Message ID | 20230130123655.86339-2-n.zhandarovich@fintech.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2160913wrn; Mon, 30 Jan 2023 04:53:10 -0800 (PST) X-Google-Smtp-Source: AK7set8Pd2E+N176sJDgY9jT8dOV59OhFy5uGlPdsKBWdUEoO1W7jzYfd16Ee277Q5nJlQQUyqMd X-Received: by 2002:a17:906:4f04:b0:878:785e:e57a with SMTP id t4-20020a1709064f0400b00878785ee57amr14956755eju.77.1675083190399; Mon, 30 Jan 2023 04:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675083190; cv=none; d=google.com; s=arc-20160816; b=YeHneKXnTw3UyKm6Al3TL3ndY3J1Rp+e4HP0X15o/oqny2iMENCMQYmU0U+fbHsfGv cR02ebT2OMK8t4cGJTEl9fzyyR4F89NIEIk/NN+vgKnyuBd0iOgDJOGDxy85yINiE/3Q mwxSOwZLQI9iZ/ze0B68wMUcqGiNThk+cz4AXuv5Dlxo+rtQ8ND/FL8xeUMQi5x+75KY S3zmcoIBhJXVV7iuNOv83vLYNhInFTxFPkGv9dNO9368m0bPd5Xt3jyx5ZWx1Q0BtPW9 8WyG/MHP9SLN+o9LOLWDe26h/JvraWvMjUFpEk5bTfXiQq3pBsoa8YEN4dj03H88gVkH QQqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8N51dvvgNdPlIO/ogIwHg/iY57RhT5Q6RXf/Lx7Z6sQ=; b=jBsfX4etBfz7BAcPPB5BRNgOwwix5A1RYSPtfl/f2haGKakwojXt7trHrppEAVnd/m gyjSBOPoXM6WTcbXDuMRkiHwz8RhVF74ruHYO5GQhbMtPUBSnFvzFt2z1xp80KguoYpz xnHHEGGZJoMtUD9vxUiHc//PVskE3hzFMY+Nt8vntu8d8+Si0rIM4IlakUOgXVHYpSnD orAIlR8SeB8SaTZBp8kTe/YT2OJAhnruhmY760XqRtXdMCRl3Yi1X+fbY3dYsm2MGrT8 UDMwXoURgfylEFUVMerXbMlzeWRXe9jcRMqoN0q1/L8uUne1+3+oU2yFqkEi6yJ60RNR ReVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id we5-20020a170907234500b00886de65e971si4439102ejb.698.2023.01.30.04.52.47; Mon, 30 Jan 2023 04:53:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235868AbjA3MhT (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Mon, 30 Jan 2023 07:37:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjA3MhP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Jan 2023 07:37:15 -0500 Received: from exchange.fintech.ru (exchange.fintech.ru [195.54.195.159]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C2B36FF9; Mon, 30 Jan 2023 04:37:11 -0800 (PST) Received: from Ex16-01.fintech.ru (10.0.10.18) by exchange.fintech.ru (195.54.195.169) with Microsoft SMTP Server (TLS) id 14.3.498.0; Mon, 30 Jan 2023 15:37:05 +0300 Received: from localhost (10.0.253.157) by Ex16-01.fintech.ru (10.0.10.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 30 Jan 2023 15:37:05 +0300 From: Nikita Zhandarovich <n.zhandarovich@fintech.ru> To: <stable@vger.kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: Nikita Zhandarovich <n.zhandarovich@fintech.ru>, Felix Fietkau <nbd@nbd.name>, Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>, Ryder Lee <ryder.lee@mediatek.com>, Kalle Valo <kvalo@codeaurora.org>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, <linux-wireless@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-mediatek@lists.infradead.org>, <linux-kernel@vger.kernel.org>, "Alexey Khoroshilov" <khoroshilov@ispras.ru>, <lvc-project@linuxtesting.org> Subject: [PATCH 5.10 1/1] mt76: fix mt7615_init_tx_queues() return value Date: Mon, 30 Jan 2023 04:36:55 -0800 Message-ID: <20230130123655.86339-2-n.zhandarovich@fintech.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230130123655.86339-1-n.zhandarovich@fintech.ru> References: <20230130123655.86339-1-n.zhandarovich@fintech.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.0.253.157] X-ClientProxiedBy: Ex16-01.fintech.ru (10.0.10.18) To Ex16-01.fintech.ru (10.0.10.18) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756452011232129232?= X-GMAIL-MSGID: =?utf-8?q?1756452031843093438?= |
Series |
mt76: fix mt7615_init_tx_queues() return value
|
|
Commit Message
Nikita Zhandarovich
Jan. 30, 2023, 12:36 p.m. UTC
mt7615_init_tx_queues() returns 0 regardless of how final
mt7615_init_tx_queue() performs. If mt7615_init_tx_queue() fails (due to
memory issues, for instance), parent function will still erroneously
return 0.
This change takes into account ret value of mt7615_init_tx_queue()
when finishing up mt7615_init_tx_queues().
Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
drivers/net/wireless/mediatek/mt76/mt7615/dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Jan 30, 2023 at 04:36:55AM -0800, Nikita Zhandarovich wrote: > mt7615_init_tx_queues() returns 0 regardless of how final > mt7615_init_tx_queue() performs. If mt7615_init_tx_queue() fails (due to > memory issues, for instance), parent function will still erroneously > return 0. > > This change takes into account ret value of mt7615_init_tx_queue() > when finishing up mt7615_init_tx_queues(). > > Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") > Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru> > > drivers/net/wireless/mediatek/mt76/mt7615/dma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) What is the git commit id of this upstream? And I can't apply this as-is for the obvious reason it would mess up the changelog, how did you create this? confused, greg k-h
> What is the git commit id of this upstream? > > And I can't apply this as-is for the obvious reason it would mess up the > changelog, how did you create this? > > confused, > > greg k-h Commit in question is b671da33d1c5973f90f098ff66a91953691df582 upstream. I wasn't certain it makes sense to backport the whole patch as only a small portion of it pertains to the fault at question. Would be extremely grateful for directions how to proceed from here. somewhat embarrassed, Nikita
On Mon, Jan 30, 2023 at 01:27:26PM +0000, Жандарович Никита Игоревич wrote: > > What is the git commit id of this upstream? > > > > And I can't apply this as-is for the obvious reason it would mess up the > > changelog, how did you create this? > > > > confused, > > > > greg k-h > > Commit in question is b671da33d1c5973f90f098ff66a91953691df582 > upstream. I wasn't certain it makes sense to backport the whole patch > as only a small portion of it pertains to the fault at question. What is the "fault"? And why not take the whole thing? What's wrong with that? We almost always want to take whatever is in Linus's tree because when we do not, we almost always cause bugs or other problems (later merge issues.) So always take the original fix please. thanks, greg k-h
> On Mon, Jan 30, 2023 at 01:27:26PM +0000, Жандарович Никита Игоревич > wrote: > > > What is the git commit id of this upstream? > > > > > > And I can't apply this as-is for the obvious reason it would mess up > > > the changelog, how did you create this? > > > > > > confused, > > > > > > greg k-h > > > > Commit in question is b671da33d1c5973f90f098ff66a91953691df582 > > upstream. I wasn't certain it makes sense to backport the whole patch > > as only a small portion of it pertains to the fault at question. > > What is the "fault"? In 5.10.y "mt7615_init_tx_queues() returns 0 regardless of how final mt7615_init_tx_queue() performs. If mt7615_init_tx_queue() fails (due to memory issues, for instance), parent function will still erroneously return 0." This was fixed upstream, although that particular commit's scope was broader. > And why not take the whole thing? What's wrong with that? We almost > always want to take whatever is in Linus's tree because when we do not, we > almost always cause bugs or other problems (later merge issues.) > > So always take the original fix please. > > thanks, > > greg k-h That makes sense, of course. Thanks for your patience, will work toward backporting the whole thing. regards, Nikita
On Mon, Jan 30, 2023 at 01:48:24PM +0000, Жандарович Никита Игоревич wrote: > > On Mon, Jan 30, 2023 at 01:27:26PM +0000, Жандарович Никита Игоревич > > wrote: > > > > What is the git commit id of this upstream? > > > > > > > > And I can't apply this as-is for the obvious reason it would mess up > > > > the changelog, how did you create this? > > > > > > > > confused, > > > > > > > > greg k-h > > > > > > Commit in question is b671da33d1c5973f90f098ff66a91953691df582 > > > upstream. I wasn't certain it makes sense to backport the whole patch > > > as only a small portion of it pertains to the fault at question. > > > > What is the "fault"? > > In 5.10.y "mt7615_init_tx_queues() returns 0 regardless of how final > mt7615_init_tx_queue() performs. If mt7615_init_tx_queue() fails (due to > memory issues, for instance), parent function will still erroneously > return 0." And how can memory issues actually be triggered in a real system? Is this a fake problem or something you can validate and verify works properly? Don't worry about fake issues for stable backports please. thanks, greg k-h
> > > What is the "fault"? > > > > In 5.10.y "mt7615_init_tx_queues() returns 0 regardless of how final > > mt7615_init_tx_queue() performs. If mt7615_init_tx_queue() fails (due > > to memory issues, for instance), parent function will still > > erroneously return 0." > > And how can memory issues actually be triggered in a real system? Is this a > fake problem or something you can validate and verify works properly? > > Don't worry about fake issues for stable backports please. > > thanks, > > greg k-h mt7615_init_tx_queue() calls devm_kzalloc() (which can throw -ENOMEM) and mt76_queue_alloc() (which can also fail). It's hard for me to gauge how probable these failures can be. But I feel like at the very least it's a logical sanity check. @@ -82,7 +82,7 @@ mt7615_init_tx_queues(struct mt7615_dev *dev) ret = mt7615_init_tx_queue(dev, MT_TXQ_MCU, MT7615_TXQ_MCU, MT7615_TX_MCU_RING_SIZE); return 0; There is no special reason for mt7615_init_tx_queues() to ignore last 'ret'. If last mt7615_init_tx_queue(), so should mt7615_init_tx_queues(). And upstream patch (b671da33d1c5973f90f098ff66a91953691df582) addresses this as well. If you feel differently, I will of course back down. regards, Nikita
On Mon, Jan 30, 2023 at 04:13:11PM +0000, Жандарович Никита Игоревич wrote: > > > > What is the "fault"? > > > > > > In 5.10.y "mt7615_init_tx_queues() returns 0 regardless of how final > > > mt7615_init_tx_queue() performs. If mt7615_init_tx_queue() fails (due > > > to memory issues, for instance), parent function will still > > > erroneously return 0." > > > > And how can memory issues actually be triggered in a real system? Is this a > > fake problem or something you can validate and verify works properly? > > > > Don't worry about fake issues for stable backports please. > > > > thanks, > > > > greg k-h > > mt7615_init_tx_queue() calls devm_kzalloc() (which can throw -ENOMEM) and mt76_queue_alloc() (which can also fail). It's hard for me to gauge how probable these failures can be. But I feel like at the very least it's a logical sanity check. Again, how can those allocations really fail? Or the queue allocation? Can you test this? If not, it's not a real failure that you need to backport. Otherwise all of the little tiny "fix up this potential failure path" patches would need to be backported, and that's just crazy if they can not be hit in normal operation. And please line-wrap your emails :( thanks, greg k-h
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c index bf8ae14121db..47922c1dd6e3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c @@ -82,7 +82,7 @@ mt7615_init_tx_queues(struct mt7615_dev *dev) ret = mt7615_init_tx_queue(dev, MT_TXQ_MCU, MT7615_TXQ_MCU, MT7615_TX_MCU_RING_SIZE); - return 0; + return ret; } static int mt7615_poll_tx(struct napi_struct *napi, int budget)