All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: Mylene.Josserand@navocap.com, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: RFC: [PATCH] can: mcp251x: add missing IRQF_ONESHOT to request_threaded_irq
Date: Thu, 11 Apr 2013 10:36:50 +0200	[thread overview]
Message-ID: <1365669410-8101-1-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <51666B21.10109@pengutronix.de>

Since commit:

    1c6c695 genirq: Reject bogus threaded irq requests

threaded irqs must provide a primary handler or set the IRQF_ONESHOT flag.
Since the mcp251x driver doesn't make use of a primary handler set the
IRQF_ONESHOT flag.

/* Cc: linux-stable <stable@vger.kernel.org> # >= v3.5 */
Reported-by: Mylene Josserand <Mylene.Josserand@navocap.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/mcp251x.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index f32b9fc..9aa0c64 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -929,6 +929,7 @@ static int mcp251x_open(struct net_device *net)
 	struct mcp251x_priv *priv = netdev_priv(net);
 	struct spi_device *spi = priv->spi;
 	struct mcp251x_platform_data *pdata = spi->dev.platform_data;
+	unsigned long flags;
 	int ret;
 
 	ret = open_candev(net);
@@ -945,9 +946,14 @@ static int mcp251x_open(struct net_device *net)
 	priv->tx_skb = NULL;
 	priv->tx_len = 0;
 
+	flags = IRQF_ONESHOT;
+	if (pdata->irq_flags)
+		flags |= pdata->irq_flags;
+	else
+		flags |= IRQF_TRIGGER_FALLING;
+
 	ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
-		  pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING,
-		  DEVICE_NAME, priv);
+				   flags, DEVICE_NAME, priv);
 	if (ret) {
 		dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
 		if (pdata->transceiver_enable)
-- 
1.8.2.rc2


  parent reply	other threads:[~2013-04-11  8:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 13:07 [imx27 - mcp251x] MCP251x does not work in static ? Mylene Josserand
2013-04-10 13:39 ` Marc Kleine-Budde
2013-04-10 14:11   ` Mylene Josserand
2013-04-10 15:30     ` Marc Kleine-Budde
2013-04-11  7:39       ` Mylene Josserand
2013-04-11  7:49         ` Marc Kleine-Budde
2013-04-11  8:04           ` Mylene Josserand
2013-04-11  8:39             ` Marc Kleine-Budde
2013-04-11  9:22               ` Mylene Josserand
2013-04-11  9:49                 ` Marc Kleine-Budde
2013-04-11 14:39                   ` Mylene Josserand
2013-04-11 15:09                     ` Marc Kleine-Budde
2013-04-12  9:24                       ` Mylene Josserand
2013-04-12  9:49                         ` Marc Kleine-Budde
2013-04-12  9:36                     ` Marc Kleine-Budde
2013-04-12  9:40                       ` Mylene Josserand
2013-04-12  9:48                         ` Marc Kleine-Budde
2013-04-11  8:36           ` Marc Kleine-Budde [this message]
2013-04-12 11:16             ` RFC: [PATCH] can: mcp251x: add missing IRQF_ONESHOT to request_threaded_irq 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=1365669410-8101-1-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=Mylene.Josserand@navocap.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.