--- Begin Message ---
- To: Wesley Cheng <quic_wcheng@xxxxxxxxxxx>, srinivas.kandagatla@xxxxxxxxxx, mathias.nyman@xxxxxxxxx, perex@xxxxxxxx, broonie@xxxxxxxxxx, lgirdwood@xxxxxxxxx, krzysztof.kozlowski+dt@xxxxxxxxxx, agross@xxxxxxxxxx, Thinh.Nguyen@xxxxxxxxxxxx, bgoswami@xxxxxxxxxxx, andersson@xxxxxxxxxx, robh+dt@xxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, tiwai@xxxxxxxx
- Subject: Re: [PATCH v3 01/28] xhci: Add support to allocate several interrupters
- From: Oliver Neukum <oneukum@xxxxxxxx>
- Date: Thu, 9 Mar 2023 11:34:13 +0100
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, alsa-devel@xxxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx, linux-usb@xxxxxxxxxxxxxxx, quic_jackp@xxxxxxxxxxx, quic_plai@xxxxxxxxxxx, Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
- In-reply-to: <20230308235751.495-2-quic_wcheng@quicinc.com>
- References: <20230308235751.495-1-quic_wcheng@quicinc.com> <20230308235751.495-2-quic_wcheng@quicinc.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0
On 09.03.23 00:57, Wesley Cheng wrote:
@@ -1865,8 +1889,15 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
cancel_delayed_work_sync(&xhci->cmd_timer);
- xhci_free_interrupter(xhci, xhci->interrupter);
- xhci->interrupter = NULL;
+ for (i = 1; i < xhci->max_interrupters; i++) {
+ if (xhci->interrupters[i])
+ xhci_remove_secondary_interrupter(xhci_to_hcd(xhci),
+ xhci->interrupters[i]);
+ }
+
+ /* free the primary interrupter, interrupter number 0 */
+ xhci_free_interrupter(xhci, xhci->interrupters[0]);
+ xhci->interrupters[0] = NULL;
xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed primary event ring");
Any reason you are not just counting down to zero?
+ if (idx > 0) {
+ ir = xhci_alloc_interrupter(xhci, idx, GFP_KERNEL);
+ if (!ir) {
+ spin_unlock_irqrestore(&xhci->lock, flags);
Why use _irqrestore?
Regards
Oliver
--- End Message ---