RE: Linux 6.12-rc2

From: Wei Fang
Date: Tue Oct 08 2024 - 03:31:55 EST


> -----Original Message-----
> From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Sent: 2024年10月8日 1:26
> To: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>; Csókás, Bence
> <csokas.bence@xxxxxxxxx>; Wei Fang <wei.fang@xxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>
> Subject: Re: Linux 6.12-rc2
>
> On Mon, 7 Oct 2024 at 10:00, Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
> >
> > The failed qemu tests are crashes, bisected to commit d9335d0232d2 ("net:
> fec: Reload PTP
> > registers after link-state change"). I copied the author and reviewers for
> feedback.
>
> It seems to be this in timecounter_read_delta() (inlined into
> timecounter_read()):
>
> /* read cycle counter: */
> cycle_now = tc->cc->read(tc->cc);
>
> where "tc->cc" is NULL (but that's just a guess from the fact that the
> exception happens very early in timecounter_read()).
>
> So presumably the timecounter_init() hasn't been called yet
> (fec_ptp_init -> fec_ptp_start_cyclecounter -> timecounter_init).
>
> And looking around, we have fec_probe() doing
>
> irq_cnt = fec_enet_get_irq_cnt(pdev);
> if (fep->bufdesc_ex)
> fec_ptp_init(pdev, irq_cnt);
>
> so the fec_ptp_init() is called conditionally, but
> fec_ptp_save_state() that does the timecounter_read() seems to be
> called unconditionally.
>
> So that commit d9335d0232d2 looks just broken. Either the
> timecounter_init() needs to be done unconditionally, or the
> timecounter_read() needs to be conditional on ptp being inited.
>

This analysis is absolutely correct. I have cooked up a patch for
this issue.
Thanks very much.