Merge branch 'for-linus' into fixes
authorVinod Koul <vkoul@kernel.org>
Wed, 5 Aug 2020 13:32:07 +0000 (19:02 +0530)
committerVinod Koul <vkoul@kernel.org>
Wed, 5 Aug 2020 13:32:07 +0000 (19:02 +0530)
Signed-off-by: Vinod Koul <vkoul@kernel.org>
 Conflicts:
drivers/dma/idxd/sysfs.c

12 files changed:
1  2 
drivers/dma/dmatest.c
drivers/dma/dw/core.c
drivers/dma/idxd/cdev.c
drivers/dma/idxd/device.c
drivers/dma/idxd/idxd.h
drivers/dma/idxd/irq.c
drivers/dma/idxd/sysfs.c
drivers/dma/imx-sdma.c
drivers/dma/ioat/dma.c
drivers/dma/ti/k3-udma-private.c
drivers/dma/ti/k3-udma.c
include/uapi/linux/idxd.h

Simple merge
Simple merge
@@@ -115,10 -104,11 +115,13 @@@ static int idxd_cdev_release(struct ino
        dev_dbg(dev, "%s called\n", __func__);
        filep->private_data = NULL;
  
+       /* Wait for in-flight operations to complete. */
+       idxd_wq_drain(wq);
        kfree(ctx);
 +      mutex_lock(&wq->wq_lock);
        idxd_wq_put(wq);
 +      mutex_unlock(&wq->wq_lock);
        return 0;
  }
  
Simple merge
@@@ -288,9 -290,9 +290,10 @@@ int idxd_wq_alloc_resources(struct idxd
  void idxd_wq_free_resources(struct idxd_wq *wq);
  int idxd_wq_enable(struct idxd_wq *wq);
  int idxd_wq_disable(struct idxd_wq *wq);
+ void idxd_wq_drain(struct idxd_wq *wq);
  int idxd_wq_map_portal(struct idxd_wq *wq);
  void idxd_wq_unmap_portal(struct idxd_wq *wq);
 +void idxd_wq_disable_cleanup(struct idxd_wq *wq);
  
  /* submission */
  int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc);
@@@ -158,11 -155,10 +155,11 @@@ irqreturn_t idxd_misc_thread(int vec, v
                                "idxd halted, need %s.\n",
                                gensts.reset_type == IDXD_DEVICE_RESET_FLR ?
                                "FLR" : "system reset");
+                       spin_unlock_bh(&idxd->dev_lock);
                }
-               spin_unlock_bh(&idxd->dev_lock);
        }
  
 + out:
        idxd_unmask_msix_vector(idxd, irq_entry->id);
        return IRQ_HANDLED;
  }
@@@ -313,14 -303,7 +303,14 @@@ static int idxd_config_bus_remove(struc
                }
  
                idxd_unregister_dma_device(idxd);
-               spin_lock_irqsave(&idxd->dev_lock, flags);
                rc = idxd_device_disable(idxd);
-               spin_unlock_irqrestore(&idxd->dev_lock, flags);
 +              for (i = 0; i < idxd->max_wqs; i++) {
 +                      struct idxd_wq *wq = &idxd->wqs[i];
 +
++                      mutex_lock(&wq->wq_lock);
 +                      idxd_wq_disable_cleanup(wq);
++                      mutex_unlock(&wq->wq_lock);
 +              }
                module_put(THIS_MODULE);
                if (rc < 0)
                        dev_warn(dev, "Device disable failed\n");
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge