Re: thunderbolt: resume from hibernation CPUs racing in tb_ring_start

From: Brian Geffon
Date: Thu Jun 15 2023 - 06:28:50 EST


On Thu, Jun 15, 2023 at 12:49 AM Mika Westerberg
<mika.westerberg@xxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> On Wed, Jun 14, 2023 at 04:26:49PM -0400, Brian Geffon wrote:
> > Hi,
> > On ChromeOS we're running a 5.15 kernel patched up to 6.4-rc6 w.r.t to
> > drivers/thunderbolt code and we're seeing a similar issue to the one
> > discussed in https://lore.kernel.org/lkml/20230421140725.495-1-mario.limonciello@xxxxxxx/T/#
> > / https://bugzilla.kernel.org/show_bug.cgi?id=217343 where when
> > resuming from hibernation you'll see warnings along the lines of
> >
> > [ 126.292769] thunderbolt 0000:00:0d.3: interrupt for RX ring 0 is
> > already enabled
> >
> > The thing that's odd is it appears three CPUs are racing through this code path:
> >
> > [ 126.292076] ------------[ cut here ]------------
> > [ 126.292077] thunderbolt 0000:00:0d.2: interrupt for TX ring 0 is
> > already enabled
> > [ 126.292080] proc_thermal_pci 0000:00:04.0: PM:
> > pci_pm_thaw_noirq+0x0/0x7c returned 0 after 606 usecs
> > [ 126.292086] ------------[ cut here ]------------
> > [ 126.292087] thunderbolt 0000:00:0d.3: interrupt for TX ring 0 is
> > already enabled
> > [ 126.292089] WARNING: CPU: 6 PID: 7879 at
> > drivers/thunderbolt/nhi.c:138 ring_interrupt_active+0x1cd/0x225
> > [ 126.292092] Modules linked in:
> > [ 126.292091] WARNING: CPU: 0 PID: 175 at
> > drivers/thunderbolt/nhi.c:138 ring_interrupt_active+0x1cd/0x225
> > [ 126.292157] CPU: 0 PID: 175 Comm: kworker/u24:2 Tainted: G U
> > 5.15.116-19568-g766d8095041b #24
> > fdadcb2517d1d37363ad385ffddbc1ad5dc72550
> > [ 126.292158] lzo_rle zram joydev
> > [ 126.292159] Hardware name: Google Anahera/Anahera, BIOS
> > Google_Anahera.14505.143.0 06/22/2022
> > [ 126.292159]
> > [ 126.292160] Workqueue: events_unbound async_run_entry_fn
> > [ 126.292160] CPU: 6 PID: 7879 Comm: kworker/u24:13 Tainted: G U
> > 5.15.116-19568-g766d8095041b #24
>
> Do you have this one?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git/commit/?h=fixes&id=9f9666e65359d5047089aef97ac87c50f624ecb0

Thank you for pointing me to this, we do not have that in our tree yet
since it's not upstream. I'll apply it and see if it resolved the
issue.

Thanks!
Brian