All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: netdev@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-pcmcia@lists.infradead.org, jeffrey.t.kirsher@intel.com,
	kas@fi.muni.cz, davem@davemloft.net,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] net: am2150: fix nmclan_cs.c shared interrupt handling
Date: Wed, 28 Jan 2015 15:15:04 +0100	[thread overview]
Message-ID: <1422454504-439085-5-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1422454504-439085-1-git-send-email-arnd@arndb.de>

A recent patch tried to work around a valid warning for the use of a
deprecated interface by blindly changing from the old
pcmcia_request_exclusive_irq() interface to pcmcia_request_irq().

This driver has an interrupt handler that is not currently aware
of shared interrupts, but can be easily converted to be.
At the moment, the driver reads the interrupt status register
repeatedly until it contains only zeroes in the interesting bits,
and handles each bit individually.

This patch adds the missing part of returning IRQ_NONE in case none
of the bits are set to start with, so we can move on to the next
interrupt source.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5f5316fcd08ef7 ("am2150: Update nmclan_cs.c to use update PCMCIA API")
---
 drivers/net/ethernet/amd/nmclan_cs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/amd/nmclan_cs.c b/drivers/net/ethernet/amd/nmclan_cs.c
index 5b22764ba88d..27245efe9f50 100644
--- a/drivers/net/ethernet/amd/nmclan_cs.c
+++ b/drivers/net/ethernet/amd/nmclan_cs.c
@@ -952,6 +952,8 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
   do {
     /* WARNING: MACE_IR is a READ/CLEAR port! */
     status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR);
+    if (!(status & ~MACE_IMR_DEFAULT) && IntrCnt == MACE_MAX_IR_ITERATIONS)
+      return IRQ_NONE;
 
     pr_debug("mace_interrupt: irq 0x%X status 0x%X.\n", irq, status);
 
-- 
2.1.0.rc2

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] net: am2150: fix nmclan_cs.c shared interrupt handling
Date: Wed, 28 Jan 2015 15:15:04 +0100	[thread overview]
Message-ID: <1422454504-439085-5-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1422454504-439085-1-git-send-email-arnd@arndb.de>

A recent patch tried to work around a valid warning for the use of a
deprecated interface by blindly changing from the old
pcmcia_request_exclusive_irq() interface to pcmcia_request_irq().

This driver has an interrupt handler that is not currently aware
of shared interrupts, but can be easily converted to be.
At the moment, the driver reads the interrupt status register
repeatedly until it contains only zeroes in the interesting bits,
and handles each bit individually.

This patch adds the missing part of returning IRQ_NONE in case none
of the bits are set to start with, so we can move on to the next
interrupt source.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5f5316fcd08ef7 ("am2150: Update nmclan_cs.c to use update PCMCIA API")
---
 drivers/net/ethernet/amd/nmclan_cs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/amd/nmclan_cs.c b/drivers/net/ethernet/amd/nmclan_cs.c
index 5b22764ba88d..27245efe9f50 100644
--- a/drivers/net/ethernet/amd/nmclan_cs.c
+++ b/drivers/net/ethernet/amd/nmclan_cs.c
@@ -952,6 +952,8 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
   do {
     /* WARNING: MACE_IR is a READ/CLEAR port! */
     status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR);
+    if (!(status & ~MACE_IMR_DEFAULT) && IntrCnt == MACE_MAX_IR_ITERATIONS)
+      return IRQ_NONE;
 
     pr_debug("mace_interrupt: irq 0x%X status 0x%X.\n", irq, status);
 
-- 
2.1.0.rc2

  parent reply	other threads:[~2015-01-28 14:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 14:15 [PATCH 0/4] net: driver fixes from arm randconfig builds Arnd Bergmann
2015-01-28 14:15 ` Arnd Bergmann
2015-01-28 14:15 ` [PATCH 1/4] net: cs89x0: always build platform code if !HAS_IOPORT_MAP Arnd Bergmann
2015-01-28 14:15   ` Arnd Bergmann
2015-01-28 14:15 ` [PATCH 2/4] net: wan: add missing virt_to_bus dependencies Arnd Bergmann
2015-01-28 14:15   ` Arnd Bergmann
2015-01-28 16:19   ` Jan Kasprzak
2015-01-28 16:19     ` Jan Kasprzak
2015-01-28 14:15 ` [PATCH 3/4] net: lance,ni64: don't build for ARM Arnd Bergmann
2015-01-28 14:15   ` Arnd Bergmann
2015-01-28 14:15 ` Arnd Bergmann [this message]
2015-01-28 14:15   ` [PATCH 4/4] net: am2150: fix nmclan_cs.c shared interrupt handling Arnd Bergmann
2015-01-29 23:08 ` [PATCH 0/4] net: driver fixes from arm randconfig builds David Miller
2015-01-29 23:08   ` David Miller

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=1422454504-439085-5-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=kas@fi.muni.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=netdev@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.