aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuisong Li <[email protected]>2024-04-17 17:48:00 +0800
committerWei Xu <[email protected]>2024-04-25 01:30:33 +0000
commit192f97fe164dd946d0da54bf6e17ff6f9ab9ba43 (patch)
tree4603b867a9c58b720581342fbdb474d14ab7c518
parent4cece764965020c22cff7665b18a012006359095 (diff)
soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
The hccs_get_all_port_attr() is used to obtain the attribute of all the ports on a specified DIE from the firmware. However this interface doesn't ensure whether the firmware reports the complete attribute of all the ports or not. So this patch adds the check for this. Signed-off-by: Huisong Li <[email protected]> Signed-off-by: Wei Xu <[email protected]>
-rw-r--r--drivers/soc/hisilicon/kunpeng_hccs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
index 9ff70b38e5e9..e882a61636ec 100644
--- a/drivers/soc/hisilicon/kunpeng_hccs.c
+++ b/drivers/soc/hisilicon/kunpeng_hccs.c
@@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
start_id = rsp_head.next_id;
}
+ if (left_buf_len != 0) {
+ dev_err(hdev->dev, "failed to get the expected port number(%u) attribute.\n",
+ size);
+ return -EINVAL;
+ }
+
return 0;
}