[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+HBbNGwAK2PKEA-cY6e0wyjbE3KLWPvoRPbSt4hou_SeJRvMQ@mail.gmail.com>
Date: Thu, 23 Oct 2025 16:16:03 +0200
From: Robert Marko <robert.marko@...tura.hr>
To: Jakub Kicinski <kuba@...nel.org>
Cc: daniel.machon@...rochip.com, andrew@...n.ch, hkallweit1@...il.com,
linux@...linux.org.uk, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, vadim.fedorenko@...ux.dev, horatiu.vultur@...rochip.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org, luka.perkov@...tura.hr
Subject: Re: [PATCH net] net: phy: micrel: always set shared->phydev for LAN8814
On Thu, Oct 23, 2025 at 4:13 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Tue, 21 Oct 2025 15:20:26 +0200 Robert Marko wrote:
> > Currently, during the LAN8814 PTP probe shared->phydev is only set if PTP
> > clock gets actually set, otherwise the function will return before setting
> > it.
> >
> > This is an issue as shared->phydev is unconditionally being used when IRQ
> > is being handled, especially in lan8814_gpio_process_cap and since it was
> > not set it will cause a NULL pointer exception and crash the kernel.
> >
> > So, simply always set shared->phydev to avoid the NULL pointer exception.
> >
> > Fixes: b3f1a08fcf0d ("net: phy: micrel: Add support for PTP_PF_EXTTS for lan8814")
> > Signed-off-by: Robert Marko <robert.marko@...tura.hr>
>
> Hopefully I'm not misunderstanding the situation, but since we're
> considering taking the other patchset via net-next I'll apply
> already this to prevent crashes in net..
That would be great, as Horatiu explained, if PTP_1588_CLOCK is not
enabled in the kernel config
kernel will crash with a NULL pointer exception as soon as the first
interrupt is being handled.
It is not tied to the pending [PATCH net-next v2] net: phy: micrel:
Add support for non-PTP SKUs for lan8814
patch.
Regards,
Robert
--
Robert Marko
Staff Embedded Linux Engineer
Sartura d.d.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: robert.marko@...tura.hr
Web: www.sartura.hr
Powered by blists - more mailing lists