mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs
@ 2026-01-08 10:21 Wei-Cheng Chen
  2026-01-09 18:36 ` Jon Hunter
  2026-01-12 14:56 ` [PATCH v2] " Wei-Cheng Chen
  0 siblings, 2 replies; 3+ messages in thread
From: Wei-Cheng Chen @ 2026-01-08 10:21 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman, Thierry Reding,
	Jonathan Hunter, Haotien Hsu
  Cc: linux-usb, linux-tegra, linux-kernel, Wayne Chang, Wei-Cheng Chen

From: Wayne Chang <waynec@nvidia.com>

When some wake IRQs are disabled in the device tree, the corresponding
interrupt entries are removed from DT. In such cases, the driver
currently calls platform_get_irq(), which returns -ENXIO and logs
an error like:

  tegra-xusb 3610000.usb: error -ENXIO: IRQ index 2 not found

However, not all wake IRQs are mandatory. The hardware can operate
normally even if some wake sources are not defined in DT. To avoid this
false alarm and allow missing wake IRQs gracefully, use
platform_get_irq_optional() instead of platform_get_irq().

Fixes: 5df186e2ef11 ("usb: xhci: tegra: Support USB wakeup function for Tegra234")
Signed-off-by: Wayne Chang <waynec@nvidia.com>
Signed-off-by: Wei-Cheng Chen <weichengc@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 31ccced5125..8b492871d21 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1563,7 +1563,7 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xu
 	for (i = 0; i < tegra->soc->max_num_wakes; i++) {
 		struct irq_data *data;
 
-		tegra->wake_irqs[i] = platform_get_irq(pdev, i + WAKE_IRQ_START_INDEX);
+		tegra->wake_irqs[i] = platform_get_irq_optional(pdev, i + WAKE_IRQ_START_INDEX);
 		if (tegra->wake_irqs[i] < 0)
 			break;
 
-- 
2.43.0


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

* Re: [PATCH] usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs
  2026-01-08 10:21 [PATCH] usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs Wei-Cheng Chen
@ 2026-01-09 18:36 ` Jon Hunter
  2026-01-12 14:56 ` [PATCH v2] " Wei-Cheng Chen
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Hunter @ 2026-01-09 18:36 UTC (permalink / raw)
  To: Wei-Cheng Chen, Mathias Nyman, Greg Kroah-Hartman,
	Thierry Reding, Haotien Hsu
  Cc: linux-usb, linux-tegra, linux-kernel, Wayne Chang


On 08/01/2026 10:21, Wei-Cheng Chen wrote:
> From: Wayne Chang <waynec@nvidia.com>
> 
> When some wake IRQs are disabled in the device tree, the corresponding
> interrupt entries are removed from DT. In such cases, the driver
> currently calls platform_get_irq(), which returns -ENXIO and logs
> an error like:
> 
>    tegra-xusb 3610000.usb: error -ENXIO: IRQ index 2 not found
> 
> However, not all wake IRQs are mandatory. The hardware can operate
> normally even if some wake sources are not defined in DT. To avoid this
> false alarm and allow missing wake IRQs gracefully, use
> platform_get_irq_optional() instead of platform_get_irq().
> 
> Fixes: 5df186e2ef11 ("usb: xhci: tegra: Support USB wakeup function for Tegra234")
> Signed-off-by: Wayne Chang <waynec@nvidia.com>
> Signed-off-by: Wei-Cheng Chen <weichengc@nvidia.com>
> ---
>   drivers/usb/host/xhci-tegra.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 31ccced5125..8b492871d21 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -1563,7 +1563,7 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xu
>   	for (i = 0; i < tegra->soc->max_num_wakes; i++) {
>   		struct irq_data *data;
>   
> -		tegra->wake_irqs[i] = platform_get_irq(pdev, i + WAKE_IRQ_START_INDEX);
> +		tegra->wake_irqs[i] = platform_get_irq_optional(pdev, i + WAKE_IRQ_START_INDEX);
>   		if (tegra->wake_irqs[i] < 0)
>   			break;
>   

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>

Thanks!
Jon

-- 
nvpublic


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

* [PATCH v2] usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs
  2026-01-08 10:21 [PATCH] usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs Wei-Cheng Chen
  2026-01-09 18:36 ` Jon Hunter
@ 2026-01-12 14:56 ` Wei-Cheng Chen
  1 sibling, 0 replies; 3+ messages in thread
From: Wei-Cheng Chen @ 2026-01-12 14:56 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman, Thierry Reding,
	Jonathan Hunter, Haotien Hsu
  Cc: linux-usb, linux-tegra, linux-kernel, Wayne Chang, Wei-Cheng Chen

From: Wayne Chang <waynec@nvidia.com>

When some wake IRQs are disabled in the device tree, the corresponding
interrupt entries are removed from DT. In such cases, the driver
currently calls platform_get_irq(), which returns -ENXIO and logs
an error like:

  tegra-xusb 3610000.usb: error -ENXIO: IRQ index 2 not found

However, not all wake IRQs are mandatory. The hardware can operate
normally even if some wake sources are not defined in DT. To avoid this
false alarm and allow missing wake IRQs gracefully, use
platform_get_irq_optional() instead of platform_get_irq().

Fixes: 5df186e2ef11 ("usb: xhci: tegra: Support USB wakeup function for Tegra234")
Cc: stable@vger.kernel.org
Signed-off-by: Wayne Chang <waynec@nvidia.com>
Signed-off-by: Wei-Cheng Chen <weichengc@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
---
V1 -> V2:
 - Added Reviewed-by and Tested-by tags from Jon Hunter.
 - Added Cc: stable@vger.kernel.org tag to ensure backporting.
---
 drivers/usb/host/xhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 31ccced5125..8b492871d21 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1563,7 +1563,7 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xu
 	for (i = 0; i < tegra->soc->max_num_wakes; i++) {
 		struct irq_data *data;
 
-		tegra->wake_irqs[i] = platform_get_irq(pdev, i + WAKE_IRQ_START_INDEX);
+		tegra->wake_irqs[i] = platform_get_irq_optional(pdev, i + WAKE_IRQ_START_INDEX);
 		if (tegra->wake_irqs[i] < 0)
 			break;
 
-- 
2.43.0


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

end of thread, other threads:[~2026-01-12 14:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-08 10:21 [PATCH] usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs Wei-Cheng Chen
2026-01-09 18:36 ` Jon Hunter
2026-01-12 14:56 ` [PATCH v2] " Wei-Cheng Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®