devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>,
	Jon Hunter <jonathanh@nvidia.com>
Subject: [PATCH V2 2/5] usb: xhci: tegra: Power-off power-domains on removal
Date: Fri, 28 Sep 2018 15:11:47 +0100	[thread overview]
Message-ID: <1538143910-24400-3-git-send-email-jonathanh@nvidia.com> (raw)
In-Reply-To: <1538143910-24400-1-git-send-email-jonathanh@nvidia.com>

Currently the XUSB power domains used by the Tegra xHCI controller are
never powered off on the removal of the driver, however, they will be
powered off on probe failure. Update the removal code to be consistent
with the probe failure path to power off the XUSB power domains.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/usb/host/xhci-tegra.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 4b463e5202a4..a586a7930a3d 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1249,6 +1249,11 @@ static int tegra_xusb_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
+	if (!pdev->dev.pm_domain) {
+		tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC);
+		tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA);
+	}
+
 	tegra_xusb_padctl_put(tegra->padctl);
 
 	return 0;
-- 
2.7.4

  parent reply	other threads:[~2018-09-28 14:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28 14:11 [PATCH V2 0/5] Tegra xHCI genpd support Jon Hunter
2018-09-28 14:11 ` [PATCH V2 1/5] dt-bindings: usb: xhci-tegra: Add power-domain details Jon Hunter
2018-10-11 16:49   ` Thierry Reding
2018-10-12  7:36     ` Jon Hunter
2018-10-12 19:38   ` Rob Herring
2018-09-28 14:11 ` Jon Hunter [this message]
2018-10-11 16:48   ` [PATCH V2 2/5] usb: xhci: tegra: Power-off power-domains on removal Thierry Reding
2018-09-28 14:11 ` [PATCH V2 3/5] usb: xhci: tegra: Add genpd support Jon Hunter
2018-10-03  9:52   ` Ulf Hansson
2018-10-03 13:44     ` Jon Hunter
2018-10-11 16:47   ` Thierry Reding
2018-10-12  8:41     ` Jon Hunter
2018-10-12 10:27       ` Thierry Reding
2018-10-15 13:29   ` Ulf Hansson
2018-09-28 14:11 ` [PATCH V2 4/5] soc/tegra: pmc: Don't power-up XUSB power-domains Jon Hunter
2018-10-11 16:50   ` Thierry Reding
2018-09-28 14:11 ` [PATCH V2 5/5] arm64: dts: tegra210: Add power-domains for xHCI Jon Hunter
2018-10-11 16:51   ` Thierry Reding
2018-10-15 12:40 ` [PATCH V2 0/5] Tegra xHCI genpd support Jon Hunter
2018-10-16 11:00   ` Mathias Nyman

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=1538143910-24400-3-git-send-email-jonathanh@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathias.nyman@intel.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.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 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).