* [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk'
@ 2024-02-12 16:19 Frank Li
2024-02-12 16:19 ` [PATCH v2 1/2] dt-bindings: " Frank Li
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Frank Li @ 2024-02-12 16:19 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Felipe Balbi, Thinh Nguyen
Cc: linux-usb, devicetree, linux-kernel, imx, Frank Li
Since dt maintainer give comments at old thread
https://lore.kernel.org/linux-usb/20240119213130.3147517-1-Frank.Li@nxp.com/
The patch v4 already merged.
https://lore.kernel.org/linux-usb/20240124152525.3910311-1-Frank.Li@nxp.com/
In thread "dwc3: drop 'quirk' suffix at snps,host-vbus-glitches-quirk"
https://lore.kernel.org/imx/ZcVr05vAYsObrrRR@lizhi-Precision-Tower-5810/T/#t
DT maintainer and DWC maintainer think it is better to apply workaround
unconditionaly.
Drop 'snps,host-vbus-glitches-quirk' and apply workaround unconditional.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Changes in v2:
- Drop 'snps,host-vbus-glitches-quirk' and apply workaround unconditional.
- Link to v1: https://lore.kernel.org/r/20240207-vbus-glitch-v1-0-7be87099461d@nxp.com
---
Frank Li (2):
dt-bindings: usb: dwc3: drop 'snps,host-vbus-glitches-quirk'
usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally
Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 7 -------
drivers/usb/dwc3/core.c | 3 ---
drivers/usb/dwc3/core.h | 2 --
drivers/usb/dwc3/host.c | 3 +--
4 files changed, 1 insertion(+), 14 deletions(-)
---
base-commit: b1d3a0e70c3881d2f8cf6692ccf7c2a4fb2d030d
change-id: 20240207-vbus-glitch-97fd340d8a66
Best regards,
--
Frank Li <Frank.Li@nxp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] dt-bindings: usb: dwc3: drop 'snps,host-vbus-glitches-quirk'
2024-02-12 16:19 [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk' Frank Li
@ 2024-02-12 16:19 ` Frank Li
2024-02-12 16:19 ` [PATCH v2 2/2] usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally Frank Li
2024-02-12 17:19 ` [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk' Conor Dooley
2 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2024-02-12 16:19 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Felipe Balbi, Thinh Nguyen
Cc: linux-usb, devicetree, linux-kernel, imx, Frank Li
Drop 'snps,host-vbus-glitches-quirk'. It is safer to keep vbus disabled
before handing over to xhci driver. Needn't this property to control enable
workaround. Apply workaround unconditional.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 7 -------
1 file changed, 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index 8f5d250070c78..203a1eb66691f 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -273,13 +273,6 @@ properties:
with an external supply.
type: boolean
- snps,host-vbus-glitches-quirk:
- description:
- When set, power off all Root Hub ports immediately after
- setting host mode to avoid vbus (negative) glitch happen in later
- xhci reset. And the vbus will back to 5V automatically when reset done.
- type: boolean
-
snps,is-utmi-l1-suspend:
description:
True when DWC3 asserts output signal utmi_l1_suspend_n, false when
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally
2024-02-12 16:19 [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk' Frank Li
2024-02-12 16:19 ` [PATCH v2 1/2] dt-bindings: " Frank Li
@ 2024-02-12 16:19 ` Frank Li
2024-02-15 23:39 ` Thinh Nguyen
2024-02-12 17:19 ` [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk' Conor Dooley
2 siblings, 1 reply; 5+ messages in thread
From: Frank Li @ 2024-02-12 16:19 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Felipe Balbi, Thinh Nguyen
Cc: linux-usb, devicetree, linux-kernel, imx, Frank Li
Remove 'snps,host-vbus-glitches-quirk' and apply workaround
unconditionally.
It is safer to keep vbus disabled before handing over to xhci driver. So
needn't 'snps,host-vbus-glitches' property to enable it and apply it
unconditionally.
Remove all host_vbus_glitches variable and call
dwc3_power_off_all_roothub_ports() directly.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/usb/dwc3/core.c | 3 ---
drivers/usb/dwc3/core.h | 2 --
drivers/usb/dwc3/host.c | 3 +--
3 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 3b68e8e45b8b9..3e55838c00014 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1626,9 +1626,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
dwc->dis_split_quirk = device_property_read_bool(dev,
"snps,dis-split-quirk");
- dwc->host_vbus_glitches_quirk = device_property_read_bool(dev,
- "snps,host-vbus-glitches-quirk");
-
dwc->lpm_nyet_threshold = lpm_nyet_threshold;
dwc->tx_de_emphasis = tx_de_emphasis;
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index df544ec730d22..e3eea965e57bf 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -1132,7 +1132,6 @@ struct dwc3_scratchpad_array {
* 2 - No de-emphasis
* 3 - Reserved
* @dis_metastability_quirk: set to disable metastability quirk.
- * @host_vbus_glitches_quirk: set to avoid vbus glitch during xhci reset.
* @dis_split_quirk: set to disable split boundary.
* @wakeup_configured: set if the device is configured for remote wakeup.
* @suspended: set to track suspend event due to U3/L2.
@@ -1354,7 +1353,6 @@ struct dwc3 {
unsigned tx_de_emphasis:2;
unsigned dis_metastability_quirk:1;
- unsigned host_vbus_glitches_quirk:1;
unsigned dis_split_quirk:1;
unsigned async_callbacks:1;
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index ae189b7a4f8b8..98964e8dea1f7 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -114,8 +114,7 @@ int dwc3_host_init(struct dwc3 *dwc)
* Some platforms need to power off all Root hub ports immediately after DWC3 set to host
* mode to avoid VBUS glitch happen when xhci get reset later.
*/
- if (dwc->host_vbus_glitches_quirk)
- dwc3_power_off_all_roothub_ports(dwc);
+ dwc3_power_off_all_roothub_ports(dwc);
irq = dwc3_host_get_irq(dwc);
if (irq < 0)
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk'
2024-02-12 16:19 [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk' Frank Li
2024-02-12 16:19 ` [PATCH v2 1/2] dt-bindings: " Frank Li
2024-02-12 16:19 ` [PATCH v2 2/2] usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally Frank Li
@ 2024-02-12 17:19 ` Conor Dooley
2 siblings, 0 replies; 5+ messages in thread
From: Conor Dooley @ 2024-02-12 17:19 UTC (permalink / raw)
To: Frank Li
Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Felipe Balbi, Thinh Nguyen, linux-usb, devicetree,
linux-kernel, imx
[-- Attachment #1: Type: text/plain, Size: 871 bytes --]
On Mon, Feb 12, 2024 at 11:19:06AM -0500, Frank Li wrote:
> Since dt maintainer give comments at old thread
> https://lore.kernel.org/linux-usb/20240119213130.3147517-1-Frank.Li@nxp.com/
>
> The patch v4 already merged.
> https://lore.kernel.org/linux-usb/20240124152525.3910311-1-Frank.Li@nxp.com/
>
> In thread "dwc3: drop 'quirk' suffix at snps,host-vbus-glitches-quirk"
> https://lore.kernel.org/imx/ZcVr05vAYsObrrRR@lizhi-Precision-Tower-5810/T/#t
>
> DT maintainer and DWC maintainer think it is better to apply workaround
> unconditionaly.
>
> Drop 'snps,host-vbus-glitches-quirk' and apply workaround unconditional.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Changes in v2:
> - Drop 'snps,host-vbus-glitches-quirk' and apply workaround unconditional.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally
2024-02-12 16:19 ` [PATCH v2 2/2] usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally Frank Li
@ 2024-02-15 23:39 ` Thinh Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thinh Nguyen @ 2024-02-15 23:39 UTC (permalink / raw)
To: Frank Li
Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Felipe Balbi, Thinh Nguyen,
linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, imx@lists.linux.dev
On Mon, Feb 12, 2024, Frank Li wrote:
> Remove 'snps,host-vbus-glitches-quirk' and apply workaround
> unconditionally.
>
> It is safer to keep vbus disabled before handing over to xhci driver. So
> needn't 'snps,host-vbus-glitches' property to enable it and apply it
> unconditionally.
>
> Remove all host_vbus_glitches variable and call
> dwc3_power_off_all_roothub_ports() directly.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/usb/dwc3/core.c | 3 ---
> drivers/usb/dwc3/core.h | 2 --
> drivers/usb/dwc3/host.c | 3 +--
> 3 files changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 3b68e8e45b8b9..3e55838c00014 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1626,9 +1626,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
> dwc->dis_split_quirk = device_property_read_bool(dev,
> "snps,dis-split-quirk");
>
> - dwc->host_vbus_glitches_quirk = device_property_read_bool(dev,
> - "snps,host-vbus-glitches-quirk");
> -
> dwc->lpm_nyet_threshold = lpm_nyet_threshold;
> dwc->tx_de_emphasis = tx_de_emphasis;
>
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index df544ec730d22..e3eea965e57bf 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -1132,7 +1132,6 @@ struct dwc3_scratchpad_array {
> * 2 - No de-emphasis
> * 3 - Reserved
> * @dis_metastability_quirk: set to disable metastability quirk.
> - * @host_vbus_glitches_quirk: set to avoid vbus glitch during xhci reset.
> * @dis_split_quirk: set to disable split boundary.
> * @wakeup_configured: set if the device is configured for remote wakeup.
> * @suspended: set to track suspend event due to U3/L2.
> @@ -1354,7 +1353,6 @@ struct dwc3 {
> unsigned tx_de_emphasis:2;
>
> unsigned dis_metastability_quirk:1;
> - unsigned host_vbus_glitches_quirk:1;
>
> unsigned dis_split_quirk:1;
> unsigned async_callbacks:1;
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index ae189b7a4f8b8..98964e8dea1f7 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -114,8 +114,7 @@ int dwc3_host_init(struct dwc3 *dwc)
> * Some platforms need to power off all Root hub ports immediately after DWC3 set to host
> * mode to avoid VBUS glitch happen when xhci get reset later.
> */
> - if (dwc->host_vbus_glitches_quirk)
> - dwc3_power_off_all_roothub_ports(dwc);
> + dwc3_power_off_all_roothub_ports(dwc);
>
> irq = dwc3_host_get_irq(dwc);
> if (irq < 0)
>
> --
> 2.34.1
>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Thanks,
Thinh
ps: Was there a v1 of this series or did I drop it from my inbox?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-15 23:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-12 16:19 [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk' Frank Li
2024-02-12 16:19 ` [PATCH v2 1/2] dt-bindings: " Frank Li
2024-02-12 16:19 ` [PATCH v2 2/2] usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally Frank Li
2024-02-15 23:39 ` Thinh Nguyen
2024-02-12 17:19 ` [PATCH v2 0/2] usb: dwc3: drop 'snps,host-vbus-glitches-quirk' Conor Dooley
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).