Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331058
| From | Marek Szyprowski <m.szyprowski@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v5 RESEND 5/5] ARM: amba: Properly handle devices with power domains |
| Date | 2016-02-10 11:50 +0100 |
| Message-ID | <r0Avo-12b-17@gated-at.bofh.it> (permalink) |
| References | <r0Avn-12b-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v5 RESEND 0/5] AMBA: add complete support for power domains Marek Szyprowski <m.szyprowski@samsung.com> - 2016-02-10 11:50 +0100
[PATCH v5 RESEND 1/5] drivers: nvdimm: ensure no negative value gets returned on positive match Marek Szyprowski <m.szyprowski@samsung.com> - 2016-02-10 11:50 +0100
[PATCH v5 RESEND 3/5] driver core: handle -EPROBE_DEFER from bus_type.match() Marek Szyprowski <m.szyprowski@samsung.com> - 2016-02-10 11:50 +0100
Re: [PATCH v5 RESEND 3/5] driver core: handle -EPROBE_DEFER from bus_type.match() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-12 04:20 +0100
[PATCH v5 RESEND 5/5] ARM: amba: Properly handle devices with power domains Marek Szyprowski <m.szyprowski@samsung.com> - 2016-02-10 11:50 +0100
[PATCH v5 RESEND 2/5] ARM: sa1111: ensure no negative value gets returned on positive match Marek Szyprowski <m.szyprowski@samsung.com> - 2016-02-10 11:50 +0100
Re: [PATCH v5 RESEND 2/5] ARM: sa1111: ensure no negative value gets returned on positive match Ulf Hansson <ulf.hansson@linaro.org> - 2016-02-10 17:50 +0100
csiph-web