linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 3.10.9-rt5 with Atmel AT91SAM9G25 SoC triggers "Trying to free already-free IRQ 1"
@ 2013-08-30 11:18 Sami Pietikäinen
  2013-09-01 10:40 ` Michael Langfinger
  0 siblings, 1 reply; 11+ messages in thread
From: Sami Pietikäinen @ 2013-08-30 11:18 UTC (permalink / raw)
  To: linux-rt-users@vger.kernel.org

Hello Michael

We have encountered the same warnings with the Atmel SAMA5D35 processor when using the RT_PREEMPT patch. We get the same warnings with both 3.6.9-rt21 and 3.10.9-rt5 kernels. However, the 3.6.9-rt21 kernel boots just fine, and we also had problems booting the 3.10.9-rt5 kernel. Therefore these warnings and boot hanging might be unrelated.

What's causing these warnings is still unknown, but at least we got the 3.10.9-rt5 kernel to boot. The boot problem seems to be caused by the TCB clock source (tcb_clksrc). You could try to unset the CONFIG_ATMEL_TCB_CLKSRC option, but this is not optimal configuration for rt. 

I have attached a patch which goes on top of the rt5 patch that seems to fix the boot hang issue. Could you please report the results if you have time to test this patch? Please note that I have not yet done any rt-tests with this patch.

BR,
Sami Pietikäinen
Software Developer
Wapice Ltd.

--- a/drivers/clocksource/tcb_clksrc.c	2013-08-29 16:14:14.611335823 +0300
+++ b/drivers/clocksource/tcb_clksrc.c	2013-08-29 16:16:28.129657272 +0300
@@ -192,9 +192,13 @@
 	clkevt.clk = t2_clk;
 	tc_irqaction.dev_id = &clkevt;
 
-	timer_clock = clk32k_divisor_idx;
+	timer_clock = divisor_idx;
 
-	clkevt.clkevt.cpumask = cpumask_of(0);
+	if (!divisor)
+		clkevt.freq = 32768;
+	else
+		clkevt.freq = clk_get_rate(t2_clk)/divisor;
+	clkevt.clkevt.cpumask = cpumask_of(0);
 
 	clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff);
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread
* 3.10.9-rt5 with Atmel AT91SAM9G25 SoC triggers "Trying to free  already-free IRQ 1"
@ 2013-08-29 21:54 Michael Langfinger
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Langfinger @ 2013-08-29 21:54 UTC (permalink / raw)
  To: linux-rt-users

 Hi,

 when I try to boot kernel 3.10.9-rt5 (or lower) on the Atmel 
 AT91SAM9G25, I get the following error:

 WARNING: at kernel/irq/manage.c:1268 __free_irq+0x90/0x1a8()
 Trying to free already-free IRQ 1
 Modules linked in:
 CPU: 0 PID: 0 Comm: swapper Not tainted 3.10.9-rt5 #1
 [<c000cffc>] (unwind_backtrace+0x0/0xe0) from [<c000b58c>] 
 (show_stack+0x10/0x1)
 [<c000b58c>] (show_stack+0x10/0x14) from [<c001550c>] 
 (warn_slowpath_common+0x4)
 [<c001550c>] (warn_slowpath_common+0x4c/0x68) from [<c00155a8>] 
 (warn_slowpath_)
 [<c00155a8>] (warn_slowpath_fmt+0x2c/0x3c) from [<c004f84c>] 
 (__free_irq+0x90/0)
 [<c004f84c>] (__free_irq+0x90/0x1a8) from [<c0043d18>] 
 (clockevents_set_mode+0x)
 [<c0043d18>] (clockevents_set_mode+0x28/0x5c) from [<c0043d5c>] 
 (clockevents_sh)
 [<c0043d5c>] (clockevents_shutdown+0x10/0x20) from [<c004403c>] 
 (clockevents_ex)
 [<c004403c>] (clockevents_exchange_device+0x74/0x80) from [<c0044410>] 
 (tick_no)
 [<c0044410>] (tick_notify+0xec/0x2d8) from [<c0035768>] 
 (notifier_call_chain+0x)
 [<c0035768>] (notifier_call_chain+0x38/0x68) from [<c00357b8>] 
 (raw_notifier_ca)
 [<c00357b8>] (raw_notifier_call_chain+0x14/0x18) from [<c0043c58>] 
 (clockevents)
 [<c0043c58>] (clockevents_register_device+0x90/0x128) from [<c0453abc>] 
 (time_i)
 [<c0453abc>] (time_init+0x1c/0x28) from [<c04508c4>] 
 (start_kernel+0x1b0/0x304)
 [<c04508c4>] (start_kernel+0x1b0/0x304) from [<20008040>] (0x20008040)
 ---[ end trace 0000000000000001 ]---

 This happens twice and the system hangs afterwards. I tried with  with 
 CONFIG_PREEMPT_RT_FULL as well as with CONFIG_PREEMPT_RTB, in both cases 
 I get the same error.

 I am no expert in this matter, so I would be grateful for any 
 assistance that might help me to solve the problem. Thank you!

 Kind regards,

 Michael Langfinger

 P.S.: Below you can find the complete output of the boot sequence, if 
 it helps.

 Uncompressing Linux... done, booting the kernel.
 Booting Linux on physical CPU 0x0
 Linux version 3.10.9-rt5 (mitarbeiter@ariag25-dev) (gcc version 4.7.3 
 (Ubuntu/L3
 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
 CPU: VIVT data cache, VIVT instruction cache
 Machine: Atmel AT91SAM (Device Tree), model: Acme Systems Aria G25
 Memory policy: ECC disabled, Data cache writeback
 AT91: Detected soc type: at91sam9x5
 AT91: Detected soc subtype: at91sam9g25
 AT91: sram at 0x300000 of 0x8000 mapped at 0xfef70000
 DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map
 Clocks: CPU 400 MHz, master 133 MHz, main 12.000 MHz
 Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 
 65024
 Kernel command line: mem=256M console=ttyS0,115200 root=/dev/mmcblk0p2 
 rootfsty1
 PID hash table entries: 1024 (order: 0, 4096 bytes)
 Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
 Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
 Memory: 256MB = 256MB total
 Memory: 254852k/254852k available, 7292k reserved, 0K highmem
 Virtual kernel memory layout:
     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
     modules : 0xbf000000 - 0xc0000000   (  16 MB)
       .text : 0xc0008000 - 0xc044f5e8   (4382 kB)
       .init : 0xc0450000 - 0xc04768dc   ( 155 kB)
       .data : 0xc0478000 - 0xc04a9740   ( 198 kB)
        .bss : 0xc04a9740 - 0xc04d5858   ( 177 kB)
 SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
 Preemptible hierarchical RCU implementation.
 NR_IRQS:16 nr_irqs:16 16
 ------------[ cut here ]------------
 WARNING: at kernel/irq/manage.c:1268 __free_irq+0x90/0x1a8()
 Trying to free already-free IRQ 1
 Modules linked in:
 CPU: 0 PID: 0 Comm: swapper Not tainted 3.10.9-rt5 #1
 [<c000cffc>] (unwind_backtrace+0x0/0xe0) from [<c000b58c>] 
 (show_stack+0x10/0x1)
 [<c000b58c>] (show_stack+0x10/0x14) from [<c001550c>] 
 (warn_slowpath_common+0x4)
 [<c001550c>] (warn_slowpath_common+0x4c/0x68) from [<c00155a8>] 
 (warn_slowpath_)
 [<c00155a8>] (warn_slowpath_fmt+0x2c/0x3c) from [<c004f84c>] 
 (__free_irq+0x90/0)
 [<c004f84c>] (__free_irq+0x90/0x1a8) from [<c0043d18>] 
 (clockevents_set_mode+0x)
 [<c0043d18>] (clockevents_set_mode+0x28/0x5c) from [<c0043d5c>] 
 (clockevents_sh)
 [<c0043d5c>] (clockevents_shutdown+0x10/0x20) from [<c004403c>] 
 (clockevents_ex)
 [<c004403c>] (clockevents_exchange_device+0x74/0x80) from [<c0044410>] 
 (tick_no)
 [<c0044410>] (tick_notify+0xec/0x2d8) from [<c0035768>] 
 (notifier_call_chain+0x)
 [<c0035768>] (notifier_call_chain+0x38/0x68) from [<c00357b8>] 
 (raw_notifier_ca)
 [<c00357b8>] (raw_notifier_call_chain+0x14/0x18) from [<c0043c58>] 
 (clockevents)
 [<c0043c58>] (clockevents_register_device+0x90/0x128) from [<c0453abc>] 
 (time_i)
 [<c0453abc>] (time_init+0x1c/0x28) from [<c04508c4>] 
 (start_kernel+0x1b0/0x304)
 [<c04508c4>] (start_kernel+0x1b0/0x304) from [<20008040>] (0x20008040)
 ---[ end trace 0000000000000001 ]---
 sched_clock: 32 bits at 128 Hz, resolution 7812500ns, wraps every 
 3489660920ms
 Console: colour dummy device 80x30
 Calibrating delay loop... 198.76 BogoMIPS (lpj=775168)
 pid_max: default: 32768 minimum: 301
 Mount-cache hash table entries: 512
 CPU: Testing write buffer coherency: ok
 Setting up static identity map for 0xc032aac0 - 0xc032ab18
 devtmpfs: initialized
 pinctrl core: initialized pinctrl subsystem
 NET: Registered protocol family 16
 DMA: preallocated 256 KiB pool for atomic coherent allocations
 AT91: Power Management
 AT91: Starting after power-restored wakeup
 gpio-at91 fffff400.gpio: at address fefff400
 gpio-at91 fffff600.gpio: at address fefff600
 gpio-at91 fffff800.gpio: at address fefff800
 gpio-at91 fffffa00.gpio: at address fefffa00
 pinctrl-at91 pinctrl.2: initialized AT91 pinctrl driver
 ------------[ cut here ]------------
 WARNING: at kernel/irq/manage.c:1268 __free_irq+0x90/0x1a8()
 Trying to free already-free IRQ 1
 Modules linked in:
 CPU: 0 PID: 1 Comm: swapper Tainted: G        W    3.10.9-rt5 #1
 [<c000cffc>] (unwind_backtrace+0x0/0xe0) from [<c000b58c>] 
 (show_stack+0x10/0x1)
 [<c000b58c>] (show_stack+0x10/0x14) from [<c001550c>] 
 (warn_slowpath_common+0x4)
 [<c001550c>] (warn_slowpath_common+0x4c/0x68) from [<c00155a8>] 
 (warn_slowpath_)
 [<c00155a8>] (warn_slowpath_fmt+0x2c/0x3c) from [<c004f84c>] 
 (__free_irq+0x90/0)
 [<c004f84c>] (__free_irq+0x90/0x1a8) from [<c0043d18>] 
 (clockevents_set_mode+0x)
 [<c0043d18>] (clockevents_set_mode+0x28/0x5c) from [<c0043ff0>] 
 (clockevents_ex)
 [<c0043ff0>] (clockevents_exchange_device+0x28/0x80) from [<c0044410>] 
 (tick_no)
 [<c0044410>] (tick_notify+0xec/0x2d8) from [<c0035768>] 
 (notifier_call_chain+0x)
 [<c0035768>] (notifier_call_chain+0x38/0x68) from [<c00357b8>] 
 (raw_notifier_ca)
 [<c00357b8>] (raw_notifier_call_chain+0x14/0x18) from [<c0043c58>] 
 (clockevents)
 [<c0043c58>] (clockevents_register_device+0x90/0x128) from [<c04694e4>] 
 (tcb_cl)
 [<c04694e4>] (tcb_clksrc_init+0x1c4/0x204) from [<c0008890>] 
 (do_one_initcall+0)
 [<c0008890>] (do_one_initcall+0x90/0x148) from [<c0450b00>] 
 (kernel_init_freeab)
 [<c0450b00>] (kernel_init_freeable+0xe8/0x1ac) from [<c0323138>] 
 (kernel_init+0)
 [<c0323138>] (kernel_init+0x8/0xe4) from [<c0009450>] 
 (ret_from_fork+0x14/0x24)
 ---[ end trace 0000000000000002 ]---
 bio: create slab <bio-0> at 0
 at_hdmac ffffec00.dma-controller: Atmel AHB DMA Controller ( cpy slave 
 ), 8 chas
 at_hdmac ffffee00.dma-controller: Atmel AHB DMA Controller ( cpy slave 
 ), 8 chas
 SCSI subsystem initialized
 usbcore: registered new interface driver usbfs
 usbcore: registered new interface driver hub
 usbcore: registered new device driver usb
 cfg80211: Calling CRDA to update world regulatory domain
 Switching to clocksource tcb_clksrc
 NET: Registered protocol family 2
 TCP established hash table entries: 2048 (order: 2, 16384 bytes)
 TCP bind hash table entries: 2048 (order: 3, 49152 bytes)
 TCP: Hash tables configured (established 2048 bind 2048)
 TCP: reno registered
 UDP hash table entries: 256 (order: 2, 16384 bytes)
 UDP-Lite hash table entries: 256 (order: 2, 16384 bytes)
 NET: Registered protocol family 1
 msgmni has been set to 497
 Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
 io scheduler noop registered (default)
 io scheduler deadline registered
 io scheduler cfq registered
 fffff200.serial: ttyS0 at MMIO 0xfffff200 (irq = 16) is a ATMEL_SERIAL
 console [ttyS0] enabled
 f801c000.serial: ttyS1 at MMIO 0xf801c000 (irq = 23) is a ATMEL_SERIAL
 f8020000.serial: ttyS2 at MMIO 0xf8020000 (irq = 24) is a ATMEL_SERIAL
 brd: module loaded
 loop: module loaded
 atmel_spi f0000000.spi: version: 0x212
 atmel_spi f0000000.spi: DMA channel not available, SPI unable to use 
 DMA
 atmel_spi f0000000.spi: Atmel SPI Controller using PIO only
 atmel_spi f0000000.spi: Atmel SPI Controller at 0xf0000000 (irq 28)
 atmel_spi f0000000.spi: master is unqueued, this is deprecated
 macb f802c000.ethernet (unregistered net_device): invalid hw address, 
 using ranm
 libphy: MACB_mii_bus: probed
 macb f802c000.ethernet eth0: Cadence MACB at 0xf802c000 irq 25 
 (2a:4d:fa:f3:37:)
 macb f802c000.ethernet eth0: attached PHY driver [SMSC LAN8710/LAN8720] 
 (mii_bu)
 ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
 ehci-atmel: EHCI Atmel driver
 atmel-ehci 700000.ehci: EHCI Host Controller
 atmel-ehci 700000.ehci: new USB bus registered, assigned bus number 1
 atmel-ehci 700000.ehci: irq 29, io mem 0x00700000


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

end of thread, other threads:[~2013-11-09 20:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30 11:18 3.10.9-rt5 with Atmel AT91SAM9G25 SoC triggers "Trying to free already-free IRQ 1" Sami Pietikäinen
2013-09-01 10:40 ` Michael Langfinger
2013-09-03  9:09   ` Sami Pietikäinen
2013-10-11 10:09   ` Sebastian Andrzej Siewior
2013-10-14  7:24     ` Sami Pietikäinen
2013-10-18 14:03       ` Sebastian Andrzej Siewior
2013-10-23 12:19         ` Sami Pietikäinen
2013-10-28 13:59           ` Sami Pietikäinen
2013-11-08 22:17             ` Sebastian Andrzej Siewior
2013-11-09 20:37               ` Michael Langfinger
  -- strict thread matches above, loose matches on Subject: below --
2013-08-29 21:54 Michael Langfinger

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).