Re: [PATCH] mfd: qcom_rpm: fix offset error for msm8660

From
Linus Walleij <hidden>
Date
2016-06-14 19:38:06
Also in
lkml
Reply to
Stephen Boyd, 2016-06-14
On Tue, Jun 14, 2016 at 8:51 PM, Stephen Boyd [off-list ref] wrote:
On 06/14, Linus Walleij wrote:
quoted
-#define RPM_REQUEST_CONTEXT  3
-#define RPM_REQ_SELECT               11
-#define RPM_ACK_CONTEXT              15
-#define RPM_ACK_SELECTOR     23
 #define RPM_SELECT_SIZE              7
The RPM_SELECT_SIZE is 7 on 8660, but now you've pointed out that
otherwise the size is 4. I think you've uncovered another bug.
OMG you're right. I'll send a v2 fixing that too.
quoted
-                            RPM_CTRL_REG(rpm, RPM_REQ_SELECT + i));
+                            RPM_CTRL_REG(rpm, rpm->data->req_sel_off + i));
Here we write from 0 to ARRAY_SIZE(sel_mask) which is 7. That
would mean we write into the ack context that starts at 15 (we
start writing at req_sel_off which is always 11). Oops.
Argh well it seems it didn't hurt so far but let's have it fixed.

Yours,
Linus Walleij
Thread (4 messages) 4 messages, 3 authors, last reply 2016-06-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help