Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4000974pxu; Mon, 30 Nov 2020 15:20:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuy+7H21bq7cUwelp5HrnmPz0gKfTpc5lXRLj4MtH/gd1jMhYSsOd/rRgIpVTJ0amTCze3 X-Received: by 2002:aa7:d883:: with SMTP id u3mr68347edq.69.1606778406214; Mon, 30 Nov 2020 15:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606778406; cv=none; d=google.com; s=arc-20160816; b=jaoCUrugZ98hzAue2URqqK4OPl5UIgWf+1lTowIPL2fcKkn4axxd1B1yEG02ilPHjQ X4zPAYx2Gg4GcIJXfrvfeC5brst2qK9VHNHwjv9bPv1NrXFnmeQswOxY3DsjTXdH9wFD FUSifF7DAemTVXTn0DipRDgGizZm8e//ut7zuEOA+ClZLzC90AfcNCbB221jY6yOlZXJ NfdraXSRd+RfxMpLzAoHggW4ZU93JPYP8+Wu1oiKWNLgsBbwnO82Z7LWjukY2/XpCE6R 82zEhiWsi/nLzRTdSCzcRNGDi0lRFnXHAUBVezFTTMJ713eYhVmVAC/ia8fQMZ/LJH7s 84Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ElQq1bkIiUYhrFnOCJXzaDWlbvoQCXiavddjZw8fCCM=; b=dJgZjbLPXhPeftt+Wxt4n9XPY4jJ2wJAdvpPuVFYGpsE6oGPMPP0cEBLiYY9ihSp70 roFTqRC1Ub+4SJiZNNNW2MtQwM6MXiLLqxWrp69rLdFar8LliVt95no4VzBPMgbyabZ7 WcO9n7qkWxjhFPk5yVfqVrrQNyf5ljUFb1wih0dqbjoh5W4pnsQy730s7L2zhClEnn9i uONnfAg1tSGaf2uK/9tLXKfp2p848Wi8YQMYRYVFgC/MkDZ0WIKA2M8FXOU7O1N0LppF AU2BFTdzyqBDNhRuxnA1dlDOEJtkpoFLlqZfCTf7Dtfyx1xbiV45kyXVxzEu2T9jxkbI Yrvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FMuoHiP0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si7618751edl.270.2020.11.30.15.19.44; Mon, 30 Nov 2020 15:20:06 -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=@linaro.org header.s=google header.b=FMuoHiP0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731196AbgK3XKY (ORCPT + 99 others); Mon, 30 Nov 2020 18:10:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731198AbgK3XKV (ORCPT ); Mon, 30 Nov 2020 18:10:21 -0500 Received: from mail-oo1-xc43.google.com (mail-oo1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE4CDC0613D3 for ; Mon, 30 Nov 2020 15:09:35 -0800 (PST) Received: by mail-oo1-xc43.google.com with SMTP id p15so1434386oop.12 for ; Mon, 30 Nov 2020 15:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ElQq1bkIiUYhrFnOCJXzaDWlbvoQCXiavddjZw8fCCM=; b=FMuoHiP05HX4Iz0WlIi5VX49F90NYlSP+7bikhMJh2BsC+xXuTlcK9Z1kZf3N5vC+w iY7nofNxeSeb0INIGsnvNaEMT/Jnk/cccAvTNLBvGVrltFDk65xHRGuA5rsl7QmxOhLG 2x39e51e5VzrLbsvHMi7oIW/mOKEspqgfb3cQ5jJSbXkmSXRHDHeHpx0Z0pAj8YbcdSJ COvnLQpn3IcUdhEejlQQsBZiEL779czeYspfppjy3ZhsEvGP7IMmQIAx8ABlytPME2Mz iHZESCTK/CK33qNW2BrWgDI4EvztYXJx4wcDs+tQKF7em1iNZORrDeSB+rTEf2/U7m4N uAnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ElQq1bkIiUYhrFnOCJXzaDWlbvoQCXiavddjZw8fCCM=; b=flVlEbVf65B/QeAJU5wMZ9C6WiLs089ndloyc278QgOoSvB2dgEGiLs+3TI1LaZOww kQRLKob4LW7Ow3RMDt9P0KP925bG1g1hPbbmwbqhbGRjeWWretBLqMn/GiHS7zwF8bR4 brm5AK0OFCYKjsoQJCOM36nrFR6Lvnha0RFFJ/wGMW86320jyW9cR0KPE2Y9DPXVW4zY tY/Y/OiUP3C3iygSOxNOqAVawS2a+ZgZMsiq0/VDkzPqkADjkMmB0efO3TUPOyacHUxl Bzi2H4EYZlsSTZkppCAZK9meOukvoG+nNmYRalfqG4V4ghHcP6fAYsWhwLbpfC6WrQ+P GSKg== X-Gm-Message-State: AOAM530djZXGlI0eltNMZLXdvqec96eeXPZMYBMkkCDyfqJ+zZnltTYc LNwtOotjJIV7kCBae/hze019Kg== X-Received: by 2002:a4a:91de:: with SMTP id e30mr17437722ooh.58.1606777775002; Mon, 30 Nov 2020 15:09:35 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id m8sm5603517otm.71.2020.11.30.15.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 15:09:34 -0800 (PST) Date: Mon, 30 Nov 2020 17:09:32 -0600 From: Bjorn Andersson 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, nguyenb@codeaurora.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: [RFC PATCH v1] scsi: ufs: Remove pre-defined initial VCC voltage values Message-ID: References: <20201130091610.2752-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201130091610.2752-1-stanley.chu@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 30 Nov 03:16 CST 2020, Stanley Chu wrote: > UFS specficication allows different VCC configurations for UFS devices, > for example, > (1). 2.70V - 3.60V (By default) > (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" configuration to toggle VCC > regulator on UFU 3.x products with VCC configuration (3) used. > > To solve this issue, we simply remove pre-defined initial VCC voltage > values in UFS 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 be changed by UFS driver. What UFS driver needs to do is simply > enabling or disabling the VCC regulator only. > > This is a RFC conceptional patch. Please help review this and feel > free to feedback any ideas. Once this concept is accepted, and then > I would post a more completed patch series to fix this issue. > > Signed-off-by: Stanley Chu Reviewed-by: Bjorn Andersson This is the correct thing to do and I would prefer that we did the same for vccq and vccq2 as well - and thereby remove the min_uV and max_uV from ufs_vreg. Regards, Bjorn > --- > drivers/scsi/ufs/ufshcd-pltfrm.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c > index a6f76399b3ae..3965be03c136 100644 > --- a/drivers/scsi/ufs/ufshcd-pltfrm.c > +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c > @@ -133,15 +133,7 @@ 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")) { > + 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")) { > -- > 2.18.0 >