From 192f97fe164dd946d0da54bf6e17ff6f9ab9ba43 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Wed, 17 Apr 2024 17:48:00 +0800 Subject: [PATCH 1/2] 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 Signed-off-by: Wei Xu --- drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; } From 95d6333e0622dd5ca32c7832a015ae24f56d1ad2 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Wed, 17 Apr 2024 17:48:01 +0800 Subject: [PATCH 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC The kunpeng_hccs driver depends on the Platform Communication Channel Driver. If the PCC driver is not enabled, this driver will be failed to probe. And since the PCC driver depends on the MAILBOX, replace the MAILBOX dependency with the PCC. Signed-off-by: Huisong Li Signed-off-by: Wei Xu --- drivers/soc/hisilicon/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/hisilicon/Kconfig b/drivers/soc/hisilicon/Kconfig index 0ab688af308f..4b0a099b28cc 100644 --- a/drivers/soc/hisilicon/Kconfig +++ b/drivers/soc/hisilicon/Kconfig @@ -6,7 +6,7 @@ menu "Hisilicon SoC drivers" config KUNPENG_HCCS tristate "HCCS driver on Kunpeng SoC" depends on ACPI - depends on MAILBOX + depends on PCC depends on ARM64 || COMPILE_TEST help The Huawei Cache Coherence System (HCCS) is a multi-chip