PCI: endpoint: Use correct "end of test" interrupt
authorJohn Keeping <john@metanate.com>
Wed, 20 Sep 2017 18:56:06 +0000 (13:56 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 20 Sep 2017 18:56:06 +0000 (13:56 -0500)
commit749aaf3372b8b56b8743c3e27700d64c8bd06921
tree11434013812a24f21ab8df0b6c071879c8d8d739
parent19a8d6b7604df85402deecae01d7861cb1d40c89
PCI: endpoint: Use correct "end of test" interrupt

pci_epf_test_raise_irq() reads the interrupt to use for the response from
reg->command, but this has been cleared at the beginning of the command
handler so the value is always zero at this point.

Instead, extract the interrupt index before handling the command and then
pass the requested interrupt into pci_epf_test_raise_irq().  This allows us
to remove the specific code to extract the interrupt for
COMMAND_RAISE_MSI_IRQ since it is now handled in common code.

Fixes: 3ecf3232c54c ("PCI: endpoint: Do not reset *command* inadvertently")
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/pci/endpoint/functions/pci-epf-test.c