Thread (6 messages) 6 messages, 3 authors, 2024-12-24

Re: [RESEND. PATCH] mt76: mt76u_vendor_request: Do not print error messages when -EPROTO

From: Alexander Lobakin <aleksander.lobakin@intel.com>
Date: 2024-12-18 16:12:43
Also in: linux-mediatek, linux-usb, linux-wireless, lkml

From: Wangyuli <redacted>
Date: Wed, 18 Dec 2024 17:08:33 +0800
[RESEND. PATCH] mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
Is it a fix or an improvement?
You need to specify the target tree, either 'PATCH net' (fixes) or
'PATCH net-next' (improvements).

The '.' after 'RESEND' is not needed.
When initializing the network card, unplugging the device will
trigger an -EPROTO error, resulting in a flood of error messages
being printed frantically.
If it's a fix, you need to have a 'Fixes:' tag here.
quoted hunk ↗ jump to hunk
Co-developed-by: Xu Rao <redacted>
Signed-off-by: Xu Rao <redacted>
Signed-off-by: WangYuli <redacted>
---
 drivers/net/wireless/mediatek/mt76/usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index 58ff06823389..f9e67b8c3b3c 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -33,9 +33,9 @@ int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, u8 req_type,
 
 		ret = usb_control_msg(udev, pipe, req, req_type, val,
 				      offset, buf, len, MT_VEND_REQ_TOUT_MS);
-		if (ret == -ENODEV)
+		if (ret == -ENODEV || ret == -EPROTO)
 			set_bit(MT76_REMOVED, &dev->phy.state);
-		if (ret >= 0 || ret == -ENODEV)
+		if (ret >= 0 || ret == -ENODEV || ret == -EPROTO)
 			return ret;
 		usleep_range(5000, 10000);
How do other drivers handle this?
Can -EPROTO happen in other cases, not only unplugging, which this patch
would break?

Thanks,
Olek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help