diff mbox

[PATCHv2,1/2] gpio: mvebu: fix blink counter register selection

Message ID 20170601121826.14685-2-richard.genoud@gmail.com
State New
Headers show

Commit Message

Richard Genoud June 1, 2017, 12:18 p.m. UTC
The blink counter A was always selected because 0 was forced in the
blink select counter register.
The variable 'set' was obviously there to be used as the register value,
selecting the B counter when id==1 and A counter when id==0.

Tested on clearfog-pro (Marvell 88F6828)

Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Reviewed-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
 drivers/gpio/gpio-mvebu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Linus Walleij June 9, 2017, 7:37 a.m. UTC | #1
On Thu, Jun 1, 2017 at 2:18 PM, Richard Genoud <richard.genoud@gmail.com> wrote:

> The blink counter A was always selected because 0 was forced in the
> blink select counter register.
> The variable 'set' was obviously there to be used as the register value,
> selecting the B counter when id==1 and A counter when id==0.
>
> Tested on clearfog-pro (Marvell 88F6828)
>
> Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
> Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> Reviewed-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>

Patch applied for fixes.

It appears this will clash with patches on the development branch :(

I might screw up the merges so help me check the end result
later.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Richard Genoud June 9, 2017, 7:40 a.m. UTC | #2
2017-06-09 9:37 GMT+02:00 Linus Walleij <linus.walleij@linaro.org>:
> On Thu, Jun 1, 2017 at 2:18 PM, Richard Genoud <richard.genoud@gmail.com> wrote:
>
>> The blink counter A was always selected because 0 was forced in the
>> blink select counter register.
>> The variable 'set' was obviously there to be used as the register value,
>> selecting the B counter when id==1 and A counter when id==0.
>>
>> Tested on clearfog-pro (Marvell 88F6828)
>>
>> Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
>> Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>> Reviewed-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
>> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
>
> Patch applied for fixes.
>
> It appears this will clash with patches on the development branch :(
>
> I might screw up the merges so help me check the end result
> later.
Ok, no problem !

>
> Yours,
> Linus Walleij
Thanks !
Richard.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ralph Sennhauser June 9, 2017, 8:03 a.m. UTC | #3
On Fri, 9 Jun 2017 09:37:55 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Thu, Jun 1, 2017 at 2:18 PM, Richard Genoud
> <richard.genoud@gmail.com> wrote:
> 
> > The blink counter A was always selected because 0 was forced in the
> > blink select counter register.
> > The variable 'set' was obviously there to be used as the register
> > value, selecting the B counter when id==1 and A counter when id==0.
> >
> > Tested on clearfog-pro (Marvell 88F6828)
> >
> > Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
> > Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> > Reviewed-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
> > Signed-off-by: Richard Genoud <richard.genoud@gmail.com>  
> 
> Patch applied for fixes.
> 
> It appears this will clash with patches on the development branch :(

Hi Linus,

The commit 2233bf7a92e7 ("gpio: mvebu: switch to regmap for register
access") which you likely mean breaks gpio-keys, reported about an hour
ago, so you might just want to drop that one for now instead as it
needs mor work anyway.

Ralph
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij June 11, 2017, 9:48 p.m. UTC | #4
On Fri, Jun 9, 2017 at 10:03 AM, Ralph Sennhauser
<ralph.sennhauser@gmail.com> wrote:
> On Fri, 9 Jun 2017 09:37:55 +0200
> Linus Walleij <linus.walleij@linaro.org> wrote:
>
>> On Thu, Jun 1, 2017 at 2:18 PM, Richard Genoud
>> <richard.genoud@gmail.com> wrote:
>>
>> > The blink counter A was always selected because 0 was forced in the
>> > blink select counter register.
>> > The variable 'set' was obviously there to be used as the register
>> > value, selecting the B counter when id==1 and A counter when id==0.
>> >
>> > Tested on clearfog-pro (Marvell 88F6828)
>> >
>> > Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
>> > Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>> > Reviewed-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
>> > Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
>>
>> Patch applied for fixes.
>>
>> It appears this will clash with patches on the development branch :(
>
> Hi Linus,
>
> The commit 2233bf7a92e7 ("gpio: mvebu: switch to regmap for register
> access") which you likely mean breaks gpio-keys, reported about an hour
> ago, so you might just want to drop that one for now instead as it
> needs mor work anyway.

I would like to get an indication from Thomas and/or Gregory if they think
it is a good idea to revert or if they just wanna fix it.

We still have development time before we even start merging for v4.13
and then we have all the release candidates. No point to throw up hands
this early?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ralph Sennhauser June 12, 2017, 7:17 a.m. UTC | #5
Hi Linus,

On Sun, 11 Jun 2017 23:48:34 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Fri, Jun 9, 2017 at 10:03 AM, Ralph Sennhauser
> <ralph.sennhauser@gmail.com> wrote:
> > On Fri, 9 Jun 2017 09:37:55 +0200
> > Linus Walleij <linus.walleij@linaro.org> wrote:
> >  
> >> On Thu, Jun 1, 2017 at 2:18 PM, Richard Genoud
> >> <richard.genoud@gmail.com> wrote:
> >>  
> >> > The blink counter A was always selected because 0 was forced in
> >> > the blink select counter register.
> >> > The variable 'set' was obviously there to be used as the register
> >> > value, selecting the B counter when id==1 and A counter when
> >> > id==0.
> >> >
> >> > Tested on clearfog-pro (Marvell 88F6828)
> >> >
> >> > Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support")
> >> > Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> >> > Reviewed-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
> >> > Signed-off-by: Richard Genoud <richard.genoud@gmail.com>  
> >>
> >> Patch applied for fixes.
> >>
> >> It appears this will clash with patches on the development
> >> branch :(  
> >
> > Hi Linus,
> >
> > The commit 2233bf7a92e7 ("gpio: mvebu: switch to regmap for register
> > access") which you likely mean breaks gpio-keys, reported about an
> > hour ago, so you might just want to drop that one for now instead
> > as it needs mor work anyway.  
> 
> I would like to get an indication from Thomas and/or Gregory if they
> think it is a good idea to revert or if they just wanna fix it.

A fix patch by Gregory exists by now ([PATCH v2] gpio: mvebu: fix
regmap_update_bits usage).
 
> We still have development time before we even start merging for v4.13
> and then we have all the release candidates. No point to throw up
> hands this early?

Ah, not throwing hands. Just thought the author might prefer to rebase
the patch himself when fixing the bug so there is just one clean patch
for the change as there is still enough time for that before the merge
window opens.

Ralph

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 19a92efabbef..cdef2c78cb3b 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -747,7 +747,7 @@  static int mvebu_pwm_probe(struct platform_device *pdev,
 		set = U32_MAX;
 	else
 		return -EINVAL;
-	writel_relaxed(0, mvebu_gpioreg_blink_counter_select(mvchip));
+	writel_relaxed(set, mvebu_gpioreg_blink_counter_select(mvchip));
 
 	mvpwm = devm_kzalloc(dev, sizeof(struct mvebu_pwm), GFP_KERNEL);
 	if (!mvpwm)