All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: balbi@kernel.org, gregkh@linuxfoundation.org
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org,
	hanjie.lin@amlogic.com, yue.wang@amlogic.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"kernelci.org bot" <bot@kernelci.org>
Subject: Re: [PATCH for-5.8 2/2] usb: dwc3: meson-g12a: fix USB2 PHY initialization on G12A and A1 SoCs
Date: Wed, 27 May 2020 10:17:31 +0200	[thread overview]
Message-ID: <40a874eb-1a2b-533e-ee3e-bd90510abaf9@baylibre.com> (raw)
In-Reply-To: <20200526202943.715220-3-martin.blumenstingl@googlemail.com>

Hi Martin,

On 26/05/2020 22:29, Martin Blumenstingl wrote:
> dwc3_meson_g12a_usb2_init_phy() crashes with NULL pointer on an SM1
> board (which uses the same USB setup as G12A) dereference as reported
> by the Kernel CI bot. This is because of the following call flow:
>   dwc3_meson_g12a_probe
>     priv->drvdata->setup_regmaps
>       dwc3_meson_g12a_setup_regmaps
>         priv->usb2_ports is still 0 so priv->u2p_regmap[i] will be NULL
>     dwc3_meson_g12a_get_phys
>       initializes priv->usb2_ports
>     priv->drvdata->usb_init
>       dwc3_meson_g12a_usb_init
>         dwc3_meson_g12a_usb_init_glue
>           dwc3_meson_g12a_usb2_init
>             priv->drvdata->usb2_init_phy
>               dwc3_meson_g12a_usb2_init_phy
>                 dereferences priv->u2p_regmap[i]
> 
> Call priv->drvdata->setup_regmaps only after dwc3_meson_g12a_get_phys so
> priv->usb2_ports is initialized and the regmaps will be set up
> correctly. This fixes the NULL dereference later on.
> 
> Fixes: 013af227f58a97 ("usb: dwc3: meson-g12a: handle the phy and glue registers separately")
> Reported-by: "kernelci.org bot" <bot@kernelci.org>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  drivers/usb/dwc3/dwc3-meson-g12a.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> index ce5388338389..1f7f4d88ed9d 100644
> --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c

[...]

Fixes regression reported at [1] on SEI510 board based on Amlogic G12A.

Felipe, Greg, can this be queued on uxb-next for 5.8 ?

Acked-by: Neil Armstrong <narmstron@baylibre.com>

Thanks,
Neil

[1] http://lore.kernel.org/r/ffe2c64c-62ed-9b59-3754-7ede0f0203be@collabora.com

WARNING: multiple messages have this Message-ID (diff)
From: Neil Armstrong <narmstrong@baylibre.com>
To: balbi@kernel.org, gregkh@linuxfoundation.org
Cc: hanjie.lin@amlogic.com, "kernelci.org bot" <bot@kernelci.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	yue.wang@amlogic.com, linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH for-5.8 2/2] usb: dwc3: meson-g12a: fix USB2 PHY initialization on G12A and A1 SoCs
Date: Wed, 27 May 2020 10:17:31 +0200	[thread overview]
Message-ID: <40a874eb-1a2b-533e-ee3e-bd90510abaf9@baylibre.com> (raw)
In-Reply-To: <20200526202943.715220-3-martin.blumenstingl@googlemail.com>

Hi Martin,

On 26/05/2020 22:29, Martin Blumenstingl wrote:
> dwc3_meson_g12a_usb2_init_phy() crashes with NULL pointer on an SM1
> board (which uses the same USB setup as G12A) dereference as reported
> by the Kernel CI bot. This is because of the following call flow:
>   dwc3_meson_g12a_probe
>     priv->drvdata->setup_regmaps
>       dwc3_meson_g12a_setup_regmaps
>         priv->usb2_ports is still 0 so priv->u2p_regmap[i] will be NULL
>     dwc3_meson_g12a_get_phys
>       initializes priv->usb2_ports
>     priv->drvdata->usb_init
>       dwc3_meson_g12a_usb_init
>         dwc3_meson_g12a_usb_init_glue
>           dwc3_meson_g12a_usb2_init
>             priv->drvdata->usb2_init_phy
>               dwc3_meson_g12a_usb2_init_phy
>                 dereferences priv->u2p_regmap[i]
> 
> Call priv->drvdata->setup_regmaps only after dwc3_meson_g12a_get_phys so
> priv->usb2_ports is initialized and the regmaps will be set up
> correctly. This fixes the NULL dereference later on.
> 
> Fixes: 013af227f58a97 ("usb: dwc3: meson-g12a: handle the phy and glue registers separately")
> Reported-by: "kernelci.org bot" <bot@kernelci.org>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  drivers/usb/dwc3/dwc3-meson-g12a.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> index ce5388338389..1f7f4d88ed9d 100644
> --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c

[...]

Fixes regression reported at [1] on SEI510 board based on Amlogic G12A.

Felipe, Greg, can this be queued on uxb-next for 5.8 ?

Acked-by: Neil Armstrong <narmstron@baylibre.com>

Thanks,
Neil

[1] http://lore.kernel.org/r/ffe2c64c-62ed-9b59-3754-7ede0f0203be@collabora.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Neil Armstrong <narmstrong@baylibre.com>
To: balbi@kernel.org, gregkh@linuxfoundation.org
Cc: hanjie.lin@amlogic.com, "kernelci.org bot" <bot@kernelci.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	yue.wang@amlogic.com, linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH for-5.8 2/2] usb: dwc3: meson-g12a: fix USB2 PHY initialization on G12A and A1 SoCs
Date: Wed, 27 May 2020 10:17:31 +0200	[thread overview]
Message-ID: <40a874eb-1a2b-533e-ee3e-bd90510abaf9@baylibre.com> (raw)
In-Reply-To: <20200526202943.715220-3-martin.blumenstingl@googlemail.com>

Hi Martin,

On 26/05/2020 22:29, Martin Blumenstingl wrote:
> dwc3_meson_g12a_usb2_init_phy() crashes with NULL pointer on an SM1
> board (which uses the same USB setup as G12A) dereference as reported
> by the Kernel CI bot. This is because of the following call flow:
>   dwc3_meson_g12a_probe
>     priv->drvdata->setup_regmaps
>       dwc3_meson_g12a_setup_regmaps
>         priv->usb2_ports is still 0 so priv->u2p_regmap[i] will be NULL
>     dwc3_meson_g12a_get_phys
>       initializes priv->usb2_ports
>     priv->drvdata->usb_init
>       dwc3_meson_g12a_usb_init
>         dwc3_meson_g12a_usb_init_glue
>           dwc3_meson_g12a_usb2_init
>             priv->drvdata->usb2_init_phy
>               dwc3_meson_g12a_usb2_init_phy
>                 dereferences priv->u2p_regmap[i]
> 
> Call priv->drvdata->setup_regmaps only after dwc3_meson_g12a_get_phys so
> priv->usb2_ports is initialized and the regmaps will be set up
> correctly. This fixes the NULL dereference later on.
> 
> Fixes: 013af227f58a97 ("usb: dwc3: meson-g12a: handle the phy and glue registers separately")
> Reported-by: "kernelci.org bot" <bot@kernelci.org>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  drivers/usb/dwc3/dwc3-meson-g12a.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> index ce5388338389..1f7f4d88ed9d 100644
> --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c

[...]

Fixes regression reported at [1] on SEI510 board based on Amlogic G12A.

Felipe, Greg, can this be queued on uxb-next for 5.8 ?

Acked-by: Neil Armstrong <narmstron@baylibre.com>

Thanks,
Neil

[1] http://lore.kernel.org/r/ffe2c64c-62ed-9b59-3754-7ede0f0203be@collabora.com

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2020-05-27  8:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 20:29 [PATCH for-5.8 0/2] dwc3: meson-g12a: two fixes for v5.8 Martin Blumenstingl
2020-05-26 20:29 ` Martin Blumenstingl
2020-05-26 20:29 ` Martin Blumenstingl
2020-05-26 20:29 ` [PATCH for-5.8 1/2] usb: dwc3: meson-g12a: fix error path when fetching the reset line fails Martin Blumenstingl
2020-05-26 20:29   ` Martin Blumenstingl
2020-05-26 20:29   ` Martin Blumenstingl
2020-05-27  7:53   ` Neil Armstrong
2020-05-27  7:53     ` Neil Armstrong
2020-05-27  7:53     ` Neil Armstrong
2020-05-26 20:29 ` [PATCH for-5.8 2/2] usb: dwc3: meson-g12a: fix USB2 PHY initialization on G12A and A1 SoCs Martin Blumenstingl
2020-05-26 20:29   ` Martin Blumenstingl
2020-05-26 20:29   ` Martin Blumenstingl
2020-05-27  8:17   ` Neil Armstrong [this message]
2020-05-27  8:17     ` Neil Armstrong
2020-05-27  8:17     ` Neil Armstrong
2020-05-27  8:53     ` Greg KH
2020-05-27  8:53       ` Greg KH
2020-05-27  8:53       ` Greg KH
2020-05-27 12:56       ` Felipe Balbi
2020-05-27 12:56         ` Felipe Balbi
2020-05-27 12:56         ` Felipe Balbi
2020-07-07 18:51 ` [PATCH for-5.8 0/2] dwc3: meson-g12a: two fixes for v5.8 patchwork-bot+linux-amlogic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40a874eb-1a2b-533e-ee3e-bd90510abaf9@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=balbi@kernel.org \
    --cc=bot@kernelci.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hanjie.lin@amlogic.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=yue.wang@amlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.