Hi,

I've found something confusing when I wanted to use more than one
sja1000 attached to a platform bus with interrupt sharing. The flag for
the sja1000 resources I wanted to set first was the
IORESOURCE_IRQ_SHAREABLE* flag because of the other IORESOURCE_IRQ_XXX
flags. But this flag is ignored by the sja1000_platform driver because
it has another position. If I use the generic IRQF_SHARED** flag
everything works fine. Does it make sense to patch the driver in a way
like that:

--- linux-3.5/drivers/net/can/sja1000/sja1000_platform.c.orig
2012-08-09 10:38:57.405381025 +0200
+++ linux-3.5/drivers/net/can/sja1000/sja1000_platform.c
2012-08-09 10:57:22.693364557 +0200
@@ -109,6 +109,8 @@
        priv = netdev_priv(dev);
 
        dev->irq = res_irq->start;
+       if(res_irq->flags & IORESOURCE_IRQ_SHAREABLE)
+               priv->irq_flags |= IRQF_SHARED;
        priv->irq_flags = res_irq->flags & (IRQF_TRIGGER_MASK |
IRQF_SHARED);
        priv->reg_base = addr;
        /* The CAN clock frequency is half the oscillator clock
frequency */



*
include/linux/ioport.h:
#define IORESOURCE_IRQ_SHAREABLE
<http://lxr.free-electrons.com/ident?i=IORESOURCE_IRQ_SHAREABLE>
(1<<4)

**
include/linux/interrupt.h:
#define IRQF_SHARED <http://lxr.free-electrons.com/ident?i=IRQF_SHARED>
0x00000080 


Best regards,
Sven Schmitt
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to