mirror of
https://github.com/apache/nuttx.git
synced 2026-09-08 09:56:33 +00:00
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:
parent
c23babbcc7
commit
9b60f8d9d0
1 changed files with 14 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue