Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp193521ybj; Wed, 6 May 2020 15:01:52 -0700 (PDT) X-Google-Smtp-Source: APiQypK3vEGQijaTByo0AFPfYNeOCzlbkQ3nDSOw3zsKEkzqbHg5MUtnuJb9o0QRYsRK9arMNwAA X-Received: by 2002:a17:906:ca49:: with SMTP id jx9mr9111448ejb.246.1588802512093; Wed, 06 May 2020 15:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588802512; cv=none; d=google.com; s=arc-20160816; b=IA185ONLjPKHNsQRgYD73IrEUs2Q+ErXlzhXKPDD3pQJdeCX9zYalnHJn8/vJFn3gZ nGEmdRLIdc0sAQBVmzNSfRKh1BcPDByvLSD2aHJoazivcqY8Z52mi8Gz76TmDPTsSXJG pYobxPEJAjFz9XWbfA+aHPxMtjezQaAF7tQFCBdpWeTtvMgYl0hNF2hJdlTL6MhcK9LL 1YeyxCIUldXekywvYdzPhNhQcs/CBcKxK/fE3MgqU2qHq/RR4ajkPZm6WwT60FcTKOg5 ZDiu/bYCEv+NeD69R0TIlYmwnOLsfQZpp5k1/IT5HcDf3QVt3hNIwx/4MbH4HhcV0dg7 1N2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=D3HLAmhleMVlXboeN/ESZ9LiI7X6UcD6sdwQl/S4L9M=; b=bwTDKbnVkHHp4V2a5ajUczdraRPMqX7Hjbfu03S1yZewK3SfpeK/cGKMB7LT9ot0E5 yaBp6X8OgtA/I7VBIxEmm2pKvKJKThNoKcZyWrF5PmeqgC0PuvoIY6yOnRRwe2UyPZAf Q8dxdC4+lE7YiBIxme1m1glqtIifYKyqzf5vRmamAeL8+hAmKl2SE1WsmhqgVhp04OVB fc46JGC34257gbnwIc24N2b94PbbJ5QGaA4keHub1rpLGTd2hFbU4bLE3N1sXELgyJc3 piCRnzqgQ+w8KqC6JbhNym8md11ryrOYA+HglvKcHt59y0gt3M7JQB89iLzhQQRh4AvW 8lbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si1719137edh.318.2020.05.06.15.01.27; Wed, 06 May 2020 15:01:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729654AbgEFV5P convert rfc822-to-8bit (ORCPT + 99 others); Wed, 6 May 2020 17:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726927AbgEFV5P (ORCPT ); Wed, 6 May 2020 17:57:15 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD95C061A0F for ; Wed, 6 May 2020 14:57:15 -0700 (PDT) Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1jWS2T-0004iz-5R; Wed, 06 May 2020 23:57:13 +0200 Date: Wed, 6 May 2020 23:57:13 +0200 From: Sebastian Andrzej Siewior To: Stephen Berman Cc: Thomas Gleixner , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: power-off delay/hang due to commit 6d25be57 (mainline) Message-ID: <20200506215713.qoo4enq32ckcjmz7@linutronix.de> References: <87bln7ves7.fsf@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <87bln7ves7.fsf@gmx.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-01 17:46:48 [+0200], Stephen Berman wrote: > I'm experiencing a delay or hang in powering off my computer after `halt > -d -f -i -p' and I've bisected it to this commit in the mainline tree: You refer to a normal "poweroff" or is this some kind of "shutdown now" kind of thing? Unless I'm mistaken, the `halt' command above will turn off the machine without stopping user tasks (as in "reaching shutdown level"). … > The delays have varied in length from ~20 seconds to seeminingly > indefinitely long (the longest I've waited before pressing the start > button on the machine is 6 minutes). With kernels prior to this commit, > my machine powers off within 4 seconds after the halt invocation. So you say that normally the machine shuts down immediately but now it takes 20secs+ if it shuts down at all? … > sr 5:0:0:0: tag#21 timing out command, waited 120s The CD-drive is polled regularly so it notices when a CD us inserted / removed. It seems that one of the requests wasn't answered and it ended up in timeout. … > minutes. But after running emacs in a tty (and then killing it), the > delay was seemingly indefinite, as it is with my usual workflow with X, > emacs, firefox, etc. running (but I always kill them before invoking > `shutdown -h now' from a tty). During the bisection I tested each > kernel build by running startx, emacs, firefox, killing these, then > `shutdown -h now'. I've attached the git log of the bisection augmented > with power-off timing notes. (FWIW, when I reboot the machine with > `shutdown -r now' there is no delay with the problematic kernels.) So reboot is not affected, just the halt. Could you please check if the "poweroff" variant is also affected? … > Another pointer I got was to the recent commit 62849a96, which fixes a > bug due to the commit that causes my problem. I applied 62849a96 to > 5.6.4, but it did not prevent the delay/hang. You should see a warning if you were facing the problem described in the commit. … > Please let me know if there's any > other information I can provide or anything else I can do to help with > debugging this issue. I hope you can fix it. Can you send dmesg output of the system / lspci -k? I'm mainly interested what drivers are bound to storage devices (you can send it offlist if you want). Can you log the output on the serial console? If the commit you cited is really the problem then it would mean that a worker isn't scheduled for some reason. Could you please enable CONFIG_WQ_WATCHDOG to see if workqueue core code notices that a worker isn't making progress? > Thanks, > Steve Berman Sebastian