linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/8] wcn36xx: Use platform_get_irq_byname() to get the interrupt
       [not found] <20211224192626.15843-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
@ 2021-12-24 19:26 ` Lad Prabhakar
  2022-01-17 12:44   ` Kalle Valo
  2021-12-24 19:26 ` [PATCH 7/8] ath10k: Use platform_get_irq() " Lad Prabhakar
  1 sibling, 1 reply; 4+ messages in thread
From: Lad Prabhakar @ 2021-12-24 19:26 UTC (permalink / raw)
  To: netdev, Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar, wcn36xx,
	linux-wireless

platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_byname().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 9575d7373bf2..bd334a302057 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1446,25 +1446,20 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn,
 {
 	struct device_node *mmio_node;
 	struct device_node *iris_node;
-	struct resource *res;
 	int index;
 	int ret;
 
 	/* Set TX IRQ */
-	res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "tx");
-	if (!res) {
-		wcn36xx_err("failed to get tx_irq\n");
-		return -ENOENT;
-	}
-	wcn->tx_irq = res->start;
+	ret = platform_get_irq_byname(pdev, "tx");
+	if (ret < 0)
+		return ret;
+	wcn->tx_irq = ret;
 
 	/* Set RX IRQ */
-	res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "rx");
-	if (!res) {
-		wcn36xx_err("failed to get rx_irq\n");
-		return -ENOENT;
-	}
-	wcn->rx_irq = res->start;
+	ret = platform_get_irq_byname(pdev, "rx");
+	if (ret < 0)
+		return ret;
+	wcn->rx_irq = ret;
 
 	/* Acquire SMSM tx enable handle */
 	wcn->tx_enable_state = qcom_smem_state_get(&pdev->dev,
-- 
2.17.1


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

* [PATCH 7/8] ath10k: Use platform_get_irq() to get the interrupt
       [not found] <20211224192626.15843-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
  2021-12-24 19:26 ` [PATCH 6/8] wcn36xx: Use platform_get_irq_byname() to get the interrupt Lad Prabhakar
@ 2021-12-24 19:26 ` Lad Prabhakar
  2022-01-17 12:41   ` Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Lad Prabhakar @ 2021-12-24 19:26 UTC (permalink / raw)
  To: netdev, Kalle Valo, David S. Miller, Jakub Kicinski
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar, ath10k,
	linux-wireless

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/net/wireless/ath/ath10k/snoc.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c
index 9513ab696fff..681e1abe7440 100644
--- a/drivers/net/wireless/ath/ath10k/snoc.c
+++ b/drivers/net/wireless/ath/ath10k/snoc.c
@@ -1306,13 +1306,10 @@ static int ath10k_snoc_resource_init(struct ath10k *ar)
 	}
 
 	for (i = 0; i < CE_COUNT; i++) {
-		res = platform_get_resource(ar_snoc->dev, IORESOURCE_IRQ, i);
-		if (!res) {
-			ath10k_err(ar, "failed to get IRQ%d\n", i);
-			ret = -ENODEV;
-			goto out;
-		}
-		ar_snoc->ce_irqs[i].irq_line = res->start;
+		ret = platform_get_irq(ar_snoc->dev, i);
+		if (ret < 0)
+			return ret;
+		ar_snoc->ce_irqs[i].irq_line = ret;
 	}
 
 	ret = device_property_read_u32(&pdev->dev, "qcom,xo-cal-data",
@@ -1323,10 +1320,8 @@ static int ath10k_snoc_resource_init(struct ath10k *ar)
 		ath10k_dbg(ar, ATH10K_DBG_SNOC, "xo cal data %x\n",
 			   ar_snoc->xo_cal_data);
 	}
-	ret = 0;
 
-out:
-	return ret;
+	return 0;
 }
 
 static void ath10k_snoc_quirks_init(struct ath10k *ar)
-- 
2.17.1


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

* Re: [PATCH 7/8] ath10k: Use platform_get_irq() to get the interrupt
  2021-12-24 19:26 ` [PATCH 7/8] ath10k: Use platform_get_irq() " Lad Prabhakar
@ 2022-01-17 12:41   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2022-01-17 12:41 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: netdev, David S. Miller, Jakub Kicinski, Rob Herring,
	linux-kernel, Prabhakar, Lad Prabhakar, ath10k, linux-wireless

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

> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
> 
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq().
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

f14c3f4db9cb ath10k: Use platform_get_irq() to get the interrupt

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211224192626.15843-8-prabhakar.mahadev-lad.rj@bp.renesas.com/

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


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

* Re: [PATCH 6/8] wcn36xx: Use platform_get_irq_byname() to get the interrupt
  2021-12-24 19:26 ` [PATCH 6/8] wcn36xx: Use platform_get_irq_byname() to get the interrupt Lad Prabhakar
@ 2022-01-17 12:44   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2022-01-17 12:44 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: netdev, David S. Miller, Jakub Kicinski, Rob Herring,
	linux-kernel, Prabhakar, Lad Prabhakar, wcn36xx, linux-wireless

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

> platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
> 
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq_byname().
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

d17efe4f80fc wcn36xx: Use platform_get_irq_byname() to get the interrupt

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211224192626.15843-7-prabhakar.mahadev-lad.rj@bp.renesas.com/

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


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

end of thread, other threads:[~2022-01-17 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211224192626.15843-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
2021-12-24 19:26 ` [PATCH 6/8] wcn36xx: Use platform_get_irq_byname() to get the interrupt Lad Prabhakar
2022-01-17 12:44   ` Kalle Valo
2021-12-24 19:26 ` [PATCH 7/8] ath10k: Use platform_get_irq() " Lad Prabhakar
2022-01-17 12:41   ` 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).