Skip to content

Commit 4aca56f

Browse files
damien-lemoalbjorn-helgaas
authored andcommitted
PCI: epf-test: Fix DMA transfer completion initialization
Reinitialize the transfer_complete DMA transfer completion before calling tx_submit(), to avoid seeing the DMA transfer complete before the completion is initialized, thus potentially losing the completion notification. Link: https://lore.kernel.org/r/[email protected] Fixes: 8353813 ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Cc: [email protected]
1 parent f6ec339 commit 4aca56f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test,
151151
return -EIO;
152152
}
153153

154+
reinit_completion(&epf_test->transfer_complete);
154155
tx->callback = pci_epf_test_dma_callback;
155156
tx->callback_param = epf_test;
156157
cookie = tx->tx_submit(tx);
157-
reinit_completion(&epf_test->transfer_complete);
158158

159159
ret = dma_submit_error(cookie);
160160
if (ret) {

0 commit comments

Comments
 (0)