Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1371050rdb; Wed, 20 Sep 2023 07:27:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6MGmN96ooHSQji6VheDeSZ4Ct+2WMPjZh8N/c/+kMAvKRjssDJh4XbJxeratJkfplcXr7 X-Received: by 2002:a05:6a20:4308:b0:14c:e4d9:de46 with SMTP id h8-20020a056a20430800b0014ce4d9de46mr2997290pzk.39.1695220037410; Wed, 20 Sep 2023 07:27:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695220037; cv=none; d=google.com; s=arc-20160816; b=wUBrhutIadTrrZLFzIWBq91sDjdt6lP8AH6YpiEhV4wzTVMSHHKXCM0iBz3t6xxgVc Hu9YSGUFUc7Ce3g9ZIH+PZ29fVebV0t11kr4wl0SaqfG7JEOmPI2UvQ0jlQpaGTdK4W9 B+Mv3m87HbzrtH1XeXuKMCskev5ycPml+Z3lnW1tt+/WzrZD4109SRIG7bv80+NfuDNy LGH4bU5TidTvpYE286NB+K3Wy8UAPQ46cyDYDa4f7bqytWYQTAkMXg0H4duDUZgXsCJn Z6odLKtxAqgHnT9lBMqggMIEb2jocCNWjyM5erJ1Y92nhOmgOHqxNFvrj6mR/VH+1fTa jt0g== 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=0/H01HY400jwojfEzhRVczVnRWcwA/27krDYW09FWIg=; fh=xcN6uuPskTZd3Dd5AjUBxZre+vLGs30t6oOTsLuYzJc=; b=wObruN9KQPKvRmlDH5G7vOT74Zg0X6syL66xgpgHJcIG+tOoIJgcc9r+qluL8s1eNU LRXL8hfpPezJjJ9ehUqiqwU23xJvLSmo0U89Z0rzTexwQJxXRwpbdVAHDCwpnLsWp9q1 OIdFlSYFT9cpD6LJc0MfqCxJWbq5cwiUOt/gz5rbZMtGQYZSTtcUBu+Co1fS19RIvNFS ujVDcrYyRv38+mfA96FJXyi7PzBR47seIDwLSW8CxzwEpeGgvXXGoLQjyKAnwiFtT08E vFkp8RMxg8JyjHiDLGEl0df8TGOSqnwlMyHWIozseX19SY3fnWHFeeyCoBNGHiydoyBT g44w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b12-20020a17090a800c00b002743b58483asi1610913pjn.66.2023.09.20.07.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 07:27:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 0B12682E10AA; Wed, 20 Sep 2023 07:12:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235087AbjITOL7 (ORCPT + 99 others); Wed, 20 Sep 2023 10:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234889AbjITOL6 (ORCPT ); Wed, 20 Sep 2023 10:11:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 388BED9; Wed, 20 Sep 2023 07:11:51 -0700 (PDT) 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 0EBD11FB; Wed, 20 Sep 2023 07:12:28 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 994813F5A1; Wed, 20 Sep 2023 07:11:49 -0700 (PDT) Date: Wed, 20 Sep 2023 15:11:47 +0100 From: Sudeep Holla To: Huisong Li Cc: rafael@kernel.org, rafael.j.wysocki@intel.com, xuwei5@hisilicon.com, Sudeep Holla , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, soc@kernel.org, linux-arm-kernel@lists.infradead.org, liuyonglong@huawei.com Subject: Re: [PATCH v2 2/2] soc: kunpeng_hccs: add the check for PCC subspace type Message-ID: <20230920141147.bq7cjiqjk6c36t6d@bogus> References: <20230914115753.9064-1-lihuisong@huawei.com> <20230920064703.23543-1-lihuisong@huawei.com> <20230920064703.23543-3-lihuisong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230920064703.23543-3-lihuisong@huawei.com> 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 20 Sep 2023 07:12:15 -0700 (PDT) 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. 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. Ideally I would expect the driver to make this transparent and give error during transmit if not supported. 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 use of Type 4 ? I think we must do something better but I don't know what that is yet. -- Regards, Sudeep