summaryrefslogtreecommitdiff
path: root/drivers/pci/doe.c
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2023-03-11 15:40:10 +0100
committerDan Williams <dan.j.williams@intel.com>2023-04-18 10:36:58 -0700
commitc8fc07abeba5cd14e88a2d77f4c4fed670da9492 (patch)
tree0a81079f281729bc17862e1463ae62da3e4eb8ee /drivers/pci/doe.c
parent0821ff8ed059d38dfc9bec2106c5cc53bcaa15b1 (diff)
PCI/DOE: Deduplicate mailbox flushing
When a DOE mailbox is torn down, its workqueue is flushed once in pci_doe_flush_mb() through a call to flush_workqueue() and subsequently flushed once more in pci_doe_destroy_workqueue() through a call to destroy_workqueue(). Deduplicate by dropping flush_workqueue() from pci_doe_flush_mb(). Rename pci_doe_flush_mb() to pci_doe_cancel_tasks() to more aptly describe what it now does. Tested-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Lukas Wunner <lukas@wunner.de> Reviewed-by: Ming Li <ming4.li@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/1f009f60b326d1c6d776641d4b20aff27de0c234.1678543498.git.lukas@wunner.de Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/pci/doe.c')
-rw-r--r--drivers/pci/doe.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pci/doe.c b/drivers/pci/doe.c
index dfdec73f6abc..d9f3676bce29 100644
--- a/drivers/pci/doe.c
+++ b/drivers/pci/doe.c
@@ -429,7 +429,7 @@ static void pci_doe_destroy_workqueue(void *mb)
destroy_workqueue(doe_mb->work_queue);
}
-static void pci_doe_flush_mb(void *mb)
+static void pci_doe_cancel_tasks(void *mb)
{
struct pci_doe_mb *doe_mb = mb;
@@ -439,9 +439,6 @@ static void pci_doe_flush_mb(void *mb)
/* Cancel an in progress work item, if necessary */
set_bit(PCI_DOE_FLAG_CANCEL, &doe_mb->flags);
wake_up(&doe_mb->wq);
-
- /* Flush all work items */
- flush_workqueue(doe_mb->work_queue);
}
/**
@@ -498,9 +495,9 @@ struct pci_doe_mb *pcim_doe_create_mb(struct pci_dev *pdev, u16 cap_offset)
/*
* The state machine and the mailbox should be in sync now;
- * Set up mailbox flush prior to using the mailbox to query protocols.
+ * Set up cancel tasks prior to using the mailbox to query protocols.
*/
- rc = devm_add_action_or_reset(dev, pci_doe_flush_mb, doe_mb);
+ rc = devm_add_action_or_reset(dev, pci_doe_cancel_tasks, doe_mb);
if (rc)
return ERR_PTR(rc);