Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755045AbdDEOGo (ORCPT ); Wed, 5 Apr 2017 10:06:44 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:52076 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753588AbdDEOGV (ORCPT ); Wed, 5 Apr 2017 10:06:21 -0400 From: Sjoerd Simons To: John Youn , Heiko Stuebner Cc: Greg Kroah-Hartman , 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 Message-Id: <20170405140613.4444-4-sjoerd.simons@collabora.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170405140613.4444-1-sjoerd.simons@collabora.co.uk> References: <20170405140613.4444-1-sjoerd.simons@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1069 Lines: 33 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 --- 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