summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-04-09 16:37:31 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2024-04-11 21:37:48 -0400
commit6248d7f7714f018f2c02f356582784e74596f8e8 (patch)
tree3ed59a406d61d664e516b9709ce3f86aeb4d5b49 /drivers/usb
parent7eaae991c30d46a4ea45aa00f50eba939d7f951b (diff)
scsi: core: Add a no_highmem flag to struct Scsi_Host
While we really should be killing the block layer bounce buffering ASAP, I even more urgently need to stop the drivers to fiddle with the limits from ->slave_configure. Add a no_highmem flag to the Scsi_Host to centralize this setting and switch the remaining four drivers that use block layer bounce buffering to it. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20240409143748.980206-7-hch@lst.de Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/storage/scsiglue.c10
-rw-r--r--drivers/usb/storage/usb.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 12cf9940e5b6..1d14c678f3d3 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -40,7 +40,6 @@
#include <scsi/scsi_eh.h>
#include "usb.h"
-#include <linux/usb/hcd.h>
#include "scsiglue.h"
#include "debug.h"
#include "transport.h"
@@ -131,15 +130,6 @@ static int slave_configure(struct scsi_device *sdev)
dma_max_mapping_size(dev) >> SECTOR_SHIFT));
/*
- * Some USB host controllers can't do DMA; they have to use PIO.
- * For such controllers we need to make sure the block layer sets
- * up bounce buffers in addressable memory.
- */
- if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) ||
- (bus_to_hcd(us->pusb_dev->bus)->localmem_pool != NULL))
- blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH);
-
- /*
* We can't put these settings in slave_alloc() because that gets
* called before the device type is known. Consequently these
* settings can't be overridden via the scsi devinfo mechanism.
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index d1ad6a2509ab..a49a31639f6f 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -47,6 +47,7 @@
#include <scsi/scsi_device.h>
#include "usb.h"
+#include <linux/usb/hcd.h>
#include "scsiglue.h"
#include "transport.h"
#include "protocol.h"
@@ -961,6 +962,15 @@ int usb_stor_probe1(struct us_data **pus,
if (result)
goto BadDevice;
+ /*
+ * Some USB host controllers can't do DMA; they have to use PIO.
+ * For such controllers we need to make sure the block layer sets
+ * up bounce buffers in addressable memory.
+ */
+ if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) ||
+ bus_to_hcd(us->pusb_dev->bus)->localmem_pool)
+ host->no_highmem = true;
+
/* Get the unusual_devs entries and the descriptors */
result = get_device_info(us, id, unusual_dev);
if (result)