All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
To: John Youn <johnyoun@synopsys.com>, Heiko Stuebner <heiko@sntech.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] usb: dwc2: Power off the phy on shutdown
Date: Wed,  5 Apr 2017 16:06:12 +0200	[thread overview]
Message-ID: <20170405140613.4444-4-sjoerd.simons@collabora.co.uk> (raw)
In-Reply-To: <20170405140613.4444-1-sjoerd.simons@collabora.co.uk>

On a board with a usb->sata bridge behind a usb hub, the bridge only
appears on cold boot and becomes non-functional after a reboot. Testing
thusfar shows that it gets confused during reboot if the usb hub is left
on (Interestingly a similar setup without the usb hub in between doesn't
have the issue).  This can be avoided by turning off the phy (thus vbus)
during shutdown, which turns off the usb hub.

For devices where this isn't required, powering down the phy is harmless
so we can do this unconditionally.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

---

 drivers/usb/dwc2/platform.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 9564bc76c56f..b5bbc433c94d 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -348,6 +348,9 @@ static void dwc2_driver_shutdown(struct platform_device *dev)
 {
 	struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
 
+	if (hsotg->phy)
+		phy_power_off(hsotg->phy);
+
 	disable_irq(hsotg->irq);
 }
 
-- 
2.11.0

      parent reply	other threads:[~2017-04-05 14:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 14:06 [PATCH 0/3] rockchip dwc2: Turn off vbus on shutdown Sjoerd Simons
2017-04-05 14:06 ` Sjoerd Simons
2017-04-05 14:06 ` Sjoerd Simons
2017-04-05 14:06 ` [PATCH 1/3] phy: rockchip-usb: Add vbus regulator support Sjoerd Simons
2017-04-05 14:06   ` Sjoerd Simons
2017-04-05 14:06   ` Sjoerd Simons
2017-04-06 10:37   ` Kishon Vijay Abraham I
2017-04-06 10:37     ` Kishon Vijay Abraham I
2017-04-06 10:37     ` Kishon Vijay Abraham I
2017-04-05 14:06 ` [PATCH 2/3] ARM: dts: rockchip: rock2: Setup usb vbus-supply Sjoerd Simons
2017-04-05 14:06   ` Sjoerd Simons
2017-04-05 14:06   ` Sjoerd Simons
2017-04-06 22:23   ` Heiko Stuebner
2017-04-06 22:23     ` Heiko Stuebner
2017-04-06 22:23     ` Heiko Stuebner
2017-04-05 14:06 ` Sjoerd Simons [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170405140613.4444-4-sjoerd.simons@collabora.co.uk \
    --to=sjoerd.simons@collabora.co.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=johnyoun@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.