soc.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: "lihuisong (C)" <lihuisong@huawei.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Bjorn Andersson <andersson@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Shawn Guo <shawnguo@kernel.org>,
	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 <lenb@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Subject: Re: [PATCH] soc: hisilicon: Support HCCS driver on Kunpeng SoC
Date: Thu, 18 May 2023 09:38:41 +0100	[thread overview]
Message-ID: <20230518083841.nqmjvqqxnea6qrbe@bogus> (raw)
In-Reply-To: <aec13381-e9be-4f3d-1834-52f32f9f8418@huawei.com>

On Thu, May 18, 2023 at 04:24:36PM +0800, lihuisong (C) wrote:
> 
> 在 2023/5/17 21:16, Sudeep Holla 写道:
> > On Wed, May 17, 2023 at 07:35:25PM +0800, lihuisong (C) wrote:
> > > 在 2023/5/17 17:30, Sudeep Holla 写道:
> > > > 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 just needs to call these APIs, such as acpi_evaluate_integer(), if
> > > want to use PCC OpRegion.
> > OK, please provide examples. I am definitely lost as it doesn't match with
> > my understanding of how PCC Opregions are/can be used.
> > 
> > > I know that. I have tested PCC OpRegion before.
> > Cool, examples please.
> > 
> > > You've completely misunderstood what I said.😅
> > > 
> > Hmm, may be but I need examples.
> As you said below, the driver works just for PCC not PCC Opregion for now.
> not sure if we need to discuss how PCC Opregion is used here.

Good let us drop the idea of using PCC Opregion with this driver for now.

> > 
> > > I mean that this driver plans to support both PCC and PCC OpRegion.
> > > For example,
> > > Platform A: this driver use PCC (as the current implementation)
> > Good, then just keep what it needs in the implementation nothing more
> > until you add support for something you have described below(not that
> > I agree, just want you to make progress here based on what is actually
> > required today)
> Agreed.
> > 
> > > Platform B: this driver use PCC OpRegion (Currently, this patch does not
> > > implement it, but it may be available in the future.)
> > Then let us discuss that in the future, don't add unnecessary complexity
> > for some future use case today. You can always add it when you introduce
> > that feature or support in the future.
> Yes. We just need to focus on the current.
> If there are any usage problems with PCC OpRegion in the future, we can
> discuss that later.
>

Agreed.

> My original full scheme is as follows:
> -->
> dev_flags = get_device_flags();  // to know if use PCC OpRegion
> if (USE_PCC_OPREGION_B in dev_flags is 0) {
>     chan_id = get_pcc_chan_id();
>     init_mbox_client();
>     pcc_mbox_request_channel(cl, chan_id)
> } else {
>     /* we need to return unsupport now because of no this feature in this
> driver. */
>     do_nothing();
> }
> 
> void get_some_info(...) {
>     if (USE_PCC_OPREGION_B in dev_flags is 0)
>         pcc_cmd_send();  // use PCC to communicate with Platform
>     else
>         acpi_evaluate_object(); // will be used in future.
> }
> 
> As described in the pseudocode above,
> it is necessary to put "dev_flags" in this current driver first in case of
> the version driver runs on the platform which just use PCC Opregion.

No, you can't randomly define dev_flags just to assist your driver
implementation. If you need it, you need to get the spec updated. We
will not add anything unless that happens.

Note that I don't agree with the flags at all but if you convince and get
them added to spec, I won't object.

> >
> > > Note:
> > > This driver selects only one of them (PCC and PCC OpRegion) to communicate
> > > with firmware on one platform.
> > Let us keep it simple(KISS). The driver works just for PCC not PCC Opregion
> > for now.
> ok.

Good

> > 
> > > We use one bit in device-flags to know which one this driver will use.
> > > 
> > NACK again just to re-iterate my point if you have not yet accepted that
> > fact.
> Above is our plan. Do you still think we shouldn't add this device-flags?
> please let me know.

Correct, no device flags as I see no use for it with your PCC only use case
for now, right ?

> > > I'm not sure if you can understand what I mean by saing that.
> > > If you're not confused about this now, can you reply to my last email
> > > again?😁
> > > 
> > The example you had IIRC is use of System Memory Opregion to demonstrate
> > some _DSM. That has nothing to do with PCC Opregion.
> Yes, it doesn't matter.
> I just want to have a way to get device-flags which contains many bits(every
> bits can be used to as one feature for expanding), rigtht?

Get it through the spec, we don't allow random additions for some
implementations like this.

> > 
> > Commit 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for
> > the PCC Type 3 subtype") has the example in the commit message. IIRC,
> Your example is very useful to the user.
> > you have even fixed couple of bugs in that driver. That is the reason
> > why I don't understand how you think this driver and that can or must
> Understand you, Sudeep.
> At that time, I tested it by a simple demo driver on the platform supported
> type3.
>

OK

> This driver will support multiple platforms.
> On some platforms, we can only use PCC with polling way.
> And we will add PCC Opregion way for others platforms.

Again when you do please post the patch with the ASL snippet as I am
very much interested in understanding how you would make that work.

> What's more, every platform just use one of them(PCC and PCC Opregion).

OK

> > work together. At least I fail to see how ATM(examples please, by that
> > I mean ASL snippet for PCC vs PCC Opregion usage to work with this driver)
> ok!
> For PCC, ASL snippet is little.
> I will add ASL snippet when this driver addes PCC Opregion way.


Sounds like a plan to make progress at-least for now.

-- 
Regards,
Sudeep

  reply	other threads:[~2023-05-18  8:38 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24  7:30 [PATCH] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-04-24  8:09 ` Arnd Bergmann
2023-04-25  3:04   ` lihuisong (C)
2023-04-25  6:08     ` Arnd Bergmann
2023-04-25  9:42       ` lihuisong (C)
2023-04-25 10:30   ` Sudeep Holla
2023-04-25 13:00     ` lihuisong (C)
2023-04-25 13:19       ` Sudeep Holla
2023-04-26 12:12         ` lihuisong (C)
2023-05-04 13:16         ` lihuisong (C)
2023-05-15  3:37           ` lihuisong (C)
2023-05-15 13:08           ` Sudeep Holla
2023-05-16  7:35             ` lihuisong (C)
2023-05-16 12:29               ` Sudeep Holla
2023-05-16 14:13                 ` lihuisong (C)
2023-05-16 14:35                   ` Sudeep Holla
2023-05-17  7:16                     ` lihuisong (C)
2023-05-17  9:30                       ` Sudeep Holla
2023-05-17 11:35                         ` lihuisong (C)
2023-05-17 13:16                           ` Sudeep Holla
2023-05-18  8:24                             ` lihuisong (C)
2023-05-18  8:38                               ` Sudeep Holla [this message]
2023-05-18 12:29                                 ` lihuisong (C)
2023-04-24  8:42 ` Krzysztof Kozlowski
2023-04-25  3:16   ` lihuisong (C)
2023-04-25 11:24     ` Sudeep Holla
2023-05-22  7:22 ` [PATCH v2 0/2] " Huisong Li
2023-05-22  7:22   ` [PATCH v2 1/2] " Huisong Li
2023-05-23  9:39     ` Sudeep Holla
2023-05-23 11:57       ` lihuisong (C)
2023-05-23 13:41         ` Sudeep Holla
2023-05-24  9:36           ` lihuisong (C)
2023-05-25  2:41       ` lihuisong (C)
2023-05-25  7:35         ` Sudeep Holla
2023-05-25  8:12           ` lihuisong (C)
2023-05-30  2:53             ` lihuisong (C)
2023-05-30  8:43               ` Sudeep Holla
2023-05-30 10:57                 ` lihuisong (C)
2023-05-22  7:22   ` [PATCH v2 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-05-30 11:27 ` [PATCH v3 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-05-30 11:27   ` [PATCH v3 1/2] " Huisong Li
2023-05-30 11:27   ` [PATCH v3 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-06-19  6:32   ` [PATCH v3 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC lihuisong (C)
2023-07-14  6:17   ` lihuisong (C)
2023-07-17 12:06     ` Krzysztof Kozlowski
2023-07-18  8:07       ` lihuisong (C)
2023-07-18 10:59         ` Krzysztof Kozlowski
2023-07-18 14:00           ` lihuisong (C)
2023-07-18 11:01         ` Wei Xu
2023-07-20 12:43   ` lihuisong (C)
2023-07-25  7:57 ` [PATCH RESEND " Huisong Li
2023-07-25  7:57   ` [PATCH RESEND v3 1/2] " Huisong Li
2023-07-25  8:55     ` Wei Xu
2023-07-26  9:54       ` lihuisong (C)
2023-07-27  3:51         ` lihuisong (C)
2023-07-25 15:28     ` Randy Dunlap
2023-07-26  9:48       ` lihuisong (C)
2023-07-25  7:57   ` [PATCH RESEND v3 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-07-25  8:59     ` Wei Xu
2023-07-26  9:56       ` lihuisong (C)
2023-07-28  3:03 ` [PATCH v4 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-07-28  3:03   ` [PATCH v4 1/2] " Huisong Li
2023-07-28  3:03   ` [PATCH v4 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-07-29  8:26 ` [PATCH v5 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-07-29  8:26   ` [PATCH v5 1/2] " Huisong Li
2023-07-29 22:43     ` Randy Dunlap
2023-08-01  1:30       ` lihuisong (C)
2023-07-29  8:26   ` [PATCH v5 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-08-01  2:41 ` [PATCH v6 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-08-01  2:41   ` [PATCH v6 1/2] " Huisong Li
2023-08-06 15:09     ` Zenghui Yu
2023-08-07  1:14       ` lihuisong (C)
2023-08-07  1:41       ` lihuisong (C)
2023-08-01  2:41   ` [PATCH v6 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-08-08  2:36 ` [PATCH v7 0/3] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-08-08  2:36   ` [PATCH v7 1/3] " Huisong Li
2023-08-08  2:36   ` [PATCH v7 2/3] soc: hisilicon: add sysfs entry to query information of HCCS Huisong Li
2023-08-08  2:36   ` [PATCH v7 3/3] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-08-11  9:30   ` [PATCH v7 0/3] soc: hisilicon: Support HCCS driver on Kunpeng SoC Wei Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230518083841.nqmjvqqxnea6qrbe@bogus \
    --to=sudeep.holla@arm.com \
    --cc=andersson@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=huangdaode@huawei.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lenb@kernel.org \
    --cc=lihuisong@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=matthias.bgg@gmail.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=soc@kernel.org \
    --cc=tanxiaofei@huawei.com \
    --cc=wanghuiqiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).