All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH v3 3/3] ARM: amba: Properly handle devices with power domains
Date: Tue, 01 Dec 2015 14:34:26 +0100	[thread overview]
Message-ID: <1448976866-7892-4-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1448976866-7892-1-git-send-email-m.szyprowski@samsung.com>

To read pid/cid registers, the probed device need to be properly turned on.
When it is inside a power domain, the bus code should ensure that the
given power domain is enabled before trying to access device's registers.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/amba/bus.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 879a421..8d182a4 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -365,6 +365,10 @@ static int amba_read_periphid(struct amba_device *dev)
 	if (!tmp)
 		return -ENOMEM;
 
+	ret = dev_pm_domain_attach(&dev->dev, true);
+	if (ret == -EPROBE_DEFER)
+		goto err_unmap;
+
 	ret = amba_get_enable_pclk(dev);
 	if (ret == 0) {
 		u32 pid, cid;
@@ -389,6 +393,8 @@ static int amba_read_periphid(struct amba_device *dev)
 			ret = -ENODEV;
 	}
 
+	dev_pm_domain_detach(&dev->dev, true);
+err_unmap:
 	iounmap(tmp);
 
 	return ret;
-- 
1.9.2


WARNING: multiple messages have this Message-ID (diff)
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/3] ARM: amba: Properly handle devices with power domains
Date: Tue, 01 Dec 2015 14:34:26 +0100	[thread overview]
Message-ID: <1448976866-7892-4-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1448976866-7892-1-git-send-email-m.szyprowski@samsung.com>

To read pid/cid registers, the probed device need to be properly turned on.
When it is inside a power domain, the bus code should ensure that the
given power domain is enabled before trying to access device's registers.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/amba/bus.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 879a421..8d182a4 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -365,6 +365,10 @@ static int amba_read_periphid(struct amba_device *dev)
 	if (!tmp)
 		return -ENOMEM;
 
+	ret = dev_pm_domain_attach(&dev->dev, true);
+	if (ret == -EPROBE_DEFER)
+		goto err_unmap;
+
 	ret = amba_get_enable_pclk(dev);
 	if (ret == 0) {
 		u32 pid, cid;
@@ -389,6 +393,8 @@ static int amba_read_periphid(struct amba_device *dev)
 			ret = -ENODEV;
 	}
 
+	dev_pm_domain_detach(&dev->dev, true);
+err_unmap:
 	iounmap(tmp);
 
 	return ret;
-- 
1.9.2

  parent reply	other threads:[~2015-12-01 13:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 13:34 [PATCH v3 0/3] Exynos4210: fix power domain for MDMA1 device Marek Szyprowski
2015-12-01 13:34 ` Marek Szyprowski
2015-12-01 13:34 ` [PATCH v3 1/3] driver core: handle -EPROBE_DEFER from bus_type.match() Marek Szyprowski
2015-12-01 13:34   ` Marek Szyprowski
2015-12-01 13:34   ` Marek Szyprowski
2015-12-01 15:23   ` Ulf Hansson
2015-12-01 15:23     ` Ulf Hansson
2015-12-01 15:23     ` Ulf Hansson
2015-12-01 13:34 ` [PATCH v3 2/3] ARM: amba: Move reading of periphid to amba_match() Marek Szyprowski
2015-12-01 13:34   ` Marek Szyprowski
2015-12-01 15:27   ` Ulf Hansson
2015-12-01 15:27     ` Ulf Hansson
2015-12-01 15:27     ` Ulf Hansson
2015-12-01 15:46   ` Russell King - ARM Linux
2015-12-01 15:46     ` Russell King - ARM Linux
2015-12-01 13:34 ` Marek Szyprowski [this message]
2015-12-01 13:34   ` [PATCH v3 3/3] ARM: amba: Properly handle devices with power domains Marek Szyprowski
2015-12-01 15:29   ` Ulf Hansson
2015-12-01 15:29     ` Ulf Hansson
2015-12-01 15:29     ` Ulf Hansson

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=1448976866-7892-4-git-send-email-m.szyprowski@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=tomeu.vizoso@collabora.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 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.