]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bnxt_en: Send FUNC_RESOURCE_QCAPS command in bnxt_resume()
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Sun, 24 Nov 2019 03:30:42 +0000 (22:30 -0500)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sun, 24 Nov 2019 22:48:02 +0000 (14:48 -0800)
After driver unregister, firmware is erasing the information that
driver supports new resource management. Send FUNC_RESOURCE_QCAPS
command to inform the firmware that driver supports new resource
management while resuming from hibernation.  Otherwise, we fallback
to the older resource allocation scheme.

Also, move driver register after sending FUNC_RESOURCE_QCAPS command
to be consistent with the normal initialization sequence.

Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index f627741ef5853337169f1ff560b783cdf9b8b49f..69d7ab1d01db27dd7f1fe363f53237558f503455 100644 (file)
@@ -11934,8 +11934,7 @@ static int bnxt_resume(struct device *device)
                goto resume_exit;
        }
        pci_set_master(bp->pdev);
-       if (bnxt_hwrm_ver_get(bp) ||
-           bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, false)) {
+       if (bnxt_hwrm_ver_get(bp)) {
                rc = -ENODEV;
                goto resume_exit;
        }
@@ -11944,6 +11943,15 @@ static int bnxt_resume(struct device *device)
                rc = -EBUSY;
                goto resume_exit;
        }
+
+       if (BNXT_NEW_RM(bp))
+               bnxt_hwrm_func_resc_qcaps(bp, false);
+
+       if (bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, false)) {
+               rc = -ENODEV;
+               goto resume_exit;
+       }
+
        bnxt_get_wol_settings(bp);
        if (netif_running(dev)) {
                rc = bnxt_open(dev);