lkml.org 
[lkml]   [2021]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] scsi: ufs: Protect PM ops and err_handler from user access through sysfs
On 2021-01-11 00:18, Bean Huo wrote:
> On Sat, 2021-01-02 at 05:59 -0800, Can Guo wrote:
>> + * @shutting_down: flag to check if shutdown has been invoked
>> + * @host_sem: semaphore used to serialize concurrent contexts
>> * @eh_wq: Workqueue that eh_work works on
>> * @eh_work: Worker to handle UFS errors that require s/w attention
>> * @eeh_work: Worker to handle exception events
>> @@ -751,7 +753,8 @@ struct ufs_hba {
>> u32 intr_mask;
>> u16 ee_ctrl_mask;
>> bool is_powered;
>> - struct semaphore eh_sem;
>> + bool shutting_down;
>> + struct semaphore host_sem;
>>
>> /* Work Queues */
>> struct workqueue_struct *eh_wq;
>> @@ -875,6 +878,11 @@ static inline bool ufshcd_is_wb_allowed(struct
>> ufs_hba *hba)
>> return hba->caps & UFSHCD_CAP_WB_EN;
>> }
>>
>> +static inline bool ufshcd_is_sysfs_allowed(struct ufs_hba *hba)
>> +{
>> + return !hba->shutting_down;
>> +}
>> +
>
>
> Can,
>
> Instead adding new shutting_down flag, can we use availible variable
> system_state?
>
> Thanks,
> Bean

Hi Bean,

I prefer the flag shutting_down, it tells us whether ufshcd_shutdown()
has been invoked or not. It comes handy when debug some system crash
issues caused by UFS during reboot/shutdown tests. system_state is too
wide in this case.

Thanks,
Can Guo.

\
 
 \ /
  Last update: 2021-01-11 02:32    [W:0.133 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site