All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] cxgb4 : Disable recursive mailbox commands when enabling vi
@ 2014-08-05 23:05 Anish Bhatt
  2014-08-05 23:49 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Anish Bhatt @ 2014-08-05 23:05 UTC (permalink / raw)
  To: netdev; +Cc: davem, hariprasad, leedom, Anish Bhatt

Enabling a Virtual Interface can result in an interrupt during the processing
 of the VI Enable command and, in some paths, result in an attempt to issue
another command in the interrupt context, eventually crashing the system. Thus,
 we disable interrupts during the course of the VI Enable command and ensure 
enable doesn't sleep.

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Casey Leedom <leedom@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 5 ++++-
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c      | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 8b46534b06c1..4247356c16ff 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -673,9 +673,12 @@ static int link_start(struct net_device *dev)
 	if (ret == 0)
 		ret = t4_link_start(pi->adapter, mb, pi->tx_chan,
 				    &pi->link_cfg);
-	if (ret == 0)
+	if (ret == 0) {
+		local_bh_disable();
 		ret = t4_enable_vi_params(pi->adapter, mb, pi->viid, true,
 					  true, CXGB4_DCB_ENABLED);
+		local_bh_enable();
+	}
 
 	return ret;
 }
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 448bec119c3c..a853133d8db8 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3558,7 +3558,7 @@ int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,
 	c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_IEN(rx_en) |
 			       FW_VI_ENABLE_CMD_EEN(tx_en) | FW_LEN16(c) |
 			       FW_VI_ENABLE_CMD_DCB_INFO(dcb_en));
-	return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
+	return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL);
 }
 
 /**
-- 
2.0.3

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

* Re: [PATCH net-next] cxgb4 : Disable recursive mailbox commands when enabling vi
  2014-08-05 23:05 [PATCH net-next] cxgb4 : Disable recursive mailbox commands when enabling vi Anish Bhatt
@ 2014-08-05 23:49 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-08-05 23:49 UTC (permalink / raw)
  To: anish; +Cc: netdev, hariprasad, leedom

From: Anish Bhatt <anish@chelsio.com>
Date: Tue,  5 Aug 2014 16:05:23 -0700

> Enabling a Virtual Interface can result in an interrupt during the processing
>  of the VI Enable command and, in some paths, result in an attempt to issue
> another command in the interrupt context, eventually crashing the system. Thus,
>  we disable interrupts during the course of the VI Enable command and ensure 
> enable doesn't sleep.
> 
> Signed-off-by: Anish Bhatt <anish@chelsio.com>
> Signed-off-by: Casey Leedom <leedom@chelsio.com>

Applied.

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

end of thread, other threads:[~2014-08-05 23:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 23:05 [PATCH net-next] cxgb4 : Disable recursive mailbox commands when enabling vi Anish Bhatt
2014-08-05 23:49 ` 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.