diff options
author | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> | 2016-07-26 13:08:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-26 18:18:56 -0400 |
commit | 0a91605cda883f7a25b1e7fa8cdc3f633ae8f8e0 (patch) | |
tree | 636abbd76d500b8b9f861843b41547356a45cbb7 | |
parent | 90b5ca1766ae7806a711d66df056af1290faa2c0 (diff) |
net/mlx5_core/health: Remove deprecated create_singlethread_workqueue
The workqueue health->wq was used as per device private health thread.
This was done to perform delayed work.
The workqueue has a single workitem(&health->work) and
hence doesn't require ordering. It is involved in handling the health of
the device and is not being used on a memory reclaim path.
Hence, the singlethreaded workqueue has been replaced with the use of
system_wq.
Work item has been flushed in mlx5_health_cleanup() to ensure that
there are no pending tasks while disconnecting the driver.
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/health.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c index 96a59463ae65..1a05fb965c8d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c | |||
@@ -272,7 +272,7 @@ static void poll_health(unsigned long data) | |||
272 | if (in_fatal(dev) && !health->sick) { | 272 | if (in_fatal(dev) && !health->sick) { |
273 | health->sick = true; | 273 | health->sick = true; |
274 | print_health_info(dev); | 274 | print_health_info(dev); |
275 | queue_work(health->wq, &health->work); | 275 | schedule_work(&health->work); |
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
@@ -301,7 +301,7 @@ void mlx5_health_cleanup(struct mlx5_core_dev *dev) | |||
301 | { | 301 | { |
302 | struct mlx5_core_health *health = &dev->priv.health; | 302 | struct mlx5_core_health *health = &dev->priv.health; |
303 | 303 | ||
304 | destroy_workqueue(health->wq); | 304 | flush_work(&health->work); |
305 | } | 305 | } |
306 | 306 | ||
307 | int mlx5_health_init(struct mlx5_core_dev *dev) | 307 | int mlx5_health_init(struct mlx5_core_dev *dev) |
@@ -316,10 +316,7 @@ int mlx5_health_init(struct mlx5_core_dev *dev) | |||
316 | 316 | ||
317 | strcpy(name, "mlx5_health"); | 317 | strcpy(name, "mlx5_health"); |
318 | strcat(name, dev_name(&dev->pdev->dev)); | 318 | strcat(name, dev_name(&dev->pdev->dev)); |
319 | health->wq = create_singlethread_workqueue(name); | ||
320 | kfree(name); | 319 | kfree(name); |
321 | if (!health->wq) | ||
322 | return -ENOMEM; | ||
323 | 320 | ||
324 | INIT_WORK(&health->work, health_care); | 321 | INIT_WORK(&health->work, health_care); |
325 | 322 | ||