Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1390178ybc; Tue, 19 Nov 2019 20:18:26 -0800 (PST) X-Google-Smtp-Source: APXvYqy+sYuT5yvdAVEr+e6BP18JdwG+ZrG/jq0KVyoyADR6R8hG0k0Q7Lqja6N/ZBdDWNR1QptH X-Received: by 2002:a17:906:f756:: with SMTP id jp22mr2184268ejb.234.1574223506591; Tue, 19 Nov 2019 20:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574223506; cv=none; d=google.com; s=arc-20160816; b=kzim0TLC//Q8scqx0b3SdiVHtZ6+9GUNBJi2nWgueatk4ImsdXITfEFTXsPn4uy8IE r8sSiViEaYbIQWySi1iANIwnxLfrNjPbYIfDYCINUd7+EZ58FZwxWPaDlV2lVf50t1tr mdR1zSVZBm5XLJQGqA5oz64JUQcDo89VqSYzuDGrKz622kr5TTItpLSYJwxEIQtt4Rmi /DT1yp76yVBhefn3aKTzrc1NBr2fL+YusNkUELUWc5y55GfVJrIqR2bfNPH0M6QtheuE jPkii2cNohf1bKXl8Bc9BREZgwMQscYc+jc0ifiJFDd4uLSHBlBtXerSM3MQqvO/0Hth M/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:user-agent:message-id :references:in-reply-to:subject:cc:to:from:date :content-transfer-encoding:mime-version:dkim-signature :dkim-signature; bh=uolGHc4kH66/4MJkoD2owW2Su4xpHTEBqrANIeHsWp0=; b=WHjLxg9jdbN0KEa5HuPCUUZNX4HKvmcWQIhrOfs4ki4YG3bscY2vPbe09vHU8VQt0r axzTZRqkzjIoZL3gNyWWY+pALketmZmoPo0p03rp0gXcoOfL5n6x82D1/7h9M6Jz4X9F NhXrHNSOzDa0oL9vCF4xLbSVKi6T+xH113lG7Bbl9JpEZwFRfH4a3hWI1TN227niZzPF d1DmrFDFUDAPX1Od76dj1ZS1WM4WavNIvyle36F2fwpENVcNGPTfAPKWhhXVsi6MsRKN T9KfuW/tdSKWzdCTsC83QSP+ucBPknVXbFDGjHBBztJU8989lw0LEBXRQ72O3ptl3tNh EM7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=Qo8vScqx; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=InwQXLwh; 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 f25si15468839ejw.85.2019.11.19.20.18.01; Tue, 19 Nov 2019 20:18:26 -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=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=Qo8vScqx; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=InwQXLwh; 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 S1727608AbfKTEOo (ORCPT + 99 others); Tue, 19 Nov 2019 23:14:44 -0500 Received: from a27-56.smtp-out.us-west-2.amazonses.com ([54.240.27.56]:39036 "EHLO a27-56.smtp-out.us-west-2.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbfKTEOo (ORCPT ); Tue, 19 Nov 2019 23:14:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=zsmsymrwgfyinv5wlfyidntwsjeeldzt; d=codeaurora.org; t=1574223283; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID; bh=sQkNXuDVsJ0tsz0h+83RhRvsNtFDcFeY7de5XccyV/E=; b=Qo8vScqxfHA9Q4ooy0gAv3ctisVHtZ/bvCgBemcoAta+TlCQyGQtN9gV6gxWw01E BYbgqiimoIEi+HNkEx6WUGEdHD1YLlMUhQjomvxtBuUsnpJ4o1i1iV3mTbi0mFpS1qc qqBqzgivaUP0pMGs/GhNO2wkIh4hMu3RjrOzi0js= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx; d=amazonses.com; t=1574223283; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID:Feedback-ID; bh=sQkNXuDVsJ0tsz0h+83RhRvsNtFDcFeY7de5XccyV/E=; b=InwQXLwhSUoSQHOniuON/CDxljrEZ51RI60W5t3yDU1H0uZW+HNcrnRWJXc6V4gz WKA/YRHpZnjxhTE43up5r8H4UA/prqfqxM8BgWUrnxneNSeUJPTIyomc/pDndpcnbJk y7Tx1EzXS7PIy/IhfvJ5Tu7HPJkuAXRxBRQGYB1k= 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=-1.0 required=2.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 20 Nov 2019 04:14:43 +0000 From: cang@codeaurora.org To: Avri Altman Cc: Can Guo , asutoshd@codeaurora.org, nguyenb@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Alim Akhtar , Pedro Sousa , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Tomas Winkler , open list Subject: Re: [PATCH v2 2/4] scsi: ufs: Update VCCQ2 and VCCQ min/max voltage hard codes In-Reply-To: References: <1574049061-11417-1-git-send-email-cang@qti.qualcomm.com> <1574049061-11417-3-git-send-email-cang@qti.qualcomm.com> <0101016e8163937a-d539c90e-6df8-454a-969a-9e33e9ef35b6-000000@us-west-2.amazonses.com> Message-ID: <0101016e870503bb-b0e9294a-c6ea-46de-a8f3-19e11329410c-000000@us-west-2.amazonses.com> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-SES-Outgoing: 2019.11.20-54.240.27.56 Feedback-ID: 1.us-west-2.CZuq2qbDmUIuT3qdvXlRHZZCpfZqZ4GtG9v3VKgRyF0=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-11-19 20:41, Avri Altman wrote: >> >> On 2019-11-18 15:15, Avri Altman wrote: >> >> >> >> From: Can Guo >> >> >> >> Per UFS 3.0 JEDEC standard, the VCCQ2 min voltage is 1.7v and the >> >> VCCQ voltage range is 1.14v ~ 1.26v. Update their hard codes >> >> accordingly to make sure they work in a safe range compliant for ver >> >> 1.0/2.0/2.1/3.0 UFS devices. >> > So to keep it safe, we need to use largest range: >> > min_uV = min over all spec ranges, and max_uV = max over all spec >> > ranges. >> > Meaning leave it as it is if we want to be backward compatible with >> > UFS1.0. >> > >> > Thanks, >> > Avri >> > >> >> Hi Avri, >> >> Sorry I don't quite follow you here. >> Leaving it as it is means for UFS2.1 devices, when boot up, if we call >> regulator_set_voltage(1.65, 1.95) to setup its VCCQ2, >> regulator_set_voltage() will >> give you 1.65v on VCCQ2 if the voltage level of this regulator is >> wider, say (1.60, >> 1.95). >> Meaning you will finally set 1.65v to VCCQ2. But 1.65v is out of spec >> for UFS >> v2.1 as it requires min voltage to be 1.7v on VCCQ2. So, the smallest >> range is >> safe. >> Of course, in real board design, the regulator's voltage level is >> limited/designed >> by power team to be in a safe range, say (1.8, 1.92), so that calling >> regulator_set_voltage(1.65, 1.95) still gives you 1.8v. But it does >> not mean the >> current hard codes are compliant for all UFS devices. > You are correct - the narrowest the range the better - as long as you > don't cross the limits of previous spec. > So changing 1.1 -> 1.14 and 1.65 -> 1.7 is fine. > While at it, Vccq max in UFS3.0 is 1.26, why not change 1.3 -> 1.26, > like you indicated in your commit log? > > Thanks, > Avri > Thank you Avri, sorry I missed the change to max voltage of VCCQ, I will update it in the next version. Best Regards, Can Guo. >> >> Best Regards, >> Can Guo. >> >> >> >> >> Signed-off-by: Can Guo >> >> --- >> >> drivers/scsi/ufs/ufs.h | 4 ++-- >> >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> >> >> diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h index >> >> 385bac8..9df4f4d >> >> 100644 >> >> --- a/drivers/scsi/ufs/ufs.h >> >> +++ b/drivers/scsi/ufs/ufs.h >> >> @@ -500,9 +500,9 @@ struct ufs_query_res { >> >> #define UFS_VREG_VCC_MAX_UV 3600000 /* uV */ >> >> #define UFS_VREG_VCC_1P8_MIN_UV 1700000 /* uV */ >> >> #define UFS_VREG_VCC_1P8_MAX_UV 1950000 /* uV */ >> >> -#define UFS_VREG_VCCQ_MIN_UV 1100000 /* uV */ >> >> +#define UFS_VREG_VCCQ_MIN_UV 1140000 /* uV */ >> >> #define UFS_VREG_VCCQ_MAX_UV 1300000 /* uV */ >> >> -#define UFS_VREG_VCCQ2_MIN_UV 1650000 /* uV */ >> >> +#define UFS_VREG_VCCQ2_MIN_UV 1700000 /* uV */ >> >> #define UFS_VREG_VCCQ2_MAX_UV 1950000 /* uV */ >> >> >> >> /* >> >> -- >> >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora >> >> Forum, a Linux Foundation Collaborative Project