Thread (20 messages) 20 messages, 5 authors, 2012-08-27

Re: [PATCH 07/10] mmc: omap_hsmmc: consolidate flush posted writes for HSMMC IRQs

From: S, Venkatraman <hidden>
Date: 2012-08-27 11:02:22
Also in: linux-omap

On Tue, Aug 21, 2012 at 8:51 PM, T Krishnamoorthy, Balaji
[off-list ref] wrote:
On Sat, Aug 18, 2012 at 12:22 AM, Venkatraman S [off-list ref] wrote:
quoted
Flushing spurious IRQs from HSMMC IP is done twice in
omap_hsmmc_irq and omap_hsmmc_do_irq.
spurious IRQ is flushed in start of omap_hsmmc_do_irq
and irq acked at the end of omap_hsmmc_do_irq
quoted
Consolidate them to one location.
if you wanted to consolidated ...
quoted
Signed-off-by: Venkatraman S <redacted>
---
 drivers/mmc/host/omap_hsmmc.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4bc55ac..20453c8 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -969,15 +969,6 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
        struct mmc_data *data;
        int end_cmd = 0, end_trans = 0;

-       if (!host->req_in_progress) {
just do a return from here
I think it's still better to filter out the validation to the outer
function and let do_irq to just 'do' it.
quoted
-               do {
-                       OMAP_HSMMC_WRITE(host->base, STAT, status);
-                       /* Flush posted write */
-                       status = OMAP_HSMMC_READ(host->base, STAT);
-               } while (status & INT_EN_MASK);
-               return;
-       }
-
        data = host->data;
        dev_vdbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
@@ -1028,8 +1019,6 @@ 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) && host->cmd))
                omap_hsmmc_cmd_done(host, host->cmd);
        if ((end_trans || (status & TC)) && host->mrq)
@@ -1045,11 +1034,13 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
        int status;

        status = OMAP_HSMMC_READ(host->base, STAT);
-       do {
+       while (status & INT_EN_MASK && host->req_in_progress) {
and remove the check for host->req_in_progress
I think do while loop can be retained as it will get executed once anyway.
It's a minor issue, and the consolidation of the check for
req_in_progress makes sure that it might
sometimes be not executed at all..

quoted
                omap_hsmmc_do_irq(host, status);
+
quoted
                /* Flush posted write */
comment is misplaced
Ok. I'll remove.
quoted
+               OMAP_HSMMC_WRITE(host->base, STAT, status);
                status = OMAP_HSMMC_READ(host->base, STAT);
-       } while (status & INT_EN_MASK);
+       }

        return IRQ_HANDLED;
 }
--
1.7.11.1.25.g0e18bef
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help