This is a note to let you know that I've just added the patch titled misc: pci_endpoint_test: Re-init completion for every test to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: misc-pci_endpoint_test-re-init-completion-for-every-test.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From fb620ae73b70c2f57b9d3e911fc24c024ba2324f Mon Sep 17 00:00:00 2001 From: Damien Le Moal <dlemoal@xxxxxxxxxx> Date: Sat, 15 Apr 2023 11:35:40 +0900 Subject: misc: pci_endpoint_test: Re-init completion for every test From: Damien Le Moal <dlemoal@xxxxxxxxxx> commit fb620ae73b70c2f57b9d3e911fc24c024ba2324f upstream. The irq_raised completion used to detect the end of a test case is initialized when the test device is probed, but never reinitialized again before a test case. As a result, the irq_raised completion synchronization is effective only for the first ioctl test case executed. Any subsequent call to wait_for_completion() by another ioctl() call will immediately return, potentially too early, leading to false positive failures. Fix this by reinitializing the irq_raised completion before starting a new ioctl() test command. Link: https://lore.kernel.org/r/20230415023542.77601-16-dlemoal@xxxxxxxxxx Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device") Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx> Signed-off-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> Reviewed-by: Manivannan Sadhasivam <mani@xxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/misc/pci_endpoint_test.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -590,6 +590,10 @@ static long pci_endpoint_test_ioctl(stru struct pci_dev *pdev = test->pdev; mutex_lock(&test->mutex); + + reinit_completion(&test->irq_raised); + test->last_irq = -ENODATA; + switch (cmd) { case PCITEST_BAR: bar = arg; Patches currently in stable-queue which might be from dlemoal@xxxxxxxxxx are queue-5.4/pci-rockchip-use-u32-variable-to-access-32-bit-registers.patch queue-5.4/pci-rockchip-assert-pci-configuration-enable-bit-after-probe.patch queue-5.4/pci-rockchip-fix-legacy-irq-generation-for-rk3399-pcie-endpoint-core.patch queue-5.4/misc-pci_endpoint_test-free-irqs-before-removing-the-device.patch queue-5.4/misc-pci_endpoint_test-re-init-completion-for-every-test.patch queue-5.4/pci-rockchip-add-poll-and-timeout-to-wait-for-phy-plls-to-be-locked.patch queue-5.4/pci-rockchip-write-pci-device-id-to-correct-register.patch queue-5.4/pci-rockchip-set-address-alignment-for-endpoint-mode.patch