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 v4 3/3] ARM: amba: Properly handle devices with power domains Date: Wed, 02 Dec 2015 08:21:43 +0100 [thread overview] Message-ID: <1449040903-26674-4-git-send-email-m.szyprowski@samsung.com> (raw) In-Reply-To: <1449040903-26674-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> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> --- drivers/amba/bus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 643127f..570033b 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -60,6 +60,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; @@ -84,6 +88,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 v4 3/3] ARM: amba: Properly handle devices with power domains Date: Wed, 02 Dec 2015 08:21:43 +0100 [thread overview] Message-ID: <1449040903-26674-4-git-send-email-m.szyprowski@samsung.com> (raw) In-Reply-To: <1449040903-26674-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> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> --- drivers/amba/bus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 643127f..570033b 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -60,6 +60,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; @@ -84,6 +88,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
next prev parent reply other threads:[~2015-12-02 7:22 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-12-02 7:21 [PATCH v4 0/3] Exynos4210: fix power domain for MDMA1 device Marek Szyprowski 2015-12-02 7:21 ` Marek Szyprowski 2015-12-02 7:21 ` [PATCH v4 1/3] driver core: handle -EPROBE_DEFER from bus_type.match() Marek Szyprowski 2015-12-02 7:21 ` Marek Szyprowski 2015-12-02 7:21 ` [PATCH v4 2/3] ARM: amba: Move reading of periphid to amba_match() Marek Szyprowski 2015-12-02 7:21 ` Marek Szyprowski 2015-12-02 7:21 ` Marek Szyprowski [this message] 2015-12-02 7:21 ` [PATCH v4 3/3] ARM: amba: Properly handle devices with power domains Marek Szyprowski
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=1449040903-26674-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: linkBe 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.