Re: [PATCH v2] ufs: core: fix deadlock when rtc update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2024-07-15 at 14:38 +0800, peter.wang@xxxxxxxxxxxx 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.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux