Skip to contentSkip to conversation

mt76x0u: Probing issues on Raspberry Pi 3 B+

BUG Stanislaw Gruszka 1 participant 1 message Feb 10, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Stefan Wahren
Quoted 2 lines

could you please test the following series:
https://patchwork.kernel.org/cover/10764453/

yeah this fixed the probing timeout and the driver will probe successful. AFAIK the dwc2 host mode doesn't support scatter-gather yet.

So this is either dwc2 scatter-gather problem which should be addressed in this driver or mt76x0u does something wrong when configuring SG.

Disabling SG is just workaround, which do not address actual problem.

I think I found mt76x0u issue that could cause this USB probe error (and possibly also address AMD IOMMU issue). We seems do not correctly set URB transfer length smaller than sg buffer length. Attached patch should correct that.

Stanislaw
From bc09bc7fa604019a5ef90184390e7c2a3899869d Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <[email protected]>
Date: Sun, 10 Feb 2019 08:09:48 +0100
Subject: [PATCH] mt76x02: usb_mcu: limit sg length

When sending fw data we limting urb transfer length by changing buf->len, while keeping segment length at max_payload value. That may confuse underlying drivers responsible for DMA.

---
 drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c +1 -0
index da299b8a1334..cfa14506eca6 100644
@@ -287,6 +287,7 @@ __mt76x02u_mcu_fw_send_data(struct mt76x02_dev *dev, struct mt76u_buf *buf,
 			MT_FCE_DMA_LEN, len << 16);
 
 	buf->len = MT_CMD_HDR_LEN + len + sizeof(info);
+	buf->urb->sg[0].length = buf->len;
 	err = mt76u_submit_buf(&dev->mt76, USB_DIR_OUT,
 			       MT_EP_OUT_INBAND_CMD,
 			       buf, GFP_KERNEL,