27 Aug, 2011

1 commit

  • Added new sysfs attr 'host_reset' in scsi_sysfs.c to
    perform adapter or firmware reset as suggested by
    Mike Christie here:
    http://marc.info/?l=linux-scsi&m=127359347111167&w=2

    user/application can write "adapter" or "firmware" on
    this attr and it will call newly added function hook
    in scsi_host_template to call LDD adapter or firmware
    reset implementation.

    Signed-off-by: Vikas Chaudhary
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Vikas Chaudhary
     

02 Jun, 2011

1 commit

  • In certain circumstances, we can get an oops from a torn down device.
    Most notably this is from CD roms trying to call scsi_ioctl. The root
    cause of the problem is the fact that after scsi_remove_device() has
    been called, the queue is fully torn down. This is actually wrong
    since the queue can be used until the sdev release function is called.
    Therefore, we add an extra reference to the queue which is released in
    sdev->release, so the queue always exists.

    Reported-by: Parag Warudkar
    Cc: stable@kernel.org
    Signed-off-by: James Bottomley

    James Bottomley
     

25 Apr, 2011

1 commit

  • SCSI uses request_queue->queuedata == NULL as a signal that the queue
    is dying. We set this state in the sdev release function. However,
    this allows a small window where we release the last reference but
    haven't quite got to this stage yet and so something will try to take
    a reference in scsi_request_fn and oops. It's very rare, but we had a
    report here, so we're pushing this as a bug fix

    The actual fix is to set request_queue->queuedata to NULL in
    scsi_remove_device() before we drop the reference. This causes
    correct automatic rejects from scsi_request_fn as people who hold
    additional references try to submit work and prevents anything from
    getting a new reference to the sdev that way.

    Cc: stable@kernel.org
    Signed-off-by: James Bottomley

    James Bottomley
     

15 Mar, 2011

1 commit


14 Jan, 2011

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    Documentation/trace/events.txt: Remove obsolete sched_signal_send.
    writeback: fix global_dirty_limits comment runtime -> real-time
    ppc: fix comment typo singal -> signal
    drivers: fix comment typo diable -> disable.
    m68k: fix comment typo diable -> disable.
    wireless: comment typo fix diable -> disable.
    media: comment typo fix diable -> disable.
    remove doc for obsolete dynamic-printk kernel-parameter
    remove extraneous 'is' from Documentation/iostats.txt
    Fix spelling milisec -> ms in snd_ps3 module parameter description
    Fix spelling mistakes in comments
    Revert conflicting V4L changes
    i7core_edac: fix typos in comments
    mm/rmap.c: fix comment
    sound, ca0106: Fix assignment to 'channel'.
    hrtimer: fix a typo in comment
    init/Kconfig: fix typo
    anon_inodes: fix wrong function name in comment
    fix comment typos concerning "consistent"
    poll: fix a typo in comment
    ...

    Fix up trivial conflicts in:
    - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
    - fs/ext4/ext4.h

    Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.

    Linus Torvalds
     

04 Jan, 2011

1 commit


23 Dec, 2010

1 commit


26 Nov, 2010

1 commit


26 Oct, 2010

1 commit

  • Removing SCSI devices through
    echo 1 > /sys/bus/scsi/devices/ ... /delete

    while the FC transport class removes the SCSI target can lead to an
    oops:

    Unable to handle kernel pointer dereference at virtual kernel address 00000000b6815000
    Oops: 0011 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    Modules linked in: sunrpc qeth_l3 binfmt_misc dm_multipath scsi_dh dm_mod ipv6 qeth ccwgroup [last unloaded: scsi_wait_scan]
    CPU: 1 Not tainted 2.6.35.5-45.x.20100924-s390xdefault #1
    Process fc_wq_0 (pid: 861, task: 00000000b7331240, ksp: 00000000b735bac0)
    Krnl PSW : 0704200180000000 00000000003ff6e4 (__scsi_remove_device+0x24/0xd0)
    R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0 EA:3
    Krnl GPRS: 0000000000000001 0000000000000000 00000000b6815000 00000000bc24a8c0
    00000000003ff7c8 000000000056dbb8 0000000000000002 0000000000835d80
    ffffffff00000000 0000000000001000 00000000b6815000 00000000bc24a7f0
    00000000b68151a0 00000000b6815000 00000000b735bc20 00000000b735bbf8
    Krnl Code: 00000000003ff6d6: a7840001 brc 8,3ff6d8
    00000000003ff6da: a7fbffd8 aghi %r15,-40
    00000000003ff6de: e3e0f0980024 stg %r14,152(%r15)
    >00000000003ff6e4: e31021200004 lg %r1,288(%r2)
    00000000003ff6ea: a71f0000 cghi %r1,0
    00000000003ff6ee: a7a40011 brc 10,3ff710
    00000000003ff6f2: a7390003 lghi %r3,3
    00000000003ff6f6: c0e5ffffc8b1 brasl %r14,3f8858
    Call Trace:
    ([] 0x1000)
    [] scsi_remove_device+0x42/0x54
    [] __scsi_remove_target+0xca/0xfc
    [] __remove_child+0x3a/0x48
    [] device_for_each_child+0x72/0xbc
    [] scsi_remove_target+0x4e/0x74
    [] fc_rport_final_delete+0xb2/0x23c
    [] worker_thread+0x200/0x344
    [] kthread+0xa0/0xa8
    [] kernel_thread_starter+0x6/0xc
    [] kernel_thread_starter+0x0/0xc
    INFO: lockdep is turned off.
    Last Breaking-Event-Address:
    [] scsi_remove_device+0x3c/0x54

    The function __scsi_remove_target iterates through the SCSI devices on
    the host, but it drops the host_lock before calling
    scsi_remove_device. When the SCSI device is deleted from another
    thread, the pointer to the SCSI device in scsi_remove_device can
    become invalid. Fix this by getting a reference to the SCSI device
    before dropping the host_lock to keep the SCSI device alive for the
    call to scsi_remove_device.

    Signed-off-by: Christof Schmitt
    Cc: Stable Tree
    Signed-off-by: James Bottomley

    Christof Schmitt
     

11 Sep, 2010

1 commit

  • Some controllers have a hardware limit on the number of protection
    information scatter-gather list segments they can handle.

    Introduce a max_integrity_segments limit in the block layer and provide
    a new scsi_host_template setting that allows HBA drivers to provide a
    value suitable for the hardware.

    Add support for honoring the integrity segment limit when merging both
    bios and requests.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

07 Aug, 2010

1 commit

  • Fake "address-of" expressions that evaluate to NULL generally confuse
    readers and can provoke compiler warnings. This patch (as1411) removes
    one such fake expression, using an "#ifdef" in its place.

    Signed-off-by: Alan Stern
    Signed-off-by: Linus Torvalds

    Alan Stern
     

28 Jul, 2010

2 commits

  • This patch (as1398b) adds runtime PM support to the SCSI layer. Only
    the machanism is provided; use of it is up to the various high-level
    drivers, and the patch doesn't change any of them. Except for sg --
    the patch expicitly prevents a device from being runtime-suspended
    while its sg device file is open.

    The implementation is simplistic. In general, hosts and targets are
    automatically suspended when all their children are asleep, but for
    them the runtime-suspend code doesn't actually do anything. (A host's
    runtime PM status is propagated up the device tree, though, so a
    runtime-PM-aware lower-level driver could power down the host adapter
    hardware at the appropriate times.) There are comments indicating
    where a transport class might be notified or some other hooks added.

    LUNs are runtime-suspended by calling the drivers' existing suspend
    handlers (and likewise for runtime-resume). Somewhat arbitrarily, the
    implementation delays for 100 ms before suspending an eligible LUN.
    This is because there typically are occasions during bootup when the
    same device file is opened and closed several times in quick
    succession.

    The way this all works is that the SCSI core increments a device's
    PM-usage count when it is registered. If a high-level driver does
    nothing then the device will not be eligible for runtime-suspend
    because of the elevated usage count. If a high-level driver wants to
    use runtime PM then it can call scsi_autopm_put_device() in its probe
    routine to decrement the usage count and scsi_autopm_get_device() in
    its remove routine to restore the original count.

    Hosts, targets, and LUNs are not suspended while they are being probed
    or removed, or while the error handler is running. In fact, a fairly
    large part of the patch consists of code to make sure that things
    aren't suspended at such times.

    [jejb: fix up compile issues in PM config variations]
    Signed-off-by: Alan Stern
    Signed-off-by: James Bottomley

    Alan Stern
     
  • This patch (as1397b) converts the SCSI midlayer to use the new PM
    callbacks (struct dev_pm_ops). A new source file, scsi_pm.c, is
    created to hold the new callback routines, and the existing
    suspend/resume code is moved there.

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

    Alan Stern
     

02 May, 2010

1 commit

  • This patch fixes sdev_rw_attr() macro for scsi device sysfs entries.
    It seems there is no such function snscanf in the current linux kernel,
    so it fails to compile scsi driver when someone try to add a new rw entry.
    This has been unfixed for a long time probably because current scsi device
    has no rw entries.

    # grep snscanf . -rn
    ./drivers/scsi/scsi_sysfs.c:489: snscanf (buf, 20, format_string, &sdev->field); \

    Signed-off-by: Tomohiro Kusumi
    Signed-off-by: James Bottomley

    Tomohiro Kusumi
     

11 Apr, 2010

1 commit

  • This patch (as1358) fixes a bug in the error pathway of
    scsi_target_add(). If registration fails, the target should not be
    reaped. The reaping occurs later, when scanning is finished and all
    the child devices are removed. The current code leaves an unbalanced
    value in starget->reap_ref.

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

    Alan Stern
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

27 Feb, 2010

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    PM / Hibernate: Fix preallocating of memory
    PM / Hibernate: Remove swsusp.c finally
    PM / Hibernate: Remove trailing space in message
    PM: Allow SCSI devices to suspend/resume asynchronously
    PM: Allow USB devices to suspend/resume asynchronously
    USB: implement non-tree resume ordering constraints for PCI host controllers
    PM: Allow PCI devices to suspend/resume asynchronously
    PM / Hibernate: Swap, remove useless check from swsusp_read()
    PM / Hibernate: Really deprecate deprecated user ioctls
    PM: Allow device drivers to use dpm_wait()
    PM: Start asynchronous resume threads upfront
    PM: Add facility for advanced testing of async suspend/resume
    PM: Add a switch for disabling/enabling asynchronous suspend/resume
    PM: Asynchronous suspend and resume of devices
    PM: Add parent information to timing messages
    PM: Document device power attributes in sysfs
    PM / Runtime: Add sysfs switch for disabling device run-time PM

    Linus Torvalds
     
  • Set power.async_suspend for all SCSI devices, targets and hosts, so
    that they can be suspended and resumed in parallel with the main
    suspend/resume thread and possibly with other devices they don't
    depend on in a known way (i.e. devices which are not their parents or
    children).

    The power.async_suspend flag is also set for devices that don't have
    suspend or resume callbacks, because otherwise they would make the
    main suspend/resume thread wait for their "asynchronous" children
    (during suspend) or parents (during resume), effectively negating the
    possible gains from executing these devices' suspend and resume
    callbacks asynchronously.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

19 Feb, 2010

1 commit


10 Dec, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
    [SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
    [SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
    [SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
    [SCSI] zfcp: Update FSF error reporting
    [SCSI] zfcp: Improve ELS ADISC handling
    [SCSI] zfcp: Simplify handling of ct and els requests
    [SCSI] zfcp: Remove ZFCP_DID_MASK
    [SCSI] zfcp: Move WKA port to zfcp FC code
    [SCSI] zfcp: Use common code definitions for FC CT structs
    [SCSI] zfcp: Use common code definitions for FC ELS structs
    [SCSI] zfcp: Update FCP protocol related code
    [SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
    [SCSI] zfcp: Assign scheduled work to driver queue
    [SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
    [SCSI] zfcp: Implement module unloading
    [SCSI] zfcp: Merge trace code for fsf requests in one function
    [SCSI] zfcp: Access ports and units with container_of in sysfs code
    [SCSI] zfcp: Remove suspend callback
    [SCSI] zfcp: Remove global config_mutex
    [SCSI] zfcp: Replace local reference counting with common kref
    ...

    Linus Torvalds
     

05 Dec, 2009

2 commits

  • Current FC HBA queue_depth ramp up code depends on last queue
    full time. The sdev already has last_queue_full_time field to
    track last queue full time but stored value is truncated by
    last four bits.

    So this patch updates last_queue_full_time without truncating
    last 4 bits to store full value and then updates its only
    current usages in scsi_track_queue_full to ignore last four bits
    to keep current usages same while also use this field
    in added ramp up code.

    Adds scsi_handle_queue_ramp_up to ramp up queue_depth on
    successful completion of IO. The scsi_handle_queue_ramp_up will
    do ramp up on all luns of a target, just same as ramp down done
    on all luns on a target.

    The ramp up is skipped in case the change_queue_depth is not
    supported by LLD or already reached to added max_queue_depth.

    Updates added max_queue_depth on every new update to default
    queue_depth value.

    The ramp up is also skipped if lapsed time since either last
    queue ramp up or down is less than LLD specified
    queue_ramp_up_period.

    Adds queue_ramp_up_period to sysfs but only if change_queue_depth
    is supported since ramp up and queue_ramp_up_period is needed only
    in case change_queue_depth is supported first.

    Initializes queue_ramp_up_period to 120HZ jiffies as initial
    default value, it is same as used in existing lpfc and qla2xxx.

    -v2
    Combined all ramp code into this single patch.

    -v3
    Moves max_queue_depth initialization after slave_configure is
    called from after slave_alloc calling done. Also adjusted
    max_queue_depth check to skip ramp up if current queue_depth
    is >= max_queue_depth.

    -v4
    Changes sdev->queue_ramp_up_period unit to ms when using sysfs i/f
    to store or show its value.

    Signed-off-by: Vasu Dev
    Tested-by: Christof Schmitt
    Tested-by: Giridhar Malavali
    Signed-off-by: James Bottomley

    Vasu Dev
     
  • This patch modifies scsi_host_template->change_queue_depth so that
    it takes an argument indicating why it is being called. This will be
    used so that if a LLD needs to do some extra processing when
    handling queue fulls or later ramp ups, it can do so.

    This is a simple port of the drivers setting a change_queue_depth
    callback. In the patch I just have these LLDs adjust the queue depth
    if the user was requesting it.

    Signed-off-by: Mike Christie

    [Vasu.Dev: v2
    Also converted pmcraid_change_queue_depth and then verified
    all modules compile using "make allmodconfig" for any new build
    warnings on X86_64.

    Updated original description after combing two original
    patches from Mike to make this patch git bisectable.]
    Signed-off-by: Vasu Dev
    [jejb: fixed up 53c700]
    Signed-off-by: James Bottomley

    Mike Christie
     

26 Nov, 2009

1 commit

  • Async scanning introduced a very wide window where the SCSI device is
    up and running but has not yet been added to sysfs. We delay the
    adding until all scans have completed to retain the same ordering as
    sync scanning.

    This delay in visibility causes an oops if a device is removed before
    we make it visible because the SCSI removal routines have an inbuilt
    assumption that if a device is in SDEV_RUNNING state, it must be
    visible (which is not necessarily true in the async scanning case).

    Fix this by introducing an additional is_visible flag which we can use
    to condition the tear down so we do the right thing for running but
    not yet made visible.

    Reported-by: Alexey Kuznetsov
    Signed-off-by: James Bottomley

    James Bottomley
     

14 Oct, 2009

1 commit

  • The root cause of the problem is the fact that dev_set_name() now
    allocates storage instead of using the original array within the kobj.
    That means that the SCSI assumption that if you haven't made the
    containing object or any sub objects visible, you can just destroy it
    (and its component devices) lock stock and barrel becomes false.

    Fix this by doing the get of sdev_dev at parent time and thus do an
    extra put of it in scsi_destroy_sdev() (and all other destruction
    without add paths).

    Reported-by: Tetsuo Handa
    Signed-off-by: James Bottomley

    James Bottomley
     

16 Sep, 2009

1 commit


22 Jun, 2009

1 commit

  • If a SCSI ULD driver sets blk_queue_prep_rq(), it should clean it
    up itself on remove(), and not from the bus callbacks. This
    removes the need to hook into bus->remove(), which should not
    be used at the same time as driver->remove().

    [jejb: fix sdkp initialisation problem due to mismerge]
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Kay Sievers
    Signed-off-by: James Bottomley

    Hannes Reinecke
     

13 Mar, 2009

1 commit


03 Jan, 2009

1 commit


11 Oct, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (37 commits)
    [SCSI] zfcp: fix double dbf id usage
    [SCSI] zfcp: wait on SCSI work to be finished before proceeding with init dev
    [SCSI] zfcp: fix erp list usage without using locks
    [SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport
    [SCSI] zfcp: fix deadlock caused by shared work queue tasks
    [SCSI] zfcp: put threshold data in hba trace
    [SCSI] zfcp: Simplify zfcp data structures
    [SCSI] zfcp: Simplify get_adapter_by_busid
    [SCSI] zfcp: remove all typedefs and replace them with standards
    [SCSI] zfcp: attach and release SAN nameserver port on demand
    [SCSI] zfcp: remove unused references, declarations and flags
    [SCSI] zfcp: Update message with input from review
    [SCSI] zfcp: add queue_full sysfs attribute
    [SCSI] scsi_dh: suppress comparison warning
    [SCSI] scsi_dh: add Dell product information into rdac device handler
    [SCSI] qla2xxx: remove the unused SCSI_QLOGIC_FC_FIRMWARE option
    [SCSI] qla2xxx: fix printk format warnings
    [SCSI] qla2xxx: Update version number to 8.02.01-k8.
    [SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing.
    [SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling.
    ...

    Linus Torvalds
     

09 Oct, 2008

1 commit

  • Right now SCSI and others do their own command timeout handling.
    Move those bits to the block layer.

    Instead of having a timer per command, we try to be a bit more clever
    and simply have one per-queue. This avoids the overhead of having to
    tear down and setup a timer for each command, so it will result in a lot
    less timer fiddling.

    Signed-off-by: Mike Anderson
    Signed-off-by: Jens Axboe

    Jens Axboe
     

04 Oct, 2008

1 commit

  • Brian King reported that fibre channel
    devices can oops during scanning if their ports block (because the
    device goes from CREATED -> BLOCK -> RUNNING rather than CREATED ->
    BLOCK -> CREATED).

    Fix this by adding a new state: CREATED_BLOCK which can only transition
    back to CREATED and disallow the CREATED -> BLOCK transition. Now both
    the created and blocked states that the mid-layer recognises can include
    CREATED_BLOCK.

    Signed-off-by: James Bottomley

    James Bottomley
     

27 Jul, 2008

1 commit

  • Controllers that support protection information must indicate this to
    the SCSI midlayer so that the ULD can prepare scsi_cmnds accordingly.

    This patch implements a host mask and various types of protection:

    - DIF Type 1-3 (between HBA and disk)
    - DIX Type 0-3 (between OS and HBA)

    The patch also allows the HBA to set the guard type to something
    different than the T10-mandated CRC.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Martin K. Petersen
     

05 Jun, 2008

1 commit

  • Some of the storage devices (that can be accessed through multiple paths),
    do need some special handling for
    1. Activating the passive path of the storage access.
    2. Decode and handle the special sense codes returned by the devices.
    3. Handle the I/Os being sent to the passive path, especially
    during the device probe time.
    when accessed through multiple paths.

    As of today this special device handling is done at the dm-multipath
    layer using dm-handlers. That works well for (1); for (2) to be handled
    at dm layer, scsi sense information need to be exported from SCSI to dm-layer,
    which is not very attractive; (3) cannot be done at all at the dm layer.

    Device handler has been moved to SCSI mainly to handle (2) and (3) properly.

    Signed-off-by: Chandra Seetharaman
    Signed-off-by: Mike Anderson
    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Chandra Seetharaman
     

24 May, 2008

1 commit

  • Reported-by: Sitsofe Wheeler
    > BUG: unable to handle kernel paging request at e6f17fac
    > IP: [] scsi_bus_uevent+0x1/0x17
    > *pde = 2714b163 *pte = 26f17160
    > Oops: 0000 [#1] DEBUG_PAGEALLOC
    > last sysfs file:
    >
    > Pid: 1, comm: swapper Not tainted (2.6.26-rc2-next-20080516skw #30)
    > EIP: 0060:[] EFLAGS: 00010282 CPU: 0
    > EIP is at scsi_bus_uevent+0x1/0x17
    > EAX: e6f18014 EBX: e6f18014 ECX: c02604d5 EDX: e7173000
    > ESI: e7173000 EDI: e7173000 EBP: e7851ca0 ESP: e7851c90
    > DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068

    The problem is caused by:

    commit b0ed43360fdca227048d88a08290365cb681c1a8
    Author: Hannes Reinecke
    Date: Tue Mar 18 14:32:28 2008 +0100

    [SCSI] add scsi_host and scsi_target to scsi_bus

    which added scsi_bus_type to the struct scsi_target device. This
    causes both the scsi_device and scsi_target to fire scsi_bus_uevents.
    However, the actualy scsi_bus_uevent() call assumes blindly that it's
    a struct scsi_device. Check for this and return immediately if it
    isn't.

    Signed-off-by: James Bottomley

    James Bottomley
     

23 Apr, 2008

4 commits

  • This patch adds release callback support, which is called when a bsg
    device goes away. bsg_register_queue() takes a pointer to a callback
    function. This feature is useful for stuff like sas_host that can't
    use the release callback in struct device.

    If a caller doesn't need bsg's release callback, it can call
    bsg_register_queue() with NULL pointer (e.g. scsi devices can use
    release callback in struct device so they don't need bsg's callback).

    With this patch, bsg uses kref for refcounts on bsg devices instead of
    get/put_device in fops->open/release. bsg calls put_device and the
    caller's release callback (if it was registered) in kref_put's
    release.

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

    FUJITA Tomonori
     
  • 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 removes the unused sysfs attibute overwriting logic for
    the scsi host attibutes, and plugs them into the driver core default
    attribute creation.

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

    Hannes Reinecke
     
  • 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
     

20 Apr, 2008

1 commit


27 Mar, 2008

1 commit