All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
@ 2017-01-16 14:23 Gabriel Krisman Bertazi
  2017-01-19 10:28 ` Adrian Hunter
  2017-01-19 20:37 ` Ulf Hansson
  0 siblings, 2 replies; 9+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-01-16 14:23 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson; +Cc: linux-mmc, Gabriel Krisman Bertazi

One of our kernelCI boxes hanged at boot because a faulty eSDHC device
was triggering spurious CARD_INT interrupts for SD cards, causing CMD52
reads, which are not allowed for SD devices.  This adds a sanity check
to the interruption path, preventing that illegal command from getting
sent if the CARD_INT interruption should be disabled.

This quirk allows that particular machine to resume boot despite the
faulty hardware, instead of getting hung dealing with thousands of
mishandled interrupts.

Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
CC: Ulf Hansson <ulf.hansson@linaro.org>
CC: linux-mmc@vger.kernel.org
---
 drivers/mmc/host/sdhci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 51cd4f0e973f..a2efa25c7f3b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2733,7 +2733,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
 		if (intmask & SDHCI_INT_RETUNE)
 			mmc_retune_needed(host->mmc);
 
-		if (intmask & SDHCI_INT_CARD_INT) {
+		if ((intmask & SDHCI_INT_CARD_INT) &&
+		    (host->ier & SDHCI_INT_CARD_INT)) {
 			sdhci_enable_sdio_irq_nolock(host, false);
 			host->thread_isr |= SDHCI_INT_CARD_INT;
 			result = IRQ_WAKE_THREAD;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-16 14:23 [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts Gabriel Krisman Bertazi
@ 2017-01-19 10:28 ` Adrian Hunter
  2017-01-19 20:37 ` Ulf Hansson
  1 sibling, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2017-01-19 10:28 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, ulf.hansson; +Cc: linux-mmc

On 16/01/17 16:23, Gabriel Krisman Bertazi wrote:
> One of our kernelCI boxes hanged at boot because a faulty eSDHC device
> was triggering spurious CARD_INT interrupts for SD cards, causing CMD52
> reads, which are not allowed for SD devices.  This adds a sanity check
> to the interruption path, preventing that illegal command from getting
> sent if the CARD_INT interruption should be disabled.
> 
> This quirk allows that particular machine to resume boot despite the
> faulty hardware, instead of getting hung dealing with thousands of
> mishandled interrupts.
> 
> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> CC: Ulf Hansson <ulf.hansson@linaro.org>
> CC: linux-mmc@vger.kernel.org

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 51cd4f0e973f..a2efa25c7f3b 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2733,7 +2733,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
>  		if (intmask & SDHCI_INT_RETUNE)
>  			mmc_retune_needed(host->mmc);
>  
> -		if (intmask & SDHCI_INT_CARD_INT) {
> +		if ((intmask & SDHCI_INT_CARD_INT) &&
> +		    (host->ier & SDHCI_INT_CARD_INT)) {
>  			sdhci_enable_sdio_irq_nolock(host, false);
>  			host->thread_isr |= SDHCI_INT_CARD_INT;
>  			result = IRQ_WAKE_THREAD;
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-16 14:23 [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts Gabriel Krisman Bertazi
  2017-01-19 10:28 ` Adrian Hunter
@ 2017-01-19 20:37 ` Ulf Hansson
  2017-01-27 19:20   ` Gabriel Krisman Bertazi
  1 sibling, 1 reply; 9+ messages in thread
From: Ulf Hansson @ 2017-01-19 20:37 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: Adrian Hunter, linux-mmc

On 16 January 2017 at 15:23, Gabriel Krisman Bertazi
<krisman@collabora.co.uk> wrote:
> One of our kernelCI boxes hanged at boot because a faulty eSDHC device
> was triggering spurious CARD_INT interrupts for SD cards, causing CMD52
> reads, which are not allowed for SD devices.  This adds a sanity check
> to the interruption path, preventing that illegal command from getting
> sent if the CARD_INT interruption should be disabled.
>
> This quirk allows that particular machine to resume boot despite the
> faulty hardware, instead of getting hung dealing with thousands of
> mishandled interrupts.
>
> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> CC: Ulf Hansson <ulf.hansson@linaro.org>
> CC: linux-mmc@vger.kernel.org

Thanks, applied for next with update commit msg header and by removing
the CCs from the changelog.

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 51cd4f0e973f..a2efa25c7f3b 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2733,7 +2733,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
>                 if (intmask & SDHCI_INT_RETUNE)
>                         mmc_retune_needed(host->mmc);
>
> -               if (intmask & SDHCI_INT_CARD_INT) {
> +               if ((intmask & SDHCI_INT_CARD_INT) &&
> +                   (host->ier & SDHCI_INT_CARD_INT)) {
>                         sdhci_enable_sdio_irq_nolock(host, false);
>                         host->thread_isr |= SDHCI_INT_CARD_INT;
>                         result = IRQ_WAKE_THREAD;
> --
> 2.11.0
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-19 20:37 ` Ulf Hansson
@ 2017-01-27 19:20   ` Gabriel Krisman Bertazi
  2017-01-30  8:19     ` Ulf Hansson
  0 siblings, 1 reply; 9+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-01-27 19:20 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Adrian Hunter, linux-mmc, Gustavo Padovan, Sjoerd Simons

Ulf Hansson <ulf.hansson@linaro.org> writes:

> On 16 January 2017 at 15:23, Gabriel Krisman Bertazi
> <krisman@collabora.co.uk> wrote:
>> One of our kernelCI boxes hanged at boot because a faulty eSDHC device
>> was triggering spurious CARD_INT interrupts for SD cards, causing CMD52
>> reads, which are not allowed for SD devices.  This adds a sanity check
>> to the interruption path, preventing that illegal command from getting
>> sent if the CARD_INT interruption should be disabled.
>>
>> This quirk allows that particular machine to resume boot despite the
>> faulty hardware, instead of getting hung dealing with thousands of
>> mishandled interrupts.
>>
>> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
>> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>> CC: Ulf Hansson <ulf.hansson@linaro.org>
>> CC: linux-mmc@vger.kernel.org
>
> Thanks, applied for next with update commit msg header and by removing
> the CCs from the changelog.

Hi Ulf,

Thanks for applying.  Although, I saw it got queued to the next merge
window, but I we believe it to be -rc material, since it fixes a hang
in our kernelCI boxes[1], and is preventing us from testing other features
in this box.  Can you consider submitting it to Linus for the next -rc?
it will be much appreciated!

[1]  <https://kernelci.org/boot/id/5881c81859b5140b59f6c3ae/>

Thanks.

-- 
Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-27 19:20   ` Gabriel Krisman Bertazi
@ 2017-01-30  8:19     ` Ulf Hansson
  2017-01-30 12:34       ` Gabriel Krisman Bertazi
  0 siblings, 1 reply; 9+ messages in thread
From: Ulf Hansson @ 2017-01-30  8:19 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi
  Cc: Adrian Hunter, linux-mmc, Gustavo Padovan, Sjoerd Simons

On 27 January 2017 at 20:20, Gabriel Krisman Bertazi
<krisman@collabora.co.uk> wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> On 16 January 2017 at 15:23, Gabriel Krisman Bertazi
>> <krisman@collabora.co.uk> wrote:
>>> One of our kernelCI boxes hanged at boot because a faulty eSDHC device
>>> was triggering spurious CARD_INT interrupts for SD cards, causing CMD52
>>> reads, which are not allowed for SD devices.  This adds a sanity check
>>> to the interruption path, preventing that illegal command from getting
>>> sent if the CARD_INT interruption should be disabled.
>>>
>>> This quirk allows that particular machine to resume boot despite the
>>> faulty hardware, instead of getting hung dealing with thousands of
>>> mishandled interrupts.
>>>
>>> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
>>> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>>> CC: Ulf Hansson <ulf.hansson@linaro.org>
>>> CC: linux-mmc@vger.kernel.org
>>
>> Thanks, applied for next with update commit msg header and by removing
>> the CCs from the changelog.
>
> Hi Ulf,
>
> Thanks for applying.  Although, I saw it got queued to the next merge
> window, but I we believe it to be -rc material, since it fixes a hang
> in our kernelCI boxes[1], and is preventing us from testing other features
> in this box.  Can you consider submitting it to Linus for the next -rc?
> it will be much appreciated!

I can do that, but perhaps this should then be tagged for stable as well?

Or was this a regression in 4.10?

Kind regards
Uffe

>
> [1]  <https://kernelci.org/boot/id/5881c81859b5140b59f6c3ae/>
>
> Thanks.
>
> --
> Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-30  8:19     ` Ulf Hansson
@ 2017-01-30 12:34       ` Gabriel Krisman Bertazi
  2017-01-30 12:40         ` Adrian Hunter
  0 siblings, 1 reply; 9+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-01-30 12:34 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Adrian Hunter, linux-mmc, Gustavo Padovan, Sjoerd Simons

Ulf Hansson <ulf.hansson@linaro.org> writes:

> On 27 January 2017 at 20:20, Gabriel Krisman Bertazi
> <krisman@collabora.co.uk> wrote:
>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>
>>> On 16 January 2017 at 15:23, Gabriel Krisman Bertazi
>>> <krisman@collabora.co.uk> wrote:
>>>> One of our kernelCI boxes hanged at boot because a faulty eSDHC
>>>> device
>>>> was triggering spurious CARD_INT interrupts for SD cards, causing
>>>> CMD52
>>>> reads, which are not allowed for SD devices.  This adds a sanity
>>>> check
>>>> to the interruption path, preventing that illegal command from
>>>> getting
>>>> sent if the CARD_INT interruption should be disabled.
>>>>
>>>> This quirk allows that particular machine to resume boot despite the
>>>> faulty hardware, instead of getting hung dealing with thousands of
>>>> mishandled interrupts.
>>>>
>>>> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
>>>> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>>>> CC: Ulf Hansson <ulf.hansson@linaro.org>
>>>> CC: linux-mmc@vger.kernel.org
>>>
>>> Thanks, applied for next with update commit msg header and by
>>> removing
>>> the CCs from the changelog.
>>
>> Hi Ulf,
>>
>> Thanks for applying.  Although, I saw it got queued to the next merge
>> window, but I we believe it to be -rc material, since it fixes a hang
>> in our kernelCI boxes[1], and is preventing us from testing other
>> features
>> in this box.  Can you consider submitting it to Linus for the next
>> -rc?
>> it will be much appreciated!
>
> I can do that, but perhaps this should then be tagged for stable as
> well?
>

Thanks Ulf.  Yes, it should go to stable releases as well.  I tested it
on 4.4 and 4.9 already.

-- 
Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-30 12:34       ` Gabriel Krisman Bertazi
@ 2017-01-30 12:40         ` Adrian Hunter
  2017-01-30 13:40           ` Gabriel Krisman Bertazi
  0 siblings, 1 reply; 9+ messages in thread
From: Adrian Hunter @ 2017-01-30 12:40 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi, Ulf Hansson
  Cc: linux-mmc, Gustavo Padovan, Sjoerd Simons

On 30/01/17 14:34, Gabriel Krisman Bertazi wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
> 
>> On 27 January 2017 at 20:20, Gabriel Krisman Bertazi
>> <krisman@collabora.co.uk> wrote:
>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>>
>>>> On 16 January 2017 at 15:23, Gabriel Krisman Bertazi
>>>> <krisman@collabora.co.uk> wrote:
>>>>> One of our kernelCI boxes hanged at boot because a faulty eSDHC
>>>>> device
>>>>> was triggering spurious CARD_INT interrupts for SD cards, causing
>>>>> CMD52
>>>>> reads, which are not allowed for SD devices.  This adds a sanity
>>>>> check
>>>>> to the interruption path, preventing that illegal command from
>>>>> getting
>>>>> sent if the CARD_INT interruption should be disabled.
>>>>>
>>>>> This quirk allows that particular machine to resume boot despite the
>>>>> faulty hardware, instead of getting hung dealing with thousands of
>>>>> mishandled interrupts.
>>>>>
>>>>> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
>>>>> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
>>>>> CC: Ulf Hansson <ulf.hansson@linaro.org>
>>>>> CC: linux-mmc@vger.kernel.org
>>>>
>>>> Thanks, applied for next with update commit msg header and by
>>>> removing
>>>> the CCs from the changelog.
>>>
>>> Hi Ulf,
>>>
>>> Thanks for applying.  Although, I saw it got queued to the next merge
>>> window, but I we believe it to be -rc material, since it fixes a hang
>>> in our kernelCI boxes[1], and is preventing us from testing other
>>> features
>>> in this box.  Can you consider submitting it to Linus for the next
>>> -rc?
>>> it will be much appreciated!
>>
>> I can do that, but perhaps this should then be tagged for stable as
>> well?
>>
> 
> Thanks Ulf.  Yes, it should go to stable releases as well.  I tested it
> on 4.4 and 4.9 already.

Did you test normal SDIO operation was unaffected?  Please do that before
sending it to stable.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-30 12:40         ` Adrian Hunter
@ 2017-01-30 13:40           ` Gabriel Krisman Bertazi
  2017-01-31 10:35             ` Ulf Hansson
  0 siblings, 1 reply; 9+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-01-30 13:40 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Ulf Hansson, linux-mmc, Gustavo Padovan, Sjoerd Simons

Adrian Hunter <adrian.hunter@intel.com> writes:
> Did you test normal SDIO operation was unaffected?  Please do that before
> sending it to stable.

I don't have any SDIO card in hand to confirm it right now.  would you
or Ulf be able to give it a try?  I'll keep looking for one.

-- 
Gabriel Krisman Bertazi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts
  2017-01-30 13:40           ` Gabriel Krisman Bertazi
@ 2017-01-31 10:35             ` Ulf Hansson
  0 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2017-01-31 10:35 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi
  Cc: Adrian Hunter, linux-mmc, Gustavo Padovan, Sjoerd Simons

On 30 January 2017 at 14:40, Gabriel Krisman Bertazi
<krisman@collabora.co.uk> wrote:
> Adrian Hunter <adrian.hunter@intel.com> writes:
>> Did you test normal SDIO operation was unaffected?  Please do that before
>> sending it to stable.
>
> I don't have any SDIO card in hand to confirm it right now.  would you
> or Ulf be able to give it a try?  I'll keep looking for one.

Sorry, I don't have any SDIO cards at hand that is using sdhci.

Still, as this has been tested for a while already in next, I decided
to move this to my fixes branch. I also added a stable-tag #4.4+.

If we see some issues, please report asap then I will drop the change.
I plan to send it to Linus on Friday this week.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-31 10:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-16 14:23 [PATCH v2 RESEND] sdhci: Ignore unexpected CARD_INT interrupts Gabriel Krisman Bertazi
2017-01-19 10:28 ` Adrian Hunter
2017-01-19 20:37 ` Ulf Hansson
2017-01-27 19:20   ` Gabriel Krisman Bertazi
2017-01-30  8:19     ` Ulf Hansson
2017-01-30 12:34       ` Gabriel Krisman Bertazi
2017-01-30 12:40         ` Adrian Hunter
2017-01-30 13:40           ` Gabriel Krisman Bertazi
2017-01-31 10:35             ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.