emmc interrupt blackout issue fix

sendfifo() function need enable BWR_IE before checking if BWE is enabled
to avoid BWE to be activated between the BWE check and BWR interrupt
enabling, which causes the interrupt to be missed and Data Timeout error.
This commit is contained in:
Jari Nippula 2023-04-14 10:51:57 +03:00 committed by Xiang Xiao
parent c23babbcc7
commit 9b60f8d9d0

View file

@ -729,12 +729,22 @@ static void mpfs_sendfifo(struct mpfs_dev_s *priv)
* come back when we're good to write again.
*/
if (priv->remaining && (!(getreg32(MPFS_EMMCSD_SRS09) &
MPFS_EMMCSD_SRS09_BWE)))
if (priv->remaining)
{
modifyreg32(MPFS_EMMCSD_SRS14, 0, MPFS_EMMCSD_SRS14_BWR_IE);
/* Enable BWR before checking BWE bit */
putreg32(MPFS_EMMCSD_SRS12_BWR, MPFS_EMMCSD_SRS12);
return;
modifyreg32(MPFS_EMMCSD_SRS14, 0, MPFS_EMMCSD_SRS14_BWR_IE);
if (!(getreg32(MPFS_EMMCSD_SRS09) & MPFS_EMMCSD_SRS09_BWE))
{
return;
}
/* There is still room for writing to buffer,
* disable BWR and continue.
*/
modifyreg32(MPFS_EMMCSD_SRS14, MPFS_EMMCSD_SRS14_BWR_IE, 0);
}
}