Re: Linux 6.12-rc2

From: Linus Torvalds
Date: Mon Oct 07 2024 - 13:26:26 EST


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.

Linus