30 Oct, 2011

1 commit


15 Mar, 2011

1 commit

  • SBC3r26 contains many changes to the Logical Block Provisioning
    interfaces (formerly known as Thin Provisioning ditto). This patch
    implements support for both the old and new schemes using the same
    heuristic as before (whether the LBP VPD page is present).

    The new code also allows the provisioning mode (i.e. choice of command)
    to be overridden on a per-device basis via sysfs. Two additional modes
    are supported in this version:

    - WRITE SAME(10) with the UNMAP bit set

    - WRITE SAME(10) without the UNMAP bit set. This allows us to support
    devices that predate the TP/LBP enhancements in SBC3 and which work
    by way zero-detection

    Switching between modes has been consolidated in a helper function that
    also updates the block layer topology according to the limitations of
    the chosen command.

    I experimented with trying WRITE SAME(16) if UNMAP fails, WRITE SAME(10)
    if WRITE SAME(16) fails, etc. but found several devices that got
    cranky. So for now we'll disable discard if one of the commands
    fail. The user still has the option of selecting a different mode in
    sysfs.

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

    Martin K. Petersen
     

14 Jan, 2011

1 commit

  • Replace sd_media_change() with sd_check_events().

    * Move media removed logic into set_media_not_present() and
    media_not_present() and set sdev->changed iff an existing media is
    removed or the device indicates UNIT_ATTENTION.

    * Make sd_check_events() sets sdev->changed if previously missing
    media becomes present.

    * Event is reported only if sdev->changed is set.

    This makes media presence event reported if scsi_disk->media_present
    actually changed or the device indicated UNIT_ATTENTION. For backward
    compatibility, SDEV_EVT_MEDIA_CHANGE is generated each time
    sd_check_events() detects media change event.

    [jejb: fix boot failure]
    Signed-off-by: Tejun Heo
    Acked-by: Jens Axboe
    Signed-off-by: James Bottomley

    Tejun Heo
     

12 Oct, 2010

1 commit


18 Sep, 2010

1 commit

  • Add support for the Thin Provisioning VPD page and use the TPU and TPWS
    bits to switch between UNMAP and WRITE SAME(16) for discards. If no TP
    VPD page is present we fall back to old scheme where the max descriptor
    count combined with the max lba count are used trigger UNMAP.

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

    Martin K. Petersen
     

06 Sep, 2010

1 commit

  • We have been seeing the flush request timeout with a wide
    range of hardware from tgt+iser to FC targets from a major vendor.

    After discussions about if the value should be configurable and
    what the best value should be, this patch just increases the flush/sync
    cache timeout to 1 minute. 2 minutes was determined to be too long, and
    making it configurable was troublesome for users.

    This patch was made over Linus's tree. It is not made over scsi-misc
    or scsi-rc-fixes, because Linus's had block layer changes that my
    patch was built over.

    Signed-off-by: Mike Christie
    Acked-by: Jens Axboe
    Signed-off-by: James Bottomley

    Mike Christie
     

08 Aug, 2010

1 commit

  • Every user of the BKL in the sd driver is the
    result of the pushdown from the block layer
    into the open/close/ioctl functions.

    The only place that used to rely on the BKL is
    the sdkp->openers variable, which gets converted
    into an atomic_t.

    Nothing else seems to rely on the BKL, since the
    functions do not touch global data without holding
    another lock, and the open/close functions are
    still protected from concurrent execution using
    the bdev->bd_mutex.

    Signed-off-by: Arnd Bergmann
    Cc: linux-scsi@vger.kernel.org
    Cc: "James E.J. Bottomley"
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Arnd Bergmann
     

10 Dec, 2009

1 commit

  • Implement a function for handling discard requests that sends either
    WRITE SAME(16) or UNMAP(10) depending on parameters indicated by the
    device in the block limits VPD.

    Extract unmap constraints and report them to the block layer.

    Based in part by a patch by Christoph Hellwig .

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

    Martin K. Petersen
     

02 Oct, 2009

2 commits

  • Disks formatted with DIF Type 2 reject READ/WRITE 6/10/12/16 commands
    when protection is enabled. Only the 32-byte variants are supported.

    Implement support for issusing 32-byte READ/WRITE and enable Type 2
    drives in the protection type detection logic.

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

    Martin K. Petersen
     
  • So far we have only issued DIF commands if CONFIG_BLK_DEV_INTEGRITY is
    enabled. However, communication between initiator and target should be
    independent of protection information DMA. There are DIF-only host
    adapters coming out that will be able to take advantage of this.

    Move the relevant DIF bits to sd.c.

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

    Martin K. Petersen
     

21 Jun, 2009

1 commit


18 Mar, 2009

1 commit

  • sd_revalidate ends up being called several times during device setup.
    With this patch we print everything during the first scan. Subsequent
    invocations will only print a message if the parameter in question has
    actually changed (LUN capacity has increased, etc.).

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

    Martin K. Petersen
     

15 Oct, 2008

1 commit


13 Oct, 2008

1 commit


06 Aug, 2008

1 commit

  • This re-introduces commit 2b142900784c6e38c8d39fa57d5f95ef08e735d8,
    which was reverted due to the regression it caused by commit
    fca082c9f1e11ec07efa8d2f9f13688521253f36.

    That regression was not root-caused by the original commit, it was just
    uncovered by it, and the real fix was done by Alan Stern in commit
    580da34847488b404218d1d7f53b156f245f5555 ("Fix USB storage hang on
    command abort").

    We can thus re-introduce the change that was confirmed by Alan Jenkins
    to be still required by his odd card reader.

    Cc: Alan Jenkins
    Cc: Alan Stern
    Cc: James Bottomley
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

05 Aug, 2008

1 commit

  • This reverts commit 2b142900784c6e38c8d39fa57d5f95ef08e735d8, since it
    seems to break some other USB storage devices (at least a JMicron USB to
    ATA bridge). As such, while it apparently fixes some cardreaders, it
    would need to be made conditional on the exact reader it fixes in order
    to avoid causing regressions.

    Cc: Alan Jenkins
    Cc: James Bottomley
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

27 Jul, 2008

3 commits

  • The last_sector_bug flag was added to work around a bug in certain usb
    cardreaders, where they would crash if a multiple sector read included the
    last sector. The original implementation avoids this by e.g. splitting an 8
    sector read which includes the last sector into a 7 sector read, and a single
    sector read for the last sector. The flag is enabled for all USB devices.

    This revealed a second bug in other usb cardreaders, which crash when they
    get a multiple sector read which stops 1 sector short of the last sector.
    Affected hardware includes the Kingston "MobileLite" external USB cardreader
    and the internal USB cardreader on the Asus EeePC.

    Extend the last_sector_bug workaround to ensure that any access which touches
    the last 8 hardware sectors of the device is a single sector long. Requests
    are shrunk as necessary to meet this constraint.

    This gives us a safety margin against potential unknown or future bugs
    affecting multi-sector access to the end of the device. The two known bugs
    only affect the last 2 sectors. However, they suggest that these devices
    are prone to fencepost errors and that multi-sector access to the end of the
    device is not well tested. Popular OS's use multi-sector accesses, but they
    rarely read the last few sectors. Linux (with udev & vol_id) automatically
    reads sectors from the end of the device on insertion. It is assumed that
    single sector accesses are more thoroughly tested during development.

    Signed-off-by: Alan Jenkins
    Tested-by: Alan Jenkins
    Signed-off-by: James Bottomley

    Alan Jenkins
     
  • Support for controllers and disks that implement DIF protection
    information:

    - During command preparation the RDPROTECT/WRPROTECT must be set
    correctly if the target has DIF enabled.

    - READ(6) and WRITE(6) are not supported when DIF is on.

    - The controller must be told how to handle the I/O via the
    protection operation field in scsi_cmnd.

    - Refactor the I/O completion code that extracts failed LBA from the
    returned sense data and handle DIF failures correctly.

    - sd_dif.c implements the functions required to prepare and complete
    requests with protection information attached.

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

    Martin K. Petersen
     
  • If a disk is formatted with protection information (Inquiry bit
    PROTECT=1) it is required to support Read Capacity(16). Force use of
    the 16-bit command in this case and extract the P_TYPE field which
    indicates whether the disk is formatted using DIF Type 1, 2 or 3.

    The ATO (App Tag Own) bit in the Control Mode Page indicates whether
    the storage device or the initiator own the contents of the
    DIF application tag.

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

    Martin K. Petersen
     

12 Jul, 2008

2 commits