public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "lihuisong (C)" <lihuisong@huawei.com>
To: Sudeep Holla <sudeep.holla@arm.com>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: Jassi Brar <jassisinghbrar@gmail.com>,
	Adam Young <admiyo@os.amperecomputing.com>
Subject: Re: [PATCH 10/14] soc: hisilicon: kunpeng_hccs: Simplify PCC shared memory region handling
Date: Wed, 5 Mar 2025 15:14:50 +0800	[thread overview]
Message-ID: <1e7560ab-2545-843a-e42a-2d37f6b7ef93@huawei.com> (raw)
In-Reply-To: <20250303-pcc_fixes_updates-v1-10-3b44f3d134b1@arm.com>


在 2025/3/3 18:51, Sudeep Holla 写道:
> The PCC driver now handles mapping and unmapping of shared memory
> areas as part of pcc_mbox_{request,free}_channel(). Without these before,
> this Kunpeng HCCS driver did handling of those mappings like several
> other PCC mailbox client drivers.
>
> There were redundant operations, leading to unnecessary code. Maintaining
> the consistency across these driver was harder due to scattered handling
> of shmem.
>
> Just use the mapped shmem and remove all redundant operations from this
> driver.
>
> Cc: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
With belows to change,
Reviewed-by: Huisong Li <lihuisong@huawei.com>
> ---
>   drivers/soc/hisilicon/kunpeng_hccs.c | 38 ++++++++++++------------------------
>   drivers/soc/hisilicon/kunpeng_hccs.h |  2 --
>   2 files changed, 13 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
> index 8aa8dec14911cdcdc2a2d11606bf6159144e9489..3b57189cd778f507afaa89bf47f0fa834043c244 100644
> --- a/drivers/soc/hisilicon/kunpeng_hccs.c
> +++ b/drivers/soc/hisilicon/kunpeng_hccs.c
> @@ -167,10 +167,6 @@ static void hccs_pcc_rx_callback(struct mbox_client *cl, void *mssg)
>   
>   static void hccs_unregister_pcc_channel(struct hccs_dev *hdev)
>   {
> -	struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
> -
> -	if (cl_info->pcc_comm_addr)
> -		iounmap(cl_info->pcc_comm_addr);
>   	pcc_mbox_free_channel(hdev->cl_info.pcc_chan);
>   }
>   
> @@ -179,6 +175,7 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev)
>   	struct hccs_mbox_client_info *cl_info = &hdev->cl_info;
>   	struct mbox_client *cl = &cl_info->client;
>   	struct pcc_mbox_chan *pcc_chan;
> +	struct mbox_chan *mbox_chan;
>   	struct device *dev = hdev->dev;
>   	int rc;
>   
> @@ -196,7 +193,7 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev)
>   		goto out;
>   	}
>   	cl_info->pcc_chan = pcc_chan;
> -	cl_info->mbox_chan = pcc_chan->mchan;
> +	mbox_chan = pcc_chan->mchan;
>   
>   	/*
>   	 * pcc_chan->latency is just a nominal value. In reality the remote
> @@ -206,34 +203,24 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev)
>   	cl_info->deadline_us =
>   			HCCS_PCC_CMD_WAIT_RETRIES_NUM * pcc_chan->latency;
>   	if (!hdev->verspec_data->has_txdone_irq &&
> -	    cl_info->mbox_chan->mbox->txdone_irq) {
> +	    mbox_chan->mbox->txdone_irq) {
>   		dev_err(dev, "PCC IRQ in PCCT is enabled.\n");
>   		rc = -EINVAL;
>   		goto err_mbx_channel_free;
>   	} else if (hdev->verspec_data->has_txdone_irq &&
> -		   !cl_info->mbox_chan->mbox->txdone_irq) {
> +		   !mbox_chan->mbox->txdone_irq) {
>   		dev_err(dev, "PCC IRQ in PCCT isn't supported.\n");
>   		rc = -EINVAL;
>   		goto err_mbx_channel_free;
>   	}
>   
> -	if (!pcc_chan->shmem_base_addr ||
> -	    pcc_chan->shmem_size != HCCS_PCC_SHARE_MEM_BYTES) {
> +	if (pcc_chan->shmem_size != HCCS_PCC_SHARE_MEM_BYTES) {
>   		dev_err(dev, "The base address or size (%llu) of PCC communication region is invalid.\n",
>   			pcc_chan->shmem_size);

Now the check of shared base address is not here. The log about this 
address no need to be printed.

Can you help me fix it like:

dev_err(dev, "The base size (%llu) of PCC communication region must be %d Byte.\n",
  			pcc_chan->shmem_size, HCCS_PCC_SHARE_MEM_BYTES
);

>   		rc = -EINVAL;
>   		goto err_mbx_channel_free;
>   	}
>   


  reply	other threads:[~2025-03-05  7:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 10:51 [PATCH 00/14] mailbox: pcc: Fixes and cleanup/refactoring Sudeep Holla
2025-03-03 10:51 ` [PATCH 01/14] mailbox: pcc: Fix the possible race in updation of chan_in_use flag Sudeep Holla
2025-03-03 10:51 ` [PATCH 02/14] mailbox: pcc: Always clear the platform ack interrupt first Sudeep Holla
2025-03-05  3:45   ` lihuisong (C)
2025-03-05 14:29     ` Sudeep Holla
2025-03-06  3:44       ` lihuisong (C)
2025-03-03 10:51 ` [PATCH 03/14] mailbox: pcc: Drop unnecessary endianness conversion of pcc_hdr.flags Sudeep Holla
2025-03-05  4:02   ` lihuisong (C)
2025-03-05 10:34     ` Sudeep Holla
2025-03-05 10:36     ` Sudeep Holla
2025-03-06  3:50       ` lihuisong (C)
2025-03-03 10:51 ` [PATCH 04/14] mailbox: pcc: Return early if no GAS register from pcc_mbox_cmd_complete_check Sudeep Holla
2025-03-05  5:57   ` lihuisong (C)
2025-03-03 10:51 ` [PATCH 05/14] mailbox: pcc: Use acpi_os_ioremap() instead of ioremap() Sudeep Holla
2025-03-03 10:51 ` [PATCH 06/14] mailbox: pcc: Refactor error handling in irq handler into separate function Sudeep Holla
2025-03-05  6:09   ` lihuisong (C)
2025-03-05 10:42     ` Sudeep Holla
2025-03-03 10:51 ` [PATCH 07/14] mailbox: pcc: Move pcc_mbox_ioremap() before pcc_mbox_request_channel() Sudeep Holla
2025-03-05  6:48   ` lihuisong (C)
2025-03-05 10:56     ` Sudeep Holla
2025-03-05 13:37       ` Sudeep Holla
2025-03-03 10:51 ` [PATCH 08/14] mailbox: pcc: Always map the shared memory communication address Sudeep Holla
2025-03-05  6:54   ` lihuisong (C)
2025-03-05 11:31     ` Sudeep Holla
2025-03-03 10:51 ` [PATCH 09/14] mailbox: pcc: Refactor and simplify check_and_ack() Sudeep Holla
2025-03-03 10:51 ` [PATCH 10/14] soc: hisilicon: kunpeng_hccs: Simplify PCC shared memory region handling Sudeep Holla
2025-03-05  7:14   ` lihuisong (C) [this message]
2025-03-05 11:34     ` Sudeep Holla
2025-03-06  3:55       ` lihuisong (C)
2025-03-06  9:31         ` Sudeep Holla
2025-03-03 10:51 ` [PATCH 11/14] i2c: xgene-slimpro: " Sudeep Holla
2025-03-03 10:51 ` [PATCH 12/14] hwmon: (xgene-hwmon) " Sudeep Holla
2025-03-03 13:55   ` Guenter Roeck
2025-03-03 15:05     ` Sudeep Holla
2025-03-03 10:51 ` [PATCH 13/14] ACPI: PCC: " Sudeep Holla
2025-03-03 10:51 ` [PATCH 14/14] ACPI: CPPC: " Sudeep Holla
2025-03-03 12:06   ` Rafael J. Wysocki

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=1e7560ab-2545-843a-e42a-2d37f6b7ef93@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=admiyo@os.amperecomputing.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@arm.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