From: Huisong Li <lihuisong@huawei.com>
To: <rafael@kernel.org>, <rafael.j.wysocki@intel.com>,
<sudeep.holla@arm.com>, <xuwei5@hisilicon.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<soc@kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<liuyonglong@huawei.com>, <lihuisong@huawei.com>
Subject: [PATCH v2 2/2] soc: kunpeng_hccs: add the check for PCC subspace type
Date: Wed, 20 Sep 2023 14:47:03 +0800 [thread overview]
Message-ID: <20230920064703.23543-3-lihuisong@huawei.com> (raw)
In-Reply-To: <20230920064703.23543-1-lihuisong@huawei.com>
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@huawei.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
next prev parent reply other threads:[~2023-09-20 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230914115753.9064-1-lihuisong@huawei.com>
2023-09-20 6:47 ` [PATCH v2 0/2] mailbox: pcc: export the PCC subspace type Huisong Li
2023-09-20 6:47 ` [PATCH v2 1/2] " Huisong Li
2023-09-20 6:47 ` Huisong Li [this message]
2023-09-20 14:11 ` [PATCH v2 2/2] soc: kunpeng_hccs: add the check for " Sudeep Holla
2023-09-21 2:27 ` lihuisong (C)
2023-09-28 11:40 ` lihuisong (C)
2023-09-29 11:27 ` Sudeep Holla
2023-10-07 2:45 ` lihuisong (C)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230920064703.23543-3-lihuisong@huawei.com \
--to=lihuisong@huawei.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=soc@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=xuwei5@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox