All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch -next] bnx2x: fix a power state test
@ 2013-05-31 10:07 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-05-31 10:07 UTC (permalink / raw)
  To: Eilon Greenstein; +Cc: netdev, kernel-janitors

PCI_D0 is zero so the original test is never true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I don't have the hardware to test this, and I'm not positive on it.
Buyer beware!

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 263950c..a9a1609 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -1391,7 +1391,7 @@ static bool bnx2x_is_nvm_accessible(struct bnx2x *bp)
 		rc = pci_read_config_word(bp->pdev,
 					  bp->pm_cap + PCI_PM_CTRL, &pm);
 
-	if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_D0) != PCI_D0)))
+	if ((rc && !netif_running(dev)) || (!rc && pm != PCI_D0))
 		return false;
 
 	return true;

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

* [patch -next] bnx2x: fix a power state test
@ 2013-05-31 10:07 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-05-31 10:07 UTC (permalink / raw)
  To: Eilon Greenstein; +Cc: netdev, kernel-janitors

PCI_D0 is zero so the original test is never true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I don't have the hardware to test this, and I'm not positive on it.
Buyer beware!

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 263950c..a9a1609 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -1391,7 +1391,7 @@ static bool bnx2x_is_nvm_accessible(struct bnx2x *bp)
 		rc = pci_read_config_word(bp->pdev,
 					  bp->pm_cap + PCI_PM_CTRL, &pm);
 
-	if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_D0) != PCI_D0)))
+	if ((rc && !netif_running(dev)) || (!rc && pm != PCI_D0))
 		return false;
 
 	return true;

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

* Re: [patch -next] bnx2x: fix a power state test
  2013-05-31 10:07 ` Dan Carpenter
@ 2013-06-01  0:11   ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-06-01  0:11 UTC (permalink / raw)
  To: dan.carpenter; +Cc: eilong, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 31 May 2013 13:07:19 +0300

> PCI_D0 is zero so the original test is never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I don't have the hardware to test this, and I'm not positive on it.
> Buyer beware!

Someone please review/test this patch, thanks.

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

* Re: [patch -next] bnx2x: fix a power state test
@ 2013-06-01  0:11   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-06-01  0:11 UTC (permalink / raw)
  To: dan.carpenter; +Cc: eilong, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 31 May 2013 13:07:19 +0300

> PCI_D0 is zero so the original test is never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I don't have the hardware to test this, and I'm not positive on it.
> Buyer beware!

Someone please review/test this patch, thanks.

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

* RE: [patch -next] bnx2x: fix a power state test
  2013-05-31 10:07 ` Dan Carpenter
@ 2013-06-01 14:53   ` Yuval Mintz
  -1 siblings, 0 replies; 6+ messages in thread
From: Yuval Mintz @ 2013-06-01 14:53 UTC (permalink / raw)
  To: Dan Carpenter, Eilon Greenstein; +Cc: netdev, kernel-janitors


> PCI_D0 is zero so the original test is never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I don't have the hardware to test this, and I'm not positive on it.
> Buyer beware!
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> index 263950c..a9a1609 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> @@ -1391,7 +1391,7 @@ static bool bnx2x_is_nvm_accessible(struct bnx2x
> *bp)
>  		rc = pci_read_config_word(bp->pdev,
>  					  bp->pm_cap + PCI_PM_CTRL, &pm);
> 
> -	if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_D0) != PCI_D0)))
> +	if ((rc && !netif_running(dev)) || (!rc && pm != PCI_D0))
>  		return false;

Hi Dan,

Thanks for the catch, but I think your fix might be incomplete; It should probably be
+	if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_PM_CTRL_STATE_MASK) != PCI_D0)))
Otherwise the condition will fail if other bits are set in the PM control register.

Thanks,
Yuval

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

* RE: [patch -next] bnx2x: fix a power state test
@ 2013-06-01 14:53   ` Yuval Mintz
  0 siblings, 0 replies; 6+ messages in thread
From: Yuval Mintz @ 2013-06-01 14:53 UTC (permalink / raw)
  To: Dan Carpenter, Eilon Greenstein; +Cc: netdev, kernel-janitors


> PCI_D0 is zero so the original test is never true.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I don't have the hardware to test this, and I'm not positive on it.
> Buyer beware!
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> index 263950c..a9a1609 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
> @@ -1391,7 +1391,7 @@ static bool bnx2x_is_nvm_accessible(struct bnx2x
> *bp)
>  		rc = pci_read_config_word(bp->pdev,
>  					  bp->pm_cap + PCI_PM_CTRL, &pm);
> 
> -	if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_D0) != PCI_D0)))
> +	if ((rc && !netif_running(dev)) || (!rc && pm != PCI_D0))
>  		return false;

Hi Dan,

Thanks for the catch, but I think your fix might be incomplete; It should probably be
+	if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_PM_CTRL_STATE_MASK) != PCI_D0)))
Otherwise the condition will fail if other bits are set in the PM control register.

Thanks,
Yuval


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

end of thread, other threads:[~2013-06-01 14:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-31 10:07 [patch -next] bnx2x: fix a power state test Dan Carpenter
2013-05-31 10:07 ` Dan Carpenter
2013-06-01  0:11 ` David Miller
2013-06-01  0:11   ` David Miller
2013-06-01 14:53 ` Yuval Mintz
2013-06-01 14:53   ` Yuval Mintz

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.