Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp520016rwb; Thu, 10 Nov 2022 04:11:57 -0800 (PST) X-Google-Smtp-Source: AMsMyM4Nes/FpgAiVtSsSxpAFnd+Dzn0jPCyENgevVA3NpxsYbncM2yEC2ECUIJhwjJFX5wN0GDY X-Received: by 2002:a17:903:558:b0:187:18f7:714b with SMTP id jo24-20020a170903055800b0018718f7714bmr55151955plb.28.1668082317485; Thu, 10 Nov 2022 04:11:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668082317; cv=none; d=google.com; s=arc-20160816; b=LDWKfMsD7Juq30ndCj5+DUmwVTXfJLwGJPrV9qERU7iMZdnTQOj3iQmPpPRSAvNi/S TQzSfO3hvgcNSPgp94beSULp5dNj6KEA4WebLoc7N4j/44wZ2NdjS05W+dcA4k1V8Mn7 fMS3JuG6LxDx+W5Uep4rBH35feUzQQh2EB/4g4GuJEPxHfSO/Yzw4ayxH1RhDmAHhvO3 R74E5h6xCEOZlnjITac6hg3TDJt8UGgxEPG74G1WxxT6vJwzDDN49jDfFb0+48RtFSbY lFOCOPXmmraFwnM3MNIsyaDRaV6UHkf3bPUPKxN6us8g7u0DGj1TyGZ4d4iioKU+WTG3 FYKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=gt8DYgE8vn0S3Kxy2pANJdFx3yh1fLGF+sB50s9hJS0=; b=ts7sb/Lo7WX4Wfu+d/Zpy4VxbTTlC2TOTIF66grTFecCXqY4i+xFQC6omowzHjJOs+ r1CVlY4eLCdnV13Ie9+CheNrDI7mqKMfpLkHMxTTrz9vaES8PwNX5k/7eeSb7ApGQ2oA tcZn9kbm5umpSEPv7R+pLK9g7N+pySzmmT/x8fACY8D7YAGZ9PRZ+0N2WG796umo2Lm8 /gx+Pes5jNpNAU2H+lLC0U+ni9XZHgnciqqvvwZuI9HpTWtO7etIYtjvj9csJ2fIrp/H 0ieMESIu7z6sdilpayqTg/06FNtCv4/quQt3sEInEMorM7Koo0dcXsyTwrXZUPh5a13W Vb1g== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk8-20020a17090b4a0800b00214166b28bcsi4794649pjb.72.2022.11.10.04.11.44; Thu, 10 Nov 2022 04:11:57 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbiKJMIh (ORCPT + 92 others); Thu, 10 Nov 2022 07:08:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbiKJMIe (ORCPT ); Thu, 10 Nov 2022 07:08:34 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20A83A0; Thu, 10 Nov 2022 04:08:29 -0800 (PST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4N7LFn4rY2z15MVx; Thu, 10 Nov 2022 20:08:13 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 20:08:27 +0800 Received: from [10.67.103.231] (10.67.103.231) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 20:08:26 +0800 Message-ID: Date: Thu, 10 Nov 2022 20:08:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 2/3] ACPI: PCC: add check for platform interrupt To: Sudeep Holla CC: , , , , , , , , , , , References: <20221110015034.7943-1-lihuisong@huawei.com> <20221110015034.7943-3-lihuisong@huawei.com> <20221110103618.3vuyfdhcebf7ewmo@bogus> From: "lihuisong (C)" In-Reply-To: <20221110103618.3vuyfdhcebf7ewmo@bogus> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.231] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 在 2022/11/10 18:36, Sudeep Holla 写道: > 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. I make this patch based on the commit f890157e61b8. Here is to unify the relese resources path. > >> 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) Yes >