be2net: Check for POST state in suspend-resume sequence
authorSarveshwar Bandi <sarveshwar.bandi@emulex.com>
Fri, 23 Aug 2013 09:29:33 +0000 (14:59 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Aug 2013 20:55:26 +0000 (16:55 -0400)
In suspend-resume sequence, the OS could attempt to initialize the controller
before it is ready, check for POST state before going ahead.

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 4559c35eea13b5bf5e989066cf062c94ab38710a..3d91a5ec61a4e7a6cd37249d5bad08ee451eeb09 100644 (file)
@@ -4373,6 +4373,10 @@ static int be_resume(struct pci_dev *pdev)
        pci_set_power_state(pdev, PCI_D0);
        pci_restore_state(pdev);
 
+       status = be_fw_wait_ready(adapter);
+       if (status)
+               return status;
+
        /* tell fw we're ready to fire cmds */
        status = be_cmd_fw_init(adapter);
        if (status)