public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
* [PATCH] pinctrl: mediatek: common: Fix probe failure for devices without EINT
@ 2026-03-17 11:02 Luca Leonardo Scorcia
  2026-03-17 14:28 ` AngeloGioacchino Del Regno
  2026-03-19 18:52 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Luca Leonardo Scorcia @ 2026-03-17 11:02 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Luca Leonardo Scorcia, Sean Wang, Linus Walleij, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-gpio, linux-kernel,
	linux-arm-kernel

Some pinctrl devices like mt6397 or mt6392 don't support EINT at all, but
the mtk_eint_init function is always called and returns -ENODEV, which
then bubbles up and causes probe failure.

To address this only call mtk_eint_init if EINT pins are present.

Tested on Xiaomi Mi Smart Clock x04g (mt6392).

Fixes: e46df235b4e6 ("pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit")
Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail•com>
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index d6a46fe0cda8..3f518dce6d23 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -1135,9 +1135,12 @@ int mtk_pctrl_init(struct platform_device *pdev,
 		goto chip_error;
 	}
 
-	ret = mtk_eint_init(pctl, pdev);
-	if (ret)
-		goto chip_error;
+	/* Only initialize EINT if we have EINT pins */
+	if (data->eint_hw.ap_num > 0) {
+		ret = mtk_eint_init(pctl, pdev);
+		if (ret)
+			goto chip_error;
+	}
 
 	return 0;
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: mediatek: common: Fix probe failure for devices without EINT
  2026-03-17 11:02 [PATCH] pinctrl: mediatek: common: Fix probe failure for devices without EINT Luca Leonardo Scorcia
@ 2026-03-17 14:28 ` AngeloGioacchino Del Regno
  2026-03-19 18:52 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-03-17 14:28 UTC (permalink / raw)
  To: Luca Leonardo Scorcia, linux-mediatek
  Cc: Sean Wang, Linus Walleij, Matthias Brugger, linux-gpio,
	linux-kernel, linux-arm-kernel

Il 17/03/26 12:02, Luca Leonardo Scorcia ha scritto:
> Some pinctrl devices like mt6397 or mt6392 don't support EINT at all, but
> the mtk_eint_init function is always called and returns -ENODEV, which
> then bubbles up and causes probe failure.
> 
> To address this only call mtk_eint_init if EINT pins are present.
> 
> Tested on Xiaomi Mi Smart Clock x04g (mt6392).
> 
> Fixes: e46df235b4e6 ("pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit")
> Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail•com>

That's right. Not all do - and the ones that don't have eint support also won't
have the pm ops, so no further check is required.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora•com>

> ---
>   drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index d6a46fe0cda8..3f518dce6d23 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -1135,9 +1135,12 @@ int mtk_pctrl_init(struct platform_device *pdev,
>   		goto chip_error;
>   	}
>   
> -	ret = mtk_eint_init(pctl, pdev);
> -	if (ret)
> -		goto chip_error;
> +	/* Only initialize EINT if we have EINT pins */
> +	if (data->eint_hw.ap_num > 0) {
> +		ret = mtk_eint_init(pctl, pdev);
> +		if (ret)
> +			goto chip_error;
> +	}
>   
>   	return 0;
>   



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: mediatek: common: Fix probe failure for devices without EINT
  2026-03-17 11:02 [PATCH] pinctrl: mediatek: common: Fix probe failure for devices without EINT Luca Leonardo Scorcia
  2026-03-17 14:28 ` AngeloGioacchino Del Regno
@ 2026-03-19 18:52 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2026-03-19 18:52 UTC (permalink / raw)
  To: Luca Leonardo Scorcia
  Cc: linux-mediatek, Sean Wang, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-gpio, linux-kernel,
	linux-arm-kernel

On Tue, Mar 17, 2026 at 12:03 PM Luca Leonardo Scorcia
<l.scorcia@gmail•com> wrote:

> Some pinctrl devices like mt6397 or mt6392 don't support EINT at all, but
> the mtk_eint_init function is always called and returns -ENODEV, which
> then bubbles up and causes probe failure.
>
> To address this only call mtk_eint_init if EINT pins are present.
>
> Tested on Xiaomi Mi Smart Clock x04g (mt6392).
>
> Fixes: e46df235b4e6 ("pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit")
> Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail•com>

Patch applied for fixes!

Yours,
Linus Walleij


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-19 18:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 11:02 [PATCH] pinctrl: mediatek: common: Fix probe failure for devices without EINT Luca Leonardo Scorcia
2026-03-17 14:28 ` AngeloGioacchino Del Regno
2026-03-19 18:52 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox