diff mbox

[2/2] sdio: report error if pending IRQ but none function bits

Message ID 1306874008-28867-3-git-send-email-per.forlin@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Per Forlin May 31, 2011, 8:33 p.m. UTC
Return error in case of pending IRQ but none functions bits
in CCCR_INTx is set.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
---
 drivers/mmc/core/sdio_irq.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Comments

Nicolas Pitre June 1, 2011, 2:30 p.m. UTC | #1
On Tue, 31 May 2011, Per Forlin wrote:

> Return error in case of pending IRQ but none functions bits
> in CCCR_INTx is set.
> 
> Signed-off-by: Per Forlin <per.forlin@linaro.org>
> ---
>  drivers/mmc/core/sdio_irq.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
> index 2f81ddc..8184b6e 100644
> --- a/drivers/mmc/core/sdio_irq.c
> +++ b/drivers/mmc/core/sdio_irq.c
> @@ -50,6 +50,11 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
>  		return ret;
>  	}
>  
> +	if (!pending) {
> +		printk(KERN_WARNING "%s: pending IRQ but none function bits\n",
> +		       mmc_card_id(card));
> +		ret = -EINVAL;
> +	}

Nope, this won't work with the polled interrupt mode.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Per Forlin June 7, 2011, 7:02 a.m. UTC | #2
On 1 June 2011 16:30, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> On Tue, 31 May 2011, Per Forlin wrote:
>
>> Return error in case of pending IRQ but none functions bits
>> in CCCR_INTx is set.
>>
>> Signed-off-by: Per Forlin <per.forlin@linaro.org>
>> ---
>>  drivers/mmc/core/sdio_irq.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
>> index 2f81ddc..8184b6e 100644
>> --- a/drivers/mmc/core/sdio_irq.c
>> +++ b/drivers/mmc/core/sdio_irq.c
>> @@ -50,6 +50,11 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
>>               return ret;
>>       }
>>
>> +     if (!pending) {
>> +             printk(KERN_WARNING "%s: pending IRQ but none function bits\n",
>> +                    mmc_card_id(card));
>> +             ret = -EINVAL;
>> +     }
>
> Nope, this won't work with the polled interrupt mode.
I'll drop this patch.

Thanks for your comment,
Per
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 2f81ddc..8184b6e 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -50,6 +50,11 @@  static int process_sdio_pending_irqs(struct mmc_card *card)
 		return ret;
 	}
 
+	if (!pending) {
+		printk(KERN_WARNING "%s: pending IRQ but none function bits\n",
+		       mmc_card_id(card));
+		ret = -EINVAL;
+	}
 	count = 0;
 	for (i = 1; i <= 7; i++) {
 		if (pending & (1 << i)) {