mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 20:48:49 +08:00
misc: pci_endpoint_test: Re-init completion for every test
commitfb620ae73b
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@kernel.org Fixes:2c156ac71c
("misc: Add host side PCI driver for PCI test function device") 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:
parent
dd22103792
commit
dac4afa3ef
@ -590,6 +590,10 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
|
|||||||
struct pci_dev *pdev = test->pdev;
|
struct pci_dev *pdev = test->pdev;
|
||||||
|
|
||||||
mutex_lock(&test->mutex);
|
mutex_lock(&test->mutex);
|
||||||
|
|
||||||
|
reinit_completion(&test->irq_raised);
|
||||||
|
test->last_irq = -ENODATA;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case PCITEST_BAR:
|
case PCITEST_BAR:
|
||||||
bar = arg;
|
bar = arg;
|
||||||
|
Loading…
Reference in New Issue
Block a user