Re: [Fwd: [PlanetCCRMA] atl1 driver; sleeping function]

2007-07-31 Thread Fernando Lopez-Lezcano
On Tue, 2007-07-31 at 10:51 +0200, Ingo Molnar wrote:
> * Fernando Lopez-Lezcano <[EMAIL PROTECTED]> wrote:
> 
> > Hi Ingo, I'm forwading this report from a Planet CCRMA user, this is 
> > happening to him with 2.6.21.6-rt21...
> 
> thanks!

Thanks for the patch!
Looks like it fixed the problem Matt was having...
-- Fernando

 Forwarded Message 
From: Matt Barbe
To: Fernando Lopez-Lezcano
Cc: [EMAIL PROTECTED]
Subject: Re: [PlanetCCRMA] atl1 driver; sleeping function
Date: Tue, 31 Jul 2007 22:50:28 -0400

The newly patched atl1 driver seems to be working fine.  I tried it
also in rt21.3 (that's the latest src.rpm in
http://ccrma.stanford.edu/planetccrma/mirror/all/linux/SRPMS/), and it
also worked fine -- I need kernel-rt-devel because I do use apps that
need nvidia drivers, and those are working fine in rt21.3 as well.  I
can keep you up to date if anything negative happens.

Thanks again,

Matt

> 
> > BUG: sleeping function called from invalid context IRQ-219(2243) at
> > kernel/rtmutex.c:613
> > in_atomic():0 [], irqs_disabled():1
> >  [] dump_trace+0x64/0x105
> >  [] show_trace_log_lvl+0x18/0x2c
> >  [] show_trace+0xf/0x11
> >  [] dump_stack+0x12/0x14
> >  [] __rt_spin_lock+0x21/0x3d
> >  [] atl1_xmit_frame+0x66f/0x6c6 [atl1]
> >  [] dev_hard_start_xmit+0x1c6/0x225
> >  [] __qdisc_run+0xb7/0x1cf
> 
> could you try the patch below, does it fix the problem? The atl1 driver 
> uses raw irq flags in combination with a spinlock that is a sleeping 
> lock on -rt. (this is valid code on upstream, fortunately the -rt fix is 
> also a cleanup and a small code reduction enhancement on upstream, so 
> there's no problem pushing such fixes upstream.)
> 
>   Ingo
> 
> --->
> Subject: [patch] drivers/net/atl1/atl1_main.c: use spin_trylock_irqsave()
> From: Ingo Molnar <[EMAIL PROTECTED]>
> 
> use the simpler spin_trylock_irqsave() API to get the adapter lock.
> 
> [ this is also a fix for -rt where adapter->lock is a sleeping lock. ]
> 
> Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
> ---
>  drivers/net/atl1/atl1_main.c |4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> Index: linux-rt-rebase.q/drivers/net/atl1/atl1_main.c
> ===
> --- linux-rt-rebase.q.orig/drivers/net/atl1/atl1_main.c
> +++ linux-rt-rebase.q/drivers/net/atl1/atl1_main.c
> @@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buf
>   }
>   }
>  
> - local_irq_save(flags);
> - if (!spin_trylock(&adapter->lock)) {
> + if (!spin_trylock_irqsave(&adapter->lock, flags)) {
>   /* Can't get lock - tell upper layer to requeue */
> - local_irq_restore(flags);
>   dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
>   return NETDEV_TX_LOCKED;
>   }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Fwd: [PlanetCCRMA] atl1 driver; sleeping function]

2007-07-31 Thread Ingo Molnar

* Fernando Lopez-Lezcano <[EMAIL PROTECTED]> wrote:

> Hi Ingo, I'm forwading this report from a Planet CCRMA user, this is 
> happening to him with 2.6.21.6-rt21...

thanks!

> BUG: sleeping function called from invalid context IRQ-219(2243) at
> kernel/rtmutex.c:613
> in_atomic():0 [], irqs_disabled():1
>  [] dump_trace+0x64/0x105
>  [] show_trace_log_lvl+0x18/0x2c
>  [] show_trace+0xf/0x11
>  [] dump_stack+0x12/0x14
>  [] __rt_spin_lock+0x21/0x3d
>  [] atl1_xmit_frame+0x66f/0x6c6 [atl1]
>  [] dev_hard_start_xmit+0x1c6/0x225
>  [] __qdisc_run+0xb7/0x1cf

could you try the patch below, does it fix the problem? The atl1 driver 
uses raw irq flags in combination with a spinlock that is a sleeping 
lock on -rt. (this is valid code on upstream, fortunately the -rt fix is 
also a cleanup and a small code reduction enhancement on upstream, so 
there's no problem pushing such fixes upstream.)

Ingo

--->
Subject: [patch] drivers/net/atl1/atl1_main.c: use spin_trylock_irqsave()
From: Ingo Molnar <[EMAIL PROTECTED]>

use the simpler spin_trylock_irqsave() API to get the adapter lock.

[ this is also a fix for -rt where adapter->lock is a sleeping lock. ]

Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 drivers/net/atl1/atl1_main.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Index: linux-rt-rebase.q/drivers/net/atl1/atl1_main.c
===
--- linux-rt-rebase.q.orig/drivers/net/atl1/atl1_main.c
+++ linux-rt-rebase.q/drivers/net/atl1/atl1_main.c
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buf
}
}
 
-   local_irq_save(flags);
-   if (!spin_trylock(&adapter->lock)) {
+   if (!spin_trylock_irqsave(&adapter->lock, flags)) {
/* Can't get lock - tell upper layer to requeue */
-   local_irq_restore(flags);
dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
return NETDEV_TX_LOCKED;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[Fwd: [PlanetCCRMA] atl1 driver; sleeping function]

2007-07-30 Thread Fernando Lopez-Lezcano
Hi Ingo, I'm forwading this report from a Planet CCRMA user, this is
happening to him with 2.6.21.6-rt21...

-- Fernando

 Forwarded Message 
From: Matt Barber
To: [EMAIL PROTECTED]
Subject: [PlanetCCRMA] atl1 driver; sleeping function
Date: Mon, 30 Jul 2007 06:09:58 -0400

Hello,

I'm getting a set of BUG messages in my dmesg with the newest ccrma
kernel.  This is a new box, so I haven't tried the older ccrma
kernels, but the bugs aren't there with Fedora stock.  They look like
this (probably at least a hundred more by now):

BUG: sleeping function called from invalid context IRQ-219(2243) at
kernel/rtmutex.c:613
in_atomic():0 [], irqs_disabled():1
 [] dump_trace+0x64/0x105
 [] show_trace_log_lvl+0x18/0x2c
 [] show_trace+0xf/0x11
 [] dump_stack+0x12/0x14
 [] __rt_spin_lock+0x21/0x3d
 [] atl1_xmit_frame+0x66f/0x6c6 [atl1]
 [] dev_hard_start_xmit+0x1c6/0x225
 [] __qdisc_run+0xb7/0x1cf
 [] dev_queue_xmit+0x14a/0x239
 [] ip_output+0x207/0x243
 [] ip_queue_xmit+0x3b2/0x402
 [] tcp_transmit_skb+0x6e5/0x713
 [] tcp_send_ack+0xeb/0xef
 [] tcp_rcv_established+0x52a/0x7ff
 [] tcp_v4_do_rcv+0x1bf/0x494
 [] tcp_v4_rcv+0x863/0x8d6
 [] ip_local_deliver+0x18f/0x23d
 [] ip_rcv+0x41d/0x456
 [] netif_receive_skb+0x2cc/0x35e
 [] process_backlog+0x76/0xc9
 [] net_rx_action+0xa7/0x1a5
 [] ___do_softirq+0xfe/0x214
 [] do_softirq_from_hardirq+0x48/0x61
 [] do_irqd+0x21a/0x282
 [] kthread+0xb0/0xd8
 [] kernel_thread_helper+0x7/0x10
 ===
printk: 6 messages suppressed.
network driver disabled raw interrupts: atl1_xmit_frame+0x0/0x6c6 [atl1]
BUG: sleeping function called from invalid context firefox-bin(17517)
at kernel/rtmutex.c:613
in_atomic():0 [], irqs_disabled():1
 [] dump_trace+0x64/0x105
 [] show_trace_log_lvl+0x18/0x2c
 [] show_trace+0xf/0x11
 [] dump_stack+0x12/0x14
 [] __rt_spin_lock+0x21/0x3d
 [] atl1_xmit_frame+0x66f/0x6c6 [atl1]
 [] dev_hard_start_xmit+0x1c6/0x225
 [] __qdisc_run+0xb7/0x1cf
 [] dev_queue_xmit+0x14a/0x239
 [] ip_output+0x207/0x243
 [] ip_queue_xmit+0x3b2/0x402
 [] tcp_transmit_skb+0x6e5/0x713
 [] tcp_push_one+0xb3/0xd8
 [] tcp_sendmsg+0x7c8/0x9f9
 [] inet_sendmsg+0x3b/0x45
 [] sock_sendmsg+0xd0/0xeb
 [] sys_sendto+0x11b/0x13b
 [] sys_send+0x37/0x3b
 [] sys_socketcall+0x14a/0x261
 [] syscall_call+0x7/0xb
 [] 0xb7fd8410
 ===
network driver disabled raw interrupts: atl1_xmit_frame+0x0/0x6c6 [atl1]
network driver disabled raw interrupts: atl1_xmit_frame+0x0/0x6c6 [atl1]
network driver disabled raw interrupts: atl1_xmit_frame+0x0/0x6c6 [atl1]
BUG: sleeping function called from invalid context IRQ-219(2243) at
kernel/rtmutex.c:613
in_atomic():0 [], irqs_disabled():1
 [] dump_trace+0x64/0x105
 [] show_trace_log_lvl+0x18/0x2c
 [] show_trace+0xf/0x11
 [] dump_stack+0x12/0x14
 [] __rt_spin_lock+0x21/0x3d
 [] atl1_xmit_frame+0x66f/0x6c6 [atl1]
 [] dev_hard_start_xmit+0x1c6/0x225
 [] __qdisc_run+0xb7/0x1cf
 [] dev_queue_xmit+0x14a/0x239
 [] ip_output+0x207/0x243
 [] ip_queue_xmit+0x3b2/0x402
 [] tcp_transmit_skb+0x6e5/0x713
 [] tcp_send_ack+0xeb/0xef
 [] tcp_rcv_established+0x52a/0x7ff
 [] tcp_v4_do_rcv+0x1bf/0x494
 [] tcp_v4_rcv+0x863/0x8d6
 [] ip_local_deliver+0x18f/0x23d
 [] ip_rcv+0x41d/0x456
 [] netif_receive_skb+0x2cc/0x35e
 [] process_backlog+0x76/0xc9
 [] net_rx_action+0xa7/0x1a5
 [] ___do_softirq+0xfe/0x214
 [] do_softirq_from_hardirq+0x48/0x61
 [] do_irqd+0x21a/0x282
 [] kthread+0xb0/0xd8
 [] kernel_thread_helper+0x7/0x10
 ===
printk: 14 messages suppressed.
network driver disabled raw interrupts: atl1_xmit_frame+0x0/0x6c6 [atl1]
BUG: sleeping function called from invalid context firefox-bin(17517)
at kernel/rtmutex.c:613
in_atomic():0 [], irqs_disabled():1
 [] dump_trace+0x64/0x105
 [] show_trace_log_lvl+0x18/0x2c
 [] show_trace+0xf/0x11
 [] dump_stack+0x12/0x14
 [] __rt_spin_lock+0x21/0x3d
 [] atl1_xmit_frame+0x66f/0x6c6 [atl1]
 [] dev_hard_start_xmit+0x1c6/0x225
 [] __qdisc_run+0xb7/0x1cf
 [] dev_queue_xmit+0x14a/0x239
 [] ip_output+0x207/0x243
 [] ip_queue_xmit+0x3b2/0x402
 [] tcp_transmit_skb+0x6e5/0x713
 [] tcp_push_one+0xb3/0xd8
 [] tcp_sendmsg+0x7c8/0x9f9
 [] inet_sendmsg+0x3b/0x45
 [] sock_sendmsg+0xd0/0xeb
 [] sys_sendto+0x11b/0x13b
 [] sys_send+0x37/0x3b
 [] sys_socketcall+0x14a/0x261
 [] syscall_call+0x7/0xb
 [] 0xb7fd8410
 ===
BUG: sleeping function called from invalid context IRQ-219(2243) at
kernel/rtmutex.c:613
in_atomic():0 [], irqs_disabled():1
 [] dump_trace+0x64/0x105
 [] show_trace_log_lvl+0x18/0x2c
 [] show_trace+0xf/0x11
 [] dump_stack+0x12/0x14
 [] __rt_spin_lock+0x21/0x3d
 [] atl1_xmit_frame+0x66f/0x6c6 [atl1]
 [] dev_hard_start_xmit+0x1c6/0x225
 [] __qdisc_run+0xb7/0x1cf
 [] dev_queue_xmit+0x14a/0x239
 [] ip_output+0x207/0x243
 [] ip_queue_xmit+0x3b2/0x402
 [] tcp_transmit_skb+0x6e5/0x713
 [] __tcp_push_pending_frames+0x6ec/0x7af
 [] tcp_rcv_established+0x107/0x7ff
 [] tcp_v4_do_rcv+0x1bf/0x494
 [] tcp_v4_rcv+0x863/0x8d6
 [] ip_local_deliver+0x18