21 May, 2009

1 commit

  • This patch (as1224) changes the default timeout for INQUIRY commands
    from 3 seconds to 20 seconds, which is the value used by Windows for
    USB Mass-Storage devices. Some of these devices, like the Corsair
    Flash Voyager (see Bugzilla #12188) really do need a long timeout.

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

    Alan Stern
     

15 May, 2009

1 commit

  • This patch initializes the max_target_blocked field of a scsi target
    structure so that a queuecommand return value of
    SCSI_MLQUEUE_TARGET_BUSY will actually result in having the
    scsi_queue_insert blocking the device queue before requeuing the
    command and running the queue. Otherwise, can and does cause livelock
    on single CPU configurations if/when open-iSCSI software initiator's
    command PDU window fills.

    Signed-off-by: Ed Goggin
    Signed-off-by: James Bottomley

    Edward Goggin
     

22 Apr, 2009

1 commit

  • There is currently only one way for userspace to say "wait for my storage
    device to get ready for the modules I just loaded": to load the
    scsi_wait_scan module. Expectations of userspace are that once this
    module is loaded, all the (storage) devices for which the drivers
    were loaded before the module load are present.

    Now, there are some issues with the implementation, and the async
    stuff got caught in the middle of this: The existing code only
    waits for the scsy async probing to finish, but it did not take
    into account at all that probing might not have begun yet.
    (Russell ran into this problem on his computer and the fix works for him)

    This patch fixes this more thoroughly than the previous "fix", which
    had some bad side effects (namely, for kernel code that wanted to wait for
    the scsi scan it would also do an async sync, which would deadlock if you did
    it from async context already.. there's a report about that on lkml):
    The patch makes the module first wait for all device driver probes, and then it
    will wait for the scsi parallel scan to finish.

    Signed-off-by: Arjan van de Ven
    Tested-by: Russell King
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

13 Mar, 2009

1 commit


11 Feb, 2009

1 commit

  • We were running i/o and performing a bunch of hba resets in a loop.
    This forces a lot of target removes and then rescans. Since the
    resets are occuring during scan it's causing the scan i/o to timeout,
    invoking error recovery, etc. We end up getting some nasty crashing
    in scsi_scan.c due to references to old sdevs that are failing
    but had some lingering references that kept them around.

    Fix by setting device state to SDEV_DEL if the LLD's slave_alloc
    fails.

    Signed-off-by: James Smart
    Signed-off-by: James Bottomley

    James Smart
     

09 Jan, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (45 commits)
    [SCSI] qla2xxx: Update version number to 8.03.00-k1.
    [SCSI] qla2xxx: Add ISP81XX support.
    [SCSI] qla2xxx: Use proper request/response queues with MQ instantiations.
    [SCSI] qla2xxx: Correct MQ-chain information retrieval during a firmware dump.
    [SCSI] qla2xxx: Collapse EFT/FCE copy procedures during a firmware dump.
    [SCSI] qla2xxx: Don't pollute kernel logs with ZIO/RIO status messages.
    [SCSI] qla2xxx: Don't fallback to interrupt-polling during re-initialization with MSI-X enabled.
    [SCSI] qla2xxx: Remove support for reading/writing HW-event-log.
    [SCSI] cxgb3i: add missing include
    [SCSI] scsi_lib: fix DID_RESET status problems
    [SCSI] fc transport: restore missing dev_loss_tmo callback to LLDD
    [SCSI] aha152x_cs: Fix regression that keeps driver from using shared interrupts
    [SCSI] sd: Correctly handle 6-byte commands with DIX
    [SCSI] sd: DIF: Fix tagging on platforms with signed char
    [SCSI] sd: DIF: Show app tag on error
    [SCSI] Fix error handling for DIF/DIX
    [SCSI] scsi_lib: don't decrement busy counters when inserting commands
    [SCSI] libsas: fix test for negative unsigned and typos
    [SCSI] a2091, gvp11: kill warn_unused_result warnings
    [SCSI] fusion: Move a dereference below a NULL test
    ...

    Fixed up trivial conflict due to moving the async part of sd_probe
    around in the async probes vs using dev_set_name() in naming.

    Linus Torvalds
     

08 Jan, 2009

1 commit

  • This patch makes part of the scsi probe (which is mostly device spin up and the
    partition scan) asynchronous. Only the part that runs after getting the device
    number allocated is asynchronous, ensuring that device numbering remains stable.

    Signed-off-by: Arjan van de Ven

    Arjan van de Ven
     

03 Jan, 2009

1 commit


30 Dec, 2008

2 commits

  • This patch changes scsi_probe_lun() to retry INQUIRY if the device has
    not actually sent back any INQUIRY data,

    This enables the Thecus N2050 storage device to work better. The
    firmware on that device starts up strangely; it sends no data in
    response to the initial INQUIRY, and it sends the INQUIRY information
    in response to the followup REQUEST SENSE. But after that it works
    better, so retrying the INQUIRY is enough to get it going.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     
  • scsi_execute() and scsi_execute_req() discard the residual length
    information. Some callers need it. This adds residual argument
    (optional) to scsi_execute and scsi_execute_req.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     

13 Oct, 2008

1 commit

  • SCSI-ml manages the queueing limits for the device and host, but
    does not do so at the target level. However something something similar
    can come in userful when a driver is transitioning a transport object to
    the the blocked state, becuase at that time we do not want to queue
    io and we do not want the queuecommand to be called again.

    The patch adds code similar to the exisiting SCSI_ML_*BUSY handlers.
    You can now return SCSI_MLQUEUE_TARGET_BUSY when we hit
    a transport level queueing issue like the hw cannot allocate some
    resource at the iscsi session/connection level, or the target has temporarily
    closed or shrunk the queueing window, or if we are transitioning
    to the blocked state.

    bnx2i, when they rework their firmware according to netdev
    developers requests, will also need to be able to limit queueing at this
    level. bnx2i will hook into libiscsi, but will allocate a scsi host per
    netdevice/hba, so unlike pure software iscsi/iser which is allocating
    a host per session, it cannot set the scsi_host->can_queue and return
    SCSI_MLQUEUE_HOST_BUSY to reflect queueing limits on the transport.

    The iscsi class/driver can also set a scsi_target->can_queue value which
    reflects the max commands the driver/class can support. For iscsi this
    reflects the number of commands we can support for each session due to
    session/connection hw limits, driver limits, and to also reflect the
    session/targets's queueing window.

    Changes:
    v1 - initial patch.
    v2 - Fix scsi_run_queue handling of multiple blocked targets.
    Previously we would break from the main loop if a device was added back on
    the starved list. We now run over the list and check if any target is
    blocked.
    v3 - Rediff for scsi-misc.

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

    Mike Christie
     

04 Oct, 2008

2 commits


29 Aug, 2008

1 commit

  • For IBM z series certain LUNs can no longer be accessed.

    This is because kernel version 2.6.19 a check was introduced not to
    create a generic SCSI device for devices that return PQ=1 and
    PDT=0x1f. For WLUNs (see SAM-3, p. 41ff) generic SCSI devices should
    be created unconditionally without looking at the PQ bit, so add a
    check for WLUNs in with this test.

    Acked-by: Martin Petermann
    Signed-off-by: James Bottomley

    James Bottomley
     

27 Jul, 2008

2 commits

  • [jejb: fixed up a ton of missed conversions.

    All of you are on notice this has happened, driver trees will now
    need to be rebased]

    Signed-off-by: Harvey Harrison
    Cc: SCSI List
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Harvey Harrison
     
  • The mutex is released on a successful return, so it would seem that it
    should be released on an error return as well.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    expression l;
    @@

    mutex_lock(l);
    ... when != mutex_unlock(l)
    when any
    when strict
    (
    if (...) { ... when != mutex_unlock(l)
    + mutex_unlock(l);
    return ...;
    }
    |
    mutex_unlock(l);
    )
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: James Bottomley

    Julia Lawall
     

12 Jul, 2008

1 commit


29 Apr, 2008

1 commit

  • Some drivers have duplicated unlikely() macros. IS_ERR() already has
    unlikely() in itself.

    This patch cleans up such pointless code.

    Signed-off-by: Hirofumi Nakagawa
    Acked-by: David S. Miller
    Acked-by: Jeff Garzik
    Cc: Paul Clements
    Cc: Richard Purdie
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: James Bottomley
    Cc: Michael Halcrow
    Cc: Anton Altaparmakov
    Cc: Al Viro
    Cc: Carsten Otte
    Cc: Patrick McHardy
    Cc: Paul Mundt
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hirofumi Nakagawa
     

23 Apr, 2008

2 commits

  • The current target allocation code registeres each possible target
    with sysfs; it will be deleted again if no useable LUN on this target
    was found. This results in a string of 'target add/target remove' uevents.

    Based on a patch by Hannes Reinecke this patch reworks
    the target allocation code so that only uevents for existing targets
    are sent. The sysfs registration is split off from the existing
    scsi_target_alloc() into a in a new scsi_add_target() function, which
    should be called whenever an existing target is found. Only then a
    uevent is sent, so we'll be generating events for existing targets
    only.

    Signed-off-by: James Bottomley

    James Bottomley
     
  • This patch implements scsi_host and scsi_target device types
    and adds both to the scsi_bus.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Kay Sievers
    Signed-off-by: James Bottomley

    Hannes Reinecke
     

04 Mar, 2008

1 commit


24 Jan, 2008

1 commit

  • While trying to convert the SPI transport class to attribute groups, I
    discovered that we don't actually have any transport configure points
    for either the target or the host. This patch adds these missing
    transport class triggers. The host one is simply done after the add,
    the target one tries to be more clever and add it after devices may have
    been placed on the target (so the device configure will have set up the
    target parameters).

    Signed-off-by: James Bottomley

    James Bottomley
     

12 Jan, 2008

2 commits

  • Some SCSI tape medium changers that need the BLIST_SINGLELUN flag have
    the medium changer at one LUN and the tape drive at a different LUN.
    The inquiry string of the tape drive may be different from that of the
    medium changer. In order for single_lun to be effective, every
    scsi_device under a given scsi_target must have it set. This means that
    there needs to be a blacklist entry for BOTH the medium changer AND the
    tape drive, which is impractical because some medium changers may be
    paired with a variety of different tape drive models. It makes more
    sense to put the single_lun flag in scsi_target instead of scsi_device,
    which causes every device at a given target ID to inherit the single_lun
    flag from one LUN. This makes it possible to blacklist just the medium
    changer and not the tape drive.

    Signed-off-by: Tony Battersby
    Signed-off-by: James Bottomley

    Tony Battersby
     
  • Add Documentation/DocBook/scsi_midlayer.tmpl, add to Makefile, and update
    lots of kerneldoc comments in drivers/scsi/*.

    Updated with comments from Stefan Richter, Stephen M. Cameron,
    James Bottomley and Randy Dunlap.

    Signed-off-by: Rob Landley
    Signed-off-by: James Bottomley

    Rob Landley
     

04 Nov, 2007

1 commit


13 Oct, 2007

3 commits

  • If kthread_run failed, we would fail to scan the host, and leak the
    allocated async_scan_data. Since using a separate thread is just an
    optimisation, do the scan synchronously if we fail to spawn a thread.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     
  • In scsi module I've found some inconsistency between variable type
    used in module_param_named and type passed to module_param_named as an
    argument. Especially the inconsistency of `max_scsi_luns' parameter is
    a bit serious because the description text says "last scsi LUN (should
    be between 1 and 2^32-1)".

    Signed-off-by: Masatake YAMATO
    Acked-by: Randy Dunlap
    Signed-off-by: James Bottomley

    Masatake YAMATO
     
  • Stress-testing and some thought has revealed some places where
    asynchronous scanning needs some more attention to locking.

    - Since async_scan is a bit, we need to hold the host_lock while
    modifying it to prevent races against other CPUs modifying the word
    that bit is in. This is probably a theoretical race for the moment,
    but other patches may change that.
    - The async_scan bit means not only that this host is being scanned
    asynchronously, but that all the devices attached to this host are not
    yet added to sysfs. So we must ensure that this bit is always in sync.
    I've chosen to do this with the scan_mutex since it's already acquired
    in most of the right places.
    - If the host changes state to deleted while we're in the middle of
    a scan, we'll end up with some devices on the host's list which must
    be deleted. Add a check to scsi_sysfs_add_devices() to ensure the
    host is still running.
    - To avoid the async_scan bit being protected by three locks, the
    async_scan_lock now only protects the scanning_list.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     

16 Jul, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (166 commits)
    [SCSI] ibmvscsi: convert to use the data buffer accessors
    [SCSI] dc395x: convert to use the data buffer accessors
    [SCSI] ncr53c8xx: convert to use the data buffer accessors
    [SCSI] sym53c8xx: convert to use the data buffer accessors
    [SCSI] ppa: coding police and printk levels
    [SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmalloc
    [SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.c
    [SCSI] remove the dead CYBERSTORMIII_SCSI option
    [SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMA
    [SCSI] Clean up scsi_add_lun a bit
    [SCSI] 53c700: Remove printk, which triggers because of low scsi clock on SNI RMs
    [SCSI] sni_53c710: Cleanup
    [SCSI] qla4xxx: Fix underrun/overrun conditions
    [SCSI] megaraid_mbox: use mutex instead of semaphore
    [SCSI] aacraid: add 51245, 51645 and 52245 adapters to documentation.
    [SCSI] qla2xxx: update version to 8.02.00-k1.
    [SCSI] qla2xxx: add support for NPIV
    [SCSI] stex: use resid for xfer len information
    [SCSI] Add Brownie 1200U3P to blacklist
    [SCSI] scsi.c: convert to use the data buffer accessors
    ...

    Linus Torvalds
     

15 Jul, 2007

1 commit

  • This patch tidies up scsi_add_lun a bit. I rewrote the kerneldoc to match
    the actual parameters, moved the check for RBC and MMC REPORT_LUN devices
    away from the switch(), changed the setup of sdev->type to account for
    BLIST_ISROM, moved the check for BLIST_NO_ULD_ATTACH further down in
    the function, removed a bogus comment and fixed some whitespace issues.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     

20 Jun, 2007

1 commit

  • When reporting SCSI devices to the SCSI midlayer, use the FCP LUN as
    LUN reported to the SCSI layer. With this approach, zfcp does not have
    to create unique LUNS, and this code can be removed.

    Signed-off-by: Christof Schmitt
    Signed-off-by: Swen Schillig
    Signed-off-by: James Bottomley

    Christof Schmitt
     

30 May, 2007

1 commit

  • CONFIG_MODULES=y
    CONFIG_SCSI=y
    CONFIG_SCSI_SCAN_ASYNC=y
    CONFIG_SCSI_WAIT_SCAN=m

    2.6.21-rc5-mm2 VFS panics unable to find my root on /dev/sda2, but boots
    okay if I change drivers/scsi/Kconfig to "default y" instead of "default m"
    for SCSI_WAIT_SCAN.

    Make sure there's a late_initcall to scsi_complete_async_scans when it's
    built in, so a monolithic SCSI_SCAN_ASYNC kernel can rely on the scans
    being completed before trying to mount root, even if they're slow.

    [akpm@linux-foundation.org: build fixes]
    Signed-off-by: Hugh Dickins
    Acked-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Hugh Dickins
     

21 Mar, 2007

1 commit

  • The #ifdef MODULE around the export of scsi_complete_async_scans()
    which is the API the scsi_wait_scan module uses is incorrect and
    causes the symbol to be undefined in certain circumstances leading to
    a build failure. Remove the defines.

    Signed-off-by: James Bottomley

    James Bottomley
     

20 Feb, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6:
    [SCSI] SCSI core: better initialization for sdev->scsi_level
    [SCSI] scsi_proc.c: display sdev->scsi_level correctly
    [SCSI] megaraid_sas: update version and author info
    [SCSI] megaraid_sas: return sync cache call with success
    [SCSI] megaraid_sas: replace pci_alloc_consitent with dma_alloc_coherent in ioctl path
    [SCSI] megaraid_sas: add bios_param in scsi_host_template
    [SCSI] megaraid_sas: do not process cmds if hw_crit_error is set
    [SCSI] scsi_transport.h should include scsi_device.h
    [SCSI] aic79xx: remove extra newline from info message
    [SCSI] scsi_scan.c: handle bad inquiry responses
    [SCSI] aic94xx: tie driver to the major number of the sequencer firmware
    [SCSI] lpfc: add PCI error recovery support
    [SCSI] megaraid: pci_module_init to pci_register_driver
    [SCSI] tgt: fix the user/kernel ring buffer interface
    [SCSI] sgiwd93: interfacing to wd33c93
    [SCSI] wd33c93: Fast SCSI with WD33C93B

    Linus Torvalds
     

18 Feb, 2007

1 commit


17 Feb, 2007

2 commits

  • This patch will affect the CDB in INQUIRY commands sent to LUNs above 0
    when LUN-0 reports a scsi_level of 0; the LUN bits will no longer be set
    in the second byte of the CDB. This is as it should be. Nevertheless,
    it's possible that some wacky device might be adversely affected. I doubt
    anyone will complain...

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

    Alan Stern
     
  • A particular USB device has been reporting short inquiry lengths. The
    SCSI code cannot operate properly unless we get an inquiry length of
    36 or above (because of the way we parse vendor and product), so
    assume at least 36 bytes are valid even if the device reports fewer.
    This is wrong, but it's no worse than what we're doing now (using the
    garbage beyond the last reported valid byte).

    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Alan Stern
     

11 Feb, 2007

1 commit


01 Feb, 2007

1 commit


27 Jan, 2007

1 commit

  • I had thought that all drivers which didn't call scsi_scan_host()
    called scsi_scan_target(). Some, such as sbp2, mptsas and libata-scsi,
    call scsi_add_device() or __scsi_add_device(). We just need to wait
    for the currently executing async scans to complete first. This is the
    same code that's in scsi_scan_target(), except that we have to return
    an error instead of void when we're declining to scan at all.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox