All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] qlge: Fix qlge_update_hw_vlan_features to handle if interface is down
@ 2015-01-30 11:56 Marcelo Ricardo Leitner
  2015-01-30 23:40 ` Harish Patil
  2015-02-03  1:51 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-01-30 11:56 UTC (permalink / raw)
  To: netdev; +Cc: harish.patil, cdupuis

Currently qlge_update_hw_vlan_features() will always first put the
interface down, then update features and then bring it up again. But it
is possible to hit this code while the adapter is down and this causes a
non-paired call to napi_disable(), which will get stuck.

This patch fixes it by skipping these down/up actions if the interface
is already down.

Fixes: a45adbe8d352 ("qlge: Enhance nested VLAN (Q-in-Q) handling.")
Cc: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index dc0058f9037001b56eb816f0b3d3765089c919cd..8011ef3e7707f783f4caf9f1c16f3d7be3410c4f 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -2351,23 +2351,29 @@ static int qlge_update_hw_vlan_features(struct net_device *ndev,
 {
 	struct ql_adapter *qdev = netdev_priv(ndev);
 	int status = 0;
+	bool need_restart = netif_running(ndev);
 
-	status = ql_adapter_down(qdev);
-	if (status) {
-		netif_err(qdev, link, qdev->ndev,
-			  "Failed to bring down the adapter\n");
-		return status;
+	if (need_restart) {
+		status = ql_adapter_down(qdev);
+		if (status) {
+			netif_err(qdev, link, qdev->ndev,
+				  "Failed to bring down the adapter\n");
+			return status;
+		}
 	}
 
 	/* update the features with resent change */
 	ndev->features = features;
 
-	status = ql_adapter_up(qdev);
-	if (status) {
-		netif_err(qdev, link, qdev->ndev,
-			  "Failed to bring up the adapter\n");
-		return status;
+	if (need_restart) {
+		status = ql_adapter_up(qdev);
+		if (status) {
+			netif_err(qdev, link, qdev->ndev,
+				  "Failed to bring up the adapter\n");
+			return status;
+		}
 	}
+
 	return status;
 }
 
-- 
1.9.3

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

* Re: [PATCH net] qlge: Fix qlge_update_hw_vlan_features to handle if interface is down
  2015-01-30 11:56 [PATCH net] qlge: Fix qlge_update_hw_vlan_features to handle if interface is down Marcelo Ricardo Leitner
@ 2015-01-30 23:40 ` Harish Patil
  2015-02-03  1:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Harish Patil @ 2015-01-30 23:40 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner, netdev; +Cc: cdupuis

>
>Currently qlge_update_hw_vlan_features() will always first put the
>interface down, then update features and then bring it up again. But it
>is possible to hit this code while the adapter is down and this causes a
>non-paired call to napi_disable(), which will get stuck.
>
>This patch fixes it by skipping these down/up actions if the interface
>is already down.
>
>Fixes: a45adbe8d352 ("qlge: Enhance nested VLAN (Q-in-Q) handling.")
>Cc: Harish Patil <harish.patil@qlogic.com>
>Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
>---
> drivers/net/ethernet/qlogic/qlge/qlge_main.c | 26
>++++++++++++++++----------
> 1 file changed, 16 insertions(+), 10 deletions(-)


Acked-by: Harish Patil <harish.patil@qlogic.com>

Thanks,
Harish




________________________________

This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

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

* Re: [PATCH net] qlge: Fix qlge_update_hw_vlan_features to handle if interface is down
  2015-01-30 11:56 [PATCH net] qlge: Fix qlge_update_hw_vlan_features to handle if interface is down Marcelo Ricardo Leitner
  2015-01-30 23:40 ` Harish Patil
@ 2015-02-03  1:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-02-03  1:51 UTC (permalink / raw)
  To: mleitner; +Cc: netdev, harish.patil, cdupuis

From: Marcelo Ricardo Leitner <mleitner@redhat.com>
Date: Fri, 30 Jan 2015 09:56:01 -0200

> Currently qlge_update_hw_vlan_features() will always first put the
> interface down, then update features and then bring it up again. But it
> is possible to hit this code while the adapter is down and this causes a
> non-paired call to napi_disable(), which will get stuck.
> 
> This patch fixes it by skipping these down/up actions if the interface
> is already down.
> 
> Fixes: a45adbe8d352 ("qlge: Enhance nested VLAN (Q-in-Q) handling.")
> Cc: Harish Patil <harish.patil@qlogic.com>
> Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2015-02-03  1:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30 11:56 [PATCH net] qlge: Fix qlge_update_hw_vlan_features to handle if interface is down Marcelo Ricardo Leitner
2015-01-30 23:40 ` Harish Patil
2015-02-03  1:51 ` David Miller

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.