Skip to contentSkip to conversation

2.36.1 sdhci R5C822 regression

DISCUSSION Bringfried Stecklum 2 participants 6 messages Dec 17, 2010 – Dec 31, 2010 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

I recently upgraded from 3.6.31-22 to 3.6.36-1 (Ubuntu kernel nomenclature) and am quite happy with it apart from the card reader

stecklum@extragalactix:~$ lspci |grep Ricoh
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host
Adapter (rev 22)
03:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter
(rev 12)
03:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)

which used to work flawlessly in the past, e.g. with previous kernel 2.6.31-22.

On resume from hibernation (suspend is fine) a kernel trace happens along with the well-know "IRQ nobody cared" statement (see below). The interrupt gets disabled, and since mmc0 is compiled into the kernel, I cannot do anything about it (I tried CONFIG_MMC_RICOH_MMC=m but this will be overriden during the build).

I checked with both WLAN and WWAN disabled in BIOS, same behaviour. So spurious interrupts can be ruled out. Also booting with irqpoll does not help.

extragalactix kernel: [ 156.991348] Restarting tasks ... done.

Nov 24 09:58:43 extragalactix kernel: [  157.420395] tg3 0000:09:00.0: eth0:
Link is up at 100 Mbps, full duplex
Nov 24 09:58:43 extragalactix kernel: [  157.420404] tg3 0000:09:00.0: eth0:
Flow control is on for TX and on for RX
Nov 24 09:58:43 extragalactix anacron[6896]: Anacron 2.3 started on 2010-11-24
Nov 24 09:58:43 extragalactix anacron[6896]: Normal exit (0 jobs run)
Nov 24 09:58:43 extragalactix laptop-mode: Laptop mode
Nov 24 09:58:43 extragalactix laptop-mode: enabled,
Nov 24 09:58:43 extragalactix laptop-mode: not active [unchanged]
Nov 24 09:58:43 extragalactix kernel: [  158.018563] irq 18: nobody cared(try
booting with the "irqpoll" option)
Nov 24 09:58:43 extragalactix kernel: [  158.018724] Pid: 0, comm: swapper
Tainted: P            2.6.36-1-generic #7
Nov 24 09:58:43 extragalactix kernel: [  158.018726] Call Trace:
Nov 24 09:58:43 extragalactix kernel: [  158.018728]  <IRQ>
[<ffffffffa00c5ead>] ? r852_irq+0xfd/0x290 [r852]
Nov 24 09:58:43 extragalactix kernel: [  158.018746]  [<ffffffff810ca5e6>]
__report_bad_irq+0x26/0xa0
Nov 24 09:58:43 extragalactix kernel: [  158.018749]  [<ffffffff810ca7e8>]
note_interrupt+0x188/0x1d0
Nov 24 09:58:43 extragalactix kernel: [  158.018751]  [<ffffffff810caffd>]
handle_fasteoi_irq+0xdd/0x110
Nov 24 09:58:43 extragalactix kernel: [  158.018755]  [<ffffffff8100dbaf>]
handle_irq+0x1f/0x30
Nov 24 09:58:43 extragalactix kernel: [  158.018757]  [<ffffffff8100d06a>]
do_IRQ+0x6a/0xf0
Nov 24 09:58:43 extragalactix kernel: [  158.018761]  [<ffffffff816019d3>]
ret_from_intr+0x0/0x11
Nov 24 09:58:43 extragalactix kernel: [  158.018762]  <EOI>
[<ffffffff81375e6f>] ? acpi_idle_enter_c1+0x9f/0xbe
Nov 24 09:58:43 extragalactix kernel: [  158.018768]  [<ffffffff81375e4d>] ?
acpi_idle_enter_c1+0x7d/0xbe
Nov 24 09:58:43 extragalactix kernel: [  158.018772]  [<ffffffff814c437c>]
cpuidle_idle_call+0xcc/0x150
Nov 24 09:58:43 extragalactix kernel: [  158.018775]  [<ffffffff8100a1a7>]
cpu_idle+0xc7/0x170
Nov 24 09:58:43 extragalactix kernel: [  158.018778]  [<ffffffff815e583d>]
rest_init+0x6d/0x80
Nov 24 09:58:43 extragalactix kernel: [  158.018782]  [<ffffffff81cdeead>]
start_kernel+0x340/0x409
Nov 24 09:58:43 extragalactix kernel: [  158.018784]  [<ffffffff81cde2c0>]
x86_64_start_reservations+0xa0/0xc1
Nov 24 09:58:43 extragalactix kernel: [  158.018787]  [<ffffffff81cde3ea>]
x86_64_start_kernel+0x109/0x124
Nov 24 09:58:43 extragalactix kernel: [  158.018789]  [<ffffffff81cde140>] ?
early_idt_handler+0x0/0x71
Nov 24 09:58:43 extragalactix kernel: [  158.018791] handlers:
Nov 24 09:58:43 extragalactix kernel: [  158.018843] [<ffffffffa00c5db0>]
(r852_irq+0x0/0x290 [r852])
Nov 24 09:58:43 extragalactix kernel: [  158.018983] [<ffffffffa0130ab0>]
(sdhci_irq+0x0/0x650 [sdhci])
Nov 24 09:58:43 extragalactix kernel: [  158.019128] Disabling IRQ #18
...
extragalactix kernel: [  167.040050] mmc0: Timeout waiting for hardware interrupt.
Nov 24 09:58:53 extragalactix kernel: [  167.040055] sdhci: ==============
REGISTER DUMP ==============
Nov 24 09:58:53 extragalactix kernel: [  167.040061] sdhci: Sys addr: 0x00000000
| Version:  0x00000400
Nov 24 09:58:53 extragalactix kernel: [  167.040066] sdhci: Blk size: 0x00000000
| Blk cnt:  0x00000000
Nov 24 09:58:53 extragalactix kernel: [  167.040070] sdhci: Argument: 0x00000000
| Trn mode: 0x00000000
Nov 24 09:58:53 extragalactix kernel: [  167.040074] sdhci: Present:  0x01f70000
| Host ctl: 0x00000001
Nov 24 09:58:53 extragalactix kernel: [  167.040078] sdhci: Power:    0x0000000f
| Blk gap:  0x00000000
Nov 24 09:58:53 extragalactix kernel: [  167.040082] sdhci: Wake-up:  0x00000000
| Clock:    0x00004007
Nov 24 09:58:53 extragalactix kernel: [  167.040086] sdhci: Timeout:  0x00000000
| Int stat: 0x00000000
Nov 24 09:58:53 extragalactix kernel: [  167.040089] sdhci: Int enab: 0x00ff00c3
| Sig enab: 0x00ff00c3
Nov 24 09:58:53 extragalactix kernel: [  167.040093] sdhci: AC12 err: 0x00000000
| Slot int: 0x00000001
Nov 24 09:58:53 extragalactix kernel: [  167.040097] sdhci: Caps:     0x00c02120
| Max curr: 0x00000040
Nov 24 09:58:53 extragalactix kernel: [  167.040098] sdhci:

===========================================

Signature · 6 lines
Dr. Bringfried Stecklum
Thüringer Landessternwarte
Sternwarte 5
07778 Tautenburg, Germany
Phone: +49-36427-863-54
FAX:   +49-36427-863-29
#1 lore raw

Hi Bringfried,

Quoted 4 lines · Bringfried Stecklum

On resume from hibernation (suspend is fine) a kernel trace happens along with the well-know "IRQ nobody cared" statement (see below). The interrupt gets disabled, and since mmc0 is compiled into the kernel, I cannot do anything about it (I tried CONFIG_MMC_RICOH_MMC=m but this will be overriden during the build).

Please try the patch below, and let us know if it cures the problem for you. Thanks! (This patch is already scheduled for inclusion in 2.6.37.)

- Chris.

From: Takashi Iwai <[email protected]>
Date: Fri, 10 Dec 2010 08:40:31 +0100
Subject: mmc: Fix re-probing with PM_POST_RESTORE notification

In the error-path where PM notifies PM_POST_RESTORE, the rescan-blockage should be cleared as well. Otherwise it'll be never re-probed.

Also, as a bonus, this fixes a bug in S4 with user-mode suspend in the current code, as it sends PM_POST_RESTORE instead of PM_POST_HIBERNATION wrongly.

---
 drivers/mmc/core/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mmc/core/core.c +1 -0
index 6286898..e7c0c78 100644
@@ -1833,6 +1833,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
 
 	case PM_POST_SUSPEND:
 	case PM_POST_HIBERNATION:
+	case PM_POST_RESTORE:
 
 		spin_lock_irqsave(&host->lock, flags);
 		host->rescan_disable = 0;
Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#2 lore raw
Quoted 36 lines · Chris Ball

Hi Bringfried,

Quoted 4 lines · Bringfried Stecklum

On resume from hibernation (suspend is fine) a kernel trace happens along with the well-know "IRQ nobody cared" statement (see below). The interrupt gets disabled, and since mmc0 is compiled into the kernel, I cannot do anything about it (I tried CONFIG_MMC_RICOH_MMC=m but this will be overriden during the build).

Please try the patch below, and let us know if it cures the problem for you. Thanks! (This patch is already scheduled for inclusion in 2.6.37.)

- Chris.

From: Takashi Iwai <[email protected]>
Date: Fri, 10 Dec 2010 08:40:31 +0100
Subject: mmc: Fix re-probing with PM_POST_RESTORE notification

In the error-path where PM notifies PM_POST_RESTORE, the rescan-blockage should be cleared as well. Otherwise it'll be never re-probed.

Also, as a bonus, this fixes a bug in S4 with user-mode suspend in the current code, as it sends PM_POST_RESTORE instead of PM_POST_HIBERNATION wrongly.

---
 drivers/mmc/core/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mmc/core/core.c +0 -0
index 6286898..e7c0c78 100644

drivers/mmc/core/core.c int mmc_pm_notify(struct notifier_block *notify_block, · line 1839

Quoted 7 lines
drivers/mmc/core/core.c +1 -0
@@ -1833,6 +1833,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
 
 	case PM_POST_SUSPEND:
 	case PM_POST_HIBERNATION:
+	case PM_POST_RESTORE:
 
 		spin_lock_irqsave(&host->lock, flags);
 		host->rescan_disable = 0;

Thanks for the patch which, however, does not solve the problem. Now I don't get the oops immediately upon resume from hibernation but later, on inserting the card (2.6.37 is no solution at the moment since my system is on a Reiser4 partition, so I have to wait for those patches).

Dec 17 18:44:34 extragalactix kernel: [  161.320496] irq 18: nobody cared (try
booting with the "irqpoll" option)
Dec 17 18:44:34 extragalactix kernel: [  161.320510] Pid: 0, comm: kworker/0:0
Tainted: P            2.6.36-1-generic #7
Dec 17 18:44:34 extragalactix kernel: [  161.320515] Call Trace:
Dec 17 18:44:34 extragalactix kernel: [  161.320520]  <IRQ>
[<ffffffffa01131b2>] ? sdhci_irq+0xd2/0x2c4 [sdhci]
Dec 17 18:44:34 extragalactix kernel: [  161.320562]  [<ffffffff810ca5e6>]
__report_bad_irq+0x26/0xa0
Dec 17 18:44:34 extragalactix kernel: [  161.320571]  [<ffffffff810ca7e8>]
note_interrupt+0x188/0x1d0
Dec 17 18:44:34 extragalactix kernel: [  161.320579]  [<ffffffff810caffd>]
handle_fasteoi_irq+0xdd/0x110
Dec 17 18:44:34 extragalactix kernel: [  161.320589]  [<ffffffff8100dbaf>]
handle_irq+0x1f/0x30
Dec 17 18:44:34 extragalactix kernel: [  161.320596]  [<ffffffff8100d06a>]
do_IRQ+0x6a/0xf0
Dec 17 18:44:34 extragalactix kernel: [  161.320606]  [<ffffffff816019d3>]
ret_from_intr+0x0/0x11
Dec 17 18:44:34 extragalactix kernel: [  161.320610]  <EOI>
[<ffffffff813761fa>] ? acpi_idle_enter_simple+0xe4/0x11e
Dec 17 18:44:34 extragalactix kernel: [  161.320628]  [<ffffffff813761f3>] ?
acpi_idle_enter_simple+0xdd/0x11e
Dec 17 18:44:34 extragalactix kernel: [  161.320638]  [<ffffffff814c435c>]
cpuidle_idle_call+0xcc/0x150
Dec 17 18:44:34 extragalactix kernel: [  161.320647]  [<ffffffff8100a1a7>]
cpu_idle+0xc7/0x170
Dec 17 18:44:34 extragalactix kernel: [  161.320657]  [<ffffffff815fa87d>]
start_secondary+0xdd/0x110
Dec 17 18:44:34 extragalactix kernel: [  161.320662] handlers:
Dec 17 18:44:34 extragalactix kernel: [  161.320666] [<ffffffffa0144db0>]
(r852_irq+0x0/0x290 [r852])
Dec 17 18:44:34 extragalactix kernel: [  161.320679] [<ffffffffa01130e0>]
(sdhci_irq+0x0/0x2c4 [sdhci])
Dec 17 18:44:34 extragalactix kernel: [  161.320691] Disabling IRQ #18
Dec 17 18:44:43 extragalactix kernel: [  169.760266] mmc0: Timeout waiting for
hardware interrupt.
Dec 17 18:44:43 extragalactix kernel: [  169.760276] sdhci: ==============
REGISTER DUMP ==============
Dec 17 18:44:43 extragalactix kernel: [  169.760285] sdhci: Sys addr: 0x00000000
| Version:  0x00000400
Dec 17 18:44:43 extragalactix kernel: [  169.760293] sdhci: Blk size: 0x00000000
| Blk cnt:  0x00000000
Dec 17 18:44:43 extragalactix kernel: [  169.760300] sdhci: Argument: 0x00000000
| Trn mode: 0x00000000
Dec 17 18:44:43 extragalactix kernel: [  169.760307] sdhci: Present:  0x01f70000
| Host ctl: 0x00000001
Dec 17 18:44:43 extragalactix kernel: [  169.760314] sdhci: Power:    0x0000000f
| Blk gap:  0x00000000
Dec 17 18:44:43 extragalactix kernel: [  169.760322] sdhci: Wake-up:  0x00000000
| Clock:    0x00004007
Dec 17 18:44:43 extragalactix kernel: [  169.760329] sdhci: Timeout:  0x00000000
| Int stat: 0x00000000
Dec 17 18:44:43 extragalactix kernel: [  169.760336] sdhci: Int enab: 0x00ff00c3
| Sig enab: 0x00ff00c3
Dec 17 18:44:43 extragalactix kernel: [  169.760343] sdhci: AC12 err: 0x00000000
| Slot int: 0x00000001
Dec 17 18:44:43 extragalactix kernel: [  169.760351] sdhci: Caps:     0x00c02120
| Max curr: 0x00000040
Dec 17 18:44:43 extragalactix kernel: [  169.760355] sdhci:

===========================================
...

#3 lore raw

I just tried with the irqpoll option which prevents the kernel oops indeed (unlike without the patch) but I still get the timeout waiting for hardware interrupt message. The number of irqs seems to be exceedingly high, e.g.

cat /proc/interrupts
CPU0 CPU1

  0:      20239       2789   IO-APIC-edge      timer
  1:         84          2   IO-APIC-edge      i8042
  8:          0          1   IO-APIC-edge      rtc0
  9:          0          1   IO-APIC-fasteoi   acpi
 12:        181         73   IO-APIC-edge      i8042
 14:       1431        340   IO-APIC-edge      ata_piix
 15:          0          0   IO-APIC-edge      ata_piix
 16:          0          0   IO-APIC-fasteoi   pata_jmicron
 18:     933200          0   IO-APIC-fasteoi   r852, mmc0

...

#4 lore raw

I figured out that a suspend to memory after resuming from hibernation is a remedy. When the system is back from suspend, the card is properly reckognised.

#5 lore raw
In reply to Bringfried Stecklum

Hi Bringfried,

Quoted 4 lines · Bringfried Stecklum

Thanks for the patch which, however, does not solve the problem. Now I don't get the oops immediately upon resume from hibernation but later, on inserting the card (2.6.37 is no solution at the moment since my system is on a Reiser4 partition, so I have to wait for those patches).

If you're able to at some point, it'd be very helpful to do some Git bisection here.

Thanks,

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child