* Re: ACPI support in common clock framework [not found] <CABe79T6zQ_7Ycws5b=xaQ3edpVn1QPQyWd9p24eqLGpYbdtt0A@mail.gmail.com> @ 2018-06-13 8:13 ` Andy Shevchenko 2018-06-13 8:27 ` Rafael J. Wysocki 2018-06-14 10:58 ` Srinath Mannam 0 siblings, 2 replies; 11+ messages in thread From: Andy Shevchenko @ 2018-06-13 8:13 UTC (permalink / raw) To: Srinath Mannam, Rafael J. Wysocki, ACPI Devel Maling List Cc: Michael Turquette, Stephen Boyd, linux-clk, Linux Kernel Mailing List +Cc: Rafael, ACPI ML On Wed, Jun 13, 2018 at 7:14 AM, Srinath Mannam <srinath.mannam@broadcom.com> wrote: > Hi Michael, Stephen, > > We are adding ACPI support in our Linux based platform. > At present our clock hierarchy using common clock framework through DTS. > Now we required ACPI support in common clock framework to upgrade our platform. > > For example, clk_get API called in many drivers to get clock device is > tightly coupled with DT framework. > > Please let us know, if anybody in Open Source community have plans to > add ACPI support for common clock framework. > If not please suggest us alternative method to use common clock > framework in ACPI use case. > > Thanks in advance. > > Regards, > Srinath. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-13 8:13 ` ACPI support in common clock framework Andy Shevchenko @ 2018-06-13 8:27 ` Rafael J. Wysocki 2018-06-15 17:43 ` Stephen Boyd 2018-06-14 10:58 ` Srinath Mannam 1 sibling, 1 reply; 11+ messages in thread From: Rafael J. Wysocki @ 2018-06-13 8:27 UTC (permalink / raw) To: Andy Shevchenko, Srinath Mannam Cc: Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, Stephen Boyd, linux-clk, Linux Kernel Mailing List, Mika Westerberg On Wed, Jun 13, 2018 at 10:13 AM, Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > +Cc: Rafael, ACPI ML > > On Wed, Jun 13, 2018 at 7:14 AM, Srinath Mannam > <srinath.mannam@broadcom.com> wrote: >> Hi Michael, Stephen, >> >> We are adding ACPI support in our Linux based platform. >> At present our clock hierarchy using common clock framework through DTS. >> Now we required ACPI support in common clock framework to upgrade our platform. >> >> For example, clk_get API called in many drivers to get clock device is >> tightly coupled with DT framework. >> >> Please let us know, if anybody in Open Source community have plans to >> add ACPI support for common clock framework. There are no plans for doing that AFAICS. Moreover, it generally would not be consistent with ACPI power management defined by the specification. >> If not please suggest us alternative method to use common clock >> framework in ACPI use case. The problem with using the clock framework on systems with ACPI is that, in general, the clock manipulation is expected to be carried out by ACPI power management and therefore it is "owned" by AML. Currently, there are no defined methods for synchronizing the AML's use of clocks for power management with what the OS may do with them directly. In theory, that can be worked around to some extent by representing clocks as power resources in ASL (even though the provider information would be missing then) and manipulating those power resources directly from the OS. I'm not aware of anyone doing that successfully, however. For simple power management it should be sufficient to let drivers rely on the ACPI PM domain which should happen automatically in the majority of cases anyway. Thanks, Rafael ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-13 8:27 ` Rafael J. Wysocki @ 2018-06-15 17:43 ` Stephen Boyd 2018-06-16 15:50 ` Rafael J. Wysocki 0 siblings, 1 reply; 11+ messages in thread From: Stephen Boyd @ 2018-06-15 17:43 UTC (permalink / raw) To: Rafael J. Wysocki, Andy Shevchenko, Srinath Mannam Cc: Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, linux-clk, Linux Kernel Mailing List, Mika Westerberg Quoting Rafael J. Wysocki (2018-06-13 01:27:39) > On Wed, Jun 13, 2018 at 10:13 AM, Andy Shevchenko > <andy.shevchenko@gmail.com> wrote: > > +Cc: Rafael, ACPI ML > > > > On Wed, Jun 13, 2018 at 7:14 AM, Srinath Mannam > > <srinath.mannam@broadcom.com> wrote: > >> Hi Michael, Stephen, > >> > >> We are adding ACPI support in our Linux based platform. > >> At present our clock hierarchy using common clock framework through DTS. > >> Now we required ACPI support in common clock framework to upgrade our platform. > >> > >> For example, clk_get API called in many drivers to get clock device is > >> tightly coupled with DT framework. > >> > >> Please let us know, if anybody in Open Source community have plans to > >> add ACPI support for common clock framework. > > There are no plans for doing that AFAICS. > > Moreover, it generally would not be consistent with ACPI power > management defined by the specification. This matches my understanding. > > >> If not please suggest us alternative method to use common clock > >> framework in ACPI use case. > > The problem with using the clock framework on systems with ACPI is > that, in general, the clock manipulation is expected to be carried out > by ACPI power management and therefore it is "owned" by AML. > Currently, there are no defined methods for synchronizing the AML's > use of clocks for power management with what the OS may do with them > directly. > > In theory, that can be worked around to some extent by representing > clocks as power resources in ASL (even though the provider information > would be missing then) and manipulating those power resources directly > from the OS. I'm not aware of anyone doing that successfully, > however. > > For simple power management it should be sufficient to let drivers > rely on the ACPI PM domain which should happen automatically in the > majority of cases anyway. > Is this for clk_enable/disable? What about clk_set_rate() or clk_set_phase()? Is ACPI's AML taking care of that? ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-15 17:43 ` Stephen Boyd @ 2018-06-16 15:50 ` Rafael J. Wysocki 2018-06-25 16:37 ` Stephen Boyd 0 siblings, 1 reply; 11+ messages in thread From: Rafael J. Wysocki @ 2018-06-16 15:50 UTC (permalink / raw) To: Stephen Boyd Cc: Rafael J. Wysocki, Andy Shevchenko, Srinath Mannam, Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, linux-clk, Linux Kernel Mailing List, Mika Westerberg On Fri, Jun 15, 2018 at 7:43 PM, Stephen Boyd <sboyd@kernel.org> wrote: > Quoting Rafael J. Wysocki (2018-06-13 01:27:39) >> On Wed, Jun 13, 2018 at 10:13 AM, Andy Shevchenko >> <andy.shevchenko@gmail.com> wrote: >> > +Cc: Rafael, ACPI ML >> > >> > On Wed, Jun 13, 2018 at 7:14 AM, Srinath Mannam >> > <srinath.mannam@broadcom.com> wrote: >> >> Hi Michael, Stephen, >> >> >> >> We are adding ACPI support in our Linux based platform. >> >> At present our clock hierarchy using common clock framework through DTS. >> >> Now we required ACPI support in common clock framework to upgrade our platform. >> >> >> >> For example, clk_get API called in many drivers to get clock device is >> >> tightly coupled with DT framework. >> >> >> >> Please let us know, if anybody in Open Source community have plans to >> >> add ACPI support for common clock framework. >> >> There are no plans for doing that AFAICS. >> >> Moreover, it generally would not be consistent with ACPI power >> management defined by the specification. > > This matches my understanding. > >> >> >> If not please suggest us alternative method to use common clock >> >> framework in ACPI use case. >> >> The problem with using the clock framework on systems with ACPI is >> that, in general, the clock manipulation is expected to be carried out >> by ACPI power management and therefore it is "owned" by AML. >> Currently, there are no defined methods for synchronizing the AML's >> use of clocks for power management with what the OS may do with them >> directly. >> >> In theory, that can be worked around to some extent by representing >> clocks as power resources in ASL (even though the provider information >> would be missing then) and manipulating those power resources directly >> from the OS. I'm not aware of anyone doing that successfully, >> however. >> >> For simple power management it should be sufficient to let drivers >> rely on the ACPI PM domain which should happen automatically in the >> majority of cases anyway. >> > > Is this for clk_enable/disable? What about clk_set_rate() or > clk_set_phase()? Is ACPI's AML taking care of that? That's for clk_enable/disable AFAICS. AML doesn't manage device performance states at all. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-16 15:50 ` Rafael J. Wysocki @ 2018-06-25 16:37 ` Stephen Boyd 2018-06-25 17:15 ` Sudeep Holla 0 siblings, 1 reply; 11+ messages in thread From: Stephen Boyd @ 2018-06-25 16:37 UTC (permalink / raw) Cc: Rafael J. Wysocki, Andy Shevchenko, Srinath Mannam, Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, linux-clk, Linux Kernel Mailing List, Mika Westerberg Quoting Rafael J. Wysocki (2018-06-16 08:50:18) > On Fri, Jun 15, 2018 at 7:43 PM, Stephen Boyd <sboyd@kernel.org> wrote: > > > > Is this for clk_enable/disable? What about clk_set_rate() or > > clk_set_phase()? Is ACPI's AML taking care of that? > > That's for clk_enable/disable AFAICS. > > AML doesn't manage device performance states at all. Alright. We may need to add a better way for device drivers to get handles to clk pointers on ACPI firmware so they can change frequencies or phase, etc. Right now it's all through clkdev and it looks to be mostly based on string matching of connection names instead of associating clks with devices. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-25 16:37 ` Stephen Boyd @ 2018-06-25 17:15 ` Sudeep Holla 2018-06-25 23:37 ` Stephen Boyd 0 siblings, 1 reply; 11+ messages in thread From: Sudeep Holla @ 2018-06-25 17:15 UTC (permalink / raw) To: Stephen Boyd, Srinath Mannam Cc: Rafael J. Wysocki, Sudeep Holla, Andy Shevchenko, Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, linux-clk, Linux Kernel Mailing List, Mika Westerberg On 25/06/18 17:37, Stephen Boyd wrote: > Quoting Rafael J. Wysocki (2018-06-16 08:50:18) >> On Fri, Jun 15, 2018 at 7:43 PM, Stephen Boyd <sboyd@kernel.org> wrote: >>> >>> Is this for clk_enable/disable? What about clk_set_rate() or >>> clk_set_phase()? Is ACPI's AML taking care of that? >> >> That's for clk_enable/disable AFAICS. >> >> AML doesn't manage device performance states at all. > > Alright. We may need to add a better way for device drivers to get > handles to clk pointers on ACPI firmware so they can change frequencies > or phase, etc. Is there any specific usecase/device needing this in the kernel ? SPI slaves ? > Right now it's all through clkdev and it looks to be > mostly based on string matching of connection names instead of > associating clks with devices. > > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Regards, Sudeep ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-25 17:15 ` Sudeep Holla @ 2018-06-25 23:37 ` Stephen Boyd 2018-06-26 8:59 ` Srinath Mannam 2018-06-26 17:27 ` Andy Shevchenko 0 siblings, 2 replies; 11+ messages in thread From: Stephen Boyd @ 2018-06-25 23:37 UTC (permalink / raw) To: Srinath Mannam Cc: Rafael J. Wysocki, Sudeep Holla, Andy Shevchenko, Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, linux-clk, Linux Kernel Mailing List, Mika Westerberg Quoting Sudeep Holla (2018-06-25 10:15:45) > > > On 25/06/18 17:37, Stephen Boyd wrote: > > Quoting Rafael J. Wysocki (2018-06-16 08:50:18) > >> On Fri, Jun 15, 2018 at 7:43 PM, Stephen Boyd <sboyd@kernel.org> wrote: > >>> > >>> Is this for clk_enable/disable? What about clk_set_rate() or > >>> clk_set_phase()? Is ACPI's AML taking care of that? > >> > >> That's for clk_enable/disable AFAICS. > >> > >> AML doesn't manage device performance states at all. > > > > Alright. We may need to add a better way for device drivers to get > > handles to clk pointers on ACPI firmware so they can change frequencies > > or phase, etc. > > Is there any specific usecase/device needing this in the kernel ? SPI > slaves ? Mark Brown has been pushing x86 folks to use clk framework for audio drivers in ASoC. I haven't seen other uses besides that really. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-25 23:37 ` Stephen Boyd @ 2018-06-26 8:59 ` Srinath Mannam 2018-06-26 17:27 ` Andy Shevchenko 1 sibling, 0 replies; 11+ messages in thread From: Srinath Mannam @ 2018-06-26 8:59 UTC (permalink / raw) To: Stephen Boyd Cc: Sudeep Holla, Rafael J. Wysocki, Andy Shevchenko, Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, linux-clk, Linux Kernel Mailing List, Mika Westerberg Hi Rafael, Stephen, Thank you so much for detailed inputs. In our platform, all HW clocks are accessed (enable/disable/set rate) in Linux through common clock framework (drivers/clk/) using clock nodes exported by device tree. To manage our HW clocks operations (enable/disable/set rate) we have driver in common clock framework (clk-iproc-pll.c, clk-sr.c). At present, clock drivers get properties information from device tree framework. Also many devices to access (enable/disable/set rate) its clock source in their driver. it must call clk_get function and clocks phandler in its device tree node. It means, common clock framework is tightly coupled with device tree framework. We want to upgrade our platforms to ACPI support in the place of device tree support. So that we need to have ACPI support in common clock framework, to modify our HW clock drivers. At the same time we also configure few clocks as "fixed-factor-clock". so fixed-factor-clock also need ACPI support. These are all the reasons insists to have ACPI support in common clock framework. Ex: SP805 watch dog used in our platform whose driver is register as AMBA device. In this case both apb_pclk and watch dog clock devices get (clk_get API) through device tree APIs. AMBA framework has ACPI support. so probe function of sp805_wdt driver is called. But failed with clk_get API because common clock does not have ACPI support. I thought a solution to upgrade ACPI support in common clock framework, in the similar way we have ACPI support in normal device drivers using DSDT ACPI tables. DSDT table of all devices including clock devices contain all resource specific information of device and clock device name. Need to implement similar APIs like of_clk* for ACPI purpose also to get clock device in driver software. Ex: of_clk_src_simple_get of_clk_hw_simple_get of_clk_src_onecell_get of_clk_hw_onecell_get of_clk_add_provider of_clk_add_hw_provider of_clk_del_provider of_clk_get_from_provider of_clk_get_parent_count of_clk_get_parent_name of_clk_parent_fill With this approach no dependency on AML to provide clock rate, enable, disable. It is like translating device tree into ACPI. Please provide your inputs. Regards, Srinath. On Tue, Jun 26, 2018 at 5:07 AM, Stephen Boyd <sboyd@kernel.org> wrote: > Quoting Sudeep Holla (2018-06-25 10:15:45) >> >> >> On 25/06/18 17:37, Stephen Boyd wrote: >> > Quoting Rafael J. Wysocki (2018-06-16 08:50:18) >> >> On Fri, Jun 15, 2018 at 7:43 PM, Stephen Boyd <sboyd@kernel.org> wrote: >> >>> >> >>> Is this for clk_enable/disable? What about clk_set_rate() or >> >>> clk_set_phase()? Is ACPI's AML taking care of that? >> >> >> >> That's for clk_enable/disable AFAICS. >> >> >> >> AML doesn't manage device performance states at all. >> > >> > Alright. We may need to add a better way for device drivers to get >> > handles to clk pointers on ACPI firmware so they can change frequencies >> > or phase, etc. >> >> Is there any specific usecase/device needing this in the kernel ? SPI >> slaves ? > > Mark Brown has been pushing x86 folks to use clk framework for audio > drivers in ASoC. I haven't seen other uses besides that really. > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-25 23:37 ` Stephen Boyd 2018-06-26 8:59 ` Srinath Mannam @ 2018-06-26 17:27 ` Andy Shevchenko 1 sibling, 0 replies; 11+ messages in thread From: Andy Shevchenko @ 2018-06-26 17:27 UTC (permalink / raw) To: Stephen Boyd Cc: Srinath Mannam, Sudeep Holla, Rafael J. Wysocki, Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, linux-clk, Linux Kernel Mailing List, Mika Westerberg On Tue, Jun 26, 2018 at 2:37 AM, Stephen Boyd <sboyd@kernel.org> wrote: > Quoting Sudeep Holla (2018-06-25 10:15:45) >> >> >> On 25/06/18 17:37, Stephen Boyd wrote: >> > Quoting Rafael J. Wysocki (2018-06-16 08:50:18) >> >> On Fri, Jun 15, 2018 at 7:43 PM, Stephen Boyd <sboyd@kernel.org> wrote: >> >>> >> >>> Is this for clk_enable/disable? What about clk_set_rate() or >> >>> clk_set_phase()? Is ACPI's AML taking care of that? >> >> >> >> That's for clk_enable/disable AFAICS. >> >> >> >> AML doesn't manage device performance states at all. >> > >> > Alright. We may need to add a better way for device drivers to get >> > handles to clk pointers on ACPI firmware so they can change frequencies >> > or phase, etc. >> >> Is there any specific usecase/device needing this in the kernel ? SPI >> slaves ? > > Mark Brown has been pushing x86 folks to use clk framework for audio > drivers in ASoC. I haven't seen other uses besides that really. All LPSS code based on fixed rate clocks created by some platform code. Since we have no board files for modern x86 platforms the clock providers and consumers often are located in the same / adjoining drivers. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-13 8:13 ` ACPI support in common clock framework Andy Shevchenko 2018-06-13 8:27 ` Rafael J. Wysocki @ 2018-06-14 10:58 ` Srinath Mannam 2018-06-14 11:07 ` okaya 1 sibling, 1 reply; 11+ messages in thread From: Srinath Mannam @ 2018-06-14 10:58 UTC (permalink / raw) To: Andy Shevchenko Cc: Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, Stephen Boyd, linux-clk, Linux Kernel Mailing List Thank you Andy, Regards, Srinath. On Wed, Jun 13, 2018 at 1:43 PM, Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > +Cc: Rafael, ACPI ML > > On Wed, Jun 13, 2018 at 7:14 AM, Srinath Mannam > <srinath.mannam@broadcom.com> wrote: >> Hi Michael, Stephen, >> >> We are adding ACPI support in our Linux based platform. >> At present our clock hierarchy using common clock framework through DTS. >> Now we required ACPI support in common clock framework to upgrade our platform. >> >> For example, clk_get API called in many drivers to get clock device is >> tightly coupled with DT framework. >> >> Please let us know, if anybody in Open Source community have plans to >> add ACPI support for common clock framework. >> If not please suggest us alternative method to use common clock >> framework in ACPI use case. >> >> Thanks in advance. >> >> Regards, >> Srinath. > > > > -- > With Best Regards, > Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: ACPI support in common clock framework 2018-06-14 10:58 ` Srinath Mannam @ 2018-06-14 11:07 ` okaya 0 siblings, 0 replies; 11+ messages in thread From: okaya @ 2018-06-14 11:07 UTC (permalink / raw) To: Srinath Mannam Cc: Andy Shevchenko, Rafael J. Wysocki, ACPI Devel Maling List, Michael Turquette, Stephen Boyd, linux-clk, Linux Kernel Mailing List, linux-acpi-owner On 2018-06-14 06:58, Srinath Mannam wrote: > Thank you Andy, > > Regards, > Srinath. > > On Wed, Jun 13, 2018 at 1:43 PM, Andy Shevchenko > <andy.shevchenko@gmail.com> wrote: >> +Cc: Rafael, ACPI ML >> >> On Wed, Jun 13, 2018 at 7:14 AM, Srinath Mannam >> <srinath.mannam@broadcom.com> wrote: >>> Hi Michael, Stephen, >>> >>> We are adding ACPI support in our Linux based platform. >>> At present our clock hierarchy using common clock framework through >>> DTS. >>> Now we required ACPI support in common clock framework to upgrade our >>> platform. >>> >>> For example, clk_get API called in many drivers to get clock device >>> is >>> tightly coupled with DT framework. >>> >>> Please let us know, if anybody in Open Source community have plans to >>> add ACPI support for common clock framework. >>> If not please suggest us alternative method to use common clock >>> framework in ACPI use case. Are you hooking up clk apis to PS0/PS3 calls? Clk api didn't play nice with acpi until now. >>> >>> Thanks in advance. >>> >>> Regards, >>> Srinath. >> >> >> >> -- >> With Best Regards, >> Andy Shevchenko > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" > in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-06-26 17:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CABe79T6zQ_7Ycws5b=xaQ3edpVn1QPQyWd9p24eqLGpYbdtt0A@mail.gmail.com>
2018-06-13 8:13 ` ACPI support in common clock framework Andy Shevchenko
2018-06-13 8:27 ` Rafael J. Wysocki
2018-06-15 17:43 ` Stephen Boyd
2018-06-16 15:50 ` Rafael J. Wysocki
2018-06-25 16:37 ` Stephen Boyd
2018-06-25 17:15 ` Sudeep Holla
2018-06-25 23:37 ` Stephen Boyd
2018-06-26 8:59 ` Srinath Mannam
2018-06-26 17:27 ` Andy Shevchenko
2018-06-14 10:58 ` Srinath Mannam
2018-06-14 11:07 ` okaya
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).