Linux-3.0 on PortuxG20

Hello,

because I plan to use the ad799x driver from staging/iio, I have changed to the linux-3.0 kernel. With atmel-mci I get the warning below, at91-mci does'nt work at all.

Is this a known problem?
Is there a solution in the near future?

mmcblk0: mmc0:8fe4 SU04G 3.69 GiB
 mmcblk0: p1 p2
EXT3-fs: barriers not enabled
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p1): using internal journal
EXT3-fs (mmcblk0p1): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) on device 179:1.
Freeing init memory: 128K
------------[ cut here ]------------
WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x70/0x194()
irq 9 handler atmci_interrupt+0x0/0x70c enabled interrupts
Modules linked in:
Backtrace:
[] (dump_backtrace+0x0/0x110) from [] (dump_stack+0x18/0x1c)
 r6:c0070274 r5:c031f0bc r4:00000082
[] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x58/0x70)
[] (warn_slowpath_common+0x0/0x70) from [] (warn_slowpath_fmt+0x38/0x40)
 r8:00000000 r7:c0369cd4 r6:00000001 r5:00000009 r4:c396b7a0
[] (warn_slowpath_fmt+0x0/0x40) from [] (handle_irq_event_percpu+0x70/0x194)
 r3:00000009 r2:c031f0d0
[] (handle_irq_event_percpu+0x0/0x194) from [] (handle_irq_event+0x60/0x7c)
[] (handle_irq_event+0x0/0x7c) from [] (handle_level_irq+0x10c/0x120)
 r6:00000009 r5:00000000 r4:c0369cd4
[] (handle_level_irq+0x0/0x120) from [] (generic_handle_irq+0x34/0x3c)
 r4:00000009
[] (generic_handle_irq+0x0/0x3c) from [] (asm_do_IRQ+0x68/0x98)
 r4:00000009
[] (asm_do_IRQ+0x0/0x98) from [] (__irq_svc+0x48/0x8c)
Exception stack(0xc0361ef0 to 0xc0361f38)
1ee0:                                     0008df95 000003e8 00000000 20000013
1f00: c0367368 c0367378 c03826f0 c00243dc c03905e8 41069265 20022768 c0361f5c
1f20: 22a95d21 c0361f38 c005e334 c0032bb4 20000013 ffffffff
 r5:fefff000 r4:ffffffff
[] (at91_enter_idle+0x0/0xbc) from [] (cpuidle_idle_call+0xb8/0x118)
 r5:c0367368 r4:c0367378
[] (cpuidle_idle_call+0x0/0x118) from [] (cpu_idle+0x68/0xc8)
 r8:c0362000 r7:c00243dc r6:c03826f0 r5:c03649f0 r4:c0360000
[] (cpu_idle+0x0/0xc8) from [] (rest_init+0x8c/0xa4)
 r6:c0382640 r5:c03826b8 r4:c0360000
[] (rest_init+0x0/0xa4) from [] (start_kernel+0x2b0/0x31c)
 r4:c03620a0
[] (start_kernel+0x0/0x31c) from [<20008040>] (0x20008040)
 r8:20004000 r7:c03649e4 r6:c00247e0 r5:c036200c r4:00053175
---[ end trace 1b5d20f2e52724f8 ]---

Re: Linux-3.0 on PortuxG20

This is a known problem. Cglind already fixed it but is on holiday for the next weeks. I'll try to post his patch soon.

Re: Linux-3.0 on PortuxG20

The following patch is for Open Embedded on StampG45 using kernel 3.0. It should also solve the problem on PortuxG20.

commit b674cc5ba47970b3ef0f81ead4da508cbad285fb
Author: Christian Glindkamp 
Date:   Tue Jul 26 16:29:25 2011 +0200

    mmc: atmel-mci: use flush_kernel_dcache_page()

    flush_dcache_page() results in IRQs being enabled due to the
    flush_dcache_mmap_lock() (as pointed out Russel King) thereby causing:
     WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x70/0x194()
     irq 29 handler atmci_interrupt+0x0/0x64c enabled interrupts

    Signed-off-by: Christian Glindkamp 

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index aa8039f..6afa9ba 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1387,7 +1387,7 @@ static void atmci_read_data_pio(struct atmel_mci *host)
                        nbytes += 4;

                        if (offset == sg->length) {
-                               flush_dcache_page(sg_page(sg));
+                               flush_kernel_dcache_page(sg_page(sg));
                                host->sg = sg = sg_next(sg);
                                if (!sg)
                                        goto done;
@@ -1400,7 +1400,7 @@ static void atmci_read_data_pio(struct atmel_mci *host)
                        memcpy(buf + offset, &value, remaining);
                        nbytes += remaining;

-                       flush_dcache_page(sg_page(sg));
+                       flush_kernel_dcache_page(sg_page(sg));
                        host->sg = sg = sg_next(sg);
                        if (!sg)
                                goto done;

Re: Linux-3.0 on PortuxG20

We use the UARTs for modbus rtu communications. Now we have communications errors during sd write oprations with this fix. I suspect this is due to the interrupts are disabled for too long.

with at91-mci we don't get uart comminucations errors. But we have boot problems. Sometimes we get a 'error -110 whilst initialising SD card' during bootup and the kernel panics.

Re: Linux-3.0 on PortuxG20

The patch fixes a wrong function call. This is essential to get the system work properly. A big problem with Modbus RTU and any multi-tasking operating system is that these do not guarantee your program is run in real-time. This means that the 3.5 character gap between two Modbus transfers is hard to detect. A longer sleep - e.g. in the at91-mci write function - can easily "destroy" (mark an unfinished packet as complete) Modbus RTU packets.

To avoid this you can try out the xenomai project which is an real-time extension to Linux. Note, all drivers used by your program have to support xenomai to achieve real-time. At least the at91-usart driver does not. As an alternative try using Modbus ASCII at higher baud rates. This will compensate the extra overhead. If your Modbus modules only support RTU mode you might consider to use one of our Modbus modules as gateway between ASCII mode over USB and RTU over RS485/RS232.

Re: Linux-3.0 on PortuxG20

The PortuxG20 is the bus master. so no problem with de 3.5 character gap.
The problem is that we are lossing data in modbus responses when a large SD write is active.

In development we used the at91 driver. The modbus communication works with out a glitch.
Known in production we have a problem with the at91 driver.
Some system are booting 100% like the development system.
Most system are booting 98% of the bootups. some system keeps rebooting (kernel panic and reboot).
So we switch to the atmel driver. But now modbus errors...

I think the problem with de Atmel driver is that it is eating CPU power in interrupt time doing pio. The at91 driver is using dma.
I have looked into the at91 problem. But to make this hard to find is that when I enable MMC debug messages bootup is 100%

Re: Linux-3.0 on PortuxG20

If the problem is that your rootfile system is not mounted when using the at91 driver, it might help to change rootdelay=1 to rootwait in your kernel command line.

Syndicate content