Patch "wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mt76-mt76u_vendor_request-do-not-print-error-me.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1f1742e649d32d1e8b048d30a148603728383362
Author: WangYuli <wangyuli@xxxxxxxxxxxxx>
Date:   Mon Jan 13 15:02:41 2025 +0800

    wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO
    
    [ Upstream commit f1b1e133a770fcdbd89551651232b034d2f7a27a ]
    
    When initializing the network card, unplugging the device will
    trigger an -EPROTO error, resulting in a flood of error messages
    being printed frantically.
    
    The exception is printed as follows:
    
             mt76x2u 2-2.4:1.0: vendor request req:47 off:9018 failed:-71
             mt76x2u 2-2.4:1.0: vendor request req:47 off:9018 failed:-71
             ...
    
    It will continue to print more than 2000 times for about 5 minutes,
    causing the usb device to be unable to be disconnected. During this
    period, the usb port cannot recognize the new device because the old
    device has not disconnected.
    
    There may be other operating methods that cause -EPROTO, but -EPROTO is
    a low-level hardware error. It is unwise to repeat vendor requests
    expecting to read correct data. It is a better choice to treat -EPROTO
    and -ENODEV the same way.
    
    Similar to commit 9b0f100c1970 ("mt76: usb: process URBs with status
    EPROTO properly") do no schedule rx_worker for urb marked with status
    set  -EPROTO. I also reproduced this situation when plugging and
    unplugging the device, and this patch is effective.
    
    Just do not vendor request again for urb marked with status set -EPROTO.
    
    Link: https://lore.kernel.org/all/531681bd-30f5-4a70-a156-bf8754b8e072@xxxxxxxxx/
    Link: https://lore.kernel.org/all/D4B9CC1FFC0CBAC3+20250105040607.154706-1-wangyuli@xxxxxxxxxxxxx/
    Fixes: b40b15e1521f ("mt76: add usb support to mt76 layer")
    Co-developed-by: Xu Rao <raoxu@xxxxxxxxxxxxx>
    Signed-off-by: Xu Rao <raoxu@xxxxxxxxxxxxx>
    Signed-off-by: WangYuli <wangyuli@xxxxxxxxxxxxx>
    Link: https://patch.msgid.link/9DD7DE7AAB497CB7+20250113070241.63590-1-wangyuli@xxxxxxxxxxxxx
    Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index f1ae9ff835b23..07a563df6d6d3 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -34,9 +34,9 @@ static int __mt76u_vendor_request(struct mt76_dev *dev, u8 req,
 
 		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);
 	}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux