HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset state
Subsystems (2)
PATCH 1/1 HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset state
From: Teik Heng Chong <[email protected]>
The controller registers should not be accessed while the controller's vcc_reset_n is asserted.
--- drivers/usb/host/xhci-dwc3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-dwc3.c +6 -1
@@ -227,6 +227,11 @@ static int xhci_dwc3_probe(struct udevice *dev)static int xhci_dwc3_remove (struct udevice *dev) {struct xhci_dwc3_plat *plat =dev_get_plat (dev); +int ret; + + ret =xhci_deregister (dev); +if (ret) +return ret;dwc3_shutdown_phy (dev, &plat->phys);
@@ -234,7 +239,7 @@ static int xhci_dwc3_remove(struct udevice *dev)reset_release_bulk (&plat->resets); -return xhci_deregister (dev); +return 0 ; }static const struct udevice_id xhci_dwc3_ids[] = {
Signature · 1 line
2.26.2
Quoted 6 lines · Jit Loon Lim
From: Teik Heng Chong <[email protected]>
The controller registers should not be accessed while the controller's
vcc_reset_nis asserted.Signed-off-by Teik Heng Chong <[email protected]>
Is this patch ported from Linux or is this custom development ?
Is there a matching patch/fix in Linux already ?
Quoted 19 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Wednesday, 21 June, 2023 10:19 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 2 lines · Jit Loon Lim
From: Teik Heng Chong <[email protected]>
Quoted 8 lines
Quoted 4 lines
The controller registers should not be accessed while the controller's
vcc_reset_nis asserted.Signed-off-by Teik Heng Chong <[email protected]>Is this patch ported from Linux or is this custom development ?
Is there a matching patch/fix in Linux already ?
In xhci_dwc3_probe(), the program sequence is
vcc reset -> clk init -> phy setup -> xhci_register
therefore, when xhci_dwc3_remove is called, the proper usb stop sequence should be xhci_register _> phy setup -> clk init -> vcc reset
if we look at linux driver https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-of-simple.c#L33
dwc3_of_simple_probe: The sequence is reset -> clock __dwc3_of_simple_teardown: Then, clock -> reset
So based on the above, we have made changes and the uboot fix is now aligned with linux driver.
Quoted 33 lines · Jit Loon
Quoted 19 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Wednesday, 21 June, 2023 10:19 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 2 lines · Jit Loon Lim
From: Teik Heng Chong <[email protected]>
Quoted 8 lines
Quoted 4 lines
The controller registers should not be accessed while the controller's
vcc_reset_nis asserted.Signed-off-by Teik Heng Chong <[email protected]>Is this patch ported from Linux or is this custom development ?
Is there a matching patch/fix in Linux already ?
In
xhci_dwc3_probe(), the program sequence is
vcc reset -> clk init -> phy setup ->xhci_register
therefore, whenxhci_dwc3_removeis called, the proper usb stop sequence should bexhci_register_> phy setup -> clk init -> vcc reset
Quoted 6 lines
if we look at linux driver https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-of-simple.c#L33
dwc3_of_simple_probe: The sequence is reset -> clock__dwc3_of_simple_teardown: Then, clock -> resetSo based on the above, we have made changes and the uboot fix is now aligned with linux driver.
Instead of adding random patches to the U-Boot dwc3 driver, please just synchronize the driver with Linux. You should be able to add the missing patches to the DWC3 driver from Linux since the last synchronization point, the process should be largely mechanical. Make sure to include commit ID of each Linux commit in the new matching U-Boot patch.
It shouldn't be difficult, one approach I can think of is roughly this:
- figure out the original merge base from which the DWC3 driver was imported to U-Boot
- in U-Boot, revert all dwc3 patches on top of that import patch
- pick all Linux kernel dwc3 patches from that merge base and apply on top of this U-Boot with reverts
- Run rebase and drop the reverts, let git drop duplicate patches
Quoted 68 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, 22 June, 2023 5:35 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>; Michal Simek <[email protected]>; Tom Rini <[email protected]>; Eugen Hristev <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 33 lines · Jit Loon
Quoted 19 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Wednesday, 21 June, 2023 10:19 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 2 lines · Jit Loon Lim
From: Teik Heng Chong <[email protected]>
Quoted 8 lines
Quoted 4 lines
The controller registers should not be accessed while the controller's
vcc_reset_nis asserted.Signed-off-by Teik Heng Chong <[email protected]>Is this patch ported from Linux or is this custom development ?
Is there a matching patch/fix in Linux already ?
In
xhci_dwc3_probe(), the program sequence is vcc reset -> clk init -> phy setup ->xhci_registertherefore, whenxhci_dwc3_removeis called, the proper usb stop sequence should bexhci_register_> phy setup -> clk init -> vcc resetQuoted 8 lines
if we look at linux driver
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-o
f-simple.c#L33
dwc3_of_simple_probe: The sequence is reset -> clock__dwc3_of_simple_teardown: Then, clock -> resetSo based on the above, we have made changes and the uboot fix is now
aligned with linux driver.
Instead of adding random patches to the U-Boot dwc3 driver, please just synchronize the driver with Linux. You should be able to add the missing patches to the DWC3 driver from Linux since the last synchronization point, the process should be largely mechanical. Make sure to include commit ID of each Linux commit in the new matching U-Boot patch.
Quoted 7 lines
It shouldn't be difficult, one approach I can think of is roughly this:
- figure out the original merge base from which the DWC3 driver was imported to U-Boot
- in U-Boot, revert all dwc3 patches on top of that import patch
- pick all Linux kernel dwc3 patches from that merge base and apply on top of this U-Boot with reverts
- Run rebase and drop the reverts, let git drop duplicate patches
We believed the previous reply from us is a bit confusing. There is no exact same function/file for U-Boot to use in Linux. What we are doing is, we are referring to Linux sequence.
Linux: (dwc3_of_simple_probe)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-of-simple.c#L33
U-Boot: (xhci_dwc3_probe)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhci-dwc3.c#L159
Linux: (__dwc3_of_simple_teardown)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-of-simple.c#L98
U-Boot: (xhci_dwc3_remove)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhci-dwc3.c#L227
So we believed that we can't directly pickup all Linux kernel dwc3 patches and merge to U-Boot.
Quoted 85 lines · Jit Loon
Quoted 68 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, 22 June, 2023 5:35 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>; Michal Simek <[email protected]>; Tom Rini <[email protected]>; Eugen Hristev <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 33 lines · Jit Loon
Quoted 19 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Wednesday, 21 June, 2023 10:19 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 2 lines · Jit Loon Lim
From: Teik Heng Chong <[email protected]>
Quoted 8 lines
Quoted 4 lines
The controller registers should not be accessed while the controller's
vcc_reset_nis asserted.Signed-off-by Teik Heng Chong <[email protected]>Is this patch ported from Linux or is this custom development ?
Is there a matching patch/fix in Linux already ?
In
xhci_dwc3_probe(), the program sequence is vcc reset -> clk init -> phy setup ->xhci_registertherefore, whenxhci_dwc3_removeis called, the proper usb stop sequence should bexhci_register_> phy setup -> clk init -> vcc resetQuoted 8 lines
if we look at linux driver
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-o
f-simple.c#L33
dwc3_of_simple_probe: The sequence is reset -> clock__dwc3_of_simple_teardown: Then, clock -> resetSo based on the above, we have made changes and the uboot fix is now
aligned with linux driver.
Instead of adding random patches to the U-Boot dwc3 driver, please just synchronize the driver with Linux. You should be able to add the missing patches to the DWC3 driver from Linux since the last synchronization point, the process should be largely mechanical. Make sure to include commit ID of each Linux commit in the new matching U-Boot patch.
Quoted 7 lines
It shouldn't be difficult, one approach I can think of is roughly this:
- figure out the original merge base from which the DWC3 driver was imported to U-Boot
- in U-Boot, revert all dwc3 patches on top of that import patch
- pick all Linux kernel dwc3 patches from that merge base and apply on top of this U-Boot with reverts
- Run rebase and drop the reverts, let git drop duplicate patchesWe believed the previous reply from us is a bit confusing. There is no exact same function/file for U-Boot to use in Linux. What we are doing is, we are referring to Linux sequence.
Linux: (
dwc3_of_simple_probe)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-of-simple.c#L33
U-Boot: (xhci_dwc3_probe)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhci-dwc3.c#L159
Quoted 6 lines
Linux: (
__dwc3_of_simple_teardown)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-of-simple.c#L98
U-Boot: (xhci_dwc3_remove)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhci-dwc3.c#L227So we believed that we can't directly pickup all Linux kernel dwc3 patches and merge to U-Boot.
If you were to sync the driver from Linux to U-Boot, then the same sequence as Linux uses would be automatically used too, right ?
Sorry for the abysmal delay in my reply.
Hi
Quoted 118 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Friday, 7 July, 2023 5:50 AM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>; Michal Simek <[email protected]>; Tom Rini <[email protected]>; Eugen Hristev <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 9 lines · Jit Loon
Quoted 9 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, 22 June, 2023 5:35 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon KhaiQuoted 10 lines
Quoted 10 lines
Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>; Michal Simek <[email protected]>; Tom Rini <[email protected]>; Eugen Hristev <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateOn 6/22/23 04:48, Lim, Jit Loon wrote:
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Wednesday, 21 June, 2023 10:19 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon KhaiQuoted 32 lines
Quoted 32 lines
Quoted 32 lines
Quoted 10 lines
Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateQuoted 2 lines · Jit Loon Lim
From: Teik Heng Chong <[email protected]>
Quoted 8 lines
Quoted 4 lines
The controller registers should not be accessed while the controller's
vcc_reset_nis asserted.Signed-off-by Teik Heng Chong <[email protected]>Is this patch ported from Linux or is this custom development ?
Is there a matching patch/fix in Linux already ?
In
xhci_dwc3_probe(), the program sequence is vcc reset -> clk init -> phy setup ->xhci_registertherefore, whenxhci_dwc3_removeis called, the proper usb stop sequence should bexhci_register_> phy setup -> clk init -> vcc resetif we look at linux driver
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3
-o
f-simple.c#L33
dwc3_of_simple_probe: The sequence is reset -> clock__dwc3_of_simple_teardown: Then, clock -> resetQuoted 8 lines
Quoted 8 lines
Quoted 1 line
So based on the above, we have made changes and the uboot fix is now
aligned with linux driver.
Instead of adding random patches to the U-Boot dwc3 driver, please just synchronize the driver with Linux. You should be able to add the missing patches to the DWC3 driver from Linux since the last synchronization point, the process should be largely mechanical. Make sure to include commit ID of each Linux commit in the new matching U-
Boot patch.
Quoted 27 lines
Quoted 8 lines
It shouldn't be difficult, one approach I can think of is roughly this:
- figure out the original merge base from which the DWC3 driver was imported to U-Boot
- in U-Boot, revert all dwc3 patches on top of that import patch
- pick all Linux kernel dwc3 patches from that merge base and apply on top of this U-Boot with reverts
- Run rebase and drop the reverts, let git drop duplicate patchesWe believed the previous reply from us is a bit confusing. There is no exact same function/file for U-Boot to use in Linux. What we are doing is, we are referring to Linux sequence.
Linux: (
dwc3_of_simple_probe)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-o
f-simple.c#L33
U-Boot: (xhci_dwc3_probe)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhci-
dwc3.c#L159Linux: (
__dwc3_of_simple_teardown)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-o
f-simple.c#L98
U-Boot: (xhci_dwc3_remove)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhci-
dwc3.c#L227
Quoted 7 lines
Quoted 1 line
So we believed that we can't directly pickup all Linux kernel dwc3 patches
and merge to U-Boot.
If you were to sync the driver from Linux to U-Boot, then the same sequence as Linux uses would be automatically used too, right ?
Sorry for the abysmal delay in my reply.
Are we saying that we shall port/use Linux driver in U-Boot and abandon the existing USB host driver in U-Boot?
On 7/21/23 05:26, Lim, Jit Loon wrote:
Hi,
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Linux: (
__dwc3_of_simple_teardown)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3-o
f-simple.c#L98
U-Boot: (xhci_dwc3_remove)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhci-
dwc3.c#L227So we believed that we can't directly pickup all Linux kernel dwc3 patches
Quoted 8 lines
Quoted 6 lines
and merge to U-Boot.
If you were to sync the driver from Linux to U-Boot, then the same sequence as Linux uses would be automatically used too, right ?
Sorry for the abysmal delay in my reply.
Are we saying that we shall port/use Linux driver in U-Boot and abandon the existing USB host driver in U-Boot?
No, the existing driver in U-Boot is a port of the Linux driver, it is just outdated. I am saying, just pick the missing patches from Linux and add them to U-Boot, so the two drivers are in sync.
Hi
Quoted 38 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Saturday, 22 July, 2023 4:31 AM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>; Michal Simek <[email protected]>; Tom Rini <[email protected]>; Eugen Hristev <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateOn 7/21/23 05:26, Lim, Jit Loon wrote:
Hi,
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines
Linux: (
__dwc3_of_simple_teardown)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3
-o
f-simple.c#L98
U-Boot: (xhci_dwc3_remove)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhc
i-
dwc3.c#L227So we believed that we can't directly pickup all Linux kernel dwc3 patches
and merge to U-Boot.
If you were to sync the driver from Linux to U-Boot, then the same sequence as Linux uses would be automatically used too, right ?
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Sorry for the abysmal delay in my reply.
Are we saying that we shall port/use Linux driver in U-Boot and abandon
the existing USB host driver in U-Boot?
No, the existing driver in U-Boot is a port of the Linux driver, it is just outdated. I am saying, just pick the missing patches from Linux and add them to U-Boot, so the two drivers are in sync.
We do not see a DWC3 host driver under usb host folder in Linux https://elixir.bootlin.com/linux/latest/source/drivers/usb/host. Would you mind to tell us which DWC3 host driver we should use in usb host folder? Then, we can pick up the missing patches
On 7/26/23 06:04, Chong, Teik Heng wrote:
[...]
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 11 lines
Linux: (
__dwc3_of_simple_teardown)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dwc3
-o
f-simple.c#L98
U-Boot: (xhci_dwc3_remove)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/xhc
i-
dwc3.c#L227So we believed that we can't directly pickup all Linux kernel dwc3 patches
and merge to U-Boot.
If you were to sync the driver from Linux to U-Boot, then the same sequence as Linux uses would be automatically used too, right ?
Sorry for the abysmal delay in my reply.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Are we saying that we shall port/use Linux driver in U-Boot and abandon
the existing USB host driver in U-Boot?
No, the existing driver in U-Boot is a port of the Linux driver, it is just outdated. I am saying, just pick the missing patches from Linux and add them to U-Boot, so the two drivers are in sync.
We do not see a DWC3 host driver under usb host folder in Linux https://elixir.bootlin.com/linux/latest/source/drivers/usb/host. Would you mind to tell us which DWC3 host driver we should use in usb host folder? Then, we can pick up the missing patches
drivers/usb/dwc3
Same as u-boot
Hi
Quoted 48 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Wednesday, 26 July, 2023 6:30 PM
To: Chong, Teik Heng <[email protected]>; Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>; Bin Meng <[email protected]>; Michal Simek <[email protected]>; Tom Rini <[email protected]>; Eugen Hristev <[email protected]>
Subject: Re: [PATCH v1] HSD #18028953892: usb: xhci-dwc3: Fix USB3.1 controller register access in reset stateOn 7/26/23 06:04, Chong, Teik Heng wrote:
[...]Quoted 28 lines
Quoted 27 lines
Quoted 15 lines
Quoted 15 lines
Quoted 11 lines
Linux: (
__dwc3_of_simple_teardown)
https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/dw
c3
-o
f-simple.c#L98
U-Boot: (xhci_dwc3_remove)
https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/host/x
hc
i-
dwc3.c#L227Quoted 2 lines
So we believed that we can't directly pickup all Linux kernel dwc3 patches
and merge to U-Boot.
Quoted 7 lines
Quoted 4 lines
If you were to sync the driver from Linux to U-Boot, then the same sequence as Linux uses would be automatically used too, right ?
Sorry for the abysmal delay in my reply.
Are we saying that we shall port/use Linux driver in U-Boot and abandon
the existing USB host driver in U-Boot?
No, the existing driver in U-Boot is a port of the Linux driver, it is just outdated. I am saying, just pick the missing patches from Linux and add them to U-Boot, so the two drivers are in sync.
Quoted 8 lines
Quoted 4 lines
We do not see a DWC3 host driver under usb host folder in Linux
https://elixir.bootlin.com/linux/latest/source/drivers/usb/host. Would you mind to tell us which DWC3 host driver we should use in usb host folder? Then, we can pick up the missing patches
drivers/usb/dwc3Same as u-boot
Ok. We will use the driver from drivers/usb/dwc3. Thank you for the pointers
Quoted 28 lines · Jit Loon Lim
From: Teik Heng Chong <[email protected]>
The controller registers should not be accessed while the controller's
vcc_reset_nis asserted.Signed-off-by Teik Heng Chong <[email protected]>--- drivers/usb/host/xhci-dwc3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/usb/host/xhci-dwc3.c +5
-0@@ -227,6 +227,11 @@ static int xhci_dwc3_probe(struct udevice *dev)static int xhci_dwc3_remove (struct udevice *dev) {struct xhci_dwc3_plat *plat =dev_get_plat (dev); +int ret; + + ret =xhci_deregister (dev); +if (ret) +return ret;dwc3_shutdown_phy (dev, &plat->phys);
drivers/usb/host/xhci-dwc3.c static int xhci_dwc3_remove(struct udevice *dev) · line 245
Quoted 8 lines
drivers/usb/host/xhci-dwc3.c +1
-1@@ -234,7 +239,7 @@ static int xhci_dwc3_remove(struct udevice *dev)reset_release_bulk (&plat->resets); -return xhci_deregister (dev); +return 0 ; }static const struct udevice_id xhci_dwc3_ids[] = {
Please remove the HSD tag in the commit summary.
Regards,
Bin