Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3321523rwa; Tue, 23 Aug 2022 02:47:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR7dHp/TVBlqv3e5TeQ3FHLjai0CaMnHLK3Lw32l9N1UyLR/TXy64FMI7R3+Ax0/KXQbES5r X-Received: by 2002:a17:907:2672:b0:734:a952:439a with SMTP id ci18-20020a170907267200b00734a952439amr14996498ejc.539.1661248078904; Tue, 23 Aug 2022 02:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248078; cv=none; d=google.com; s=arc-20160816; b=Z2l8XaEjhrj1an2NbmTjRqBraPLiizzXNJAi96GjYigkSzwxL4fauGmP3B1iIL/GXc 2eQDU9/vn5kTnk9mKgEOpBP5xgQklLj0KJteW5nJAsA5FLCVwzfwft8PymkcaScAh03s tdQn8RHUT5on29MJ3HnTZhVenJMAeNvw6mwY+yxnshqssk3IoKAIA5LHTiJu9wXdESdq lzm9ZN/En5f5q5nrDH8wsk7fTATNh7my1/Tyfzgpa0ihBHn44k1Dymp0Fh+OByYnilrB SafjiCPclwTxoemm+2ezX81GywTyMnZhTuZbnBp/RDgyWUdoJwa30Jk3F9RPG8mF/baP DfRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aVNmB4bo5URLZOcyRC07Q7KF/F/Y1s01tY+NquRzclk=; b=pVF/vFGvBcxclwmLbDmMuhtIFPjesUu2kuC7aYqYb/y6604nvj+j+vowKNFzOxCcZs WIMMrcMCRI0rcSqT1yecftz4fjLpPkibr6pMYQESMdk+KhuwP0cOGQTF9JD00nrwf75k NZTHR5bWGmLhvFMQsupWCC772UExyc6nfBRA5u9CwM4YQFfNCHYAgkL+dAVTD6Idd4IA FTEEgDHxYdWWjc8bduh/mvbA/S72ywWFN5c61TlXT+t3KRv7+YIkO4xqkx29WFaSR42k 8cJgNsLAJeTzVQE+nhb5a7lj1sOkeM5cHsfAakDt1F8dUYjVgEpmfGY2NnKhAQ4jVMnj 7FDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LCu6WYT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht18-20020a170907609200b0073094ce02casi11469675ejc.791.2022.08.23.02.47.32; Tue, 23 Aug 2022 02:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LCu6WYT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349259AbiHWJPC (ORCPT + 99 others); Tue, 23 Aug 2022 05:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234244AbiHWJL5 (ORCPT ); Tue, 23 Aug 2022 05:11:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552E986FCC; Tue, 23 Aug 2022 01:31:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 176B16132D; Tue, 23 Aug 2022 08:31:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25677C433C1; Tue, 23 Aug 2022 08:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243508; bh=K8+HU82cIH/0qwDMa0Dv+OBDT+wFIxbdQiqvPEXazeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LCu6WYT13YGrhhy1+CTp3sDfXbl7ZozQr3np6kzAgVi6/6kLLh3u4HzR0IPAf6KbJ EuQQDxwwPu9ZRVtG0HyGVZwaH19b8lN3zTxMF1KoV9/+vEruZasdd99GEZE0kMjeqr ZTDO2PhW9/IFBBueTx7144mpRwyJ1IsXO19MYtGk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.19 269/365] scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO Date: Tue, 23 Aug 2022 10:02:50 +0200 Message-Id: <20220823080129.437569823@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yoshihiro Shimoda [ Upstream commit 2f11bbc2c7f37e3a6151ac548b1c0679cc90ea83 ] Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports auto-hibernate the capability but only FASTAUTO mode. Link: https://lore.kernel.org/r/20220603110524.1997825-4-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/ufs/core/ufshcd.c | 9 +++++++-- include/ufs/ufshcd.h | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 141fff01a662..a51ca56a0ebe 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4292,8 +4292,13 @@ static int ufshcd_get_max_pwr_mode(struct ufs_hba *hba) if (hba->max_pwr_info.is_valid) return 0; - pwr_info->pwr_tx = FAST_MODE; - pwr_info->pwr_rx = FAST_MODE; + if (hba->quirks & UFSHCD_QUIRK_HIBERN_FASTAUTO) { + pwr_info->pwr_tx = FASTAUTO_MODE; + pwr_info->pwr_rx = FASTAUTO_MODE; + } else { + pwr_info->pwr_tx = FAST_MODE; + pwr_info->pwr_rx = FAST_MODE; + } pwr_info->hs_rate = PA_HS_MODE_B; /* Get the connected lane count */ diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 795c8951341d..991aea081ec7 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -583,6 +583,12 @@ enum ufshcd_quirks { * 64-bit addressing supported capability but it doesn't work. */ UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS = 1 << 17, + + /* + * This quirk needs to be enabled if the host controller has + * auto-hibernate capability but it's FASTAUTO only. + */ + UFSHCD_QUIRK_HIBERN_FASTAUTO = 1 << 18, }; enum ufshcd_caps { -- 2.35.1