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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 60523C47083 for ; Fri, 4 Jun 2021 05:19:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E11E61411 for ; Fri, 4 Jun 2021 05:19:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229800AbhFDFUq (ORCPT ); Fri, 4 Jun 2021 01:20:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:38126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbhFDFUp (ORCPT ); Fri, 4 Jun 2021 01:20:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8F88C6140C; Fri, 4 Jun 2021 05:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622783940; bh=ONqzTmF2TKNKpTt2q+hFIF9FuwLq2RcU7s8ak7La8Jo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Ywe3k4GGhh+jrD6XrYE7TENci9+SCBcL53Ja9ynyLxj8odUWd0PjyFg/PDoVFEQJX Pu3vjk3XVnCiGBl/nvy2QtwYFaIEgWgHcV3TJUy8R8fazTvzK8i7ANJb8QYkLQLHDQ EHurzq67+4ejlKF2PHNZRBAy0upy+1UnNouWuSGdwlC6qplGVeT9P1VZAfqvyzAYzc S2xhwmBcQmncrGJ5KwzWZeajDhmloI292jvK7CkKTZACuhYVMmL194pqfujJessaL7 LQzIu1EXYRBfh6BP5SLKhVE1I2HOTlEgOeShUoLYJmgrBr0hOLK2APMvoe5JUOyA9Y H/LfsBKdP1GgA== From: Felipe Balbi To: Alan Stern Cc: USB mailing list Subject: Re: [PATCH 1/4] USB: UDC core: Add udc_async_callbacks gadget op In-Reply-To: <20210520202144.GC1216852@rowland.harvard.edu> References: <20210520202144.GC1216852@rowland.harvard.edu> Date: Fri, 04 Jun 2021 08:18:53 +0300 Message-ID: <87y2bqb41u.fsf@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Alan Stern writes: > The Gadget API has a theoretical race when a gadget driver is unbound. > Although the pull-up is turned off before the driver's ->unbind > callback runs, if the USB cable were to be unplugged at just the wrong > moment there would be nothing to prevent the UDC driver from invoking > the ->disconnect callback after the unbind has finished. In theory, > other asynchronous callbacks could also happen during the time before > the UDC driver's udc_stop routine is called, and the gadget driver > would not be prepared to handle any of them. > > We need a way to tell UDC drivers to stop issuing asynchronous (that is, > ->suspend, ->resume, ->disconnect, ->reset, or ->setup) callbacks at > some point after the pull-up has been turned off and before the > ->unbind callback runs. This patch adds a new ->udc_async_callbacks > callback to the usb_gadget_ops structure for precisely this purpose, > and it adds the corresponding support to the UDC core. > > Later patches in this series add support for udc_async_callbacks to > several UDC drivers. > > Signed-off-by: Alan Stern Thank you for working on this, Alan. Acked-by: Felipe Balbi =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFFBAEBCAAvFiEE9DumQ60WEZ09LIErzlfNM9wDzUgFAmC5t70RHGJhbGJpQGtl cm5lbC5vcmcACgkQzlfNM9wDzUj91Af/cisNEgAuKdLLaZah3VNIB3B//gFq2Euf J6sGWPznwgS0Of/qxI9Fd/UW9EP5+qhbxzDabUnpe1JqtjhoIli67G7d5h2v21Pu q0s01DAf6moeW3LBGEAo9cj89aZYZkLbYzbSZpYcGdbXqC7dGdCZroAVHrQgPjxu Jyzu3kiULaAOEM0j1nPtlD5eesxYiYzZ3il3vqf4mPe5DMojs4Og9ADRkw5YhPAF Y27s6i86d5bVGW/OoPJYReH0WN838lf26UkIckGGYqFJdXLw4uX/YM+lGQ4Fsv9H ANOYlXnpg1qzmkeQJBAj89gPrbrE3Dov/u8pLunVjBbZoymtZcofxg== =glgX -----END PGP SIGNATURE----- --=-=-=--