Re: [PATCH 2/2] scsi: ufs: Protect PM ops and err_handler from user access through sysfs

From: Bean Huo
Date: Mon Jan 11 2021 - 03:26:37 EST


On Mon, 2021-01-11 at 09:30 +0800, Can Guo wrote:
> > > +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.
>

It is only a suggestion, and others LLD use system_state, you prefer
adding new flags.

Bean

> Thanks,
> Can Guo.