public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: peter.wang@mediatek.com, linux-scsi@vger.kernel.org,
	 martin.petersen@oracle.com, avri.altman@wdc.com,
	alim.akhtar@samsung.com,  jejb@linux.ibm.com, beanhuo@micron.com
Cc: wsd_upstream@mediatek.com, linux-mediatek@lists.infradead.org,
	 chun-hung.wu@mediatek.com, alice.chao@mediatek.com,
	cc.chou@mediatek.com,  chaotian.jing@mediatek.com,
	jiajie.hao@mediatek.com, powen.kao@mediatek.com,
	 qilin.tan@mediatek.com, lin.gui@mediatek.com,
	tun-yu.yu@mediatek.com,  eddie.huang@mediatek.com,
	naomi.chu@mediatek.com, chu.stanley@gmail.com,
	 stable@vger.kernel.org
Subject: Re: [PATCH v2] ufs: core: fix deadlock when rtc update
Date: Mon, 15 Jul 2024 11:34:01 +0200	[thread overview]
Message-ID: <37c27c61ebf9e1db06a0d93adcc588fcaccec8ab.camel@gmail.com> (raw)
In-Reply-To: <20240715063831.29792-1-peter.wang@mediatek.com>

On Mon, 2024-07-15 at 14:38 +0800, peter.wang@mediatek.com wrote:
> @@ -8171,7 +8171,10 @@ static void ufshcd_update_rtc(struct ufs_hba
> *hba)
>          */
>         val = ts64.tv_sec - hba->dev_info.rtc_time_baseline;
>  
> -       ufshcd_rpm_get_sync(hba);
> +       /* Skip update RTC if RPM state is not RPM_ACTIVE */
> +       if (ufshcd_rpm_get_if_active(hba) <= 0)
> +               return;
> +
>         err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
> QUERY_ATTR_IDN_SECONDS_PASSED,
>                                 0, 0, &val);
>         ufshcd_rpm_put_sync(hba);

My suggestion would be to not return here and just skip the update, but
reschedule it for the next time that doesn't affect the suspend/resume
flow you're worried about.

  parent reply	other threads:[~2024-07-15  9:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15  6:38 [PATCH v2] ufs: core: fix deadlock when rtc update peter.wang
2024-07-15  9:29 ` Bean Huo
2024-07-15  9:34 ` Bean Huo [this message]
2024-07-15  9:37 ` Bean Huo
2024-07-15 11:48   ` Peter Wang (王信友)
2024-07-15 17:17 ` Bart Van Assche
2024-07-16  2:03   ` Peter Wang (王信友)
2024-07-16  2:57 ` Martin K. Petersen
2024-07-23  1:23 ` Martin K. Petersen

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=37c27c61ebf9e1db06a0d93adcc588fcaccec8ab.camel@gmail.com \
    --to=huobean@gmail.com \
    --cc=alice.chao@mediatek.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chu.stanley@gmail.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=jejb@linux.ibm.com \
    --cc=jiajie.hao@mediatek.com \
    --cc=lin.gui@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=naomi.chu@mediatek.com \
    --cc=peter.wang@mediatek.com \
    --cc=powen.kao@mediatek.com \
    --cc=qilin.tan@mediatek.com \
    --cc=stable@vger.kernel.org \
    --cc=tun-yu.yu@mediatek.com \
    --cc=wsd_upstream@mediatek.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