From nobody Thu Dec 18 12:43:42 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29654C32774 for ; Tue, 23 Aug 2022 09:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349268AbiHWJPC (ORCPT ); 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-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 *h= ba) if (hba->max_pwr_info.is_valid) return 0; =20 - pwr_info->pwr_tx =3D FAST_MODE; - pwr_info->pwr_rx =3D FAST_MODE; + if (hba->quirks & UFSHCD_QUIRK_HIBERN_FASTAUTO) { + pwr_info->pwr_tx =3D FASTAUTO_MODE; + pwr_info->pwr_rx =3D FASTAUTO_MODE; + } else { + pwr_info->pwr_tx =3D FAST_MODE; + pwr_info->pwr_rx =3D FAST_MODE; + } pwr_info->hs_rate =3D PA_HS_MODE_B; =20 /* 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 =3D 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 =3D 1 << 18, }; =20 enum ufshcd_caps { --=20 2.35.1