* [PATCH] pinctrl: mediatek: move bit assignment
@ 2021-05-28 9:19 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-05-28 9:19 UTC (permalink / raw
To: linux-gpio
Cc: Linus Walleij, Fabien Parent, Sean Wang, Matthias Brugger,
Mattijs Korpershoek, linux-mediatek, kernel test robot
The bit needs offset to be defined which happens some lines
below. Looks like a bug. The kernel test robot complains:
drivers/pinctrl/mediatek/pinctrl-mtk-common.c:137:12:
warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
bit = BIT(offset & pctl->devdata->mode_mask);
^~~~~~
Fix it up by reverting to what was done before.
Cc: Fabien Parent <fparent@baylibre.com>
Cc: Sean Wang <sean.wang@kernel.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: linux-mediatek@lists.infradead.org
Fixes: 9f940d8ecf92 ("pinctrl: mediatek: don't hardcode mode encoding in common code")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 9fe91e11a877..525b1aa7f7a6 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -134,7 +134,7 @@ static int mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin,
pin, pctl->devdata->port_align, value, arg);
}
- bit = BIT(offset & pctl->devdata->mode_mask);
+ bit = BIT(pin & 0xf);
if (arg == PIN_CONFIG_INPUT_ENABLE)
offset = pctl->devdata->ies_offset;
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] pinctrl: mediatek: move bit assignment
@ 2021-05-28 9:19 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-05-28 9:19 UTC (permalink / raw
To: linux-gpio
Cc: Linus Walleij, Fabien Parent, Sean Wang, Matthias Brugger,
Mattijs Korpershoek, linux-mediatek, kernel test robot
The bit needs offset to be defined which happens some lines
below. Looks like a bug. The kernel test robot complains:
drivers/pinctrl/mediatek/pinctrl-mtk-common.c:137:12:
warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
bit = BIT(offset & pctl->devdata->mode_mask);
^~~~~~
Fix it up by reverting to what was done before.
Cc: Fabien Parent <fparent@baylibre.com>
Cc: Sean Wang <sean.wang@kernel.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: linux-mediatek@lists.infradead.org
Fixes: 9f940d8ecf92 ("pinctrl: mediatek: don't hardcode mode encoding in common code")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 9fe91e11a877..525b1aa7f7a6 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -134,7 +134,7 @@ static int mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin,
pin, pctl->devdata->port_align, value, arg);
}
- bit = BIT(offset & pctl->devdata->mode_mask);
+ bit = BIT(pin & 0xf);
if (arg == PIN_CONFIG_INPUT_ENABLE)
offset = pctl->devdata->ies_offset;
--
2.31.1
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] pinctrl: mediatek: move bit assignment
2021-05-28 9:19 ` Linus Walleij
@ 2021-06-02 12:34 ` Matthias Brugger
-1 siblings, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2021-06-02 12:34 UTC (permalink / raw
To: Linus Walleij, linux-gpio
Cc: Fabien Parent, Sean Wang, Mattijs Korpershoek, linux-mediatek,
kernel test robot
Hi Linus,
On 28/05/2021 11:19, Linus Walleij wrote:
> The bit needs offset to be defined which happens some lines
> below. Looks like a bug. The kernel test robot complains:
>
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c:137:12:
> warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
> bit = BIT(offset & pctl->devdata->mode_mask);
> ^~~~~~
>
> Fix it up by reverting to what was done before.
>
> Cc: Fabien Parent <fparent@baylibre.com>
> Cc: Sean Wang <sean.wang@kernel.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: linux-mediatek@lists.infradead.org
> Fixes: 9f940d8ecf92 ("pinctrl: mediatek: don't hardcode mode encoding in common code")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 9fe91e11a877..525b1aa7f7a6 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -134,7 +134,7 @@ static int mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin,
> pin, pctl->devdata->port_align, value, arg);
> }
>
> -
> + bit = BIT(pin & 0xf);
I see this is already applied to linux-next, but I think the correct fix is to move
bit = BIT(offset & pctl->devdata->mode_mask);
just before calling regmap_write(...)
I can provide a patch for that, if you want. Just let me know if I should base
it against linux-next or if you will drop the fix proposed by you?
Regards,
Matthias
>
> if (arg == PIN_CONFIG_INPUT_ENABLE)
> offset = pctl->devdata->ies_offset;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pinctrl: mediatek: move bit assignment
@ 2021-06-02 12:34 ` Matthias Brugger
0 siblings, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2021-06-02 12:34 UTC (permalink / raw
To: Linus Walleij, linux-gpio
Cc: Fabien Parent, Sean Wang, Mattijs Korpershoek, linux-mediatek,
kernel test robot
Hi Linus,
On 28/05/2021 11:19, Linus Walleij wrote:
> The bit needs offset to be defined which happens some lines
> below. Looks like a bug. The kernel test robot complains:
>
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c:137:12:
> warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
> bit = BIT(offset & pctl->devdata->mode_mask);
> ^~~~~~
>
> Fix it up by reverting to what was done before.
>
> Cc: Fabien Parent <fparent@baylibre.com>
> Cc: Sean Wang <sean.wang@kernel.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: linux-mediatek@lists.infradead.org
> Fixes: 9f940d8ecf92 ("pinctrl: mediatek: don't hardcode mode encoding in common code")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 9fe91e11a877..525b1aa7f7a6 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -134,7 +134,7 @@ static int mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin,
> pin, pctl->devdata->port_align, value, arg);
> }
>
> -
> + bit = BIT(pin & 0xf);
I see this is already applied to linux-next, but I think the correct fix is to move
bit = BIT(offset & pctl->devdata->mode_mask);
just before calling regmap_write(...)
I can provide a patch for that, if you want. Just let me know if I should base
it against linux-next or if you will drop the fix proposed by you?
Regards,
Matthias
>
> if (arg == PIN_CONFIG_INPUT_ENABLE)
> offset = pctl->devdata->ies_offset;
>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pinctrl: mediatek: move bit assignment
2021-06-02 12:34 ` Matthias Brugger
@ 2021-06-06 22:49 ` Linus Walleij
-1 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-06-06 22:49 UTC (permalink / raw
To: Matthias Brugger
Cc: open list:GPIO SUBSYSTEM, Fabien Parent, Sean Wang,
Mattijs Korpershoek, moderated list:ARM/Mediatek SoC support,
kernel test robot
On Wed, Jun 2, 2021 at 2:34 PM Matthias Brugger <matthias.bgg@gmail.com> wrote:
> > -
> > + bit = BIT(pin & 0xf);
>
> I see this is already applied to linux-next, but I think the correct fix is to move
> bit = BIT(offset & pctl->devdata->mode_mask);
> just before calling regmap_write(...)
>
> I can provide a patch for that, if you want. Just let me know if I should base
> it against linux-next or if you will drop the fix proposed by you?
Just patch it in my tree, I merged more stuff on top and this
was just my quickfix to get next working.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pinctrl: mediatek: move bit assignment
@ 2021-06-06 22:49 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2021-06-06 22:49 UTC (permalink / raw
To: Matthias Brugger
Cc: open list:GPIO SUBSYSTEM, Fabien Parent, Sean Wang,
Mattijs Korpershoek, moderated list:ARM/Mediatek SoC support,
kernel test robot
On Wed, Jun 2, 2021 at 2:34 PM Matthias Brugger <matthias.bgg@gmail.com> wrote:
> > -
> > + bit = BIT(pin & 0xf);
>
> I see this is already applied to linux-next, but I think the correct fix is to move
> bit = BIT(offset & pctl->devdata->mode_mask);
> just before calling regmap_write(...)
>
> I can provide a patch for that, if you want. Just let me know if I should base
> it against linux-next or if you will drop the fix proposed by you?
Just patch it in my tree, I merged more stuff on top and this
was just my quickfix to get next working.
Yours,
Linus Walleij
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-06-06 22:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-28 9:19 [PATCH] pinctrl: mediatek: move bit assignment Linus Walleij
2021-05-28 9:19 ` Linus Walleij
2021-06-02 12:34 ` Matthias Brugger
2021-06-02 12:34 ` Matthias Brugger
2021-06-06 22:49 ` Linus Walleij
2021-06-06 22:49 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.