mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Linton <jeremy.linton@arm.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, mw@semihalf.com, davem@davemloft.net,
	kuba@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: mvpp2: Check for null pcs in mvpp2_acpi_start()
Date: Fri, 11 Feb 2022 18:18:22 -0600	[thread overview]
Message-ID: <0e5f1807-22f1-ec5b-0b18-8bc02ad99760@arm.com> (raw)
In-Reply-To: <Ygb2E1DGYVBO+mNP@shell.armlinux.org.uk>

Hi,

On 2/11/22 17:49, Russell King (Oracle) wrote:
> On Fri, Feb 11, 2022 at 05:42:35PM -0600, Jeremy Linton wrote:
>> Booting a MACCHIATObin with 5.17 the system OOPs with
>> a null pointer deref when the network is started. This
>> is caused by the pcs->ops structure being null on this
>> particular platform/firmware.
> 
> pcs->ops should never be NULL. I'm surprised this fix results in any
> kind of working networking.
> 
> Instead, the initialilsation of port->pcs_*.ops needs to be moved out
> of the if (!mvpp2_use_acpi_compat_mode(..)) block. Please try this:

That appears to fix it as well, shall I re-post this with your fix, or 
will you?

> 
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index b45cc7bfcdb5..0fb65940c0a5 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -7036,6 +7036,9 @@ static int mvpp2_port_probe(struct platform_device *pdev,
>   	dev->max_mtu = MVPP2_BM_JUMBO_PKT_SIZE;
>   	dev->dev.of_node = port_node;
>   
> +	port->pcs_gmac.ops = &mvpp2_phylink_gmac_pcs_ops;
> +	port->pcs_xlg.ops = &mvpp2_phylink_xlg_pcs_ops;
> +
>   	if (!mvpp2_use_acpi_compat_mode(port_fwnode)) {
>   		port->phylink_config.dev = &dev->dev;
>   		port->phylink_config.type = PHYLINK_NETDEV;
> @@ -7106,9 +7109,6 @@ static int mvpp2_port_probe(struct platform_device *pdev,
>   				  port->phylink_config.supported_interfaces);
>   		}
>   
> -		port->pcs_gmac.ops = &mvpp2_phylink_gmac_pcs_ops;
> -		port->pcs_xlg.ops = &mvpp2_phylink_xlg_pcs_ops;
> -
>   		phylink = phylink_create(&port->phylink_config, port_fwnode,
>   					 phy_mode, &mvpp2_phylink_ops);
>   		if (IS_ERR(phylink)) {
> 
> Thanks.
> 

I did a bit more testing and as a side note, it seems ethtool tosses 
these errors too.


netlink error: failed to retrieve link settings
netlink error: Unknown error 524
netlink error: failed to retrieve link settings
netlink error: Unknown error 524
Settings for enamrvl110i0:
         Link detected: no

  reply	other threads:[~2022-02-12  0:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 23:42 Jeremy Linton
2022-02-11 23:49 ` Russell King (Oracle)
2022-02-12  0:18   ` Jeremy Linton [this message]
2022-02-12  9:58     ` Russell King (Oracle)

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=0e5f1807-22f1-ec5b-0b18-8bc02ad99760@arm.com \
    --to=jeremy.linton@arm.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mw@semihalf.com \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®