* [PATCH] imx: usb: get pinctrl if it's not yet initialized
@ 2019-06-26 8:25 Krzysztof Michonski
2019-06-27 3:22 ` Peter Chen
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Michonski @ 2019-06-26 8:25 UTC (permalink / raw)
To: gregkh
Cc: Peter.Chen, s.hauer, festevam, linux-usb, linux-arm-kernel,
afenkart, Krzysztof Michonski
In case usb phy mode is other than USBPHY_INTERFACE_MODE_HSIC
the pinctrl for device is not acquired. It is however used later
regardless of the mode, hence leads to requesting access to
uninitialized data.
Signed-off-by: Krzysztof Michonski <michonskikrzysztof@gmail.com>
---
drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index a4b482c3dc65..2f02b35c40b6 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -428,6 +428,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
+ if (!data->pinctrl)
+ data->pinctrl = devm_pinctrl_get(dev);
+
if (!IS_ERR(data->pinctrl)) {
struct pinctrl_state *state;
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] imx: usb: get pinctrl if it's not yet initialized
2019-06-26 8:25 [PATCH] imx: usb: get pinctrl if it's not yet initialized Krzysztof Michonski
@ 2019-06-27 3:22 ` Peter Chen
2019-06-30 10:31 ` Krzysztof Michoński
0 siblings, 1 reply; 3+ messages in thread
From: Peter Chen @ 2019-06-27 3:22 UTC (permalink / raw)
To: Krzysztof Michonski, gregkh
Cc: s.hauer, festevam, linux-usb, linux-arm-kernel, afenkart
> In case usb phy mode is other than USBPHY_INTERFACE_MODE_HSIC the pinctrl
> for device is not acquired. It is however used later regardless of the mode, hence
> leads to requesting access to uninitialized data.
>
> Signed-off-by: Krzysztof Michonski <michonskikrzysztof@gmail.com>
> ---
> drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index a4b482c3dc65..2f02b35c40b6 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -428,6 +428,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
> pm_runtime_enable(dev);
> }
>
> + if (!data->pinctrl)
> + data->pinctrl = devm_pinctrl_get(dev);
> +
> if (!IS_ERR(data->pinctrl)) {
> struct pinctrl_state *state;
>
Sorry, what kernel version you are using? The recent kernel is different with the patch you posted.
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] imx: usb: get pinctrl if it's not yet initialized
2019-06-27 3:22 ` Peter Chen
@ 2019-06-30 10:31 ` Krzysztof Michoński
0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Michoński @ 2019-06-30 10:31 UTC (permalink / raw)
To: Peter Chen
Cc: gregkh, s.hauer, festevam, linux-usb, linux-arm-kernel, afenkart
Hi Peter,
Yes you are right! This file's been patched previously in my fork.
Sorry about that.
Regards,
Krzysztof Michoński
czw., 27 cze 2019 o 05:22 Peter Chen <peter.chen@nxp.com> napisał(a):
>
>
> > In case usb phy mode is other than USBPHY_INTERFACE_MODE_HSIC the pinctrl
> > for device is not acquired. It is however used later regardless of the mode, hence
> > leads to requesting access to uninitialized data.
> >
> > Signed-off-by: Krzysztof Michonski <michonskikrzysztof@gmail.com>
> > ---
> > drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> > index a4b482c3dc65..2f02b35c40b6 100644
> > --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> > +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> > @@ -428,6 +428,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
> > pm_runtime_enable(dev);
> > }
> >
> > + if (!data->pinctrl)
> > + data->pinctrl = devm_pinctrl_get(dev);
> > +
> > if (!IS_ERR(data->pinctrl)) {
> > struct pinctrl_state *state;
> >
>
> Sorry, what kernel version you are using? The recent kernel is different with the patch you posted.
>
> Peter
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-30 10:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 8:25 [PATCH] imx: usb: get pinctrl if it's not yet initialized Krzysztof Michonski
2019-06-27 3:22 ` Peter Chen
2019-06-30 10:31 ` Krzysztof Michoński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).