Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177AbbKBWDQ (ORCPT ); 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 MIME-Version: 1.0 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 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2070 Lines: 58 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): --- 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; } 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/