Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375727 > unrolled thread

[PATCH v6 08/10] usb: dwc3: core: fix PHY handling during suspend

Started byRoger Quadros <rogerq@ti.com>
First post2016-04-11 13:40 +0200
Last post2016-04-11 15:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v6 08/10] usb: dwc3: core: fix PHY handling during suspend Roger Quadros <rogerq@ti.com> - 2016-04-11 13:40 +0200
    Re: [PATCH v6 08/10] usb: dwc3: core: fix PHY handling during suspend Felipe Balbi <balbi@kernel.org> - 2016-04-11 14:30 +0200
      Re: [PATCH v6 08/10] usb: dwc3: core: fix PHY handling during suspend Roger Quadros <rogerq@ti.com> - 2016-04-11 15:20 +0200

#1375727 — [PATCH v6 08/10] usb: dwc3: core: fix PHY handling during suspend

FromRoger Quadros <rogerq@ti.com>
Date2016-04-11 13:40 +0200
Subject[PATCH v6 08/10] usb: dwc3: core: fix PHY handling during suspend
Message-ID<rmIme-57L-7@gated-at.bofh.it>
From: Felipe Balbi <balbi@kernel.org>

we need to power off the PHY during suspend and
power it back on during resume.

Signed-off-by: Felipe Balbi <balbi@kernel.org>
[nsekhar@ti.com: fix call to usb_phy_set_suspend() in dwc3_suspend()]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/dwc3/core.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index f24c091..60665dd 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1649,6 +1649,11 @@ static int dwc3_suspend(struct device *dev)
 	phy_exit(dwc->usb2_generic_phy);
 	phy_exit(dwc->usb3_generic_phy);
 
+	usb_phy_set_suspend(dwc->usb2_phy, 1);
+	usb_phy_set_suspend(dwc->usb3_phy, 1);
+	WARN_ON(phy_power_off(dwc->usb2_generic_phy) < 0);
+	WARN_ON(phy_power_off(dwc->usb3_generic_phy) < 0);
+
 	pinctrl_pm_select_sleep_state(dev);
 
 	return 0;
@@ -1662,11 +1667,21 @@ static int dwc3_resume(struct device *dev)
 
 	pinctrl_pm_select_default_state(dev);
 
+	usb_phy_set_suspend(dwc->usb2_phy, 0);
+	usb_phy_set_suspend(dwc->usb3_phy, 0);
+	ret = phy_power_on(dwc->usb2_generic_phy);
+	if (ret < 0)
+		return ret;
+
+	ret = phy_power_on(dwc->usb3_generic_phy);
+	if (ret < 0)
+		goto err_usb2phy_power;
+
 	usb_phy_init(dwc->usb3_phy);
 	usb_phy_init(dwc->usb2_phy);
 	ret = phy_init(dwc->usb2_generic_phy);
 	if (ret < 0)
-		return ret;
+		goto err_usb3phy_power;
 
 	ret = phy_init(dwc->usb3_generic_phy);
 	if (ret < 0)
@@ -1718,6 +1733,12 @@ static int dwc3_resume(struct device *dev)
 err_usb2phy_init:
 	phy_exit(dwc->usb2_generic_phy);
 
+err_usb3phy_power:
+	phy_power_off(dwc->usb3_generic_phy);
+
+err_usb2phy_power:
+	phy_power_off(dwc->usb2_generic_phy);
+
 	return ret;
 }
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1375773

FromFelipe Balbi <balbi@kernel.org>
Date2016-04-11 14:30 +0200
Message-ID<rmJ8C-5Ts-15@gated-at.bofh.it>
In reply to#1375727

[Multipart message — attachments visible in raw view] — view raw

Hi,

Roger Quadros <rogerq@ti.com> writes:
> From: Felipe Balbi <balbi@kernel.org>
>
> we need to power off the PHY during suspend and
> power it back on during resume.
>
> Signed-off-by: Felipe Balbi <balbi@kernel.org>
> [nsekhar@ti.com: fix call to usb_phy_set_suspend() in dwc3_suspend()]
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
> Signed-off-by: Roger Quadros <rogerq@ti.com>

is this also a fix which needs to be rebased on v4.6-rc3 and merged
during current -rc cycle ?

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1375828

FromRoger Quadros <rogerq@ti.com>
Date2016-04-11 15:20 +0200
Message-ID<rmJUZ-6uN-3@gated-at.bofh.it>
In reply to#1375773
On 11/04/16 15:24, Felipe Balbi wrote:
> 
> Hi,
> 
> Roger Quadros <rogerq@ti.com> writes:
>> From: Felipe Balbi <balbi@kernel.org>
>>
>> we need to power off the PHY during suspend and
>> power it back on during resume.
>>
>> Signed-off-by: Felipe Balbi <balbi@kernel.org>
>> [nsekhar@ti.com: fix call to usb_phy_set_suspend() in dwc3_suspend()]
>> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> is this also a fix which needs to be rebased on v4.6-rc3 and merged
> during current -rc cycle ?
> 
Yes, I'll post it separately.

cheers,
-roger

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web