Guennadi Liakhovetski | 4 Apr 2007 15:30
Picon
Favicon

[PATCH] irda.ko debug parameter writable

Hi

How about making irda.ko debug module parameter run-time modifiable. It 
was quite useful in my debugging... Can it cause problems?

Thanks
Guennadi
---------------------------------
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany

PATCH FOLLOWS

Make irda.ko debug module parameter read-writable. Notice, that it is only 
enabled when CONFIG_IRDA_DEBUG is set.

Signed-off-by: G. Liakhovetski <gl@...>

diff -u -r1.1.1.5 irmod.c
--- a/net/irda/irmod.c	15 Aug 2006 07:22:02 -0000	1.1.1.5
+++ b/net/irda/irmod.c	4 Apr 2007 13:13:04 -0000
 <at>  <at>  -60,7 +60,7  <at>  <at> 
  */
 #ifdef CONFIG_IRDA_DEBUG
 unsigned int irda_debug = IRDA_DEBUG_LEVEL;
-module_param_named(debug, irda_debug, uint, 0);
+module_param_named(debug, irda_debug, uint, S_IRUGO | S_IWUSR);
(Continue reading)

Samuel Ortiz | 4 Apr 2007 15:56

Re: [PATCH] irda.ko debug parameter writable


Hi Guennadi,

On 4/4/2007, "Guennadi Liakhovetski" <gl@...> wrote:

>Hi
>
>How about making irda.ko debug module parameter run-time modifiable. It
>was quite useful in my debugging... Can it cause problems?
Probably not, but how would that be different from setting
/proc/sys/net/irda/debug ?

Cheers,
Samuel.

>Thanks
>Guennadi
>---------------------------------
>Guennadi Liakhovetski, Ph.D.
>DSA Daten- und Systemtechnik GmbH
>Pascalstr. 28
>D-52076 Aachen
>Germany
>
>PATCH FOLLOWS
>
>Make irda.ko debug module parameter read-writable. Notice, that it is only
>enabled when CONFIG_IRDA_DEBUG is set.
>
>Signed-off-by: G. Liakhovetski <gl@...>
(Continue reading)

Guennadi Liakhovetski | 4 Apr 2007 16:02
Picon
Favicon

Re: [PATCH] irda.ko debug parameter writable

On Wed, 4 Apr 2007, Samuel Ortiz wrote:

> >How about making irda.ko debug module parameter run-time modifiable. It
> >was quite useful in my debugging... Can it cause problems?
> Probably not, but how would that be different from setting
> /proc/sys/net/irda/debug ?

Ouch, I think, not at all, didn't notice it:-)) Ok, forget about it:-)

Thanks
Guennadi
---------------------------------
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Guennadi Liakhovetski | 5 Apr 2007 09:09
Picon
Favicon

[BUG] 2.6.20.1-rt8 irnet + pppd recursive spinlock...

Hi all

As I came this morning to check the IrNET / PPP test, I started yesterday, 
the device was dead and OOM messages were scrolling up the terminal. I 
captured task trace, and the ftp process seems to have been the original 
culprit. Below is the backtrace. Which looks like a recursive spinlock, 
since, I assume, it is this BUG() that has triggered:

	BUG_ON(rt_mutex_owner(lock) == current);

and ppp is indeed entered recursively in the trace. I'll look if I can 
find the reason and a solution, but would also be greatful for any hints.

Thanks
Guennadi
---------------------------------
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany

ftp           D [c3c9e460] C01E5838     0 18445      1         20756 14588 (L-TLB)
[<c01e5420>] (__schedule+0x0/0x7e8) from [<c01e5cfc>] (schedule+0x54/0x124)
[<c01e5ca8>] (schedule+0x0/0x124) from [<c017e69c>] (lock_sock_nested+0x94/0xd0)
 r5 = C329F06C  r4 = C14B9780 
[<c017e608>] (lock_sock_nested+0x0/0xd0) from [<c017b878>] (sock_fasync+0x40/0x154)
 r7 = C329F040  r6 = C2238A5C  r5 = C0AD8B60  r4 = C0AD8B60
[<c017b838>] (sock_fasync+0x0/0x154) from [<c017b9b0>] (sock_close+0x24/0x44)
[<c017b98c>] (sock_close+0x0/0x44) from [<c008dbbc>] (__fput+0x194/0x1c8)
(Continue reading)

Guennadi Liakhovetski | 5 Apr 2007 12:59
Picon
Favicon

Re: [BUG] 2.6.20.1-rt8 irnet + pppd recursive spinlock...

Ok, a simple analysis reveals the recursive spinlock:

On Thu, 5 Apr 2007, Guennadi Liakhovetski wrote:

> [<bf12b220>] (ppp_channel_push+0x0/0xc8 [ppp_generic]) from [<bf12bf98>]
(ppp_output_wakeup+0x18/0x1c [ppp_generic])
===>		^^^^^^^^^^^^^^^^
>  r7 = C38F42BC  r6 = C38F4200  r5 = C38F4200  r4 = 00000000

===>	spin_lock_bh(&pch->downl);

> [<bf12bf80>] (ppp_output_wakeup+0x0/0x1c [ppp_generic]) from [<bf132c98>]
(irnet_flow_indication+0x38/0x3c [irnet])
> [<bf132c60>] (irnet_flow_indication+0x0/0x3c [irnet]) from [<bf104e4c>]
(irttp_run_tx_queue+0x1c0/0x1d4 [irda])
> [<bf104c8c>] (irttp_run_tx_queue+0x0/0x1d4 [irda]) from [<bf104f88>]
(irttp_data_request+0x128/0x4f8 [irda])
>  r8 = BF121560  r7 = 00000002  r6 = C38F4200  r5 = C21418B8
>  r4 = C21418B8 
> [<bf104e60>] (irttp_data_request+0x0/0x4f8 [irda]) from [<bf1321bc>]
(ppp_irnet_send+0x134/0x238 [irnet])
> [<bf132088>] (ppp_irnet_send+0x0/0x238 [irnet]) from [<bf12a600>] (ppp_push+0x80/0xb8 [ppp_generic])
>  r7 = C3A436E0  r6 = 00000000  r5 = C21418B8  r4 = C1489600
> [<bf12a580>] (ppp_push+0x0/0xb8 [ppp_generic]) from [<bf12a8d8>] (ppp_xmit_process+0x34/0x50c [ppp_generic])
===>		^^^^^^^^
>  r7 = 00000021  r6 = C21418B8  r5 = C1489600  r4 = 00000000

===>		spin_lock_bh(&pch->downl);

> [<bf12a8a4>] (ppp_xmit_process+0x0/0x50c [ppp_generic]) from [<bf12aed8>]
(Continue reading)

Guennadi Liakhovetski | 5 Apr 2007 17:11
Picon
Favicon

Re: [BUG] 2.6.20.1-rt8 irnet + pppd recursive spinlock...

On Thu, 5 Apr 2007, Guennadi Liakhovetski wrote:

> Ok, a simple analysis reveals the recursive spinlock:
> 
> On Thu, 5 Apr 2007, Guennadi Liakhovetski wrote:
> 
> > [<bf12b220>] (ppp_channel_push+0x0/0xc8 [ppp_generic]) from [<bf12bf98>]
(ppp_output_wakeup+0x18/0x1c [ppp_generic])
> ===>		^^^^^^^^^^^^^^^^
> >  r7 = C38F42BC  r6 = C38F4200  r5 = C38F4200  r4 = 00000000
> 
> ===>	spin_lock_bh(&pch->downl);
> 
> > [<bf12bf80>] (ppp_output_wakeup+0x0/0x1c [ppp_generic]) from [<bf132c98>]
(irnet_flow_indication+0x38/0x3c [irnet])
> > [<bf132c60>] (irnet_flow_indication+0x0/0x3c [irnet]) from [<bf104e4c>]
(irttp_run_tx_queue+0x1c0/0x1d4 [irda])
> > [<bf104c8c>] (irttp_run_tx_queue+0x0/0x1d4 [irda]) from [<bf104f88>]
(irttp_data_request+0x128/0x4f8 [irda])
> >  r8 = BF121560  r7 = 00000002  r6 = C38F4200  r5 = C21418B8
> >  r4 = C21418B8 
> > [<bf104e60>] (irttp_data_request+0x0/0x4f8 [irda]) from [<bf1321bc>]
(ppp_irnet_send+0x134/0x238 [irnet])
> > [<bf132088>] (ppp_irnet_send+0x0/0x238 [irnet]) from [<bf12a600>] (ppp_push+0x80/0xb8 [ppp_generic])
> >  r7 = C3A436E0  r6 = 00000000  r5 = C21418B8  r4 = C1489600
> > [<bf12a580>] (ppp_push+0x0/0xb8 [ppp_generic]) from [<bf12a8d8>] (ppp_xmit_process+0x34/0x50c [ppp_generic])
> ===>		^^^^^^^^
> >  r7 = 00000021  r6 = C21418B8  r5 = C1489600  r4 = 00000000
> 
> ===>		spin_lock_bh(&pch->downl);
(Continue reading)

Samuel Ortiz | 7 Apr 2007 01:53

Re: [PATCH 1/4] [net-2.6.22] IrDA: IrLAP raw mode

On Fri, Mar 16, 2007 at 08:34:51PM -0700, David Miller wrote:
> From: Samuel Ortiz <samuel@...>
> Date: Sat, 17 Mar 2007 03:57:29 +0200
> 
> > This patch allows us to bypass the IrDA stack down to the IrLAP level.
> > Sending and receiving frames is done through a character device.
> > This is useful for e.g. doing real IrDA sniffing, testing external IrDA
> > stacks and for Lirc (once I will add the framing disabling switch).
> > 
> > Signed-off-by: Samuel Ortiz <samuel@...>
> 
> I understand the idea, but I fail to see any reason this should not be
> done with sockets.
> 
> Everywhere else we provide this kind of functionality it is either
> with netlink (nf_queue etc.) or raw sockets of some kind
> (AF_INET/SOCK_RAW, AF_PACKET, etc.)
> 
> Therefore IRDA should really provide this facility in some similar
> manner.
I definitely agree here. Actually, you can already sniff IrDA packets through
an AF_PACKET socket, that's what irdadump does. My patch was useless, forget
about it...

I have a question though: On top of the regular IrDA sniffing done with a
simple AF_PACKET socket, I also would like to be able to disable TX at the
IrLAP level (typically, this would allow an IrDA device to listen to all
the packets from an IrDA link without being noticed by the other devices).

I was thinking of adding a protocol private ioctl (as in SIOCPROTOPRIVATE) to
(Continue reading)

Samuel Ortiz | 7 Apr 2007 02:59

Re: [BUG] 2.6.20.1-rt8 irnet + pppd recursive spinlock...

Hi Guennadi,

On Thu, Apr 05, 2007 at 12:59:40PM +0200, Guennadi Liakhovetski wrote:
> Ok, a simple analysis reveals the recursive spinlock:
> 
> On Thu, 5 Apr 2007, Guennadi Liakhovetski wrote:
> 
> > [<bf12b220>] (ppp_channel_push+0x0/0xc8 [ppp_generic]) from [<bf12bf98>]
(ppp_output_wakeup+0x18/0x1c [ppp_generic])
> ===>		^^^^^^^^^^^^^^^^
> >  r7 = C38F42BC  r6 = C38F4200  r5 = C38F4200  r4 = 00000000
> 
> ===>	spin_lock_bh(&pch->downl);
> 
> > [<bf12bf80>] (ppp_output_wakeup+0x0/0x1c [ppp_generic]) from [<bf132c98>]
(irnet_flow_indication+0x38/0x3c [irnet])
> > [<bf132c60>] (irnet_flow_indication+0x0/0x3c [irnet]) from [<bf104e4c>]
(irttp_run_tx_queue+0x1c0/0x1d4 [irda])
> > [<bf104c8c>] (irttp_run_tx_queue+0x0/0x1d4 [irda]) from [<bf104f88>]
(irttp_data_request+0x128/0x4f8 [irda])
> >  r8 = BF121560  r7 = 00000002  r6 = C38F4200  r5 = C21418B8
> >  r4 = C21418B8 
> > [<bf104e60>] (irttp_data_request+0x0/0x4f8 [irda]) from [<bf1321bc>]
(ppp_irnet_send+0x134/0x238 [irnet])
> > [<bf132088>] (ppp_irnet_send+0x0/0x238 [irnet]) from [<bf12a600>] (ppp_push+0x80/0xb8 [ppp_generic])
> >  r7 = C3A436E0  r6 = 00000000  r5 = C21418B8  r4 = C1489600
> > [<bf12a580>] (ppp_push+0x0/0xb8 [ppp_generic]) from [<bf12a8d8>] (ppp_xmit_process+0x34/0x50c [ppp_generic])
> ===>		^^^^^^^^
> >  r7 = 00000021  r6 = C21418B8  r5 = C1489600  r4 = 00000000
> 
(Continue reading)

Samuel Ortiz | 10 Apr 2007 20:10

Re: [irda-users] [BUG] 2.6.20.1-rt8 irnet + pppd recursive spinlock...

Hi Guennadi,

On Sat, Apr 07, 2007 at 03:59:26AM +0300, Samuel Ortiz wrote:
> IMHO, irnet_flow_indication() should be called asynchronously by
> irttp_run_tx_queue(), through some bottom-half mechanism. That would fix your
> locking issues, and that would reduce the time we spend in the IrDA code with
> this lock taken.
> 
> I will try to come up with some patches for you later this weekend.
The patch below schedules irnet_flow_indication() asynchronously. Could
you please give it a try (it builds, but I couldn't test it...) ? :

diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index a899e58..941f0f1 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
 <at>  <at>  -128,6 +128,7  <at>  <at>  struct tsap_cb {

 	struct net_device_stats stats;
 	struct timer_list todo_timer; 
+	struct work_struct irnet_flow_work;   /* irttp asynchronous flow restart */

 	__u32 max_seg_size;     /* Max data that fit into an IrLAP frame */
 	__u8  max_header_size;
diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index 7069e4a..a0d0f26 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
 <at>  <at>  -367,6 +367,29  <at>  <at>  static int irttp_param_max_sdu_size(void *instance, irda_param_t *param,
(Continue reading)

Guennadi Liakhovetski | 11 Apr 2007 12:02
Picon
Favicon

Re: [irda-users] [BUG] 2.6.20.1-rt8 irnet + pppd recursive spinlock...

On Tue, 10 Apr 2007, Samuel Ortiz wrote:

> The patch below schedules irnet_flow_indication() asynchronously. Could
> you please give it a try (it builds, but I couldn't test it...) ? :

I'm afraid, your patch makes it worse - with my patch to ppp_generic it 
worked 5 hours before Ir stopped, remaining at 4mbaud, and only discovery 
timer was expiring periodically without actually doing anything; with your 
patch the same happens in about 5 minutes.

I'll double-verify it, and then will try the same work-queue approach, but 
from ppp_generic, rather than from irttp, combining our 2 patches.

Thanks
Guennadi
---------------------------------
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane