Thread (3 messages) flat view 3 messages, 3 authors, 2012-11-11

[PATCH v2] pinctrl/nomadik: make independent of prcmu driver

From: Linus Walleij <hidden>
Date: 2012-11-11 18:40:46
Also in: lkml

On Fri, Nov 9, 2012 at 6:16 PM, Stephen Warren [off-list ref] wrote:
[Me]
quoted
+     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+     if (res) {
+             npct->prcm_base = devm_ioremap(&pdev->dev, res->start,
+                                            resource_size(res));
+             if (!npct->prcm_base) {
+                     dev_err(&pdev->dev,
+                             "failed to ioremap PRCM registers\n");
+                     return -ENOMEM;
+             }
+     } else {
+             dev_info(&pdev->dev,
+                      "No PRCM base, assume no ALT-Cx control is available\n");
+     }
Where is "assume no ALT-Cx control is available" implemented; I don't
see anything that uses npct->prcm_base to conditionally enable/block any
features. Is it just assumed that the DT won't contain any entries that
trigger writes to the PRCM registers? That seems fragile; it could cause
a "user"-triggered kernel crash.
Yeah. That's been in for a while, so this patch in itself is not making
things more fragile, it came with the first Alt-Cx patch.
So it is indeed based on good faith in the maps.

I'm poking Jean-Nicolas to have a look at hardening
this with some check, ping!
Aside from that, this seems fine. Much smaller than V1:-)
Yeah, thanks for poking us...

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help