linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes
@ 2024-02-14  9:46 Roger Quadros
  2024-02-14  9:46 ` [PATCH v3 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove() Roger Quadros
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Roger Quadros @ 2024-02-14  9:46 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: nm, r-gunasekaran, afd, b-liu, srk, francesco, linux-usb,
	linux-kernel, devicetree, Roger Quadros

Hi,

This series fixes errors during module removal. It also
implements PHY core voltage selection as per TI recommendation
and workaround for Errata i2409 [1].

The workaround needs PHY2 region to be present in device node.
The device tree patch will be sent later after the DT binding doc
is merged.

[1] - https://www.ti.com/lit/er/sprz487d/sprz487d.pdf

Changelog in each file

v2: https://lore.kernel.org/all/20240205141221.56076-1-rogerq@kernel.org/
v1: https://lore.kernel.org/all/20240201121220.5523-1-rogerq@kernel.org/

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Roger Quadros (5):
      usb: dwc3-am62: call of_platform_depopulate in .remove()
      usb: dwc3-am62: fix error on module removal
      usb: dwc3-am62: Fix PHY core voltage selection
      dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space
      usb: dwc3-am62: add workaround for Errata i2409

 .../devicetree/bindings/usb/ti,am62-usb.yaml       |  8 +++-
 drivers/usb/dwc3/dwc3-am62.c                       | 45 ++++++++++++++++------
 2 files changed, 39 insertions(+), 14 deletions(-)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20240206-for-v6-9-am62-usb-errata-3-0-233024ea8e9d

Best regards,
-- 
Roger Quadros <rogerq@kernel.org>


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

* [PATCH v3 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove()
  2024-02-14  9:46 [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
@ 2024-02-14  9:46 ` Roger Quadros
  2024-02-23 22:14   ` Thinh Nguyen
  2024-02-14  9:46 ` [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal Roger Quadros
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-02-14  9:46 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: nm, r-gunasekaran, afd, b-liu, srk, francesco, linux-usb,
	linux-kernel, devicetree, Roger Quadros

We called of_platform_populate() in .probe() so call the
cleanup function of_platform_depopulate() in .remove().

Get rid of the now unnnecessary dwc3_ti_remove_core().

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Changelog:

v3: no change
v2: no change
	https://lore.kernel.org/all/20240205141221.56076-2-rogerq@kernel.org/
v1: https://lore.kernel.org/all/20240201121220.5523-2-rogerq@kernel.org/
---
 drivers/usb/dwc3/dwc3-am62.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 90a587bc29b7..1bfc9e67614f 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -267,21 +267,13 @@ static int dwc3_ti_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int dwc3_ti_remove_core(struct device *dev, void *c)
-{
-	struct platform_device *pdev = to_platform_device(dev);
-
-	platform_device_unregister(pdev);
-	return 0;
-}
-
 static void dwc3_ti_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct dwc3_am62 *am62 = platform_get_drvdata(pdev);
 	u32 reg;
 
-	device_for_each_child(dev, NULL, dwc3_ti_remove_core);
+	of_platform_depopulate(dev);
 
 	/* Clear mode valid bit */
 	reg = dwc3_ti_readl(am62, USBSS_MODE_CONTROL);

-- 
2.34.1


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

* [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal
  2024-02-14  9:46 [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
  2024-02-14  9:46 ` [PATCH v3 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove() Roger Quadros
@ 2024-02-14  9:46 ` Roger Quadros
  2024-02-23 22:17   ` Thinh Nguyen
  2024-02-23 22:31   ` Thinh Nguyen
  2024-02-14  9:46 ` [PATCH v3 3/5] usb: dwc3-am62: Fix PHY core voltage selection Roger Quadros
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: Roger Quadros @ 2024-02-14  9:46 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: nm, r-gunasekaran, afd, b-liu, srk, francesco, linux-usb,
	linux-kernel, devicetree, Roger Quadros

As runtime PM is enabled, the module can be runtime
suspended when .remove() is called.

Do a pm_runtime_get_sync() to make sure module is active
before doing any register operations.

Doing a pm_runtime_put_sync() should disable the refclk
so no need to disable it again.

Fixes the below warning at module removel.

[   39.705310] ------------[ cut here ]------------
[   39.710004] clk:162:3 already disabled
[   39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clk_core_disable+0xb0/0xb8

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Changelog:

v3: no change

v2: no change
	https://lore.kernel.org/all/20240205141221.56076-3-rogerq@kernel.org/

v1: https://lore.kernel.org/all/20240201121220.5523-3-rogerq@kernel.org/
---
 drivers/usb/dwc3/dwc3-am62.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 1bfc9e67614f..600ba9cfefea 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -273,6 +273,11 @@ static void dwc3_ti_remove(struct platform_device *pdev)
 	struct dwc3_am62 *am62 = platform_get_drvdata(pdev);
 	u32 reg;
 
+	pm_runtime_get_sync(dev);
+
+	device_wakeup_disable(dev);
+	device_set_wakeup_capable(dev, false);
+
 	of_platform_depopulate(dev);
 
 	/* Clear mode valid bit */
@@ -281,7 +286,6 @@ static void dwc3_ti_remove(struct platform_device *pdev)
 	dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg);
 
 	pm_runtime_put_sync(dev);
-	clk_disable_unprepare(am62->usb2_refclk);
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
 }

-- 
2.34.1


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

* [PATCH v3 3/5] usb: dwc3-am62: Fix PHY core voltage selection
  2024-02-14  9:46 [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
  2024-02-14  9:46 ` [PATCH v3 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove() Roger Quadros
  2024-02-14  9:46 ` [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal Roger Quadros
@ 2024-02-14  9:46 ` Roger Quadros
  2024-02-23 22:19   ` Thinh Nguyen
  2024-02-14  9:46 ` [PATCH v3 4/5] dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space Roger Quadros
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-02-14  9:46 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: nm, r-gunasekaran, afd, b-liu, srk, francesco, linux-usb,
	linux-kernel, devicetree, Roger Quadros

TRM information is outdated and design team has confirmed
that PHY_CORE_VOLTAGE should be 0 irrespective of
VDD_CORE voltage.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Changelog:

v3: no change

v2: no change
	https://lore.kernel.org/all/20240205141221.56076-4-rogerq@kernel.org/

v1: https://lore.kernel.org/all/20240201121220.5523-4-rogerq@kernel.org/
---
 drivers/usb/dwc3/dwc3-am62.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 600ba9cfefea..af1ce934e7fb 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -97,7 +97,8 @@
 #define USBSS_VBUS_STAT_SESSVALID	BIT(2)
 #define USBSS_VBUS_STAT_VBUSVALID	BIT(0)
 
-/* Mask for PHY PLL REFCLK */
+/* USB_PHY_CTRL register bits in CTRL_MMR */
+#define PHY_CORE_VOLTAGE_MASK	BIT(31)
 #define PHY_PLL_REFCLK_MASK	GENMASK(3, 0)
 
 #define DWC3_AM62_AUTOSUSPEND_DELAY	100
@@ -162,6 +163,13 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62)
 
 	am62->offset = args.args[0];
 
+	/* Core voltage. PHY_CORE_VOLTAGE bit Recommended to be 0 always */
+	ret = regmap_update_bits(am62->syscon, am62->offset, PHY_CORE_VOLTAGE_MASK, 0);
+	if (ret) {
+		dev_err(dev, "failed to set phy core voltage\n");
+		return ret;
+	}
+
 	ret = regmap_update_bits(am62->syscon, am62->offset, PHY_PLL_REFCLK_MASK, am62->rate_code);
 	if (ret) {
 		dev_err(dev, "failed to set phy pll reference clock rate\n");

-- 
2.34.1


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

* [PATCH v3 4/5] dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space
  2024-02-14  9:46 [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
                   ` (2 preceding siblings ...)
  2024-02-14  9:46 ` [PATCH v3 3/5] usb: dwc3-am62: Fix PHY core voltage selection Roger Quadros
@ 2024-02-14  9:46 ` Roger Quadros
  2024-02-14 14:09   ` Rob Herring
  2024-02-14  9:46 ` [PATCH v3 5/5] usb: dwc3-am62: add workaround for Errata i2409 Roger Quadros
  2024-02-23 13:17 ` [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
  5 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-02-14  9:46 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: nm, r-gunasekaran, afd, b-liu, srk, francesco, linux-usb,
	linux-kernel, devicetree, Roger Quadros

Add PHY2 register space to DT binding documentation.

We use minItems: 1 as DT update will come later and we don't
want warnings for existing DTs.

So far this register space was not required but due to the
newly identified Errata i2409 [1] we need to poke this
register space.

[1] https://www.ti.com/lit/er/sprz487d/sprz487d.pdf

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Changelog:

v3: no change

v2: add minItems and update commit log
	https://lore.kernel.org/all/20240205141221.56076-5-rogerq@kernel.org/

v1: was sent as part of different series
https://lore.kernel.org/all/20240201120332.4811-5-rogerq@kernel.org/
---
 Documentation/devicetree/bindings/usb/ti,am62-usb.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml b/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml
index fec5651f5602..f6e6d084d1c5 100644
--- a/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml
+++ b/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml
@@ -14,7 +14,10 @@ properties:
     const: ti,am62-usb
 
   reg:
-    maxItems: 1
+    minItems: 1
+    items:
+      - description: USB CFG register space
+      - description: USB PHY2 register space
 
   ranges: true
 
@@ -82,7 +85,8 @@ examples:
 
       usbss1: usb@f910000 {
         compatible = "ti,am62-usb";
-        reg = <0x00 0x0f910000 0x00 0x800>;
+        reg = <0x00 0x0f910000 0x00 0x800>,
+              <0x00 0x0f918000 0x00 0x400>;
         clocks = <&k3_clks 162 3>;
         clock-names = "ref";
         ti,syscon-phy-pll-refclk = <&wkup_conf 0x4018>;

-- 
2.34.1


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

* [PATCH v3 5/5] usb: dwc3-am62: add workaround for Errata i2409
  2024-02-14  9:46 [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
                   ` (3 preceding siblings ...)
  2024-02-14  9:46 ` [PATCH v3 4/5] dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space Roger Quadros
@ 2024-02-14  9:46 ` Roger Quadros
  2024-02-23 22:24   ` Thinh Nguyen
  2024-02-23 13:17 ` [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
  5 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-02-14  9:46 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: nm, r-gunasekaran, afd, b-liu, srk, francesco, linux-usb,
	linux-kernel, devicetree, Roger Quadros

All AM62 devices have Errata i2409 [1] due to which
USB2 PHY may lock up due to short suspend.

Workaround involves setting bit 5 and 4 PLL_REG12
in PHY2 register space after USB controller is brought
out of LPSC reset but before controller initialization.

Handle this workaround.

[1] - https://www.ti.com/lit/er/sprz487d/sprz487d.pdf

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
Changelog:

v3:
- move requesting of PHY2 region to right where we need it

v2:
- don't add phy read/write helpers or add phy to private data
	https://lore.kernel.org/all/20240205141221.56076-5-rogerq@kernel.org/

v1: https://lore.kernel.org/all/20240201121220.5523-5-rogerq@kernel.org/
---
 drivers/usb/dwc3/dwc3-am62.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index af1ce934e7fb..163278050595 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -101,6 +101,11 @@
 #define PHY_CORE_VOLTAGE_MASK	BIT(31)
 #define PHY_PLL_REFCLK_MASK	GENMASK(3, 0)
 
+/* USB PHY2 register offsets */
+#define	USB_PHY_PLL_REG12		0x130
+#define	USB_PHY_PLL_LDO_REF_EN		BIT(5)
+#define	USB_PHY_PLL_LDO_REF_EN_EN	BIT(4)
+
 #define DWC3_AM62_AUTOSUSPEND_DELAY	100
 
 struct dwc3_am62 {
@@ -184,8 +189,9 @@ static int dwc3_ti_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *node = pdev->dev.of_node;
 	struct dwc3_am62 *am62;
-	int i, ret;
 	unsigned long rate;
+	void __iomem *phy;
+	int i, ret;
 	u32 reg;
 
 	am62 = devm_kzalloc(dev, sizeof(*am62), GFP_KERNEL);
@@ -227,6 +233,17 @@ static int dwc3_ti_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	/* Workaround Errata i2409 */
+	phy = devm_platform_ioremap_resource(pdev, 1);
+	if (IS_ERR(phy)) {
+		dev_err(dev, "can't map PHY IOMEM resource. Won't apply i2409 fix.\n");
+		phy = NULL;
+	} else {
+		reg = readl(phy + USB_PHY_PLL_REG12);
+		reg |= USB_PHY_PLL_LDO_REF_EN | USB_PHY_PLL_LDO_REF_EN_EN;
+		writel(reg, phy + USB_PHY_PLL_REG12);
+	}
+
 	/* VBUS divider select */
 	am62->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider");
 	reg = dwc3_ti_readl(am62, USBSS_PHY_CONFIG);

-- 
2.34.1


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

* Re: [PATCH v3 4/5] dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space
  2024-02-14  9:46 ` [PATCH v3 4/5] dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space Roger Quadros
@ 2024-02-14 14:09   ` Rob Herring
  0 siblings, 0 replies; 15+ messages in thread
From: Rob Herring @ 2024-02-14 14:09 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Conor Dooley, nm, devicetree, Rob Herring, Krzysztof Kozlowski,
	francesco, linux-usb, b-liu, afd, srk, Thinh Nguyen,
	Greg Kroah-Hartman, linux-kernel, r-gunasekaran


On Wed, 14 Feb 2024 11:46:48 +0200, Roger Quadros wrote:
> Add PHY2 register space to DT binding documentation.
> 
> We use minItems: 1 as DT update will come later and we don't
> want warnings for existing DTs.
> 
> So far this register space was not required but due to the
> newly identified Errata i2409 [1] we need to poke this
> register space.
> 
> [1] https://www.ti.com/lit/er/sprz487d/sprz487d.pdf
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Changelog:
> 
> v3: no change
> 
> v2: add minItems and update commit log
> 	https://lore.kernel.org/all/20240205141221.56076-5-rogerq@kernel.org/
> 
> v1: was sent as part of different series
> https://lore.kernel.org/all/20240201120332.4811-5-rogerq@kernel.org/
> ---
>  Documentation/devicetree/bindings/usb/ti,am62-usb.yaml | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>


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

* Re: [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes
  2024-02-14  9:46 [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
                   ` (4 preceding siblings ...)
  2024-02-14  9:46 ` [PATCH v3 5/5] usb: dwc3-am62: add workaround for Errata i2409 Roger Quadros
@ 2024-02-23 13:17 ` Roger Quadros
  2024-02-23 22:25   ` Thinh Nguyen
  5 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2024-02-23 13:17 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: nm, r-gunasekaran, afd, b-liu, srk, francesco, linux-usb,
	linux-kernel, devicetree

Hi Thinh,

On 14/02/2024 11:46, Roger Quadros wrote:
> Hi,
> 
> This series fixes errors during module removal. It also
> implements PHY core voltage selection as per TI recommendation
> and workaround for Errata i2409 [1].
> 
> The workaround needs PHY2 region to be present in device node.
> The device tree patch will be sent later after the DT binding doc
> is merged.
> 
> [1] - https://www.ti.com/lit/er/sprz487d/sprz487d.pdf
> 
> Changelog in each file
> 
> v2: https://lore.kernel.org/all/20240205141221.56076-1-rogerq@kernel.org/
> v1: https://lore.kernel.org/all/20240201121220.5523-1-rogerq@kernel.org/
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Roger Quadros (5):
>       usb: dwc3-am62: call of_platform_depopulate in .remove()
>       usb: dwc3-am62: fix error on module removal
>       usb: dwc3-am62: Fix PHY core voltage selection
>       dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space
>       usb: dwc3-am62: add workaround for Errata i2409

Any feedback on this series? Thanks!

> 
>  .../devicetree/bindings/usb/ti,am62-usb.yaml       |  8 +++-
>  drivers/usb/dwc3/dwc3-am62.c                       | 45 ++++++++++++++++------
>  2 files changed, 39 insertions(+), 14 deletions(-)
> ---
> base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
> change-id: 20240206-for-v6-9-am62-usb-errata-3-0-233024ea8e9d
> 
> Best regards,

-- 
cheers,
-roger

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

* Re: [PATCH v3 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove()
  2024-02-14  9:46 ` [PATCH v3 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove() Roger Quadros
@ 2024-02-23 22:14   ` Thinh Nguyen
  0 siblings, 0 replies; 15+ messages in thread
From: Thinh Nguyen @ 2024-02-23 22:14 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, nm, r-gunasekaran, afd, b-liu,
	srk, francesco, linux-usb, linux-kernel, devicetree

On Wed, Feb 14, 2024, Roger Quadros wrote:
> We called of_platform_populate() in .probe() so call the
> cleanup function of_platform_depopulate() in .remove().
> 
> Get rid of the now unnnecessary dwc3_ti_remove_core().
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Changelog:
> 
> v3: no change
> v2: no change
> 	https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-2-rogerq@kernel.org/__;!!A4F2R9G_pg!f-317oDBUen4tQjM4Kk_1bBkD4OrvVVyd7XvIKjotuQlxsQVXxZoq-Q6SZIV_X7W2nFqfsAuwTrMhPV3Hreq$ 
> v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-2-rogerq@kernel.org/__;!!A4F2R9G_pg!f-317oDBUen4tQjM4Kk_1bBkD4OrvVVyd7XvIKjotuQlxsQVXxZoq-Q6SZIV_X7W2nFqfsAuwTrMhLhI0BZr$ 
> ---
>  drivers/usb/dwc3/dwc3-am62.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 90a587bc29b7..1bfc9e67614f 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -267,21 +267,13 @@ static int dwc3_ti_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int dwc3_ti_remove_core(struct device *dev, void *c)
> -{
> -	struct platform_device *pdev = to_platform_device(dev);
> -
> -	platform_device_unregister(pdev);
> -	return 0;
> -}
> -
>  static void dwc3_ti_remove(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct dwc3_am62 *am62 = platform_get_drvdata(pdev);
>  	u32 reg;
>  
> -	device_for_each_child(dev, NULL, dwc3_ti_remove_core);
> +	of_platform_depopulate(dev);
>  
>  	/* Clear mode valid bit */
>  	reg = dwc3_ti_readl(am62, USBSS_MODE_CONTROL);
> 
> -- 
> 2.34.1
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

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

* Re: [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal
  2024-02-14  9:46 ` [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal Roger Quadros
@ 2024-02-23 22:17   ` Thinh Nguyen
  2024-02-23 22:31   ` Thinh Nguyen
  1 sibling, 0 replies; 15+ messages in thread
From: Thinh Nguyen @ 2024-02-23 22:17 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, nm, r-gunasekaran, afd, b-liu,
	srk, francesco, linux-usb, linux-kernel, devicetree

On Wed, Feb 14, 2024, Roger Quadros wrote:
> As runtime PM is enabled, the module can be runtime
> suspended when .remove() is called.
> 
> Do a pm_runtime_get_sync() to make sure module is active
> before doing any register operations.
> 
> Doing a pm_runtime_put_sync() should disable the refclk
> so no need to disable it again.
> 
> Fixes the below warning at module removel.
> 
> [   39.705310] ------------[ cut here ]------------
> [   39.710004] clk:162:3 already disabled
> [   39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clk_core_disable+0xb0/0xb8
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Changelog:
> 
> v3: no change
> 
> v2: no change
> 	https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q5BPD-jX$ 
> 
> v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q1CciylE$ 
> ---
>  drivers/usb/dwc3/dwc3-am62.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 1bfc9e67614f..600ba9cfefea 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -273,6 +273,11 @@ static void dwc3_ti_remove(struct platform_device *pdev)
>  	struct dwc3_am62 *am62 = platform_get_drvdata(pdev);
>  	u32 reg;
>  
> +	pm_runtime_get_sync(dev);
> +
> +	device_wakeup_disable(dev);
> +	device_set_wakeup_capable(dev, false);
> +

We have a more convenient function to enable/disable this
(device_init_wakeup()) if you ever want to cleanup the driver later.

>  	of_platform_depopulate(dev);
>  
>  	/* Clear mode valid bit */
> @@ -281,7 +286,6 @@ static void dwc3_ti_remove(struct platform_device *pdev)
>  	dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg);
>  
>  	pm_runtime_put_sync(dev);
> -	clk_disable_unprepare(am62->usb2_refclk);
>  	pm_runtime_disable(dev);
>  	pm_runtime_set_suspended(dev);
>  }
> 
> -- 
> 2.34.1
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

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

* Re: [PATCH v3 3/5] usb: dwc3-am62: Fix PHY core voltage selection
  2024-02-14  9:46 ` [PATCH v3 3/5] usb: dwc3-am62: Fix PHY core voltage selection Roger Quadros
@ 2024-02-23 22:19   ` Thinh Nguyen
  0 siblings, 0 replies; 15+ messages in thread
From: Thinh Nguyen @ 2024-02-23 22:19 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, nm, r-gunasekaran, afd, b-liu,
	srk, francesco, linux-usb, linux-kernel, devicetree

On Wed, Feb 14, 2024, Roger Quadros wrote:
> TRM information is outdated and design team has confirmed
> that PHY_CORE_VOLTAGE should be 0 irrespective of
> VDD_CORE voltage.
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Changelog:
> 
> v3: no change
> 
> v2: no change
> 	https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-4-rogerq@kernel.org/__;!!A4F2R9G_pg!YRbEcs6kcWbVmZ0bBu9SvOEAnSFUPv-Zzpt-zLtFZFLdhquAp5tppvikEqMuGTcFuQAXksPiBmc-zuZqrvmN$ 
> 
> v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-4-rogerq@kernel.org/__;!!A4F2R9G_pg!YRbEcs6kcWbVmZ0bBu9SvOEAnSFUPv-Zzpt-zLtFZFLdhquAp5tppvikEqMuGTcFuQAXksPiBmc-zlgvqaS8$ 
> ---
>  drivers/usb/dwc3/dwc3-am62.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 600ba9cfefea..af1ce934e7fb 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -97,7 +97,8 @@
>  #define USBSS_VBUS_STAT_SESSVALID	BIT(2)
>  #define USBSS_VBUS_STAT_VBUSVALID	BIT(0)
>  
> -/* Mask for PHY PLL REFCLK */
> +/* USB_PHY_CTRL register bits in CTRL_MMR */
> +#define PHY_CORE_VOLTAGE_MASK	BIT(31)
>  #define PHY_PLL_REFCLK_MASK	GENMASK(3, 0)
>  
>  #define DWC3_AM62_AUTOSUSPEND_DELAY	100
> @@ -162,6 +163,13 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62)
>  
>  	am62->offset = args.args[0];
>  
> +	/* Core voltage. PHY_CORE_VOLTAGE bit Recommended to be 0 always */
> +	ret = regmap_update_bits(am62->syscon, am62->offset, PHY_CORE_VOLTAGE_MASK, 0);
> +	if (ret) {
> +		dev_err(dev, "failed to set phy core voltage\n");
> +		return ret;
> +	}
> +
>  	ret = regmap_update_bits(am62->syscon, am62->offset, PHY_PLL_REFCLK_MASK, am62->rate_code);
>  	if (ret) {
>  		dev_err(dev, "failed to set phy pll reference clock rate\n");
> 
> -- 
> 2.34.1
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thinh

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

* Re: [PATCH v3 5/5] usb: dwc3-am62: add workaround for Errata i2409
  2024-02-14  9:46 ` [PATCH v3 5/5] usb: dwc3-am62: add workaround for Errata i2409 Roger Quadros
@ 2024-02-23 22:24   ` Thinh Nguyen
  0 siblings, 0 replies; 15+ messages in thread
From: Thinh Nguyen @ 2024-02-23 22:24 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, nm, r-gunasekaran, afd, b-liu,
	srk, francesco, linux-usb, linux-kernel, devicetree

On Wed, Feb 14, 2024, Roger Quadros wrote:
> All AM62 devices have Errata i2409 [1] due to which
> USB2 PHY may lock up due to short suspend.
> 
> Workaround involves setting bit 5 and 4 PLL_REG12
> in PHY2 register space after USB controller is brought
> out of LPSC reset but before controller initialization.
> 
> Handle this workaround.
> 
> [1] - https://urldefense.com/v3/__https://www.ti.com/lit/er/sprz487d/sprz487d.pdf__;!!A4F2R9G_pg!djrhB3gW9q9ZBzv7_15MDrMqxOeQuOMbrceRs6NsnAzMMrENAGLMrt-zvq5avRei9uC6r3x9kItwobKxn2Vw$ 
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Changelog:
> 
> v3:
> - move requesting of PHY2 region to right where we need it
> 
> v2:
> - don't add phy read/write helpers or add phy to private data
> 	https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-5-rogerq@kernel.org/__;!!A4F2R9G_pg!djrhB3gW9q9ZBzv7_15MDrMqxOeQuOMbrceRs6NsnAzMMrENAGLMrt-zvq5avRei9uC6r3x9kItwobI0OZD1$ 
> 
> v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-5-rogerq@kernel.org/__;!!A4F2R9G_pg!djrhB3gW9q9ZBzv7_15MDrMqxOeQuOMbrceRs6NsnAzMMrENAGLMrt-zvq5avRei9uC6r3x9kItwofeJSsi1$ 
> ---
>  drivers/usb/dwc3/dwc3-am62.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index af1ce934e7fb..163278050595 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -101,6 +101,11 @@
>  #define PHY_CORE_VOLTAGE_MASK	BIT(31)
>  #define PHY_PLL_REFCLK_MASK	GENMASK(3, 0)
>  
> +/* USB PHY2 register offsets */
> +#define	USB_PHY_PLL_REG12		0x130
> +#define	USB_PHY_PLL_LDO_REF_EN		BIT(5)
> +#define	USB_PHY_PLL_LDO_REF_EN_EN	BIT(4)
> +
>  #define DWC3_AM62_AUTOSUSPEND_DELAY	100
>  
>  struct dwc3_am62 {
> @@ -184,8 +189,9 @@ static int dwc3_ti_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct device_node *node = pdev->dev.of_node;
>  	struct dwc3_am62 *am62;
> -	int i, ret;
>  	unsigned long rate;
> +	void __iomem *phy;
> +	int i, ret;
>  	u32 reg;
>  
>  	am62 = devm_kzalloc(dev, sizeof(*am62), GFP_KERNEL);
> @@ -227,6 +233,17 @@ static int dwc3_ti_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> +	/* Workaround Errata i2409 */
> +	phy = devm_platform_ioremap_resource(pdev, 1);
> +	if (IS_ERR(phy)) {
> +		dev_err(dev, "can't map PHY IOMEM resource. Won't apply i2409 fix.\n");
> +		phy = NULL;
> +	} else {
> +		reg = readl(phy + USB_PHY_PLL_REG12);
> +		reg |= USB_PHY_PLL_LDO_REF_EN | USB_PHY_PLL_LDO_REF_EN_EN;
> +		writel(reg, phy + USB_PHY_PLL_REG12);
> +	}
> +
>  	/* VBUS divider select */
>  	am62->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider");
>  	reg = dwc3_ti_readl(am62, USBSS_PHY_CONFIG);
> 
> -- 
> 2.34.1
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

BR,
Thinh

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

* Re: [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes
  2024-02-23 13:17 ` [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
@ 2024-02-23 22:25   ` Thinh Nguyen
  0 siblings, 0 replies; 15+ messages in thread
From: Thinh Nguyen @ 2024-02-23 22:25 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, nm, r-gunasekaran, afd, b-liu,
	srk, francesco, linux-usb, linux-kernel, devicetree

On Fri, Feb 23, 2024, Roger Quadros wrote:
> Hi Thinh,
> 
> On 14/02/2024 11:46, Roger Quadros wrote:
> > Hi,
> > 
> > This series fixes errors during module removal. It also
> > implements PHY core voltage selection as per TI recommendation
> > and workaround for Errata i2409 [1].
> > 
> > The workaround needs PHY2 region to be present in device node.
> > The device tree patch will be sent later after the DT binding doc
> > is merged.
> > 
> > [1] - https://urldefense.com/v3/__https://www.ti.com/lit/er/sprz487d/sprz487d.pdf__;!!A4F2R9G_pg!ZBXH4OebB2sFGs4Y04X6e3Uyr3AKcppsXCLY9XG2ET3RFRgS_i-xq7Jwps-uF-74gPOolfZo9gtZ4TjDCTp5$ 
> > 
> > Changelog in each file
> > 
> > v2: https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-1-rogerq@kernel.org/__;!!A4F2R9G_pg!ZBXH4OebB2sFGs4Y04X6e3Uyr3AKcppsXCLY9XG2ET3RFRgS_i-xq7Jwps-uF-74gPOolfZo9gtZ4d-cSehP$ 
> > v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-1-rogerq@kernel.org/__;!!A4F2R9G_pg!ZBXH4OebB2sFGs4Y04X6e3Uyr3AKcppsXCLY9XG2ET3RFRgS_i-xq7Jwps-uF-74gPOolfZo9gtZ4YnYBTMg$ 
> > 
> > Signed-off-by: Roger Quadros <rogerq@kernel.org>
> > ---
> > Roger Quadros (5):
> >       usb: dwc3-am62: call of_platform_depopulate in .remove()
> >       usb: dwc3-am62: fix error on module removal
> >       usb: dwc3-am62: Fix PHY core voltage selection
> >       dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space
> >       usb: dwc3-am62: add workaround for Errata i2409
> 
> Any feedback on this series? Thanks!
> 

They look good to me.

BR,
Thinh

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

* Re: [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal
  2024-02-14  9:46 ` [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal Roger Quadros
  2024-02-23 22:17   ` Thinh Nguyen
@ 2024-02-23 22:31   ` Thinh Nguyen
  2024-02-26 13:19     ` Roger Quadros
  1 sibling, 1 reply; 15+ messages in thread
From: Thinh Nguyen @ 2024-02-23 22:31 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Thinh Nguyen, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, nm, r-gunasekaran, afd, b-liu,
	srk, francesco, linux-usb, linux-kernel, devicetree

On Wed, Feb 14, 2024, Roger Quadros wrote:
> As runtime PM is enabled, the module can be runtime
> suspended when .remove() is called.
> 
> Do a pm_runtime_get_sync() to make sure module is active
> before doing any register operations.
> 
> Doing a pm_runtime_put_sync() should disable the refclk
> so no need to disable it again.
> 
> Fixes the below warning at module removel.
> 
> [   39.705310] ------------[ cut here ]------------
> [   39.710004] clk:162:3 already disabled
> [   39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clk_core_disable+0xb0/0xb8
> 

Actually, it will be better to have a fixes tag and separate this from
this series series. You can retain my Acked-by if you resend it with the
Fixes tag and Cc stable.

BR,
Thinh

> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> Changelog:
> 
> v3: no change
> 
> v2: no change
> 	https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q5BPD-jX$ 
> 
> v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q1CciylE$ 
> ---
>  drivers/usb/dwc3/dwc3-am62.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 1bfc9e67614f..600ba9cfefea 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -273,6 +273,11 @@ static void dwc3_ti_remove(struct platform_device *pdev)
>  	struct dwc3_am62 *am62 = platform_get_drvdata(pdev);
>  	u32 reg;
>  
> +	pm_runtime_get_sync(dev);
> +
> +	device_wakeup_disable(dev);
> +	device_set_wakeup_capable(dev, false);
> +
>  	of_platform_depopulate(dev);
>  
>  	/* Clear mode valid bit */
> @@ -281,7 +286,6 @@ static void dwc3_ti_remove(struct platform_device *pdev)
>  	dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg);
>  
>  	pm_runtime_put_sync(dev);
> -	clk_disable_unprepare(am62->usb2_refclk);
>  	pm_runtime_disable(dev);
>  	pm_runtime_set_suspended(dev);
>  }
> 
> -- 
> 2.34.1
> 

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

* Re: [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal
  2024-02-23 22:31   ` Thinh Nguyen
@ 2024-02-26 13:19     ` Roger Quadros
  0 siblings, 0 replies; 15+ messages in thread
From: Roger Quadros @ 2024-02-26 13:19 UTC (permalink / raw)
  To: Thinh Nguyen
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, nm, r-gunasekaran, afd, b-liu, srk, francesco,
	linux-usb, linux-kernel, devicetree



On 24/02/2024 00:31, Thinh Nguyen wrote:
> On Wed, Feb 14, 2024, Roger Quadros wrote:
>> As runtime PM is enabled, the module can be runtime
>> suspended when .remove() is called.
>>
>> Do a pm_runtime_get_sync() to make sure module is active
>> before doing any register operations.
>>
>> Doing a pm_runtime_put_sync() should disable the refclk
>> so no need to disable it again.
>>
>> Fixes the below warning at module removel.
>>
>> [   39.705310] ------------[ cut here ]------------
>> [   39.710004] clk:162:3 already disabled
>> [   39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clk_core_disable+0xb0/0xb8
>>
> 
> Actually, it will be better to have a fixes tag and separate this from
> this series series. You can retain my Acked-by if you resend it with the
> Fixes tag and Cc stable.

OK I will resend. please see below.
> 
> BR,
> Thinh
> 
>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>> ---
>> Changelog:
>>
>> v3: no change
>>
>> v2: no change
>> 	https://urldefense.com/v3/__https://lore.kernel.org/all/20240205141221.56076-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q5BPD-jX$ 
>>
>> v1: https://urldefense.com/v3/__https://lore.kernel.org/all/20240201121220.5523-3-rogerq@kernel.org/__;!!A4F2R9G_pg!b7_3vmJpNLOFy3g_wExMQSAzi949O4PoID3e4rNEvAsbgCvxxkj0DiSDFJxF7857DZM7qy9DMkH6Q1CciylE$ 
>> ---
>>  drivers/usb/dwc3/dwc3-am62.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
>> index 1bfc9e67614f..600ba9cfefea 100644
>> --- a/drivers/usb/dwc3/dwc3-am62.c
>> +++ b/drivers/usb/dwc3/dwc3-am62.c
>> @@ -273,6 +273,11 @@ static void dwc3_ti_remove(struct platform_device *pdev)
>>  	struct dwc3_am62 *am62 = platform_get_drvdata(pdev);
>>  	u32 reg;
>>  
>> +	pm_runtime_get_sync(dev);
>> +
>> +	device_wakeup_disable(dev);
>> +	device_set_wakeup_capable(dev, false);
>> +

I'll split the wakeup disable changes to a separate patch, so there are less dependencies.

>>  	of_platform_depopulate(dev);
>>  
>>  	/* Clear mode valid bit */
>> @@ -281,7 +286,6 @@ static void dwc3_ti_remove(struct platform_device *pdev)
>>  	dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg);
>>  
>>  	pm_runtime_put_sync(dev);
>> -	clk_disable_unprepare(am62->usb2_refclk);
>>  	pm_runtime_disable(dev);
>>  	pm_runtime_set_suspended(dev);
>>  }
>>
>> -- 
>> 2.34.1
>>

-- 
cheers,
-roger

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

end of thread, other threads:[~2024-02-26 13:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14  9:46 [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
2024-02-14  9:46 ` [PATCH v3 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove() Roger Quadros
2024-02-23 22:14   ` Thinh Nguyen
2024-02-14  9:46 ` [PATCH v3 2/5] usb: dwc3-am62: fix error on module removal Roger Quadros
2024-02-23 22:17   ` Thinh Nguyen
2024-02-23 22:31   ` Thinh Nguyen
2024-02-26 13:19     ` Roger Quadros
2024-02-14  9:46 ` [PATCH v3 3/5] usb: dwc3-am62: Fix PHY core voltage selection Roger Quadros
2024-02-23 22:19   ` Thinh Nguyen
2024-02-14  9:46 ` [PATCH v3 4/5] dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space Roger Quadros
2024-02-14 14:09   ` Rob Herring
2024-02-14  9:46 ` [PATCH v3 5/5] usb: dwc3-am62: add workaround for Errata i2409 Roger Quadros
2024-02-23 22:24   ` Thinh Nguyen
2024-02-23 13:17 ` [PATCH v3 0/5] usb: dwc3-am62: module removal and errata fixes Roger Quadros
2024-02-23 22:25   ` Thinh Nguyen

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