* [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers
@ 2012-04-13 20:43 Nicolas Pitre
2012-04-15 8:00 ` Sujit Reddy Thumma
2012-04-16 23:16 ` [PATCH v2] " Nicolas Pitre
0 siblings, 2 replies; 7+ messages in thread
From: Nicolas Pitre @ 2012-04-13 20:43 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc
Commit 06e8935feb "optimized SDIO IRQ handling for single irq"
introduced some spurious calls to SDIO function interrupt handlers,
such as when the SDIO IRQ thread is started, or the safety check
performed upon a system resume. Let's add a flag to perform the
optimization only when a real interrupt is signaled by the host
driver and we know there is no point confirming it.
Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@kernel.org
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index f573e7f9f7..3d8ceb4084 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -28,18 +28,20 @@
#include "sdio_ops.h"
-static int process_sdio_pending_irqs(struct mmc_card *card)
+static int process_sdio_pending_irqs(struct mmc_host *host)
{
+ struct mmc_card *card = host->card;
int i, ret, count;
unsigned char pending;
struct sdio_func *func;
/*
* Optimization, if there is only 1 function interrupt registered
- * call irq handler directly
+ * and we know an IRQ was signaled then call irq handler directly.
+ * Otherwise do the full probe.
*/
func = card->sdio_single_irq;
- if (func) {
+ if (func && host->sdio_irq_pending) {
func->irq_handler(func);
return 1;
}
@@ -116,7 +118,8 @@ static int sdio_irq_thread(void *_host)
ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
if (ret)
break;
- ret = process_sdio_pending_irqs(host->card);
+ ret = process_sdio_pending_irqs(host);
+ host->sdio_irq_pending = false;
mmc_release_host(host);
/*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index ee2b0363c0..557aa4cd66 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -323,6 +323,7 @@ struct mmc_host {
unsigned int sdio_irqs;
struct task_struct *sdio_irq_thread;
+ bool sdio_irq_pending;
atomic_t sdio_irq_thread_abort;
mmc_pm_flag_t pm_flags; /* requested pm features */
@@ -378,6 +379,7 @@ extern int mmc_cache_ctrl(struct mmc_host *, u8);
static inline void mmc_signal_sdio_irq(struct mmc_host *host)
{
host->ops->enable_sdio_irq(host, 0);
+ host->sdio_irq_pending = true;
wake_up_process(host->sdio_irq_thread);
}
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers
2012-04-13 20:43 [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers Nicolas Pitre
@ 2012-04-15 8:00 ` Sujit Reddy Thumma
2012-04-15 13:02 ` Nicolas Pitre
2012-04-16 23:16 ` [PATCH v2] " Nicolas Pitre
1 sibling, 1 reply; 7+ messages in thread
From: Sujit Reddy Thumma @ 2012-04-15 8:00 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Chris Ball, linux-mmc
Hi Nicolas,
>
> Commit 06e8935feb "optimized SDIO IRQ handling for single irq"
> introduced some spurious calls to SDIO function interrupt handlers,
> such as when the SDIO IRQ thread is started, or the safety check
> performed upon a system resume. Let's add a flag to perform the
> optimization only when a real interrupt is signaled by the host
> driver and we know there is no point confirming it.
>
Thanks for putting up formal patch.
> Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> Cc: stable@kernel.org
>
> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
> index f573e7f9f7..3d8ceb4084 100644
> --- a/drivers/mmc/core/sdio_irq.c
> +++ b/drivers/mmc/core/sdio_irq.c
> @@ -28,18 +28,20 @@
>
> #include "sdio_ops.h"
>
> -static int process_sdio_pending_irqs(struct mmc_card *card)
> +static int process_sdio_pending_irqs(struct mmc_host *host)
> {
> + struct mmc_card *card = host->card;
> int i, ret, count;
> unsigned char pending;
> struct sdio_func *func;
>
> /*
> * Optimization, if there is only 1 function interrupt registered
> - * call irq handler directly
> + * and we know an IRQ was signaled then call irq handler directly.
> + * Otherwise do the full probe.
> */
> func = card->sdio_single_irq;
> - if (func) {
> + if (func && host->sdio_irq_pending) {
> func->irq_handler(func);
> return 1;
> }
> @@ -116,7 +118,8 @@ static int sdio_irq_thread(void *_host)
> ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
> if (ret)
> break;
> - ret = process_sdio_pending_irqs(host->card);
> + ret = process_sdio_pending_irqs(host);
> + host->sdio_irq_pending = false;
> mmc_release_host(host);
>
> /*
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index ee2b0363c0..557aa4cd66 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -323,6 +323,7 @@ struct mmc_host {
>
> unsigned int sdio_irqs;
> struct task_struct *sdio_irq_thread;
> + bool sdio_irq_pending;
> atomic_t sdio_irq_thread_abort;
>
> mmc_pm_flag_t pm_flags; /* requested pm features */
> @@ -378,6 +379,7 @@ extern int mmc_cache_ctrl(struct mmc_host *, u8);
> static inline void mmc_signal_sdio_irq(struct mmc_host *host)
> {
> host->ops->enable_sdio_irq(host, 0);
> + host->sdio_irq_pending = true;
> wake_up_process(host->sdio_irq_thread);
> }
In this case probably we need to add the following:
@@ -946,8 +946,11 @@ static int mmc_sdio_resume(struct mmc_host *host)
}
}
- if (!err && host->sdio_irqs)
- mmc_signal_sdio_irq(host);
+ if (!err && host->sdio_irqs) {
+ host->ops->enable_sdio_irq(host, 0);
+ wake_up_process(host->sdio_irq_thread);
+ }
>
> --
> 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
>
--
Thanks & Regards,
Sujit Reddy Thumma
Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers
2012-04-15 8:00 ` Sujit Reddy Thumma
@ 2012-04-15 13:02 ` Nicolas Pitre
2012-04-15 14:59 ` Sujit Reddy Thumma
0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Pitre @ 2012-04-15 13:02 UTC (permalink / raw)
To: Sujit Reddy Thumma; +Cc: Chris Ball, linux-mmc
On Sun, 15 Apr 2012, Sujit Reddy Thumma wrote:
> Hi Nicolas,
>
> >
> > Commit 06e8935feb "optimized SDIO IRQ handling for single irq"
> > introduced some spurious calls to SDIO function interrupt handlers,
> > such as when the SDIO IRQ thread is started, or the safety check
> > performed upon a system resume. Let's add a flag to perform the
> > optimization only when a real interrupt is signaled by the host
> > driver and we know there is no point confirming it.
> >
>
> Thanks for putting up formal patch.
>
> > Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
> > Signed-off-by: Nicolas Pitre <nico@linaro.org>
> > Cc: stable@kernel.org
> >
> > diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
> > index f573e7f9f7..3d8ceb4084 100644
> > --- a/drivers/mmc/core/sdio_irq.c
> > +++ b/drivers/mmc/core/sdio_irq.c
> > @@ -28,18 +28,20 @@
> >
> > #include "sdio_ops.h"
> >
> > -static int process_sdio_pending_irqs(struct mmc_card *card)
> > +static int process_sdio_pending_irqs(struct mmc_host *host)
> > {
> > + struct mmc_card *card = host->card;
> > int i, ret, count;
> > unsigned char pending;
> > struct sdio_func *func;
> >
> > /*
> > * Optimization, if there is only 1 function interrupt registered
> > - * call irq handler directly
> > + * and we know an IRQ was signaled then call irq handler directly.
> > + * Otherwise do the full probe.
> > */
> > func = card->sdio_single_irq;
> > - if (func) {
> > + if (func && host->sdio_irq_pending) {
> > func->irq_handler(func);
> > return 1;
> > }
> > @@ -116,7 +118,8 @@ static int sdio_irq_thread(void *_host)
> > ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
> > if (ret)
> > break;
> > - ret = process_sdio_pending_irqs(host->card);
> > + ret = process_sdio_pending_irqs(host);
> > + host->sdio_irq_pending = false;
> > mmc_release_host(host);
> >
> > /*
> > diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> > index ee2b0363c0..557aa4cd66 100644
> > --- a/include/linux/mmc/host.h
> > +++ b/include/linux/mmc/host.h
> > @@ -323,6 +323,7 @@ struct mmc_host {
> >
> > unsigned int sdio_irqs;
> > struct task_struct *sdio_irq_thread;
> > + bool sdio_irq_pending;
> > atomic_t sdio_irq_thread_abort;
> >
> > mmc_pm_flag_t pm_flags; /* requested pm features */
> > @@ -378,6 +379,7 @@ extern int mmc_cache_ctrl(struct mmc_host *, u8);
> > static inline void mmc_signal_sdio_irq(struct mmc_host *host)
> > {
> > host->ops->enable_sdio_irq(host, 0);
> > + host->sdio_irq_pending = true;
> > wake_up_process(host->sdio_irq_thread);
> > }
>
> In this case probably we need to add the following:
> @@ -946,8 +946,11 @@ static int mmc_sdio_resume(struct mmc_host *host)
> }
> }
>
> - if (!err && host->sdio_irqs)
> - mmc_signal_sdio_irq(host);
> + if (!err && host->sdio_irqs) {
> + host->ops->enable_sdio_irq(host, 0);
> + wake_up_process(host->sdio_irq_thread);
> + }
The call to enable_sdio_irq() is probably redundant. Only
wake_up_process() should be sufficient.
Nicolas
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers
2012-04-15 13:02 ` Nicolas Pitre
@ 2012-04-15 14:59 ` Sujit Reddy Thumma
2012-04-16 8:58 ` Ulf Hansson
0 siblings, 1 reply; 7+ messages in thread
From: Sujit Reddy Thumma @ 2012-04-15 14:59 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Sujit Reddy Thumma, Chris Ball, linux-mmc
> On Sun, 15 Apr 2012, Sujit Reddy Thumma wrote:
>
>> Hi Nicolas,
>>
>> >
>> > Commit 06e8935feb "optimized SDIO IRQ handling for single irq"
>> > introduced some spurious calls to SDIO function interrupt handlers,
>> > such as when the SDIO IRQ thread is started, or the safety check
>> > performed upon a system resume. Let's add a flag to perform the
>> > optimization only when a real interrupt is signaled by the host
>> > driver and we know there is no point confirming it.
>> >
>>
>> Thanks for putting up formal patch.
>>
>> > Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
>> > Signed-off-by: Nicolas Pitre <nico@linaro.org>
>> > Cc: stable@kernel.org
>> >
>> > diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
>> > index f573e7f9f7..3d8ceb4084 100644
>> > --- a/drivers/mmc/core/sdio_irq.c
>> > +++ b/drivers/mmc/core/sdio_irq.c
>> > @@ -28,18 +28,20 @@
>> >
>> > #include "sdio_ops.h"
>> >
>> > -static int process_sdio_pending_irqs(struct mmc_card *card)
>> > +static int process_sdio_pending_irqs(struct mmc_host *host)
>> > {
>> > + struct mmc_card *card = host->card;
>> > int i, ret, count;
>> > unsigned char pending;
>> > struct sdio_func *func;
>> >
>> > /*
>> > * Optimization, if there is only 1 function interrupt registered
>> > - * call irq handler directly
>> > + * and we know an IRQ was signaled then call irq handler directly.
>> > + * Otherwise do the full probe.
>> > */
>> > func = card->sdio_single_irq;
>> > - if (func) {
>> > + if (func && host->sdio_irq_pending) {
>> > func->irq_handler(func);
>> > return 1;
>> > }
>> > @@ -116,7 +118,8 @@ static int sdio_irq_thread(void *_host)
>> > ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
>> > if (ret)
>> > break;
>> > - ret = process_sdio_pending_irqs(host->card);
>> > + ret = process_sdio_pending_irqs(host);
>> > + host->sdio_irq_pending = false;
>> > mmc_release_host(host);
>> >
>> > /*
>> > diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>> > index ee2b0363c0..557aa4cd66 100644
>> > --- a/include/linux/mmc/host.h
>> > +++ b/include/linux/mmc/host.h
>> > @@ -323,6 +323,7 @@ struct mmc_host {
>> >
>> > unsigned int sdio_irqs;
>> > struct task_struct *sdio_irq_thread;
>> > + bool sdio_irq_pending;
>> > atomic_t sdio_irq_thread_abort;
>> >
>> > mmc_pm_flag_t pm_flags; /* requested pm features */
>> > @@ -378,6 +379,7 @@ extern int mmc_cache_ctrl(struct mmc_host *, u8);
>> > static inline void mmc_signal_sdio_irq(struct mmc_host *host)
>> > {
>> > host->ops->enable_sdio_irq(host, 0);
>> > + host->sdio_irq_pending = true;
>> > wake_up_process(host->sdio_irq_thread);
>> > }
>>
>> In this case probably we need to add the following:
>> @@ -946,8 +946,11 @@ static int mmc_sdio_resume(struct mmc_host *host)
>> }
>> }
>>
>> - if (!err && host->sdio_irqs)
>> - mmc_signal_sdio_irq(host);
>> + if (!err && host->sdio_irqs) {
>> + host->ops->enable_sdio_irq(host, 0);
>> + wake_up_process(host->sdio_irq_thread);
>> + }
>
> The call to enable_sdio_irq() is probably redundant. Only
> wake_up_process() should be sufficient.
>
True, I was wondering if we really need to wakeup sdio_irq_thread here. If
there is a pending interrupt is it not the host driver supposed to wake it
up or do you think it is needed for hosts that don't have CAP_SDIO_IRQ
set?
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers
2012-04-15 14:59 ` Sujit Reddy Thumma
@ 2012-04-16 8:58 ` Ulf Hansson
0 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2012-04-16 8:58 UTC (permalink / raw)
To: Sujit Reddy Thumma, Nicolas Pitre; +Cc: Chris Ball, linux-mmc@vger.kernel.org
On 04/15/2012 04:59 PM, Sujit Reddy Thumma wrote:
>
>> On Sun, 15 Apr 2012, Sujit Reddy Thumma wrote:
>>
>>> Hi Nicolas,
>>>
>>>>
>>>> Commit 06e8935feb "optimized SDIO IRQ handling for single irq"
>>>> introduced some spurious calls to SDIO function interrupt handlers,
>>>> such as when the SDIO IRQ thread is started, or the safety check
>>>> performed upon a system resume. Let's add a flag to perform the
>>>> optimization only when a real interrupt is signaled by the host
>>>> driver and we know there is no point confirming it.
>>>>
>>>
>>> Thanks for putting up formal patch.
>>>
>>>> Reported-by: Sujit Reddy Thumma<sthumma@codeaurora.org>
>>>> Signed-off-by: Nicolas Pitre<nico@linaro.org>
>>>> Cc: stable@kernel.org
>>>>
>>>> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
>>>> index f573e7f9f7..3d8ceb4084 100644
>>>> --- a/drivers/mmc/core/sdio_irq.c
>>>> +++ b/drivers/mmc/core/sdio_irq.c
>>>> @@ -28,18 +28,20 @@
>>>>
>>>> #include "sdio_ops.h"
>>>>
>>>> -static int process_sdio_pending_irqs(struct mmc_card *card)
>>>> +static int process_sdio_pending_irqs(struct mmc_host *host)
>>>> {
>>>> + struct mmc_card *card = host->card;
>>>> int i, ret, count;
>>>> unsigned char pending;
>>>> struct sdio_func *func;
>>>>
>>>> /*
>>>> * Optimization, if there is only 1 function interrupt registered
>>>> - * call irq handler directly
>>>> + * and we know an IRQ was signaled then call irq handler directly.
>>>> + * Otherwise do the full probe.
>>>> */
>>>> func = card->sdio_single_irq;
>>>> - if (func) {
>>>> + if (func&& host->sdio_irq_pending) {
>>>> func->irq_handler(func);
>>>> return 1;
>>>> }
>>>> @@ -116,7 +118,8 @@ static int sdio_irq_thread(void *_host)
>>>> ret = __mmc_claim_host(host,&host->sdio_irq_thread_abort);
>>>> if (ret)
>>>> break;
>>>> - ret = process_sdio_pending_irqs(host->card);
>>>> + ret = process_sdio_pending_irqs(host);
>>>> + host->sdio_irq_pending = false;
>>>> mmc_release_host(host);
>>>>
>>>> /*
>>>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>>>> index ee2b0363c0..557aa4cd66 100644
>>>> --- a/include/linux/mmc/host.h
>>>> +++ b/include/linux/mmc/host.h
>>>> @@ -323,6 +323,7 @@ struct mmc_host {
>>>>
>>>> unsigned int sdio_irqs;
>>>> struct task_struct *sdio_irq_thread;
>>>> + bool sdio_irq_pending;
>>>> atomic_t sdio_irq_thread_abort;
>>>>
>>>> mmc_pm_flag_t pm_flags; /* requested pm features */
>>>> @@ -378,6 +379,7 @@ extern int mmc_cache_ctrl(struct mmc_host *, u8);
>>>> static inline void mmc_signal_sdio_irq(struct mmc_host *host)
>>>> {
>>>> host->ops->enable_sdio_irq(host, 0);
>>>> + host->sdio_irq_pending = true;
>>>> wake_up_process(host->sdio_irq_thread);
>>>> }
>>>
>>> In this case probably we need to add the following:
>>> @@ -946,8 +946,11 @@ static int mmc_sdio_resume(struct mmc_host *host)
>>> }
>>> }
>>>
>>> - if (!err&& host->sdio_irqs)
>>> - mmc_signal_sdio_irq(host);
I think the idea with trying to signal an irq at this state is good and
should try to be maintained somehow.
Some SDIO devices has a separate GPIO line instead of using the DAT1
line for SDIO irq. In those cases the GPIO irq is configured as a wakeup
irq and then the SDIO irq is handled from this point and more important
after SDIO has been resumed.
Although I realize that the "optimized SDIO IRQ handling for single irq"
is messing up things here. What you would like to do here is to make
sure the CCCR register is read before really signaling the irq, even if
there is only one irq registered. Could we think of a nice way to handle
that I think I am in favor of keeping the SDIO irq signaling here.
>>> + if (!err&& host->sdio_irqs) {
>>> + host->ops->enable_sdio_irq(host, 0);
>>> + wake_up_process(host->sdio_irq_thread);
>>> + }
>>
>> The call to enable_sdio_irq() is probably redundant. Only
>> wake_up_process() should be sufficient.
>>
>
> True, I was wondering if we really need to wakeup sdio_irq_thread here. If
> there is a pending interrupt is it not the host driver supposed to wake it
> up or do you think it is needed for hosts that don't have CAP_SDIO_IRQ
> set?
>
> --
> 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
Kind regards
Ulf Hansson
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] mmc: sdio: avoid spurious calls to interrupt handlers
2012-04-13 20:43 [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers Nicolas Pitre
2012-04-15 8:00 ` Sujit Reddy Thumma
@ 2012-04-16 23:16 ` Nicolas Pitre
2012-04-18 23:49 ` Chris Ball
1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Pitre @ 2012-04-16 23:16 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc, Sujit Reddy Thumma
Commit 06e8935feb "optimized SDIO IRQ handling for single irq"
introduced some spurious calls to SDIO function interrupt handlers,
such as when the SDIO IRQ thread is started, or the safety check
performed upon a system resume. Let's add a flag to perform the
optimization only when a real interrupt is signaled by the host
driver and we know there is no point confirming it.
Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@kernel.org
---
V2: avoid using mmc_signal_sdio_irq() from mmc_sdio_resume(().
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 2c7c83f832..13d0e95380 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -947,7 +947,7 @@ static int mmc_sdio_resume(struct mmc_host *host)
}
if (!err && host->sdio_irqs)
- mmc_signal_sdio_irq(host);
+ wake_up_process(host->sdio_irq_thread);
mmc_release_host(host);
/*
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index f573e7f9f7..3d8ceb4084 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -28,18 +28,20 @@
#include "sdio_ops.h"
-static int process_sdio_pending_irqs(struct mmc_card *card)
+static int process_sdio_pending_irqs(struct mmc_host *host)
{
+ struct mmc_card *card = host->card;
int i, ret, count;
unsigned char pending;
struct sdio_func *func;
/*
* Optimization, if there is only 1 function interrupt registered
- * call irq handler directly
+ * and we know an IRQ was signaled then call irq handler directly.
+ * Otherwise do the full probe.
*/
func = card->sdio_single_irq;
- if (func) {
+ if (func && host->sdio_irq_pending) {
func->irq_handler(func);
return 1;
}
@@ -116,7 +118,8 @@ static int sdio_irq_thread(void *_host)
ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
if (ret)
break;
- ret = process_sdio_pending_irqs(host->card);
+ ret = process_sdio_pending_irqs(host);
+ host->sdio_irq_pending = false;
mmc_release_host(host);
/*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index cbde4b7e67..0707d228d7 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -297,6 +297,7 @@ struct mmc_host {
unsigned int sdio_irqs;
struct task_struct *sdio_irq_thread;
+ bool sdio_irq_pending;
atomic_t sdio_irq_thread_abort;
mmc_pm_flag_t pm_flags; /* requested pm features */
@@ -352,6 +353,7 @@ extern int mmc_cache_ctrl(struct mmc_host *, u8);
static inline void mmc_signal_sdio_irq(struct mmc_host *host)
{
host->ops->enable_sdio_irq(host, 0);
+ host->sdio_irq_pending = true;
wake_up_process(host->sdio_irq_thread);
}
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2] mmc: sdio: avoid spurious calls to interrupt handlers
2012-04-16 23:16 ` [PATCH v2] " Nicolas Pitre
@ 2012-04-18 23:49 ` Chris Ball
0 siblings, 0 replies; 7+ messages in thread
From: Chris Ball @ 2012-04-18 23:49 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: linux-mmc, Sujit Reddy Thumma
Hi,
On Mon, Apr 16 2012, Nicolas Pitre wrote:
> Commit 06e8935feb "optimized SDIO IRQ handling for single irq"
> introduced some spurious calls to SDIO function interrupt handlers,
> such as when the SDIO IRQ thread is started, or the safety check
> performed upon a system resume. Let's add a flag to perform the
> optimization only when a real interrupt is signaled by the host
> driver and we know there is no point confirming it.
>
> Reported-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> Cc: stable@kernel.org
Thanks, pushed v2 to mmc-next for 3.5.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-04-18 23:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-13 20:43 [PATCH] mmc: sdio: avoid spurious calls to interrupt handlers Nicolas Pitre
2012-04-15 8:00 ` Sujit Reddy Thumma
2012-04-15 13:02 ` Nicolas Pitre
2012-04-15 14:59 ` Sujit Reddy Thumma
2012-04-16 8:58 ` Ulf Hansson
2012-04-16 23:16 ` [PATCH v2] " Nicolas Pitre
2012-04-18 23:49 ` Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).