Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4292979pxu; Tue, 1 Dec 2020 01:02:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxexwkCGLOYMK0fOSwTFsGvqmHbfvQxK/o0byC+vi9U7Vd8E5N5L5zvYE1ZKUa56a7Qb0Yu X-Received: by 2002:a17:906:94ca:: with SMTP id d10mr1932301ejy.62.1606813321006; Tue, 01 Dec 2020 01:02:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606813320; cv=none; d=google.com; s=arc-20160816; b=VR8//U2BFzOle1wY7S2D0eibD1Rhp57qWR+PbDyf9mDjIunRKzY+CFnwwH4bcWaelO YduCpH383o/xPZUeZRt8X7nPfbCZrdAqIy6siQWQZS0eVo6dQmBNrtuWaUg5jK4CnvQV rNATuKi9NUfiJay95+WR90j0r9MqHi8moRcbA5C7r0XVPYvShkRTjqnjv5ZVJXcjnlum Gkt21c+O72u+tRGuOZ154ZRS1zx25Ztjz5eFFmb3JQflVtIG8NPVZOUY06KLsfSmXnKp 4GPB1kMPvfTAvA9FSCZ8FXWj3LWJ0Po7GAgaNuPG5Q9dDBTufqGmVXp3sWQMsBy7CO2k KF1g== 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=pPZpmLqZ4pakoctxhiL8jJ1bvE3m748YIDRaerKZxVM=; b=0BJqA5+PRBYfcznreXqFJMdgJwkY0zrtS0qba3GsffYcAg79ZgaHmgpzCkdgS56L1f 3ObTIPdz9vNaIaha7G1vXynIEfElnRi5xKuvY3WaULzgY8yscuh71f8fnrNrfjpZyEZt w9FmIomEctQmsioxuAW9be6CmlL1xdbabQqkuuxPIdotuUhfisj3fyZ7PVTA731PO7FQ aDp/GgOp5BLQYfeqiHKzWwQDNNjGAYWnj/SVT38xQRuJcI6xIx5Hr/Uf0s3JtS4Z+cyd l4f5u+aG25//vM3jtdtnwBGNudALzUIP8iuGHcbqknC9gpOwWHu/0wmMpIZQaIbgQ0Es VvFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xmqs6oBr; 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; 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 go10si557579ejc.656.2020.12.01.01.01.38; Tue, 01 Dec 2020 01:02:00 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=xmqs6oBr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387767AbgLAI5E (ORCPT + 99 others); Tue, 1 Dec 2020 03:57:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:60202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387762AbgLAI5B (ORCPT ); Tue, 1 Dec 2020 03:57:01 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67C1C22250; Tue, 1 Dec 2020 08:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606812975; bh=RPqcXIlDlB+4+RN1b9MSkZEsEpMrhpb438RyuRLWWM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xmqs6oBrxsWC01OvTB6m+x0NMifsGVbOSZz5EafaK6jkeiyg0vIMCSzVbZEKG2/GW nsbvSML6lmC92TbVlD7F2Z+i/LrQ1vaIwlr2CeO4zFw7n8Vl/wvFg/kUopyd8AfDA+ YE80QHj27dvy/z2zCBcSM4XJ3gi0mBE2Mg7gRf+A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ahmad Fatoum , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Mark Brown , Sudip Mukherjee Subject: [PATCH 4.9 40/42] regulator: workaround self-referent regulators Date: Tue, 1 Dec 2020 09:53:38 +0100 Message-Id: <20201201084645.890848252@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084642.194933793@linuxfoundation.org> References: <20201201084642.194933793@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Michał Mirosław" commit f5c042b23f7429e5c2ac987b01a31c69059a978b upstream Workaround regulators whose supply name happens to be the same as its own name. This fixes boards that used to work before the early supply resolving was removed. The error message is left in place so that offending drivers can be detected. Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator") Cc: stable@vger.kernel.org Reported-by: Ahmad Fatoum Signed-off-by: Michał Mirosław Tested-by: Ahmad Fatoum # stpmic1 Link: https://lore.kernel.org/r/d703acde2a93100c3c7a81059d716c50ad1b1f52.1605226675.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown [sudip: adjust context] Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1553,7 +1553,10 @@ static int regulator_resolve_supply(stru if (r == rdev) { dev_err(dev, "Supply for %s (%s) resolved to itself\n", rdev->desc->name, rdev->supply_name); - return -EINVAL; + if (!have_full_constraints()) + return -EINVAL; + r = dummy_regulator_rdev; + get_device(&r->dev); } /* Recursively resolve the supply of the supply */