25 Jan, 2011

1 commit


14 Jan, 2011

2 commits

  • * 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block: (43 commits)
    block: ensure that completion error gets properly traced
    blktrace: add missing probe argument to block_bio_complete
    block cfq: don't use atomic_t for cfq_group
    block cfq: don't use atomic_t for cfq_queue
    block: trace event block fix unassigned field
    block: add internal hd part table references
    block: fix accounting bug on cross partition merges
    kref: add kref_test_and_get
    bio-integrity: mark kintegrityd_wq highpri and CPU intensive
    block: make kblockd_workqueue smarter
    Revert "sd: implement sd_check_events()"
    block: Clean up exit_io_context() source code.
    Fix compile warnings due to missing removal of a 'ret' variable
    fs/block: type signature of major_to_index(int) to major_to_index(unsigned)
    block: convert !IS_ERR(p) && p to !IS_ERR_NOR_NULL(p)
    cfq-iosched: don't check cfqg in choose_service_tree()
    fs/splice: Pull buf->ops->confirm() from splice_from_pipe actors
    cdrom: export cdrom_check_events()
    sd: implement sd_check_events()
    sr: implement sr_check_events()
    ...

    Linus Torvalds
     
  • * '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
     

31 Dec, 2010

2 commits


23 Dec, 2010

1 commit


22 Dec, 2010

6 commits

  • This patch adds a handful of missing CDBs defs that are used by TCM
    persistent reservation logic in the SPC-4 defined CDB exclusion table for
    registrations and reservations.

    This includes a number of missing MI_* and MO_* prefixed service actions defs
    for MAINTENANCE_IN and MAINTENANCE_OUT that are mentioned wrt to persistent
    registration and reservation status for the SCSI Initiator Port.

    Signed-off-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Nicholas Bellinger
     
  • The statistics for InputMegabytes and OutputMegabytes are
    misnamed. They're accumulating bytes, not megabytes.

    The statistic returned via /sys must be in megabytes, however,
    which is what the HBA-API wants. The FCP code needs to accumulate
    it in bytes and then divide by 1,000,000 (not 2^20) before it
    presented via sysfs.

    This affects fcoe.ko only, not fnic. The fnic driver
    correctly by accumulating bytes and then converts to megabytes.

    I checked that libhbalinux is using the /sys file directly without
    conversion.

    BTW, qla2xxx does divide by 2^20, which I'm not fixing here.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • Switches using multiple-FCFs may reject FLOGI in order to
    balance the load between multiple FCFs. Even though the FCF
    was available, it may have more load at the point we actually
    send the FLOGI.

    If the FLOGI fails, select a different FCF
    if possible, among those with the same priority. If no other
    FCF is available, just deliver the reject to libfc for retry.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • We can easily remove the tgt_flags from fc_fcp_pkt struct
    and use rpriv->tgt_flags directly where needed.

    Signed-off-by: John Fastabend
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    john fastabend
     
  • The patch fixes the following situations where NOP-Out pkt is called for:
    - local unsolicited NOP-Out requests (requesting no NOP-In response)
    - local NOP-Out responses to unsolicited NOP-In requests

    kernel panic is observed due to double session spin_lock requests; one in the
    bnx2i_process_nopin_local_cmpl routine in bnx2i_hwi.c and the other in the
    iscsi_put_task routine in libiscsi.c

    The proposed fix is to export the currently static __iscsi_put_task() routine
    and have bnx2i call it directly instead of the iscsi_put_task() routine which
    holds the session spin lock.

    Signed-off-by: Eddie Wai
    Reviewed-by: Michael Chan
    Reviewed-by: Anil Veerabhadrappa
    Acked-by: Benjamin Li
    Reviewed-by: Mike Christie
    Signed-off-by: James Bottomley

    Eddie Wai
     
  • To date libsas has only looked at the attached sas address when
    determining the formation of wide ports. The specification and some
    hardware expects that phys with different addresses will not form a wide
    port unless the local peer phys also match each other. Introduce a flag
    to select stricter behavior at sas_register_ha() time. The flag can be
    dropped once it is known that all libsas users expect the same behavior.

    Current drivers just initialize this field to zero and get the
    traditional behavior.

    Reported-by: Patrick Thomson
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Dan Williams
     

17 Dec, 2010

1 commit

  • Replace sr_media_change() with sr_check_events(). It normally only
    uses GET_EVENT_STATUS_NOTIFICATION to check both media change and
    eject request. If @clearing includes DISK_EVENT_MEDIA_CHANGE, it
    issues TUR and compares whether media presence has changed. The SCSI
    specific media change uevent is kept for compatibility.

    sr_media_change() was doing both media change check and revalidation.
    The revalidation part is split into sr_block_revalidate_disk().

    Signed-off-by: Tejun Heo
    Cc: Kay Sievers
    Signed-off-by: Jens Axboe

    Tejun Heo
     

17 Nov, 2010

1 commit

  • Move the mid-layer's ->queuecommand() invocation from being locked
    with the host lock to being unlocked to facilitate speeding up the
    critical path for drivers who don't need this lock taken anyway.

    The patch below presents a simple SCSI host lock push-down as an
    equivalent transformation. No locking or other behavior should change
    with this patch. All existing bugs and locking orders are preserved.

    Additionally, add one parameter to queuecommand,
    struct Scsi_Host *
    and remove one parameter from queuecommand,
    void (*done)(struct scsi_cmnd *)

    Scsi_Host* is a convenient pointer that most host drivers need anyway,
    and 'done' is redundant to struct scsi_cmnd->scsi_done.

    Minimal code disturbance was attempted with this change. Most drivers
    needed only two one-line modifications for their host lock push-down.

    Signed-off-by: Jeff Garzik
    Acked-by: James Bottomley
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

02 Nov, 2010

1 commit

  • "gadget", "through", "command", "maintain", "maintain", "controller", "address",
    "between", "initiali[zs]e", "instead", "function", "select", "already",
    "equal", "access", "management", "hierarchy", "registration", "interest",
    "relative", "memory", "offset", "already",

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Jiri Kosina

    Uwe Kleine-König
     

01 Nov, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (70 commits)
    [SCSI] pmcraid: add support for set timestamp command and other fixes
    [SCSI] pmcraid: remove duplicate struct member
    [SCSI] qla4xxx: Fix cmd check in qla4xxx_cmd_wait
    [SCSI] megaraid_sas: Version and documentation update
    [SCSI] megaraid_sas: Add three times Online controller reset
    [SCSI] megaraid_sas: Add input parameter for max_sectors
    [SCSI] megaraid_sas: support devices update flag
    [SCSI] libosd: write/read_sg_kern API
    [SCSI] libosd: Support for scatter gather write/read commands
    [SCSI] libosd: Free resources in reverse order of allocation
    [SCSI] libosd: Fix bug in attr_page handling
    [SCSI] lpfc 8.3.18: Update lpfc driver version to 8.3.18
    [SCSI] lpfc 8.3.18: Add new WQE support
    [SCSI] lpfc 8.3.18: Fix critical errors
    [SCSI] lpfc 8.3.18: Adapter Shutdown and Unregistration cleanup
    [SCSI] lpfc 8.3.18: Add logic to detect last devloss timeout
    [SCSI] lpfc 8.3.18: Add support of received ELS commands
    [SCSI] lpfc 8.3.18: FC/FCoE Discovery fixes
    [SCSI] ipr: add definitions for a new adapter
    [SCSI] bfa: fix comments for c files
    ...

    Linus Torvalds
     

27 Oct, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (63 commits)
    IB/qib: clean up properly if pci_set_consistent_dma_mask() fails
    IB/qib: Allow driver to load if PCIe AER fails
    IB/qib: Fix uninitialized pointer if CONFIG_PCI_MSI not set
    IB/qib: Fix extra log level in qib_early_err()
    RDMA/cxgb4: Remove unnecessary KERN_ use
    RDMA/cxgb3: Remove unnecessary KERN_ use
    IB/core: Add link layer type information to sysfs
    IB/mlx4: Add VLAN support for IBoE
    IB/core: Add VLAN support for IBoE
    IB/mlx4: Add support for IBoE
    mlx4_en: Change multicast promiscuous mode to support IBoE
    mlx4_core: Update data structures and constants for IBoE
    mlx4_core: Allow protocol drivers to find corresponding interfaces
    IB/uverbs: Return link layer type to userspace for query port operation
    IB/srp: Sync buffer before posting send
    IB/srp: Use list_first_entry()
    IB/srp: Reduce number of BUSY conditions
    IB/srp: Eliminate two forward declarations
    IB/mlx4: Signal node desc changes to SM by using FW to generate trap 144
    IB: Replace EXTRA_CFLAGS with ccflags-y
    ...

    Linus Torvalds
     

26 Oct, 2010

3 commits

  • This is a trivial addition to the SG API that can receive kernel
    pointers. It is only used by the out-of-tree test module. So
    it's immediate need is questionable. For maintenance ease it might
    just get in, as it's very small.

    John.
    do you need this in the Kernel, or is it only for osd_ktest.ko?

    Signed-off-by: John A. Chandy
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • This patch adds the Scatter-Gather (sg) API to libosd.
    Scatter-gather enables a write/read of multiple none-contiguous
    areas of an object, in a single call. The extents may overlap
    and/or be in any order.

    The Scatter-Gather list is sent to the target in what is called
    a "cdb continuation segment". This is yet another possible segment
    in the osd-out-buffer. It is unlike all other segments in that it
    sits before the actual "data" segment (which until now was always
    first), and that it is signed by itself and not part of the data
    buffer. This is because the cdb-continuation-segment is considered
    a spill-over of the CDB data, and is therefor signed under
    OSD_SEC_CAPKEY and higher.

    TODO: A new osd_finalize_request_ex version should be supplied so
    the @caps received on the network also contains a size parameter
    and can be spilled over into the "cdb continuation segment".

    Thanks to John Chandy for the original
    code, and investigations. And the implementation of SG support
    in the osd-target.

    Original-coded-by: John Chandy
    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • When number of NPIV ports created are greater than the xids
    allocated per pool -- for eg., creating 255 NPIV ports on a
    system with nr_cpu_ids of 32, with each pool containing 128
    xids -- and then generating a link event - for eg.,
    shutdown/no shutdown -- on the switch port causes the hang
    with the following stack trace.

    Call Trace:
    schedule_timeout+0x19d/0x230
    wait_for_common+0xc0/0x170
    __cancel_work_timer+0xcf/0x1b0
    fc_disc_stop+0x16/0x30 [libfc]
    fc_lport_reset_locked+0x47/0x90 [libfc]
    fc_lport_enter_reset+0x67/0xe0 [libfc]
    fc_lport_disc_callback+0xbc/0xe0 [libfc]
    fc_disc_done+0xa8/0xf0 [libfc]
    fc_disc_timeout+0x29/0x40 [libfc]
    run_workqueue+0xb8/0x140
    worker_thread+0x96/0x110
    kthread+0x96/0xa0
    child_rip+0xa/0x20

    Fix is to not cancel the disc_work if discovery is already
    stopped, thus allowing lport state machine to restart and try
    discovery again.

    Signed-off-by: Bhanu Prakash Gollapudi
    Acked-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Bhanu Prakash Gollapudi
     

23 Oct, 2010

7 commits

  • This patch adds support for SRP_CRED_REQ to avoid a lockup by targets
    that use that mechanism to return credits to the initiator. This
    prevents a lockup observed in the field where we would never add the
    credits from the SRP_CRED_REQ to our current count, and would therefore
    never send another command to the target.

    Minimal support for SRP_AER_REQ is also added, as these messages can
    also be used to convey additional credits to the initiator.

    Based upon extensive debugging and code by Bart Van Assche and a bug
    report by Chris Worley.

    Signed-off-by: David Dillow
    Signed-off-by: Roland Dreier

    David Dillow
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (141 commits)
    USB: mct_u232: fix broken close
    USB: gadget: amd5536udc.c: fix error path
    USB: imx21-hcd - fix off by one resource size calculation
    usb: gadget: fix Kconfig warning
    usb: r8a66597-udc: Add processing when USB was removed.
    mxc_udc: add workaround for ENGcm09152 for i.MX35
    USB: ftdi_sio: add device ids for ScienceScope
    USB: musb: AM35x: Workaround for fifo read issue
    USB: musb: add musb support for AM35x
    USB: AM35x: Add musb support
    usb: Fix linker errors with CONFIG_PM=n
    USB: ohci-sh - use resource_size instead of defining its own resource_len macro
    USB: isp1362-hcd - use resource_size instead of defining its own resource_len macro
    USB: isp116x-hcd - use resource_size instead of defining its own resource_len macro
    USB: xhci: Fix compile error when CONFIG_PM=n
    USB: accept some invalid ep0-maxpacket values
    USB: xHCI: PCI power management implementation
    USB: xHCI: bus power management implementation
    USB: xHCI: port remote wakeup implementation
    USB: xHCI: port power management implementation
    ...

    Manually fix up (non-data) conflict: the SCSI merge gad renamed the
    'hw_sector_size' member to 'physical_block_size', and the USB tree
    brought a new use of it.

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (84 commits)
    [SCSI] be2iscsi: SGE Len == 64K
    [SCSI] be2iscsi: Remove premature free of cid
    [SCSI] be2iscsi: More time for FW
    [SCSI] libsas: fix bug for vacant phy
    [SCSI] sd: Fix overflow with big physical blocks
    [SCSI] st: add MTWEOFI to write filemarks without flushing drive buffer
    [SCSI] libsas: Don't issue commands to devices that have been hot-removed
    [SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive
    [SCSI] lpfc 8.3.17: Update lpfc driver version to 8.3.17
    [SCSI] lpfc 8.3.17: Replace function reset methodology
    [SCSI] lpfc 8.3.17: SCSI fixes
    [SCSI] lpfc 8.3.17: BSG fixes
    [SCSI] lpfc 8.3.17: SLI Additions and Fixes
    [SCSI] lpfc 8.3.17: Code Cleanup and Locking fixes
    [SCSI] zfcp: Remove scsi_cmnd->serial_number from debug traces
    [SCSI] ipr: fix array error logging
    [SCSI] aha152x: enable PCMCIA on 64bit
    [SCSI] scsi_dh_alua: Handle all states correctly
    [SCSI] cxgb4i: connection and ddp setting update
    [SCSI] cxgb3i: fixed connection over vlan
    ...

    Linus Torvalds
     
  • * 'for-2.6.37/barrier' of git://git.kernel.dk/linux-2.6-block: (46 commits)
    xen-blkfront: disable barrier/flush write support
    Added blk-lib.c and blk-barrier.c was renamed to blk-flush.c
    block: remove BLKDEV_IFL_WAIT
    aic7xxx_old: removed unused 'req' variable
    block: remove the BH_Eopnotsupp flag
    block: remove the BLKDEV_IFL_BARRIER flag
    block: remove the WRITE_BARRIER flag
    swap: do not send discards as barriers
    fat: do not send discards as barriers
    ext4: do not send discards as barriers
    jbd2: replace barriers with explicit flush / FUA usage
    jbd2: Modify ASYNC_COMMIT code to not rely on queue draining on barrier
    jbd: replace barriers with explicit flush / FUA usage
    nilfs2: replace barriers with explicit flush / FUA usage
    reiserfs: replace barriers with explicit flush / FUA usage
    gfs2: replace barriers with explicit flush / FUA usage
    btrfs: replace barriers with explicit flush / FUA usage
    xfs: replace barriers with explicit flush / FUA usage
    block: pass gfp_mask and flags to sb_issue_discard
    dm: convey that all flushes are processed as empty
    ...

    Linus Torvalds
     
  • This commit changes storage_common.h, file_storage.c and
    f_mass_storage.c to use definitions of SCSI commands from
    scsi/scsi.h file instead of redefining the commands in
    storage_common.c.

    scsi/scsi.h header file was missing READ_FORMAT_CAPACITIES and
    READ_HEADER so this commit also add those to the header.

    Signed-off-by: Michal Nazarewicz
    Cc: Alan Stern
    Cc: James Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     
  • I seem to have a knack for digging up buggy usb devices which don't work
    with Linux, and I'm crazy enough to try to make them work. So this time a
    friend of mine asked me to get an mp4 player (an mp3 player which can play
    videos on a small screen) to work with Linux.

    It is based on the well known rockbox chipset for which we already have an
    unusual devs entries to work around some of its bugs. But this model
    comes with an additional twist.

    This model chokes on read_capacity_16 calls. Now normally we don't make
    those calls, but this model comes with an sdcard slot and when there is no
    card in there (and shipped from the factory there is none), it reports a
    size of 0. However this time the programmers actually got the
    read_capacity_10 response right! So they substract one from the size as
    stored internally in the mp3 player before reporting it back, resulting in
    an answer of ... 0xffffffff sectors, causing sd.c to try a
    read_capacity_16, on which the device crashes.

    This patch adds a flag to scsi_device to indicate that a a device cannot
    handle read_capacity_16, and when this flag is set if a device reports an
    lba of 0xffffffff as answer to a read_capacity_10, assumes it tries to
    report a size of 0.

    Signed-off-by: Hans de Goede
    Cc: James Bottomley
    Cc: Alan Stern
    Cc: Matthew Dharm
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • Some USB devices emulate a usb-mass-storage attached (scsi) cdrom device,
    usually this fake cdrom contains the windows software for the device.
    While working on supporting Appotech ax3003 based photoframes, which do
    this I discovered that they will go of into lala land when ever they see a
    READ_DISC_INFO scsi command.

    Thus this patch adds a scsi_device flag (which can then be set by the
    usb-storage driver through an unsual-devs entry), to indicate this, and
    makes the sr driver honor this flag.

    I know this sucks, but as discussed on linux-scsi list there is no other
    way to make this device work properly.

    Looking at usb traces made under windows, windows never sends a
    READ_DISC_INFO during normal interactions with a usb cdrom device. So as
    this cdrom emulation thingie becomes more common we might see more of this
    problem.

    Signed-off-by: Hans de Goede
    Cc: James Bottomley
    Cc: Alan Stern
    Cc: Matthew Dharm
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     

09 Oct, 2010

1 commit

  • sd will get hung up issuing commands to flush write cache if a SAS
    device behind the expander is unplugged without warning. Change libsas
    to reject commands to domain devices that have already gone away.

    [maciej.trela@intel.com: removed setting ->gone in sas_deform_port() to
    permit sync cache commands at module removal]

    Signed-off-by: Darrick J. Wong
    Tested-by: Haipao Fan
    Signed-off-by: Maciej Trela
    Signed-off-by: Dan Williams
    Signed-off-by: James Bottomley

    Darrick J. Wong
     

08 Oct, 2010

1 commit

  • This adds a fc host dev loss sysfs file. Instead of
    calling into the driver using the get_host_def_dev_loss_tmo
    callback, we allow drivers to init the dev loss like is done
    for other fc host params, and then the fc class will handle
    updating the value if the user writes to the new sysfs file.

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

    Mike Christie
     

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
     

10 Sep, 2010

1 commit

  • REQ_HARDBARRIER is deprecated. Remove spurious uses in the following
    users. Please note that other than osdblk, all other uses were
    already spurious before deprecation.

    * osdblk: osdblk_rq_fn() won't receive any request with
    REQ_HARDBARRIER set. Remove the test for it.

    * pktcdvd: use of REQ_HARDBARRIER in pkt_generic_packet() doesn't mean
    anything. Removed.

    * aic7xxx_old: Setting MSG_ORDERED_Q_TAG on REQ_HARDBARRIER is
    spurious. Removed.

    * sas_scsi_host: Setting TASK_ATTR_ORDERED on REQ_HARDBARRIER is
    spurious. Removed.

    * scsi_tcq: The ordered tag path wasn't being used anyway. Removed.

    Signed-off-by: Tejun Heo
    Acked-by: Boaz Harrosh
    Cc: James Bottomley
    Cc: Peter Osterlund
    Signed-off-by: Jens Axboe

    Tejun Heo
     

06 Sep, 2010

1 commit


11 Aug, 2010

1 commit

  • Commit 9e4f5e29 ("FC Pass Thru support") exported a number of header files
    in include/scsi to user space, but didn't change the uX types to the
    userspace-compatible __uX types. Without that you'll get compile errors
    when including them - E.G.:

    include/scsi/scsi.h:145: error: expected specifier-qualifier-list before `u8'

    Signed-off-by: Peter Korsgaard
    Cc: Boaz Harrosh
    Cc: James Smart
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Korsgaard
     

28 Jul, 2010

7 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
     
  • We have two separate definitions for identical constants with nearly the
    same name. One comes from the generic headers in scsi.h; the other is
    an enum in libsas.h ... it's causing confusion about which one is
    correct (fortunately they both are).

    Fix this by eliminating the libsas.h duplicate

    Signed-off-by: James Bottomley

    James Bottomley
     
  • wait for session to come online in eh_device_reset_handler
    and eh_target_reset_handler

    Signed-off-by: Mike Christie
    Signed-off-by: Vikas Chaudhary
    Signed-off-by: Ravi Anand
    Signed-off-by: James Bottomley

    Mike Christie
     
  • Incoming requests shouldn't require a local exchange if we're
    just going to reply with one or two frames and don't expect
    anything further. Don't allocate exchanges for such requests
    until requested by the upper-layer protocol.

    The sequence is always NULL for new requests, so remove
    that as an argument to request handlers.

    Also change the first argument to lport->tt.seq_els_rsp_send
    from the sequence pointer to the received frame pointer, to
    supply the exchange IDs and destination ID info.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • For incoming ELS and FCP requests, we often don't require an
    exchange and sequence, however, sometimes we do. For those cases,
    (primarily FCP requests for targets) add a function to set up
    the exchange and sequence.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • Add functions to fill in an FC header given a request header.
    These reduces code lines in fc_lport and fc_rport and works
    without an exchange/sequence assigned.

    fc_fill_reply_hdr() fills a header for a final reply frame.

    fc_fill_hdr() which is similar but allows specifying the
    f_ctl parameter.

    Add defines for F_CTL values FC_FCTL_REQ and FC_FCTL_RESP.
    These can be used for most request and response sequences.

    v2 of patch adds a line to copy the frame encapsulation
    info from the received frame.

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt
     
  • To pave the way for eliminating exchanges from incoming requests,
    add simple inline fc_frame_sid() and fc_frame_did() functions
    which get the FC_IDs from the frame header. This can be almost
    as efficient as getting them from the sequence/exchange.

    Move ntohll, htonll, ntoh24 and hton24 to
    since we need them there and that's included by

    Signed-off-by: Joe Eykholt
    Signed-off-by: Robert Love
    Signed-off-by: James Bottomley

    Joe Eykholt