History

dmaengine: idxd: move wq irq enabling to after device enable

Move the calling of request_irq() and other related irq setup code until after the WQ is successfully enabled. This reduces the amount of setup/teardown if the wq is not configured correctly and cannot be enabled.

Dave Jiang committed 4 years ago

Commit 439b5e71 parent 96144c81 file · +9 −9Browse files

Unified · Split

drivers/dma/idxd/dma.c+9−9
@@ -291,13 +291,6 @@ static int idxd_dmaengine_drv_probe(struct idxd_dev *idxd_dev) · 290 unmodified lines
291 mutex_lock(&wq->wq_lock);291 mutex_lock(&wq->wq_lock);
292 wq->type = IDXD_WQT_KERNEL;292 wq->type = IDXD_WQT_KERNEL;
293 293
294 rc = idxd_wq_request_irq(wq);
295 if (rc < 0) {
296 idxd->cmd_status = IDXD_SCMD_WQ_IRQ_ERR;
297 dev_dbg(dev, "WQ %d irq setup failed: %d\n", wq->id, rc);
298 goto err_irq;
299 }
300
301 rc = __drv_enable_wq(wq);294 rc = __drv_enable_wq(wq);
302 if (rc < 0) {295 if (rc < 0) {
303 dev_dbg(dev, "Enable wq %d failed: %d\n", wq->id, rc);296 dev_dbg(dev, "Enable wq %d failed: %d\n", wq->id, rc);
@@ -305,6 +298,13 @@ static int idxd_dmaengine_drv_probe(struct idxd_dev *idxd_dev) · 1 unmodified line
305 goto err;298 goto err;
306 }299 }
307 300
301 rc = idxd_wq_request_irq(wq);
302 if (rc < 0) {
303 idxd->cmd_status = IDXD_SCMD_WQ_IRQ_ERR;
304 dev_dbg(dev, "WQ %d irq setup failed: %d\n", wq->id, rc);
305 goto err_irq;
306 }
307
308 rc = idxd_wq_alloc_resources(wq);308 rc = idxd_wq_alloc_resources(wq);
309 if (rc < 0) {309 if (rc < 0) {
310 idxd->cmd_status = IDXD_SCMD_WQ_RES_ALLOC_ERR;310 idxd->cmd_status = IDXD_SCMD_WQ_RES_ALLOC_ERR;
@@ -336,10 +336,10 @@ err_dma: · 25 unmodified lines
336err_ref:336err_ref:
337 idxd_wq_free_resources(wq);337 idxd_wq_free_resources(wq);
338err_res_alloc:338err_res_alloc:
339 __drv_disable_wq(wq);
340err:
341 idxd_wq_free_irq(wq);339 idxd_wq_free_irq(wq);
342err_irq:340err_irq:
341 __drv_disable_wq(wq);
342err:
343 wq->type = IDXD_WQT_NONE;343 wq->type = IDXD_WQT_NONE;
344 mutex_unlock(&wq->wq_lock);344 mutex_unlock(&wq->wq_lock);
345 return rc;345 return rc;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t