From patchwork Tue Oct 18 00:10:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: subhashj@codeaurora.org X-Patchwork-Id: 9380895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC98C600CA for ; Tue, 18 Oct 2016 00:11:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBB8D28FF3 for ; Tue, 18 Oct 2016 00:11:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE21F289EB; Tue, 18 Oct 2016 00:11:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EC56289EB for ; Tue, 18 Oct 2016 00:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030470AbcJRAK6 (ORCPT ); Mon, 17 Oct 2016 20:10:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43957 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030434AbcJRAKw (ORCPT ); Mon, 17 Oct 2016 20:10:52 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8E457617C6; Tue, 18 Oct 2016 00:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476749446; bh=sZh+bmxP0lfvKtq8szKlI3nwk2zbFfF7wxK2EX4JShE=; h=From:To:Cc:Subject:Date:From; b=o7Nm+5wD5CAJT9ViZJYg9vJCNc6PuiFNB5M8mb89SvQsYeJsZrVcn5fZ4YK4fUVPi kxzCaEHuB33WkGGbBWzPcUyefZZYm4RPhKr8EyGw7J8lQfUpWDGBhe9rRxOgZfFMi2 8LSB91xk+zX0Vh55pDV/wwCFMNaIYrCjnAaezQcI= Received: from subhashj-linux1.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: subhashj@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id CFD1B617C6; Tue, 18 Oct 2016 00:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1476749446; bh=sZh+bmxP0lfvKtq8szKlI3nwk2zbFfF7wxK2EX4JShE=; h=From:To:Cc:Subject:Date:From; b=o7Nm+5wD5CAJT9ViZJYg9vJCNc6PuiFNB5M8mb89SvQsYeJsZrVcn5fZ4YK4fUVPi kxzCaEHuB33WkGGbBWzPcUyefZZYm4RPhKr8EyGw7J8lQfUpWDGBhe9rRxOgZfFMi2 8LSB91xk+zX0Vh55pDV/wwCFMNaIYrCjnAaezQcI= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org CFD1B617C6 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=subhashj@codeaurora.org From: Subhash Jadavani To: vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: Subhash Jadavani , linux-scsi@vger.kernel.org (open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 09/11] scsi: ufs: change device rails hpm mode ramp up sequence Date: Mon, 17 Oct 2016 17:10:40 -0700 Message-Id: <1476749441-11406-1-git-send-email-subhashj@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When we are resuming the UFS device rails in HPM mode, we are first powering on the VCC rail while VCCQ and VCCQ2 rails still being in LPM mode. Some UFS devices may take VCC on event as hint that host wants UFS device to be resumed and may start drawing more power from the VCCQ/VCCQ2 rails (while they are still in LPM mode) causing voltage drop on these rails. This change fixes this issue by bringing VCCQ & VCCQ2 rails out of LPM before powering on VCC rail. Signed-off-by: Subhash Jadavani --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 43f1c55..ea97fd0 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5797,7 +5797,6 @@ static int ufshcd_vreg_set_hpm(struct ufs_hba *hba) !hba->dev_info.is_lu_power_on_wp) { ret = ufshcd_setup_vreg(hba, true); } else if (!ufshcd_is_ufs_dev_active(hba)) { - ret = ufshcd_toggle_vreg(hba->dev, hba->vreg_info.vcc, true); if (!ret && !ufshcd_is_link_active(hba)) { ret = ufshcd_config_vreg_hpm(hba, hba->vreg_info.vccq); if (ret) @@ -5806,6 +5805,7 @@ static int ufshcd_vreg_set_hpm(struct ufs_hba *hba) if (ret) goto vccq_lpm; } + ret = ufshcd_toggle_vreg(hba->dev, hba->vreg_info.vcc, true); } goto out;