Re: 6.1.30: thunderbolt: Clear registers properly when auto clear isn't in use cause call trace after resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



both
# rmmod thunderbolt
# modprobe thunderbolt
makes many crash logs on my hardware.

try to patch this to 6.1.30 and 6.4-rc4 but are all failed.

how about continue this on the kernel bugzilla, and post a patch here
after it is resolved as Greg said ?


On Mon, May 29, 2023 at 7:38 AM Mika Westerberg
<mika.westerberg@xxxxxxxxxxxxxxx> wrote:
>
> On Sun, May 28, 2023 at 07:55:39AM -0500, Mario Limonciello wrote:
> > On 5/27/23 18:48, Bagas Sanjaya wrote:
> > > On Sat, May 27, 2023 at 04:15:51PM -0400, beld zhang wrote:
> > > > Upgrade to 6.1.30, got crash message after resume, but looks still
> > > > running normally
> >
> > This is specific resuming from s2idle, doesn't happen at boot?
> >
> > Does it happen with hot-plugging or hot-unplugging a TBT3 or USB4 dock too?
>
> Happens also when device is connected and do
>
>   # rmmod thunderbolt
>   # modprobe thunderbolt
>
> I think it is because nhi_mask_interrupt() does not mask interrupt on
> Intel now.
>
> Can you try the patch below? I'm unable to try myself because my test
> system has some booting issues at the moment.
>
> diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
> index 4c9f2811d20d..a11650da40f9 100644
> --- a/drivers/thunderbolt/nhi.c
> +++ b/drivers/thunderbolt/nhi.c
> @@ -60,9 +60,12 @@ static int ring_interrupt_index(const struct tb_ring *ring)
>
>  static void nhi_mask_interrupt(struct tb_nhi *nhi, int mask, int ring)
>  {
> -       if (nhi->quirks & QUIRK_AUTO_CLEAR_INT)
> -               return;
> -       iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
> +       if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) {
> +               u32 val = ioread32(nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
> +               iowrite32(val & ~mask, nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
> +       } else {
> +               iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
> +       }
>  }
>
>  static void nhi_clear_interrupt(struct tb_nhi *nhi, int ring)




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux