diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-11-21 11:46:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-07 12:59:57 -0500 |
commit | 96983d2d861bf94b7f70bc47ac3c5b289f519a2d (patch) | |
tree | 562c8f19df7dcf8bd2ad9a399e09fae71fcd8046 /drivers/usb/storage/scsiglue.c | |
parent | 3dae5345311271fe598a61bd01f563fc835b4217 (diff) |
USB: storage: set bounce limit for non-DMA-capable host controllers
This patch (as1175) makes usb-storage set a SCSI device's
request-queue bounce limit such that all buffers will be located in
addressable memory (i.e., not in high memory) if the host controller's
dma_mask is NULL. This is necessary when the host controller doesn't
support DMA: If a buffer is in high memory then the both the virtual
and DMA addresses produced by the scatter-gather library will be NULL,
preventing the HCD from accessing the buffer's data.
In particular, the isp1760 driver needs this when used on a system
with more than 1 GB of memory.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Tested-by: Thomas Hommel <Thomas.Hommel@gefanuc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 1b35e011a34f..e9d6c196a7ab 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -129,6 +129,14 @@ static int slave_configure(struct scsi_device *sdev) | |||
129 | max_sectors); | 129 | max_sectors); |
130 | } | 130 | } |
131 | 131 | ||
132 | /* Some USB host controllers can't do DMA; they have to use PIO. | ||
133 | * They indicate this by setting their dma_mask to NULL. For | ||
134 | * such controllers we need to make sure the block layer sets | ||
135 | * up bounce buffers in addressable memory. | ||
136 | */ | ||
137 | if (!us->pusb_dev->bus->controller->dma_mask) | ||
138 | blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH); | ||
139 | |||
132 | /* We can't put these settings in slave_alloc() because that gets | 140 | /* We can't put these settings in slave_alloc() because that gets |
133 | * called before the device type is known. Consequently these | 141 | * called before the device type is known. Consequently these |
134 | * settings can't be overridden via the scsi devinfo mechanism. */ | 142 | * settings can't be overridden via the scsi devinfo mechanism. */ |