PCI: endpoint: Do not reset *command* inadvertently
authorKishon Vijay Abraham I <kishon@ti.com>
Fri, 18 Aug 2017 14:57:58 +0000 (20:27 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Aug 2017 21:00:37 +0000 (16:00 -0500)
commit3ecf3232c54cf76a21e552879285be2f313b2e06
tree557dc9674dd05608cd54d7335ba763102d4ede8e
parent09232c7acbd451c6da555ffdebad82661bf3d0be
PCI: endpoint: Do not reset *command* inadvertently

pci_epf_test_cmd_handler() is the delayed work function which reads
*command* (set by the host) and performs various actions requested by the
host periodically. If the value in *command* is '0', it goes to the
reset_handler where it resets *command* to '0' and queues
pci_epf_test_cmd_handler().

However if the host writes a value to the *command* just after the
pci-epf-test driver checks *command* for '0' and before the control goes to
reset_handler, the *command* will be reset to '0' and the pci-epf-test
driver won't be able to perform the actions requested by the host.  Fix it
here by not resetting the *command* in the reset_handler.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/endpoint/functions/pci-epf-test.c