Skip to content

Commit 97110d4

Browse files
damien-lemoalkwilczynski
authored andcommitted
PCI: endpoint: test: Synchronously cancel command handler work
Use cancel_delayed_work_sync() in pci_epf_test_epc_deinit() to ensure that the command handler is really stopped before proceeding with DMA and BAR cleanup. The same change is also done in pci_epf_test_link_down() to ensure that the link down handling completes with the command handler fully stopped. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Frank Li <[email protected]>
1 parent e73ea1c commit 97110d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/endpoint/functions/pci-epf-test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ static void pci_epf_test_epc_deinit(struct pci_epf *epf)
800800
{
801801
struct pci_epf_test *epf_test = epf_get_drvdata(epf);
802802

803-
cancel_delayed_work(&epf_test->cmd_handler);
803+
cancel_delayed_work_sync(&epf_test->cmd_handler);
804804
pci_epf_test_clean_dma_chan(epf_test);
805805
pci_epf_test_clear_bar(epf);
806806
}
@@ -931,7 +931,7 @@ static void pci_epf_test_unbind(struct pci_epf *epf)
931931
struct pci_epf_test *epf_test = epf_get_drvdata(epf);
932932
struct pci_epc *epc = epf->epc;
933933

934-
cancel_delayed_work(&epf_test->cmd_handler);
934+
cancel_delayed_work_sync(&epf_test->cmd_handler);
935935
if (epc->init_complete) {
936936
pci_epf_test_clean_dma_chan(epf_test);
937937
pci_epf_test_clear_bar(epf);

0 commit comments

Comments
 (0)