Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2236177ybi; Mon, 1 Jul 2019 08:30:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5XBi8t/i8E5Wq8Eoe5m7LGl11vlMlDamAUOihmgdUXOhpb5Ml3VlMVsBZCehDwSbl4Zg4 X-Received: by 2002:a63:460c:: with SMTP id t12mr22406418pga.69.1561995016482; Mon, 01 Jul 2019 08:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561995016; cv=none; d=google.com; s=arc-20160816; b=EHWbZX0MeJ7XHnSvmm0Lez5lTeQe3tQwlvwHmk0uW5oaJcmiKa1Dj1cECJzv3dwg/v dHfgv0H0Q2iBG1znzv/Khr/OpaAZ6Al2+Dsw15izfBoYrgmPNpYm4gqdTJ6HmroZirWh k4oDetHBm6ms3DLucxLadWBhn1CLLHr1oiLZgO5PbKyu44pEvTq2UmqVKFpiyMth0uoy kfwGvQ1S37k7OfDiXC5076PfHqickyI2mZ3VhqeZbFkBn4gIxA4J8nv1KbEgeo4UdJw8 LJSM9jqbedZvV9+VU4eHQ2jJv4MT8mLTDO8/2pSZQuv6Wl2r0+A7VZ8vbV9NuOzq8Yyt yFjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=E67xAdHp26LwU+c1iTEXnaYektd/F2U/KXJpY6bkiWs=; b=tOHRGKvWRzHr8Z9Z2X4/RQQfEeAM8yWyWzeGj7TfND2z1nmGwPxy31zcS72+RVNFMd pp52q3qVs7KTIHenATEPgsbza0mZPZyOn2/KHu7/lBpP11GOKIKhlNyPP2RLbWpJWBqu 5rIAF78lGZPXBFYwLpvQJE8S74zBaqxHYfcSy9h38j+0GixZUW7gGzWAfdB4bDc5rdh7 7KeRZ5GXsQO3RLkedtTb7MmkrY+vgct+bwMQTnBN1X/s8PNEA8r4VK1SoKHQWFL1cBFU Dvh+zlfxY5JlF/w3zaZHKfYm+0XzkpvJ8M6R7dg25aVd4rG/BRFfR1U/hZRCSKtjHsi2 c+IQ== 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 m3si11283537pld.40.2019.07.01.08.30.00; Mon, 01 Jul 2019 08:30:16 -0700 (PDT) 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 S1729512AbfGAOUi (ORCPT + 99 others); Mon, 1 Jul 2019 10:20:38 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:51326 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729437AbfGAOUh (ORCPT ); Mon, 1 Jul 2019 10:20:37 -0400 Received: (qmail 1634 invoked by uid 2102); 1 Jul 2019 10:20:36 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 1 Jul 2019 10:20:36 -0400 Date: Mon, 1 Jul 2019 10:20:36 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: Tejun Heo , Kernel development list , USB list Subject: Re: [RFC] deadlock with flush_work() in UAS In-Reply-To: <1561978947.10014.12.camel@suse.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 1 Jul 2019, Oliver Neukum wrote: > Am Mittwoch, den 26.06.2019, 10:38 -0400 schrieb Alan Stern: > > On Wed, 26 Jun 2019, Oliver Neukum wrote: > > > > > Am Montag, den 24.06.2019, 10:22 -0400 schrieb Alan Stern: > > > > But that pattern makes no sense; a driver would never use it. The > > > > driver would just do the reset itself. > > > > > > Correct. But UAS and storage themselves still need to use > > > WQ_MEM_RECLAIM for their workqueues, don't they? > > > > Perhaps so for uas. usb-storage uses a work queue only for scanning > > targets, which doesn't interfere with the block I/O pathway. > > Are you sure? What about hub_tt_work? Technically speaking, hub_tt_work is used by the hub driver, not by usb-storage. :-) > As far as I can tell, hub_quiesce > will flush it, hence it is used in error handling. Yes, it needs to use a work queue with WQ_MEM_RECLAIM set. Unfortunately, I don't think we can use hub_wq for this purpose (we could end up with a work item waiting for another work item later on in the same queue, not good). Alan Stern