]> git.baikalelectronics.ru Git - kernel.git/commit
mips: cevt-r4k: Update the r4k-clockevent frequency in sync with CPU
authorBaikal Electronics <support@baikalelectronics.ru>
Thu, 21 May 2020 14:07:24 +0000 (17:07 +0300)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 22 May 2020 07:14:32 +0000 (09:14 +0200)
commit94ee8d9a4aaed6b7c8e9be8df4161c654f613cce
treeafc026e6bd2c333a24a52f51213a91d948bfbc92
parenta368ebe8e3c90a2fea8bb4ee7a2411ed6e2b9632
mips: cevt-r4k: Update the r4k-clockevent frequency in sync with CPU

Due to being embedded into the CPU cores MIPS count/compare timer
frequency is changed together with the CPU clocks alteration.
In case if frequency really changes the kernel clockevent framework
must be notified, otherwise the kernel timers won't work correctly.
Fix this by calling clockevents_update_freq() for each r4k clockevent
handlers registered per available CPUs.

Traditionally MIPS r4k-clock are clocked with CPU frequency divided by 2.
But this isn't true for some of the platforms. Due to this we have to save
the basic CPU frequency, so then use it to scale the initial timer
frequency (mips_hpt_frequency) and pass the updated value further to the
clockevent framework.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/cevt-r4k.c