Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp854776pxu; Wed, 14 Oct 2020 16:04:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8jbtw99ofo3/frjUoNykKMfK5d7ChLYybrfP2/uCC0ARf9XrMbgGSrRoC9HpPNxzw9u95 X-Received: by 2002:a05:6402:1cbb:: with SMTP id cz27mr1351766edb.38.1602716699043; Wed, 14 Oct 2020 16:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602716699; cv=none; d=google.com; s=arc-20160816; b=LExXuHwEw/YhwDTxnuCgnm5zymYIkSmBNXBDXMx/xEY/af1VZ3QmqQ/vbvaWwMTxXQ F+HjAhxoayn8FC9REWcbv23leLq/XfJsiKlBUC46m/H3DWhupXmVEUsQj07Y/WWcgN18 WauIEpykJDMUr5cXjUrZVVBFXgJk3PO6j7jQqNeBEinP/8uYsnLp8z8SaSHwQ6oG2bvi u20aZMYT5kZajcaEVWNYa233evOstoC52RgzGFgLFSq4ODGAQRogZiNZdmbwicowsr34 OKYK2hFkVL5VltPPAA4KYR737IkcWfCHDWKgbVhIuPgVvwaaQ89kDiWsQ2CTgI+B0cY9 0kXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nF1xtRc6hoyIhhUsLoF1MrL95+6NlC6A1wO3cJUjPnQ=; b=BbQJ/8bjrtn6/2NzbUD6PUFgI3vQDKNJDtjPyq7UcR5tMZBB2v3T4aaVIL4ClRW3Re 48uGjQiP08edB2huLUr6NTysgjGeruo6I6SDU9tGhLHoP1gY8GaZXEtyj75f+J0MIVVL SqmWTq9I4wHMg8EMAXpA0D1N3l2RB1OSLDtlMekyT/oo6kVGfzCmQ+ImTdlJ39KnzPUK KNFHOYGr9lhdtlzPlPz1SjMEdUolK4c3Mx8MMjEHy8ZWTVs5XY+YybTlk606JGPAffiN PkAj17b4B6mUIBJPo8m12+VA2rgQDn4BvQ21g69SBXdT6gRR2ADETe0akXv8b+yzsS8+ qYeQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb20si761935ejb.685.2020.10.14.16.04.36; Wed, 14 Oct 2020 16:04:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388349AbgJNQ1Z (ORCPT + 99 others); Wed, 14 Oct 2020 12:27:25 -0400 Received: from netrider.rowland.org ([192.131.102.5]:35281 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S2388353AbgJNQ1W (ORCPT ); Wed, 14 Oct 2020 12:27:22 -0400 Received: (qmail 719448 invoked by uid 1000); 14 Oct 2020 12:27:21 -0400 Date: Wed, 14 Oct 2020 12:27:21 -0400 From: Alan Stern To: Thomas Gleixner Cc: LKML , Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , 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: <20201014162721.GE712494@rowland.harvard.edu> References: <20201014145215.518912759@linutronix.de> <20201014145728.318078828@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201014145728.318078828@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2020 at 04:52:26PM +0200, Thomas Gleixner wrote: > From: Ahmed S. Darwish > > The usage of in_interrupt() in drivers is phased out for various reasons. > > Various comments use !in_interrupt() to describe calling context for > functions which might sleep. That's wrong because the calling context has > to be preemptible task context, which is not what !in_interrupt() > describes. > > Replace !in_interrupt() with more accurate plain text descriptions. > > The comment for usb_hcd_poll_rh_status() is misleading as this function is > called from all kinds of contexts including preemptible task > context. Remove it as there is obviously no restriction. > > Signed-off-by: Ahmed S. Darwish > Signed-off-by: Sebastian Andrzej Siewior > Signed-off-by: Thomas Gleixner > Cc: Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org > > --- > --- 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. > @@ -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). > --- 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? Alan Stern