Skip to content

Commit 8159cbe

Browse files
Vasundhara Volamdavem330
authored andcommitted
bnxt_en: Add support to update progress of flash update
This patch adds status notification to devlink flash update while flashing is in progress. $ devlink dev flash pci/0000:05:00.0 file 103.pkg Preparing to flash Flashing done Cc: Jiri Pirko <[email protected]> Signed-off-by: Vasundhara Volam <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cda2cab commit 8159cbe

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ bnxt_dl_flash_update(struct devlink *dl, const char *filename,
2121
const char *region, struct netlink_ext_ack *extack)
2222
{
2323
struct bnxt *bp = bnxt_get_bp_from_dl(dl);
24+
int rc;
2425

2526
if (region)
2627
return -EOPNOTSUPP;
@@ -31,7 +32,18 @@ bnxt_dl_flash_update(struct devlink *dl, const char *filename,
3132
return -EPERM;
3233
}
3334

34-
return bnxt_flash_package_from_file(bp->dev, filename, 0);
35+
devlink_flash_update_begin_notify(dl);
36+
devlink_flash_update_status_notify(dl, "Preparing to flash", region, 0,
37+
0);
38+
rc = bnxt_flash_package_from_file(bp->dev, filename, 0);
39+
if (!rc)
40+
devlink_flash_update_status_notify(dl, "Flashing done", region,
41+
0, 0);
42+
else
43+
devlink_flash_update_status_notify(dl, "Flashing failed",
44+
region, 0, 0);
45+
devlink_flash_update_end_notify(dl);
46+
return rc;
3547
}
3648

3749
static int bnxt_fw_reporter_diagnose(struct devlink_health_reporter *reporter,

0 commit comments

Comments
 (0)