linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sricharan@codeaurora.org (Sricharan R)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] iommu/arm-smmu: Add the device_link between masters and smmu
Date: Fri, 21 Oct 2016 22:44:26 +0530	[thread overview]
Message-ID: <1477070066-15044-5-git-send-email-sricharan@codeaurora.org> (raw)
In-Reply-To: <1477070066-15044-1-git-send-email-sricharan@codeaurora.org>

The device link between master and its smmu is added so that
the smmu gets runtime enabled/disabled when the master needs it.
This is done from add_device callback which gets called once
when the master is added to the smmu group.

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
---
 drivers/iommu/arm-smmu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 578cdc2..71ce4b6 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1470,6 +1470,15 @@ static int arm_smmu_add_device(struct device *dev)
 		goto out_free;
 	pm_runtime_put_sync(smmu->dev);
 
+	/*
+	 * Establish the link between smmu and master, so that the
+	 * smmu gets runtime enabled/disabled as per the master's
+	 * needs.
+	 */
+
+	device_link_add(dev, smmu->dev, DEVICE_LINK_AVAILABLE,
+			DEVICE_LINK_PM_RUNTIME);
+
 	return 0;
 
 out_free:
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

  parent reply	other threads:[~2016-10-21 17:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 17:14 [PATCH 0/4] iommu/arm-smmu: Add runtime pm/sleep support Sricharan R
2016-10-21 17:14 ` [PATCH 1/4] Docs: dt: document ARM SMMU clocks/powerdomains bindings Sricharan R
2016-10-21 17:14 ` [PATCH 2/4] iommu/arm-smmu: Add pm_runtime/sleep ops Sricharan R
2016-10-24 16:40   ` Mathieu Poirier
2016-10-25  6:27     ` Sricharan
2016-10-21 17:14 ` [PATCH 3/4] iommu/arm-smmu: Add context save restore support Sricharan R
2016-10-24 16:45   ` Mathieu Poirier
2016-10-25  6:43     ` Sricharan
2016-10-26 16:51   ` Robin Murphy
2016-10-21 17:14 ` Sricharan R [this message]
2016-10-25 10:07   ` [PATCH 4/4] iommu/arm-smmu: Add the device_link between masters and smmu Marek Szyprowski
2016-10-26  4:14     ` Sricharan

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=1477070066-15044-5-git-send-email-sricharan@codeaurora.org \
    --to=sricharan@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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).