Message ID | 20230124110057.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid |
---|---|
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 s9csp2324262wrn; Tue, 24 Jan 2023 11:05:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXt2KMmlVw5uYHExkGNWd54JLtGvQoxaTQ3GD8V9BJWNnFj4NyUgnyTYFybcu17TcN2t+ONr X-Received: by 2002:a17:906:b004:b0:872:aa82:ac56 with SMTP id v4-20020a170906b00400b00872aa82ac56mr27002029ejy.47.1674587100142; Tue, 24 Jan 2023 11:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674587100; cv=none; d=google.com; s=arc-20160816; b=pD2QSt+2aM5+yb4pwab3VdzJ0h6IWV67chXGulMT0cd5g8hun2lrcc+htqvA3z8EWj ri6SCyl6hqpBhOZImsNckUBuR4Lq2VAEHjD4MWz9KtvdR9xf1tymVoxcehXJpAeIK7Ev jCf5E+UKBB4h12oqsMv8AUj11R22qzOBSfZNuva98eS+bgZiwXNc7+FlUqrQnpXG7Ga2 eb/2DxtGziqAcFJ4Uwjp+GeYoGaL8ntzGxwLO2ogN2cc1rjdHwfdoRDovnvHZg8himR7 gVkD6P5ATjsCkUIe1PoHi6h4/Yj/kP+QcKO8Hos1WbhFFZfNTTjODlCQaQFTZmJcvFG8 p/hQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=SEJDfnpuHczelrJ6vp0fb1JDaeIwWS2iq2BACn7e/IE=; b=lIvuEmp6/dsRMgU8hLTTc7AXWvN58fF8zwOp1dneO358auggiAmGNWy7zhslXjQ8+x GFYwCXZiW9n9vMvJuKZdIFhVcfc0FeX3MXpOjB0iIF/4LiHQEQ2oGW0MHYckA4zdQj5f RdWHgQ44xTPxJcP+KUEfeuQfz1xWdqz+zuqEJSO80SE+/4OL1e3Yq3AsXkKaZAVzZTY0 Ml4TQlB8Hno3Tu/7Qg2EFKSJrlEa4R44nnjKlgnYolm1UZ5fBUZy+kCjXdLy6OVv26rM m9WGud3ta7gWGiPHzr6s5yBoWH6GwwnvzH9N7JtJ9n2Ei1uUh9YXXSpZhB19eVPyW9Fg eR0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZPjYuk0y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fp2-20020a1709069e0200b008777c3e6b28si3263505ejc.281.2023.01.24.11.04.36; Tue, 24 Jan 2023 11:05:00 -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; dkim=pass header.i=@chromium.org header.s=google header.b=ZPjYuk0y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233549AbjAXTB3 (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Tue, 24 Jan 2023 14:01:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbjAXTB1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 24 Jan 2023 14:01:27 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A01B4DBCB for <linux-kernel@vger.kernel.org>; Tue, 24 Jan 2023 11:01:25 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id k18so15667911pll.5 for <linux-kernel@vger.kernel.org>; Tue, 24 Jan 2023 11:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SEJDfnpuHczelrJ6vp0fb1JDaeIwWS2iq2BACn7e/IE=; b=ZPjYuk0ya4aeNvJO7qCFVWhUdg0oqrtCfCmpbpBLA+ntney22BIz/3+x+FcjsEArwy EhC1rTUOzPpnWRcgDlgTPkpWxjQVhxbNJKGVBjVKQb4u+qsL8owwjnObWFkBj3oGR3sl BW7yKEPe0fUVC9ATGwooiBc7H5EhIV8q26nao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SEJDfnpuHczelrJ6vp0fb1JDaeIwWS2iq2BACn7e/IE=; b=Ujd+jSFmdHOteevjuLLVv3BfRI89foxgAUpZz9PSdY5BWWE0ciNauv0JIrMjJ8YlFd NJHwKDi/l6E1zvy5K1WlAscDV7a4vqBnt4jdu34IMwaE+/4X4ma4U4PJKqpsrq1uOr/e bhCcNJv2LmOu/QySfcYe2N8c8R0eZkqZXGV6ttVTwLnZDDAO0pA0U61+ex6HSiKjXi3n KJay62KSVpfJ3O5f7rsyqcaX+bwz4dIr+1JBGOjGBFrUFB3gXSNZmvpC2NUXmrV7yhqA lGz/XwohXnEujatg9LgeeCq3jC5zKEgMxp8MvEIaOvUIKnGkONzST68ebxRRu+PsXzNi /TKA== X-Gm-Message-State: AO0yUKUARC13Od4nEDK/chew8TEU9rzb2tjC29Rt9pY4aY5f+PiRtChB Y570K1MJOZQuF6Nn7L4mj11qDw== X-Received: by 2002:a17:902:e747:b0:196:1d89:7002 with SMTP id p7-20020a170902e74700b001961d897002mr1941570plf.31.1674586884928; Tue, 24 Jan 2023 11:01:24 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:7b28:de8d:ee0:2cd6]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b001948720f6bdsm2010415plt.98.2023.01.24.11.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 11:01:24 -0800 (PST) From: Douglas Anderson <dianders@chromium.org> To: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Luis Chamberlain <mcgrof@kernel.org>, Nick Kossifidis <mickflemm@gmail.com>, Youghandhar Chintala <quic_youghand@quicinc.com>, junyuu@chromium.org, Kalle Valo <kvalo@kernel.org>, Jiri Slaby <jirislaby@kernel.org>, Douglas Anderson <dianders@chromium.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Manikanta Pubbisetty <quic_mpubbise@quicinc.com>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt Date: Tue, 24 Jan 2023 11:01:00 -0800 Message-Id: <20230124110057.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid> X-Mailer: git-send-email 2.39.1.405.gd4c25cc71f-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1755931842713310471?= X-GMAIL-MSGID: =?utf-8?q?1755931842713310471?= |
Series |
[1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt
|
|
Commit Message
Doug Anderson
Jan. 24, 2023, 7:01 p.m. UTC
For the same reasons talked about in commit 9503a1fc123d ("ath9k: Use
platform_get_irq() to get the interrupt"), we should be using
platform_get_irq() in ath11k. Let's make the switch.
Without this change, WiFi wasn't coming up on my Qualcomm sc7280-based
hardware. Specifically, "platform_get_resource(pdev, IORESOURCE_IRQ,
i)" was failing even for i=0. Digging into the platform device there
truly were no IRQs present in the list of resources when the call was
made.
I didn't dig into what changed between 5.15 (where
platform_get_resource() seems to work) and mainline Linux (where it
doesn't). Given the zeal robot report for ath9k I assume it's a known
issue. I'll mark this as "fixing" the patch that introduced the
platform_get_resource() call since it should have always been fine to
just call platform_get_irq() and that'll make sure it goes back as far
as it needs to go.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
drivers/net/wireless/ath/ath11k/ahb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Tue, 24 Jan 2023 at 20:05, Douglas Anderson <dianders@chromium.org> wrote: > > For the same reasons talked about in commit 9503a1fc123d ("ath9k: Use > platform_get_irq() to get the interrupt"), we should be using > platform_get_irq() in ath11k. Let's make the switch. > > Without this change, WiFi wasn't coming up on my Qualcomm sc7280-based > hardware. Specifically, "platform_get_resource(pdev, IORESOURCE_IRQ, > i)" was failing even for i=0. Digging into the platform device there > truly were no IRQs present in the list of resources when the call was > made. > > I didn't dig into what changed between 5.15 (where > platform_get_resource() seems to work) and mainline Linux (where it > doesn't). Given the zeal robot report for ath9k I assume it's a known > issue. I'll mark this as "fixing" the patch that introduced the > platform_get_resource() call since it should have always been fine to > just call platform_get_irq() and that'll make sure it goes back as far > as it needs to go. Since I recently stumbled upon this in a different (external) driver, it's likely a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core"). Regards Jonas
On Tue, Jan 24, 2023 at 11:01:00AM -0800, Douglas Anderson wrote: > For the same reasons talked about in commit 9503a1fc123d ("ath9k: Use > platform_get_irq() to get the interrupt"), we should be using > platform_get_irq() in ath11k. Let's make the switch. The commit log is rather weak, it is better to re-state what the commit log in 9503a1fc123d states as it is stronger, and very clear. To that end. Why not write an SmPL Coccinelle grammer patch for this and put it on scripts/coccinelle/api ? Then hunt / convert things which will use DT as well and where this is actually useful / likely buggy. Luis
Hi, On Thu, Jan 26, 2023 at 11:01 AM Luis Chamberlain <mcgrof@kernel.org> wrote: > > On Tue, Jan 24, 2023 at 11:01:00AM -0800, Douglas Anderson wrote: > > For the same reasons talked about in commit 9503a1fc123d ("ath9k: Use > > platform_get_irq() to get the interrupt"), we should be using > > platform_get_irq() in ath11k. Let's make the switch. > > The commit log is rather weak, it is better to re-state what the commit > log in 9503a1fc123d states as it is stronger, and very clear. Sure. Adding in the info that Jonas provided about what commit specifically broke me would also be nice. I'll try to send out a new CL with improved wording tomorrow. > To that end. Why not write an SmPL Coccinelle grammer patch for this > and put it on scripts/coccinelle/api ? Then hunt / convert things which > will use DT as well and where this is actually useful / likely buggy. That sounds like a great idea. ...but not something I'm going to do. I'm not personally on a mission to track down everyone hitting this particular issue. Hopefully those that were involved in commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core") made some effort to hunt problems down and it seems like, maybe, the zeal robot was part of that effort? In my case, the ath11k bug hit me and that's what I need fixed. I tried to be a friendly citizen and also fixup ath5k because it was super obvious that it was the same issue and the same code. -Doug
On Thu, Jan 26, 2023 at 04:14:42PM -0800, Doug Anderson wrote: > > To that end. Why not write an SmPL Coccinelle grammer patch for this > > and put it on scripts/coccinelle/api ? Then hunt / convert things which > > will use DT as well and where this is actually useful / likely buggy. > > That sounds like a great idea. ...but not something I'm going to do. :*( Luis
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index d34a4d6325b2..f70a119bb5c8 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -859,11 +859,11 @@ static int ath11k_ahb_setup_msi_resources(struct ath11k_base *ab) ab->pci.msi.ep_base_data = int_prop + 32; for (i = 0; i < ab->pci.msi.config->total_vectors; i++) { - res = platform_get_resource(pdev, IORESOURCE_IRQ, i); - if (!res) - return -ENODEV; + ret = platform_get_irq(pdev, i); + if (ret < 0) + return ret; - ab->pci.msi.irqs[i] = res->start; + ab->pci.msi.irqs[i] = ret; } set_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags);