Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp750166pxu; Wed, 2 Dec 2020 02:20:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRLFbogBFMUBpKlEBNPBsI9UtZT5is034ivGnuwhjPaXbkwktUr4mLbUTVeRmnm+191PE6 X-Received: by 2002:aa7:d7d7:: with SMTP id e23mr1918617eds.78.1606904456021; Wed, 02 Dec 2020 02:20:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606904456; cv=none; d=google.com; s=arc-20160816; b=JqSB+zEJm7zQw2uDVjCDfEqjM3R2WeIZNljdUanGx+lfMPQOfFlldBC5B+d3bPlfCk mGeLd3EMI4C5MY39TBnMXqLp+yDZ5PjMMbA1eOz78NBguKvw1q+XAoiuQ2Fkb2o9urkr A5p27oAvbC+fafecgL7KhxXpZl0s7L/Rgr2ECMSEGHWVk3QBKpbv5ZcZMJ7IqCkv+/DB S5yC1+CSqwqR1e+HcWg2H8GysY5TFkEKcyj4T94XDomddXUFHv5HrQSUJ/Yvmvu6JEIU uNbEJd93mh+a5XT6MMEpHONBSVAUR8ZQv/7QgeABvnyddlaL2w/V6lDAi+LLTRvgxmJg CRiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=PtTR3K77Jj6EGHE+NEYqNB3DHE430N+l6KIpgZc7+Vg=; b=TZBQAP/Wl4cdteTBGMckGbBd67tK/twd/1dpx9vMgJ09qdEZEj1g9G2URy8gXwaf0Y d0eYfubEMFYipnK5kdUv/wHjJBioaPVUhKWY3d/B9j6ceAsYcHo40/Itd2B9B1kB6/2B MGUCJjp8J8eGuJG6wcyJjwBuf+yFMjDokuhlMTMDNN47o6bvzGupkh44TpqqpjVykiwG 1Sq628OZ8P+z4E2q48vX7ZoodZtd8PDDVu3aYy81y/qFVGSCV13qpZ8csICgDUI7HpnI BsxNg/BqTdu161i9OttoXF6788+rcIQIbGU+8l21RBdXXUZjDQ2nTkdvfC7FTcQSBU8k NfuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=CucOyy0p; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si764149eds.144.2020.12.02.02.20.31; Wed, 02 Dec 2020 02:20:56 -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=@mg.codeaurora.org header.s=smtp header.b=CucOyy0p; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729438AbgLBKRT (ORCPT + 99 others); Wed, 2 Dec 2020 05:17:19 -0500 Received: from a2.mail.mailgun.net ([198.61.254.61]:37780 "EHLO a2.mail.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729356AbgLBKRT (ORCPT ); Wed, 2 Dec 2020 05:17:19 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606904221; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=PtTR3K77Jj6EGHE+NEYqNB3DHE430N+l6KIpgZc7+Vg=; b=CucOyy0pt+Ct18IGTVFpLm5we2IQC8DoPANnPG+GBN5lZgRDaQwGZYONOnNXJMNYFJ5fxZ8A e4VwzjWCJt13YlAlac53pZYr60+uPN6AKAazPOAw4GulPhfm9Avi6zVeVGxjZBhhKBwvLWwL +Siv9FO2+9ingpXuX9fTgcqNB3k= X-Mailgun-Sending-Ip: 198.61.254.61 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n10.prod.us-east-1.postgun.com with SMTP id 5fc76981f2eedd9084073f1e (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Dec 2020 10:16:33 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 4C1F8C43464; Wed, 2 Dec 2020 10:16:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id C7586C433C6; Wed, 2 Dec 2020 10:16:30 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 02 Dec 2020 18:16:30 +0800 From: Can Guo To: Stanley Chu Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com, avri.altman@wdc.com, alim.akhtar@samsung.com, jejb@linux.ibm.com, beanhuo@micron.com, asutoshd@codeaurora.org, matthias.bgg@gmail.com, bvanassche@acm.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kuohong.wang@mediatek.com, peter.wang@mediatek.com, chun-hung.wu@mediatek.com, andy.teng@mediatek.com, chaotian.jing@mediatek.com, cc.chou@mediatek.com, jiajie.hao@mediatek.com, alice.chao@mediatek.com Subject: Re: [PATCH v3] scsi: ufs: Remove pre-defined initial voltage values of device powers In-Reply-To: <20201202091819.22363-1-stanley.chu@mediatek.com> References: <20201202091819.22363-1-stanley.chu@mediatek.com> Message-ID: <3d3e5d90774423243b071b20191e9ce4@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-12-02 17:18, Stanley Chu wrote: > UFS specficication allows different VCC configurations for UFS devices, > for example, > (1). 2.70V - 3.60V (Activated by default in UFS core driver) > (2). 1.70V - 1.95V (Activated if "vcc-supply-1p8" is declared in > device tree) > (3). 2.40V - 2.70V (Supported since UFS 3.x) > > With the introduction of UFS 3.x products, an issue is happening that > UFS driver will use wrong "min_uV-max_uV" values to configure the > voltage of VCC regulator on UFU 3.x products with the configuration (3) > used. > > To solve this issue, we simply remove pre-defined initial VCC voltage > values in UFS core driver with below reasons, > > 1. UFS specifications do not define how to detect the VCC configuration > supported by attached device. > > 2. Device tree already supports standard regulator properties. > > Therefore VCC voltage shall be defined correctly in device tree, and > shall not changed by UFS driver. What UFS driver needs to do is simply > enable or disable the VCC regulator only. > > Similar change is applied to VCCQ and VCCQ2 as well. > > Note that we keep struct ufs_vreg unchanged. This allows vendors to > configure proper min_uV and max_uV of any regulators to make > regulator_set_voltage() works during regulator toggling flow in the > future. Without specific vendor configurations, min_uV and max_uV will > be NULL by default and UFS core driver will enable or disable the > regulator only without adjusting its voltage. > > Acked-by: Avri Altman > Reviewed-by: Asutosh Das > Reviewed-by: Bjorn Andersson Reviewed-by: Can Guo > Signed-off-by: Stanley Chu > --- > drivers/scsi/ufs/ufshcd-pltfrm.c | 19 ------------------- > 1 file changed, 19 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c > b/drivers/scsi/ufs/ufshcd-pltfrm.c > index 0619cfbfbdbb..1a69949a4ea1 100644 > --- a/drivers/scsi/ufs/ufshcd-pltfrm.c > +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c > @@ -134,25 +134,6 @@ static int ufshcd_populate_vreg(struct device > *dev, const char *name, > dev_info(dev, "%s: unable to find %s\n", __func__, prop_name); > vreg->max_uA = 0; > } > - > - if (!strcmp(name, "vcc")) { > - if (of_property_read_bool(np, "vcc-supply-1p8")) { > - vreg->min_uV = UFS_VREG_VCC_1P8_MIN_UV; > - vreg->max_uV = UFS_VREG_VCC_1P8_MAX_UV; > - } else { > - vreg->min_uV = UFS_VREG_VCC_MIN_UV; > - vreg->max_uV = UFS_VREG_VCC_MAX_UV; > - } > - } else if (!strcmp(name, "vccq")) { > - vreg->min_uV = UFS_VREG_VCCQ_MIN_UV; > - vreg->max_uV = UFS_VREG_VCCQ_MAX_UV; > - } else if (!strcmp(name, "vccq2")) { > - vreg->min_uV = UFS_VREG_VCCQ2_MIN_UV; > - vreg->max_uV = UFS_VREG_VCCQ2_MAX_UV; > - } > - > - goto out; > - > out: > if (!ret) > *out_vreg = vreg;