aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Wibo <obiwac@FreeBSD.org>2026-08-12 17:40:56 +0000
committerAymeric Wibo <obiwac@FreeBSD.org>2026-08-13 05:46:14 +0000
commit7858a57baa2f2efc4cfbd61303efb7e72ec43194 (patch)
treee45076491e09ac5b0400922446a9c77a494e2871
parentefdb82413963bea5f4bf2ae52006cceeb6944a3b (diff)
thunderbolt: Explicitly read NHI ISR0 register to clear it
This fixes and issue where Pink Sardine controllers were not receiving interrupts for more than the first command sent on the ring. Reviewed by: emaste, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52862
-rw-r--r--sys/dev/thunderbolt/nhi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/thunderbolt/nhi.c b/sys/dev/thunderbolt/nhi.c
index 75eb4fe6a5d9..22427cf324fb 100644
--- a/sys/dev/thunderbolt/nhi.c
+++ b/sys/dev/thunderbolt/nhi.c
@@ -26,6 +26,12 @@
* SUCH DAMAGE.
*/
+/*
+ * Spec references are to the Universal Serial Bus 4 (USB4®) Specification
+ * version 2.0, September 2024:
+ * https://usb.org/document-library/usb4r-specification-v20
+ */
+
#include "opt_thunderbolt.h"
/* PCIe interface for Thunderbolt Native Host Interface (nhi) */
@@ -1091,6 +1097,16 @@ nhi_intr(void *data)
return;
/*
+ * Need to read this necessarily to clear it; see 12.6.3.4.1. Disable
+ * ISR Auto-Clear must be set to 0.
+ *
+ * XXX This might not be necessary on all platforms. It is on Pink
+ * Sardine, but this was not being done previously so it might have
+ * been working without this on whatever scottl@ was testing on.
+ */
+ nhi_read_reg(sc, NHI_ISR0);
+
+ /*
* Process TX completions from the adapter. Only go through
* the ring once to prevent unbounded looping.
*/