From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Huisong Li <lihuisong@huawei.com>
Cc: <xuwei5@hisilicon.com>, <linux-kernel@vger.kernel.org>,
<soc@kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<arnd@arndb.de>, <krzk@kernel.org>, <sudeep.holla@arm.com>,
<liuyonglong@huawei.com>
Subject: Re: [PATCH v2 4/4] soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack
Date: Thu, 30 Nov 2023 14:49:11 +0000 [thread overview]
Message-ID: <20231130144911.00005faf@Huawei.com> (raw)
In-Reply-To: <20231130134550.33398-5-lihuisong@huawei.com>
On Thu, 30 Nov 2023 21:45:50 +0800
Huisong Li <lihuisong@huawei.com> wrote:
> Support the platform with PCC type3 and interrupt ack. And a version
> specific structure is introduced to handle the difference between the
> device in the code.
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
Hi.
A few trivial things inline but now looks good to me!
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> drivers/soc/hisilicon/kunpeng_hccs.c | 136 ++++++++++++++++++++++-----
> drivers/soc/hisilicon/kunpeng_hccs.h | 15 +++
> 2 files changed, 126 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
> index 15125f1e0f3e..d2302ff8c0e9 100644
> --- a/drivers/soc/hisilicon/kunpeng_hccs.c
> +++ b/drivers/soc/hisilicon/kunpeng_hccs.c
...
>
> -static int hccs_check_chan_cmd_complete(struct hccs_dev *hdev)
> +static inline int hccs_wait_cmd_complete_by_poll(struct hccs_dev *hdev)
Why inline? Do we have numbers to support this hint to the compiler being
useful?
> {
> struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
> struct acpi_pcct_shared_memory __iomem *comm_base =
> @@ -194,30 +211,75 @@ static int hccs_check_chan_cmd_complete(struct hccs_dev *hdev)
> return ret;
> }
>
> +static inline int hccs_wait_cmd_complete_by_irq(struct hccs_dev *hdev)
> +{
> + struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
> + int ret = 0;
Drop ret...
> +
> + if (!wait_for_completion_timeout(&cl_info->done,
> + usecs_to_jiffies(cl_info->deadline_us))) {
> + dev_err(hdev->dev, "PCC command executed timeout!\n");
> + ret = -ETIMEDOUT;
return -TIMEDOUT;
...
> + }
> +
> + return ret;
return 0;
> +}
> +static const struct hccs_verspecific_data hisi04b1_verspec_data = {
> + .rx_callback = NULL,
It's harmless but no need to set callback to NULL. Maybe it acts as documentation?
It's common practice to just let C spec guarantees initialize any not implemented callbacks
to 0 without them needing to be done explicitly.
> + .wait_cmd_complete = hccs_wait_cmd_complete_by_poll,
> + .fill_pcc_shared_mem = hccs_fill_pcc_shared_mem_region,
> + .shared_mem_size = sizeof(struct acpi_pcct_shared_memory),
> + .has_txdone_irq = false,
> +};
> +
> +static const struct hccs_verspecific_data hisi04b2_verspec_data = {
> + .rx_callback = hccs_pcc_rx_callback,
> + .wait_cmd_complete = hccs_wait_cmd_complete_by_irq,
> + .fill_pcc_shared_mem = hccs_fill_ext_pcc_shared_mem_region,
> + .shared_mem_size = sizeof(struct acpi_pcct_ext_pcc_shared_memory),
> + .has_txdone_irq = true,
> +};
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-11-30 14:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 5:45 [PATCH v1 0/3] soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack Huisong Li
2023-11-09 5:45 ` [PATCH v1 1/3] soc: hisilicon: kunpeng_hccs: Fix some incorrect format strings Huisong Li
2023-11-28 15:25 ` Jonathan Cameron
2023-11-09 5:45 ` [PATCH v1 2/3] soc: hisilicon: kunpeng_hccs: Add failure log for no _CRS method Huisong Li
2023-11-28 15:22 ` Jonathan Cameron
2023-11-09 5:45 ` [PATCH v1 3/3] soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack Huisong Li
2023-11-28 15:44 ` Jonathan Cameron
2023-11-30 1:16 ` lihuisong (C)
2023-11-30 13:45 ` [PATCH v2 0/4] " Huisong Li
2023-11-30 13:45 ` [PATCH v2 1/4] soc: hisilicon: kunpeng_hccs: Fix some incorrect format strings Huisong Li
2023-11-30 13:45 ` [PATCH v2 2/4] soc: hisilicon: kunpeng_hccs: Add failure log for no _CRS method Huisong Li
2023-11-30 13:45 ` [PATCH v2 3/4] soc: hisilicon: kunpeng_hccs: remove an unused blank line Huisong Li
2023-11-30 14:42 ` Jonathan Cameron
2023-11-30 13:45 ` [PATCH v2 4/4] soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack Huisong Li
2023-11-30 14:49 ` Jonathan Cameron [this message]
2023-12-01 2:45 ` lihuisong (C)
2023-12-01 3:45 ` [PATCH v3 0/5] " Huisong Li
2023-12-01 3:45 ` [PATCH v3 1/5] soc: hisilicon: kunpeng_hccs: Fix some incorrect format strings Huisong Li
2023-12-01 3:45 ` [PATCH v3 2/5] soc: hisilicon: kunpeng_hccs: Add failure log for no _CRS method Huisong Li
2023-12-01 3:45 ` [PATCH v3 3/5] soc: hisilicon: kunpeng_hccs: Remove an unused blank line Huisong Li
2023-12-01 3:45 ` [PATCH v3 4/5] doc: kunpeng_hccs: Fix incorrect email domain name Huisong Li
2023-12-01 3:45 ` [PATCH v3 5/5] soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack Huisong Li
2023-12-08 7:18 ` [PATCH v3 0/5] " Wei Xu
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=20231130144911.00005faf@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=arnd@arndb.de \
--cc=krzk@kernel.org \
--cc=lihuisong@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--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;
as well as URLs for NNTP newsgroup(s).