From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757903AbcBXH25 (ORCPT ); Wed, 24 Feb 2016 02:28:57 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:35553 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757625AbcBXH24 (ORCPT ); Wed, 24 Feb 2016 02:28:56 -0500 Date: Wed, 24 Feb 2016 15:24:30 +0800 From: Peter Chen To: Alan Stern Cc: tj@kernel.org, florian@mickler.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, usb-storage@lists.one-eyed-alien.net Subject: Re: Freezable workqueue blocks non-freezable workqueue during the system resume process Message-ID: <20160224072430.GC15452@shlinux2.ap.freescale.net> References: <20160223032056.GB12256@shlinux2.ap.freescale.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 23, 2016 at 10:34:09AM -0500, Alan Stern wrote: > On Tue, 23 Feb 2016, Peter Chen wrote: > > > Hi Tejun Heo and Florian Mickler, > > > > I have a question that during the system resume process, the freezable > > workqueue can be thawed if there is a non-freezable workqueue is > > blocked (At uninterruptable state)? > > > > My case like below, I have a USB OTG (Micro-AB) cable is at USB > > Micro-B port, and there is a USB driver on it, and un-plug this > > cable can wake up system from the suspend. There is a non-freezable > > workqueue ci_otg will be scheduled after disconnecting OTG cable, > > and in its worker ci_otg_work, it will try to disconnect USB drive, > > and flush disk information. > > These operations probably are not safe while the system is resuming. > It might be best to make them wait until the resume is finished. > > > But flush disk information is done by > > freezable workqueue writeback, it seeems workqueue writeback is > > never got chance to execute, the workqueue ci_otg is waiting there > > forever, and the system is deadlock. > > > Both change workqueue ci_otg as freezable or change workqueue writeback > > as non-freezable can fix this problem. > > It sounds like making ci_otg freezable is the easiest solution. > > > Please ignore it, the system is locked at driver's resume, > > maybe at scsi or usb driver, so of cos, the freezable processes > > can't be thawed. > > > > [ 555.263177] [] (flush_work) from [] (flush_delayed_work+0x48/0x4c) > > > [ 555.271106] r8:ed5b5000 r7:c0b38a3c r6:eea439cc r5:eea4372c r4:eea4372c > > > [ 555.277958] [] (flush_delayed_work) from [] (bdi_unregister+0x84/0xec) > > > [ 555.286236] r4:eea43520 r3:20000153 > > > [ 555.289885] [] (bdi_unregister) from [] (blk_cleanup_queue+0x180/0x29c) > > > [ 555.298250] r5:eea43808 r4:eea43400 > > You might want to complain to the block-layer people about this. I > don't know if anything can be done to fix it. > > Or maybe flush_work and flush_delayed_work can be changed to avoid > blocking if the workqueue is frozen. Tejun? > I have a patch to show the root cause of this issue. http://www.spinics.net/lists/linux-usb/msg136815.html -- Best Regards, Peter Chen