All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew@lunn.ch>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	netdev <netdev@vger.kernel.org>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Fabio Estevam <festevam@denx.de>, stable <stable@vger.kernel.org>
Subject: Re: [PATCH net v2 1/2] net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061
Date: Wed, 4 May 2022 14:03:08 -0300	[thread overview]
Message-ID: <CAOMZO5DU8XRCGaYOcGeHimgupqMksyLXsjL=R8JHajSBs4KAeg@mail.gmail.com> (raw)
In-Reply-To: <20220504143104.1286960-1-festevam@gmail.com>

Hi Andrew,

On Wed, May 4, 2022 at 11:31 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> From: Fabio Estevam <festevam@denx.de>
>
> Since commit f1131b9c23fb ("net: phy: micrel: use
> kszphy_suspend()/kszphy_resume for irq aware devices") the following
> NULL pointer dereference is observed on a board with KSZ8061:
>
>  # udhcpc -i eth0
> udhcpc: started, v1.35.0
> 8<--- cut here ---
> Unable to handle kernel NULL pointer dereference at virtual address 00000008
> pgd = f73cef4e
> [00000008] *pgd=00000000
> Internal error: Oops: 5 [#1] SMP ARM
> Modules linked in:
> CPU: 0 PID: 196 Comm: ifconfig Not tainted 5.15.37-dirty #94
> Hardware name: Freescale i.MX6 SoloX (Device Tree)
> PC is at kszphy_config_reset+0x10/0x114
> LR is at kszphy_resume+0x24/0x64
> ...
>
> The KSZ8061 phy_driver structure does not have the .probe/..driver_data
> fields, which means that priv is not allocated.
>
> This causes the NULL pointer dereference inside kszphy_config_reset().
>
> Fix the problem by using the generic suspend/resume functions as before.
>
> Another alternative would be to provide the .probe and .driver_data
> information into the structure, but to be on the safe side, let's
> just restore Ethernet functionality by using the generic suspend/resume.
>
> Cc: stable@vger.kernel.org
> Fixes: f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices")
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
> Changes since v1:
> - Explained why enphy_suspend/resume solution is preferred (Andrew).

If this series gets applied, I plan to submit two patches targeting net-next to:

1. Allow .probe to be called without .data_driver being passed
2. Convert KSZ8061 to use .probe and kszphy_suspend/resume

  parent reply	other threads:[~2022-05-04 17:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 14:31 [PATCH net v2 1/2] net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061 Fabio Estevam
2022-05-04 14:31 ` [PATCH net v2 2/2] net: phy: micrel: Pass .probe for KS8737 Fabio Estevam
2022-05-04 21:52   ` Andrew Lunn
2022-05-04 17:03 ` Fabio Estevam [this message]
2022-05-04 21:53   ` [PATCH net v2 1/2] net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061 Andrew Lunn
2022-05-04 21:51 ` Andrew Lunn
2022-05-06  1:20 ` patchwork-bot+netdevbpf

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='CAOMZO5DU8XRCGaYOcGeHimgupqMksyLXsjL=R8JHajSBs4KAeg@mail.gmail.com' \
    --to=festevam@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=festevam@denx.de \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=stable@vger.kernel.org \
    /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.