Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2545970imu; Thu, 29 Nov 2018 06:41:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/UrdRLfzO+HhaFwMonX0JosQaqleiV9J/kP8fp8gVvmA1dc34X9OJct1OUnRv+BsTwBY9zl X-Received: by 2002:a63:580a:: with SMTP id m10mr1446405pgb.332.1543502501426; Thu, 29 Nov 2018 06:41:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543502501; cv=none; d=google.com; s=arc-20160816; b=xvdEOpmoglABTZScnBXZkvFcFzM6bAflBYK7w9t0KoyCuexWd3/rZ5tkwnlHReNn3a q0+cBfzUYTXWawQiagy+f6z3AKvmkLO9NpgLMryr7R9y3qWl/qKsuacngK5YzJ50fnvZ IZWkDO1+b0t90Tpgpy0mVLIAv5ENKjycgtyFvIMiktGyGbExvelW12OFC9QOG4h5zEGS ggPBghnSVOSmIWxLlSsNyNfatt19yr39k1pJQwWfSjVk0MaJP6R0U0i6vjU1KNanb7pC cy8k/T6qLViZrZP6qpIuc/iZcstx2s//RYOBDxAE8WRLgg63tlQf/qQfl6BW2S3pbbkf B3FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JB6dVA+k8uEOTm+0XxlLjiUm8XApt3MBrgxF76oVUPk=; b=n53Gm1muI3+ocBccfBqqDwbW0pqHaxElB2BTGnZn6/QIYrKDI6hbPkMT/FatS7rbzy gZ/OlLSLIxfw/EPaC3myzm3sRQThhWQvu6g+28IjNi/FtTraxto5r2TAgwbp/vULNiQq HXImCj8X6d74v2PiO0Pwqv7Q6xaYjqn2iIq0gaRitA3DwnOlAQmFGcHPF5PlLXeVSk/p vVnfa9pOWeNRX0nW4B6qgflp3axO+k1D+SuL1hI+OTn2fTiFwnX7LV3LSDokL/svPAyp gn7GVz5sqTGBwESBoNZUp9eDwK26KMx7twkYNjiD/IVDYHdW6f9eRthV1dd1d02k+iKA tY4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ed4exNI8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si1892383pgk.249.2018.11.29.06.41.17; Thu, 29 Nov 2018 06:41:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ed4exNI8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388355AbeK3Beq (ORCPT + 99 others); Thu, 29 Nov 2018 20:34:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:36180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387426AbeK3Bep (ORCPT ); Thu, 29 Nov 2018 20:34:45 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 92E4F2147C; Thu, 29 Nov 2018 14:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501753; bh=ntKb6vJB37wP9tnimWLC3pOUhQD7Fjsk3JydZehm1Zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ed4exNI8aadyoJMBXHZdjQl9rlVO7gpBf07Wa2AHhB/qlfvD16jLKQuFubF+fPdrq FQstGQYvutSPAluY519W8FRrRvnD+lbkqhOllkyStXl0ydDiLbnracVTh0FMc7OA0w 2o0W4TTMtaHh2anRPNj6r2JSkafXMS3GY19d4T/k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keerthy , Dave Gerlach , Viresh Kumar Subject: [PATCH 4.19 027/110] opp: ti-opp-supply: Dynamically update u_volt_min Date: Thu, 29 Nov 2018 15:11:58 +0100 Message-Id: <20181129135922.358073617@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129135921.231283053@linuxfoundation.org> References: <20181129135921.231283053@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Keerthy commit ba038546ff9e15d54d1134b5c5d2355648c00dec upstream. The voltage range (min, max) provided in the device tree is from the data manual and is pretty big, catering to a wide range of devices. On a i2c read/write failure the regulator_set_voltage_triplet function falls back to set voltage between min and max. The min value from Device Tree can be lesser than the optimal value and in that case that can lead to a hang or crash. Hence set the u_volt_min dynamically to the optimal voltage value. Cc: 4.16+ # v4.16+ Fixes: 9a835fa6e47 ("PM / OPP: Add ti-opp-supply driver") Signed-off-by: Keerthy Acked-by: Dave Gerlach Signed-off-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/opp/ti-opp-supply.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/opp/ti-opp-supply.c +++ b/drivers/opp/ti-opp-supply.c @@ -290,6 +290,9 @@ static int ti_opp_supply_set_opp(struct vdd_uv = _get_optimal_vdd_voltage(dev, &opp_data, new_supply_vbb->u_volt); + if (new_supply_vdd->u_volt_min < vdd_uv) + new_supply_vdd->u_volt_min = vdd_uv; + /* Scaling up? Scale voltage before frequency */ if (freq > old_freq) { ret = _opp_set_voltage(dev, new_supply_vdd, vdd_uv, vdd_reg,