Re: [PATCH 1/1] scsi: ufs: core: Fix EH failure after wlun resume error

From: Brian Kao

Date: Wed Nov 12 2025 - 04:29:48 EST


[RESEND using plain text]

Hi Peter,

This log actually is triggered by fault injection when wlun is suspended
echo 0xf > /sys/kernel/debug/ufshcd/3c2d0000.ufs/saved_uic_err

In a real-world scenario, this situation can occur when an error
interrupt calls `ufshcd_check_errors()`, which schedules the error
handler before the system reaches `ufshcd_set_dev_pwr_mode()`.

Thanks,
Brian


On Wed, Nov 12, 2025 at 5:18 PM Brian Kao <powenkao@xxxxxxxxxx> wrote:
>
> Hi Peter,
>
> This log actually is triggered by fault injection when wlun is suspended
> echo 0xf > /sys/kernel/debug/ufshcd/3c2d0000.ufs/saved_uic_err
>
> In a real-world scenario, this situation can occur when an error interrupt calls `ufshcd_check_errors()`, which schedules the error handler before the system reaches `ufshcd_set_dev_pwr_mode()`.
>
> Thanks,
> Brian
>
>
> On Wed, Nov 12, 2025 at 4:17 PM Peter Wang (王信友) <peter.wang@xxxxxxxxxxxx> wrote:
>>
>> On Wed, 2025-11-12 at 06:32 +0000, Po-Wen Kao wrote:
>> > google-ufshcd 3c2d0000.ufs: ufshcd_err_handler started; HBA state
>> > eh_fatal; ...
>> > ufs_device_wlun 0:0:0:49488: START_STOP failed for power mode: 1,
>> > result 40000
>> > ufs_device_wlun 0:0:0:49488: ufshcd_wl_runtime_resume failed: -5
>> > ...
>> > ufs_device_wlun 0:0:0:49488: runtime PM trying to activate child
>> > device 0:0:0:49488 but parent (target0:0:0) is not active
>> >
>>
>> Hi Brian,
>>
>> How is ufshcd_err_handler triggered before the parent device
>> resumes? I mean, what causes ufshcd_err_handler to be
>> triggered, an error interrupt or something else?
>>
>> Thanks
>> Peter
>>
>>
>> ************* MEDIATEK Confidentiality Notice
>> ********************
>> The information contained in this e-mail message (including any
>> attachments) may be confidential, proprietary, privileged, or otherwise
>> exempt from disclosure under applicable laws. It is intended to be
>> conveyed only to the designated recipient(s). Any use, dissemination,
>> distribution, printing, retaining or copying of this e-mail (including its
>> attachments) by unintended recipient(s) is strictly prohibited and may
>> be unlawful. If you are not an intended recipient of this e-mail, or believe
>>
>> that you have received this e-mail in error, please notify the sender
>> immediately (by replying to this e-mail), delete any and all copies of
>> this e-mail (including any attachments) from your system, and do not
>> disclose the content of this e-mail to any other person. Thank you!