19 Jun, 2019

1 commit

  • As explained during the 2018 LSF/MM session about increasing SCSI disk
    probing concurrency, the problems with the current probing approach are as
    follows:

    - The driver core is unaware of asynchronous SCSI LUN probing.
    wait_for_device_probe() waits for all asynchronous probes except
    asynchronous SCSI disk probes.

    - There is unnecessary serialization between sd_probe() and sd_remove().
    This can lead to a deadlock.

    Hence this patch that modifies the sd driver such that it uses the driver
    core framework for asynchronous probing. The async domain and
    get_device()/put_device() pairs that became superfluous due to this change
    are removed.

    This patch does not affect the time needed for loading the scsi_debug
    kernel module with parameters delay=0 and max_luns=256.

    This patch depends on commit ef0ff68351be ("driver core: Probe devices
    asynchronously instead of the driver") that went upstream in kernel version
    v5.1-rc1.

    Cc: Lee Duncan
    Cc: Hannes Reinecke
    Cc: Luis Chamberlain
    Cc: Johannes Thumshirn
    Cc: Christoph Hellwig
    Cc: Pavel Machek
    Cc: Dan Williams
    Signed-off-by: Bart Van Assche
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

08 Nov, 2018

1 commit

  • This removes the legacy (non-mq) IO path for SCSI.

    Cc: linux-scsi@vger.kernel.org
    Acked-by: Himanshu Madhani
    Reviewed-by: Hannes Reinecke
    Tested-by: Ming Lei
    Reviewed-by: Omar Sandoval
    Acked-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Jens Axboe
     

08 Dec, 2017

2 commits


17 Nov, 2017

1 commit


15 Nov, 2017

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly updates of the usual suspects: lpfc, qla2xxx, hisi_sas,
    megaraid_sas, pm80xx, mpt3sas, be2iscsi, hpsa. and a host of minor
    updates.

    There's no major behaviour change or additions to the core in all of
    this, so the potential for regressions should be small (biggest
    potential being in the scsi error handler changes)"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (203 commits)
    scsi: lpfc: Fix hard lock up NMI in els timeout handling.
    scsi: mpt3sas: remove a stray KERN_INFO
    scsi: mpt3sas: cleanup _scsih_pcie_enumeration_event()
    scsi: aacraid: use timespec64 instead of timeval
    scsi: scsi_transport_fc: add 64GBIT and 128GBIT port speed definitions
    scsi: qla2xxx: Suppress a kernel complaint in qla_init_base_qpair()
    scsi: mpt3sas: fix dma_addr_t casts
    scsi: be2iscsi: Use kasprintf
    scsi: storvsc: Avoid excessive host scan on controller change
    scsi: lpfc: fix kzalloc-simple.cocci warnings
    scsi: mpt3sas: Update mpt3sas driver version.
    scsi: mpt3sas: Fix sparse warnings
    scsi: mpt3sas: Fix nvme drives checking for tlr.
    scsi: mpt3sas: NVMe drive support for BTDHMAPPING ioctl command and log info
    scsi: mpt3sas: Add-Task-management-debug-info-for-NVMe-drives.
    scsi: mpt3sas: scan and add nvme device after controller reset
    scsi: mpt3sas: Set NVMe device queue depth as 128
    scsi: mpt3sas: Handle NVMe PCIe device related events generated from firmware.
    scsi: mpt3sas: API's to remove nvme drive from sml
    scsi: mpt3sas: API 's to support NVMe drive addition to SML
    ...

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

26 Sep, 2017

1 commit


26 Aug, 2017

1 commit


13 Jun, 2017

2 commits

  • Just like for the scsi-mq code path, in the single queue SCSI code path
    only add commands to the per-device command list if required by the SCSI
    LLD. This patch will make it easier to merge the single-queue and
    multiqueue command initialization code.

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

    Bart Van Assche
     
  • This patch does not change any functionality.

    Signed-off-by: Bart Van Assche
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Cc: Israel Rukshin
    Cc: Max Gurtovoy
    Cc: Benjamin Block
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

05 May, 2017

1 commit

  • Pull SCSI updates from James Bottomley:
    "This update includes the usual round of major driver updates
    (hisi_sas, ufs, fnic, cxlflash, be2iscsi, ipr, stex). There's also the
    usual amount of cosmetic and spelling stuff"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (155 commits)
    scsi: qla4xxx: fix spelling mistake: "Tempalate" -> "Template"
    scsi: stex: make S6flag static
    scsi: mac_esp: fix to pass correct device identity to free_irq()
    scsi: aacraid: pci_alloc_consistent() failures on ARM64
    scsi: ufs: make ufshcd_get_lists_status() register operation obvious
    scsi: ufs: use MASK_EE_STATUS
    scsi: mac_esp: Replace bogus memory barrier with spinlock
    scsi: fcoe: make fcoe_e_d_tov and fcoe_r_a_tov static
    scsi: sd_zbc: Do not write lock zones for reset
    scsi: sd_zbc: Remove superfluous assignments
    scsi: sd: sd_zbc: Rename sd_zbc_setup_write_cmnd
    scsi: Improve scsi_get_sense_info_fld
    scsi: sd: Cleanup sd_done sense data handling
    scsi: sd: Improve sd_completed_bytes
    scsi: sd: Fix function descriptions
    scsi: mpt3sas: remove redundant wmb
    scsi: mpt: Move scsi_remove_host() out of mptscsih_remove_host()
    scsi: sg: reset 'res_in_use' after unlinking reserved array
    scsi: mvumi: remove code handling zero scsi_sg_count(scmd) case
    scsi: fusion: fix spelling mistake: "Persistancy" -> "Persistency"
    ...

    Linus Torvalds
     

07 Apr, 2017

2 commits

  • There hasn't been any reports for HBAs where asynchronous abort
    would not work, so we should make it mandatory and remove
    the fallback.

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

    Hannes Reinecke
     
  • scsi_eh_scmd_add() currently only will fail if no
    error handler thread is started (which will never be the
    case) or if the state machine encounters an illegal transition.

    But if we're encountering an invalid state transition
    chances is we cannot fixup things with the error handler.
    So better add a WARN_ON for illegal host states and
    make scsi_dh_scmd_add() a void function.

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

    Hannes Reinecke
     

02 Mar, 2017

1 commit

  • Commit 669f044170d8 ("scsi: srp_transport: Move queuecommand() wait code
    to SCSI core") can make scsi_internal_device_block() sleep. However,
    the mpt3sas driver can call this function from an interrupt
    handler. Hence add a second argument to scsi_internal_device_block()
    that restores the old behavior of this function for the mpt3sas handler.

    The call chain that triggered an "IRQ handler enabled interrupts"
    complaint is as follows:

    _base_interrupt()
    -> _base_async_event()
    -> mpt3sas_scsih_event_callback()
    -> _scsih_check_topo_delete_events()
    -> _scsih_block_io_to_children_attached_directly()
    -> _scsih_block_io_device()
    -> _scsih_internal_device_block()
    -> scsi_internal_device_block()

    Reported-by: Omar Sandoval
    Signed-off-by: Bart Van Assche
    Cc: Omar Sandoval
    Cc: Hannes Reinecke
    Cc: Sagi Grimberg
    Cc: Christoph Hellwig
    Cc: Sathya Prakash
    Cc: Chaitra P B
    Cc: Suganath Prabu Subramani
    Cc: Sreekanth Reddy
    Cc: # v4.10+
    Tested-by: Omar Sandoval
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

28 Jan, 2017

2 commits

  • Rely on the new block layer functionality to allocate additional driver
    specific data behind struct request instead of implementing it in SCSI
    itѕelf.

    Signed-off-by: Christoph Hellwig
    Acked-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • Currently blk-mq always allocates the sense buffer using normal GFP_KERNEL
    allocation. Refactor the cmd pool code to split the cmd and sense allocation
    and share the code to allocate the sense buffers as well as the sense buffer
    slab caches between the legacy and blk-mq path.

    Note that this switches to lazy allocation of the sense slab caches - the
    slab caches (not the actual allocations) won't be destroy until the scsi
    module is unloaded instead of keeping track of hosts using them.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Acked-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

08 Oct, 2016

1 commit

  • Pull SCSI updates from James Bottomley:
    "This update includes the usual round of major driver updates (hpsa,
    be2iscsi, hisi_sas, zfcp, cxlflash). There's a new incarnation of hpsa
    called smartpqi for which a driver is added, there's some cleanup work
    of the ibm vscsi target and updates to libfc, plus a whole host of
    minor fixes and updates and finally the removal of several ISA drivers
    which seem not to have been used for years"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (173 commits)
    scsi: mvsas: Mark symbols static where possible
    scsi: pm8001: Mark symbols static where possible
    scsi: arcmsr: Simplify user_len checking
    scsi: fcoe: fix off by one in eth2fc_speed()
    scsi: dtc: remove from tree
    scsi: t128: remove from tree
    scsi: pas16: remove from tree
    scsi: u14-34f: remove from tree
    scsi: ultrastor: remove from tree
    scsi: in2000: remove from tree
    scsi: wd7000: remove from tree
    scsi: scsi_dh_alua: Fix memory leak in alua_rtpg()
    scsi: lpfc: Mark symbols static where possible
    scsi: hpsa: correct call to hpsa_do_reset
    scsi: ufs: Get a TM service response from the correct offset
    scsi: ibmvfc: Fix I/O hang when port is not mapped
    scsi: megaraid_sas: clean function declarations in megaraid_sas_base.c up
    scsi: ipr: Remove redundant messages at adapter init time
    scsi: ipr: Don't log unnecessary 9084 error details
    scsi: smartpqi: raid bypass lba calculation fix
    ...

    Linus Torvalds
     

27 Sep, 2016

1 commit

  • This patch avoids that the following memory leak is triggered if
    use_blk_mq is disabled after a SCSI host has been allocated by the
    ib_srp driver and before the same SCSI host is freed:

    unreferenced object 0xffff8803a168c568 (size 256):
    backtrace:
    [] kmemleak_alloc+0x45/0xa0
    [] __kmalloc_node+0x1e4/0x400
    [] blk_mq_alloc_tag_set+0xb4/0x230
    [] scsi_mq_setup_tags+0xc7/0xd0
    [] scsi_add_host_with_dma+0x216/0x2d0
    [] srp_create_target+0xe55/0x13d0 [ib_srp]
    [] dev_attr_store+0x13/0x20
    [] sysfs_kf_write+0x40/0x50
    [] kernfs_fop_write+0x137/0x1c0
    [] __vfs_write+0x23/0x140
    [] vfs_write+0xb0/0x190
    [] SyS_write+0x44/0xa0
    [] entry_SYSCALL_64_fastpath+0x18/0xa8

    Fixes: 9aa9cc4221f5 ("scsi: remove the disable_blk_mq host flag")
    Signed-off-by: Bart Van Assche
    Cc: Christoph Hellwig
    Cc: Martin K. Petersen
    Cc:
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

31 Aug, 2016

1 commit

  • We get 2 warnings about global functions without a declaration in the
    scsi driver when building with W=1:

    drivers/scsi/scsi_lib.c:467:6: warning: no previous prototype for 'scsi_requeue_run_queue' [-Wmissing-prototypes]
    drivers/scsi/scsi_lib.c:2609:6: warning: no previous prototype for 'scsi_evt_thread' [-Wmissing-prototypes]

    In fact, both functions are declared in drivers/scsi/scsi_scan.c but
    need to move them into scsi_priv.h.

    Signed-off-by: Baoyou Xie
    Reviewed-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Baoyou Xie
     

12 Apr, 2016

1 commit

  • On larger installations it is useful to disable automatic LUN scanning,
    and only add the required LUNs via udev rules. This can speed up bootup
    dramatically.

    This patch introduces a new scan module parameter value 'manual', which
    works like 'none', but can be overridden by setting the 'rescan' value
    from scsi_scan_target to 'SCSI_SCAN_MANUAL'. And it updates all
    relevant callers to set the 'rescan' value to 'SCSI_SCAN_MANUAL' if
    invoked via the 'scan' option in sysfs.

    Signed-off-by: Hannes Reinecke
    Reviewed-by: Ewan D. Milne
    Tested-by: Laurence Oberman
    Signed-off-by: Martin K. Petersen

    Hannes Reinecke
     

03 Dec, 2015

1 commit


27 Oct, 2015

1 commit

  • The commit 1bab0de0274f ("dm-mpath, scsi_dh: don't let dm detach device
    handlers") removed reference counting of attached scsi device handler.
    As a result, handler data is freed immediately via scsi_dh->detach()
    in the context of scsi_remove_device() where activation request can be
    still in flight.

    This patch moves scsi_dh_handler_detach() to sdev releasing function,
    scsi_device_dev_release_usercontext(), at that point the device
    is already in quiesced state.

    Fixes: 1bab0de0274f ("dm-mpath, scsi_dh: don't let dm detach device handlers")
    Signed-off-by: Jun'ichi Nomura
    Acked-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Junichi Nomura
     

29 Aug, 2015

1 commit

  • Stop building scsi_dh as a separate module and integrate it fully into the
    core SCSI code with explicit callouts at bus scan time. For now the
    callouts are placed at the same point as the old bus notifiers were called,
    but in the future we will be able to look at ALUA INQUIRY data earlier on.

    Note that this also means that the device handler modules need to be loaded
    by the time we scan the bus. The next patches will add support for
    autoloading device handlers at bus scan time to make sure they are always
    loaded if they are enabled in the kernel config.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Acked-by: Mike Snitzer
    Signed-off-by: James Bottomley

    Christoph Hellwig
     

15 Dec, 2014

1 commit

  • After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
    selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
    depending on CONFIG_PM_RUNTIME may now be changed to depend on
    CONFIG_PM.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
    drivers/scsi/ and in include/scsi/scsi_device.h.

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Aaron Lu
    Acked-by: Christoph Hellwig

    Rafael J. Wysocki
     

25 Nov, 2014

2 commits


26 Jul, 2014

1 commit

  • This patch adds support for an alternate I/O path in the scsi midlayer
    which uses the blk-mq infrastructure instead of the legacy request code.

    Use of blk-mq is fully transparent to drivers, although for now a host
    template field is provided to opt out of blk-mq usage in case any unforseen
    incompatibilities arise.

    In general replacing the legacy request code with blk-mq is a simple and
    mostly mechanical transformation. The biggest exception is the new code
    that deals with the fact the I/O submissions in blk-mq must happen from
    process context, which slightly complicates the I/O completion handler.
    The second biggest differences is that blk-mq is build around the concept
    of preallocated requests that also include driver specific data, which
    in SCSI context means the scsi_cmnd structure. This completely avoids
    dynamic memory allocations for the fast path through I/O submission.

    Due the preallocated requests the MQ code path exclusively uses the
    host-wide shared tag allocator instead of a per-LUN one. This only
    affects drivers actually using the block layer provided tag allocator
    instead of their own. Unlike the old path blk-mq always provides a tag,
    although drivers don't have to use it.

    For now the blk-mq path is disable by defauly and must be enabled using
    the "use_blk_mq" module parameter. Once the remaining work in the block
    layer to make blk-mq more suitable for slow devices is complete I hope
    to make it the default and eventually even remove the old code path.

    Based on the earlier scsi-mq prototype by Nicholas Bellinger.

    Thanks to Bart Van Assche and Robert Elliot for testing, benchmarking and
    various sugestions and code contributions.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Martin K. Petersen
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Webb Scales
    Acked-by: Jens Axboe
    Tested-by: Bart Van Assche
    Tested-by: Robert Elliott

    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
     

11 Apr, 2014

1 commit

  • async_schedule() sd resume work to allow disks and other devices to
    resume in parallel.

    This moves the entirety of scsi_device resume to an async context to
    ensure that scsi_device_resume() remains ordered with respect to the
    completion of the start/stop command. For the duration of the resume,
    new command submissions (that do not originate from the scsi-core) will
    be deferred (BLKPREP_DEFER).

    It adds a new ASYNC_DOMAIN_EXCLUSIVE(scsi_sd_pm_domain) as a container
    of these operations. Like scsi_sd_probe_domain it is flushed at
    sd_remove() time to ensure async ops do not continue past the
    end-of-life of the sdev. The implementation explicitly refrains from
    reusing scsi_sd_probe_domain directly for this purpose as it is flushed
    at the end of dpm_resume(), potentially defeating some of the benefit.
    Given sdevs are quiesced it is permissible for these resume operations
    to bleed past the async_synchronize_full() calls made by the driver
    core.

    We defer the resolution of which pm callback to call until
    scsi_dev_type_{suspend|resume} time and guarantee that the callback
    parameter is never NULL. With this in place the type of resume
    operation is encoded in the async function identifier.

    There is a concern that async resume could trigger PSU overload. In the
    enterprise, storage enclosures enforce staggered spin-up regardless of
    what the kernel does making async scanning safe by default. Outside of
    that context a user can disable asynchronous scanning via a kernel
    command line or CONFIG_SCSI_SCAN_ASYNC. Honor that setting when
    deciding whether to do resume asynchronously.

    Inspired by Todd's analysis and initial proposal [2]:
    https://01.org/suspendresume/blogs/tebrandt/2013/hard-disk-resume-optimization-simpler-approach

    Cc: Len Brown
    Cc: Phillip Susi
    [alan: bug fix and clean up suggestion]
    Acked-by: Alan Stern
    Suggested-by: Todd Brandt
    [djbw: kick all resume work to the async queue]
    Signed-off-by: Dan Williams

    Dan Williams
     

19 Dec, 2013

1 commit

  • When a command runs into a timeout we need to send an 'ABORT TASK'
    TMF. This is typically done by the 'eh_abort_handler' LLDD callback.

    Conceptually, however, this function is a normal SCSI command, so
    there is no need to enter the error handler.

    This patch implements a new scsi_abort_command() function which
    invokes an asynchronous function scsi_eh_abort_handler() to
    abort the commands via the usual 'eh_abort_handler'.

    If abort succeeds the command is either retried or terminated,
    depending on the number of allowed retries. However, 'eh_eflags'
    records the abort, so if the retry would fail again the
    command is pushed onto the error handler without trying to
    abort it (again); it'll be cleared up from SCSI EH.

    [hare: smatch detected stray switch fixed]
    Signed-off-by: Hannes Reinecke
    Signed-off-by: James Bottomley

    Hannes Reinecke
     

20 Jul, 2012

4 commits

  • This is in preparation for teaching async_synchronize_full() to sync all
    pending async work, and not just on the async_running domain. This
    conversion is functionally equivalent, just embedding the existing list
    in a new async_domain type.

    The .registered attribute is used in a later patch to distinguish
    between domains that want to be flushed by async_synchronize_full()
    versus those that only expect async_synchronize_{full|cookie}_domain to
    be used for flushing.

    [jejb: add async.h to scsi_priv.h for struct async_domain]
    Signed-off-by: Dan Williams
    Acked-by: Arjan van de Ven
    Acked-by: Mark Brown
    Tested-by: Eldad Zack
    Signed-off-by: James Bottomley

    Dan Williams
     
  • The return value of scsi_queue_insert() is ignored by all its
    callers, hence change the return type of this function into
    void.

    Signed-off-by: Bart Van Assche
    Reviewed-by: Mike Christie
    Reviewed-by: Tejun Heo
    Signed-off-by: James Bottomley

    Bart Van Assche
     
  • Use blk_queue_dead() to test whether the queue is dead instead
    of !sdev. Since scsi_prep_fn() may be invoked concurrently with
    __scsi_remove_device(), keep the queuedata (sdev) pointer in
    __scsi_remove_device(). This patch fixes a kernel oops that
    can be triggered by USB device removal. See also
    http://www.spinics.net/lists/linux-scsi/msg56254.html.

    Other changes included in this patch:
    - Swap the blk_cleanup_queue() and kfree() calls in
    scsi_host_dev_release() to make that code easier to grasp.
    - Remove the queue dead check from scsi_run_queue() since the
    queue state can change anyway at any point in that function
    where the queue lock is not held.
    - Remove the queue dead check from the start of scsi_request_fn()
    since it is redundant with the scsi_device_online() check.

    Reported-by: Jun'ichi Nomura
    Signed-off-by: Bart Van Assche
    Reviewed-by: Mike Christie
    Reviewed-by: Tejun Heo
    Cc:
    Signed-off-by: James Bottomley

    Bart Van Assche
     
  • This has scsi_internal_device_unblock/scsi_target_unblock take
    the new state to set the devices as an argument instead of
    always setting to running. The patch also converts users of these
    functions.

    This allows the FC and iSCSI class to transition devices from blocked
    to transport-offline, so that when fast_io_fail/replacement_timeout
    has fired we do not set the devices back to running. Instead, we
    set them to SDEV_TRANSPORT_OFFLINE.

    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Mike Christie
     

17 May, 2012

1 commit

  • sd injects and synchronizes probe work on the global kernel-wide domain.
    This runs into conflict with PM that wants to perform resume actions in
    async context:

    [ 494.237079] INFO: task kworker/u:3:554 blocked for more than 120 seconds.
    [ 494.294396] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [ 494.360809] kworker/u:3 D 0000000000000000 0 554 2 0x00000000
    [ 494.420739] ffff88012e4d3af0 0000000000000046 ffff88013200c160 ffff88012e4d3fd8
    [ 494.484392] ffff88012e4d3fd8 0000000000012500 ffff8801394ea0b0 ffff88013200c160
    [ 494.548038] ffff88012e4d3ae0 00000000000001e3 ffffffff81a249e0 ffff8801321c5398
    [ 494.611685] Call Trace:
    [ 494.632649] [] schedule+0x5a/0x5c
    [ 494.674687] [] async_synchronize_cookie_domain+0xb6/0x112
    [ 494.734177] [] ? __init_waitqueue_head+0x50/0x50
    [ 494.787134] [] ? scsi_remove_target+0x48/0x48
    [ 494.837900] [] async_synchronize_cookie+0x15/0x17
    [ 494.891567] [] async_synchronize_full+0x54/0x70 ] ? async_synchronize_full_domain+0x1a/0x1a
    [ 495.002547] [] sd_remove+0x2c/0xa2 [sd_mod]
    [ 495.051861] [] __device_release_driver+0x86/0xcf
    [ 495.104807] [] device_release_driver+0x25/0x32 ] schedule+0x5a/0x5c
    [ 853.949670] [] __mutex_lock_common+0x220/0x351
    [ 854.001225] [] ? device_resume+0x58/0x1c4
    [ 854.049082] [] ? device_resume+0x58/0x1c4
    [ 854.097011] [] mutex_lock_nested+0x2f/0x36 ] device_resume+0x58/0x1c4
    [ 854.192066] [] async_resume+0x1e/0x45
    [ 854.237019] [] async_run_entry_fn+0xc6/0x173
    [alan: uplevel scsi_sd_probe_domain, clarify scsi_device_resume]
    Signed-off-by: Dan Williams
    [jejb: remove unneeded config guards in include file]
    Signed-off-by: James Bottomley

    Dan Williams
     

18 Feb, 2012

1 commit

  • This patch (as1520) fixes a bug in the SCSI layer's power management
    implementation.

    LUN scanning can be carried out asynchronously in do_scan_async(), and
    sd uses an asynchronous thread for the time-consuming parts of disk
    probing in sd_probe_async(). Currently nothing coordinates these
    async threads with system sleep transitions; they can and do attempt
    to continue scanning/probing SCSI devices even after the host adapter
    has been suspended. As one might expect, the outcome is not ideal.

    This is what the "prepare" stage of system suspend was created for.
    After the prepare callback has been called for a host, target, or
    device, drivers are not allowed to register any children underneath
    them. Currently the SCSI prepare callback is not implemented; this
    patch rectifies that omission.

    For SCSI hosts, the prepare routine calls scsi_complete_async_scans()
    to wait until async scanning is finished. It might be slightly more
    efficient to wait only until the host in question has been scanned,
    but there's currently no way to do that. Besides, during a sleep
    transition we will ultimately have to wait until all the host scanning
    has finished anyway.

    For SCSI devices, the prepare routine calls async_synchronize_full()
    to wait until sd probing is finished. The routine does nothing for
    SCSI targets, because asynchronous target scanning is done only as
    part of host scanning.

    Signed-off-by: Alan Stern
    CC:
    Signed-off-by: James Bottomley

    Alan Stern
     

15 Dec, 2011

1 commit


18 Mar, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (170 commits)
    [SCSI] scsi_dh_rdac: Add MD36xxf into device list
    [SCSI] scsi_debug: add consecutive medium errors
    [SCSI] libsas: fix ata list corruption issue
    [SCSI] hpsa: export resettable host attribute
    [SCSI] hpsa: move device attributes to avoid forward declarations
    [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
    [SCSI] sd: Logical Block Provisioning update
    [SCSI] Include protection operation in SCSI command trace
    [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
    [SCSI] target: Fix volume size misreporting for volumes > 2TB
    [SCSI] bnx2fc: Broadcom FCoE offload driver
    [SCSI] fcoe: fix broken fcoe interface reset
    [SCSI] fcoe: precedence bug in fcoe_filter_frames()
    [SCSI] libfcoe: Remove stale fcoe-netdev entries
    [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
    [SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument
    [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
    [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
    [SCSI] libfc: Fixing a memory leak when destroying an interface
    [SCSI] megaraid_sas: Version and Changelog update
    ...

    Fix up trivial conflicts due to whitespace differences in
    drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}

    Linus Torvalds
     

15 Mar, 2011

1 commit