Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4580300ybv; Mon, 17 Feb 2020 01:50:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxZIYArMS7L/Z6AejCFGjVtqZp5mS9+D4/3f+B5a+GfGKaJxVlGHAVaT2N4oYryejN9eXhU X-Received: by 2002:aca:3805:: with SMTP id f5mr9378063oia.6.1581933031064; Mon, 17 Feb 2020 01:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581933031; cv=none; d=google.com; s=arc-20160816; b=WMisO0CfVqEutP8X/LNalM61uiTdJBHFoFYSRNGQauELx3Ynq/zxOjoZ2qBgVDY1hL hoNjbVx8xgWYyVHOXe0FyiOW9qIAN2SRqhNUrsjPvy/v/r9e208R5fr1HFjofuQagdAD J1FnNhd2gtvAVTgl1Wv0/FQdtPt+0QtyooQeX8tAtbmUTf9QRp34KvugPNi+aR2O5BjZ fjf31s/sA3BQIrmcqkIPECSz5I6qxmxDG3DVVN7tTvj/jZwiLCjnTPWKNO0fAGzoJDmF 0tsEj5uZ1Q0Ey8Ur8mjzkcqVGS6DkBwWn4w6X1Kkd/rbvGgixdMo3ToUbAwc7cUAOQVB RH0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=EKQuITNqxs57IPYwN1T10R91lSQSP/kEoR8KinKMDuo=; b=MQW3RGFdwIgWgnWEitbFrp9ECBdVewq/BHnS+vJp7svfoOUKEeA8I30pio/pQVQRJI /W2jd4fmS6m7e8//v4Y4xmduL/3XkWAFeIVBrj2DuZgG+uC6tn3mB/ZOx5ZA1qtFILbD dm2vInxWPK0rHyME27ulFASQUHJPHRmFNupV9bqyBwNESfGRmjq+X7UVSC1ljDNwYXZc SqXmCFpEOAB5E53avWoa7V4vs3z+0tB6/HeF9djluZQSmaqCcikHWAOQ/9hSEenxWpCU IPbB3q3IwTHDEAaATgPCj+nXrsiEhGy/QgnoELja/hJRRUk1dk8ygAEEBXXMSnm2TrJI xmiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si6249361oiv.13.2020.02.17.01.50.19; Mon, 17 Feb 2020 01:50:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728972AbgBQJsn (ORCPT + 99 others); Mon, 17 Feb 2020 04:48:43 -0500 Received: from inva020.nxp.com ([92.121.34.13]:39958 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726397AbgBQJsn (ORCPT ); Mon, 17 Feb 2020 04:48:43 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1DD311A03D5; Mon, 17 Feb 2020 10:48:42 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D20DD1A03B2; Mon, 17 Feb 2020 10:48:36 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 46132402A7; Mon, 17 Feb 2020 17:48:30 +0800 (SGT) From: Anson Huang To: rjw@rjwysocki.net, viresh.kumar@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] cpufreq: imx-cpufreq-dt: Add "cpu-supply" property check Date: Mon, 17 Feb 2020 17:42:55 +0800 Message-Id: <1581932575-13177-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpufreq-dt driver allows cpufreq driver enabled without valid regulator assigned, however, all i.MX platforms using cpufreq-dt driver now require valid regulator, add "cpu-supply" property check to avoid i.MX platforms' cpufreq enabled without valid regulator and lead to system unstable. Signed-off-by: Anson Huang --- drivers/cpufreq/imx-cpufreq-dt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 6cb8193..0e29d88 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -31,6 +31,9 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) int speed_grade, mkt_segment; int ret; + if (!of_find_property(cpu_dev->of_node, "cpu-supply", NULL)) + return -ENODEV; + ret = nvmem_cell_read_u32(cpu_dev, "speed_grade", &cell_value); if (ret) return ret; -- 2.7.4