03 May, 2008

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6:
    [SCSI] aic94xx: fix section mismatch
    [SCSI] u14-34f: Fix 32bit only problem
    [SCSI] dpt_i2o: sysfs code
    [SCSI] dpt_i2o: 64 bit support
    [SCSI] dpt_i2o: move from virt_to_bus/bus_to_virt to dma_alloc_coherent
    [SCSI] dpt_i2o: use standard __init / __exit code
    [SCSI] megaraid_sas: fix suspend/resume sections
    [SCSI] aacraid: Add Power Management support
    [SCSI] aacraid: Fix jbod operations scan issues
    [SCSI] aacraid: Fix warning about macro side-effects
    [SCSI] add support for variable length extended commands
    [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer
    [SCSI] bsg: add large command support
    [SCSI] aacraid: Fix down_interruptible() to check the return value correctly
    [SCSI] megaraid_sas; Update the Version and Changelog
    [SCSI] ibmvscsi: Handle non SCSI error status
    [SCSI] bug fix for free list handling
    [SCSI] ipr: Rename ipr's state scsi host attribute to prevent collisions
    [SCSI] megaraid_mbox: fix Dell CERC firmware problem

    Linus Torvalds
     
  • Add support for variable-length, extended, and vendor specific
    CDBs to scsi-ml. It is now possible for initiators and ULD's
    to issue these types of commands. LLDs need not change much.
    All they need is to raise the .max_cmd_len to the longest command
    they support (see iscsi patch).

    - clean-up some code paths that did not expect commands to be
    larger than 16, and change cmd_len members' type to short as
    char is not enough.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

02 May, 2008

1 commit

  • - struct scsi_cmnd had a 16 bytes command buffer of its own.
    This is an unnecessary duplication and copy of request's
    cmd. It is probably left overs from the time that scsi_cmnd
    could function without a request attached. So clean that up.

    - Once above is done, few places, apart from scsi-ml, needed
    adjustments due to changing the data type of scsi_cmnd->cmnd.

    - Lots of drivers still use MAX_COMMAND_SIZE. So I have left
    that #define but equate it to BLK_MAX_CDB. The way I see it
    and is reflected in the patch below is.
    MAX_COMMAND_SIZE - means: The longest fixed-length (*) SCSI CDB
    as per the SCSI standard and is not related
    to the implementation.
    BLK_MAX_CDB. - The allocated space at the request level

    - I have audit all ISA drivers and made sure none use ->cmnd in a DMA
    Operation. Same audit was done by Andi Kleen.

    (*)fixed-length here means commands that their size can be determined
    by their opcode and the CDB does not carry a length specifier, (unlike
    the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly
    true and the SCSI standard also defines extended commands and
    vendor specific commands that can be bigger than 16 bytes. The kernel
    will support these using the same infrastructure used for VARLEN CDB's.
    So in effect MAX_COMMAND_SIZE means the maximum size command
    scsi-ml supports without specifying a cmd_len by ULD's

    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

30 Apr, 2008

1 commit


23 Apr, 2008

1 commit

  • 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
     

22 Apr, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
    SCSI: convert struct class_device to struct device
    DRM: remove unused dev_class
    IB: rename "dev" to "srp_dev" in srp_host structure
    IB: convert struct class_device to struct device
    memstick: convert struct class_device to struct device
    driver core: replace remaining __FUNCTION__ occurrences
    sysfs: refill attribute buffer when reading from offset 0
    PM: Remove destroy_suspended_device()
    Firmware: add iSCSI iBFT Support
    PM: Remove legacy PM (fix)
    Kobject: Replace list_for_each() with list_for_each_entry().
    SYSFS: Explicitly include required header file slab.h.
    Driver core: make device_is_registered() work for class devices
    PM: Convert wakeup flag accessors to inline functions
    PM: Make wakeup flags available whenever CONFIG_PM is set
    PM: Fix misuse of wakeup flag accessors in serial core
    Driver core: Call device_pm_add() after bus_add_device() in device_add()
    PM: Handle device registrations during suspend/resume
    block: send disk "change" event for rescan_partitions()
    sysdev: detect multiple driver registrations
    ...

    Fixed trivial conflict in include/linux/memory.h due to semaphore header
    file change (made irrelevant by the change to mutex).

    Linus Torvalds
     

20 Apr, 2008

1 commit


19 Apr, 2008

2 commits

  • None of these files use any of the functionality promised by
    asm/semaphore.h. It's possible that they (or some user of them) rely
    on it dragging in some unrelated header file, but I can't build all
    these files, so we'll have to fix any build failures as they come up.

    Signed-off-by: Matthew Wilcox

    Matthew Wilcox
     
  • Support for extended CDBs in iscsi.
    All we need is to check if command spills over 16 bytes then allocate
    an iscsi-extended-header for the leftovers.

    Signed-off-by: Boaz Harrosh
    Reviewed-by: Pete Wyckoff
    Signed-off-by: Mike Christie
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

08 Apr, 2008

6 commits

  • Two functions in include/scsi/sas_ata.h don't have static inlines
    leading to problems if they're built in:

    On Thu, 2008-04-03 at 14:06 +0200, Toralf Förster wrote:
    > drivers/scsi/mvsas.o: In function `sas_ata_init_host_and_port':
    > mvsas.c:(.text+0x0): multiple definition of `sas_ata_init_host_and_port'
    > drivers/scsi/libsas/built-in.o:(.text+0x37f4): first defined here
    > drivers/scsi/mvsas.o: In function `sas_ata_task_abort':
    > mvsas.c:(.text+0x7): multiple definition of `sas_ata_task_abort'
    > drivers/scsi/libsas/built-in.o:(.text+0x37fb): first defined here
    > make[2]: *** [drivers/scsi/built-in.o] Error 1
    > make[1]: *** [drivers/scsi] Error 2
    > make: *** [drivers] Error 2

    Add the correct static inline modifiers.

    Tested-by: Toralf Förster
    Signed-off-by: James Bottomley

    James Bottomley
     
  • This adds scsi_build_sense_buffer, a simple helper function to build
    sense data in a buffer.

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

    FUJITA Tomonori
     
  • This is needed by things like USB storage that want to set up static
    commands for later use at start of day.

    Signed-off-by: James Bottomley

    James Bottomley
     
  • LLDs need to copies data between the SG table in struct scsi_cmnd and
    liner buffer. So they use the helper functions like

    sg_copy_from_buffer(scsi_sglist(sc), scsi_sg_count(sc), buf, buflen)
    sg_copy_to_buffer(scsi_sglist(sc), scsi_sg_count(sc), buf, buflen)

    This patch just adds wrapper functions:

    scsi_sg_copy_from_buffer(sc, buf, buflen)
    scsi_sg_copy_to_buffer(sc, buf, buflen)

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

    FUJITA Tomonori
     
  • The problem is that serveral drivers are sending a target reset from the
    device reset handler, and if we have multiple devices a target reset gets
    sent for each device when only one would be sufficient. And if we do a target
    reset it affects all the commands on the target so the device reset handler
    code only cleaning up one devices's commands makes programming the driver a
    little more difficult than it should be.

    This patch adds a target reset handler, which drivers can use to send
    a target reset. If successful it cleans up the commands for a devices
    accessed through that starget.

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

    Mike Christie
     
  • Provide a facility to use the request_firmware() interface to get a SAS
    address from userspace. This can be used by SAS LLDDs that cannot
    obtain the address from the host adapter.

    Signed-off-by: Darrick J. Wong
    Signed-off-by: James Bottomley

    Darrick J. Wong
     

06 Mar, 2008

1 commit


24 Feb, 2008

1 commit


12 Feb, 2008

1 commit

  • Since the sg chaining patches went in, our current value of 255 for
    SG_ALL excites chaining on some drivers which cannot support it (and
    would thus oops). Redefine SG_ALL to mean no sg table size
    preference, but use the single allocation (non chained) limit. This
    also helps for drivers that use it to size an internal table.

    We'll do an opt in system later where truly chaining supporting
    drivers can define their sg_tablesize to be anything up to
    SCSI_MAX_SG_CHAIN_ELEMENTS.

    Signed-off-by: James Bottomley

    James Bottomley
     

08 Feb, 2008

8 commits


03 Feb, 2008

1 commit


31 Jan, 2008

5 commits

  • Signed-off-by: FUJITA Tomonori
    Acked-by: Douglas Gilbert
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     
  • With the sg table code, every SCSI driver is now either chain capable
    or broken (or has sg_tablesize set so chaining is never activated), so
    there's no need to have a check in the host template.

    Also tidy up the code by moving the scatterlist size defines into the
    SCSI includes and permit the last entry of the scatterlist pools not
    to be a power of two.
    Signed-off-by: James Bottomley

    James Bottomley
     
  • At the block level bidi request uses req->next_rq pointer for a second
    bidi_read request.
    At Scsi-midlayer a second scsi_data_buffer structure is used for the
    bidi_read part. This bidi scsi_data_buffer is put on
    request->next_rq->special. Struct scsi_cmnd is not changed.

    - Define scsi_bidi_cmnd() to return true if it is a bidi request and a
    second sgtable was allocated.

    - Define scsi_in()/scsi_out() to return the in or out scsi_data_buffer
    from this command This API is to isolate users from the mechanics of
    bidi.

    - Define scsi_end_bidi_request() to do what scsi_end_request() does but
    for a bidi request. This is necessary because bidi commands are a bit
    tricky here. (See comments in body)

    - scsi_release_buffers() will also release the bidi_read scsi_data_buffer

    - scsi_io_completion() on bidi commands will now call
    scsi_end_bidi_request() and return.

    - The previous work done in scsi_init_io() is now done in a new
    scsi_init_sgtable() (which is 99% identical to old scsi_init_io())
    The new scsi_init_io() will call the above twice if needed also for
    the bidi_read command. Only at this point is a command bidi.

    - In scsi_error.c at scsi_eh_prep/restore_cmnd() make sure bidi-lld is not
    confused by a get-sense command that looks like bidi. This is done
    by puting NULL at request->next_rq, and restoring.

    [jejb: update to sg_table and resolve conflicts
    also update to blk-end-request and resolve conflicts]

    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • In preparation for bidi we abstract all IO members of scsi_cmnd,
    that will need to duplicate, into a substructure.

    - Group all IO members of scsi_cmnd into a scsi_data_buffer
    structure.
    - Adjust accessors to new members.
    - scsi_{alloc,free}_sgtable receive a scsi_data_buffer instead of
    scsi_cmnd. And work on it.
    - Adjust scsi_init_io() and scsi_release_buffers() for above
    change.
    - Fix other parts of scsi_lib/scsi.c to members migration. Use
    accessors where appropriate.

    - fix Documentation about scsi_cmnd in scsi_host.h

    - scsi_error.c
    * Changed needed members of struct scsi_eh_save.
    * Careful considerations in scsi_eh_prep/restore_cmnd.

    - sd.c and sr.c
    * sd and sr would adjust IO size to align on device's block
    size so code needs to change once we move to scsi_data_buff
    implementation.
    * Convert code to use scsi_for_each_sg
    * Use data accessors where appropriate.

    - tgt: convert libsrp to use scsi_data_buffer

    - isd200: This driver still bangs on scsi_cmnd IO members,
    so need changing

    [jejb: rebased on top of sg_table patches fixed up conflicts
    and used the synergy to eliminate use_sg and sg_count]

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

    Boaz Harrosh
     
  • If we export scsi_init_io()/scsi_release_buffers() instead of
    scsi_{alloc,free}_sgtable() from scsi_lib than tgt code is much more
    insulated from scsi_lib changes. As a bonus it will also gain bidi
    capability when it comes.

    [jejb: rebase on to sg_table and fix up rejections]

    Signed-off-by: Boaz Harrosh
    Acked-by: FUJITA Tomonori
    Signed-off-by: Andrew Morton
    Signed-off-by: James Bottomley

    Boaz Harrosh
     

28 Jan, 2008

1 commit


26 Jan, 2008

1 commit


24 Jan, 2008

3 commits

  • This removes static array sense_buffer in scsi_cmnd and uses
    dynamically allocated sense_buffer (with GFP_DMA).

    The reason for doing this is that some architectures need cacheline
    aligned buffer for DMA:

    http://lkml.org/lkml/2007/11/19/2

    The problems are that scsi_eh_prep_cmnd puts scsi_cmnd::sense_buffer
    to sglist and some LLDs directly DMA to scsi_cmnd::sense_buffer. It's
    necessary to DMA to scsi_cmnd::sense_buffer safely. This patch solves
    these issues.

    __scsi_get_command allocates sense_buffer via kmem_cache_alloc and
    attaches it to a scsi_cmnd so everything just work as before.

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

    FUJITA Tomonori
     
  • The macro tells us whether the device is (or contains) an enclosure device.

    Signed-off-by: James Bottomley

    James Bottomley
     
  • This patch adds a new scsi_device flag (last_sector_bug) for devices
    which contain a bug where the device crashes when the last sector is
    read in a larger then 1 sector read.

    This is for example the case with sdcards in the HP PSC1350 printer
    cardreader and in the HP PSC1610 printer cardreader.

    Signed-off-by: Hans de Goede
    Signed-off-by: James Bottomley

    Hans de Goede
     

12 Jan, 2008

3 commits

  • This is bad for two reasons:

    1. If they're returned to outside applications, no-one knows what
    they mean.
    2. Eventually they'll clash with the ever expanding standard error
    codes.

    The problem error code in question is ETASK. I've replaced this by
    ECOMM (communications error on send) a network error code that seems to
    most closely relay what ETASK meant.

    Acked-by: Darrick J. Wong
    Signed-off-by: James Bottomley

    James Bottomley
     
  • This adds support for host side SMP processing, via a separate
    SMP interpreter file.

    Signed-off-by: James Bottomley

    James Bottomley
     
  • Convert xmit to iscsi chunks.

    from michaelc@cs.wisc.edu:

    Bug fixes, more digest integration, sg chaining conversion and other
    sg wrapper changes, coding style sync up, and removal of io fields,
    like pdu_sent, that are not needed.

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

    Olaf Kirch