Commit ef70c601 authored by Chris Mason's avatar Chris Mason Committed by Ben Hutchings

mlx4_en: don't use napi_synchronize inside mlx4_en_netpoll

commit c98235cb upstream.

The mlx4 driver is triggering schedules while atomic inside
mlx4_en_netpoll:

	spin_lock_irqsave(&cq->lock, flags);
	napi_synchronize(&cq->napi);
		^^^^^ msleep here
	mlx4_en_process_rx_cq(dev, cq, 0);
	spin_unlock_irqrestore(&cq->lock, flags);

This was part of a patch by Alexander Guller from Mellanox in 2011,
but it still isn't upstream.
Signed-off-by: default avatarChris Mason <clm@fb.com>
Acked-By: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 48633e72
...@@ -58,7 +58,6 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, ...@@ -58,7 +58,6 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv,
cq->ring = ring; cq->ring = ring;
cq->is_tx = mode; cq->is_tx = mode;
spin_lock_init(&cq->lock);
err = mlx4_alloc_hwq_res(mdev->dev, &cq->wqres, err = mlx4_alloc_hwq_res(mdev->dev, &cq->wqres,
cq->buf_size, 2 * PAGE_SIZE); cq->buf_size, 2 * PAGE_SIZE);
......
...@@ -355,15 +355,11 @@ static void mlx4_en_netpoll(struct net_device *dev) ...@@ -355,15 +355,11 @@ static void mlx4_en_netpoll(struct net_device *dev)
{ {
struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_cq *cq; struct mlx4_en_cq *cq;
unsigned long flags;
int i; int i;
for (i = 0; i < priv->rx_ring_num; i++) { for (i = 0; i < priv->rx_ring_num; i++) {
cq = &priv->rx_cq[i]; cq = &priv->rx_cq[i];
spin_lock_irqsave(&cq->lock, flags); napi_schedule(&cq->napi);
napi_synchronize(&cq->napi);
mlx4_en_process_rx_cq(dev, cq, 0);
spin_unlock_irqrestore(&cq->lock, flags);
} }
} }
#endif #endif
......
...@@ -300,7 +300,6 @@ struct mlx4_en_cq { ...@@ -300,7 +300,6 @@ struct mlx4_en_cq {
struct mlx4_cq mcq; struct mlx4_cq mcq;
struct mlx4_hwq_resources wqres; struct mlx4_hwq_resources wqres;
int ring; int ring;
spinlock_t lock;
struct net_device *dev; struct net_device *dev;
struct napi_struct napi; struct napi_struct napi;
/* Per-core Tx cq processing support */ /* Per-core Tx cq processing support */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment