public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Huisong Li <lihuisong@huawei.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	rafael@kernel.org, rafael.j.wysocki@intel.com,
	Sudeep Holla <sudeep.holla@arm.com>,
	wanghuiqiang@huawei.com, zhangzekun11@huawei.com,
	wangxiongfeng2@huawei.com, tanxiaofei@huawei.com,
	guohanjun@huawei.com, xiexiuqi@huawei.com,
	wangkefeng.wang@huawei.com, huangdaode@huawei.com
Subject: Re: [PATCH 2/3] ACPI: PCC: add check for platform interrupt
Date: Thu, 10 Nov 2022 10:36:18 +0000	[thread overview]
Message-ID: <20221110103618.3vuyfdhcebf7ewmo@bogus> (raw)
In-Reply-To: <20221110015034.7943-3-lihuisong@huawei.com>

On Thu, Nov 10, 2022 at 09:50:33AM +0800, Huisong Li wrote:
> PCC Operation Region driver senses the completion of command by interrupt
> way. If platform can not generate an interrupt when a command complete,
> the caller never gets the desired result. So let's reject the setup of the
> PCC address space on platform that do not support interrupt mode.
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> ---
>  drivers/acpi/acpi_pcc.c | 47 +++++++++++++++++++++++++----------------
>  1 file changed, 29 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
> index 3e252be047b8..8efd08e469aa 100644
> --- a/drivers/acpi/acpi_pcc.c
> +++ b/drivers/acpi/acpi_pcc.c
> @@ -53,6 +53,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
>  	struct pcc_data *data;
>  	struct acpi_pcc_info *ctx = handler_context;
>  	struct pcc_mbox_chan *pcc_chan;
> +	static acpi_status ret;
>  
>  	data = kzalloc(sizeof(*data), GFP_KERNEL);
>  	if (!data)
> @@ -69,23 +70,35 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
>  	if (IS_ERR(data->pcc_chan)) {
>  		pr_err("Failed to find PCC channel for subspace %d\n",
>  		       ctx->subspace_id);
> -		kfree(data);
> -		return AE_NOT_FOUND;
> +		ret = AE_NOT_FOUND;
> +		goto request_channel_fail;
>  	}
>

Your patch seems to be not based on the upstream.
Commit f890157e61b8 ("ACPI: PCC: Release resources on address space setup
failure path") has addressed it already.

>  	pcc_chan = data->pcc_chan;
> +	if (!pcc_chan->mchan->mbox->txdone_irq) {
> +		pr_err("This channel-%d does not support interrupt.\n",
> +		       ctx->subspace_id);
> +		ret = AE_SUPPORT;
> +		goto request_channel_fail;
> +	}

Indeed, I supported only interrupt case and this approach is better than
checking it in handler atleast until we add support for polling based
transfers in future(hope that never happens, but you never know)

-- 
Regards,
Sudeep

  reply	other threads:[~2022-11-10 10:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10  1:50 [PATCH 0/3] ACPI: PCC: optimize pcc codes and fix one bug Huisong Li
2022-11-10  1:50 ` [PATCH 1/3] mailbox: pcc: rename platform interrupt bit macro name Huisong Li
2022-11-10 10:25   ` Sudeep Holla
2022-11-10 12:17     ` lihuisong (C)
2022-11-10 19:29       ` Rafael J. Wysocki
2022-11-11  1:10         ` lihuisong (C)
2022-11-10  1:50 ` [PATCH 2/3] ACPI: PCC: add check for platform interrupt Huisong Li
2022-11-10 10:36   ` Sudeep Holla [this message]
2022-11-10 12:08     ` lihuisong (C)
2022-11-10  1:50 ` [PATCH 3/3] mailbox: pcc: fix 'pcc_chan_count' when fail to initialize PCC Huisong Li
2022-11-10 10:44   ` Sudeep Holla
2022-11-10 12:10     ` lihuisong (C)
2022-11-11  2:44 ` [PATCH V2 0/2] optimize pcc code and fix one bug Huisong Li
2022-11-11  2:44   ` [PATCH V2 1/2] ACPI: PCC: add check for platform interrupt Huisong Li
2022-11-11 14:26     ` Sudeep Holla
2022-11-12  1:27       ` lihuisong (C)
2022-11-11  2:44   ` [PATCH V2 2/2] mailbox: pcc: fix 'pcc_chan_count' when fail to initialize PCC Huisong Li
2022-11-11 14:14     ` Sudeep Holla
2022-11-12  2:05 ` [PATCH V3 0/2] Optimize PCC OpRegion code and reset pcc_chan_count Huisong Li
2022-11-12  2:05   ` [PATCH V3 1/2] ACPI: PCC: Setup PCC Opregion handler only if platform interrupt is available Huisong Li
2022-11-12  2:05   ` [PATCH V3 2/2] mailbox: pcc: Reset pcc_chan_count to zero in case of PCC probe failure Huisong Li
2022-11-23 18:28   ` [PATCH V3 0/2] Optimize PCC OpRegion code and reset pcc_chan_count 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=20221110103618.3vuyfdhcebf7ewmo@bogus \
    --to=sudeep.holla@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=huangdaode@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=tanxiaofei@huawei.com \
    --cc=wanghuiqiang@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=wangxiongfeng2@huawei.com \
    --cc=xiexiuqi@huawei.com \
    --cc=zhangzekun11@huawei.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