Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1237667pxu; Mon, 23 Nov 2020 15:35:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWHa1mffDF8JkTiI53uw41LkAAfFKpabBK/3l6mKgeYRPwWMax5b9gthu8tfYlulOj8dIp X-Received: by 2002:a17:906:1253:: with SMTP id u19mr1789640eja.288.1606174531290; Mon, 23 Nov 2020 15:35:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174531; cv=none; d=google.com; s=arc-20160816; b=m2E8nfZroaiov8UwbH+v3htD/LSuIJGNqwapwZdcpoGqY4T9R4oYRbqQgIN+f9fr3g tZxpkT0Z5FepKS6QCN6oBDpcJvfSjV0S5310dK9RF07AC4magN5GNd6pkliUrOrjhm6y 44Jncob8/CO57itRRu4XGccFsdi+w2bBg4pLDjm/N/8PVpVwFVCLVC+vVMBDRaTc6mw1 XHP6HKEnPCNH3YxUkfk6DoLzayqPf7oRqgkbqufTAuBXFHYjRapeFEjy3VQKE9X1ttQz G2BuUJ4HT7gKupdNm200eSLYo0Zk7cIK7BEjPjr/xz4r3SHzm69k7E2Sz0pBfjBS4YOh 5SpA== 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=eJ57b+++kuLErwuBpGElu6rkw9R20H/hcAqHQvMd70A=; b=Y1BSE3yjUcd/wucNmfyXlpftYSeOt8OLQNKVGgcNlUDI/D8d968RBFAQm5m36x9+JZ ZPsdMkBtCG/2G5AWsxTkKF3EZZOqHjaikbykf1/S/lUqblCSXwH5cC43gPkCCW3snWZ2 R4ZOAxlxdDOTkMQjZjsxOZ3kUe8Xz/Xc2lgGKaKCUI2a+Cf1ZXVEsn3n/Sv5FNG/66Q5 iwBu+/D8h44G891z6/VOSQj69dW6jOx2lqfYkzsodR/OFlI/t0u7AxIQl4NBHG8CweyC Z1zPk20L4D8lWx1Rp65Y03CFgnKxvUkXAK34HldmWQDhoA8hkQxxWKAVB+XmRRRjE/zO KRcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Rl+bz/54"; 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 a5si7501696ejs.534.2020.11.23.15.35.07; Mon, 23 Nov 2020 15:35:31 -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="Rl+bz/54"; 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 S1731205AbgKWMdX (ORCPT + 99 others); Mon, 23 Nov 2020 07:33:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:44272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730604AbgKWMdE (ORCPT ); Mon, 23 Nov 2020 07:33:04 -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 3C61020781; Mon, 23 Nov 2020 12:33:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134782; bh=GC0u43jDMd+oYqXZg0Rqvq7bb73dAQcDjjuq/lrF9js=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rl+bz/54TDsUAl3MVDKiiUDZiFm0fuAszHPCFBxRXGofHhz/T2GpUdf8wXbefUgJx zwRQ+XXvY0UK2beb0IdeapZaXp6ZtjzvuICour3OWOp4oFIwVBh5yrIdK/bBs8NlXT Wp2ppJX3/gGXTIOFRf/pc1htYKvke/MyjLh6R4Kk= 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 Subject: [PATCH 4.19 81/91] regulator: workaround self-referent regulators Date: Mon, 23 Nov 2020 13:22:41 +0100 Message-Id: <20201123121813.266386748@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@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 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 @@ -1598,7 +1598,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); } /*