netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] s2io: don't run MSI handlers if device is offline.
@ 2007-05-22 22:50 Linas Vepstas
  2007-05-23  5:03 ` Sivakumar Subramani
  2007-05-24 21:20 ` Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Linas Vepstas @ 2007-05-22 22:50 UTC (permalink / raw)
  To: Jeff Garzik, Andrew Morton
  Cc: linux-pci, netdev, Ramkrishna Vepa, Sivakumar Subramani,
	Sreenivasa Honnur, Rastapur Santosh, Wen Xiong


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);
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] s2io: don't run MSI handlers if device is offline.
  2007-05-22 22:50 [PATCH] s2io: don't run MSI handlers if device is offline Linas Vepstas
@ 2007-05-23  5:03 ` Sivakumar Subramani
  2007-05-24 21:20 ` Jeff Garzik
  1 sibling, 0 replies; 4+ messages in thread
From: Sivakumar Subramani @ 2007-05-23  5:03 UTC (permalink / raw)
  To: Linas Vepstas, Jeff Garzik, Andrew Morton
  Cc: linux-pci, netdev, Ramkrishna Vepa, Sreenivasa Honnur,
	Rastapur Santosh, Wen Xiong, Leonid Grossman, Sriram Rapuru

Fix looks good. No comments.
~Siva 

-----Original Message-----
From: Linas Vepstas [mailto:linas@austin.ibm.com] 
Sent: Wednesday, May 23, 2007 4:20 AM
To: Jeff Garzik; Andrew Morton
Cc: linux-pci@atrey.karlin.mff.cuni.cz; netdev@vger.kernel.org;
Ramkrishna Vepa; Sivakumar Subramani; Sreenivasa Honnur; Rastapur
Santosh; Wen Xiong
Subject: [PATCH] s2io: don't run MSI handlers if device is offline.


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);
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] s2io: don't run MSI handlers if device is offline.
  2007-05-22 22:50 [PATCH] s2io: don't run MSI handlers if device is offline Linas Vepstas
  2007-05-23  5:03 ` Sivakumar Subramani
@ 2007-05-24 21:20 ` Jeff Garzik
  2007-05-25 18:29   ` Linas Vepstas
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2007-05-24 21:20 UTC (permalink / raw)
  To: Linas Vepstas
  Cc: Andrew Morton, linux-pci, netdev, Ramkrishna Vepa,
	Sivakumar Subramani, Sreenivasa Honnur, Rastapur Santosh,
	Wen Xiong

Linas Vepstas wrote:
> 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>

Why are the interrupt handlers being called at all, then?

This seems to be papering over another bug.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] s2io: don't run MSI handlers if device is offline.
  2007-05-24 21:20 ` Jeff Garzik
@ 2007-05-25 18:29   ` Linas Vepstas
  0 siblings, 0 replies; 4+ messages in thread
From: Linas Vepstas @ 2007-05-25 18:29 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Andrew Morton, linux-pci, netdev, Ramkrishna Vepa,
	Sivakumar Subramani, Sreenivasa Honnur, Rastapur Santosh,
	Wen Xiong

On Thu, May 24, 2007 at 05:20:24PM -0400, Jeff Garzik wrote:
> Linas Vepstas wrote:
> >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>.
> >
> Why are the interrupt handlers being called at all, then?
> 
> This seems to be papering over another bug.

Ahh ... are you suggesting that the arch should be performing 
this check in driver-independent code, and not delivering the
MSI if the pci channel is deemed offline? Yes, right, good point. 

So far, I'd hadn't really given this much thought, and had been 
letting the dev drivers perform this check, but, yes, it is probably 
better to have one common check performed in the generic arch-specific 
code, and the interrupt dropped, if the device is offlined.

I'll look into this.

--linas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-25 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22 22:50 [PATCH] s2io: don't run MSI handlers if device is offline Linas Vepstas
2007-05-23  5:03 ` Sivakumar Subramani
2007-05-24 21:20 ` Jeff Garzik
2007-05-25 18:29   ` Linas Vepstas

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).