Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp46537pxa; Mon, 10 Aug 2020 18:11:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6ReMSg7hNmA0wO7hTi39AU9D+c97uYm1Y1pqasqjSWfmqa9JMjz1ZLi3aIkrYhZ0XvsqD X-Received: by 2002:a05:6402:b32:: with SMTP id bo18mr24001554edb.201.1597108305466; Mon, 10 Aug 2020 18:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597108305; cv=none; d=google.com; s=arc-20160816; b=UeQaSfJxeJCFWG6E5blPGjMpjjKalUihIASVuBXvBdP97FmYPpAKe5VyCpRJe9Of4D JLX+Iz6cq4a+e/5FI4+gKsitfywEXOZSfSrspN0BAaEPdmDcdD/uqmENCW83L14FTnwc xTkJOJJBX2q2IIE16Fdsz0/1ar0i9h+yYBCnczYEx1VOQQSQ1p92DmLUOA57Ak8fBzD/ i2Cw53k7rBI14bBOR1tOWDXmJrFtpM9odwEcS0ipwclDZmUAiMs+JDqRBd3iCxzunVxF BzTuIb27Ju6NhkUKf/afa3HAfSC4iWneovwBdyKnY4ejqr1ZFuuZdsNjl5iXqlWRSDmu b9wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:content-transfer-encoding :mime-version:subject:from:message-id:date:dkim-signature; bh=o3ClSoqUcUyo/aBbB/PYENWu0HDIW3kj1DSaAF7tGic=; b=VmEpOFrp8u3SI+wWKi2+oQ5nFh/uX7iiE2EX55TkHlqwTEpT/Jbv8hIm6H0dzbnMgb u+WF5GlPHZlRcn2U5TX/TSWseL4TqOfObi8zH5dc7l8OHU1aG0ri6EY1w5+QmOGpwtlV iqXTMYyVSA3J07PnX9eLDBwRnyeNt20UqHfOV6EWTpeqrrPqEvk6t3qtFyaPLW+FzTdI 6cuKpzaJr51rNqJra/ePa2lfAP2rKo5qMi8oqkk/Q1O7gavPnsyvW+6dRIvFdQKmU9y2 Hagbezs2dN5MqEl6q0ZmsPSCNYw+7sbLVty/7L5GjS5IWPUyImgbpiHO672Q2vfe8LuS ylgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=AxIyVi7H; 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 oy7si11942155ejb.534.2020.08.10.18.11.19; Mon, 10 Aug 2020 18:11:45 -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; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=AxIyVi7H; 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 S1727929AbgHKBHk (ORCPT + 99 others); Mon, 10 Aug 2020 21:07:40 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:11787 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727793AbgHKBHj (ORCPT ); Mon, 10 Aug 2020 21:07:39 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4BQZST3tp3zL3; Tue, 11 Aug 2020 03:07:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1597108057; bh=9e3feEKulY/dNznrJIBuGuIp9LBvzdzl+EChhD0C2kw=; h=Date:From:Subject:To:Cc:From; b=AxIyVi7HtkOc4TumEdGJc61VbVulfdxMr4feWkRNP/AyASxPaktt1qcgNVDefzcx3 R4PWA0h2ZLP+qmHyJT3LBLM6PCC22DLSg6XM8EsiPwdJAvceZ+o/VFsyml2Lmtd1Lg r7roQig0WT82jnFJBi4DBp2lQFWhzIh7eetTKj7XdyfMTBdLvUZaDLkq5ECs5n/IOu CQBKEXPhmcoye9GMzdCLs1opaINPLTOOr3hFaS8nF9irQXJE3zq4k9ti/N4z9dIMVG 10X13MjPrOMeTM1F717pOBVuftg00gGzKqCjKWXrvEngqswo4OtSVRF7kwJisxXJx1 0urYqXD6lr7Vg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.4 at mail Date: Tue, 11 Aug 2020 03:07:34 +0200 Message-Id: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH 0/7] regulator: fix deadlock vs memory reclaim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: Dmitry Osipenko , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Vladimir Zapolskiy Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For systems that have eg. eMMC storage using voltage regulator, memory reclaim path might call back into regulator subsystem. This means we have to make sure no allocations happen with a regulator or regulator list locked. After this series I see no more lockdep complaints on my test system, but please review and test further. First four patches move allocations out of locked regions, next three came as a drive-by cleanups. Michał Mirosław (7): regulator: push allocation in regulator_init_coupling() outside of lock regulator: push allocation in regulator_ena_gpio_request() out of lock regulator: push allocations in create_regulator() outside of lock regulator: push allocation in set_consumer_device_supply() out of lock regulator: plug of_node leak in regulator_register()'s error path regulator: cleanup regulator_ena_gpio_free() regulator: remove superfluous lock in regulator_resolve_coupling() drivers/regulator/core.c | 162 +++++++++++++++++++++------------------ 1 file changed, 86 insertions(+), 76 deletions(-) -- 2.20.1