Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3582619ybc; Mon, 18 Nov 2019 18:02:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzW33naoNDHikKplk1mZ3nmYUt77Z3YfBcjWnPBcUkimTkgLZXIqc65oprvrWQfX0AF7PKl X-Received: by 2002:a17:906:e289:: with SMTP id gg9mr30834289ejb.71.1574128938931; Mon, 18 Nov 2019 18:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574128938; cv=none; d=google.com; s=arc-20160816; b=jD1DFcUtXsX5SG1xig6D4Cf5l3LmAnO+QdXT0KIet+2VTeKuQIq7cHfDcWvvn17qZb KLkEeH9SrZMgZOnkKkEkIaPjPZPE8ZZlFmY3Ebpw72lZ4vhEtMjiYpKZqTt1S9tpDXtl KZTCTKAICXyq3TxPy48BJtkTgdvWX6hbYtlRFhvA56merBNnBcMuDAYCfBACf3Jk4iIj qcc3lN3hfDXF1Evb2Vc48z/xdgkxg9d72WES0pcOFQzKzLuFf+XJish3x0kFc65oZEy/ v/6fMHHEAiFCwbm48o9S9wCch2gPaePgLRlHgnmKvVZyRvhNWJDB/QAcIaXFAQqspd2z E65A== 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=XMwBPZ309JOB+kwNgzL1ey0Pg0H2YZ1B9gMtbenhZkk=; b=K22IudN69Gpr48umC/+fRCggsMuLWC/79iJX46dCBV7pe6MotmgN3W1bOi/nXGllxD 8LadePpkbfU19zyHLHKFaFVEPjSg5XqLAkcPpWMs3+3Fdwgd2x0a/pl8mE6fhCwllEVl MmcdD8bc2NFZ+owKH48suqFQw1KMrdtG93CCMS7lUls2TxHBmnSKEmhga3EburhyYUs3 w9KaklnVL2M/HJSQz5TmUH0osNdYEWPENVjwBYUSee0Kt6qkMk6xhq8tQwnHk1iwkGyT qsWum1cXx0DNSBAN9iHtrQoqDPTBYE477fQN9IZKybM5OU2ql8ipaVUDlcyg0fidMxAb SAsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=bTKW7Euh; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=QeXuzILQ; 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 d26si12764221ejr.361.2019.11.18.18.01.54; Mon, 18 Nov 2019 18:02:18 -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=bTKW7Euh; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=QeXuzILQ; 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 S1727262AbfKSCAS (ORCPT + 99 others); Mon, 18 Nov 2019 21:00:18 -0500 Received: from a27-188.smtp-out.us-west-2.amazonses.com ([54.240.27.188]:48322 "EHLO a27-188.smtp-out.us-west-2.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbfKSCAS (ORCPT ); Mon, 18 Nov 2019 21:00:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=zsmsymrwgfyinv5wlfyidntwsjeeldzt; d=codeaurora.org; t=1574128817; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID; bh=7V4ORWP4fmF4jElRRjqAY3TB3aDqmX0kyeDAD63NAXI=; b=bTKW7EuhSjXlKRDMjm7W+okWiYVbugJm9jJZVv2klzVKWL8Kxux0BfAkWuahy+a3 VDX/wBKKKox8V1NdH5NDNWyYNAVW34ds8YOpmAzqrFVdnSzH5MOxK23XOksKEkP2fJz jgBnTfSFk2cDvA697vEJHLMwl4vgYpla9Y3O9HGA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx; d=amazonses.com; t=1574128816; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID:Feedback-ID; bh=7V4ORWP4fmF4jElRRjqAY3TB3aDqmX0kyeDAD63NAXI=; b=QeXuzILQm7kHviFL/e1WbYMrNgz86RFtKHQMHZj2UPCVZqrQacAOmwd9NE35u+aF XpFc91shZwT9iQmU59E0yzvdxpNZUk2wbf7rBkK898/NnM+hqnz6PnJqQT1JIo/geOf E6EIuz4wJ5C7fStnoGJN3tKmCEmnqoJllQJ4nheQ= 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 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: Tue, 19 Nov 2019 02:00:16 +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> Message-ID: <0101016e816392e3-3a981572-cccc-4a0e-a462-8790ab7c11b7-000000@us-west-2.amazonses.com> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-SES-Outgoing: 2019.11.19-54.240.27.188 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-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. 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