Milan Plzik | 4 Oct 2008 18:37
Picon

Possible bug in Linux IrDA stack

Hello,

  first of all, I apologize for posting this e-mail more times -- I
tried sending it to the mailing list via gmail smtp, but it probably got
blocked; then privately to Samuel Ortiz, but he did not respond (maybe
spamfilter?). Sorry for possible duplicates :).

  Recently I've been implementing IrDA support for one ARM board (uses
pxaficp_ir driver; in fact re-implementing, as the same code for 2.6.21
already works pretty nicely) in current linux-arm master branch;
unfortunately, the code did not work. 

  Further examination has shown that the IrDA transceiver always works
on 9600 bauds (when forcing this as maximal baudrate, things seem to
work). From what I was able to find, it looks like IrDA stack stores
instruction on how to manage speed to skb->cb structure, but according
to documentation, the content of this structure is owned by layer in
which the packet is enqueued. 

  It looks like in recent versions of kernel, linux general networking
layer starts using skb->cb to store some qdisc data
(include/net/sch_generic.h, e.g. qdisc_enqueue_root). This in the end
overwrites (at least) LAP_MAGIC stored in 'cb' by IrDA stack, preventing
low-level drivers from changing their operation speed.

  Unfortunately, I could not find any quick and clean fix for this so
there is no patch attached; it doesn't seem like fixable without
changing few other pieces of code (or just delaying the needed rewrite
by placing the data farther into the 'cb'). Maybe it could be solved
similar way as the mac80211 layer solves it -- the low-level drivers
(Continue reading)

Bryan Wu | 13 Oct 2008 12:04

[PATCH 1/1] [net/irda]: new Blackfin on-chip SIR IrDA driver

From: Graf Yang <graf.yang <at> analog.com>

Signed-off-by: Graf Yang <graf.yang <at> analog.com>
Signed-off-by: Bryan Wu <cooloney <at> kernel.org>
---
 drivers/net/irda/Kconfig    |   52 +++
 drivers/net/irda/Makefile   |    1 +
 drivers/net/irda/bfin_sir.c |  824 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 877 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/irda/bfin_sir.c

diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index e631755..4e14d03 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
 <at>  <at>  -17,6 +17,58  <at>  <at>  config IRTTY_SIR

 	  If unsure, say Y.

+config BFIN_SIR
+	tristate "Blackfin SIR on UART"
+	depends on BLACKFIN && IRDA && (!SERIAL_BFIN_UART0 || !SERIAL_BFIN_UART1 || !SERIAL_BFIN_UART2 ||
!SERIAL_BFIN_UART3 )
+	help
+	  Say Y here if your want to enable SIR function on Blackfin UART 
+	  devices.
+
+	  To activate this driver you can start irattach like:
+	  "irattach irda0 -s"
+
(Continue reading)

Vasily Khoruzhick | 16 Oct 2008 23:17
Picon
Gravatar

irda problems with 2.6.27

Hi, I'm expiriencing problems with my irda-dongle and 2.6.27 kernel.

I.e. it seems IrCOMM do not work at all (or some problems with irattach?)

I'm using ks-959 irda dongle, irattach invoked as follows:
irattach irda0 -s

irdadump output is attached.

I've noticed following packet in irdadump:
21:11:29.693807 xid:cmd d48d5861 > ffffffff S=6 s=* anarsoul-laptop hint=0400 
[ Computer ] (31)

i.e. computer reports that it isn't IrCOMM-capable. But irattach was invoked, 
and appropriate modules are loaded:

lsmod | grep ir
ircomm_tty             20808  0
ircomm                 10372  1 ircomm_tty
ks959_sir               7680  0
irda                  106808  3 ircomm_tty,ircomm,ks959_sir
crc_ccitt               1920  2 irda,ppp_async
usbcore               131824  8 
ks959_sir,hci_usb,usbhid,ohci_hcd,uhci_hcd,usb_storage,ehci_hcd

Also this line appears on dmesg:

IrLAP, no activity on link!

I have no problems with this dongle and 2.6.26 kernel. Any suggestions? :)
(Continue reading)

Huang Weiyi | 18 Oct 2008 05:52
Picon

[IrDA]: remove duplicated #include

Removed duplicated include <linux/module.h> in file(s) below
  drivers/net/irda/ks959-sir.c
  drivers/net/irda/ksdazzle-sir.c

Signed-off-by: Huang Weiyi <weiyi.huang@...>

diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c
index 2482d61..2e67ae0 100644
--- a/drivers/net/irda/ks959-sir.c
+++ b/drivers/net/irda/ks959-sir.c
 <at>  <at>  -118,7 +118,6  <at>  <at> 
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/module.h>
 #include <linux/kref.h>
 #include <linux/usb.h>
 #include <linux/device.h>

diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c
index 1e0de93..3843b5f 100644
--- a/drivers/net/irda/ksdazzle-sir.c
+++ b/drivers/net/irda/ksdazzle-sir.c
 <at>  <at>  -82,7 +82,6  <at>  <at> 
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/module.h>
 #include <linux/kref.h>
 #include <linux/usb.h>
(Continue reading)

Vasily Khoruzhick | 19 Oct 2008 00:50
Picon
Gravatar

Re: irda problems with 2.6.27

On 17 October 2008 23:28:39 Vasily Khoruzhick wrote:
> On 17 October 2008 04:26:22 Alim Akhtar wrote:
> > Hi
> > send me the complete log till you get "IrLAP, no activity on link!"
> > message.
> >
> > Also check for the Baud rate setting, both the side that should be same.
>
> What logs do you need? In dmesg I get nothing except my ks-959 was
> plugged...

Ok, I've found out why it doesn't work.
For some reason ks959_change_speed is never called in 2.6.27... Now I'm trying 
to find out why it is never called :)

Regards
Vasily
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
irda-users mailing list
irda-users@...
http://lists.sourceforge.net/lists/listinfo/irda-users
(Continue reading)

Vasily Khoruzhick | 19 Oct 2008 01:34
Picon
Gravatar

Re: irda problems with 2.6.27

On 19 October 2008 01:50:26 Vasily Khoruzhick wrote:
> On 17 October 2008 23:28:39 Vasily Khoruzhick wrote:
> > On 17 October 2008 04:26:22 Alim Akhtar wrote:
> > > Hi
> > > send me the complete log till you get "IrLAP, no activity on link!"
> > > message.
> > >
> > > Also check for the Baud rate setting, both the side that should be
> > > same.
> >
> > What logs do you need? In dmesg I get nothing except my ks-959 was
> > plugged...
>
> Ok, I've found out why it doesn't work.
> For some reason ks959_change_speed is never called in 2.6.27... Now I'm
> trying to find out why it is never called :)
>
> Regards
> Vasily

More clues:

function irda_get_next_speed is broken (include/linux/irda/irda_device.h)
I've inserted printk to check what it gets:

252 static inline __u32 irda_get_next_speed(const struct sk_buff *skb)
253 {
254         const struct irda_skb_cb *cb = (const struct irda_skb_cb *) 
skb->cb;
255         printk("%s, speed: %d, magic: %d, LAP_MAGIC: %d\n", __func__,
(Continue reading)

Vasily Khoruzhick | 19 Oct 2008 02:41
Picon
Gravatar

Re: irda problems with 2.6.27

On 19 October 2008 02:34:33 Vasily Khoruzhick wrote:
> On 19 October 2008 01:50:26 Vasily Khoruzhick wrote:
> > On 17 October 2008 23:28:39 Vasily Khoruzhick wrote:
> > > On 17 October 2008 04:26:22 Alim Akhtar wrote:
> > > > Hi
> > > > send me the complete log till you get "IrLAP, no activity on link!"
> > > > message.
> > > >
> > > > Also check for the Baud rate setting, both the side that should be
> > > > same.
> > >
> > > What logs do you need? In dmesg I get nothing except my ks-959 was
> > > plugged...
> >
> > Ok, I've found out why it doesn't work.
> > For some reason ks959_change_speed is never called in 2.6.27... Now I'm
> > trying to find out why it is never called :)
> >
> > Regards
> > Vasily
>
> More clues:
>
> function irda_get_next_speed is broken (include/linux/irda/irda_device.h)
> I've inserted printk to check what it gets:
>
> 252 static inline __u32 irda_get_next_speed(const struct sk_buff *skb)
> 253 {
> 254         const struct irda_skb_cb *cb = (const struct irda_skb_cb *)
> skb->cb;
(Continue reading)

Milan Plzik | 19 Oct 2008 10:06
Picon

Re: irda problems with 2.6.27

On Ne, 2008-10-19 at 03:41 +0300, Vasily Khoruzhick wrote:
> On 19 October 2008 02:34:33 Vasily Khoruzhick wrote:

> Ok, it seems someone screws up magic number in irda_skb_cb.
> Just after dev_queue_xmit skb->cb->magic != LAP_MAGIC.
> 
> I'm not a cool kernel hacker to debug this problem, so I just made simple 
> workarond, here it is in attacment :) With this patch my ks-959 works fine.

  Some time ago I already reported this (I wonder whether this e-mail
got into this mailing list), although the driver was pxaficp_ir. It
looks like this should be solved some more clean way -- using private
field structure, which (according to header files) belongs to the layer
actually holding the whole structure. These private data are recently
being changed by some qdisc code in linux kernel. Unfortunately, so far
I got no response on this issue.

> 
> Regards
> Vasily

	Milan

> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________ irda-users mailing list
irda-users@... http://lists.sourceforge.net/lists/listinfo/irda-users
(Continue reading)

Vasily Khoruzhick | 19 Oct 2008 10:41
Picon
Gravatar

Re: irda problems with 2.6.27

On 19 October 2008 11:06:21 Milan Plzik wrote:
> On Ne, 2008-10-19 at 03:41 +0300, Vasily Khoruzhick wrote:
> > On 19 October 2008 02:34:33 Vasily Khoruzhick wrote:
> >
> > Ok, it seems someone screws up magic number in irda_skb_cb.
> > Just after dev_queue_xmit skb->cb->magic != LAP_MAGIC.
> >
> > I'm not a cool kernel hacker to debug this problem, so I just made simple
> > workarond, here it is in attacment :) With this patch my ks-959 works
> > fine.
>
>   Some time ago I already reported this (I wonder whether this e-mail
> got into this mailing list), although the driver was pxaficp_ir. It
> looks like this should be solved some more clean way -- using private
> field structure, which (according to header files) belongs to the layer
> actually holding the whole structure. 
Agreed, my patch is just a quick hack :)

> These private data are recently 
> being changed by some qdisc code in linux kernel. Unfortunately, so far
> I got no response on this issue.
>
> > Regards
> > Vasily
>
> 	Milan

Btw, did you file bug in bugzilla.kernel.org?

Regards
(Continue reading)

Milan Plzik | 19 Oct 2008 12:51
Picon

Re: irda problems with 2.6.27

On Ne, 2008-10-19 at 11:41 +0300, Vasily Khoruzhick wrote:
> On 19 October 2008 11:06:21 Milan Plzik wrote:
> > On Ne, 2008-10-19 at 03:41 +0300, Vasily Khoruzhick wrote:
> > > On 19 October 2008 02:34:33 Vasily Khoruzhick wrote:
> > >
> > > Ok, it seems someone screws up magic number in irda_skb_cb.
> > > Just after dev_queue_xmit skb->cb->magic != LAP_MAGIC.
> > >
> > > I'm not a cool kernel hacker to debug this problem, so I just made simple
> > > workarond, here it is in attacment :) With this patch my ks-959 works
> > > fine.
> >
> >   Some time ago I already reported this (I wonder whether this e-mail
> > got into this mailing list), although the driver was pxaficp_ir. It
> > looks like this should be solved some more clean way -- using private
> > field structure, which (according to header files) belongs to the layer
> > actually holding the whole structure. 
> Agreed, my patch is just a quick hack :)
> 
> > These private data are recently 
> > being changed by some qdisc code in linux kernel. Unfortunately, so far
> > I got no response on this issue.
> >
> > > Regards
> > > Vasily
> >
> > 	Milan
> 
> Btw, did you file bug in bugzilla.kernel.org?

(Continue reading)


Gmane