mmc: omap_hsmmc: clear status flags before starting a new command
Subsystems (2)
PATCH 1/1 mmc: omap_hsmmc: clear status flags before starting a new command
Commit 1f6b9fa40e76fffaaa0b3bd6a0bfdcf1cdc06efa consolidated writes to the STAT register in one location, moving them from omap_hsmmc_do_irq() to omap_hsmmc_irq(). This move has the unwanted side effect that the controller status flags are potentially cleared after a new command has been started as a consequence of reading the previous status flags. This means that if the new command changes the status flags before the IRQ routine returns, those flags may be cleared without handling the event which asserted them, and thus missing the event.
Move the writing of the STAT register back in omap_hsmmc_do_irq(), before handling the status flags which generated the interrupt.
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/omap_hsmmc.c +1 -1
@@ -1041,6 +1041,7 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status) } } +OMAP_HSMMC_WRITE (host->base,STAT , status);if (end_cmd || ((status &CC_EN ) && host->cmd))omap_hsmmc_cmd_done (host, host->cmd);if ((end_trans || (status &TC_EN )) && host->mrq)
@@ -1060,7 +1061,6 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)omap_hsmmc_do_irq (host, status);/* Flush posted write */ -OMAP_HSMMC_WRITE (host->base,STAT , status); status =OMAP_HSMMC_READ (host->base,STAT ); }
Signature · 1 line
1.7.5.4
Hi Balaji,
Quoted 29 lines · Francesco Lavra
Commit
1f6b9fa40e76fffaaa0b3bd6a0bfdcf1cdc06efaconsolidated writes to the STAT register in one location, moving them fromomap_hsmmc_do_irq()toomap_hsmmc_irq(). This move has the unwanted side effect that the controller status flags are potentially cleared after a new command has been started as a consequence of reading the previous status flags. This means that if the new command changes the status flags before the IRQ routine returns, those flags may be cleared without handling the event which asserted them, and thus missing the event.
Move the writing of the STAT register back inomap_hsmmc_do_irq(), before handling the status flags which generated the interrupt.Signed-off-by Francesco Lavra <[email protected]>--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mmc/host/omap_hsmmc.c +1
-0@@ -1041,6 +1041,7 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status) } } +OMAP_HSMMC_WRITE (host->base,STAT , status);if (end_cmd || ((status &CC_EN ) && host->cmd))omap_hsmmc_cmd_done (host, host->cmd);if ((end_trans || (status &TC_EN )) && host->mrq)
drivers/mmc/host/omap_hsmmc.c static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id) · line 1065
Quoted 6 lines
drivers/mmc/host/omap_hsmmc.c +0
-1@@ -1060,7 +1061,6 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)omap_hsmmc_do_irq (host, status);/* Flush posted write */ -OMAP_HSMMC_WRITE (host->base,STAT , status); status =OMAP_HSMMC_READ (host->base,STAT ); }
Please could you review this patch? Thanks,
- Chris.
Signature · 1 line
Chris Ball <[email protected]> <http://printf.net/>
Quoted 11 lines · Francesco Lavra
Commit
1f6b9fa40e76fffaaa0b3bd6a0bfdcf1cdc06efaconsolidated writes to the STAT register in one location, moving them fromomap_hsmmc_do_irq()toomap_hsmmc_irq(). This move has the unwanted side effect that the controller status flags are potentially cleared after a new command has been started as a consequence of reading the previous status flags. This means that if the new command changes the status flags before the IRQ routine returns, those flags may be cleared without handling the event which asserted them, and thus missing the event.
Move the writing of the STAT register back inomap_hsmmc_do_irq(), before handling the status flags which generated the interrupt.
Quoted 1 line
Signed-off-by Francesco Lavra <[email protected]>
Reviewed and Tested-by: Balaji T K <[email protected]>
Quoted 25 lines
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mmc/host/omap_hsmmc.c +1
-1@@ -1041,6 +1041,7 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status) } } +OMAP_HSMMC_WRITE (host->base,STAT , status);if (end_cmd || ((status &CC_EN ) && host->cmd))omap_hsmmc_cmd_done (host, host->cmd);if ((end_trans || (status &TC_EN )) && host->mrq)@@ -1060,7 +1061,6 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)omap_hsmmc_do_irq (host, status);/* Flush posted write */ -OMAP_HSMMC_WRITE (host->base,STAT , status); status =OMAP_HSMMC_READ (host->base,STAT ); }
Hi,
Quoted 12 lines · Balaji T K
Quoted 11 lines · Francesco Lavra
Commit
1f6b9fa40e76fffaaa0b3bd6a0bfdcf1cdc06efaconsolidated writes to the STAT register in one location, moving them fromomap_hsmmc_do_irq()toomap_hsmmc_irq(). This move has the unwanted side effect that the controller status flags are potentially cleared after a new command has been started as a consequence of reading the previous status flags. This means that if the new command changes the status flags before the IRQ routine returns, those flags may be cleared without handling the event which asserted them, and thus missing the event.
Move the writing of the STAT register back inomap_hsmmc_do_irq(), before handling the status flags which generated the interrupt.
Quoted 3 lines
Quoted 1 line
Signed-off-by Francesco Lavra <[email protected]>Reviewed and Tested-by: Balaji T K <[email protected]>
Thanks, pushed to mmc-next for 3.12.
- Chris.
Signature · 1 line
Chris Ball <[email protected]> <http://printf.net/>