mbox series

[00/12] Add cpufreq and cci devfreq for mt8183, and SVS support

Message ID 20200520034307.20435-1-andrew-sh.cheng@mediatek.com (mailing list archive)
Headers show
Series Add cpufreq and cci devfreq for mt8183, and SVS support | expand

Message

andrew-sh.cheng May 20, 2020, 3:42 a.m. UTC
MT8183 supports CPU DVFS and CCI DVFS, and LITTLE cpus and CCI are in the same voltage domain.
So, this series is to add drivers to handle the voltage coupling between CPU and CCI DVFS.

For SVS support, need OPP_EVENT_ADJUST_VOLTAGE and corresponding reaction.

Change since v5:
	- Changing dt-binding format to yaml.
	- Extending current devfreq passive_governor instead of create a new one.
	- Resend depending patches of Sravana Kannan base on kernel-5.7


Andrew-sh.Cheng (6):
  cpufreq: mediatek: add clock and regulator enable for intermediate
    clock
  dt-bindings: devfreq: add compatible for mt8183 cci devfreq
  devfreq: add mediatek cci devfreq
  opp: Modify opp API, dev_pm_opp_get_freq(), find freq in opp, even it
    is disabled
  cpufreq: mediatek: add opp notification for SVS support
  devfreq: mediatek: cci devfreq register opp notification for SVS
    support

Saravana Kannan (6):
  OPP: Allow required-opps even if the device doesn't have power-domains
  OPP: Add function to look up required OPP's for a given OPP
  OPP: Improve required-opps linking
  PM / devfreq: Cache OPP table reference in devfreq
  PM / devfreq: Add required OPPs support to passive governor
  PM / devfreq: Add cpu based scaling support to passive_governor

 .../devicetree/bindings/devfreq/mt8183-cci.yaml    |  51 ++++
 drivers/cpufreq/mediatek-cpufreq.c                 | 122 ++++++++-
 drivers/devfreq/Kconfig                            |  12 +
 drivers/devfreq/Makefile                           |   1 +
 drivers/devfreq/devfreq.c                          |   6 +
 drivers/devfreq/governor_passive.c                 | 298 +++++++++++++++++++--
 drivers/devfreq/mt8183-cci-devfreq.c               | 233 ++++++++++++++++
 drivers/opp/core.c                                 |  85 +++++-
 drivers/opp/of.c                                   | 108 ++++----
 drivers/opp/opp.h                                  |   5 +
 include/linux/devfreq.h                            |  42 ++-
 include/linux/pm_opp.h                             |  11 +
 12 files changed, 874 insertions(+), 100 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/devfreq/mt8183-cci.yaml
 create mode 100644 drivers/devfreq/mt8183-cci-devfreq.c

Comments

Chanwoo Choi May 20, 2020, 4:10 a.m. UTC | #1
Hi Andrew,

Could you explain the base commit of these patches?
When I tried to apply them to v5.7-rc1 for testing,
the merge conflict occurs.

Thanks,
Chanwoo Choi

On 5/20/20 12:42 PM, Andrew-sh.Cheng wrote:
> MT8183 supports CPU DVFS and CCI DVFS, and LITTLE cpus and CCI are in the same voltage domain.
> So, this series is to add drivers to handle the voltage coupling between CPU and CCI DVFS.
> 
> For SVS support, need OPP_EVENT_ADJUST_VOLTAGE and corresponding reaction.
> 
> Change since v5:
> 	- Changing dt-binding format to yaml.
> 	- Extending current devfreq passive_governor instead of create a new one.
> 	- Resend depending patches of Sravana Kannan base on kernel-5.7
> 
> 
> Andrew-sh.Cheng (6):
>   cpufreq: mediatek: add clock and regulator enable for intermediate
>     clock
>   dt-bindings: devfreq: add compatible for mt8183 cci devfreq
>   devfreq: add mediatek cci devfreq
>   opp: Modify opp API, dev_pm_opp_get_freq(), find freq in opp, even it
>     is disabled
>   cpufreq: mediatek: add opp notification for SVS support
>   devfreq: mediatek: cci devfreq register opp notification for SVS
>     support
> 
> Saravana Kannan (6):
>   OPP: Allow required-opps even if the device doesn't have power-domains
>   OPP: Add function to look up required OPP's for a given OPP
>   OPP: Improve required-opps linking
>   PM / devfreq: Cache OPP table reference in devfreq
>   PM / devfreq: Add required OPPs support to passive governor
>   PM / devfreq: Add cpu based scaling support to passive_governor
> 
>  .../devicetree/bindings/devfreq/mt8183-cci.yaml    |  51 ++++
>  drivers/cpufreq/mediatek-cpufreq.c                 | 122 ++++++++-
>  drivers/devfreq/Kconfig                            |  12 +
>  drivers/devfreq/Makefile                           |   1 +
>  drivers/devfreq/devfreq.c                          |   6 +
>  drivers/devfreq/governor_passive.c                 | 298 +++++++++++++++++++--
>  drivers/devfreq/mt8183-cci-devfreq.c               | 233 ++++++++++++++++
>  drivers/opp/core.c                                 |  85 +++++-
>  drivers/opp/of.c                                   | 108 ++++----
>  drivers/opp/opp.h                                  |   5 +
>  include/linux/devfreq.h                            |  42 ++-
>  include/linux/pm_opp.h                             |  11 +
>  12 files changed, 874 insertions(+), 100 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/devfreq/mt8183-cci.yaml
>  create mode 100644 drivers/devfreq/mt8183-cci-devfreq.c
>
andrew-sh.cheng May 20, 2020, 5:36 a.m. UTC | #2
On Wed, 2020-05-20 at 13:10 +0900, Chanwoo Choi wrote:
> Hi Andrew,
> 
> Could you explain the base commit of these patches?
> When I tried to apply them to v5.7-rc1 for testing,
> the merge conflict occurs.
> 
> Thanks,
> Chanwoo Choi

Hi Chanwoo Choi,

My base commit is
commit 8f3d9f354286745c751374f5f1fcafee6b3f3136
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sun Apr 12 12:35:55 2020 -0700

    Linux 5.7-rc1

Could you show me the conflict error?

BR,
Andrew-sh.Cheng
> 
> On 5/20/20 12:42 PM, Andrew-sh.Cheng wrote:
> > MT8183 supports CPU DVFS and CCI DVFS, and LITTLE cpus and CCI are in the same voltage domain.
> > So, this series is to add drivers to handle the voltage coupling between CPU and CCI DVFS.
> > 
> > For SVS support, need OPP_EVENT_ADJUST_VOLTAGE and corresponding reaction.
> > 
> > Change since v5:
> > 	- Changing dt-binding format to yaml.
> > 	- Extending current devfreq passive_governor instead of create a new one.
> > 	- Resend depending patches of Sravana Kannan base on kernel-5.7
> > 
> > 
> > Andrew-sh.Cheng (6):
> >   cpufreq: mediatek: add clock and regulator enable for intermediate
> >     clock
> >   dt-bindings: devfreq: add compatible for mt8183 cci devfreq
> >   devfreq: add mediatek cci devfreq
> >   opp: Modify opp API, dev_pm_opp_get_freq(), find freq in opp, even it
> >     is disabled
> >   cpufreq: mediatek: add opp notification for SVS support
> >   devfreq: mediatek: cci devfreq register opp notification for SVS
> >     support
> > 
> > Saravana Kannan (6):
> >   OPP: Allow required-opps even if the device doesn't have power-domains
> >   OPP: Add function to look up required OPP's for a given OPP
> >   OPP: Improve required-opps linking
> >   PM / devfreq: Cache OPP table reference in devfreq
> >   PM / devfreq: Add required OPPs support to passive governor
> >   PM / devfreq: Add cpu based scaling support to passive_governor
> > 
> >  .../devicetree/bindings/devfreq/mt8183-cci.yaml    |  51 ++++
> >  drivers/cpufreq/mediatek-cpufreq.c                 | 122 ++++++++-
> >  drivers/devfreq/Kconfig                            |  12 +
> >  drivers/devfreq/Makefile                           |   1 +
> >  drivers/devfreq/devfreq.c                          |   6 +
> >  drivers/devfreq/governor_passive.c                 | 298 +++++++++++++++++++--
> >  drivers/devfreq/mt8183-cci-devfreq.c               | 233 ++++++++++++++++
> >  drivers/opp/core.c                                 |  85 +++++-
> >  drivers/opp/of.c                                   | 108 ++++----
> >  drivers/opp/opp.h                                  |   5 +
> >  include/linux/devfreq.h                            |  42 ++-
> >  include/linux/pm_opp.h                             |  11 +
> >  12 files changed, 874 insertions(+), 100 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/devfreq/mt8183-cci.yaml
> >  create mode 100644 drivers/devfreq/mt8183-cci-devfreq.c
> >
Chanwoo Choi May 20, 2020, 6:24 a.m. UTC | #3
Hi,

On 5/20/20 2:36 PM, andrew-sh.cheng wrote:
> On Wed, 2020-05-20 at 13:10 +0900, Chanwoo Choi wrote:
>> Hi Andrew,
>>
>> Could you explain the base commit of these patches?
>> When I tried to apply them to v5.7-rc1 for testing,
>> the merge conflict occurs.
>>
>> Thanks,

>> Chanwoo Choi
> 
> Hi Chanwoo Choi,
> 
> My base commit is
> commit 8f3d9f354286745c751374f5f1fcafee6b3f3136
> Author: Linus Torvalds <torvalds@linux-foundation.org>
> Date:   Sun Apr 12 12:35:55 2020 -0700
> 
>     Linux 5.7-rc1
> 
> Could you show me the conflict error?


When I tried to apply first patch with 'git am',
the merge conflict occurred.

git am \[PATCH\ 01_12\]\ OPP\:\ Allow\ required-opps\ even\ if\ the\ device\ doesn\'t\ have\ power-domains.eml
Applying: OPP: Allow required-opps even if the device doesn't have power-domains
error: patch failed: drivers/opp/core.c:755
error: drivers/opp/core.c: patch does not apply
error: patch failed: drivers/opp/of.c:195																																																																												
error: drivers/opp/of.c: patch does not apply
Patch failed at 0001 OPP: Allow required-opps even if the device doesn't have power-domains
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Regards,
Chanwoo Choi

> 
> BR,
> Andrew-sh.Cheng
>>
>> On 5/20/20 12:42 PM, Andrew-sh.Cheng wrote:
>>> MT8183 supports CPU DVFS and CCI DVFS, and LITTLE cpus and CCI are in the same voltage domain.
>>> So, this series is to add drivers to handle the voltage coupling between CPU and CCI DVFS.
>>>
>>> For SVS support, need OPP_EVENT_ADJUST_VOLTAGE and corresponding reaction.
>>>
>>> Change since v5:
>>> 	- Changing dt-binding format to yaml.
>>> 	- Extending current devfreq passive_governor instead of create a new one.
>>> 	- Resend depending patches of Sravana Kannan base on kernel-5.7
>>>
>>>
>>> Andrew-sh.Cheng (6):
>>>   cpufreq: mediatek: add clock and regulator enable for intermediate
>>>     clock
>>>   dt-bindings: devfreq: add compatible for mt8183 cci devfreq
>>>   devfreq: add mediatek cci devfreq
>>>   opp: Modify opp API, dev_pm_opp_get_freq(), find freq in opp, even it
>>>     is disabled
>>>   cpufreq: mediatek: add opp notification for SVS support
>>>   devfreq: mediatek: cci devfreq register opp notification for SVS
>>>     support
>>>
>>> Saravana Kannan (6):
>>>   OPP: Allow required-opps even if the device doesn't have power-domains
>>>   OPP: Add function to look up required OPP's for a given OPP
>>>   OPP: Improve required-opps linking
>>>   PM / devfreq: Cache OPP table reference in devfreq
>>>   PM / devfreq: Add required OPPs support to passive governor
>>>   PM / devfreq: Add cpu based scaling support to passive_governor
>>>
>>>  .../devicetree/bindings/devfreq/mt8183-cci.yaml    |  51 ++++
>>>  drivers/cpufreq/mediatek-cpufreq.c                 | 122 ++++++++-
>>>  drivers/devfreq/Kconfig                            |  12 +
>>>  drivers/devfreq/Makefile                           |   1 +
>>>  drivers/devfreq/devfreq.c                          |   6 +
>>>  drivers/devfreq/governor_passive.c                 | 298 +++++++++++++++++++--
>>>  drivers/devfreq/mt8183-cci-devfreq.c               | 233 ++++++++++++++++
>>>  drivers/opp/core.c                                 |  85 +++++-
>>>  drivers/opp/of.c                                   | 108 ++++----
>>>  drivers/opp/opp.h                                  |   5 +
>>>  include/linux/devfreq.h                            |  42 ++-
>>>  include/linux/pm_opp.h                             |  11 +
>>>  12 files changed, 874 insertions(+), 100 deletions(-)
>>>  create mode 100644 Documentation/devicetree/bindings/devfreq/mt8183-cci.yaml
>>>  create mode 100644 drivers/devfreq/mt8183-cci-devfreq.c
>>>
>
andrew-sh.cheng May 20, 2020, 7:10 a.m. UTC | #4
On Wed, 2020-05-20 at 15:24 +0900, Chanwoo Choi wrote:
> Hi,
> 
> On 5/20/20 2:36 PM, andrew-sh.cheng wrote:
> > On Wed, 2020-05-20 at 13:10 +0900, Chanwoo Choi wrote:
> >> Hi Andrew,
> >>
> >> Could you explain the base commit of these patches?
> >> When I tried to apply them to v5.7-rc1 for testing,
> >> the merge conflict occurs.
> >>
> >> Thanks,
> 
> >> Chanwoo Choi
> > 
> > Hi Chanwoo Choi,
> > 
> > My base commit is
> > commit 8f3d9f354286745c751374f5f1fcafee6b3f3136
> > Author: Linus Torvalds <torvalds@linux-foundation.org>
> > Date:   Sun Apr 12 12:35:55 2020 -0700
> > 
> >     Linux 5.7-rc1
> > 
> > Could you show me the conflict error?
> 
> 
> When I tried to apply first patch with 'git am',
> the merge conflict occurred.
> 
> git am \[PATCH\ 01_12\]\ OPP\:\ Allow\ required-opps\ even\ if\ the\ device\ doesn\'t\ have\ power-domains.eml
> Applying: OPP: Allow required-opps even if the device doesn't have power-domains
> error: patch failed: drivers/opp/core.c:755
> error: drivers/opp/core.c: patch does not apply
> error: patch failed: drivers/opp/of.c:195																																																																												
> error: drivers/opp/of.c: patch does not apply
> Patch failed at 0001 OPP: Allow required-opps even if the device doesn't have power-domains
> Use 'git am --show-current-patch' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> 
> Regards,
> Chanwoo Choi

Hi Chanwoo,

I just make a new folder to get code and check.
Below is my command list.
Please help check the different with you.
  505  repo init -u http://gerrit.mediatek.inc:8080/cros-kernel/manifest
-b upstream
  506  repo sync -j8
  507  repo start kern-dev --all
  508   git remote add main
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  509  git remote add main
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  510  ls
  511  cd kernel/mediatek/
  512   git remote add main
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  513  git fetch main
  514  git checkout v5.7-rc1
  515  git am
Add-cpufreq-and-cci-devfreq-for-mt8183-and-SVS-support.patch
  516  history


BR,
Andrew-sh.Cheng
> 
> > 
> > BR,
> > Andrew-sh.Cheng
> >>
> >> On 5/20/20 12:42 PM, Andrew-sh.Cheng wrote:
> >>> MT8183 supports CPU DVFS and CCI DVFS, and LITTLE cpus and CCI are in the same voltage domain.
> >>> So, this series is to add drivers to handle the voltage coupling between CPU and CCI DVFS.
> >>>
> >>> For SVS support, need OPP_EVENT_ADJUST_VOLTAGE and corresponding reaction.
> >>>
> >>> Change since v5:
> >>> 	- Changing dt-binding format to yaml.
> >>> 	- Extending current devfreq passive_governor instead of create a new one.
> >>> 	- Resend depending patches of Sravana Kannan base on kernel-5.7
> >>>
> >>>
> >>> Andrew-sh.Cheng (6):
> >>>   cpufreq: mediatek: add clock and regulator enable for intermediate
> >>>     clock
> >>>   dt-bindings: devfreq: add compatible for mt8183 cci devfreq
> >>>   devfreq: add mediatek cci devfreq
> >>>   opp: Modify opp API, dev_pm_opp_get_freq(), find freq in opp, even it
> >>>     is disabled
> >>>   cpufreq: mediatek: add opp notification for SVS support
> >>>   devfreq: mediatek: cci devfreq register opp notification for SVS
> >>>     support
> >>>
> >>> Saravana Kannan (6):
> >>>   OPP: Allow required-opps even if the device doesn't have power-domains
> >>>   OPP: Add function to look up required OPP's for a given OPP
> >>>   OPP: Improve required-opps linking
> >>>   PM / devfreq: Cache OPP table reference in devfreq
> >>>   PM / devfreq: Add required OPPs support to passive governor
> >>>   PM / devfreq: Add cpu based scaling support to passive_governor
> >>>
> >>>  .../devicetree/bindings/devfreq/mt8183-cci.yaml    |  51 ++++
> >>>  drivers/cpufreq/mediatek-cpufreq.c                 | 122 ++++++++-
> >>>  drivers/devfreq/Kconfig                            |  12 +
> >>>  drivers/devfreq/Makefile                           |   1 +
> >>>  drivers/devfreq/devfreq.c                          |   6 +
> >>>  drivers/devfreq/governor_passive.c                 | 298 +++++++++++++++++++--
> >>>  drivers/devfreq/mt8183-cci-devfreq.c               | 233 ++++++++++++++++
> >>>  drivers/opp/core.c                                 |  85 +++++-
> >>>  drivers/opp/of.c                                   | 108 ++++----
> >>>  drivers/opp/opp.h                                  |   5 +
> >>>  include/linux/devfreq.h                            |  42 ++-
> >>>  include/linux/pm_opp.h                             |  11 +
> >>>  12 files changed, 874 insertions(+), 100 deletions(-)
> >>>  create mode 100644 Documentation/devicetree/bindings/devfreq/mt8183-cci.yaml
> >>>  create mode 100644 drivers/devfreq/mt8183-cci-devfreq.c
> >>>
> > 
> 
>
Matthias Brugger May 20, 2020, 2:53 p.m. UTC | #5
On 20/05/2020 09:10, andrew-sh.cheng wrote:
> On Wed, 2020-05-20 at 15:24 +0900, Chanwoo Choi wrote:
>> Hi,
>>
>> On 5/20/20 2:36 PM, andrew-sh.cheng wrote:
>>> On Wed, 2020-05-20 at 13:10 +0900, Chanwoo Choi wrote:
>>>> Hi Andrew,
>>>>
>>>> Could you explain the base commit of these patches?
>>>> When I tried to apply them to v5.7-rc1 for testing,
>>>> the merge conflict occurs.
>>>>
>>>> Thanks,
>>
>>>> Chanwoo Choi
>>>
>>> Hi Chanwoo Choi,
>>>
>>> My base commit is
>>> commit 8f3d9f354286745c751374f5f1fcafee6b3f3136
>>> Author: Linus Torvalds <torvalds@linux-foundation.org>
>>> Date:   Sun Apr 12 12:35:55 2020 -0700
>>>
>>>     Linux 5.7-rc1
>>>
>>> Could you show me the conflict error?
>>
>>
>> When I tried to apply first patch with 'git am',
>> the merge conflict occurred.
>>
>> git am \[PATCH\ 01_12\]\ OPP\:\ Allow\ required-opps\ even\ if\ the\ device\ doesn\'t\ have\ power-domains.eml
>> Applying: OPP: Allow required-opps even if the device doesn't have power-domains
>> error: patch failed: drivers/opp/core.c:755
>> error: drivers/opp/core.c: patch does not apply
>> error: patch failed: drivers/opp/of.c:195																																																																												
>> error: drivers/opp/of.c: patch does not apply
>> Patch failed at 0001 OPP: Allow required-opps even if the device doesn't have power-domains
>> Use 'git am --show-current-patch' to see the failed patch
>> When you have resolved this problem, run "git am --continue".
>> If you prefer to skip this patch, run "git am --skip" instead.
>> To restore the original branch and stop patching, run "git am --abort".
>>
>> Regards,
>> Chanwoo Choi
> 
> Hi Chanwoo,
> 
> I just make a new folder to get code and check.
> Below is my command list.
> Please help check the different with you.
>   505  repo init -u http://gerrit.mediatek.inc:8080/cros-kernel/manifest
> -b upstream
>   506  repo sync -j8
>   507  repo start kern-dev --all
>   508   git remote add main
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>   509  git remote add main
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>   510  ls
>   511  cd kernel/mediatek/
>   512   git remote add main
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>   513  git fetch main
>   514  git checkout v5.7-rc1
>   515  git am
> Add-cpufreq-and-cci-devfreq-for-mt8183-and-SVS-support.patch
>   516  history
> 

For reference I just tried with b4.sh [1]:
# b4.sh am -l -o /tmp -n patch  1589958625.23971.2.camel@mtksdaap41
# git am -3 -s /tmp/patch.mbx

Applies without conflicts.

Regards,
Matthias

[1] https://git.kernel.org/pub/scm/utils/b4/b4.git
Viresh Kumar June 15, 2020, 7:31 a.m. UTC | #6
On 20-05-20, 11:42, Andrew-sh.Cheng wrote:
> 	- Resend depending patches of Sravana Kannan base on kernel-5.7

Saravana's patches were never accepted and I suggested him this which
he never tested I believe.

https://lore.kernel.org/lkml/20191125112812.26jk5hsdwqfnofc2@vireshk-i7/

There is no point rebasing your stuff on a series which hasn't
concluded or is accepted, at least logically.