netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND. PATCH] mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
@ 2024-12-18  9:08 WangYuli
  2024-12-18 16:10 ` Alexander Lobakin
  0 siblings, 1 reply; 7+ messages in thread
From: WangYuli @ 2024-12-18  9:08 UTC (permalink / raw)
  To: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, kvalo,
	matthias.bgg, angelogioacchino.delregno, davem, andrew+netdev,
	edumazet, kuba, pabeni, alexander.deucher, gregkh, rodrigo.vivi
  Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
	raoxu, guanwentao, zhanjun, cug_yangyuancong, lorenzo.bianconi,
	kvalo, sidhayn, lorenzo.bianconi83, sgruszka, keescook,
	markus.theil, gustavoars, stf_xl, romain.perier, apais, mrkiko.rs,
	oliver, woojung.huh, helmut.schaa, mailhol.vincent, dokyungs,
	deren.wu, daniel, sujuan.chen, mikhail.v.gavrilov, stern,
	linux-usb, leitao, dsahern, weiwan, netdev, horms, andrew, leit,
	wang.zhao, chui-hao.chiu, lynxis, mingyen.hsieh, yn.chen,
	quan.zhou, dzm91, gch981213, git, jiefeng_li, nelson.yu, rong.yan,
	Bo.Jiao, StanleyYP.Wang, WangYuli

When initializing the network card, unplugging the device will
trigger an -EPROTO error, resulting in a flood of error messages
being printed frantically.

Co-developed-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 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);
 	}
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-12-24  9:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18  9:08 [RESEND. PATCH] mt76: mt76u_vendor_request: Do not print error messages when -EPROTO WangYuli
2024-12-18 16:10 ` Alexander Lobakin
2024-12-18 16:50   ` Kalle Valo
2024-12-19  7:11   ` WangYuli
2024-12-19 15:23     ` Alexander Lobakin
2024-12-24  9:01       ` WangYuli
2024-12-19 23:27   ` mt76: dealing with disconnections, -ENODEV and -EPROTO Michał Pecio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).