I sent the previous one to linux-serial by mistake.
I am resending to linux-gpio, dropping linux-serial.
Sorry for noise.
Masahiro Yamada (2):
pinctrl: zynq: fix DEFINE_ZYNQ_PINMUX_FUNCTION_MUX macro
pinctrl: zynq: fix offset address for {SD0,SD1}_WP_CD_SEL
drivers/pinctrl/pinctrl-zynq.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--
1.9.1
The offset to the mux register is missing.
Signed-off-by: Masahiro Yamada <[email protected]>
---
drivers/pinctrl/pinctrl-zynq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
index 3d5453a..77c5a98 100644
--- a/drivers/pinctrl/pinctrl-zynq.c
+++ b/drivers/pinctrl/pinctrl-zynq.c
@@ -714,12 +714,13 @@ static const char * const gpio0_groups[] = {"gpio0_0_grp",
.mux_val = mval, \
}
-#define DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(fname, mval, mux, mask, shift) \
+#define DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(fname, mval, offset, mask, shift)\
[ZYNQ_PMUX_##fname] = { \
.name = #fname, \
.groups = fname##_groups, \
.ngroups = ARRAY_SIZE(fname##_groups), \
.mux_val = mval, \
+ .mux = offset, \
.mux_mask = mask, \
.mux_shift = shift, \
}
--
1.9.1
The address for SD0_WP_CD_SEL, SD1_WP_CD_SEL is 0xf8000830,
0xf8000834, respectively.
Each offset address must be prefixed with 0x.
Signed-off-by: Masahiro Yamada <[email protected]>
---
drivers/pinctrl/pinctrl-zynq.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
index 77c5a98..04748a4 100644
--- a/drivers/pinctrl/pinctrl-zynq.c
+++ b/drivers/pinctrl/pinctrl-zynq.c
@@ -745,15 +745,15 @@ static const struct zynq_pinmux_function zynq_pmux_functions[] = {
DEFINE_ZYNQ_PINMUX_FUNCTION(spi1, 0x50),
DEFINE_ZYNQ_PINMUX_FUNCTION(sdio0, 0x40),
DEFINE_ZYNQ_PINMUX_FUNCTION(sdio0_pc, 0xc),
- DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio0_wp, 0, 130, ZYNQ_SDIO_WP_MASK,
+ DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio0_wp, 0, 0x130, ZYNQ_SDIO_WP_MASK,
ZYNQ_SDIO_WP_SHIFT),
- DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio0_cd, 0, 130, ZYNQ_SDIO_CD_MASK,
+ DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio0_cd, 0, 0x130, ZYNQ_SDIO_CD_MASK,
ZYNQ_SDIO_CD_SHIFT),
DEFINE_ZYNQ_PINMUX_FUNCTION(sdio1, 0x40),
DEFINE_ZYNQ_PINMUX_FUNCTION(sdio1_pc, 0xc),
- DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio1_wp, 0, 134, ZYNQ_SDIO_WP_MASK,
+ DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio1_wp, 0, 0x134, ZYNQ_SDIO_WP_MASK,
ZYNQ_SDIO_WP_SHIFT),
- DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio1_cd, 0, 134, ZYNQ_SDIO_CD_MASK,
+ DEFINE_ZYNQ_PINMUX_FUNCTION_MUX(sdio1_cd, 0, 0x134, ZYNQ_SDIO_CD_MASK,
ZYNQ_SDIO_CD_SHIFT),
DEFINE_ZYNQ_PINMUX_FUNCTION(smc0_nor, 4),
DEFINE_ZYNQ_PINMUX_FUNCTION(smc0_nor_cs1, 8),
--
1.9.1
Hi Masahiro,
On Wed, 2015-05-20 at 05:42PM +0900, Masahiro Yamada wrote:
>
> I sent the previous one to linux-serial by mistake.
> I am resending to linux-gpio, dropping linux-serial.
> Sorry for noise.
>
>
>
> Masahiro Yamada (2):
> pinctrl: zynq: fix DEFINE_ZYNQ_PINMUX_FUNCTION_MUX macro
> pinctrl: zynq: fix offset address for {SD0,SD1}_WP_CD_SEL
For the series:
Reviewed-by: Sören Brinkmann <[email protected]>
I'm not sure how severe the impact of these bugs is. It looks like the
the current driver could corrupt the register for MIO pin0, am I right?
It may be a good ides to add
Fixes: add958cee967 "pinctrl: Add driver for Zynq"
(I suspect that bug is there from the beginning) and ask Linus to
consider this for stable.
Thanks,
Sören
Hi Sören,
2015-05-20 23:23 GMT+09:00 Sören Brinkmann <[email protected]>:
> Hi Masahiro,
>
> On Wed, 2015-05-20 at 05:42PM +0900, Masahiro Yamada wrote:
>>
>> I sent the previous one to linux-serial by mistake.
>> I am resending to linux-gpio, dropping linux-serial.
>> Sorry for noise.
>>
>>
>>
>> Masahiro Yamada (2):
>> pinctrl: zynq: fix DEFINE_ZYNQ_PINMUX_FUNCTION_MUX macro
>> pinctrl: zynq: fix offset address for {SD0,SD1}_WP_CD_SEL
>
> For the series:
> Reviewed-by: Sören Brinkmann <[email protected]>
>
> I'm not sure how severe the impact of these bugs is. It looks like the
> the current driver could corrupt the register for MIO pin0, am I right?
Right.
DEFINE_ZYNQ_PINMUX_FUNCTION_MUX() is missing the .mux
so it is always set to zero, i.e. MIO pin0 register is corrupted.
> It may be a good ides to add
> Fixes: add958cee967 "pinctrl: Add driver for Zynq"
> (I suspect that bug is there from the beginning) and ask Linus to
> consider this for stable.
Yes, looks like these two bugs have been there
since the introduction of this driver.
For the series,
Fixes: add958cee967 (pinctrl: Add driver for Zynq)
Linus,
Could you consider this series for stable and linux-4.1, please?
--
Best Regards
Masahiro Yamada
On Wed, May 20, 2015 at 10:42 AM, Masahiro Yamada
<[email protected]> wrote:
> The offset to the mux register is missing.
>
> Signed-off-by: Masahiro Yamada <[email protected]>
No reply from Sören, but applying anyway since it seems to make sense.
Only for -next though.
Yours,
Linus Walleij
On Wed, May 20, 2015 at 10:42 AM, Masahiro Yamada
<[email protected]> wrote:
> The address for SD0_WP_CD_SEL, SD1_WP_CD_SEL is 0xf8000830,
> 0xf8000834, respectively.
>
> Each offset address must be prefixed with 0x.
>
> Signed-off-by: Masahiro Yamada <[email protected]>
No reply from Sören, but applying anyway since it seems to make sense.
Only for -next though.
Yours,
Linus Walleij
On Wed, May 20, 2015 at 4:23 PM, Sören Brinkmann
<[email protected]> wrote:
> For the series:
> Reviewed-by: Sören Brinkmann <[email protected]>
Ah that is Sören's Review tag.
> It may be a good ides to add
> Fixes: add958cee967 "pinctrl: Add driver for Zynq"
> (I suspect that bug is there from the beginning) and ask Linus to
> consider this for stable.
I added it but still merging for -next at this point. No need to
rush this fix since it's been around so long.
Yours,
Linus Walleij