Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1251145ybv; Sun, 23 Feb 2020 02:34:36 -0800 (PST) X-Google-Smtp-Source: APXvYqx77T1R5QcuXvWm++yJMvWeRw1IcuOagqzb4XjiLaeFDcrZEwQMGVl3QOaXWqLS8oFFJ/y7 X-Received: by 2002:a9d:7305:: with SMTP id e5mr34377805otk.64.1582454076292; Sun, 23 Feb 2020 02:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582454076; cv=none; d=google.com; s=arc-20160816; b=VMWJozy8/UzDJ1l1e/9VO1BQQb6C02qzfiBc8nx7dpsKmFbgQgUrIT0pOQUxTH5jHk Mh2jBA5XOXmKXaisKE9C04tTz1bUWRKRrXVAJc+2bYLAegxqAgMgDOAGApCNEIJuJl1P ZGV+1tVJs65pmC5dtAmo257soupZB88SqmMMQ8eBVtexrCiBXNRhl84alV1h2AOsYNt6 Nxq0FP7Klu4u1a3uEBsguXUxHfmDGUua4+Cj1j9PbMYr4dbkxB4TZNyNTRY5YmW8NEqZ sj1+/qZlyXb93Wr88GyCgBmzdEF6a8Tvs1XtswcreIYNZ5ppdTgzAJ6JFdeooGfEugLZ Yfsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NUvAvoFHbJ5W7GwZUKphA0/zHat86l+pmyIXOeha7hA=; b=0LlhGRH12FkVe4pwKHzaYbgVY83D02lEaeGtmATDF0Y6N94Pw0Xg/jHfmdgwr7EdIw tfPlRLSRICtYZTLsbrl55t0914DKMyhVMWH0FLhBKLrGsnnr/nPUIEPypAkzm2/mZ//B uXWhyW4q1Jl9d9wZ8DIJhywBpP8SL60VcMdpbnjEu23VtzwgOkPuV1s1MyP7ANw0A+0b tLow3J5NIyKQ64hxNWR0AbzZGxJnRYPe7OdHxQd/ahtbwFY37g5bAwVuRaBP2CLpRLn4 1uuIjA5kGxAQ/MmPzJQ4Z4BKFKmEFCYO4MhbCpUiZO6pGlAuNN0KpLlyD2VknM/DCJ4/ 3R9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si4908134otd.219.2020.02.23.02.34.08; Sun, 23 Feb 2020 02:34:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726748AbgBWKd0 (ORCPT + 99 others); Sun, 23 Feb 2020 05:33:26 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:58620 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725980AbgBWKd0 (ORCPT ); Sun, 23 Feb 2020 05:33:26 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 991AF1C036F; Sun, 23 Feb 2020 11:33:24 +0100 (CET) Date: Sun, 23 Feb 2020 11:33:23 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jia-Ju Bai , Felipe Balbi , Sasha Levin Subject: Re: [PATCH 4.19 032/191] usb: gadget: udc: fix possible sleep-in-atomic-context bugs in gr_probe() Message-ID: <20200223103323.GD14067@amd> References: <20200221072250.732482588@linuxfoundation.org> <20200221072255.095987384@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9dgjiU4MmWPVapMU" Content-Disposition: inline In-Reply-To: <20200221072255.095987384@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --9dgjiU4MmWPVapMU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Jia-Ju Bai >=20 > [ Upstream commit 9c1ed62ae0690dfe5d5e31d8f70e70a95cb48e52 ] >=20 > The driver may sleep while holding a spinlock. True, but you can't just fix that by removing the locking. > +++ b/drivers/usb/gadget/udc/gr_udc.c > @@ -2180,8 +2180,6 @@ static int gr_probe(struct platform_device *pdev) > return -ENOMEM; > } > =20 > - spin_lock(&dev->lock); > - > /* Inside lock so that no gadget can use this udc until probe is done */ > retval =3D usb_add_gadget_udc(dev->dev, &dev->gadget); > if (retval) { As this comment tries to explain. It is possible that the comment can just be removed, but it looks like the code needs to be rearranged so that rest of system does not see partly-initialized device. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --9dgjiU4MmWPVapMU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl5SVPMACgkQMOfwapXb+vLO7wCePfBiWkxUG6iwBB+/Zrtrmnaq 9GsAnibVRvR1tYRkGwmR5Die/TAMKTeg =eY8A -----END PGP SIGNATURE----- --9dgjiU4MmWPVapMU--