24 Oct, 2020

1 commit

  • Pull more SCSI updates from James Bottomley:
    "The set of core changes here is Christoph's submission path cleanups.

    These introduced a couple of regressions when first proposed so they
    got held over from the initial merge window pull request to give more
    testing time, which they've now had and Syzbot has confirmed the
    regression it detected is fixed.

    The other main changes are two driver updates (arcmsr, pm80xx) and
    assorted minor clean ups"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (38 commits)
    scsi: qla2xxx: Fix return of uninitialized value in rval
    scsi: core: Set sc_data_direction to DMA_NONE for no-transfer commands
    scsi: sr: Initialize ->cmd_len
    scsi: arcmsr: Update driver version to v1.50.00.02-20200819
    scsi: arcmsr: Add support for ARC-1886 series RAID controllers
    scsi: arcmsr: Fix device hot-plug monitoring timer stop
    scsi: arcmsr: Remove unnecessary syntax
    scsi: pm80xx: Driver version update
    scsi: pm80xx: Increase the number of outstanding I/O supported to 1024
    scsi: pm80xx: Remove DMA memory allocation for ccb and device structures
    scsi: pm80xx: Increase number of supported queues
    scsi: sym53c8xx_2: Fix sizeof() mismatch
    scsi: isci: Fix a typo in a comment
    scsi: qla4xxx: Fix inconsistent format argument type
    scsi: myrb: Fix inconsistent format argument types
    scsi: myrb: Remove redundant assignment to variable timeout
    scsi: bfa: Fix error return in bfad_pci_init()
    scsi: fcoe: Simplify the return expression of fcoe_sysfs_setup()
    scsi: snic: Simplify the return expression of svnic_cq_alloc()
    scsi: fnic: Simplify the return expression of vnic_wq_copy_alloc()
    ...

    Linus Torvalds
     

15 Oct, 2020

1 commit

  • Pull SCSI updates from James Bottomley:
    "The usual driver updates (ufs, qla2xxx, tcmu, ibmvfc, lpfc, smartpqi,
    hisi_sas, qedi, qedf, mpt3sas) and minor bug fixes.

    There are only three core changes: adding sense codes, cleaning up
    noretry and adding an option for limitless retries"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (226 commits)
    scsi: hisi_sas: Recover PHY state according to the status before reset
    scsi: hisi_sas: Filter out new PHY up events during suspend
    scsi: hisi_sas: Add device link between SCSI devices and hisi_hba
    scsi: hisi_sas: Add check for methods _PS0 and _PR0
    scsi: hisi_sas: Add controller runtime PM support for v3 hw
    scsi: hisi_sas: Switch to new framework to support suspend and resume
    scsi: hisi_sas: Use hisi_hba->cq_nvecs for calling calling synchronize_irq()
    scsi: qedf: Remove redundant assignment to variable 'rc'
    scsi: lpfc: Remove unneeded variable 'status' in lpfc_fcp_cpu_map_store()
    scsi: snic: Convert to use DEFINE_SEQ_ATTRIBUTE macro
    scsi: qla4xxx: Delete unneeded variable 'status' in qla4xxx_process_ddb_changed
    scsi: sun_esp: Use module_platform_driver to simplify the code
    scsi: sun3x_esp: Use module_platform_driver to simplify the code
    scsi: sni_53c710: Use module_platform_driver to simplify the code
    scsi: qlogicpti: Use module_platform_driver to simplify the code
    scsi: mac_esp: Use module_platform_driver to simplify the code
    scsi: jazz_esp: Use module_platform_driver to simplify the code
    scsi: mvumi: Fix error return in mvumi_io_attach()
    scsi: lpfc: Drop nodelist reference on error in lpfc_gen_req()
    scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()
    ...

    Linus Torvalds
     

08 Oct, 2020

1 commit

  • An incorrect sizeof() is being used, struct sym_ccb ** is not correct, it
    should be struct sym_ccb *. Note that since ** is the same size as * this
    is not causing any issues. Improve this fix by using the idiom
    sizeof(*np->ccbh) as this allows one to not even reference the type of the
    pointer.

    [ Note: this is an ancient 2005 buglet, the sha is from the
    tglx/history repo ]

    Link: https://lore.kernel.org/r/20201006110252.536641-1-colin.king@canonical.com
    Fixes: 473c67f96e06 ("[PATCH] sym2 version 2.2.0")
    Signed-off-by: Colin Ian King
    Signed-off-by: Martin K. Petersen
    Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")

    Colin Ian King
     

16 Sep, 2020

2 commits

  • If (x_status & XE_PARITY_ERR) is true we set cam_status = DID_PARITY,
    othervise cam_status always ends up being DID_ERROR. Delete superfluous
    else-if statements.

    Link: https://lore.kernel.org/r/20200902061646.576966-1-yebin10@huawei.com
    Signed-off-by: Ye Bin
    Signed-off-by: Martin K. Petersen

    Ye Bin
     
  • This addresses the following coccinelle warning:

    drivers/scsi/sym53c8xx_2/sym_fw.c:372:3-4: Unneeded semicolon
    drivers/scsi/sym53c8xx_2/sym_fw.c:480:3-4: Unneeded semicolon
    drivers/scsi/sym53c8xx_2/sym_fw.c:536:2-3: Unneeded semicolon

    Link: https://lore.kernel.org/r/20200911091031.2937834-1-yanaijie@huawei.com
    Reported-by: Hulk Robot
    Signed-off-by: Jason Yan
    Signed-off-by: Martin K. Petersen

    Jason Yan
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

08 Aug, 2020

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "Enumeration:
    - Fix pci_cfg_wait queue locking problem (Bjorn Helgaas)
    - Convert PCIe capability PCIBIOS errors to errno (Bolarinwa Olayemi
    Saheed)
    - Align PCIe capability and PCI accessor return values (Bolarinwa
    Olayemi Saheed)
    - Fix pci_create_slot() reference count leak (Qiushi Wu)
    - Announce device after early fixups (Tiezhu Yang)

    PCI device hotplug:
    - Make rpadlpar functions static (Wei Yongjun)

    Driver binding:
    - Add device even if driver attach failed (Rajat Jain)

    Virtualization:
    - xen: Remove redundant initialization of irq (Colin Ian King)

    IOMMU:
    - Add pci_pri_supported() to check device or associated PF (Ashok Raj)
    - Release IVRS table in AMD ACS quirk (Hanjun Guo)
    - Mark AMD Navi10 GPU rev 0x00 ATS as broken (Kai-Heng Feng)
    - Treat "external-facing" devices themselves as internal (Rajat Jain)

    MSI:
    - Forward MSI-X error code in pci_alloc_irq_vectors_affinity() (Piotr
    Stankiewicz)

    Error handling:
    - Clear PCIe Device Status errors only if OS owns AER (Jonathan
    Cameron)
    - Log correctable errors as warning, not error (Matt Jolly)
    - Use 'pci_channel_state_t' instead of 'enum pci_channel_state' (Luc
    Van Oostenryck)

    Peer-to-peer DMA:
    - Allow P2PDMA on AMD Zen and newer CPUs (Logan Gunthorpe)

    ASPM:
    - Add missing newline in sysfs 'policy' (Xiongfeng Wang)

    Native PCIe controllers:
    - Convert to devm_platform_ioremap_resource_byname() (Dejin Zheng)
    - Convert to devm_platform_ioremap_resource() (Dejin Zheng)
    - Remove duplicate error message from devm_pci_remap_cfg_resource()
    callers (Dejin Zheng)
    - Fix runtime PM imbalance on error (Dinghao Liu)
    - Remove dev_err() when handing an error from platform_get_irq()
    (Krzysztof Wilczyński)
    - Use pci_host_bridge.windows list directly instead of splicing in a
    temporary list for cadence, mvebu, host-common (Rob Herring)
    - Use pci_host_probe() instead of open-coding all the pieces for
    altera, brcmstb, iproc, mobiveil, rcar, rockchip, tegra, v3,
    versatile, xgene, xilinx, xilinx-nwl (Rob Herring)
    - Default host bridge parent device to the platform device (Rob
    Herring)
    - Use pci_is_root_bus() instead of tracking root bus number
    separately in aardvark, designware (imx6, keystone,
    designware-host), mobiveil, xilinx-nwl, xilinx, rockchip, rcar (Rob
    Herring)
    - Set host bridge bus number in pci_scan_root_bus_bridge() instead of
    each driver for aardvark, designware-host, host-common, mediatek,
    rcar, tegra, v3-semi (Rob Herring)
    - Move DT resource setup into devm_pci_alloc_host_bridge() (Rob
    Herring)
    - Set bridge map_irq and swizzle_irq to default functions; drivers
    that don't support legacy IRQs (iproc) need to undo this (Rob
    Herring)

    ARM Versatile PCIe controller driver:
    - Drop flag PCI_ENABLE_PROC_DOMAINS (Rob Herring)

    Cadence PCIe controller driver:
    - Use "dma-ranges" instead of "cdns,no-bar-match-nbits" property
    (Kishon Vijay Abraham I)
    - Remove "mem" from reg binding (Kishon Vijay Abraham I)
    - Fix cdns_pcie_{host|ep}_setup() error path (Kishon Vijay Abraham I)
    - Convert all r/w accessors to perform only 32-bit accesses (Kishon
    Vijay Abraham I)
    - Add support to start link and verify link status (Kishon Vijay
    Abraham I)
    - Allow pci_host_bridge to have custom pci_ops (Kishon Vijay Abraham I)
    - Add new *ops* for CPU addr fixup (Kishon Vijay Abraham I)
    - Fix updating Vendor ID and Subsystem Vendor ID register (Kishon
    Vijay Abraham I)
    - Use bridge resources for outbound window setup (Rob Herring)
    - Remove private bus number and range storage (Rob Herring)

    Cadence PCIe endpoint driver:
    - Add MSI-X support (Alan Douglas)

    HiSilicon PCIe controller driver:
    - Remove non-ECAM HiSilicon hip05/hip06 driver (Rob Herring)

    Intel VMD host bridge driver:
    - Use Shadow MEMBAR registers for QEMU/KVM guests (Jon Derrick)

    Loongson PCIe controller driver:
    - Use DECLARE_PCI_FIXUP_EARLY for bridge_class_quirk() (Tiezhu Yang)

    Marvell Aardvark PCIe controller driver:
    - Indicate error in 'val' when config read fails (Pali Rohár)
    - Don't touch PCIe registers if no card connected (Pali Rohár)

    Marvell MVEBU PCIe controller driver:
    - Setup BAR0 in order to fix MSI (Shmuel Hazan)

    Microsoft Hyper-V host bridge driver:
    - Fix a timing issue which causes kdump to fail occasionally (Wei Hu)
    - Make some functions static (Wei Yongjun)

    NVIDIA Tegra PCIe controller driver:
    - Revert tegra124 raw_violation_fixup (Nicolas Chauvet)
    - Remove PLL power supplies (Thierry Reding)

    Qualcomm PCIe controller driver:
    - Change duplicate PCI reset to phy reset (Abhishek Sahu)
    - Add missing ipq806x clocks in PCIe driver (Ansuel Smith)
    - Add missing reset for ipq806x (Ansuel Smith)
    - Add ext reset (Ansuel Smith)
    - Use bulk clk API and assert on error (Ansuel Smith)
    - Add support for tx term offset for rev 2.1.0 (Ansuel Smith)
    - Define some PARF params needed for ipq8064 SoC (Ansuel Smith)
    - Add ipq8064 rev2 variant (Ansuel Smith)
    - Support PCI speed set for ipq806x (Sham Muthayyan)

    Renesas R-Car PCIe controller driver:
    - Use devm_pci_alloc_host_bridge() (Rob Herring)
    - Use struct pci_host_bridge.windows list directly (Rob Herring)
    - Convert rcar-gen2 to use modern host bridge probe functions (Rob
    Herring)

    TI J721E PCIe driver:
    - Add TI J721E PCIe host and endpoint driver (Kishon Vijay Abraham I)

    Xilinx Versal CPM PCIe controller driver:
    - Add Versal CPM Root Port driver and YAML schema (Bharat Kumar
    Gogada)

    MicroSemi Switchtec management driver:
    - Add missing __iomem and __user tags to fix sparse warnings (Logan
    Gunthorpe)

    Miscellaneous:
    - Replace http:// links with https:// (Alexander A. Klimov)
    - Replace lkml.org, spinics, gmane with lore.kernel.org (Bjorn
    Helgaas)
    - Remove unused pci_lost_interrupt() (Heiner Kallweit)
    - Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h (Huacai Chen)
    - Fix kerneldoc warnings (Krzysztof Kozlowski)"

    * tag 'pci-v5.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (113 commits)
    PCI: Fix kerneldoc warnings
    PCI: xilinx-cpm: Add Versal CPM Root Port driver
    PCI: xilinx-cpm: Add YAML schemas for Versal CPM Root Port
    PCI: Set bridge map_irq and swizzle_irq to default functions
    PCI: Move DT resource setup into devm_pci_alloc_host_bridge()
    PCI: rcar-gen2: Convert to use modern host bridge probe functions
    PCI: Remove dev_err() when handing an error from platform_get_irq()
    MAINTAINERS: Add Kishon Vijay Abraham I for TI J721E SoC PCIe
    misc: pci_endpoint_test: Add J721E in pci_device_id table
    PCI: j721e: Add TI J721E PCIe driver
    PCI: switchtec: Add missing __iomem tag to fix sparse warnings
    PCI: switchtec: Add missing __iomem and __user tags to fix sparse warnings
    PCI: rpadlpar: Make functions static
    PCI/P2PDMA: Allow P2PDMA on AMD Zen and newer CPUs
    PCI: Release IVRS table in AMD ACS quirk
    PCI: Announce device after early fixups
    PCI: Mark AMD Navi10 GPU rev 0x00 ATS as broken
    PCI: Remove unused pci_lost_interrupt()
    dt-bindings: PCI: Add EP mode dt-bindings for TI's J721E SoC
    dt-bindings: PCI: Add host mode dt-bindings for TI's J721E SoC
    ...

    Linus Torvalds
     

25 Jul, 2020

2 commits

  • Only declare 'tp' and 'lp' if they are going to be used.

    Fixes the following W=1 kernel build warning(s):

    drivers/scsi/sym53c8xx_2/sym_hipd.c: In function ‘sym_complete_error’:
    drivers/scsi/sym53c8xx_2/sym_hipd.c:5356:18: warning: variable ‘lp’ set but not used [-Wunused-but-set-variable]
    drivers/scsi/sym53c8xx_2/sym_hipd.c: In function ‘sym_complete_ok’:
    drivers/scsi/sym53c8xx_2/sym_hipd.c:5485:18: warning: variable ‘lp’ set but not used [-Wunused-but-set-variable]

    Link: https://lore.kernel.org/r/20200721164148.2617584-39-lee.jones@linaro.org
    Cc: Matthew Wilcox
    Cc: Gerard Roudier
    Cc: Wolfgang Stanglmeier
    Cc: Stefan Esser
    Cc: Richard Waltham
    Signed-off-by: Lee Jones
    Signed-off-by: Martin K. Petersen

    Lee Jones
     
  • Fixes the following W=1 kernel build warning(s):

    drivers/scsi/sym53c8xx_2/sym_glue.c:1784: warning: Function parameter or member 'pdev' not described in 'sym2_reset_workarounds'

    Link: https://lore.kernel.org/r/20200721164148.2617584-38-lee.jones@linaro.org
    Cc: Matthew Wilcox
    Cc: Gerard Roudier
    Cc: Wolfgang Stanglmeier
    Cc: Stefan Esser
    Cc: Richard Waltham
    Signed-off-by: Lee Jones
    Signed-off-by: Martin K. Petersen

    Lee Jones
     

08 Jul, 2020

1 commit

  • The method struct pci_error_handlers.error_detected() is defined and
    documented as taking an 'enum pci_channel_state' for the second argument,
    but most drivers use 'pci_channel_state_t' instead.

    This 'pci_channel_state_t' is not a typedef for the enum but a typedef for
    a bitwise type in order to have better/stricter typechecking.

    Consolidate everything by using 'pci_channel_state_t' in the method's
    definition, in the related helpers and in the drivers.

    Enforce use of 'pci_channel_state_t' by replacing 'enum pci_channel_state'
    with an anonymous 'enum'.

    Note: Currently, from a typechecking point of view this patch changes
    nothing because only the constants defined by the enum are bitwise, not the
    enum itself (sparse doesn't have the notion of 'bitwise enum'). This may
    change in some not too far future, hence the patch.

    [bhelgaas: squash in
    https://lore.kernel.org/r/20200702162651.49526-3-luc.vanoostenryck@gmail.com
    https://lore.kernel.org/r/20200702162651.49526-4-luc.vanoostenryck@gmail.com]
    Link: https://lore.kernel.org/r/20200702162651.49526-2-luc.vanoostenryck@gmail.com
    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: Bjorn Helgaas

    Luc Van Oostenryck
     

20 Dec, 2019

1 commit


13 Aug, 2019

1 commit


31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    59 temple place suite 330 boston ma 02111 1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1334 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


09 Apr, 2019

2 commits


19 Dec, 2018

1 commit

  • Most SCSI drivers want to enable "clustering", that is merging of
    segments so that they might span more than a single page. Remove the
    ENABLE_CLUSTERING define, and require drivers to explicitly set
    DISABLE_CLUSTERING to disable this feature.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Christoph Hellwig
     

16 Nov, 2018

1 commit


12 Sep, 2018

1 commit


03 Aug, 2018

1 commit

  • Variables scriptb0 and dp_sgmin are being assigned but are never used
    hence they are redundant and can be removed.

    Cleans up clang warnings:
    warning: variable 'scriptb0' set but not used [-Wunused-but-set-variable]
    warning: variable 'dp_sgmin' set but not used [-Wunused-but-set-variable]

    Signed-off-by: Colin Ian King
    Signed-off-by: Martin K. Petersen

    Colin Ian King
     

27 Jun, 2018

1 commit

  • Some drivers are ADDing the scsi command's result bytes instead of ORing
    them.

    While this can produce correct results it has unexpected side effects.

    Signed-off-by: Johannes Thumshirn
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Johannes Thumshirn
     

26 Mar, 2018

1 commit

  • Some functions definitions have either the initial open brace and/or
    the closing brace outside of column 1.

    Move those braces to column 1.

    This allows various function analyzers like gnu complexity to work
    properly for these modified functions.

    Signed-off-by: Joe Perches
    Acked-by: Andy Shevchenko
    Acked-by: Paul Moore
    Acked-by: Alex Deucher
    Acked-by: Dave Chinner
    Reviewed-by: Darrick J. Wong
    Acked-by: Alexandre Belloni
    Acked-by: Martin K. Petersen
    Acked-by: Takashi Iwai
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Rafael J. Wysocki
    Acked-by: Nicolin Chen
    Acked-by: Martin K. Petersen
    Acked-by: Steven Rostedt (VMware)
    Signed-off-by: Jiri Kosina

    Joe Perches
     

31 Jan, 2018

1 commit


22 Nov, 2017

2 commits

  • This converts all remaining setup_timer() calls that use a nested field
    to reach a struct timer_list. Coccinelle does not have an easy way to
    match multiple fields, so a new script is needed to change the matches of
    "&_E->_timer" into "&_E->_field1._timer" in all the rules.

    spatch --very-quiet --all-includes --include-headers \
    -I ./arch/x86/include -I ./arch/x86/include/generated \
    -I ./include -I ./arch/x86/include/uapi \
    -I ./arch/x86/include/generated/uapi -I ./include/uapi \
    -I ./include/generated/uapi --include ./include/linux/kconfig.h \
    --dir . \
    --cocci-file ~/src/data/timer_setup-2fields.cocci

    @fix_address_of depends@
    expression e;
    @@

    setup_timer(
    -&(e)
    +&e
    , ...)

    // Update any raw setup_timer() usages that have a NULL callback, but
    // would otherwise match change_timer_function_usage, since the latter
    // will update all function assignments done in the face of a NULL
    // function initialization in setup_timer().
    @change_timer_function_usage_NULL@
    expression _E;
    identifier _field1;
    identifier _timer;
    type _cast_data;
    @@

    (
    -setup_timer(&_E->_field1._timer, NULL, _E);
    +timer_setup(&_E->_field1._timer, NULL, 0);
    |
    -setup_timer(&_E->_field1._timer, NULL, (_cast_data)_E);
    +timer_setup(&_E->_field1._timer, NULL, 0);
    |
    -setup_timer(&_E._field1._timer, NULL, &_E);
    +timer_setup(&_E._field1._timer, NULL, 0);
    |
    -setup_timer(&_E._field1._timer, NULL, (_cast_data)&_E);
    +timer_setup(&_E._field1._timer, NULL, 0);
    )

    @change_timer_function_usage@
    expression _E;
    identifier _field1;
    identifier _timer;
    struct timer_list _stl;
    identifier _callback;
    type _cast_func, _cast_data;
    @@

    (
    -setup_timer(&_E->_field1._timer, _callback, _E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, &_callback, _E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, _callback, (_cast_data)_E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, &_callback, (_cast_data)_E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, (_cast_func)_callback, _E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, (_cast_func)&_callback, _E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, (_cast_func)_callback, (_cast_data)_E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, (_cast_func)&_callback, (_cast_data)_E);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, _callback, (_cast_data)_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, _callback, (_cast_data)&_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, &_callback, (_cast_data)_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, &_callback, (_cast_data)&_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, (_cast_func)_callback, (_cast_data)_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, (_cast_func)_callback, (_cast_data)&_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, (_cast_func)&_callback, (_cast_data)_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, (_cast_func)&_callback, (_cast_data)&_E);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    _E->_field1._timer@_stl.function = _callback;
    |
    _E->_field1._timer@_stl.function = &_callback;
    |
    _E->_field1._timer@_stl.function = (_cast_func)_callback;
    |
    _E->_field1._timer@_stl.function = (_cast_func)&_callback;
    |
    _E._field1._timer@_stl.function = _callback;
    |
    _E._field1._timer@_stl.function = &_callback;
    |
    _E._field1._timer@_stl.function = (_cast_func)_callback;
    |
    _E._field1._timer@_stl.function = (_cast_func)&_callback;
    )

    // callback(unsigned long arg)
    @change_callback_handle_cast
    depends on change_timer_function_usage@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._field1;
    identifier change_timer_function_usage._timer;
    type _origtype;
    identifier _origarg;
    type _handletype;
    identifier _handle;
    @@

    void _callback(
    -_origtype _origarg
    +struct timer_list *t
    )
    {
    (
    ... when != _origarg
    _handletype *_handle =
    -(_handletype *)_origarg;
    +from_timer(_handle, t, _field1._timer);
    ... when != _origarg
    |
    ... when != _origarg
    _handletype *_handle =
    -(void *)_origarg;
    +from_timer(_handle, t, _field1._timer);
    ... when != _origarg
    |
    ... when != _origarg
    _handletype *_handle;
    ... when != _handle
    _handle =
    -(_handletype *)_origarg;
    +from_timer(_handle, t, _field1._timer);
    ... when != _origarg
    |
    ... when != _origarg
    _handletype *_handle;
    ... when != _handle
    _handle =
    -(void *)_origarg;
    +from_timer(_handle, t, _field1._timer);
    ... when != _origarg
    )
    }

    // callback(unsigned long arg) without existing variable
    @change_callback_handle_cast_no_arg
    depends on change_timer_function_usage &&
    !change_callback_handle_cast@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._field1;
    identifier change_timer_function_usage._timer;
    type _origtype;
    identifier _origarg;
    type _handletype;
    @@

    void _callback(
    -_origtype _origarg
    +struct timer_list *t
    )
    {
    + _handletype *_origarg = from_timer(_origarg, t, _field1._timer);
    +
    ... when != _origarg
    - (_handletype *)_origarg
    + _origarg
    ... when != _origarg
    }

    // Avoid already converted callbacks.
    @match_callback_converted
    depends on change_timer_function_usage &&
    !change_callback_handle_cast &&
    !change_callback_handle_cast_no_arg@
    identifier change_timer_function_usage._callback;
    identifier t;
    @@

    void _callback(struct timer_list *t)
    { ... }

    // callback(struct something *handle)
    @change_callback_handle_arg
    depends on change_timer_function_usage &&
    !match_callback_converted &&
    !change_callback_handle_cast &&
    !change_callback_handle_cast_no_arg@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._field1;
    identifier change_timer_function_usage._timer;
    type _handletype;
    identifier _handle;
    @@

    void _callback(
    -_handletype *_handle
    +struct timer_list *t
    )
    {
    + _handletype *_handle = from_timer(_handle, t, _field1._timer);
    ...
    }

    // If change_callback_handle_arg ran on an empty function, remove
    // the added handler.
    @unchange_callback_handle_arg
    depends on change_timer_function_usage &&
    change_callback_handle_arg@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._field1;
    identifier change_timer_function_usage._timer;
    type _handletype;
    identifier _handle;
    identifier t;
    @@

    void _callback(struct timer_list *t)
    {
    - _handletype *_handle = from_timer(_handle, t, _field1._timer);
    }

    // We only want to refactor the setup_timer() data argument if we've found
    // the matching callback. This undoes changes in change_timer_function_usage.
    @unchange_timer_function_usage
    depends on change_timer_function_usage &&
    !change_callback_handle_cast &&
    !change_callback_handle_cast_no_arg &&
    !change_callback_handle_arg@
    expression change_timer_function_usage._E;
    identifier change_timer_function_usage._field1;
    identifier change_timer_function_usage._timer;
    identifier change_timer_function_usage._callback;
    type change_timer_function_usage._cast_data;
    @@

    (
    -timer_setup(&_E->_field1._timer, _callback, 0);
    +setup_timer(&_E->_field1._timer, _callback, (_cast_data)_E);
    |
    -timer_setup(&_E._field1._timer, _callback, 0);
    +setup_timer(&_E._field1._timer, _callback, (_cast_data)&_E);
    )

    // If we fixed a callback from a .function assignment, fix the
    // assignment cast now.
    @change_timer_function_assignment
    depends on change_timer_function_usage &&
    (change_callback_handle_cast ||
    change_callback_handle_cast_no_arg ||
    change_callback_handle_arg)@
    expression change_timer_function_usage._E;
    identifier change_timer_function_usage._field1;
    identifier change_timer_function_usage._timer;
    identifier change_timer_function_usage._callback;
    type _cast_func;
    typedef TIMER_FUNC_TYPE;
    @@

    (
    _E->_field1._timer.function =
    -_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E->_field1._timer.function =
    -&_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E->_field1._timer.function =
    -(_cast_func)_callback;
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E->_field1._timer.function =
    -(_cast_func)&_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._field1._timer.function =
    -_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._field1._timer.function =
    -&_callback;
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._field1._timer.function =
    -(_cast_func)_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._field1._timer.function =
    -(_cast_func)&_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    )

    // Sometimes timer functions are called directly. Replace matched args.
    @change_timer_function_calls
    depends on change_timer_function_usage &&
    (change_callback_handle_cast ||
    change_callback_handle_cast_no_arg ||
    change_callback_handle_arg)@
    expression _E;
    identifier change_timer_function_usage._field1;
    identifier change_timer_function_usage._timer;
    identifier change_timer_function_usage._callback;
    type _cast_data;
    @@

    _callback(
    (
    -(_cast_data)_E
    +&_E->_field1._timer
    |
    -(_cast_data)&_E
    +&_E._field1._timer
    |
    -_E
    +&_E->_field1._timer
    )
    )

    // If a timer has been configured without a data argument, it can be
    // converted without regard to the callback argument, since it is unused.
    @match_timer_function_unused_data@
    expression _E;
    identifier _field1;
    identifier _timer;
    identifier _callback;
    @@

    (
    -setup_timer(&_E->_field1._timer, _callback, 0);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, _callback, 0L);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E->_field1._timer, _callback, 0UL);
    +timer_setup(&_E->_field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, _callback, 0);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, _callback, 0L);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_E._field1._timer, _callback, 0UL);
    +timer_setup(&_E._field1._timer, _callback, 0);
    |
    -setup_timer(&_field1._timer, _callback, 0);
    +timer_setup(&_field1._timer, _callback, 0);
    |
    -setup_timer(&_field1._timer, _callback, 0L);
    +timer_setup(&_field1._timer, _callback, 0);
    |
    -setup_timer(&_field1._timer, _callback, 0UL);
    +timer_setup(&_field1._timer, _callback, 0);
    |
    -setup_timer(_field1._timer, _callback, 0);
    +timer_setup(_field1._timer, _callback, 0);
    |
    -setup_timer(_field1._timer, _callback, 0L);
    +timer_setup(_field1._timer, _callback, 0);
    |
    -setup_timer(_field1._timer, _callback, 0UL);
    +timer_setup(_field1._timer, _callback, 0);
    )

    @change_callback_unused_data
    depends on match_timer_function_unused_data@
    identifier match_timer_function_unused_data._callback;
    type _origtype;
    identifier _origarg;
    @@

    void _callback(
    -_origtype _origarg
    +struct timer_list *unused
    )
    {
    ... when != _origarg
    }

    Signed-off-by: Kees Cook

    Kees Cook
     
  • This mechanically converts all remaining cases of ancient open-coded timer
    setup with the old setup_timer() API, which is the first step in timer
    conversions. This has no behavioral changes, since it ultimately just
    changes the order of assignment to fields of struct timer_list when
    finding variations of:

    init_timer(&t);
    f.function = timer_callback;
    t.data = timer_callback_arg;

    to be converted into:

    setup_timer(&t, timer_callback, timer_callback_arg);

    The conversion is done with the following Coccinelle script, which
    is an improved version of scripts/cocci/api/setup_timer.cocci, in the
    following ways:
    - assignments-before-init_timer() cases
    - limit the .data case removal to the specific struct timer_list instance
    - handling calls by dereference (timer->field vs timer.field)

    spatch --very-quiet --all-includes --include-headers \
    -I ./arch/x86/include -I ./arch/x86/include/generated \
    -I ./include -I ./arch/x86/include/uapi \
    -I ./arch/x86/include/generated/uapi -I ./include/uapi \
    -I ./include/generated/uapi --include ./include/linux/kconfig.h \
    --dir . \
    --cocci-file ~/src/data/setup_timer.cocci

    @fix_address_of@
    expression e;
    @@

    init_timer(
    -&(e)
    +&e
    , ...)

    // Match the common cases first to avoid Coccinelle parsing loops with
    // "... when" clauses.

    @match_immediate_function_data_after_init_timer@
    expression e, func, da;
    @@

    -init_timer
    +setup_timer
    ( \(&e\|e\)
    +, func, da
    );
    (
    -\(e.function\|e->function\) = func;
    -\(e.data\|e->data\) = da;
    |
    -\(e.data\|e->data\) = da;
    -\(e.function\|e->function\) = func;
    )

    @match_immediate_function_data_before_init_timer@
    expression e, func, da;
    @@

    (
    -\(e.function\|e->function\) = func;
    -\(e.data\|e->data\) = da;
    |
    -\(e.data\|e->data\) = da;
    -\(e.function\|e->function\) = func;
    )
    -init_timer
    +setup_timer
    ( \(&e\|e\)
    +, func, da
    );

    @match_function_and_data_after_init_timer@
    expression e, e2, e3, e4, e5, func, da;
    @@

    -init_timer
    +setup_timer
    ( \(&e\|e\)
    +, func, da
    );
    ... when != func = e2
    when != da = e3
    (
    -e.function = func;
    ... when != da = e4
    -e.data = da;
    |
    -e->function = func;
    ... when != da = e4
    -e->data = da;
    |
    -e.data = da;
    ... when != func = e5
    -e.function = func;
    |
    -e->data = da;
    ... when != func = e5
    -e->function = func;
    )

    @match_function_and_data_before_init_timer@
    expression e, e2, e3, e4, e5, func, da;
    @@
    (
    -e.function = func;
    ... when != da = e4
    -e.data = da;
    |
    -e->function = func;
    ... when != da = e4
    -e->data = da;
    |
    -e.data = da;
    ... when != func = e5
    -e.function = func;
    |
    -e->data = da;
    ... when != func = e5
    -e->function = func;
    )
    ... when != func = e2
    when != da = e3
    -init_timer
    +setup_timer
    ( \(&e\|e\)
    +, func, da
    );

    @r1 exists@
    expression t;
    identifier f;
    position p;
    @@

    f(...) { ... when any
    init_timer@p(\(&t\|t\))
    ... when any
    }

    @r2 exists@
    expression r1.t;
    identifier g != r1.f;
    expression e8;
    @@

    g(...) { ... when any
    \(t.data\|t->data\) = e8
    ... when any
    }

    // It is dangerous to use setup_timer if data field is initialized
    // in another function.
    @script:python depends on r2@
    p << r1.p;
    @@

    cocci.include_match(False)

    @r3@
    expression r1.t, func, e7;
    position r1.p;
    @@

    (
    -init_timer@p(&t);
    +setup_timer(&t, func, 0UL);
    ... when != func = e7
    -t.function = func;
    |
    -t.function = func;
    ... when != func = e7
    -init_timer@p(&t);
    +setup_timer(&t, func, 0UL);
    |
    -init_timer@p(t);
    +setup_timer(t, func, 0UL);
    ... when != func = e7
    -t->function = func;
    |
    -t->function = func;
    ... when != func = e7
    -init_timer@p(t);
    +setup_timer(t, func, 0UL);
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

09 Sep, 2017

1 commit

  • memset32() can be used to initialise these three arrays. Minor code
    footprint reduction.

    Link: http://lkml.kernel.org/r/20170720184539.31609-8-willy@infradead.org
    Signed-off-by: Matthew Wilcox
    Cc: "James E.J. Bottomley"
    Cc: "Martin K. Petersen"
    Cc: "H. Peter Anvin"
    Cc: David Miller
    Cc: Ingo Molnar
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Minchan Kim
    Cc: Ralf Baechle
    Cc: Richard Henderson
    Cc: Russell King
    Cc: Sam Ravnborg
    Cc: Sergey Senozhatsky
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     

25 Aug, 2017

1 commit

  • On parisc I see this UBSAN warning with a sym53c896:

    UBSAN: Undefined behaviour in ./drivers/scsi/sym53c8xx_2/sym_hipd.c:762:24
    index -1903078336 is out of range for type 'u32 [7]'

    Avoid this warning by switching to div64_ul().

    [mkp: fix typo]

    Signed-off-by: Helge Deller
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Helge Deller
     

15 Sep, 2016

1 commit

  • There is only one waiter for the completion, therefore there is no need
    to use complete_all(). Let's make that clear by using complete() instead
    of complete_all().

    The usage pattern of the completion is:

    waiter context waker context

    sym_eh_handler()
    struct completion eh_done
    init_completion(eh_done)
    pci_channel_offline()
    wait_for_completion_timeout(eh_done)

    sym2_io_resume()
    complete(eh_done)

    Signed-off-by: Daniel Wagner
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Daniel Wagner
     

24 Nov, 2014

1 commit

  • Drop the now unused reason argument from the ->change_queue_depth method.
    Also add a return value to scsi_adjust_queue_depth, and rename it to
    scsi_change_queue_depth now that it can be used as the default
    ->change_queue_depth implementation.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke

    Christoph Hellwig
     

12 Nov, 2014

1 commit

  • Remove the tagged argument from scsi_adjust_queue_depth, and just let it
    handle the queue depth. For most drivers those two are fairly separate,
    given that most modern drivers don't care about the SCSI "tagged" status
    of a command at all, and many old drivers allow queuing of multiple
    untagged commands in the driver.

    Instead we start out with the ->simple_tags flag set before calling
    ->slave_configure, which is how all drivers actually looking at
    ->simple_tags except for one worke anyway. The one other case looks
    broken, but I've kept the behavior as-is for now.

    Except for that we only change ->simple_tags from the ->change_queue_type,
    and when rejecting a tag message in a single driver, so keeping this
    churn out of scsi_adjust_queue_depth is a clear win.

    Now that the usage of scsi_adjust_queue_depth is more obvious we can
    also remove all the trivial instances in ->slave_alloc or ->slave_configure
    that just set it to the cmd_per_lun default.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Martin K. Petersen

    Christoph Hellwig
     

18 Jul, 2014

1 commit

  • The SCSI standard defines 64-bit values for LUNs, and large arrays
    employing large or hierarchical LUN numbers become more and more
    common.

    So update the linux SCSI stack to use 64-bit LUN numbers.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Ewan Milne
    Signed-off-by: Christoph Hellwig

    Hannes Reinecke
     

13 Apr, 2014

1 commit

  • This patch fixes I/O errors with the sym53c8xx_2 driver when the disk
    returns QUEUE FULL status.

    When the controller encounters an error (including QUEUE FULL or BUSY
    status), it aborts all not yet submitted requests in the function
    sym_dequeue_from_squeue.

    This function aborts them with DID_SOFT_ERROR.

    If the disk has full tag queue, the request that caused the overflow is
    aborted with QUEUE FULL status (and the scsi midlayer properly retries
    it until it is accepted by the disk), but the sym53c8xx_2 driver aborts
    the following requests with DID_SOFT_ERROR --- for them, the midlayer
    does just a few retries and then signals the error up to sd.

    The result is that disk returning QUEUE FULL causes request failures.

    The error was reproduced on 53c895 with COMPAQ BD03685A24 disk
    (rebranded ST336607LC) with command queue 48 or 64 tags. The disk has
    64 tags, but under some access patterns it return QUEUE FULL when there
    are less than 64 pending tags. The SCSI specification allows returning
    QUEUE FULL anytime and it is up to the host to retry.

    Signed-off-by: Mikulas Patocka
    Cc: Matthew Wilcox
    Cc: James Bottomley
    Signed-off-by: Linus Torvalds

    Mikulas Patocka
     

22 Dec, 2013

1 commit

  • These interfaces:

    pcibios_resource_to_bus(struct pci_dev *dev, *bus_region, *resource)
    pcibios_bus_to_resource(struct pci_dev *dev, *resource, *bus_region)

    took a pci_dev, but they really depend only on the pci_bus. And we want to
    use them in resource allocation paths where we have the bus but not a
    device, so this patch converts them to take the pci_bus instead of the
    pci_dev:

    pcibios_resource_to_bus(struct pci_bus *bus, *bus_region, *resource)
    pcibios_bus_to_resource(struct pci_bus *bus, *resource, *bus_region)

    In fact, with standard PCI-PCI bridges, they only depend on the host
    bridge, because that's the only place address translation occurs, but
    we aren't going that far yet.

    [bhelgaas: changelog]
    Signed-off-by: Yinghai Lu
    Signed-off-by: Bjorn Helgaas

    Yinghai Lu
     

14 Oct, 2013

1 commit


10 Apr, 2013

1 commit


04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Adam Radford
    Cc: "James E.J. Bottomley"
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

08 Sep, 2012

1 commit


11 Jan, 2012

1 commit


31 Mar, 2011

1 commit


23 Dec, 2010

1 commit