29 Dec, 2018

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly update of the usual drivers: smarpqi, lpfc, qedi,
    megaraid_sas, libsas, zfcp, mpt3sas, hisi_sas.

    Additionally, we have a pile of annotation, unused variable and minor
    updates.

    The big API change is the updates for Christoph's DMA rework which
    include removing the DISABLE_CLUSTERING flag.

    And finally there are a couple of target tree updates"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (259 commits)
    scsi: isci: request: mark expected switch fall-through
    scsi: isci: remote_node_context: mark expected switch fall-throughs
    scsi: isci: remote_device: Mark expected switch fall-throughs
    scsi: isci: phy: Mark expected switch fall-through
    scsi: iscsi: Capture iscsi debug messages using tracepoints
    scsi: myrb: Mark expected switch fall-throughs
    scsi: megaraid: fix out-of-bound array accesses
    scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through
    scsi: fcoe: remove set but not used variable 'port'
    scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()
    scsi: smartpqi: fix build warnings
    scsi: smartpqi: update driver version
    scsi: smartpqi: add ofa support
    scsi: smartpqi: increase fw status register read timeout
    scsi: smartpqi: bump driver version
    scsi: smartpqi: add smp_utils support
    scsi: smartpqi: correct lun reset issues
    scsi: smartpqi: correct volume status
    scsi: smartpqi: do not offline disks for transient did no connect conditions
    scsi: smartpqi: allow for larger raid maps
    ...

    Linus Torvalds
     

19 Dec, 2018

2 commits

  • The same effects can be achieved by setting the dma_boundary to
    PAGE_SIZE - 1 and the max_segment_size to PAGE_SIZE, so shift those
    settings into the drivers. Note that in many cases the setting might
    be bogus, but this keeps the status quo.

    [mkp: fix myrs and myrb]

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

    Christoph Hellwig
     
  • This allows the host driver to indicate the maximum supported
    segment size in a nice an easy way, so that the driver doesn't
    have to worry about DMA-layer imposed limitations.

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

    Christoph Hellwig
     

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
     

28 Aug, 2018

1 commit

  • This reverts commit 328728630d9f2bf14b82ca30b5e47489beefe361.

    There is fundamental issue in commit 328728630d9f2bf1 (scsi: core: avoid
    host-wide host_busy counter for scsi_mq) because SCSI's host busy counter
    may not be same with counter of blk-mq's inflight tags, especially in case
    of none io scheduler.

    We may switch to other approach for addressing this scsi_mq's performance
    issue, such as percpu counter or kind of ways, so revert this commit first
    for fixing this kind of issue in EH path, as reported by Jens.

    Cc: Omar Sandoval ,
    Cc: "Martin K. Petersen" ,
    Cc: James Bottomley ,
    Cc: Christoph Hellwig ,
    Cc: Don Brace
    Cc: Kashyap Desai
    Cc: Mike Snitzer
    Cc: Hannes Reinecke
    Cc: Laurence Oberman
    Cc: Bart Van Assche
    Cc: Jens Axboe
    Reported-by: Jens Axboe
    Signed-off-by: Ming Lei
    Signed-off-by: Martin K. Petersen

    Ming Lei
     

27 Jun, 2018

2 commits

  • It isn't necessary to check the host depth in scsi_queue_rq() any more
    since it has been respected by blk-mq before calling scsi_queue_rq() via
    getting driver tag.

    Lots of LUNs may attach to same host and per-host IOPS may reach millions,
    so we should avoid expensive atomic operations on the host-wide counter in
    the IO path.

    This patch implements scsi_host_busy() via blk_mq_tagset_busy_iter() for
    reading the count of busy IOs for scsi_mq.

    It is observed that IOPS is increased by 15% in IO test on scsi_debug (32
    LUNs, 32 submit queues, 1024 can_queue, libaio/dio) in a dual-socket
    system.

    [mkp: clarified commit message]

    Cc: Omar Sandoval ,
    Cc: "Martin K. Petersen" ,
    Cc: James Bottomley ,
    Cc: Christoph Hellwig ,
    Cc: Don Brace
    Cc: Kashyap Desai
    Cc: Mike Snitzer
    Cc: Hannes Reinecke
    Cc: Laurence Oberman
    Cc: Bart Van Assche
    Signed-off-by: Ming Lei
    Reviewed-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Ming Lei
     
  • No functional change.

    Just introduce scsi_host_busy() and replace the direct read of
    scsi_host->host_busy with this new API.

    Cc: Omar Sandoval ,
    Cc: "Martin K. Petersen" ,
    Cc: James Bottomley ,
    Cc: Christoph Hellwig ,
    Cc: Don Brace
    Cc: Kashyap Desai
    Cc: Mike Snitzer
    Cc: Hannes Reinecke
    Cc: Laurence Oberman
    Cc: Bart Van Assche

    Signed-off-by: Ming Lei
    Reviewed-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen

    Ming Lei
     

10 Apr, 2018

1 commit


04 Apr, 2018

1 commit

  • Somewhat nasty merge due to conflicts between "33b28357dd00 scsi:
    qla2xxx: Fix Async GPN_FT for FCP and FC-NVMe scan" and "2b5b96473efc
    scsi: qla2xxx: Fix FC-NVMe LUN discovery"

    Merge is non-trivial and has been verified by Qlogic (Cavium)

    Signed-off-by: James E.J. Bottomley

    James Bottomley
     

20 Mar, 2018

2 commits


15 Mar, 2018

1 commit

  • This patch introduces 'force_blk_mq' to the scsi_host_template so that
    drivers that have no desire to support the legacy I/O path can signal
    blk-mq only support.

    [mkp: commit desc]

    Cc: Omar Sandoval ,
    Cc: "Martin K. Petersen" ,
    Cc: James Bottomley ,
    Cc: Christoph Hellwig ,
    Cc: Don Brace
    Cc: Kashyap Desai
    Cc: Mike Snitzer
    Cc: Laurence Oberman
    Signed-off-by: Ming Lei
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Ming Lei
     

02 Mar, 2018

1 commit

  • Avoid that the recently introduced call_rcu() call in the SCSI core
    triggers a double call_rcu() call.

    Reported-by: Natanael Copa
    Reported-by: Damien Le Moal
    References: https://bugzilla.kernel.org/show_bug.cgi?id=198861
    Fixes: 3bd6f43f5cb3 ("scsi: core: Ensure that the SCSI error handler gets woken up")
    Signed-off-by: Bart Van Assche
    Reviewed-by: Damien Le Moal
    Tested-by: Damien Le Moal
    Cc: Natanael Copa
    Cc: Damien Le Moal
    Cc: Alexandre Oliva
    Cc: Pavel Tikhomirov
    Cc: Hannes Reinecke
    Cc: Johannes Thumshirn
    Cc:
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

14 Feb, 2018

1 commit

  • The eh_deadline definition occurs in the middle of the code for
    releasing a host. Avoid splitting the host release code by moving the
    definition of the eh_deadline parameter to the top of the hosts.c source
    file.

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

    Bart Van Assche
     

08 Dec, 2017

1 commit

  • If scsi_eh_scmd_add() is called concurrently with
    scsi_host_queue_ready() while shost->host_blocked > 0 then it can
    happen that neither function wakes up the SCSI error handler. Fix
    this by making every function that decreases the host_busy counter
    wake up the error handler if necessary and by protecting the
    host_failed checks with the SCSI host lock.

    Reported-by: Pavel Tikhomirov
    References: https://marc.info/?l=linux-kernel&m=150461610630736
    Fixes: commit 746650160866 ("scsi: convert host_busy to atomic_t")
    Signed-off-by: Bart Van Assche
    Reviewed-by: Pavel Tikhomirov
    Tested-by: Stuart Hayes
    Cc: Konstantin Khorenko
    Cc: Stuart Hayes
    Cc: Pavel Tikhomirov
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Johannes Thumshirn
    Cc:
    Signed-off-by: Martin K. Petersen

    Bart Van Assche
     

05 Sep, 2017

1 commit

  • A patch I wrote myself several years ago removed SCSI target support
    from the code under drivers/scsi. That patch removed the code that sets
    uspace_req_q to a non-NULL value. Hence also remove the code that
    depends on uspace_req_q != NULL.

    References: commit 066465251303 ("tgt: removal")
    Signed-off-by: Bart Van Assche
    Cc: Christoph Hellwig
    Cc: Hannes Reinecke
    Cc: Johannes Thumshirn
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Christoph Hellwig
    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
     

26 Aug, 2016

1 commit

  • Runtime PM should be configured already once we call device_add. See
    also the description in this mail thread
    https://lists.linuxfoundation.org/pipermail/linux-pm/2009-November/023198.html
    or the order of calls e.g. in usb_new_device.

    The changed order also helps to avoid scenarios where runtime pm for
    &shost->shost_gendev is activated whilst the parent is suspended,
    resulting in error message "runtime PM trying to activate child device
    hostx but parent yyy is not active".

    In addition properly reverse the runtime pm calls in the error path.

    Signed-off-by: Heiner Kallweit
    Acked-by: Alan Stern
    Signed-off-by: Martin K. Petersen

    Heiner Kallweit
     

16 Jul, 2016

1 commit


19 Mar, 2016

1 commit

  • Pull libata updates from Tejun Heo:

    - ahci grew runtime power management support so that the controller can
    be turned off if no devices are attached.

    - sata_via isn't dead yet. It got hotplug support and more refined
    workaround for certain WD drives.

    - Misc cleanups. There's a merge from for-4.5-fixes to avoid confusing
    conflicts in ahci PCI ID table.

    * 'for-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    ata: ahci_xgene: dereferencing uninitialized pointer in probe
    AHCI: Remove obsolete Intel Lewisburg SATA RAID device IDs
    ata: sata_rcar: Use ARCH_RENESAS
    sata_via: Implement hotplug for VT6421
    sata_via: Apply WD workaround only when needed on VT6421
    ahci: Add runtime PM support for the host controller
    ahci: Add functions to manage runtime PM of AHCI ports
    ahci: Convert driver to use modern PM hooks
    ahci: Cache host controller version
    scsi: Drop runtime PM usage count after host is added
    scsi: Set request queue runtime PM status back to active on resume
    block: Add blk_set_runtime_active()
    ata: ahci_mvebu: add support for Armada 3700 variant
    libata: fix unbalanced spin_lock_irqsave/spin_unlock_irq() in ata_scsi_park_show()
    libata: support AHCI on OCTEON platform

    Linus Torvalds
     

24 Feb, 2016

1 commit

  • Update the SCSI hosts module to use ida to manage its host_no index
    instead of an atomic integer. This means that the SCSI host number will
    now be reclaimable.

    Use the ida "simple" mechanism, since there should be no need for a
    separate spin lock current usage. Ida was chosen over idr because the
    hosts module already has its own instance and locking mechanisms that
    aren't easily changed.

    Reviewed-by: Hannes Reinecke
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Lee Duncan
    Signed-off-by: Martin K. Petersen

    Lee Duncan
     

19 Feb, 2016

1 commit

  • Runtime PM of the SCSI host is already handled by calls to
    scsi_autopm_get_host() and scsi_autopm_put_host() from appropriate places
    whenever the host needs to be powered on. This works fine when there is
    device connected to the host as once it runtime suspends the host will too.

    However, if there is no device connected the host is never runtime
    suspended (the usage counter is always 0).

    Allow runtime suspend of host even if it has no devices connected by
    calling scsi_autopm_put_host() at the end of scsi_add_host_with_dma(). We
    temporarily increase runtime PM usage counter first so call to
    scsi_autopm_put_host() will result idle request to be scheduled for the
    device.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Tejun Heo

    Mika Westerberg
     

04 Dec, 2015

1 commit


01 Dec, 2015

1 commit

  • Avoid that kmemleak reports the following memory leak if a
    SCSI LLD calls scsi_host_alloc() and scsi_host_put() but neither
    scsi_host_add() nor scsi_host_remove(). The following shell
    command triggers that scenario:

    for ((i=0; i/sys/class/infiniband_srp/srp-mlx4_0-1/add_target
    done
    done

    unreferenced object 0xffff88021b24a220 (size 8):
    comm "srp_daemon", pid 56421, jiffies 4295006762 (age 4240.750s)
    hex dump (first 8 bytes):
    68 6f 73 74 35 38 00 a5 host58..
    backtrace:
    [] kmemleak_alloc+0x7a/0xc0
    [] __kmalloc_track_caller+0xfe/0x160
    [] kvasprintf+0x5b/0x90
    [] kvasprintf_const+0x8d/0xb0
    [] kobject_set_name_vargs+0x3c/0xa0
    [] dev_set_name+0x3c/0x40
    [] scsi_host_alloc+0x327/0x4b0
    [] srp_create_target+0x4e/0x8a0 [ib_srp]
    [] dev_attr_store+0x1b/0x20
    [] sysfs_kf_write+0x4a/0x60
    [] kernfs_fop_write+0x14e/0x180
    [] __vfs_write+0x2f/0xf0
    [] vfs_write+0xa4/0x100
    [] SyS_write+0x54/0xc0
    [] entry_SYSCALL_64_fastpath+0x12/0x6f

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

    Bart Van Assche
     

10 Nov, 2015

1 commit

  • This patch changes the !blk-mq path to the same defaults as the blk-mq
    I/O path by always enabling block tagging, and always using host wide
    tags. We've had blk-mq available for a few releases so bugs with
    this mode should have been ironed out, and this ensures we get better
    coverage of over tagging setup over different configs.

    Signed-off-by: Christoph Hellwig
    Acked-by: Jens Axboe
    Reviewed-by: Hannes Reinecke
    Signed-off-by: James Bottomley

    Christoph Hellwig
     

12 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


16 Mar, 2014

1 commit


19 Dec, 2013

2 commits

  • The former minimum valid value of 'eh_deadline' is 1s, which means
    the earliest occasion to shorten EH is 1 second later since a
    command is failed or timed out. But if we want to skip EH steps
    ASAP, we have to wait until the first EH step is finished. If the
    duration of the first EH step is long, this waiting time is
    excruciating. So, it is necessary to accept 0 as the minimum valid
    value for 'eh_deadline'.

    According to my test, with Hannes' patchset 'New EH command timeout
    handler' as well, the minimum IO time is improved from 73s
    (eh_deadline = 1) to 43s(eh_deadline = 0) when commands are timed
    out by disabling RSCN and target port.

    Signed-off-by: Ren Mingxin
    Signed-off-by: Hannes Reinecke
    Signed-off-by: James Bottomley

    Ren Mingxin
     
  • 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
     

29 Nov, 2013

1 commit

  • Some host adapters do not pass commands through to the target disk
    directly. Instead they provide an emulated target which may or may not
    accurately report its capabilities. In some cases the physical device
    characteristics are reported even when the host adapter is processing
    commands on the device's behalf. This can lead to adapter firmware hangs
    or excessive I/O errors.

    This patch disables WRITE SAME for devices connected to host adapters
    that provide an emulated target. Driver writers can disable WRITE SAME
    by setting the no_write_same flag in the host adapter template.

    [jejb: fix up rejections due to eh_deadline patch]
    Signed-off-by: Martin K. Petersen
    Cc: stable@kernel.org
    Signed-off-by: James Bottomley

    Martin K. Petersen
     

25 Oct, 2013

1 commit

  • This patchs adds an 'eh_deadline' sysfs attribute to the scsi
    host which limits the overall runtime of the SCSI EH.
    The 'eh_deadline' value is stored in the now obsolete field
    'resetting'.
    When a command is failed the start time of the EH is stored
    in 'last_reset'. If the overall runtime of the SCSI EH is longer
    than last_reset + eh_deadline, the EH is short-circuited and
    falls through to issue a host reset only.

    [jejb: add comments in Scsi_Host about new fields]
    Signed-off-by: Hannes Reinecke
    Signed-off-by: James Bottomley

    Hannes Reinecke
     

07 Feb, 2013

1 commit

  • All in-kernel users of class_find_device() don't really need mutable
    data for match callback.

    In two places (kernel/power/suspend_test.c, drivers/scsi/osd/osd_uld.c)
    this patch changes match callbacks to use const search data.

    The const is propagated to rtc_class_open() and power_supply_get_by_name()
    parameters.

    Note that there's a dev reference leak in suspend_test.c that's not
    touched in this patch.

    Signed-off-by: Michał Mirosław
    Acked-by: Grant Likely
    Signed-off-by: Greg Kroah-Hartman

    Michał Mirosław
     

20 Jul, 2012

2 commits

  • 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
     
  • Initialize atomic_t scsi_host_next_hn and ioerr_cntas per the guidelines
    defined in Documentation/atomic_ops.txt

    Signed-off-by: Josh Hunt
    Signed-off-by: James Bottomley

    Josh Hunt