linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xhci: tegra: fix checked USB2 port number
@ 2024-10-11  7:22 henryl
  2024-10-11  8:03 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: henryl @ 2024-10-11  7:22 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman, Thierry Reding,
	Jonathan Hunter, linux-usb, linux-tegra, linux-kernel
  Cc: henryl

From: Henry Lin <henryl@nvidia.com>

USB2 root hub in VF may contain less port number than supported USB2
phy number. Checking all USB2 phy number here would cause invalid
memory access.

[  116.923438] Unable to handle kernel paging request at virtual address 006c622f7665642f
...
[  117.213640] Call trace:
[  117.216783]  tegra_xusb_enter_elpg+0x23c/0x658
[  117.222021]  tegra_xusb_runtime_suspend+0x40/0x68
[  117.227260]  pm_generic_runtime_suspend+0x30/0x50
[  117.232847]  __rpm_callback+0x84/0x3c0
[  117.237038]  rpm_suspend+0x2dc/0x740
[  117.241229] pm_runtime_work+0xa0/0xb8
[  117.245769]  process_scheduled_works+0x24c/0x478
[  117.251007]  worker_thread+0x23c/0x328
[  117.255547]  kthread+0x104/0x1b0
[  117.259389]  ret_from_fork+0x10/0x20
[  117.263582] Code: 54000222 f9461ae8 f8747908 b4ffff48 (f9400100)

Signed-off-by: Henry Lin <henryl@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 6246d5ad1468..76f228e7443c 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -2183,7 +2183,7 @@ static int tegra_xusb_enter_elpg(struct tegra_xusb *tegra, bool runtime)
 		goto out;
 	}
 
-	for (i = 0; i < tegra->num_usb_phys; i++) {
+	for (i = 0; i < xhci->usb2_rhub.num_ports; i++) {
 		if (!xhci->usb2_rhub.ports[i])
 			continue;
 		portsc = readl(xhci->usb2_rhub.ports[i]->addr);
-- 
2.25.1


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

* Re: [PATCH] xhci: tegra: fix checked USB2 port number
  2024-10-11  7:22 [PATCH] xhci: tegra: fix checked USB2 port number henryl
@ 2024-10-11  8:03 ` Greg Kroah-Hartman
  2024-10-11  8:32   ` Henry Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-10-11  8:03 UTC (permalink / raw)
  To: henryl
  Cc: Mathias Nyman, Thierry Reding, Jonathan Hunter, linux-usb,
	linux-tegra, linux-kernel

On Fri, Oct 11, 2024 at 03:22:40PM +0800, henryl wrote:
> From: Henry Lin <henryl@nvidia.com>
> 
> USB2 root hub in VF may contain less port number than supported USB2
> phy number. Checking all USB2 phy number here would cause invalid
> memory access.
> 
> [  116.923438] Unable to handle kernel paging request at virtual address 006c622f7665642f
> ...
> [  117.213640] Call trace:
> [  117.216783]  tegra_xusb_enter_elpg+0x23c/0x658
> [  117.222021]  tegra_xusb_runtime_suspend+0x40/0x68
> [  117.227260]  pm_generic_runtime_suspend+0x30/0x50
> [  117.232847]  __rpm_callback+0x84/0x3c0
> [  117.237038]  rpm_suspend+0x2dc/0x740
> [  117.241229] pm_runtime_work+0xa0/0xb8
> [  117.245769]  process_scheduled_works+0x24c/0x478
> [  117.251007]  worker_thread+0x23c/0x328
> [  117.255547]  kthread+0x104/0x1b0
> [  117.259389]  ret_from_fork+0x10/0x20
> [  117.263582] Code: 54000222 f9461ae8 f8747908 b4ffff48 (f9400100)
> 
> Signed-off-by: Henry Lin <henryl@nvidia.com>

What commit id does this fix?  Should it be backported?

thanks,

greg k-h

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

* Re: [PATCH] xhci: tegra: fix checked USB2 port number
  2024-10-11  8:03 ` Greg Kroah-Hartman
@ 2024-10-11  8:32   ` Henry Lin
  2024-10-11  8:44     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Henry Lin @ 2024-10-11  8:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mathias Nyman, Thierry Reding, Jon Hunter,
	linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org

>> What commit id does this fix?  Should it be backported?
Below change is fixed. It needs to be backported.
a30951d31b25 ("xhci: tegra: USB2 pad power controls") 

Thanks.
--nvpublic

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

* Re: [PATCH] xhci: tegra: fix checked USB2 port number
  2024-10-11  8:32   ` Henry Lin
@ 2024-10-11  8:44     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-10-11  8:44 UTC (permalink / raw)
  To: Henry Lin
  Cc: Mathias Nyman, Thierry Reding, Jon Hunter,
	linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Fri, Oct 11, 2024 at 08:32:27AM +0000, Henry Lin wrote:
> >> What commit id does this fix?  Should it be backported?
> Below change is fixed. It needs to be backported.
> a30951d31b25 ("xhci: tegra: USB2 pad power controls") 

Great, can you resend with the proper Fixes: tag and the needed cc:
stable line as well?

thanks,

greg k-h

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

end of thread, other threads:[~2024-10-11  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  7:22 [PATCH] xhci: tegra: fix checked USB2 port number henryl
2024-10-11  8:03 ` Greg Kroah-Hartman
2024-10-11  8:32   ` Henry Lin
2024-10-11  8:44     ` Greg Kroah-Hartman

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