<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/clk, branch v4.19.39</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.39</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.39'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-04-17T06:38:46+00:00</updated>
<entry>
<title>Revert "clk: meson: clean-up clock registration"</title>
<updated>2019-04-17T06:38:46+00:00</updated>
<author>
<name>Neil Armstrong</name>
<email>narmstrong@baylibre.com</email>
</author>
<published>2019-04-11T10:11:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=564f0391b7834528a6b96d0ad0b6c70683e9b37f'/>
<id>urn:sha1:564f0391b7834528a6b96d0ad0b6c70683e9b37f</id>
<content type='text'>
This reverts commit c8e4f8406842332fb55cd792016e5dac266f6354.

This patch was not initially a fix and is dependent on other
changes which are not fixes eithers.

With this change, multiple Amlogic based boards fails to boot,
as reported by kernelci.

Cc: stable@vger.kernel.org # 4.19.34
Signed-off-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: rockchip: fix frac settings of GPLL clock for rk3328</title>
<updated>2019-04-05T20:33:16+00:00</updated>
<author>
<name>Katsuhiro Suzuki</name>
<email>katsuhiro@katsuster.net</email>
</author>
<published>2018-12-22T16:42:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7386f095b7097f669dda3c4efd6ec47d7468ef83'/>
<id>urn:sha1:7386f095b7097f669dda3c4efd6ec47d7468ef83</id>
<content type='text'>
[ Upstream commit a0e447b0c50240a90ab84b7126b3c06b0bab4adc ]

This patch fixes settings of GPLL frequency in fractional mode for
rk3328. In this mode, FOUTVCO is calcurated by following formula:
  FOUTVCO = FREF * FBDIV / REFDIV + ((FREF * FRAC / REFDIV) &gt;&gt; 24)

The problem is in FREF * FRAC &gt;&gt; 24 term. This result always lacks
one from target value is specified by rate member. For example first
itme of rk3328_pll_frac_rate originally has
  - rate  : 1016064000
  - refdiv: 3
  - fbdiv : 127
  - frac  : 134217
  - FREF * FBDIV / REFDIV        = 1016000000
  - (FREF * FRAC / REFDIV) &gt;&gt; 24 = 63999
Thus calculated rate is 1016063999. It seems wrong.

If frac has 134218 (it is increased 1 from original value), second
term is 64000. All other items have same situation. So this patch
adds 1 to frac member in all items of rk3328_pll_frac_rate.

Signed-off-by: Katsuhiro Suzuki &lt;katsuhiro@katsuster.net&gt;
Acked-by: Elaine Zhang &lt;zhangqing@rock-chips.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: meson: clean-up clock registration</title>
<updated>2019-04-05T20:33:16+00:00</updated>
<author>
<name>Jerome Brunet</name>
<email>jbrunet@baylibre.com</email>
</author>
<published>2018-12-21T16:02:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c8e4f8406842332fb55cd792016e5dac266f6354'/>
<id>urn:sha1:c8e4f8406842332fb55cd792016e5dac266f6354</id>
<content type='text'>
[ Upstream commit 8d9981efbcab066d17af4d3c85c169200f6f78df ]

Order, ids and size  between the table of regmap clocks and the onecell
data table could be different.

Set regmap pointer in all the regmap clocks before starting the
registration using the onecell data, to make sure we don't
get into an incoherent situation.

Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Acked-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Signed-off-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Link: https://lkml.kernel.org/r/20181221160239.26265-3-jbrunet@baylibre.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: fractional-divider: check parent rate only if flag is set</title>
<updated>2019-04-05T20:33:03+00:00</updated>
<author>
<name>Katsuhiro Suzuki</name>
<email>katsuhiro@katsuster.net</email>
</author>
<published>2019-02-10T15:38:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=763a895aa49cc93c94c271678d07490632c1adb3'/>
<id>urn:sha1:763a895aa49cc93c94c271678d07490632c1adb3</id>
<content type='text'>
[ Upstream commit d13501a2bedfbea0983cc868d3f1dc692627f60d ]

Custom approximation of fractional-divider may not need parent clock
rate checking. For example Rockchip SoCs work fine using grand parent
clock rate even if target rate is greater than parent.

This patch checks parent clock rate only if CLK_SET_RATE_PARENT flag
is set.

For detailed example, clock tree of Rockchip I2S audio hardware.
  - Clock rate of CPLL is 1.2GHz, GPLL is 491.52MHz.
  - i2s1_div is integer divider can divide N (N is 1~128).
    Input clock is CPLL or GPLL. Initial divider value is N = 1.
    Ex) PLL = CPLL, N = 10, i2s1_div output rate is
      CPLL / 10 = 1.2GHz / 10 = 120MHz
  - i2s1_frac is fractional divider can divide input to x/y, x and
    y are 16bit integer.

CPLL --&gt; | selector | ---&gt; i2s1_div -+--&gt; | selector | --&gt; I2S1 MCLK
GPLL --&gt; |          | ,--------------'    |          |
                      `--&gt; i2s1_frac ---&gt; |          |

Clock mux system try to choose suitable one from i2s1_div and
i2s1_frac for master clock (MCLK) of I2S1.

Bad scenario as follows:
  - Try to set MCLK to 8.192MHz (32kHz audio replay)
    Candidate setting is
    - i2s1_div: GPLL / 60 = 8.192MHz
    i2s1_div candidate is exactly same as target clock rate, so mux
    choose this clock source. i2s1_div output rate is changed
    491.52MHz -&gt; 8.192MHz

  - After that try to set to 11.2896MHz (44.1kHz audio replay)
    Candidate settings are
    - i2s1_div : CPLL / 107 = 11.214945MHz
    - i2s1_frac: i2s1_div   = 8.192MHz
      This is because clk_fd_round_rate() thinks target rate
      (11.2896MHz) is higher than parent rate (i2s1_div = 8.192MHz)
      and returns parent clock rate.

Above is current upstreamed behavior. Clock mux system choose
i2s1_div, but this clock rate is not acceptable for I2S driver, so
users cannot replay audio.

Expected behavior is:
  - Try to set master clock to 11.2896MHz (44.1kHz audio replay)
    Candidate settings are
    - i2s1_div : CPLL / 107          = 11.214945MHz
    - i2s1_frac: i2s1_div * 147/6400 = 11.2896MHz
                 Change i2s1_div to GPLL / 1 = 491.52MHz at same
                 time.

If apply this commit, clk_fd_round_rate() calls custom approximate
function of Rockchip even if target rate is higher than parent.
Custom function changes both grand parent (i2s1_div) and parent
(i2s_frac) settings at same time. Clock mux system can choose
i2s1_frac and audio works fine.

Signed-off-by: Katsuhiro Suzuki &lt;katsuhiro@katsuster.net&gt;
Reviewed-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
[sboyd@kernel.org: Make function into a macro instead]
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: ingenic: Fix doc of ingenic_cgu_div_info</title>
<updated>2019-03-23T19:10:03+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2019-01-28T02:09:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b1c1ef7b4d63c18a1853f874e298cadc98b829f7'/>
<id>urn:sha1:b1c1ef7b4d63c18a1853f874e298cadc98b829f7</id>
<content type='text'>
commit 7ca4c922aad2e3c46767a12f80d01c6b25337b59 upstream.

The 'div' field does not represent a number of bits used to divide
(understand: right-shift) the divider, but a number itself used to
divide the divider.

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Signed-off-by: Maarten ter Huurne &lt;maarten@treewalker.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>clk: ingenic: Fix round_rate misbehaving with non-integer dividers</title>
<updated>2019-03-23T19:10:03+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2019-01-28T02:09:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a04611fc26655c0d817cfee73a133657685647f'/>
<id>urn:sha1:4a04611fc26655c0d817cfee73a133657685647f</id>
<content type='text'>
commit bc5d922c93491878c44c9216e9d227c7eeb81d7f upstream.

Take a parent rate of 180 MHz, and a requested rate of 4.285715 MHz.
This results in a theorical divider of 41.999993 which is then rounded
up to 42. The .round_rate function would then return (180 MHz / 42) as
the clock, rounded down, so 4.285714 MHz.

Calling clk_set_rate on 4.285714 MHz would round the rate again, and
give a theorical divider of 42,0000028, now rounded up to 43, and the
rate returned would be (180 MHz / 43) which is 4.186046 MHz, aka. not
what we requested.

Fix this by rounding up the divisions.

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Tested-by: Maarten ter Huurne &lt;maarten@treewalker.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>clk: samsung: exynos5: Fix kfree() of const memory on setting driver_override</title>
<updated>2019-03-23T19:10:03+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2019-02-21T11:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=33e7604ac8fd3b0e995bff4dbf0e25d36e9e8611'/>
<id>urn:sha1:33e7604ac8fd3b0e995bff4dbf0e25d36e9e8611</id>
<content type='text'>
commit 785c9f411eb2d9a6076d3511c631587d5e676bf3 upstream.

Platform driver driver_override field should not be initialized from
const memory because the core later kfree() it.  If driver_override is
manually set later through sysfs, kfree() of old value leads to:

    $ echo "new_value" &gt; /sys/bus/platform/drivers/.../driver_override

    kernel BUG at ../mm/slub.c:3960!
    Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
    ...
    (kfree) from [&lt;c058e8c0&gt;] (platform_set_driver_override+0x84/0xac)
    (platform_set_driver_override) from [&lt;c058e908&gt;] (driver_override_store+0x20/0x34)
    (driver_override_store) from [&lt;c031f778&gt;] (kernfs_fop_write+0x100/0x1dc)
    (kernfs_fop_write) from [&lt;c0296de8&gt;] (__vfs_write+0x2c/0x17c)
    (__vfs_write) from [&lt;c02970c4&gt;] (vfs_write+0xa4/0x188)
    (vfs_write) from [&lt;c02972e8&gt;] (ksys_write+0x4c/0xac)
    (ksys_write) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x28)

The clk-exynos5-subcmu driver uses override only for the purpose of
creating meaningful names for children devices (matching names of power
domains, e.g. DISP, MFC).  The driver_override was not developed for
this purpose so just switch to default names of devices to fix the
issue.

Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>clk: samsung: exynos5: Fix possible NULL pointer exception on platform_device_alloc() failure</title>
<updated>2019-03-23T19:10:03+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2019-02-21T11:45:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d1de1e6d266f273f77f7323c7ef5ee87650bd4a'/>
<id>urn:sha1:4d1de1e6d266f273f77f7323c7ef5ee87650bd4a</id>
<content type='text'>
commit 5f0b6216ea381b43c0dff88702d6cc5673d63922 upstream.

During initialization of subdevices if platform_device_alloc() failed,
returned NULL pointer will be later dereferenced.  Add proper error
paths to exynos5_clk_register_subcmu().  The return value of this
function is still ignored because at this stage of init there is nothing
we can do.

Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>clk: clk-twl6040: Fix imprecise external abort for pdmclk</title>
<updated>2019-03-23T19:10:03+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2019-02-11T22:59:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9aba7a8fd163b8a58a25505692542c184ab44b7f'/>
<id>urn:sha1:9aba7a8fd163b8a58a25505692542c184ab44b7f</id>
<content type='text'>
commit 5ae51d67aec95f6f9386aa8dd5db424964895575 upstream.

I noticed that modprobe clk-twl6040 can fail after a cold boot with:
abe_cm:clk:0010:0: failed to enable
...
Unhandled fault: imprecise external abort (0x1406) at 0xbe896b20

WARNING: CPU: 1 PID: 29 at drivers/clk/clk.c:828 clk_core_disable_lock+0x18/0x24
...
(clk_core_disable_lock) from [&lt;c0123534&gt;] (_disable_clocks+0x18/0x90)
(_disable_clocks) from [&lt;c0124040&gt;] (_idle+0x17c/0x244)
(_idle) from [&lt;c0125ad4&gt;] (omap_hwmod_idle+0x24/0x44)
(omap_hwmod_idle) from [&lt;c053a038&gt;] (sysc_runtime_suspend+0x48/0x108)
(sysc_runtime_suspend) from [&lt;c06084c4&gt;] (__rpm_callback+0x144/0x1d8)
(__rpm_callback) from [&lt;c0608578&gt;] (rpm_callback+0x20/0x80)
(rpm_callback) from [&lt;c0607034&gt;] (rpm_suspend+0x120/0x694)
(rpm_suspend) from [&lt;c0607a78&gt;] (__pm_runtime_idle+0x60/0x84)
(__pm_runtime_idle) from [&lt;c053aaf0&gt;] (sysc_probe+0x874/0xf2c)
(sysc_probe) from [&lt;c05fecd4&gt;] (platform_drv_probe+0x48/0x98)

After searching around for a similar issue, I came across an earlier fix
that never got merged upstream in the Android tree for glass-omap-xrr02.
There is patch "MFD: twl6040-codec: Implement PDMCLK cold temp errata"
by Misael Lopez Cruz &lt;misael.lopez@ti.com&gt;.

Based on my observations, this fix is also needed when cold booting
devices, and not just for deeper idle modes. Since we now have a clock
driver for pdmclk, let's fix the issue in twl6040_pdmclk_prepare().

Cc: Misael Lopez Cruz &lt;misael.lopez@ti.com&gt;
Cc: Peter Ujfalusi &lt;peter.ujfalusi@ti.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Peter Ujfalusi &lt;peter.ujfalusi@ti.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>clk: uniphier: Fix update register for CPU-gear</title>
<updated>2019-03-23T19:10:03+00:00</updated>
<author>
<name>Kunihiko Hayashi</name>
<email>hayashi.kunihiko@socionext.com</email>
</author>
<published>2019-02-08T02:25:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e02a5f5aba3f414a36b49148fa9a5c0b63965ae'/>
<id>urn:sha1:6e02a5f5aba3f414a36b49148fa9a5c0b63965ae</id>
<content type='text'>
commit 521282237b9d78b9bff423ec818becd4c95841c2 upstream.

Need to set the update bit in UNIPHIER_CLK_CPUGEAR_UPD to update
the CPU-gear value.

Fixes: d08f1f0d596c ("clk: uniphier: add CPU-gear change (cpufreq) support")
Cc: linux-stable@vger.kernel.org
Signed-off-by: Kunihiko Hayashi &lt;hayashi.kunihiko@socionext.com&gt;
Acked-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
