linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Sven.Schmitt@volkswagen.de
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Fwd: [Socketcan-users] sja1000_platform interrupt sharing
Date: Thu, 09 Aug 2012 13:21:43 +0200	[thread overview]
Message-ID: <50239D47.8020100@pengutronix.de> (raw)
In-Reply-To: <6C5A3B79888A804CAB605257CD26D37703955B43@vwagwox00032.vw.vwg>

[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]

Hello Sven,

please use our new mailinglist linux-can@vger.kernel.org (Cc'ed), and please don't send HTML emails.

-------- Original Message --------
Subject: [Socketcan-users] sja1000_platform interrupt sharing
Date: Thu, 9 Aug 2012 12:43:38 +0200
From: Schmitt, Sven (EVM/8) <Sven.Schmitt@volkswagen.de>
To: <socketcan-users@lists.berlios.de>

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


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

       reply	other threads:[~2012-08-09 11:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6C5A3B79888A804CAB605257CD26D37703955B43@vwagwox00032.vw.vwg>
2012-08-09 11:21 ` Marc Kleine-Budde [this message]
2012-08-09 11:39   ` Fwd: [Socketcan-users] sja1000_platform interrupt sharing Marc Kleine-Budde
2012-08-09 12:46 AW: " Schmitt, Sven (EVM/8)
2012-08-09 12:56 ` Yegor Yefremov
2012-08-09 13:01   ` Marc Kleine-Budde
2012-08-09 13:13     ` Yegor Yefremov
2012-08-09 14:00       ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50239D47.8020100@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=Sven.Schmitt@volkswagen.de \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).