From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C5D3C433B4 for ; Mon, 17 May 2021 02:00:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52B00611C2 for ; Mon, 17 May 2021 02:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbhEQCBc (ORCPT ); Sun, 16 May 2021 22:01:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:39498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbhEQCBb (ORCPT ); Sun, 16 May 2021 22:01:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3F436109F; Mon, 17 May 2021 02:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621216815; bh=EnX+8Y6JrEMaUk8LyKbgbeZOzWeWSa6yVUdqKeblB2o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kX0V0QdDWn5/qx818FV/bZG89wPSVtcE4WxkYJZ0vY1lhMqgt/sUFeJGpGecToWDz y4f77TMHGNrsjhbSarIF2wKZf9+ICaOBFNAlzSh5c+0UnP5uqWeW5rWoITVkCzGN85 cH5U9MFwYeSJSWTHUHEuc/BYvNWugBGlAStefOLvfp2LIWCs80xen+WEr0TZaho+1M sZp9lrjUDNvJk9dNo9T2NsR/8BaM92DOh0TSeaL4m6BkfW8wcEnTnxLtI2A7cYPVkv CKRuOFuSfDwb8klSheNRZzQ0r3/mVVncHmNSU8xTcu7fuasvekfTwOIpNK9fkYz8g5 9dML1drlO7rJQ== Date: Mon, 17 May 2021 10:00:10 +0800 From: Peter Chen To: Alan Stern Cc: Felipe Balbi , USB mailing list Subject: Re: Disconnect race in Gadget core Message-ID: <20210517020010.GA28030@nchen> References: <87r1idfzms.fsf@kernel.org> <20210511212651.GA914027@rowland.harvard.edu> <87lf8kfnc6.fsf@kernel.org> <20210512153358.GC934575@rowland.harvard.edu> <87bl9d7oo0.fsf@kernel.org> <20210514165830.GA1010288@rowland.harvard.edu> <875yzk7b2y.fsf@kernel.org> <20210515153113.GB1036273@rowland.harvard.edu> <8735un6mjl.fsf@kernel.org> <20210516145151.GC1060053@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210516145151.GC1060053@rowland.harvard.edu> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 21-05-16 10:51:51, Alan Stern wrote: > On Sun, May 16, 2021 at 12:43:58PM +0300, Felipe Balbi wrote: > > > > Hi, > > > > Alan Stern writes: > > > > > > If it's okay to call those functions in interrupt context then the > > > kerneldoc definitely should be updated. However, I don't see why you > > > would want to make DELAYED_STATUS mandatory. If all the necessary work > > > can be done in the set_alt handler, why not return the status > > > immediately? > > > > because we avoid a special case. Instead of having magic return value to > > mean "Don't do anything until I enqueue a request" we can just make that > > an assumption, i.e. gadget driver *must* enqueue requests for data and > > status stages. > > Okay. But that would require auditing every gadget/function driver to > ensure that they _do_ enqueue status stage requests CDNS3 UDC doesn't enqueue status stage by SW, instead, SW tells HW to do it by setting registers. -- Thanks, Peter Chen