From: linas@austin.ibm.com (Linas Vepstas)
To: Jeff Garzik <jgarzik@pobox.com>, Andrew Morton <akpm@osdl.org>
Cc: linux-pci@atrey.karlin.mff.cuni.cz, netdev@vger.kernel.org,
Ramkrishna Vepa <Ramkrishna.Vepa@neterion.com>,
Sivakumar Subramani <sivakumar.subramani@neterion.com>,
Sreenivasa Honnur <sreenivasa.honnur@neterion.com>,
Rastapur Santosh <santosh.rastapur@neterion.com>,
Wen Xiong <wenxiong@us.ibm.com>
Subject: [PATCH] s2io: don't run MSI handlers if device is offline.
Date: Tue, 22 May 2007 17:50:29 -0500 [thread overview]
Message-ID: <20070522225029.GS5921@austin.ibm.com> (raw)
Don't run any of the MSI handlers if the channel is off;
also don't gather device statatistics. Also, netif_wake
not needed, per suggestions from
Sivakumar Subramani <sivakumar.subramani@neterion.com>.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Ramkrishna Vepa <Ramkrishna.Vepa@neterion.com>
Cc: Sivakumar Subramani <sivakumar.subramani@neterion.com>
Cc: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Cc: Rastapur Santosh <santosh.rastapur@neterion.com>
Cc: Wen Xiong <wenxiong@us.ibm.com>
----
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index e46e164..871c37c 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -4202,6 +4202,9 @@ static irqreturn_t s2io_msi_handle(int i
struct mac_info *mac_control;
struct config_param *config;
+ if (pci_channel_offline(sp->pdev))
+ return IRQ_NONE;
+
atomic_inc(&sp->isr_cnt);
mac_control = &sp->mac_control;
config = &sp->config;
@@ -4232,6 +4235,9 @@ static irqreturn_t s2io_msix_ring_handle
struct ring_info *ring = (struct ring_info *)dev_id;
struct s2io_nic *sp = ring->nic;
+ if (pci_channel_offline(sp->pdev))
+ return IRQ_NONE;
+
atomic_inc(&sp->isr_cnt);
rx_intr_handler(ring);
@@ -4246,6 +4252,9 @@ static irqreturn_t s2io_msix_fifo_handle
struct fifo_info *fifo = (struct fifo_info *)dev_id;
struct s2io_nic *sp = fifo->nic;
+ if (pci_channel_offline(sp->pdev))
+ return IRQ_NONE;
+
atomic_inc(&sp->isr_cnt);
tx_intr_handler(fifo);
atomic_dec(&sp->isr_cnt);
@@ -4428,6 +4437,9 @@ static void s2io_updt_stats(struct s2io_
u64 val64;
int cnt = 0;
+ if (pci_channel_offline(sp->pdev))
+ return;
+
if (atomic_read(&sp->card_state) == CARD_UP) {
/* Apprx 30us on a 133 MHz bus */
val64 = SET_UPDT_CLICKS(10) |
@@ -8122,5 +8134,4 @@ static void s2io_io_resume(struct pci_de
}
netif_device_attach(netdev);
- netif_wake_queue(netdev);
}
next reply other threads:[~2007-05-22 22:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-22 22:50 Linas Vepstas [this message]
2007-05-23 5:03 ` [PATCH] s2io: don't run MSI handlers if device is offline Sivakumar Subramani
2007-05-24 21:20 ` Jeff Garzik
2007-05-25 18:29 ` Linas Vepstas
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=20070522225029.GS5921@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=Ramkrishna.Vepa@neterion.com \
--cc=akpm@osdl.org \
--cc=jgarzik@pobox.com \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=netdev@vger.kernel.org \
--cc=santosh.rastapur@neterion.com \
--cc=sivakumar.subramani@neterion.com \
--cc=sreenivasa.honnur@neterion.com \
--cc=wenxiong@us.ibm.com \
/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).