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 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