* Revised [PATCH 1/2]: define inline for test of channel error state
@ 2006-12-12 22:55 Linas Vepstas
2006-12-12 23:46 ` Greg KH
2006-12-13 0:29 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
0 siblings, 2 replies; 8+ messages in thread
From: Linas Vepstas @ 2006-12-12 22:55 UTC (permalink / raw)
To: gregkh, akpm; +Cc: linux-kernel, linux-pci
Greg,
Per discussion, a revised patch. Silly me, the value was already
initialized in drivers/pci/probe.c and I'd been dragging along
a prehistoric version of the if checks.
--linas
[PATCH 1/2]: define inline for test of pci channel error state
Add very simple routine to indicate the pci channel error state.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----
include/linux/pci.h | 5 +++++
1 file changed, 5 insertions(+)
Index: linux-2.6.19-git7/include/linux/pci.h
===================================================================
--- linux-2.6.19-git7.orig/include/linux/pci.h 2006-12-06 15:53:30.000000000 -0600
+++ linux-2.6.19-git7/include/linux/pci.h 2006-12-12 15:48:04.000000000 -0600
@@ -181,6 +181,11 @@ struct pci_dev {
#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
+static inline int pci_channel_offline(struct pci_dev *pdev)
+{
+ return (pdev->error_state != pci_channel_io_normal);
+}
+
static inline struct pci_cap_saved_state *pci_find_saved_cap(
struct pci_dev *pci_dev,char cap)
{
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Revised [PATCH 1/2]: define inline for test of channel error state
2006-12-12 22:55 Revised [PATCH 1/2]: define inline for test of channel error state Linas Vepstas
@ 2006-12-12 23:46 ` Greg KH
2006-12-13 0:29 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
1 sibling, 0 replies; 8+ messages in thread
From: Greg KH @ 2006-12-12 23:46 UTC (permalink / raw)
To: Linas Vepstas; +Cc: gregkh, akpm, linux-kernel, linux-pci
On Tue, Dec 12, 2006 at 04:55:59PM -0600, Linas Vepstas wrote:
> Greg,
>
> Per discussion, a revised patch. Silly me, the value was already
> initialized in drivers/pci/probe.c and I'd been dragging along
> a prehistoric version of the if checks.
>
> --linas
>
> [PATCH 1/2]: define inline for test of pci channel error state
care to resend 2/2 also? It's best to resend entire series, otherwise I
have to go dig for it, and it will take me a while to remember to do
that...
thanks,
greg "my inbox looks like hell" k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2]: Use newly defined PCI channel offline routine
2006-12-12 22:55 Revised [PATCH 1/2]: define inline for test of channel error state Linas Vepstas
2006-12-12 23:46 ` Greg KH
@ 2006-12-13 0:29 ` Linas Vepstas
1 sibling, 0 replies; 8+ messages in thread
From: Linas Vepstas @ 2006-12-13 0:29 UTC (permalink / raw)
To: gregkh, akpm; +Cc: linux-kernel, linux-pci
Use newly minted routine to access the PCI channel state.
Signed-off-by: Linas Vepstas <linas@linas.org>
----
drivers/net/e1000/e1000_main.c | 2 +-
drivers/net/ixgb/ixgb_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.19-git7/drivers/net/e1000/e1000_main.c
===================================================================
--- linux-2.6.19-git7.orig/drivers/net/e1000/e1000_main.c 2006-12-12 16:38:34.000000000 -0600
+++ linux-2.6.19-git7/drivers/net/e1000/e1000_main.c 2006-12-12 16:40:51.000000000 -0600
@@ -3449,7 +3449,7 @@ e1000_update_stats(struct e1000_adapter
*/
if (adapter->link_speed == 0)
return;
- if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+ if (pci_channel_offline(pdev))
return;
spin_lock_irqsave(&adapter->stats_lock, flags);
Index: linux-2.6.19-git7/drivers/net/ixgb/ixgb_main.c
===================================================================
--- linux-2.6.19-git7.orig/drivers/net/ixgb/ixgb_main.c 2006-12-12 16:38:34.000000000 -0600
+++ linux-2.6.19-git7/drivers/net/ixgb/ixgb_main.c 2006-12-12 16:41:00.000000000 -0600
@@ -1564,7 +1564,7 @@ ixgb_update_stats(struct ixgb_adapter *a
struct pci_dev *pdev = adapter->pdev;
/* Prevent stats update while adapter is being reset */
- if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+ if (pci_channel_offline(pdev))
return;
if((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2]: Use newly defined PCI channel offline routine
2006-12-12 20:01 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
@ 2006-12-12 21:27 ` Auke Kok
0 siblings, 0 replies; 8+ messages in thread
From: Auke Kok @ 2006-12-12 21:27 UTC (permalink / raw)
To: Linas Vepstas; +Cc: gregkh, akpm, linux-kernel, linux-pci, jesse.brandeburg
Linas Vepstas wrote:
> Use newly minted routine to access the PCI channel state.
>
> Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
ACK, thanks Linas.
If it doesn't get picked up I can stack it on my queue for netdev later.
Auke
>
> ----
> drivers/net/e1000/e1000_main.c | 2 +-
> drivers/net/ixgb/ixgb_main.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-2.6.19-git7/drivers/net/e1000/e1000_main.c
> ===================================================================
> --- linux-2.6.19-git7.orig/drivers/net/e1000/e1000_main.c 2006-12-05 17:11:01.000000000 -0600
> +++ linux-2.6.19-git7/drivers/net/e1000/e1000_main.c 2006-12-05 17:13:31.000000000 -0600
> @@ -3449,7 +3449,7 @@ e1000_update_stats(struct e1000_adapter
> */
> if (adapter->link_speed == 0)
> return;
> - if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
> + if (pci_channel_offline(pdev))
> return;
>
> spin_lock_irqsave(&adapter->stats_lock, flags);
> Index: linux-2.6.19-git7/drivers/net/ixgb/ixgb_main.c
> ===================================================================
> --- linux-2.6.19-git7.orig/drivers/net/ixgb/ixgb_main.c 2006-12-05 17:11:01.000000000 -0600
> +++ linux-2.6.19-git7/drivers/net/ixgb/ixgb_main.c 2006-12-05 17:13:31.000000000 -0600
> @@ -1564,7 +1564,7 @@ ixgb_update_stats(struct ixgb_adapter *a
> struct pci_dev *pdev = adapter->pdev;
>
> /* Prevent stats update while adapter is being reset */
> - if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
> + if (pci_channel_offline(pdev))
> return;
>
> if((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2]: Use newly defined PCI channel offline routine
2006-12-12 19:55 [PATCH 1/2]: Renumber PCI error enums to start at zero Linas Vepstas
@ 2006-12-12 20:01 ` Linas Vepstas
2006-12-12 21:27 ` Auke Kok
0 siblings, 1 reply; 8+ messages in thread
From: Linas Vepstas @ 2006-12-12 20:01 UTC (permalink / raw)
To: gregkh, akpm; +Cc: linux-kernel, linux-pci, jesse.brandeburg, auke-jan.h.kok
Use newly minted routine to access the PCI channel state.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----
drivers/net/e1000/e1000_main.c | 2 +-
drivers/net/ixgb/ixgb_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.19-git7/drivers/net/e1000/e1000_main.c
===================================================================
--- linux-2.6.19-git7.orig/drivers/net/e1000/e1000_main.c 2006-12-05 17:11:01.000000000 -0600
+++ linux-2.6.19-git7/drivers/net/e1000/e1000_main.c 2006-12-05 17:13:31.000000000 -0600
@@ -3449,7 +3449,7 @@ e1000_update_stats(struct e1000_adapter
*/
if (adapter->link_speed == 0)
return;
- if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+ if (pci_channel_offline(pdev))
return;
spin_lock_irqsave(&adapter->stats_lock, flags);
Index: linux-2.6.19-git7/drivers/net/ixgb/ixgb_main.c
===================================================================
--- linux-2.6.19-git7.orig/drivers/net/ixgb/ixgb_main.c 2006-12-05 17:11:01.000000000 -0600
+++ linux-2.6.19-git7/drivers/net/ixgb/ixgb_main.c 2006-12-05 17:13:31.000000000 -0600
@@ -1564,7 +1564,7 @@ ixgb_update_stats(struct ixgb_adapter *a
struct pci_dev *pdev = adapter->pdev;
/* Prevent stats update while adapter is being reset */
- if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+ if (pci_channel_offline(pdev))
return;
if((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2]: Use newly defined PCI channel offline routine
2006-11-02 0:20 ` Auke Kok
@ 2006-11-02 0:40 ` Linas Vepstas
0 siblings, 0 replies; 8+ messages in thread
From: Linas Vepstas @ 2006-11-02 0:40 UTC (permalink / raw)
To: Auke Kok; +Cc: gregkh, linux-kernel, linux-pci, Jesse Brandeburg
On Wed, Nov 01, 2006 at 04:20:11PM -0800, Auke Kok wrote:
> why not write this so that it reads:
>
> > + if (pci_channel_offline(pdev))
Dohhh! of course!
My excuse? Someone was trying to talk to me
while I wrote this code ...
--linas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2]: Use newly defined PCI channel offline routine
2006-11-02 0:00 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
@ 2006-11-02 0:20 ` Auke Kok
2006-11-02 0:40 ` Linas Vepstas
0 siblings, 1 reply; 8+ messages in thread
From: Auke Kok @ 2006-11-02 0:20 UTC (permalink / raw)
To: Linas Vepstas; +Cc: gregkh, linux-kernel, linux-pci, Jesse Brandeburg
Linas Vepstas wrote:
> Subject: [PATCH 2/2]: Use newly defined PCI channel offline routine
>
> Use newly minted routine to access the PCI channel state.
why not write this so that it reads:
> + if (pci_channel_offline(pdev))
iow are we assuming that there are multiple error_state's per pdev? That seems bogus.
Auke
>
> Signed-off-by: Linas Vepstas <linas@linas.org>
>
> ----
> drivers/net/e1000/e1000_main.c | 2 +-
> drivers/net/ixgb/ixgb_main.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-2.6.19-rc4-git3/drivers/net/e1000/e1000_main.c
> ===================================================================
> --- linux-2.6.19-rc4-git3.orig/drivers/net/e1000/e1000_main.c 2006-11-01 16:15:24.000000000 -0600
> +++ linux-2.6.19-rc4-git3/drivers/net/e1000/e1000_main.c 2006-11-01 16:20:55.000000000 -0600
> @@ -3297,7 +3297,7 @@ e1000_update_stats(struct e1000_adapter
> */
> if (adapter->link_speed == 0)
> return;
> - if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
> + if (pci_channel_offline(pdev->error_state))
> return;
>
> spin_lock_irqsave(&adapter->stats_lock, flags);
> Index: linux-2.6.19-rc4-git3/drivers/net/ixgb/ixgb_main.c
> ===================================================================
> --- linux-2.6.19-rc4-git3.orig/drivers/net/ixgb/ixgb_main.c 2006-11-01 16:15:25.000000000 -0600
> +++ linux-2.6.19-rc4-git3/drivers/net/ixgb/ixgb_main.c 2006-11-01 16:20:55.000000000 -0600
> @@ -1564,7 +1564,7 @@ ixgb_update_stats(struct ixgb_adapter *a
> struct pci_dev *pdev = adapter->pdev;
>
> /* Prevent stats update while adapter is being reset */
> - if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
> + if (pci_channel_offline(pdev->error_state))
> return;
>
> if((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2]: Use newly defined PCI channel offline routine
2006-11-01 23:54 [PATCH 1/2]: Renumber PCI error enums to start at zero Linas Vepstas
@ 2006-11-02 0:00 ` Linas Vepstas
2006-11-02 0:20 ` Auke Kok
0 siblings, 1 reply; 8+ messages in thread
From: Linas Vepstas @ 2006-11-02 0:00 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-pci, Auke Kok, Jesse Brandeburg
Subject: [PATCH 2/2]: Use newly defined PCI channel offline routine
Use newly minted routine to access the PCI channel state.
Signed-off-by: Linas Vepstas <linas@linas.org>
----
drivers/net/e1000/e1000_main.c | 2 +-
drivers/net/ixgb/ixgb_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.19-rc4-git3/drivers/net/e1000/e1000_main.c
===================================================================
--- linux-2.6.19-rc4-git3.orig/drivers/net/e1000/e1000_main.c 2006-11-01 16:15:24.000000000 -0600
+++ linux-2.6.19-rc4-git3/drivers/net/e1000/e1000_main.c 2006-11-01 16:20:55.000000000 -0600
@@ -3297,7 +3297,7 @@ e1000_update_stats(struct e1000_adapter
*/
if (adapter->link_speed == 0)
return;
- if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+ if (pci_channel_offline(pdev->error_state))
return;
spin_lock_irqsave(&adapter->stats_lock, flags);
Index: linux-2.6.19-rc4-git3/drivers/net/ixgb/ixgb_main.c
===================================================================
--- linux-2.6.19-rc4-git3.orig/drivers/net/ixgb/ixgb_main.c 2006-11-01 16:15:25.000000000 -0600
+++ linux-2.6.19-rc4-git3/drivers/net/ixgb/ixgb_main.c 2006-11-01 16:20:55.000000000 -0600
@@ -1564,7 +1564,7 @@ ixgb_update_stats(struct ixgb_adapter *a
struct pci_dev *pdev = adapter->pdev;
/* Prevent stats update while adapter is being reset */
- if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+ if (pci_channel_offline(pdev->error_state))
return;
if((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-12-13 0:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-12 22:55 Revised [PATCH 1/2]: define inline for test of channel error state Linas Vepstas
2006-12-12 23:46 ` Greg KH
2006-12-13 0:29 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
-- strict thread matches above, loose matches on Subject: below --
2006-12-12 19:55 [PATCH 1/2]: Renumber PCI error enums to start at zero Linas Vepstas
2006-12-12 20:01 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
2006-12-12 21:27 ` Auke Kok
2006-11-01 23:54 [PATCH 1/2]: Renumber PCI error enums to start at zero Linas Vepstas
2006-11-02 0:00 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
2006-11-02 0:20 ` Auke Kok
2006-11-02 0:40 ` Linas Vepstas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome