On Tue, Aug 6, 2024 at 9:15 PM Bjorn Helgaas <helgaas@xxxxxxxxxx> wrote: > > On Tue, Aug 06, 2024 at 06:27:54PM +0200, Rick Wertenbroek wrote: > > The test for a DMA transfer was done in pci_epf_test_cmd_handler, which > > if not supported would lead to the endpoint function just printing an > > error message and waiting for further commands. This would leave the > > I guess it's the *test* that prints the error message? Is this the > "Cannot transfer data using DMA" message? That is the error message, the error message is printed by the endpoint function, on the endpoint device. On the host side, nothing happens; the test program just hangs because the driver waits indefinitely. With the change I proposed, the test program completes the test and will display "NOT OKAY" as normal when a test fails. > > > host side PCI driver waiting for an interrupt because the call to > > pci_epf_test_raise_irq is skipped. The host side driver > > drivers/misc/pci_endpoint_test.c would hang indefinitely when sending > > a transfer request with DMA if the endpoint does not support it. > > This is because wait_for_completion() is used in the host side driver. > > > > Move the DMA check into the read/write/copy functions so that they > > report a transfer (IO) error so that pci_epf_test_raise_irq() is > > called when a transfer with DMA is requested, even if unsupported. > > Add "()" after function names above, as you did for > pci_epf_test_raise_irq(). I will add this. > > > The host side driver will still report an error on transfer thanks > > to the checksum, because no data was moved, but will not hang anymore > > waiting for an interrupt that will never arrive. Thanks. Regards, Rick