From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from buildserver.ru.mvista.com (unknown [213.79.90.228]) by ozlabs.org (Postfix) with ESMTP id C9BA11008B1 for ; Wed, 14 Jul 2010 23:08:02 +1000 (EST) Date: Wed, 14 Jul 2010 17:08:01 +0400 From: Anton Vorontsov To: Andrew Morton Subject: [PATCH 3/8] sdhci: Clear interrupt status register just once Message-ID: <20100714130801.GC517@oksana.dev.rtsoft.ru> References: <20100714130728.GA27339@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: <20100714130728.GA27339@oksana.dev.rtsoft.ru> Cc: Matt Fleming , Albert Herranz , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Ben Dooks , Pierre Ossman List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , There's no need to clear the interrupt status register bit-by-bit, we can just clear it once. This simplifies irq handler. Signed-off-by: Anton Vorontsov --- drivers/mmc/host/sdhci.c | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 748a2e3..9ec245c 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1522,38 +1522,29 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) goto out; } + sdhci_writel(host, intmask, SDHCI_INT_STATUS); + DBG("*** %s got interrupt: 0x%08x\n", mmc_hostname(host->mmc), intmask); - if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { - sdhci_writel(host, intmask & (SDHCI_INT_CARD_INSERT | - SDHCI_INT_CARD_REMOVE), SDHCI_INT_STATUS); + if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) schedule_work(&host->card_detect_work); - } intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); - if (intmask & SDHCI_INT_CMD_MASK) { - sdhci_writel(host, intmask & SDHCI_INT_CMD_MASK, - SDHCI_INT_STATUS); + if (intmask & SDHCI_INT_CMD_MASK) sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK); - } - if (intmask & SDHCI_INT_DATA_MASK) { - sdhci_writel(host, intmask & SDHCI_INT_DATA_MASK, - SDHCI_INT_STATUS); + if (intmask & SDHCI_INT_DATA_MASK) sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK); - } intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); intmask &= ~SDHCI_INT_ERROR; - if (intmask & SDHCI_INT_BUS_POWER) { + if (intmask & SDHCI_INT_BUS_POWER) printk(KERN_ERR "%s: Card is consuming too much power!\n", mmc_hostname(host->mmc)); - sdhci_writel(host, SDHCI_INT_BUS_POWER, SDHCI_INT_STATUS); - } intmask &= ~SDHCI_INT_BUS_POWER; @@ -1566,8 +1557,6 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) printk(KERN_ERR "%s: Unexpected interrupt 0x%08x.\n", mmc_hostname(host->mmc), intmask); sdhci_dumpregs(host); - - sdhci_writel(host, intmask, SDHCI_INT_STATUS); } result = IRQ_HANDLED; -- 1.7.0.5