Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1877329rwd; Wed, 17 May 2023 02:39:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7uopwnkWXuvyfV2VfZfidT3enUdmDytjd4p1j8SUgkDHzA995RMSi0Aa/yMJpZg3EuaTp4 X-Received: by 2002:a05:6a20:9189:b0:106:ff3c:a60d with SMTP id v9-20020a056a20918900b00106ff3ca60dmr6268906pzd.38.1684316354834; Wed, 17 May 2023 02:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684316354; cv=none; d=google.com; s=arc-20160816; b=U/Ma3sjhq9L+o0g540ghwN1n3JFnDfZsjFHJxVYWO/zQ06YmHPSaOYssg2WwY90ROr MDrOOpBGHyS4WddEBvmkvJg1Ed5NXQSnjp1CuZhIu+CuMIo3jVWaWsLpJ6RJiSUhifrB kdzVVRh1gKPu72HeeidiWYDLm0wkyWvBsmmPEp2m2eTlayj02CBKobreSbBNWox5eXfs Xx9p6hA/EJK3HNau6aXfdPF527w687krxE+AP8laxwnRokdfsEtIuLvMPmQyHAfpuBlo m9Ggt2cM9PaW6hfSwAij+qH7KLOv88y/zgZ/zeyIZ++yWoUzO55g7RHKgH0snrNaO4a6 2Rcw== 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=Ve4Cb5IeHKtYe0cA1SA93KCksTkks91I6FxZ+6LWFtM=; b=Nd5Nq++qkj+BqB6bZ3wm20zbUhdM9eYw8nsmf7jkjElQGQRZpmoVxKJCeMnLZlln+C jLdM4MH9G12hA424LCFMIbyNWfzZr9jlYxpg54R9xPAlVjk1rWlG+/rY0AzEwEwjUjPM 5b9oh/VOO2zeHMvgzN8obJc2sDJndRqunrffcxrGZvYzuKfTZXSC/A9fW7HUKuomUP4q KRAhzkhbYklNlPO9BMxboxEDJcIeFgy/5eiv9UhuPDfhZLUyve4XUFj6XYZYUfWruLD2 UNDzvzwrE1hWgfNonuysQD95TZnqhdoD6qz8gI+lrY6UJrDEzUkVnEk6xC0msDvEAUBk 3p7w== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f67-20020a623846000000b0064105588e53si11453736pfa.359.2023.05.17.02.39.01; Wed, 17 May 2023 02:39:14 -0700 (PDT) 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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjEQJam (ORCPT + 99 others); Wed, 17 May 2023 05:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjEQJak (ORCPT ); Wed, 17 May 2023 05:30:40 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0658BE4E; Wed, 17 May 2023 02:30:38 -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 46C571FB; Wed, 17 May 2023 02:31:23 -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 0E7443F663; Wed, 17 May 2023 02:30:35 -0700 (PDT) Date: Wed, 17 May 2023 10:30:33 +0100 From: Sudeep Holla To: "lihuisong (C)" Cc: Arnd Bergmann , Bjorn Andersson , Matthias Brugger , AngeloGioacchino Del Regno , Shawn Guo , linux-kernel@vger.kernel.org, soc@kernel.org, wanghuiqiang@huawei.com, tanxiaofei@huawei.com, liuyonglong@huawei.com, huangdaode@huawei.com, linux-acpi@vger.kernel.org, Len Brown , "Rafael J. Wysocki" , devicetree@vger.kernel.org, Sudeep Holla , Rob Herring , Frank Rowand , Krzysztof Kozlowski Subject: Re: [PATCH] soc: hisilicon: Support HCCS driver on Kunpeng SoC Message-ID: <20230517093033.4jvwjxuoeic46a24@bogus> References: <20230425103040.znv66k364ant6klq@bogus> <20230425131918.5tf5vot4h7jf54xk@bogus> <20230515130807.pdvx7bxwjkfdsmsr@bogus> <20230516122931.il4ai7fyxdo5gsff@bogus> <20230516143530.venhj4gax6stinah@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Wed, May 17, 2023 at 03:16:12PM +0800, lihuisong (C) wrote: [...] > No. I want to use this flag to make compability between different platforms. > This driver only use PCC OpRegion to access to the channel if platform > support use PCC OpRegion. What do you mean by that ? It is not correct. If there is a PCC Opregion, then you need to make it work with drivers/acpi/acpi_pcc.c You need to have all the other details in the firmware(ASL). By looking at the driver, it has no connection to PCC Opregion IMO unless I am missing something. > Driver must select one of them (PCC and PCC OpRegion) to communicate with > firmware on one platform. No for reasons mentioned above. PCC Opregion support in the kernel will be minimal and already there. Fix that if it is not working. If you are attempting to do something with PCC Opregion in this driver, it is just wrong and I will NACK it if I see anything around that. > > If so that may not work as the current implementation of PCC Opregion > > assumes the exclusive access to the channel. Since it is initialised > > quite early, Opregion must succeed to get the mbox channel acquired and > > this driver must fail if they are sharing the channel. Making the sharing > > across firmware and this driver may need changes in the PCC Opregion > Only using PCC OpRegion after requesting and releasing PCC channel shouldn't > change PCC OpRegion code? I don't understand what exactly that means. The spec states clearly that PCC subspaces that are used for PCC Operation Regions must not be used as PCC subspaces for other std ACPI features. I don't understand what really is going on, on this platform as I don't see what you are saying (which is wrong and I disagree with approach) in the code posted yet. > > support code. One possible way is to acquire and release the channel for > > each transaction which will be definitely overhead. > Yes, transaction will be definitely overhead. > The following method should be no such problem. > --> > If driver want to obtain other info by RegisterAddress and offset in PCC > Register(), driver generally needs to do it as follows: > 1> get channel ID and RegisterAddress and offset. > 2> call pcc_mbox_request_channel to acquire the channel. > 3> ioremap 'shmem_base_addr' to get 'pcc_comm_addr' > 4> obtain other info based on RegisterAddress, offset and 'pcc_comm_addr'. Above sound good but it is not PCC Opregion. Either you are not giving full context or you are confusing what PCC Opregion means. There is a section "Declaring PCC Operation Regions", please refer and see if that is what you have on your platform. > If driver selects PCC OpRegion method, driver may also need to release this > PCC channel by calling pcc_mbox_free_channel. As I mentioned, the driver must not do anything related to PCC Opregion. > Because this channel will be requested when PCC OpRegion method is executed > for the first time. > drivers/acpi/acpi_pcc.c must take care of that. If not patch that and get it working. It must be generic and nothing to do with your platform. > > Overall, the above process is a bit cumbersome if this driver only use PCC > OpRegion. Yes and hence must not touch anything around PCC Opregion. > In addition, I have to dig one address from comm space in share memory, > which will cause the available size of comm space to decrease, right? > So it is better to use other way to do get channel ID and other info if it > is possible. > What do you think? I am more confused about your platform than yesterday, so I don't have much valuable suggestions ATM. -- Regards, Sudeep