Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3165730rdh; Thu, 28 Sep 2023 04:53:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFK8tPbBOLdQNSE/KAWGF95CS3avGfkcZRGFLKJN1rP6m7iQP/J+sg6i9a4F0eUGkielMQ+ X-Received: by 2002:a05:6358:9924:b0:142:d71b:59ce with SMTP id w36-20020a056358992400b00142d71b59cemr1205738rwa.26.1695902003903; Thu, 28 Sep 2023 04:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902003; cv=none; d=google.com; s=arc-20160816; b=qln4iQHJ0AAekeyFczq9PfeipGV7PxTEGp/oexMBNqRReNUCT/i6u1DwoiqTX80Bbz rceR36QGSp25Z/jWk9pDhj+E1ZUr5u2AR55/nyFYx/zIVQ4Xs8/YBgYZnRAkzUiT5G25 FXp1WNbBs7FNmf1MCBqHY4T/02yqpkvbS91uZYqjGM4gpQTFSAmIprQdsuRskLn1bqZi q2/11LqJASYaGLAuZy4WdZw1Tcp7E5xV2+ZB+il+hc5oUj2QhjJpmBsTjqUgE1jCnpFJ 6o+kRM4tTxfW2cyJ3lRyBJj+FsKOdxmBrM+O2vj4faqO82seAxbOV7Z/anCIoa+Qlkem D6hg== 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=jUI3gk6lxOdvo0ZeV2/e8UL3LVNTl8NjNFlp8B4p0/4=; fh=RU1gXigCTLxxSQmdoWQoCVMDfuoYV7SKaLptwt/Iy0E=; b=p0kVcXdDBwmT+xgUc27JPQk2j236Fu/YzJmz5iOtOsXu10VKQlp4YHE+AGhxphEycW g8mHoKcT5FeJRPjlQZfMR8aMNhtM20NhBBiX7Z+Yk9vdnqcL8n2KkgBwyfmD6R2rP7nV p0+Fb1iJ3T8F15ZjPb8pGlM2san2hLJqcwVvbf76mu4JMShkQ8lC2iGqzyYUH16LI7TD JsADc48LPE8PW/q9pGRtqZO3sMJuXybrH2vcRamHJCQeesQx9BCOCXsDu/cYCkDRquAx rDOQr2vxISWYp8r/L9MjHgKC4nKa1qnSh+MEaJDvC9QRMGwGUcvAi5iMjhTfEvyny2ud fvnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id e26-20020a63545a000000b00578c9144913si18470582pgm.364.2023.09.28.04.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 49D278051907; Thu, 28 Sep 2023 04:40:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231324AbjI1Lk1 (ORCPT + 99 others); Thu, 28 Sep 2023 07:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjI1Lk0 (ORCPT ); Thu, 28 Sep 2023 07:40:26 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4F0139; Thu, 28 Sep 2023 04:40:24 -0700 (PDT) Received: from kwepemm000004.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RxBJc1bXlzNnnB; Thu, 28 Sep 2023 19:36:32 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm000004.china.huawei.com (7.193.23.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 28 Sep 2023 19:40:21 +0800 Message-ID: <33af39a8-e341-8571-4b35-68ae3052293d@huawei.com> Date: Thu, 28 Sep 2023 19:40:21 +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> <1b05f595-b485-5a7e-ad31-b19f462fe43f@huawei.com> From: "lihuisong (C)" In-Reply-To: <1b05f595-b485-5a7e-ad31-b19f462fe43f@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm000004.china.huawei.com (7.193.23.18) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:40:39 -0700 (PDT) Hi Sudeep, 在 2023/9/21 10:27, lihuisong (C) 写道: > > 在 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. What do you feeling about the comments montioned above? Maybe we still need to export the information whether the platform support interrupt before requesting PCC channel. Looking forward your reply. >> > .