Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1735468rdb; Wed, 20 Sep 2023 19:30:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJneGnEB2eTsLPiT/aVTEzZ2tLTRZplTX7zMemcBKO3FHYKYfskiWimIyoaLb5jh3yhnuH X-Received: by 2002:a17:903:1c4:b0:1c5:d747:a110 with SMTP id e4-20020a17090301c400b001c5d747a110mr120681plh.18.1695263403690; Wed, 20 Sep 2023 19:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695263403; cv=none; d=google.com; s=arc-20160816; b=tvJ8hxAt3N8KUXYOywbuxXAtS8hubYgfOQoHdH+ZvfKpmQK83Dz2BU5MTQOcbVwpTF Y85C1tOw4wNjPA0F0NvoFf7BVl1F3vZyQu3iUQAPXhYrbBxzMfI0IrrDmmh3PCCVnNR2 lctaDc3/F11ZXfJZ909+RqgR9s2tF+zwNIsPZeuuDWMY5btYuRWv2/MtfIJMCikSkT72 C8gPA5iUbuoZoTbQqtQi8yVNSYx00Q+82LbC/LEIZMgU5X2MxPrgLYBi/QCtWRQhz+y5 XvDS9tiegm2ZhO1Nf6NCsUdVa5IMWnQyUSoak8mH4RJX4V3ERXZhka4LsqZbzzvw0Gxt JBBA== 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=Lz+ppwKh2SRFP4nJei5k5NHaDZGa7F0O6MJw/4dnrp4=; fh=nL5FFx885Z5qTo0LDMKuuxpkYUW23Ntlk+eOhH+vNe4=; b=jvIYJe5VJSq/oRfDXse6WrwqDizxpwcQbwbyylLjfe99bCb2iBLGbXo85ZfwyYMe4l 8HYRB+UBy3oqZqHawGql2BKfg66fX8/prkb1U4PJ589dcA29lduOWGwA5a2JRWkU0oES rG3TXVy6meR9jExduQdgoo3x+Ldx2GmV8xikZQ11DQ6sSqCF/W+fUybHZdsggRFUEjJ3 vH2u001OHNQvjz7eU8UCfVmQ4YpBwtDKXjrifSIcJyDOHLyEb47nwJHZxDFO8gEc+PBy yYQc/Bk+jL5ejnAgqaFrHK2Vam1N7JBXaPHcl+iUEAxKz2JLhoAdNVWgos7sK4WMH1sN khXQ== 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:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f4-20020a170902684400b001bbc855a8fcsi363516pln.488.2023.09.20.19.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 19:30:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id CA091829E912; Wed, 20 Sep 2023 19:27:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbjIUC1s (ORCPT + 99 others); Wed, 20 Sep 2023 22:27:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjIUC1q (ORCPT ); Wed, 20 Sep 2023 22:27:46 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEC9B99; Wed, 20 Sep 2023 19:27:39 -0700 (PDT) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RrfNK44YSzMlhR; Thu, 21 Sep 2023 10:24:01 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) 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; Thu, 21 Sep 2023 10:27:36 +0800 Message-ID: <1b05f595-b485-5a7e-ad31-b19f462fe43f@huawei.com> Date: Thu, 21 Sep 2023 10:27:36 +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 v2 2/2] soc: kunpeng_hccs: add the check for PCC subspace type To: Sudeep Holla CC: , , , , , , , , References: <20230914115753.9064-1-lihuisong@huawei.com> <20230920064703.23543-1-lihuisong@huawei.com> <20230920064703.23543-3-lihuisong@huawei.com> <20230920141147.bq7cjiqjk6c36t6d@bogus> From: "lihuisong (C)" In-Reply-To: <20230920141147.bq7cjiqjk6c36t6d@bogus> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 20 Sep 2023 19:27:48 -0700 (PDT) 在 2023/9/20 22:11, Sudeep Holla 写道: > On Wed, Sep 20, 2023 at 02:47:03PM +0800, Huisong Li wrote: >> Currently, HCCS driver directly uses Generic Communications Channel Shared >> Memory Region which is used in type0/1/2 to communicate with platform, >> but actually doesn't support type3/4/5. >> So this patch adds the check for PCC subspace type. >> >> Signed-off-by: Huisong Li >> --- >> drivers/soc/hisilicon/kunpeng_hccs.c | 17 +++++++++++++++++ >> 1 file changed, 17 insertions(+) >> >> diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c >> index f3810d9d1caa..4ba3bfd45a01 100644 >> --- a/drivers/soc/hisilicon/kunpeng_hccs.c >> +++ b/drivers/soc/hisilicon/kunpeng_hccs.c >> @@ -174,6 +174,19 @@ static int hccs_register_pcc_channel(struct hccs_dev *hdev) >> return rc; >> } >> >> +static int hccs_check_pcc_info(struct hccs_dev *hdev) >> +{ >> + struct pcc_mbox_chan *pcc_chan = hdev->cl_info.pcc_chan; >> + >> + if (pcc_chan->type >= ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE) { >> + dev_err(hdev->dev, "unsupport for subspace type%u.\n", >> + pcc_chan->type); >> + return -EOPNOTSUPP; >> + } > > Is this the only use of the PCC type information you have or do you plan to > use it for something other than the validation. Yeah, it is just validation now. we want to plan this driver can support more types. > > Just for sake of argument, I can say all users of PCC must then do the > similar validation. I don't know where to draw the line here. If export PCC type, it is good for the user of PCC to be more universal and more compatible. > > Ideally I would expect the driver to make this transparent and give error > during transmit if not supported. I understand you. I just check this type only once during the initializing phase. Otherwise, every once need to verify it when send PCC command. > > The driver must be able to work with different PCC type to support variety > of platforms TBH. What is the issue exactly here ? Is this to prevent the Agree more with you. IMO, the user of PCC has the ability to support variety of platforms if they can get PCC type. In this case, to prevent type 4 is necessary if driver cannot act as a slave. on the other hand, If one driver acts as a slave, platform must supply slave subspace for them. > use of Type 4 ? I think we must do something better but I don't know what > that is yet. Yes, we can try to do it better. I have a concern, like below. You know that the use of PCC can use polling mode and interrupt mode to communicate with platform. I'm not sure if the obtaining of the polling mode and interrupt mode is an issue to prevent driver to be more universal. But this driver can know if they support interrupt mode based on struct mbox_chan::struct mbox_controller::txdone_irq after requesting PCC channel. Because I'm not sure it's a better way. You know that drivers used interrupt mode need to fill the rx_callback function into mbx_client when register PCC channel. And drivers used polling mode don't do it. If we use this way, drivers that both support the two mode have to modify the rx_callback pointer after requesting PCC channel. >