Two small fixes that address an issue where it is observed in stress
testing that a MHI device could appear to enter a bad state and be unable
to recover unless the module is removed and re-added which should not be
necessary.
Jeffrey Hugo (2):
bus: mhi: host: Remove duplicate ee check for syserr
bus: mhi: host: Use mhi_tryset_pm_state() for setting fw error state
drivers/bus/mhi/host/boot.c | 16 ++++++++++++----
drivers/bus/mhi/host/main.c | 2 +-
2 files changed, 13 insertions(+), 5 deletions(-)
--
2.7.4
If we detect a system error via intvec, we only process the syserr if the
current ee is different than the last observed ee. The reason for this
check is to prevent bhie from running multiple times, but with the single
queue handling syserr, that is not possible.
The check can cause an issue with device recovery. If PBL loads a bad SBL
via BHI, but that SBL hangs before notifying the host of an ee change,
then issuing soc_reset to crash the device and retry (after supplying a
fixed SBL) will not recover the device as the host will observe a PBL->PBL
transition and not process the syserr. The device will be stuck until
either the driver is reloaded, or the host is rebooted. Instead, remove
the check so that we can attempt to recover the device.
Signed-off-by: Jeffrey Hugo <[email protected]>
Reviewed-by: Carl Vanderlip <[email protected]>
---
drivers/bus/mhi/host/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
index df0fbfe..0c3a009 100644
--- a/drivers/bus/mhi/host/main.c
+++ b/drivers/bus/mhi/host/main.c
@@ -503,7 +503,7 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
}
write_unlock_irq(&mhi_cntrl->pm_lock);
- if (pm_state != MHI_PM_SYS_ERR_DETECT || ee == mhi_cntrl->ee)
+ if (pm_state != MHI_PM_SYS_ERR_DETECT)
goto exit_intvec;
switch (ee) {
--
2.7.4
On Mon, Apr 03, 2023 at 11:07:35AM +0530, Manivannan Sadhasivam wrote:
> On Tue, Jan 24, 2023 at 02:57:23PM -0700, Jeffrey Hugo wrote:
> > If we detect a system error via intvec, we only process the syserr if the
> > current ee is different than the last observed ee. The reason for this
> > check is to prevent bhie from running multiple times, but with the single
> > queue handling syserr, that is not possible.
> >
> > The check can cause an issue with device recovery. If PBL loads a bad SBL
> > via BHI, but that SBL hangs before notifying the host of an ee change,
> > then issuing soc_reset to crash the device and retry (after supplying a
> > fixed SBL) will not recover the device as the host will observe a PBL->PBL
> > transition and not process the syserr. The device will be stuck until
> > either the driver is reloaded, or the host is rebooted. Instead, remove
> > the check so that we can attempt to recover the device.
> >
> > Signed-off-by: Jeffrey Hugo <[email protected]>
>
> Reviewed-by: Manivannan Sadhasivam <[email protected]>
>
Forgot to add that, this patch also needs a fixes tag and backporting.
- Mani
> - Mani
>
> > Reviewed-by: Carl Vanderlip <[email protected]>
> > ---
> > drivers/bus/mhi/host/main.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
> > index df0fbfe..0c3a009 100644
> > --- a/drivers/bus/mhi/host/main.c
> > +++ b/drivers/bus/mhi/host/main.c
> > @@ -503,7 +503,7 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
> > }
> > write_unlock_irq(&mhi_cntrl->pm_lock);
> >
> > - if (pm_state != MHI_PM_SYS_ERR_DETECT || ee == mhi_cntrl->ee)
> > + if (pm_state != MHI_PM_SYS_ERR_DETECT)
> > goto exit_intvec;
> >
> > switch (ee) {
> > --
> > 2.7.4
> >
>
> --
> மணிவண்ணன் சதாசிவம்
--
மணிவண்ணன் சதாசிவம்
On Tue, Jan 24, 2023 at 02:57:23PM -0700, Jeffrey Hugo wrote:
> If we detect a system error via intvec, we only process the syserr if the
> current ee is different than the last observed ee. The reason for this
> check is to prevent bhie from running multiple times, but with the single
> queue handling syserr, that is not possible.
>
> The check can cause an issue with device recovery. If PBL loads a bad SBL
> via BHI, but that SBL hangs before notifying the host of an ee change,
> then issuing soc_reset to crash the device and retry (after supplying a
> fixed SBL) will not recover the device as the host will observe a PBL->PBL
> transition and not process the syserr. The device will be stuck until
> either the driver is reloaded, or the host is rebooted. Instead, remove
> the check so that we can attempt to recover the device.
>
> Signed-off-by: Jeffrey Hugo <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
- Mani
> Reviewed-by: Carl Vanderlip <[email protected]>
> ---
> drivers/bus/mhi/host/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
> index df0fbfe..0c3a009 100644
> --- a/drivers/bus/mhi/host/main.c
> +++ b/drivers/bus/mhi/host/main.c
> @@ -503,7 +503,7 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
> }
> write_unlock_irq(&mhi_cntrl->pm_lock);
>
> - if (pm_state != MHI_PM_SYS_ERR_DETECT || ee == mhi_cntrl->ee)
> + if (pm_state != MHI_PM_SYS_ERR_DETECT)
> goto exit_intvec;
>
> switch (ee) {
> --
> 2.7.4
>
--
மணிவண்ணன் சதாசிவம்