Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1378289pxk; Mon, 31 Aug 2020 18:22:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGHSo0ZYMCglyl/ZVzDVIcnbCvm5Nz13rsWw+H4t9CkOGF53Rru7n+jWdNhM+yzaeDVse8 X-Received: by 2002:a17:906:6d4c:: with SMTP id a12mr3266253ejt.64.1598923371209; Mon, 31 Aug 2020 18:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598923371; cv=none; d=google.com; s=arc-20160816; b=Ean3bwbOWru4Cx3v9j2xAlLbcuDkIOPZBHHShPc4oG2m/RR39a9q+k/cLsBJzQ2UNZ 8dMsQVAx7hITCsmiYugdzHifFkDvSrWo49mcjlHcnbgDFEuzTp73qgMKdY87KrzERuiy yFTgwrBa76hSh7QqhqrqpQBpirt/Syvpuk8vj41t75NB/3OPViD9BgSc3ijAGsMlBV5a sIAFkwl0NhqMJ0uQZ0FupQSfL6n7Q76NF1JASlZ1vY6GSU6GFCWzOJI9Jtd0VV7jYp/x T9H9CYv2B3sOneGUifaiaGvX2GBtFkc4rOGcD4/dk74TMCLx7HktCOB6UJvuiOVTjwyo VOBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=YVrekhRja53pvOBvjZUkfskwtrhryfC5K7ba/YDLhuo=; b=bBEqNxob4a8nkr0p3vT6G675Nyitd/0HSSryc2yKUobPTWLCp+dRfCwO9XYKpu7wRt fUJCFzqL9AbCrNR711PN3yowallx+ugQ9dKYESpE/rksXBT3wh8EuotKICBBwV3BDN+n CR/IDktbqZwIFeiIkanhd+r74kpyq5IZ6rWPdjxVY2kRRroXdl0Y9mLrIxsvZ2hcAR+D 3O/18JhYV2ueXU3Xkv9kdDy7R8WhP1CY8QO0rkuGtWsEOYMVFb/grj1iCz70SCke6d59 TwqAzHR3LfQ7UZ43SDbrBKwAY0gwlTRxp4rv8rL03UShkrjuQgF6uB2qBzlck2G4Gv14 /9Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=lsPSl98J; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si6425295ejt.551.2020.08.31.18.22.28; Mon, 31 Aug 2020 18:22:51 -0700 (PDT) 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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=lsPSl98J; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726307AbgIABUl (ORCPT + 99 others); Mon, 31 Aug 2020 21:20:41 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:30413 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbgIABUl (ORCPT ); Mon, 31 Aug 2020 21:20:41 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1598923240; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=YVrekhRja53pvOBvjZUkfskwtrhryfC5K7ba/YDLhuo=; b=lsPSl98JrefubjznTdUHuuPXeHneYoJbyYuPyWa85XSGz5HKM3qZI0cIXg2yMyREG8DA6mxQ fzVqL9FfCsY96whQg4o3xfsco6NU9gwXYUjbngTs1rJM80ErkbZHWEzqo2USW1+0z5N/L2zY t98+KtEHiK47i/XDwLbwPXRdxUU= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-east-1.postgun.com with SMTP id 5f4da1de238e1efa379c7321 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 01 Sep 2020 01:20:30 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 1DE17C43391; Tue, 1 Sep 2020 01:20:30 +0000 (UTC) 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,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from pacamara-linux.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: nguyenb) by smtp.codeaurora.org (Postfix) with ESMTPSA id DAD77C433C6; Tue, 1 Sep 2020 01:20:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DAD77C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=nguyenb@codeaurora.org From: "Bao D. Nguyen" To: cang@codeaurora.org, asutoshd@codeaurora.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: "Bao D. Nguyen" , linux-arm-msm@vger.kernel.org, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , Stanley Chu , Bean Huo , Bart Van Assche , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 1/1] scsi: ufshcd: Properly set the device Icc Level Date: Mon, 31 Aug 2020 18:19:57 -0700 Message-Id: <5c9d6f76303bbe5188bf839b2ea5e5bf530e7281.1598923023.git.nguyenb@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org UFS version 3.0 and later devices require Vcc and Vccq power supplies with Vccq2 being optional. While earlier UFS version 2.0 and 2.1 devices, the Vcc and Vccq2 are required with Vccq being optional. Check the required power supplies used by the device and set the device's supported Icc level properly. Signed-off-by: Can Guo Signed-off-by: Asutosh Das Signed-off-by: Bao D. Nguyen --- drivers/scsi/ufs/ufshcd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 06e2439..fdd1d3e 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6845,8 +6845,9 @@ static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba, { u32 icc_level = 0; - if (!hba->vreg_info.vcc || !hba->vreg_info.vccq || - !hba->vreg_info.vccq2) { + if (!hba->vreg_info.vcc || + (!hba->vreg_info.vccq && hba->dev_info.wspecversion >= 0x300) || + (!hba->vreg_info.vccq2 && hba->dev_info.wspecversion < 0x300)) { dev_err(hba->dev, "%s: Regulator capability was not set, actvIccLevel=%d", __func__, icc_level); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project