Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1134845rdb; Tue, 19 Sep 2023 23:59:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8iMl3Z5roiwGZWXC6/FZ4TYCkvNH+Z6U8t9zn6bbTSLqNIl5a48ftLkbyhSmVpLhyvN9h X-Received: by 2002:a17:90a:c901:b0:268:1068:4464 with SMTP id v1-20020a17090ac90100b0026810684464mr1710646pjt.30.1695193145214; Tue, 19 Sep 2023 23:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695193145; cv=none; d=google.com; s=arc-20160816; b=pspVo6qPmocNEE5ks+dzcdWCnRdM+I2P5GVJO2Yy7e5Lc50as1x4tPM78vnyYKmK+J 8yyR71CZDRRwksPmj6lBE+3rUhI2h6l7RPIjYJdupjIsdl+KYwJ5+Sr7OPUHvilvYrji ibISPTqJPZDkCWvAnkd3xi9SzMKS1Cgm1Yj6/ZnWteyZmQNc3A7kY5e5LasF9BLRBw4J f8NF8hmb0f+54uPcqh2w1Y/4fSo+NGfLMG2Zzh/9LQ7lvXVZomTTZ8i2ob91eIxCcJ3q CyERBvu9JMp5iV8gbUtng6c/h6YylbGERLe4eL/5UTrBxYyUJ8+yrxduPaYSUFsPst05 kCKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PGcXLLu+CHSYLsLcpmAoYTgNsFmPEOF+7Ss/gH2vgas=; fh=XKFVTLIwICKThvlqcUloCSp7yuwfaTWy6C5L6kfiAF8=; b=0tpYn8hEBZO6j3HG4gY6a9HXINgzZxdUk2TVd+PtxaDHTv/BR1IjkZaalL/oN+C/ks 00LYuobhnl/pbtoL6u/Q2OKmiEncfjjh5Ox1gymmbfS+nUbvQ2BMSXLeUST4ygtPPZYK HS6kL8d4NG6vcO6sLWm5Bl1ohJY0nPwu+tInk3ML1SFPChiWVxEo4naADcz8FylaME1o unjnldPXuEKac5Fj1v8pKK9pRfUTNQTLMVgPUUY2jcJxAKC/ZkMtLjPRF7fQk4bf5LRy kwE4fKZEYs1iNupN7QGGg71ywwgV0n0VsFkiAkdkUC/Qa9XIyFKT4+7igBYMKg2Ii3O9 61ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id i1-20020a170902cf0100b001bba8a9e29dsi11358037plg.100.2023.09.19.23.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 23:59:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5827182F9691; Tue, 19 Sep 2023 23:50:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233472AbjITGuj (ORCPT + 99 others); Wed, 20 Sep 2023 02:50:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233450AbjITGuc (ORCPT ); Wed, 20 Sep 2023 02:50:32 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A183ACF; Tue, 19 Sep 2023 23:50:25 -0700 (PDT) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rr8Gg6PMDzVl4Y; Wed, 20 Sep 2023 14:47:23 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) 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.2507.31; Wed, 20 Sep 2023 14:50:21 +0800 From: Huisong Li To: , , , CC: , , , , , Subject: [PATCH v2 1/2] mailbox: pcc: export the PCC subspace type Date: Wed, 20 Sep 2023 14:47:02 +0800 Message-ID: <20230920064703.23543-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230920064703.23543-1-lihuisong@huawei.com> References: <20230914115753.9064-1-lihuisong@huawei.com> <20230920064703.23543-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.69.192.56] 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=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 23:50:44 -0700 (PDT) As stated in APCI spec, the size of the subspace shared memory region may be different for different types. So it is useful for driver to fill PCC communication space. But the driver used this PCC channel doesn't know what is the subspace type of the channel. So export the PCC subspace type by requesting PCC channel. Signed-off-by: Huisong Li --- drivers/mailbox/pcc.c | 10 ++++------ include/acpi/pcc.h | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 94885e411085..9742cc7837bd 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -91,7 +91,6 @@ struct pcc_chan_reg { * @cmd_update: PCC register bundle for the command complete update register * @error: PCC register bundle for the error status register * @plat_irq: platform interrupt - * @type: PCC subspace type * @plat_irq_flags: platform interrupt flags * @chan_in_use: this flag is used just to check if the interrupt needs * handling when it is shared. Since only one transfer can occur @@ -108,7 +107,6 @@ struct pcc_chan_info { struct pcc_chan_reg cmd_update; struct pcc_chan_reg error; int plat_irq; - u8 type; unsigned int plat_irq_flags; bool chan_in_use; }; @@ -263,7 +261,7 @@ static bool pcc_mbox_cmd_complete_check(struct pcc_chan_info *pchan) * bit 0 indicates that Platform is sending a notification and OSPM * needs to respond this interrupt to process this command. */ - if (pchan->type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) + if (pchan->chan.type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) return !val; return !!val; @@ -284,7 +282,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) int ret; pchan = chan->con_priv; - if (pchan->type == ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE && + if (pchan->chan.type == ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE && !pchan->chan_in_use) return IRQ_NONE; @@ -312,7 +310,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) * * The PCC master subspace channel clears chan_in_use to free channel. */ - if (pchan->type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) + if (pchan->chan.type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) pcc_send_data(chan, NULL); pchan->chan_in_use = false; @@ -766,7 +764,7 @@ static int pcc_mbox_probe(struct platform_device *pdev) pcc_parse_subspace_shmem(pchan, pcct_entry); - pchan->type = pcct_entry->type; + pchan->chan.type = pcct_entry->type; pcct_entry = (struct acpi_subtable_header *) ((unsigned long) pcct_entry + pcct_entry->length); } diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h index 73e806fe7ce7..eddf9f5dfba3 100644 --- a/include/acpi/pcc.h +++ b/include/acpi/pcc.h @@ -16,6 +16,7 @@ struct pcc_mbox_chan { u32 latency; u32 max_access_rate; u16 min_turnaround_time; + u8 type; }; #define MAX_PCC_SUBSPACES 256 -- 2.33.0