* at91sam9g45: MMC: Issues with MMC driver
@ 2011-08-02 11:05 Prasant J
2011-08-02 14:03 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Prasant J @ 2011-08-02 11:05 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
I'm using Linux 3.0.0 on a custom board design based on AT91SAM9G45-EKES
I'm getting this kernel dump while booting:
Waiting 3sec before mounting root device...
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card at address 0007
mmcblk0: mmc0:0007 SU02G 1.83 GiB
mmcblk0: p1 p2
eth0: link up (100/Full)
EXT3-fs: barriers not enabled
kjournald starting. Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
Freeing init memory: 116K
------------[ cut here ]------------
WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x6c/0x18c()
irq 11 handler atmci_interrupt+0x0/0x6e4 enabled interrupts
Modules linked in:
[<c00307a4>] (unwind_backtrace+0x0/0xec) from [<c003af7c>]
(warn_slowpath_common+0x4c/0x64)
[<c003af7c>] (warn_slowpath_common+0x4c/0x64) from [<c003b028>]
(warn_slowpath_fmt+0x30/0x40)
[<c003b028>] (warn_slowpath_fmt+0x30/0x40) from [<c006530c>]
(handle_irq_event_percpu+0x6c/0x18c)
[<c006530c>] (handle_irq_event_percpu+0x6c/0x18c) from [<c0065454>]
(handle_irq_event+0x28/0x38)
[<c0065454>] (handle_irq_event+0x28/0x38) from [<c0067594>]
(handle_level_irq+0xc8/0xdc)
[<c0067594>] (handle_level_irq+0xc8/0xdc) from [<c0065058>]
(generic_handle_irq+0x28/0x30)
[<c0065058>] (generic_handle_irq+0x28/0x30) from [<c0025064>]
(asm_do_IRQ+0x64/0x98)
[<c0025064>] (asm_do_IRQ+0x64/0x98) from [<c002b374>] (__irq_svc+0x34/0x60)
Exception stack(0xc02b7f68 to 0xc02b7fb0)
7f60: 00000000 0005317f 0005217f 60000013 c02b6000 c02bab9c
7f80: c02baa18 c02d18e4 70004000 41069265 700203d0 00000000 600000d3 c02b7fb0
7fa0: c002cc5c c002cc68 60000013 ffffffff
[<c002b374>] (__irq_svc+0x34/0x60) from [<c002cc68>] (default_idle+0x38/0x40)
[<c002cc68>] (default_idle+0x38/0x40) from [<c002ca90>] (cpu_idle+0x68/0xbc)
[<c002ca90>] (cpu_idle+0x68/0xbc) from [<c00089fc>] (start_kernel+0x284/0x2e4)
[<c00089fc>] (start_kernel+0x284/0x2e4) from [<70008040>] (0x70008040)
---[ end trace 6f60efeaa497bae3 ]---
Can someone tell me what is possibly wrong in the mmc driver's
interrupt handler?
-Prasant
^ permalink raw reply [flat|nested] 3+ messages in thread
* at91sam9g45: MMC: Issues with MMC driver
2011-08-02 11:05 at91sam9g45: MMC: Issues with MMC driver Prasant J
@ 2011-08-02 14:03 ` Russell King - ARM Linux
2011-08-03 4:52 ` Prasant J
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2011-08-02 14:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Aug 02, 2011 at 04:35:58PM +0530, Prasant J wrote:
> Hi,
>
> I'm using Linux 3.0.0 on a custom board design based on AT91SAM9G45-EKES
>
> I'm getting this kernel dump while booting:
>
>
> Waiting 3sec before mounting root device...
> mmc0: host does not support reading read-only switch. assuming write-enable.
> mmc0: new SD card at address 0007
> mmcblk0: mmc0:0007 SU02G 1.83 GiB
> mmcblk0: p1 p2
> eth0: link up (100/Full)
> EXT3-fs: barriers not enabled
> kjournald starting. Commit interval 5 seconds
> EXT3-fs (mmcblk0p2): using internal journal
> EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
> VFS: Mounted root (ext3 filesystem) on device 179:2.
> Freeing init memory: 116K
> ------------[ cut here ]------------
> WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x6c/0x18c()
>
> Can someone tell me what is possibly wrong in the mmc driver's
> interrupt handler?
This is what I said to someone who asked about this a week ago. It
desperately needs fixing properly.
Subject: at91sam9g45: Issues while working with RAM that is separated
on physical address space
On Tue, Jul 26, 2011 at 03:37:02PM +0200, Christian Glindkamp wrote:
> The only problem that still exits with highmem for me is the following:
> Even on non-highmem/non-sparsemem systems I get the following warning
> when using an mmc as the rootfs:
>
> ------------[ cut here ]------------
> WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x70/0x194()
That'll be because the driver is still using flush_dcache_page(), whereas
it should be using flush_kernel_dcache_page(). flush_dcache_page()
unfortunately results in IRQs being enabled due to the
flush_dcache_mmap_lock().
> The system is still stable, but if switch to highmem, the kernel crashes
> completely when doing this (using and USB drive as rootfs still works
> flawlessly):
That's because the driver is basically broken:
void *buf = sg_virt(sg);
unsigned int offset = host->pio_offset;
memcpy(buf + offset, &value, remaining);
Highmem pages have a NULL sg_virt(sg) because they're by definition not
mapped. Drivers really should not be using sg_virt() directly - who
knows how this got through the review process...
There's a well defined API for walking scatterlists in drivers - see
the sg_miter_* API in linux/scatterlist.h. This takes care of the
highmem issues automatically, as well as using flush_kernel_dcache_page().
In short: the Atmel MCI driver is buggy and needs fixing.
^ permalink raw reply [flat|nested] 3+ messages in thread
* at91sam9g45: MMC: Issues with MMC driver
2011-08-02 14:03 ` Russell King - ARM Linux
@ 2011-08-03 4:52 ` Prasant J
0 siblings, 0 replies; 3+ messages in thread
From: Prasant J @ 2011-08-03 4:52 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Aug 2, 2011 at 7:33 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Aug 02, 2011 at 04:35:58PM +0530, Prasant J wrote:
>> Hi,
>>
>> I'm using Linux 3.0.0 on a custom board design based on AT91SAM9G45-EKES
>>
>> I'm getting this kernel dump while booting:
>>
>>
>> Waiting 3sec before mounting root device...
>> mmc0: host does not support reading read-only switch. assuming write-enable.
>> mmc0: new SD card at address 0007
>> mmcblk0: mmc0:0007 SU02G 1.83 GiB
>> ?mmcblk0: p1 p2
>> eth0: link up (100/Full)
>> EXT3-fs: barriers not enabled
>> kjournald starting. ?Commit interval 5 seconds
>> EXT3-fs (mmcblk0p2): using internal journal
>> EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
>> VFS: Mounted root (ext3 filesystem) on device 179:2.
>> Freeing init memory: 116K
>> ------------[ cut here ]------------
>> WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x6c/0x18c()
>>
>> Can someone tell me what is possibly wrong in the mmc driver's
>> interrupt handler?
>
> This is what I said to someone who asked about this a week ago. ?It
> desperately needs fixing properly.
>
> Subject: at91sam9g45: Issues while working with RAM that is separated
> ? ? ? ?on physical address space
>
> On Tue, Jul 26, 2011 at 03:37:02PM +0200, Christian Glindkamp wrote:
>> The only problem that still exits with highmem for me is the following:
>> Even on non-highmem/non-sparsemem systems I get the following warning
>> when using an mmc as the rootfs:
>>
>> ------------[ cut here ]------------
>> WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x70/0x194()
>
> That'll be because the driver is still using flush_dcache_page(), whereas
> it should be using flush_kernel_dcache_page(). ?flush_dcache_page()
> unfortunately results in IRQs being enabled due to the
> flush_dcache_mmap_lock().
>
>> The system is still stable, but if switch to highmem, the kernel crashes
>> completely when doing this (using and USB drive as rootfs still works
>> flawlessly):
>
> That's because the driver is basically broken:
>
> ? ? ? ?void ? ? ? ? ? ? ? ? ? ?*buf = sg_virt(sg);
> ? ? ? ?unsigned int ? ? ? ? ? ?offset = host->pio_offset;
>
> ? ? ? ? ? ? ? ? ? ? ? ?memcpy(buf + offset, &value, remaining);
>
> Highmem pages have a NULL sg_virt(sg) because they're by definition not
> mapped. ?Drivers really should not be using sg_virt() directly - who
> knows how this got through the review process...
>
> There's a well defined API for walking scatterlists in drivers - see
> the sg_miter_* API in linux/scatterlist.h. ?This takes care of the
> highmem issues automatically, as well as using flush_kernel_dcache_page().
>
> In short: the Atmel MCI driver is buggy and needs fixing.
>
>
I did read that later on (that thread was started by me). I followed
what you said and changed the function names. After changing the
function names this warning does go off for me. I'm not using Highmem.
Sometimes my filesystem on mmc card does get corrupt. Till now this is
a random observation.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-03 4:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-02 11:05 at91sam9g45: MMC: Issues with MMC driver Prasant J
2011-08-02 14:03 ` Russell King - ARM Linux
2011-08-03 4:52 ` Prasant J
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).