ath11k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt
@ 2023-02-01 16:54 Douglas Anderson
  2023-02-01 16:54 ` [PATCH v2 2/2] wifi: ath5k: " Douglas Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Douglas Anderson @ 2023-02-01 16:54 UTC (permalink / raw)
  To: ath11k, linux-wireless
  Cc: Kalle Valo, junyuu, Youghandhar Chintala, Jiri Slaby,
	Luis Chamberlain, Nick Kossifidis, Abhinav Kumar,
	Douglas Anderson, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Lad Prabhakar, Manikanta Pubbisetty, Marc Zyngier, Paolo Abeni,
	Rob Herring, linux-kernel, netdev

As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ
resource from DT core"), we need to use platform_get_irq() instead of
platform_get_resource() to get our IRQs because
platform_get_resource() simply won't get them anymore.

This was already fixed in several other Atheros WiFi drivers,
apparently in response to Zeal Robot reports. An example of another
fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the
interrupt"). ath11k seems to have been missed in this effort, though.

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.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1

Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Jun Yu <junyuu@chromium.org>
---

Changes in v2:
- Update commit message and point to patch that broke us (Jonas)

 drivers/net/wireless/ath/ath11k/ahb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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);
-- 
2.39.1.456.gfc5497dd1b-goog


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* [PATCH v2 2/2] wifi: ath5k: Use platform_get_irq() to get the interrupt
  2023-02-01 16:54 [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt Douglas Anderson
@ 2023-02-01 16:54 ` Douglas Anderson
  2023-02-01 20:44   ` Prabhakar Mahadev Lad
  2023-02-01 20:39 ` [PATCH v2 1/2] wifi: ath11k: " Prabhakar Mahadev Lad
  2023-02-22  9:51 ` Kalle Valo
  2 siblings, 1 reply; 5+ messages in thread
From: Douglas Anderson @ 2023-02-01 16:54 UTC (permalink / raw)
  To: ath11k, linux-wireless
  Cc: Kalle Valo, junyuu, Youghandhar Chintala, Jiri Slaby,
	Luis Chamberlain, Nick Kossifidis, Abhinav Kumar,
	Douglas Anderson, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Lad Prabhakar, Marc Zyngier, Paolo Abeni, Rob Herring,
	linux-kernel, netdev

As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ
resource from DT core"), we need to use platform_get_irq() instead of
platform_get_resource() to get our IRQs because
platform_get_resource() simply won't get them anymore.

This was already fixed in several other Atheros WiFi drivers,
apparently in response to Zeal Robot reports. An example of another
fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the
interrupt"). ath5k seems to have been missed in this effort, though.

Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
I'm not setup to actually test this, but I figured that I might as
well go all the way and fix all the instances of the same pattern that
I found in the ath drivers since the old call was actually breaking me
in ath11k. I did at least confirm that the code compiles for me.

If folks would rather not land an untested patch like this, though,
feel free to drop this and just land patch #1 as long as that one
looks OK.

Changes in v2:
- Update commit message and point to patch that broke us (Jonas)

 drivers/net/wireless/ath/ath5k/ahb.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
index 2c9cec8b53d9..28a1e5eff204 100644
--- a/drivers/net/wireless/ath/ath5k/ahb.c
+++ b/drivers/net/wireless/ath/ath5k/ahb.c
@@ -113,15 +113,13 @@ static int ath_ahb_probe(struct platform_device *pdev)
 		goto err_out;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (res == NULL) {
-		dev_err(&pdev->dev, "no IRQ resource found\n");
-		ret = -ENXIO;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
+		dev_err(&pdev->dev, "no IRQ resource found: %d\n", irq);
+		ret = irq;
 		goto err_iounmap;
 	}
 
-	irq = res->start;
-
 	hw = ieee80211_alloc_hw(sizeof(struct ath5k_hw), &ath5k_hw_ops);
 	if (hw == NULL) {
 		dev_err(&pdev->dev, "no memory for ieee80211_hw\n");
-- 
2.39.1.456.gfc5497dd1b-goog


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* RE: [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt
  2023-02-01 16:54 [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt Douglas Anderson
  2023-02-01 16:54 ` [PATCH v2 2/2] wifi: ath5k: " Douglas Anderson
@ 2023-02-01 20:39 ` Prabhakar Mahadev Lad
  2023-02-22  9:51 ` Kalle Valo
  2 siblings, 0 replies; 5+ messages in thread
From: Prabhakar Mahadev Lad @ 2023-02-01 20:39 UTC (permalink / raw)
  To: Douglas Anderson, ath11k, linux-wireless
  Cc: Kalle Valo, junyuu, Youghandhar Chintala, Jiri Slaby,
	Luis Chamberlain, Nick Kossifidis, Abhinav Kumar,
	David S. Miller, Eric Dumazet, Jakub Kicinski,
	Manikanta Pubbisetty, Marc Zyngier, Paolo Abeni, Rob Herring,
	linux-kernel, netdev

Hi Douglas,

Thank you for the patch.

> As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core"), we need to
> use platform_get_irq() instead of
> platform_get_resource() to get our IRQs because
> platform_get_resource() simply won't get them anymore.
> 
> This was already fixed in several other Atheros WiFi drivers, apparently in response to Zeal Robot
> reports. An example of another fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the
> interrupt"). ath11k seems to have been missed in this effort, though.
> 
> 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.
> 
> Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
> 
> Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
> Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> Tested-by: Jun Yu <junyuu@chromium.org>
> ---
> 
> Changes in v2:
> - Update commit message and point to patch that broke us (Jonas)
> 
>  drivers/net/wireless/ath/ath11k/ahb.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Unrelated to this patch, I think you need to call dma_unamp_resource() in the error path?

Cheers,
Prabhakar
 
> 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);
> --
> 2.39.1.456.gfc5497dd1b-goog


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* RE: [PATCH v2 2/2] wifi: ath5k: Use platform_get_irq() to get the interrupt
  2023-02-01 16:54 ` [PATCH v2 2/2] wifi: ath5k: " Douglas Anderson
@ 2023-02-01 20:44   ` Prabhakar Mahadev Lad
  0 siblings, 0 replies; 5+ messages in thread
From: Prabhakar Mahadev Lad @ 2023-02-01 20:44 UTC (permalink / raw)
  To: Douglas Anderson, ath11k, linux-wireless
  Cc: Kalle Valo, junyuu, Youghandhar Chintala, Jiri Slaby,
	Luis Chamberlain, Nick Kossifidis, Abhinav Kumar,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Marc Zyngier,
	Paolo Abeni, Rob Herring, linux-kernel, netdev

Hi Douglas,

Thank you for the patch.

> Subject: [PATCH v2 2/2] wifi: ath5k: Use platform_get_irq() to get the interrupt
> 
> As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core"), we need to
> use platform_get_irq() instead of
> platform_get_resource() to get our IRQs because
> platform_get_resource() simply won't get them anymore.
> 
> This was already fixed in several other Atheros WiFi drivers, apparently in response to Zeal Robot
> reports. An example of another fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the
> interrupt"). ath5k seems to have been missed in this effort, though.
> 
> Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> I'm not setup to actually test this, but I figured that I might as well go all the way and fix all the
> instances of the same pattern that I found in the ath drivers since the old call was actually breaking
> me in ath11k. I did at least confirm that the code compiles for me.
> 
> If folks would rather not land an untested patch like this, though, feel free to drop this and just
> land patch #1 as long as that one looks OK.
> 
> Changes in v2:
> - Update commit message and point to patch that broke us (Jonas)
> 
>  drivers/net/wireless/ath/ath5k/ahb.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 

Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar

> diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
> index 2c9cec8b53d9..28a1e5eff204 100644
> --- a/drivers/net/wireless/ath/ath5k/ahb.c
> +++ b/drivers/net/wireless/ath/ath5k/ahb.c
> @@ -113,15 +113,13 @@ static int ath_ahb_probe(struct platform_device *pdev)
>  		goto err_out;
>  	}
> 
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (res == NULL) {
> -		dev_err(&pdev->dev, "no IRQ resource found\n");
> -		ret = -ENXIO;
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0) {
> +		dev_err(&pdev->dev, "no IRQ resource found: %d\n", irq);
> +		ret = irq;
>  		goto err_iounmap;
>  	}
> 
> -	irq = res->start;
> -
>  	hw = ieee80211_alloc_hw(sizeof(struct ath5k_hw), &ath5k_hw_ops);
>  	if (hw == NULL) {
>  		dev_err(&pdev->dev, "no memory for ieee80211_hw\n");
> --
> 2.39.1.456.gfc5497dd1b-goog


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* Re: [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt
  2023-02-01 16:54 [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt Douglas Anderson
  2023-02-01 16:54 ` [PATCH v2 2/2] wifi: ath5k: " Douglas Anderson
  2023-02-01 20:39 ` [PATCH v2 1/2] wifi: ath11k: " Prabhakar Mahadev Lad
@ 2023-02-22  9:51 ` Kalle Valo
  2 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2023-02-22  9:51 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: ath11k, linux-wireless, junyuu, Youghandhar Chintala, Jiri Slaby,
	Luis Chamberlain, Nick Kossifidis, Abhinav Kumar,
	Douglas Anderson, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Lad Prabhakar, Manikanta Pubbisetty, Marc Zyngier, Paolo Abeni,
	Rob Herring, linux-kernel, netdev

Douglas Anderson <dianders@chromium.org> wrote:

> As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ
> resource from DT core"), we need to use platform_get_irq() instead of
> platform_get_resource() to get our IRQs because
> platform_get_resource() simply won't get them anymore.
> 
> This was already fixed in several other Atheros WiFi drivers,
> apparently in response to Zeal Robot reports. An example of another
> fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the
> interrupt"). ath11k seems to have been missed in this effort, though.
> 
> 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.
> 
> Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
> 
> Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
> Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> Tested-by: Jun Yu <junyuu@chromium.org>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

2 patches applied to ath-next branch of ath.git, thanks.

f117276638b7 wifi: ath11k: Use platform_get_irq() to get the interrupt
95c95251d054 wifi: ath5k: Use platform_get_irq() to get the interrupt

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230201084131.v2.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

end of thread, other threads:[~2023-02-22 10:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 16:54 [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt Douglas Anderson
2023-02-01 16:54 ` [PATCH v2 2/2] wifi: ath5k: " Douglas Anderson
2023-02-01 20:44   ` Prabhakar Mahadev Lad
2023-02-01 20:39 ` [PATCH v2 1/2] wifi: ath11k: " Prabhakar Mahadev Lad
2023-02-22  9:51 ` Kalle Valo

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).