1. 07 11月, 2018 1 次提交
  2. 08 10月, 2018 1 次提交
  3. 02 7月, 2018 1 次提交
    • B
      cpufreq: imx6q/thermal: imx: register cooling device depending on OF · a1d00154
      Bastian Stender 提交于
      The cooling device should be part of the i.MX cpufreq driver, but it
      cannot be removed for the sake of DT stability. So turn the cooling
      device registration into a separate function and perform the
      registration only if the CPU OF node does not have the #cooling-cells
      property.
      
      Use of_cpufreq_power_cooling_register in imx_thermal code to link the
      cooling device to the device tree node provided.
      
      This makes it possible to bind the cpufreq cooling device to a custom
      thermal zone via a cooling-maps entry like:
      
      	cooling-maps {
      		map0 {
      			trip = <&board_alert>;
      			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
      		};
      	};
      
      Assuming a cpu node exists with label "cpu0" and #cooling-cells
      property.
      Signed-off-by: NBastian Stender <bst@pengutronix.de>
      Reviewed-by: NLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a1d00154
  4. 13 6月, 2018 1 次提交
    • K
      treewide: devm_kzalloc() -> devm_kcalloc() · a86854d0
      Kees Cook 提交于
      The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc().
      This patch replaces cases of:
      
              devm_kzalloc(handle, a * b, gfp)
      
      with:
              devm_kcalloc(handle, a * b, gfp)
      
      as well as handling cases of:
      
              devm_kzalloc(handle, a * b * c, gfp)
      
      with:
      
              devm_kzalloc(handle, array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              devm_kcalloc(handle, array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              devm_kzalloc(handle, 4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      Some manual whitespace fixes were needed in this patch, as Coccinelle
      really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...".
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      expression HANDLE;
      type TYPE;
      expression THING, E;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression HANDLE;
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      expression HANDLE;
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      expression HANDLE;
      identifier SIZE, COUNT;
      @@
      
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression HANDLE;
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression HANDLE;
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      expression HANDLE;
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression HANDLE;
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
      |
        devm_kzalloc(HANDLE,
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression HANDLE;
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        devm_kzalloc(HANDLE, sizeof(THING) * C2, ...)
      |
        devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...)
      |
        devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
      |
        devm_kzalloc(HANDLE, C1 * C2, ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      a86854d0
  5. 11 6月, 2018 1 次提交
  6. 20 3月, 2018 1 次提交
  7. 08 2月, 2018 1 次提交
  8. 10 1月, 2018 1 次提交
  9. 28 12月, 2017 1 次提交
  10. 18 12月, 2017 1 次提交
  11. 18 10月, 2017 1 次提交
    • F
      cpufreq: imx6q: Move speed grading check to cpufreq driver · 8e2b04b0
      Fabio Estevam 提交于
      On some i.MX6 SoCs (like i.MX6SL, i.MX6SX and i.MX6UL) that do not have
      speed grading check, opp table will not be created in platform code,
      so cpufreq driver prints the following error message:
      
      cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
      
      However, this is not really an error in this case because the
      imx6q-cpufreq driver first calls dev_pm_opp_get_opp_count()
      and if it fails, it means that platform code does not provide
      OPP and then dev_pm_opp_of_add_table() will be called.
      
      In order to avoid such confusing error message, move the speed grading
      check from platform code to the imx6q-cpufreq driver.
      
      This way the imx6q-cpufreq no longer has to check whether OPP table
      is supplied by platform code.
      
      Tested on a i.MX6Q and i.MX6UL based boards.
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NShawn Guo <shawnguo@kernel.org>
      8e2b04b0
  12. 11 10月, 2017 1 次提交
    • F
      cpufreq: imx6q: Move speed grading check to cpufreq driver · 2b3d58a3
      Fabio Estevam 提交于
      On some i.MX6 SoCs (like i.MX6SL, i.MX6SX and i.MX6UL) that do not have
      speed grading check, opp table will not be created in platform code,
      so cpufreq driver prints the following error message:
      
      cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
      
      However, this is not really an error in this case because the
      imx6q-cpufreq driver first calls dev_pm_opp_get_opp_count()
      and if it fails, it means that platform code does not provide
      OPP and then dev_pm_opp_of_add_table() will be called.
      
      In order to avoid such confusing error message, move the speed grading
      check from platform code to the imx6q-cpufreq driver.
      
      This way the imx6q-cpufreq no longer has to check whether OPP table
      is supplied by platform code.
      
      Tested on a i.MX6Q and i.MX6UL based boards.
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2b3d58a3
  13. 29 8月, 2017 1 次提交
    • L
      cpufreq: imx6q: Fix imx6sx low frequency support · fded5fc8
      Leonard Crestez 提交于
      This patch contains the minimal changes required to support imx6sx OPP
      of 198 Mhz. Without this patch cpufreq still reports success but the
      frequency is not changed, the "arm" clock will still be at 396000000 in
      clk_summary.
      
      In order to do this PLL1 needs to be still kept enabled while changing
      the ARM clock. This is a hardware requirement: when ARM_PODF is changed
      in CCM we need to check the busy bit of CCM_CDHIPR bit 16 arm_podf_busy,
      and this bit is sync with PLL1 clock, so if PLL1 NOT enabled, this
      bit will never get clear.
      
      Keep pll1_sys explicitly enabled until after the rate is change to deal
      with this. Otherwise from the clk framework perspective pll1_sys is
      unused and gets turned off.
      Signed-off-by: NLeonard Crestez <leonard.crestez@nxp.com>
      Reviewed-by: NLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fded5fc8
  14. 24 6月, 2017 1 次提交
  15. 20 4月, 2017 3 次提交
  16. 30 1月, 2017 1 次提交
    • V
      PM / OPP: Update OPP users to put reference · 8a31d9d9
      Viresh Kumar 提交于
      This patch updates dev_pm_opp_find_freq_*() routines to get a reference
      to the OPPs returned by them.
      
      Also updates the users of dev_pm_opp_find_freq_*() routines to call
      dev_pm_opp_put() after they are done using the OPPs.
      
      As it is guaranteed the that OPPs wouldn't get freed while being used,
      the RCU read side locking present with the users isn't required anymore.
      Drop it as well.
      
      This patch also updates all users of devfreq_recommended_opp() which was
      returning an OPP received from the OPP core.
      
      Note that some of the OPP core routines have gained
      rcu_read_{lock|unlock}() calls, as those still use RCU specific APIs
      within them.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> [Devfreq]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8a31d9d9
  17. 26 9月, 2015 1 次提交
  18. 15 9月, 2015 2 次提交
  19. 01 12月, 2014 1 次提交
  20. 20 10月, 2014 1 次提交
  21. 21 7月, 2014 1 次提交
  22. 17 5月, 2014 2 次提交
  23. 12 3月, 2014 1 次提交
  24. 17 1月, 2014 1 次提交
  25. 06 1月, 2014 3 次提交
  26. 31 10月, 2013 1 次提交
  27. 26 10月, 2013 4 次提交
  28. 16 10月, 2013 3 次提交
  29. 01 10月, 2013 1 次提交