2021-02-23 08:46:02

by Daejun Park

[permalink] [raw]
Subject: RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

> > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1, &ppn);
> > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> > + if (unlikely(err < 0)) {
> > + /*
> > + * In this case, the region state is active,
> > + * but the ppn table is not allocated.
> > + * Make sure that ppn table must be allocated on
> > + * active state.
> > + */
> > + WARN_ON(true);
> > + dev_err(hba->dev, "get ppn failed. err %d\n", err);
> Maybe just pr_warn instead of risking crashing the machine over that?

Why it crashing the machine? WARN_ON will just print kernel message.

Thanks,
Daejun


2021-02-23 09:32:31

by Avri Altman

[permalink] [raw]
Subject: RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

>
>
> > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1,
> &ppn);
> > > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> > > + if (unlikely(err < 0)) {
> > > + /*
> > > + * In this case, the region state is active,
> > > + * but the ppn table is not allocated.
> > > + * Make sure that ppn table must be allocated on
> > > + * active state.
> > > + */
> > > + WARN_ON(true);
> > > + dev_err(hba->dev, "get ppn failed. err %d\n", err);
> > Maybe just pr_warn instead of risking crashing the machine over that?
>
> Why it crashing the machine? WARN_ON will just print kernel message.
I think that it can be configured, but I am not sure.

>
> Thanks,
> Daejun

2021-02-23 09:34:07

by Avri Altman

[permalink] [raw]
Subject: RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

> > > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1,
> > &ppn);
> > > > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> > > > + if (unlikely(err < 0)) {
> > > > + /*
> > > > + * In this case, the region state is active,
> > > > + * but the ppn table is not allocated.
> > > > + * Make sure that ppn table must be allocated on
> > > > + * active state.
> > > > + */
> > > > + WARN_ON(true);
> > > > + dev_err(hba->dev, "get ppn failed. err %d\n", err);
> > > Maybe just pr_warn instead of risking crashing the machine over that?
> >
> > Why it crashing the machine? WARN_ON will just print kernel message.
> I think that it can be configured, but I am not sure.
I think it can be configured via the parameter panic_on_warn

2021-02-23 10:04:38

by Daejun Park

[permalink] [raw]
Subject: RE: RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region

> > > > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1,
> > > &ppn);
> > > > > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> > > > > + if (unlikely(err < 0)) {
> > > > > + /*
> > > > > + * In this case, the region state is active,
> > > > > + * but the ppn table is not allocated.
> > > > > + * Make sure that ppn table must be allocated on
> > > > > + * active state.
> > > > > + */
> > > > > + WARN_ON(true);
> > > > > + dev_err(hba->dev, "get ppn failed. err %d\n", err);
> > > > Maybe just pr_warn instead of risking crashing the machine over that?
> > >
> > > Why it crashing the machine? WARN_ON will just print kernel message.
> > I think that it can be configured, but I am not sure.
> I think it can be configured via the parameter panic_on_warn

OK, I will change WARN_ON to dev_err for print message.

Thanks,
Daejun