Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4100596ima; Mon, 4 Feb 2019 10:11:57 -0800 (PST) X-Google-Smtp-Source: AHgI3IY9XydZm7dCDu/Q7HeQWy3/ijg+iszFMLolcx/RjIt22WVFB+FcpvMXg08UgjLTqRxOc27P X-Received: by 2002:a17:902:b581:: with SMTP id a1mr704784pls.36.1549303916956; Mon, 04 Feb 2019 10:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549303916; cv=none; d=google.com; s=arc-20160816; b=bz85+W35KOq0R2codc7OeVjKRNtB4l5T1+Y/7wmj+qmjtxvrE8o7edP+pVG/d+gswN lByhcjCg8kksyK6Ii2jy68io5UVaIOrV8SGdq84omoRCQEfYy+SvI8IiTGOpbsAslovt E/DcBC/kaju2QCNr8udJHEAlK2B3QA0zgynCrc0YE/CzdS5moUL/VOI7363jVHWQOj9b QbT735uvW2OkJkLmuHux4FZfRkXuac2vcgSLrRRsjHkSVs7Bdq+6jRas/hLuio/7POK5 PtRZZEuY3duaJ2RQ3hNT32VEH7Rth1fe1nBi42qQf6ZHhmGVANw4fG7fIQc/28AuWXMu qy4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=Yq3faGAOzGsZw2hj0N+YcqeBe0XiiigZK+Hpv4cpUys=; b=DwZ2zNLkHPWbcUHiZo826426SctplF3NsKgwHlG77CqpH/qKQf1+zDs+mTIT4kcwJA JiLmG0EDAHrF9TuFWNbiMPwXbTKAdNAeiUfQoR6RC8QXR3xenQP7aJjLkkg7j8hfiftt xQepovAvNTNU7UJyvx+eB4W9SS/p3AKCLItNB+B1Y+ZvPY7XGQlxROeJsnKRTSJJaHVh VSz1BTEjZS/3DbaY5frJGd7j16zw4jqPzmUDPajI27BH6RVPeMTki3AZmWuAv5saF3IW LPi0g3d7SaC+oi1zIOWqa4qxVeWoVi7EY7n9Mlj4RXRxZqk0n+3H+0to6v628oTCKVWe LI1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dCLpShDF; dkim=pass header.i=@codeaurora.org header.s=default header.b=eVglANJw; 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 q64si603754pga.280.2019.02.04.10.11.39; Mon, 04 Feb 2019 10:11:56 -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=default header.b=dCLpShDF; dkim=pass header.i=@codeaurora.org header.s=default header.b=eVglANJw; 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 S1729208AbfBDSLK (ORCPT + 99 others); Mon, 4 Feb 2019 13:11:10 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:42240 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728056AbfBDSLK (ORCPT ); Mon, 4 Feb 2019 13:11:10 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4E45260791; Mon, 4 Feb 2019 18:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1549303869; bh=KfUt4JUFUxnU0KQqxLpwm1YUgcBp655GnmnQBGJWJ6I=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dCLpShDF8nAuLxraLUGL+A2HVCm1hNBkZyqDVLp+Gn1kbFG6PCjUgOpIh8pEJC+2+ 5aJ5cz+5H7yswaYpgkbdTSzLf/j9JDxwBFqqKpJpCnhBlgHwfBEUueXv8hcrdgP6Uy p8GcIaEiLLCgoZ/os4R9ijNOh3qD6cEW1X9KSTiA= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.226.60.81] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id F31A760734; Mon, 4 Feb 2019 18:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1549303868; bh=KfUt4JUFUxnU0KQqxLpwm1YUgcBp655GnmnQBGJWJ6I=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=eVglANJwqfkAbq6Ci11HdpTMKhrgnA1ZqTQgNbDslgUFgSaEZdnFeUOu8cgXlnfe9 oW0T+/CmPefVzvXRNJ4ZErO1XVg5dWB8aHsygPZtmWY3y7GcveLPb0fFh7zXq6RTxd 8TzOBejChKhws12qHmL3QCZX+W+NxghuG8CXq1QU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F31A760734 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org Subject: Re: [PATCH v3 5/5] Revert "scsi: ufs: disable vccq if it's not needed by UFS device" To: Marc Gonzalez , MSM , LKML Cc: Bjorn Andersson , Andy Gross , David Brown , Evan Green , Douglas Anderson , Alim Akhtar , Avri Altman , Pedro Sousa , Subhash Jadavani , Bart Van Assche , SCSI References: <70618c25-83f0-b9db-51a3-c1d74b605a45@free.fr> From: Jeffrey Hugo Message-ID: <53ac0ac5-9b98-e9d7-08a6-0cbde1c1edb0@codeaurora.org> Date: Mon, 4 Feb 2019 11:11:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <70618c25-83f0-b9db-51a3-c1d74b605a45@free.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/4/2019 10:42 AM, Marc Gonzalez wrote: > This reverts commit 60f0187031c05e04cbadffb62f557d0ff3564490. > > Calling ufshcd_set_vccq_rail_unused hangs my system. > It seems vccq is not *not* needed. > > Signed-off-by: Marc Gonzalez > --- Reviewed-by: Jeffrey Hugo > drivers/scsi/ufs/ufs.h | 1 - > drivers/scsi/ufs/ufshcd.c | 59 +++------------------------------------ > 2 files changed, 4 insertions(+), 56 deletions(-) > > diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h > index dd65fea07687..7da7318eb6a6 100644 > --- a/drivers/scsi/ufs/ufs.h > +++ b/drivers/scsi/ufs/ufs.h > @@ -514,7 +514,6 @@ struct ufs_vreg { > struct regulator *reg; > const char *name; > bool enabled; > - bool unused; > int min_uV; > int max_uV; > int min_uA; > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index 9ba7671b84f8..8b9a01073d62 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -245,7 +245,6 @@ static int ufshcd_probe_hba(struct ufs_hba *hba); > static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, > bool skip_ref_clk); > static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on); > -static int ufshcd_set_vccq_rail_unused(struct ufs_hba *hba, bool unused); > static int ufshcd_uic_hibern8_exit(struct ufs_hba *hba); > static int ufshcd_uic_hibern8_enter(struct ufs_hba *hba); > static inline void ufshcd_add_delay_before_dme_cmd(struct ufs_hba *hba); > @@ -6819,11 +6818,6 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) > ufs_fixup_device_setup(hba, &card); > ufshcd_tune_unipro_params(hba); > > - ret = ufshcd_set_vccq_rail_unused(hba, > - (hba->dev_quirks & UFS_DEVICE_NO_VCCQ) ? true : false); > - if (ret) > - goto out; > - > /* UFS device is also active now */ > ufshcd_set_ufs_dev_active(hba); > ufshcd_force_reset_auto_bkops(hba); > @@ -7007,24 +7001,13 @@ static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg, > static inline int ufshcd_config_vreg_lpm(struct ufs_hba *hba, > struct ufs_vreg *vreg) > { > - if (!vreg) > - return 0; > - else if (vreg->unused) > - return 0; > - else > - return ufshcd_config_vreg_load(hba->dev, vreg, > - UFS_VREG_LPM_LOAD_UA); > + return ufshcd_config_vreg_load(hba->dev, vreg, UFS_VREG_LPM_LOAD_UA); > } > > static inline int ufshcd_config_vreg_hpm(struct ufs_hba *hba, > struct ufs_vreg *vreg) > { > - if (!vreg) > - return 0; > - else if (vreg->unused) > - return 0; > - else > - return ufshcd_config_vreg_load(hba->dev, vreg, vreg->max_uA); > + return ufshcd_config_vreg_load(hba->dev, vreg, vreg->max_uA); > } > > static int ufshcd_config_vreg(struct device *dev, > @@ -7062,9 +7045,7 @@ static int ufshcd_enable_vreg(struct device *dev, struct ufs_vreg *vreg) > { > int ret = 0; > > - if (!vreg) > - goto out; > - else if (vreg->enabled || vreg->unused) > + if (!vreg || vreg->enabled) > goto out; > > ret = ufshcd_config_vreg(dev, vreg, true); > @@ -7084,9 +7065,7 @@ static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg) > { > int ret = 0; > > - if (!vreg) > - goto out; > - else if (!vreg->enabled || vreg->unused) > + if (!vreg || !vreg->enabled) > goto out; > > ret = regulator_disable(vreg->reg); > @@ -7192,36 +7171,6 @@ static int ufshcd_init_hba_vreg(struct ufs_hba *hba) > return 0; > } > > -static int ufshcd_set_vccq_rail_unused(struct ufs_hba *hba, bool unused) > -{ > - int ret = 0; > - struct ufs_vreg_info *info = &hba->vreg_info; > - > - if (!info) > - goto out; > - else if (!info->vccq) > - goto out; > - > - if (unused) { > - /* shut off the rail here */ > - ret = ufshcd_toggle_vreg(hba->dev, info->vccq, false); > - /* > - * Mark this rail as no longer used, so it doesn't get enabled > - * later by mistake > - */ > - if (!ret) > - info->vccq->unused = true; > - } else { > - /* > - * rail should have been already enabled hence just make sure > - * that unused flag is cleared. > - */ > - info->vccq->unused = false; > - } > -out: > - return ret; > -} > - > static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, > bool skip_ref_clk) > { > -- Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.