• Kishon Vijay Abraham I's avatar
    PCI: endpoint: Do not reset *command* inadvertently · 3ecf3232
    Kishon Vijay Abraham I authored
    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: default avatarKishon Vijay Abraham I <kishon@ti.com>
    Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    3ecf3232
pci-epf-test.c 11.8 KB