mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
PCI: epf-test: Fix DMA transfer completion initialization
commit4aca56f8eaupstream. 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/20230415023542.77601-4-dlemoal@kernel.org Fixes:8353813c88("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cf0d7b7270
commit
bcd276f143
@@ -151,10 +151,10 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test,
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reinit_completion(&epf_test->transfer_complete);
|
||||||
tx->callback = pci_epf_test_dma_callback;
|
tx->callback = pci_epf_test_dma_callback;
|
||||||
tx->callback_param = epf_test;
|
tx->callback_param = epf_test;
|
||||||
cookie = tx->tx_submit(tx);
|
cookie = tx->tx_submit(tx);
|
||||||
reinit_completion(&epf_test->transfer_complete);
|
|
||||||
|
|
||||||
ret = dma_submit_error(cookie);
|
ret = dma_submit_error(cookie);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|||||||
Reference in New Issue
Block a user