Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp441506rwb; Thu, 10 Nov 2022 03:04:43 -0800 (PST) X-Google-Smtp-Source: AMsMyM4zJISAfZw4YCn4uvCiOY/fSrRYP25+yQ4lXjAPQogcYeFypSQ05hl+YeCFVSMtjpBoLiXN X-Received: by 2002:a17:90b:4c50:b0:213:ba14:c7f3 with SMTP id np16-20020a17090b4c5000b00213ba14c7f3mr63168002pjb.43.1668078283707; Thu, 10 Nov 2022 03:04:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668078283; cv=none; d=google.com; s=arc-20160816; b=oU4a35Aaq+nEYC3XHVZaFEHbScUDkhlIiKwOWufuViVn0BMORVEFT5Dwm9/MPVimvv rw3acRvql/DcWqBrqYOsajF/ZQffKYyini+AvFXJenZzt9fb/NezYyJrfatC8WV4Kf3S OmQVxs1S0MGL2b5WEuQ3AO6Dj9BicQ5L/CYz9bvXSXvEzNlB3VQ6tLcKLWlhLARaJNqb 0GMfKSU+JZkSaX+LaEWuvE7vUWcNZHM+wpzYFmH4EpmNhb6i7q8IzoV6vaA21QkwyGUQ riXSeFspNvFfCbtMFWRcyia7ZHGA6Lqvvs6Pe3Ea5MdhTYJaseuoSEwXQfWa3hWq6WKz pRyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nsMOU155CuCvBXmklvHr0NhgFerM1MynFPadG+hmXeM=; b=SdrIVz6mIoL2vNpduNQyxeiz5vzswioPWS+Nsw1JL3LD3Lb9qQTY7BbPvtKekaRi8J I8MAx64eAgsk/JGzlbceD1SKmpSuk/SdF3IOJd8eDchhcBapY3lcdlKNnrfn+qq/bvnQ uVnze7PyPGdJFLwHu2vGoBihtmX0v/xrh/9IdwJwRGGpyWPzLkZPaNRQ3oKAAYRDAu8Z 5kbNq96uyCYadaIdpq30L2kQTq7GhnH3SieQCENaSo9IY+7ZENbCIc1Sk+XlmfvAzxmu up2WJDRt/FJqoldPesqx3rergeN3vb01Y8drNUZzgpGOL5DjSSsb5RPUDd/n+xUiheeD h9OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j37-20020a634a65000000b0044d72a10aafsi12430116pgl.34.2022.11.10.03.04.29; Thu, 10 Nov 2022 03:04:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiKJKg0 (ORCPT + 93 others); Thu, 10 Nov 2022 05:36:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiKJKgY (ORCPT ); Thu, 10 Nov 2022 05:36:24 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61BA666C81; Thu, 10 Nov 2022 02:36:23 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 551BA1FB; Thu, 10 Nov 2022 02:36:29 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 629A43F534; Thu, 10 Nov 2022 02:36:21 -0800 (PST) Date: Thu, 10 Nov 2022 10:36:18 +0000 From: Sudeep Holla To: Huisong Li Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, rafael.j.wysocki@intel.com, Sudeep Holla , 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 Message-ID: <20221110103618.3vuyfdhcebf7ewmo@bogus> References: <20221110015034.7943-1-lihuisong@huawei.com> <20221110015034.7943-3-lihuisong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221110015034.7943-3-lihuisong@huawei.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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