mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"wkon.kim@samsung.com" <wkon.kim@samsung.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH] ufs: core: Initialize a variable mode for PA_PWRMODE
Date: Thu, 2 Oct 2025 08:00:21 +0000	[thread overview]
Message-ID: <9fda4a263951753ca7c8d90b454f00f6815b64c6.camel@mediatek.com> (raw)
In-Reply-To: <20251002070027.228638-1-wkon.kim@samsung.com>

On Thu, 2025-10-02 at 16:00 +0900, Wonkon Kim wrote:
> 
> If ufshcd_dme_get() fails uic cmd error,
> a variable mode has a garbage value.
> It may return unintended result for pwr mode restore.
> 
> Initialize it as 0 and will return true when ufshcd_dme_get() fails,
> because PA power mode 0 is not defined.
> 
> Signed-off-by: Wonkon Kim <wkon.kim@samsung.com>
> ---
>  drivers/ufs/core/ufshcd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 9a43102b2b21..a4438a3cb73a 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -6581,7 +6581,7 @@ static inline void
> ufshcd_recover_pm_error(struct ufs_hba *hba)
>  static bool ufshcd_is_pwr_mode_restore_needed(struct ufs_hba *hba)
>  {
>         struct ufs_pa_layer_attr *pwr_info = &hba->pwr_info;
> -       u32 mode;
> +       u32 mode = 0;
> 
>         ufshcd_dme_get(hba, UIC_ARG_MIB(PA_PWRMODE), &mode);
> 
> --
> 2.34.1
> 

Reviewed-by: Peter Wang <peter.wang@mediatek.com>


  reply	other threads:[~2025-10-02  8:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20251002070057epcas1p49ac487359f24f6813ba8f9f44bcf0924@epcas1p4.samsung.com>
2025-10-02  7:00 ` Wonkon Kim
2025-10-02  8:00   ` Peter Wang (王信友) [this message]
2025-10-02 16:18   ` Bart Van Assche
2025-10-02 16:23   ` Bart Van Assche
2025-10-13  2:23     ` Wonkon Kim
2025-10-13  8:20     ` Wonkon Kim
2025-10-13 16:19       ` Bart Van Assche
2025-10-14  4:35         ` Wonkon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9fda4a263951753ca7c8d90b454f00f6815b64c6.camel@mediatek.com \
    --to=peter.wang@mediatek.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=wkon.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®