]> Git Repo - linux.git/commitdiff
PCI: endpoint: test: Synchronously cancel command handler work
authorDamien Le Moal <[email protected]>
Thu, 17 Oct 2024 01:06:48 +0000 (10:06 +0900)
committerKrzysztof Wilczyński <[email protected]>
Mon, 4 Nov 2024 21:30:00 +0000 (21:30 +0000)
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]>
drivers/pci/endpoint/functions/pci-epf-test.c

index a73bc0771d358e57b46371ce81e4cb9970bc2c4a..c2e7f67e510764b59fa26267f306720845ae710c 100644 (file)
@@ -800,7 +800,7 @@ static void pci_epf_test_epc_deinit(struct pci_epf *epf)
 {
        struct pci_epf_test *epf_test = epf_get_drvdata(epf);
 
-       cancel_delayed_work(&epf_test->cmd_handler);
+       cancel_delayed_work_sync(&epf_test->cmd_handler);
        pci_epf_test_clean_dma_chan(epf_test);
        pci_epf_test_clear_bar(epf);
 }
@@ -931,7 +931,7 @@ static void pci_epf_test_unbind(struct pci_epf *epf)
        struct pci_epf_test *epf_test = epf_get_drvdata(epf);
        struct pci_epc *epc = epf->epc;
 
-       cancel_delayed_work(&epf_test->cmd_handler);
+       cancel_delayed_work_sync(&epf_test->cmd_handler);
        if (epc->init_complete) {
                pci_epf_test_clean_dma_chan(epf_test);
                pci_epf_test_clear_bar(epf);
This page took 0.059269 seconds and 4 git commands to generate.