From patchwork Mon Nov 2 22:03:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 55913 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp1507929lbr; Mon, 2 Nov 2015 14:03:18 -0800 (PST) X-Received: by 10.107.1.216 with SMTP id 207mr28611270iob.167.1446501798779; Mon, 02 Nov 2015 14:03:18 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ax3si13739418igc.53.2015.11.02.14.03.18; Mon, 02 Nov 2015 14:03:18 -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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752236AbbKBWDQ (ORCPT + 28 others); Mon, 2 Nov 2015 17:03:16 -0500 Received: from mail-ig0-f177.google.com ([209.85.213.177]:35498 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751407AbbKBWDP (ORCPT ); Mon, 2 Nov 2015 17:03:15 -0500 Received: by igpw7 with SMTP id w7so67349995igp.0 for ; Mon, 02 Nov 2015 14:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=asjW1OQ/pwfrd1ZK2fs8BLCG9DDrgM+O3TnR7eKHq34=; b=RlGZvNQP0uY2cqsbM7oFYH7F0ZgJkFr4bnYq6OT1zPUOX7JeCJ6+vL7YClPKQchZ/J rbfkd29qKnJF1HXEIZc/q8q3+ZOR2Hy99PhAHfY+eMDNRsRBpPmTwR1C05kjSGFjOkz7 tCuoz40Hl+T8KWjOvct+4IXe3MmgHsXaG7tZpiF5MwY07IqRmR+Ca0Gu2QR9W9LShtpn wbYt5EB9/uyjyb6snHBefUCaHEPqpp2G2vzdIbhLClmpWzOZAQINB3OeaEFiLEVihKyV WBn7Krq3sCobbs+dgBqWwOAYjx6mvtaFtQjV9ZUSOSdMaUAIMs/+lAGijafrC57JL6MH OWow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=asjW1OQ/pwfrd1ZK2fs8BLCG9DDrgM+O3TnR7eKHq34=; b=CzkvyCjxxsIKmshvzxPRc1kmw3ZbheKNSTGwzJ0gVrNpnr7A8zd3AK0ew2JJNnSkly QLumEgFrPHA+G5SOR0JWddhIaOvOFnHL9Q92jiLZhxWao61lvUIVPRnwQP8W9yXCmEoh I/QxtleDKjyM8um8WzJXZ2bJLG3yZo4DPMBrNbA1TiQGmsDxbc1KzgNLN3PTIi4yyVa1 0akdLx0LJK3k0jzpNttpkt/AwN4iFSUs/MG+Ra4RIZRGkeaJca/opvhB28qXHfUs8780 JWTlDwwKULpYOWkBBY/OQ3oX8xumg5/ocpqLAQWfcKLqNpDX6xRcZw822gQ8Z57Pyimy 3mPg== X-Gm-Message-State: ALoCoQkCa0Wpl0SKmwFJ9IWLITZTVJkErsrBuwJoLniULpnR7liHP7kcVywVbRVwsgsQr5Pn4QSt MIME-Version: 1.0 X-Received: by 10.50.62.148 with SMTP id y20mr12967600igr.80.1446501794231; Mon, 02 Nov 2015 14:03:14 -0800 (PST) Received: by 10.50.242.3 with HTTP; Mon, 2 Nov 2015 14:03:14 -0800 (PST) In-Reply-To: <20151102204620.GF24668@usrtlx11787.corpusers.net> References: <20151102204620.GF24668@usrtlx11787.corpusers.net> Date: Mon, 2 Nov 2015 14:03:14 -0800 Message-ID: Subject: Re: MMC/regulator boot hang in -next From: John Stultz To: Bjorn Andersson Cc: Sascha Hauer , Ulf Hansson , lkml , Mark Brown Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 2, 2015 at 12:46 PM, Bjorn Andersson wrote: > On Mon 02 Nov 11:57 PST 2015, John Stultz wrote: > >> Trying to move my nexus7 work to -next, I started seeing boot time >> hangs. Enabling some debug options provided with a lockdep spew. >> >> Reverting "regulator: core: Propagate voltage changes to supply >> regulators" - fc42112c0eaa avoids the hang, but I still see lockdep >> noise. >> >> Full log of -next based tree without any reverts follows: > > It sure does lock like a deadlock to me. Can you figure out which > regulator we're talking about here? And confirm that this is 8064 we're > talking about So it looks like we're setting the voltage on lvs1, which then calls get_voltage() on s4. At that point the lockdep spew hits. But as Mark noted *this* spew looks like a false positive, but I suspect lockdep is then disabled and can't detect the real hang happens shortly afterwards. The key bit needed to revert to get things booting for me in fc42112c0eaa ("regulator: core: Propagate voltage changes to supply regulators") is (sorry, copy pasted text here, apologies for the whitespace damage): Might the problem be here that we lock the supply in set_voltage, then if we call _regulator_get_voltage on the supply later, we try to grab the same lock and we're stuck? thanks -john -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2952,11 +2952,12 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) { int ret = 0; - regulator_lock_supply(regulator->rdev); + mutex_lock(®ulator->rdev->mutex); ret = regulator_set_voltage_unlocked(regulator, min_uV, max_uV); - regulator_unlock_supply(regulator->rdev); + mutex_unlock(®ulator->rdev->mutex); return ret; }