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]

 



On Mon, May 29, 2023 at 11:12:45PM -0500, Mario Limonciello wrote:
> On 5/29/23 06:38, Mika Westerberg 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)
> 
> Mika, that looks good for the issue, thanks!
> 
> You can add:
> Reviewed-by: Mario Limonciello <mario.limonciello@xxxxxxx>
> 
> When you submit it.

Thanks, submitted formal patch now here:

https://lore.kernel.org/linux-usb/20230530075555.35239-1-mika.westerberg@xxxxxxxxxxxxxxx/

beld zhang, can you try it and see if it works on your system? It should
apply on top of thunderbolt.git/fixes [1]. Thanks!

[1] git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git



[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