[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFoOcF1T_b+mxrEoWcmi_9uixtjjz2YdZhKFX=1z9im+ZA@mail.gmail.com>
Date: Tue, 1 Dec 2015 16:29:18 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: linux-samsung-soc <linux-samsung-soc@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Russell King - ARM Linux <linux@....linux.org.uk>,
Tomeu Vizoso <tomeu.vizoso@...labora.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <k.kozlowski@...sung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [PATCH v3 3/3] ARM: amba: Properly handle devices with power domains
On 1 December 2015 at 14:34, Marek Szyprowski <m.szyprowski@...sung.com> wrote:
> 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@...sung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@...aro.org>
Kind regards
Uffe
> ---
> 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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists