Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp673798pxu; Wed, 14 Oct 2020 10:42:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvvGI+SHXc5p3jEvID6l7vB4QzqsEjfAG79r16uULPsxcGv8tAUfX79AwcqLgONhw/jTlc X-Received: by 2002:a17:906:5806:: with SMTP id m6mr199418ejq.20.1602697328279; Wed, 14 Oct 2020 10:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602697328; cv=none; d=google.com; s=arc-20160816; b=lyDlFq08riSS9Hi4WoZRX+rV7rccyfPxhAnriprNL8TZX6ldP+O/uh2BORlA7Ncv+U 2p+RVnkKs5c9/BtUn+lqks6xHFlbB6Ydf/XwmWsASY5TtxKAw4XWJRqPLAfcxm+H71BG SIY0j/dptHTTPLPUoozmPlKrgxDYZca4s0VQ6vaDSPsG0uk4f0n9miVcB6/LosoH0okM RK29jTzf8ZvC+0Qajyg9WcXh9MOEiRzpdplZFfLiAUMdaOP3MzTfJC2Vqeg0jV1Ii5dZ xjT7GzWAaxNLOaUMwYoqY5uLsqNQLoKtKAlc/BZzNC1OJBoKcsa4QgTtZS3nCf5Vew6J zQYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=hyOdU3wkovhIW1Kvz7qShxqCzj4/rDIPSfPdvt/3zl0=; b=Cari8ALztn7OBA2PpakQRFQlAZvQrfLtCFK76tfJghtTXAwRkaGXBGHhicOGfqieDz gzyRPT0oxeH4B9jSplvl74BWY35oVuCndnU2nbOl3vOYbwXUIfjXeFIqm2/QDXmgW0h7 hbGaWZBToKr3pfaBm6/ZgBiI3R/JOFA6yiFYNn6ttlQ5atXHd+VZn9Lcutw2GtpWj4Bv OpLlsNJffP28jng+NYPR/NV2Db6+heIa245vMpainQsVIGN7tB4efcglop35jr+w1L4Z CGRaxPRKhrWQO1m167aPuayZMauxNEfHY3t6MnKlNoKJSv6P3HjboMbOAOyjJaw4Q4A0 Pweg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=M1hAxuBs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=DzzVOkrD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qn3si236616ejb.655.2020.10.14.10.41.44; Wed, 14 Oct 2020 10:42:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=M1hAxuBs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=DzzVOkrD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731202AbgJNQl2 (ORCPT + 99 others); Wed, 14 Oct 2020 12:41:28 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59870 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727559AbgJNQl1 (ORCPT ); Wed, 14 Oct 2020 12:41:27 -0400 Date: Wed, 14 Oct 2020 18:41:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602693685; h=from:from:reply-to:subject:subject: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=hyOdU3wkovhIW1Kvz7qShxqCzj4/rDIPSfPdvt/3zl0=; b=M1hAxuBsmEcPlS77v4M65R2eCSjsNXt7dkKalkKXFb+wIHDVTZPPFv/xTnHDRa0YWxn08v fqxqIcgsLy7SdcGRubYoMsFPS/weOcjOsXV8WG1wKRYZR/zCyck4CqqThYSrtduogR0wzA V9e0//aePEcPgxs4l+MB7WkHGqgYx+CnJ8x0RPxhcWTZ0y06mN0MFGpAgvCob+2l4eNJ2F 2BYD2Gny+C9uzVb7KvlDI3qMug3+i72sIh1RjQS1WJ5vdVC1mk4BgelGzJKSzVFV6qqQkj yxMsrSO2Bn0478hIKMagaS9BDD6au+mMRERRXBqf3GFripjBYNH+yJyAcOvVyA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602693685; h=from:from:reply-to:subject:subject: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=hyOdU3wkovhIW1Kvz7qShxqCzj4/rDIPSfPdvt/3zl0=; b=DzzVOkrDLRxbubq8Q8KdxzZYR5qyTcRtmdjLLvf7N8IDEB/soAO/Wp9y8OJszxrHuEWt2W XqvtEEksDFZdFtBQ== From: Sebastian Andrzej Siewior To: Alan Stern Cc: Thomas Gleixner , LKML , Peter Zijlstra , "Ahmed S. Darwish" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Johan Hovold , Mathias Nyman , Valentina Manea , Shuah Khan , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: Re: [patch 11/12] usb: core: Replace in_interrupt() in comments Message-ID: <20201014164123.hnqqkyrjrjytcxgz@linutronix.de> References: <20201014145215.518912759@linutronix.de> <20201014145728.318078828@linutronix.de> <20201014162721.GE712494@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201014162721.GE712494@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-10-14 12:27:21 [-0400], Alan Stern wrote: > > --- a/drivers/usb/core/hcd.c > > +++ b/drivers/usb/core/hcd.c > > @@ -746,9 +746,6 @@ static int rh_call_control (struct usb_h > > * Root Hub interrupt transfers are polled using a timer if the > > * driver requests it; otherwise the driver is responsible for > > * calling usb_hcd_poll_rh_status() when an event occurs. > > - * > > - * Completions are called in_interrupt(), but they may or may not > > - * be in_irq(). > > This comment should not be removed; instead it should be changed to say > that completion handlers are called with interrupts disabled. The timer callback: rh_timer_func() -> usb_hcd_poll_rh_status() invokes the function with enabled interrupts. > > @@ -1691,7 +1690,6 @@ static void usb_giveback_urb_bh(unsigned > > * @hcd: host controller returning the URB > > * @urb: urb being returned to the USB device driver. > > * @status: completion status code for the URB. > > - * Context: in_interrupt() > > The comment should be changed to say that the routine runs in a BH > handler (or however you want to express it). Do you mean usb_hcd_giveback_urb() runs in BH context or that the completion callback of the URB runs in BH context? The completion callback of the URB may run in BH or IRQ context depending on HCD. > > --- a/drivers/usb/core/message.c > > +++ b/drivers/usb/core/message.c > > > @@ -934,7 +939,7 @@ int usb_get_device_descriptor(struct usb > > /* > > * usb_set_isoch_delay - informs the device of the packet transmit delay > > * @dev: the device whose delay is to be informed > > - * Context: !in_interrupt() > > + * Context: can sleep > > Why is this comment different from all the others? It says !in_interrupt() which is also true for preempt-disabled regions. But the caller must not have preemption disabled. "can sleep" is more obvious as what it needs. > Alan Stern Sebastian