<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/clocksource/tcb_clksrc.c, branch v4.4.53</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>clockevents/tcb_clksrc: Prevent disabling an already disabled clock</title>
<updated>2016-03-03T23:07:15+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2016-01-15T10:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c0cbcf2cb59c076f4ff6422153534dd2762c3d44'/>
<id>c0cbcf2cb59c076f4ff6422153534dd2762c3d44</id>
<content type='text'>
commit f02b4b72d12cbae7020a959e2ed0410a464b4cc4 upstream.

clockevents_exchange_device is calling clockevents_shutdown() on the new
clockenvents device but it may have never been enabled in the first place.
This results in the tcb clock being disabled without being enabled first:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:680 clk_disable+0x28/0x34()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0+ #6
Hardware name: Atmel AT91SAM9
[&lt;c000f2b8&gt;] (unwind_backtrace) from [&lt;c000d01c&gt;] (show_stack+0x10/0x14)
[&lt;c000d01c&gt;] (show_stack) from [&lt;c00172f0&gt;] (warn_slowpath_common+0x78/0xa0)
[&lt;c00172f0&gt;] (warn_slowpath_common) from [&lt;c00173a8&gt;] (warn_slowpath_null+0x18/0x20)
[&lt;c00173a8&gt;] (warn_slowpath_null) from [&lt;c0361528&gt;] (clk_disable+0x28/0x34)
[&lt;c0361528&gt;] (clk_disable) from [&lt;c034d560&gt;] (tc_shutdown+0x38/0x4c)
[&lt;c034d560&gt;] (tc_shutdown) from [&lt;c0059ad4&gt;] (clockevents_switch_state+0x38/0x6c)
[&lt;c0059ad4&gt;] (clockevents_switch_state) from [&lt;c0059b18&gt;] (clockevents_shutdown+0x10/0x24)
[&lt;c0059b18&gt;] (clockevents_shutdown) from [&lt;c005a458&gt;] (tick_check_new_device+0x84/0xac)
[&lt;c005a458&gt;] (tick_check_new_device) from [&lt;c0059660&gt;] (clockevents_register_device+0x7c/0x108)
[&lt;c0059660&gt;] (clockevents_register_device) from [&lt;c06b5a68&gt;] (tcb_clksrc_init+0x390/0x3e8)
[&lt;c06b5a68&gt;] (tcb_clksrc_init) from [&lt;c00097cc&gt;] (do_one_initcall+0x114/0x1d4)
[&lt;c00097cc&gt;] (do_one_initcall) from [&lt;c069bd54&gt;] (kernel_init_freeable+0xfc/0x1b8)
[&lt;c069bd54&gt;] (kernel_init_freeable) from [&lt;c04c3818&gt;] (kernel_init+0x8/0xe0)
[&lt;c04c3818&gt;] (kernel_init) from [&lt;c000a410&gt;] (ret_from_fork+0x14/0x24)
---[ end trace 0000000000000001 ]---

Check what state we were in before trying to disable the clock.

Fixes: cf4541c101ea ("clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface")
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Cc: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: http://lkml.kernel.org/r/1452854061-30370-1-git-send-email-alexandre.belloni@free-electrons.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f02b4b72d12cbae7020a959e2ed0410a464b4cc4 upstream.

clockevents_exchange_device is calling clockevents_shutdown() on the new
clockenvents device but it may have never been enabled in the first place.
This results in the tcb clock being disabled without being enabled first:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:680 clk_disable+0x28/0x34()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0+ #6
Hardware name: Atmel AT91SAM9
[&lt;c000f2b8&gt;] (unwind_backtrace) from [&lt;c000d01c&gt;] (show_stack+0x10/0x14)
[&lt;c000d01c&gt;] (show_stack) from [&lt;c00172f0&gt;] (warn_slowpath_common+0x78/0xa0)
[&lt;c00172f0&gt;] (warn_slowpath_common) from [&lt;c00173a8&gt;] (warn_slowpath_null+0x18/0x20)
[&lt;c00173a8&gt;] (warn_slowpath_null) from [&lt;c0361528&gt;] (clk_disable+0x28/0x34)
[&lt;c0361528&gt;] (clk_disable) from [&lt;c034d560&gt;] (tc_shutdown+0x38/0x4c)
[&lt;c034d560&gt;] (tc_shutdown) from [&lt;c0059ad4&gt;] (clockevents_switch_state+0x38/0x6c)
[&lt;c0059ad4&gt;] (clockevents_switch_state) from [&lt;c0059b18&gt;] (clockevents_shutdown+0x10/0x24)
[&lt;c0059b18&gt;] (clockevents_shutdown) from [&lt;c005a458&gt;] (tick_check_new_device+0x84/0xac)
[&lt;c005a458&gt;] (tick_check_new_device) from [&lt;c0059660&gt;] (clockevents_register_device+0x7c/0x108)
[&lt;c0059660&gt;] (clockevents_register_device) from [&lt;c06b5a68&gt;] (tcb_clksrc_init+0x390/0x3e8)
[&lt;c06b5a68&gt;] (tcb_clksrc_init) from [&lt;c00097cc&gt;] (do_one_initcall+0x114/0x1d4)
[&lt;c00097cc&gt;] (do_one_initcall) from [&lt;c069bd54&gt;] (kernel_init_freeable+0xfc/0x1b8)
[&lt;c069bd54&gt;] (kernel_init_freeable) from [&lt;c04c3818&gt;] (kernel_init+0x8/0xe0)
[&lt;c04c3818&gt;] (kernel_init) from [&lt;c000a410&gt;] (ret_from_fork+0x14/0x24)
---[ end trace 0000000000000001 ]---

Check what state we were in before trying to disable the clock.

Fixes: cf4541c101ea ("clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface")
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Cc: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: http://lkml.kernel.org/r/1452854061-30370-1-git-send-email-alexandre.belloni@free-electrons.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>misc: atmel_tclib: get and use slow clock</title>
<updated>2015-10-06T10:33:14+00:00</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2015-08-16T09:23:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7d8d05d11473a169ab4d53bc7fc23d1fe3f1959f'/>
<id>7d8d05d11473a169ab4d53bc7fc23d1fe3f1959f</id>
<content type='text'>
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
hang") added a workaround for the slow clock as it is not properly handled
by its users.

Get and use the slow clock as it is necessary for the timer counters.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system
hang") added a workaround for the slow clock as it is not properly handled
by its users.

Get and use the slow clock as it is necessary for the timer counters.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: tcb_clksrc: fix setup_clkevents error path</title>
<updated>2015-10-06T10:25:39+00:00</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2015-08-16T09:23:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=eed9fb9df47898ea62d71be7dcc3b36d95819a7c'/>
<id>eed9fb9df47898ea62d71be7dcc3b36d95819a7c</id>
<content type='text'>
t2_clk is already disabled before request_irq(), it must not be disabled
again.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
t2_clk is already disabled before request_irq(), it must not be disabled
again.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface</title>
<updated>2015-08-10T09:40:52+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2015-06-18T10:54:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf4541c101ea497f68639cc94a2639a05cc3710f'/>
<id>cf4541c101ea497f68639cc94a2639a05cc3710f</id>
<content type='text'>
Migrate tcb_clksrc driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Migrate tcb_clksrc driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

Cc: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: tcb_clksrc: sanitize IRQ request</title>
<updated>2014-09-08T08:54:03+00:00</updated>
<author>
<name>Gaël PORTAY</name>
<email>gael.portay@gmail.com</email>
</author>
<published>2014-09-06T17:52:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d07a1ecdfb96b26dd665b54fee22fc7417b1cb08'/>
<id>d07a1ecdfb96b26dd665b54fee22fc7417b1cb08</id>
<content type='text'>
The clock is not unprepared in case of the request IRQ fails.

Also update to request_irq.

Signed-off-by: Gaël PORTAY &lt;gael.portay@gmail.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The clock is not unprepared in case of the request IRQ fails.

Also update to request_irq.

Signed-off-by: Gaël PORTAY &lt;gael.portay@gmail.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ARM: at91/tclib: move initialization from alloc to probe</title>
<updated>2014-09-08T08:54:03+00:00</updated>
<author>
<name>Gaël PORTAY</name>
<email>gael.portay@gmail.com</email>
</author>
<published>2014-09-06T17:52:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4930d247af29f849cd1bddd65be2400684dc886e'/>
<id>4930d247af29f849cd1bddd65be2400684dc886e</id>
<content type='text'>
Move resource retrieval from atmel_tc_alloc to tc_probe to avoid lately
reporting resource related issues when a TC block user request a TC block.

Moreover, resources retrieval are usually done in the probe function,
thus moving them add some consistency with other drivers.

Initialization is done once, ie not every time a tc block is requested.
If it fails, the device is not appended to the list of tc blocks.

Furhermore, the device id is retrieved at probe as well, avoiding parsing
DT every time the user requests of tc block.

Signed-off-by: Gaël PORTAY &lt;gael.portay@gmail.com&gt;
Acked-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Acked-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move resource retrieval from atmel_tc_alloc to tc_probe to avoid lately
reporting resource related issues when a TC block user request a TC block.

Moreover, resources retrieval are usually done in the probe function,
thus moving them add some consistency with other drivers.

Initialization is done once, ie not every time a tc block is requested.
If it fails, the device is not appended to the list of tc blocks.

Furhermore, the device id is retrieved at probe as well, avoiding parsing
DT every time the user requests of tc block.

Signed-off-by: Gaël PORTAY &lt;gael.portay@gmail.com&gt;
Acked-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Acked-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: tcb_clksrc: Make tc_mode interrupt safe</title>
<updated>2014-05-22T16:54:58+00:00</updated>
<author>
<name>David Jander</name>
<email>david@protonic.nl</email>
</author>
<published>2014-05-08T10:06:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=acbf6d21ac81195071b97ebb114b0b37bd9fcc86'/>
<id>acbf6d21ac81195071b97ebb114b0b37bd9fcc86</id>
<content type='text'>
tc_mode() can be called from interrupt context and thus must not call
clk_*prepare*() functions.

Signed-off-by: David Jander &lt;david@protonic.nl&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tc_mode() can be called from interrupt context and thus must not call
clk_*prepare*() functions.

Signed-off-by: David Jander &lt;david@protonic.nl&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: tcb_clksrc: Remove IRQF_DISABLED</title>
<updated>2013-10-03T14:28:40+00:00</updated>
<author>
<name>Boris BREZILLON</name>
<email>b.brezillon@overkiz.com</email>
</author>
<published>2013-10-02T12:35:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f51380a75652a4600b34ce384c4ff89ce0a15132'/>
<id>f51380a75652a4600b34ce384c4ff89ce0a15132</id>
<content type='text'>
Remove the deprecated IRQF_DISABLED flag.

Signed-off-by: Boris BREZILLON &lt;b.brezillon@overkiz.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the deprecated IRQF_DISABLED flag.

Signed-off-by: Boris BREZILLON &lt;b.brezillon@overkiz.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: tcb_clksrc: Improve driver robustness</title>
<updated>2013-10-03T14:28:30+00:00</updated>
<author>
<name>Boris BREZILLON</name>
<email>b.brezillon@overkiz.com</email>
</author>
<published>2013-10-02T12:35:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5b3c11da141c27df6f8dd8acf90c0046ebab3a07'/>
<id>5b3c11da141c27df6f8dd8acf90c0046ebab3a07</id>
<content type='text'>
Check function return values to avoid false positive driver init.

Signed-off-by: Boris BREZILLON &lt;b.brezillon@overkiz.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check function return values to avoid false positive driver init.

Signed-off-by: Boris BREZILLON &lt;b.brezillon@overkiz.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: tcb_clksrc: Replace clk_enable/disable with clk_prepare_enable/disable_unprepare</title>
<updated>2013-10-03T14:28:23+00:00</updated>
<author>
<name>Boris BREZILLON</name>
<email>b.brezillon@overkiz.com</email>
</author>
<published>2013-10-02T12:35:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0e746ec55812a2f8f5ab986aeedd5291e3b6fad4'/>
<id>0e746ec55812a2f8f5ab986aeedd5291e3b6fad4</id>
<content type='text'>
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON &lt;b.brezillon@overkiz.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON &lt;b.brezillon@overkiz.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
