public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Neronin <niklas.neronin@linux.intel.com>
To: mathias.nyman@linux.intel.com
Cc: linux-usb@vger.kernel.org, raoxu@uniontech.com,
	Niklas Neronin <niklas.neronin@linux.intel.com>
Subject: [PATCH 1/2] usb: xhci: move Primary Interrupter IMODI setup
Date: Wed, 28 Jan 2026 14:15:03 +0100	[thread overview]
Message-ID: <20260128131504.124322-2-niklas.neronin@linux.intel.com> (raw)
In-Reply-To: <20260128131504.124322-1-niklas.neronin@linux.intel.com>

Move IMODI programming into the Primary Interrupter initialization path,
keeping all interrupter-related setup in a single place.

xHCI platform drivers set 'xhci->imod_interval' well before xhci_init()
is called, so the value is available when the Primary Interrupter is
initialized.

The IMODI value does not change unless explicitly written by software.
See xHCI Specification v1.2, section 5.5.2.2.

Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
---
 drivers/usb/host/xhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b3ba16b9718c..fcf8b486b0e0 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -578,6 +578,7 @@ static int xhci_init(struct usb_hcd *hcd)
 
 	/* Initialize the Primary interrupter */
 	xhci_add_interrupter(xhci, 0);
+	xhci_set_interrupter_moderation(xhci->interrupters[0], xhci->imod_interval);
 	xhci->interrupters[0]->isoc_bei_interval = AVOID_BEI_INTERVAL_MAX;
 
 	/* Initializing Compliance Mode Recovery Data If Needed */
@@ -664,8 +665,6 @@ int xhci_run(struct usb_hcd *hcd)
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"ERST deq = 64'h%0lx", (long unsigned int) temp_64);
 
-	xhci_set_interrupter_moderation(ir, xhci->imod_interval);
-
 	if (xhci->quirks & XHCI_NEC_HOST) {
 		struct xhci_command *command;
 
-- 
2.50.1


  reply	other threads:[~2026-01-28 13:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28 13:15 [PATCH 0/2] usb: xhci: simplify interrupter handling Niklas Neronin
2026-01-28 13:15 ` Niklas Neronin [this message]
2026-01-28 13:15 ` [PATCH 2/2] usb: xhci: add interrupter type Niklas Neronin
2026-01-29  6:59   ` Dan Carpenter
2026-02-04  1:17   ` Wesley Cheng
2026-02-05 10:41     ` Neronin, Niklas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260128131504.124322-2-niklas.neronin@linux.intel.com \
    --to=niklas.neronin@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=raoxu@uniontech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox