From fa6903d8aeb06fef5facd6279e3d3702100b810c Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Fri, 21 Aug 2026 16:11:27 +0100 Subject: [PATCH 1/2] DT: rp1: remove dwc3 parkmode-disable-hs quirk This quirk has a negative impact on most USB mass-storage devices. The description of the feature in the databook is conflated with a case where parkmode performs badly with specific devices, but doesn't assign importance to this statement: "When park mode is disabled, pipelining of multiple packets is disabled and instead one packet at a time is requested by the scheduler." Removing the pipelining causes inter-transaction latency of the order of 4us when a single HS bulk endpoint is being serviced. This drops USB mass-storage sequential performance by 20%. RP1 has separate bus instances for each USB2 port, so the multi-device case that theoretically suffers is even less likely to occur. In https://github.com/raspberrypi/linux/pull/5892 this feature was disabled at the recommendation of Synopsys, not through a requirement to fix an interop bug with a device in the field. So turn "park mode" back on for HS. Signed-off-by: Jonathan Bell --- arch/arm64/boot/dts/broadcom/rp1.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm64/boot/dts/broadcom/rp1.dtsi b/arch/arm64/boot/dts/broadcom/rp1.dtsi index 4c2a06cb85e86..7141dfcff4e70 100644 --- a/arch/arm64/boot/dts/broadcom/rp1.dtsi +++ b/arch/arm64/boot/dts/broadcom/rp1.dtsi @@ -1126,7 +1126,6 @@ snps,dis_rxdet_inp3_quirk; snps,enhanced-nak-fs-quirk; snps,parkmode-disable-ss-quirk; - snps,parkmode-disable-hs-quirk; snps,parkmode-disable-fsls-quirk; snps,tx-max-burst = /bits/ 8 <8>; snps,tx-thr-num-pkt = /bits/ 8 <2>; @@ -1143,7 +1142,6 @@ snps,dis_rxdet_inp3_quirk; snps,enhanced-nak-fs-quirk; snps,parkmode-disable-ss-quirk; - snps,parkmode-disable-hs-quirk; snps,parkmode-disable-fsls-quirk; snps,tx-max-burst = /bits/ 8 <8>; snps,tx-thr-num-pkt = /bits/ 8 <2>; From 0ef14e23500b708b8e31cd035924ceeae8c8c78c Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 26 Aug 2026 14:10:10 +0100 Subject: [PATCH 2/2] usb-storage: pick better defaults for max_sectors Apply the higher USB3 limit to USB3 devices connected to USB2 ports, detectable through the existence of a SuperSpeed companion descriptor. For 16K page platforms, use 192 in preference to 240 as this breaks transfers on a 64-sector boundary instead of 32. Middle-of-the-range devices show a modest sequential speed increase with 64s alignment. Signed-off-by: Jonathan Bell --- drivers/usb/storage/scsiglue.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index d2f476e48d0c7..f81c997656f59 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -111,7 +111,8 @@ static int sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) * let the queue segment size sort out the real limit. */ lim->max_hw_sectors = 0x7FFFFF; - } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) { + } else if (us->pusb_dev->speed >= USB_SPEED_SUPER || + (us->pusb_dev->bos && us->pusb_dev->bos->ss_cap)) { /* * USB3 devices will be limited to 2048 sectors. This gives us * better throughput on most devices. @@ -119,6 +120,15 @@ static int sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) lim->max_hw_sectors = 2048; } + /* + * The default of 240 sectors on 16K page platforms causes decomposition + * of transfers into lengths of 224 sectors aligned to 32 sectors. + * Middle-of-the-range devices show a modest sequential speed increase + * with 192 sectors (64s alignment). + */ + if (lim->max_hw_sectors == 240 && PAGE_SIZE == SZ_16K) + lim->max_hw_sectors = 192; + /* * The max_hw_sectors should be up to maximum size of a mapping for * the device. Otherwise, a DMA API might fail on swiotlb environment.