diff options
author | Huisong Li <lihuisong@huawei.com> | 2024-04-17 11:48:00 +0200 |
---|---|---|
committer | Wei Xu <xuwei5@hisilicon.com> | 2024-04-25 03:30:33 +0200 |
commit | 192f97fe164dd946d0da54bf6e17ff6f9ab9ba43 (patch) | |
tree | 4603b867a9c58b720581342fbdb474d14ab7c518 /drivers/soc | |
parent | Linux 6.9-rc1 (diff) | |
download | linux-192f97fe164dd946d0da54bf6e17ff6f9ab9ba43.tar.xz linux-192f97fe164dd946d0da54bf6e17ff6f9ab9ba43.zip |
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 <lihuisong@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/hisilicon/kunpeng_hccs.c | 6 |
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; } |