[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230920064703.23543-3-lihuisong@huawei.com>
Date: Wed, 20 Sep 2023 14:47:03 +0800
From: Huisong Li <lihuisong@...wei.com>
To: <rafael@...nel.org>, <rafael.j.wysocki@...el.com>,
<sudeep.holla@....com>, <xuwei5@...ilicon.com>
CC: <linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<soc@...nel.org>, <linux-arm-kernel@...ts.infradead.org>,
<liuyonglong@...wei.com>, <lihuisong@...wei.com>
Subject: [PATCH v2 2/2] soc: kunpeng_hccs: add the check for PCC subspace type
Currently, HCCS driver directly uses Generic Communications Channel Shared
Memory Region which is used in type0/1/2 to communicate with platform,
but actually doesn't support type3/4/5.
So this patch adds the check for PCC subspace type.
Signed-off-by: Huisong Li <lihuisong@...wei.com>
---
drivers/soc/hisilicon/kunpeng_hccs.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
index f3810d9d1caa..4ba3bfd45a01 100644
--- a/drivers/soc/hisilicon/kunpeng_hccs.c
+++ b/drivers/soc/hisilicon/kunpeng_hccs.c
@@ -174,6 +174,19 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev)
return rc;
}
+static int hccs_check_pcc_info(struct hccs_dev *hdev)
+{
+ struct pcc_mbox_chan *pcc_chan = hdev->cl_info.pcc_chan;
+
+ if (pcc_chan->type >= ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE) {
+ dev_err(hdev->dev, "unsupport for subspace type%u.\n",
+ pcc_chan->type);
+ return -EOPNOTSUPP;
+ }
+
+ return 0;
+}
+
static int hccs_check_chan_cmd_complete(struct hccs_dev *hdev)
{
struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
@@ -1224,6 +1237,10 @@ static int hccs_probe(struct platform_device *pdev)
if (rc)
return rc;
+ rc = hccs_check_pcc_info(hdev);
+ if (rc)
+ goto unregister_pcc_chan;
+
rc = hccs_get_dev_caps(hdev);
if (rc)
goto unregister_pcc_chan;
--
2.33.0
Powered by blists - more mailing lists