Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDB8CC742A7 for ; Thu, 9 Mar 2023 10:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230203AbjCIKvZ (ORCPT ); Thu, 9 Mar 2023 05:51:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjCIKvW (ORCPT ); Thu, 9 Mar 2023 05:51:22 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7701BE1C8D; Thu, 9 Mar 2023 02:51:20 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F030320039; Thu, 9 Mar 2023 10:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678359079; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5z2z1TJRrdW4HC7J8YkWQ4B4sI+z+nwQyG06Gl2UpNU=; b=s6TuZFD4hUUzMvLOY0n/a3FbGguBQZrA9xzMLNkZYyabhbTdgD1fHao1uVahkZ2m3AEaxa e28LW86HNtiQooegxTnT/GnfyBNlJaGuG7WE5DghorZP68g1lCBU+8iWIgJhYMbOGju+fA DivY3jFcnlwgEBSQkVpPASiEmsiNDoQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678359079; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5z2z1TJRrdW4HC7J8YkWQ4B4sI+z+nwQyG06Gl2UpNU=; b=OROPJXhr44+iv79vzrIuVXGiS4nuc4IpTbFyPLtrCFNleZh2uKWD8Qqu71+tucY98rhZL9 f/S1VATGqy0pkIBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 930E313A10; Thu, 9 Mar 2023 10:51:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dhekIia6CWR9OwAAMHmgww (envelope-from ); Thu, 09 Mar 2023 10:51:18 +0000 Date: Thu, 09 Mar 2023 11:51:18 +0100 Message-ID: <87356egpuh.wl-tiwai@suse.de> From: Takashi Iwai To: Wesley Cheng Cc: , , , , , , , , , , , , , , , , , , , , Mathias Nyman Subject: Re: [PATCH v3 01/28] xhci: Add support to allocate several interrupters 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: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 09 Mar 2023 00:57:24 +0100, Wesley Cheng wrote: > +struct xhci_interrupter * > +xhci_create_secondary_interrupter(struct usb_hcd *hcd, int intr_num) > +{ > + struct xhci_hcd *xhci = hcd_to_xhci(hcd); > + struct xhci_interrupter *ir; > + unsigned int i; > + unsigned int idx = 0; > + unsigned long flags; > + > + if (!xhci->interrupters || intr_num > xhci->max_interrupters) > + return NULL; > + > + spin_lock_irqsave(&xhci->lock, flags); .... > + if (idx > 0) { > + ir = xhci_alloc_interrupter(xhci, idx, GFP_KERNEL); > + if (!ir) { > + spin_unlock_irqrestore(&xhci->lock, flags); > + return NULL; > + } > + ir->intr_num = idx; > + xhci->interrupters[idx] = ir; > + spin_unlock_irqrestore(&xhci->lock, flags); You can't use GFP_KERNEL allocation inside the spinlock. Takashi