From patchwork Thu Oct 17 03:05:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WangYuli X-Patchwork-Id: 13839412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13FEAD2F7DA for ; Thu, 17 Oct 2024 03:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=rGntS9xOFiEeM/CMGDTBCcX5N9b7TzQhEkYEMSmKp44=; b=DQE+WAYLvkzepwtNG9Xe8i8wAu GDYzA0sz4tK59k5zr2JyJh0GdATDEsBZUpNV68bHzjt//Hc/QOYn/8qf5xyijcIM6B5l3YE+4eKdP be2RQad6dAKoTR6dvDFP9pgAhvZFZEz1H15PHpOCmoed20RK45La2BPWEOchvPbkvoFeAspO0X+zG rQWgx8acEGs0E/c43xpdgUc3xEv75fOJXmug4Cs8+LJx1KUwa63XfPu/iI2O2tm3Lo+fZVN3iTUME zPUe3GGfsxIkvTMewucSxM3XfVrIB9f3dHK0Qj8FXaiDqd8inA9gocqZRMp0ud4BYiv1WATcZYeCX 8gEwd6cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1Gsy-0000000DcwH-0DjT; Thu, 17 Oct 2024 03:09:12 +0000 Received: from smtpbgeu1.qq.com ([52.59.177.22]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1GrT-0000000Dcnz-41oI; Thu, 17 Oct 2024 03:07:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1729134399; bh=rGntS9xOFiEeM/CMGDTBCcX5N9b7TzQhEkYEMSmKp44=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=XA9R44voNHMqBepq1VReiYD/fB618XAH1SIbthnQc8t4Gmy9XUJlMF2tRqNuG0JH5 IIjDN450loyVjC6TcVwtAbqGFYDatH+CfHex2gGxeqEZfQ1uNbSkgkD/tNsEV3Wgvw 8f5cFMf8oCVyzMO+8FsYm7R1uywfr2h+jn8Umbc0= X-QQ-mid: bizesmtpsz14t1729134356tiqk8w X-QQ-Originating-IP: JzxPHKK/gP3irJfApYxXxk8Z6DxYHx70zkel4N+qhuk= Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 17 Oct 2024 11:05:54 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 5622655037225638582 From: WangYuli To: nbd@nbd.name, lorenzo@kernel.org, ryder.lee@mediatek.com, shayne.chen@mediatek.com, sean.wang@mediatek.com, kvalo@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, raoxu@uniontech.com, guanwentao@uniontech.com, zhanjun@uniontech.com, WangYuli Subject: [RESEND. PATCH] mt76: mt76u_vendor_request: Do not print error messages when -EPROTO Date: Thu, 17 Oct 2024 11:05:50 +0800 Message-ID: <08A72BFE4FA79ABB+20241017030551.85817-1-wangyuli@uniontech.com> X-Mailer: git-send-email 2.45.2 MI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E5eh/Pfi1u3LGpNbDA+hSdopn69B0C8dx4GKAvhGZJwAjtJUnKyCRJ0stHKdb0We0zO8= X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= X-QQ-RECHKSPAM: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_200740_459480_896267E8 X-CRM114-Status: UNSURE ( 8.22 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When initializing the network card, unplugging the device will trigger an -EPROTO error, resulting in a flood of error messages being printed frantically. Signed-off-by: Xu Rao Signed-off-by: WangYuli --- 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); }