Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp691798pxu; Wed, 2 Dec 2020 00:25:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsp6FvMZNDU1aORGTHqLZmduvBSSb2kPyAuGOWkt25pmTbXXAoRB8x4Yz3QKyjhdBqDPY4 X-Received: by 2002:a17:906:39d7:: with SMTP id i23mr1212071eje.157.1606897536157; Wed, 02 Dec 2020 00:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606897536; cv=none; d=google.com; s=arc-20160816; b=ATrz2817eCd9DLzFIlmOR4cUkGC+G6o6+w7ZGXcI2xhQ/He+P7TlsKBM3dcaQW8KDL zV8dKkhz9sVaZpe/Voxisq6REt1hGcl+RfEsPw0ikS/yc8rt2d5kwH9DJ3i1kas0yXMG GfIdUvVxbISF9h3iwCft46qQ3o1Ghn9EGWSJ4qZx7R7uSicfNNpuplNDYaCUPFuKgYUA pZWWfFe6BuAU4tCUixh3Por8pOnHDkt/fHy5IdMjCCv1ehohZHkZF3Y2iOB5wSORDBd+ Tf3KCMdyN6Gk6ybTFEfpfab2xKps6XAGtLXu56BWN8Rqf/k4BUfb5uSXhiVTNrnWUUia 2lLw== 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=UYqvFofyELSc9o6qASO+qKPaOY+Ee0XgW1jNEcCb6qA=; b=afOlfBaWJ7Z+aoLy2tfp0JWB8cKBYyDHnAk66toUWBSDNepyDdjOuTPH8DV6XX4IJy fVn8ycSN3viYJemK29UeU3O1M9rVeEs0DUNPWlKAmlLCmfGwqxEnPqjD1+CWuHYxDG6p LnhtFSganJ6ltvXNc+wIlkFGVjIrDwZs4Ir24Mh5sujRsPl7PBo5r4gxCJ4wl9DkGjB2 dFMFA9tggNTX38Z5iAMJ+4YQEjq3WP92RQaL2b1GPHtCXTxgtCsNIi05+lOidU6ysZsc yXXMVIkSTd2ruwCMesb0bR2abNVYaW0fD46hSq63NuDrYAGala5pbjmjjD1DvTrQsInG 1dvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="MrTe85z/"; 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 e17si404783ejx.663.2020.12.02.00.25.12; Wed, 02 Dec 2020 00:25:36 -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="MrTe85z/"; 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 S1729094AbgLBIU2 (ORCPT + 99 others); Wed, 2 Dec 2020 03:20:28 -0500 Received: from a2.mail.mailgun.net ([198.61.254.61]:23405 "EHLO a2.mail.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728931AbgLBIU2 (ORCPT ); Wed, 2 Dec 2020 03:20:28 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606897202; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=UYqvFofyELSc9o6qASO+qKPaOY+Ee0XgW1jNEcCb6qA=; b=MrTe85z/dJ0n6dMDGWWP4+qcTfSIdQdqJXaJyuH0pBKCRp2VeZbz3HqJa8UBH+Xo2/OWfU23 NOcOnrJv1BaPG4dZPwLKK6kpGAJKiT90pRd3H0vXaRVse2KzhXRdBEvJj/baRpYdwuDNiWXV cz0G668mcrHwPIFoJhZVscOOxVw= 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-n04.prod.us-east-1.postgun.com with SMTP id 5fc74e181f6054cb8d6f069c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Dec 2020 08:19:36 GMT Sender: nguyenb=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 37A3FC43468; Wed, 2 Dec 2020 08:19:35 +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: nguyenb) by smtp.codeaurora.org (Postfix) with ESMTPSA id 03215C43463; Wed, 2 Dec 2020 08:19:33 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 02 Dec 2020 00:19:33 -0800 From: nguyenb@codeaurora.org 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, cang@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, bjorn.andersson@linaro.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 v2] scsi: ufs: Remove pre-defined initial voltage values of device powers In-Reply-To: <20201201065114.1001-1-stanley.chu@mediatek.com> References: <20201201065114.1001-1-stanley.chu@mediatek.com> Message-ID: X-Sender: nguyenb@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-11-30 22:51, 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 is allow vendors to > configure proper min_uV and max_uV of any regulators to make > regulator_set_voltage() works during regulator toggling flow. > 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. > > Reviewed-by: Bjorn Andersson > Signed-off-by: Stanley Chu > --- > drivers/scsi/ufs/ufshcd-pltfrm.c | 16 ---------------- > 1 file changed, 16 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c > b/drivers/scsi/ufs/ufshcd-pltfrm.c > index a6f76399b3ae..09e2f04bf4f6 100644 > --- a/drivers/scsi/ufs/ufshcd-pltfrm.c > +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c > @@ -133,22 +133,6 @@ static int ufshcd_populate_vreg(struct device > *dev, const char *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; Do we need this "goto out;"? > > out: