devctl reset -d detaches the driver, resets the function, and attaches
the driver again. When the reset is a PCIe FLR, pci_reset_child() does
not restore the configuration state that the bus saved at detach, so
the BARs are still clear on re-attach and BAR0 reads return 0xffffffff.
Defensively call pci_restore_state(dev) in gve_attach() before enabling
bus-mastering and mapping BAR resources so D0 power state, BAR base
addresses, and saved PCIe capability registers are restored prior to
accessing BAR memory.
Reviewed-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Tim Hostetler <thostet@google.com>