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

From: Linus Walleij
Date: Tue Jun 14 2016 - 15:38:09 EST


On Tue, Jun 14, 2016 at 8:51 PM, Stephen Boyd <sboyd@xxxxxxxxxxxxxx> wrote:
> On 06/14, Linus Walleij wrote:

>> -#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.

>> - 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