From patchwork Mon Jun 14 10:27:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 459813 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3175545jae; Mon, 14 Jun 2021 04:05:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfkl7h6qYYfMhJ4U26vaeBJpRcXiB94NOVr+Nf0Xf4st6PLjM1jFEa0JCK5RVIp8prmlRS X-Received: by 2002:a17:906:2988:: with SMTP id x8mr14996119eje.122.1623668732459; Mon, 14 Jun 2021 04:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623668732; cv=none; d=google.com; s=arc-20160816; b=sE/Z6AQ7VeFyBxw8DfJX2jgAmqTSfe7matzGOh4qeP3S3zr+Q6Zr4LGp0GCCselUDH QnjCowyrUJEohTp7Guc1Uq91t1VZ6qnXdvwvkoOb4Fp4D1lzhYyly5tZHdxsHb5mjtPW sf+m0Uxq/Fc4A+1rxAjLXkONjrDbrQC5zgvfLgz6/rbR9lWWeIkKOze4xCMQ2Cg0gAYh HurYg6VsIp2lP9ZqPA3PJ6koMcLC3g+eqxcGbOvnmv7FNg+NKOsidGyq0K1xcC7bcsxF oJsLA3pDZwF0JknqolB7nGy6OZ6h0O0jmc9zZwJPuO0oViHx+0s3OBAAPKl5RilcojSN ry+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+kZqBSO2FWJvhZM9hfDXzBOgiHcbokPP5VOJX9c/JhU=; b=0HbtWDhVabsglCktEIswAdI+H5jBoeF+8VCTYZoEkJPCLD/KQ2o4U/GwjLz4gPPHtG 69FDo31ifexmOGuNbze0J5X1K9eAnyvhFH62UKjjZExVCt03camgrqw1EC7KpLhqMjh/ fRkcATafMOrewsVDy8V2X9AYV+FiFS0DVWWVJl1loAF7F6AQvQg4l7Pflg67Ws1YYvif 565mbAliumTiKS2AseRfiy6PMjJImoUS4IG7DD6KtwPzBfAarNhjDZfjzGKa8ALo/y82 RnWKKWPtnmN+tdr0HSpDYtxxzs7rIFBgJPKMSPcIV+JBg/vkDCoxK6Jc7KVPanHZ3E40 bWaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S7zlX1it; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si11050174ejo.739.2021.06.14.04.05.32; Mon, 14 Jun 2021 04:05:32 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=S7zlX1it; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234987AbhFNLGz (ORCPT + 12 others); Mon, 14 Jun 2021 07:06:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:39870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235157AbhFNLEz (ORCPT ); Mon, 14 Jun 2021 07:04:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B24C56188B; Mon, 14 Jun 2021 10:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667484; bh=uOuAHXP9EQLyzOxXuegsg55MUjHHW5Q0Wdl/IVh8Eok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S7zlX1it1S5ENJKdZeCBq41kMRwQO2Dob4gnkwZQxEgz/8l7BmzdsGh22cKqjzyL0 nIDyxQ4wgANneyiLlhk0m2Gk8yukRvBJWCLQDJvruZySGMzZfy1MCCbqy1hJsyw7w9 x7jUIxvS2qA+NPHQuRxK/P8o06c8GSDSa2yfY7uw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Baryshkov , Mark Brown Subject: [PATCH 5.10 090/131] regulator: core: resolve supply for boot-on/always-on regulators Date: Mon, 14 Jun 2021 12:27:31 +0200 Message-Id: <20210614102656.054900874@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102652.964395392@linuxfoundation.org> References: <20210614102652.964395392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dmitry Baryshkov commit 98e48cd9283dbac0e1445ee780889f10b3d1db6a upstream. For the boot-on/always-on regulators the set_machine_constrainst() is called before resolving rdev->supply. Thus the code would try to enable rdev before enabling supplying regulator. Enforce resolving supply regulator before enabling rdev. Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210519221224.2868496-1-dmitry.baryshkov@linaro.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/core.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1422,6 +1422,12 @@ static int set_machine_constraints(struc * and we have control then make sure it is enabled. */ if (rdev->constraints->always_on || rdev->constraints->boot_on) { + /* If we want to enable this regulator, make sure that we know + * the supplying regulator. + */ + if (rdev->supply_name && !rdev->supply) + return -EPROBE_DEFER; + if (rdev->supply) { ret = regulator_enable(rdev->supply); if (ret < 0) {