* [PATCH v2 00/10] Allow COMMON_CLK to be selectable
@ 2020-04-09 6:44 Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 05/10] MIPS: Remove redundant CLKDEV_LOOKUP selects Stephen Boyd
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Stephen Boyd @ 2020-04-09 6:44 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, Alexander Shiyan, Andreas Färber,
Arnd Bergmann, Aurelien Jacquiot, Catalin Marinas, chenhc,
Geert Uytterhoeven, Guan Xuetao, Jiaxun Yang, linux-arm-kernel,
linux-c6x-dev, linux-m68k, linux-mips, linux-sh, Lubomir Rintel,
Manivannan Sadhasivam, Mark Brown, Mark Salter, Neil Armstrong,
Paul Burton, Paul Walmsley, Rich Felker, Russell King,
Thierry Reding, Thomas Bogendoerfer, Tony Prisk, uclinux-h8-devel,
Ulf Hansson, Will Deacon, Yoshinori Sato
This patch series cleans up a handful of selects that were redundant and
deletes presumably dead code with the goal of making it possible to add
kunit tests for the CCF in the future. To do that, we introduce a
"legacy" clk Kconfig option to mark code that hasn't migrated to the
common clk framework and then make the COMMON_CLK config option visible
in the menuconfig as long as that legacy option isn't enabled. I've also
included a couple patches at the end that may be more controversial but
helped me consolidate all this logic/code.
I haven't done more than compile test a few configs for arm, arm64,
h8300, and mips. More testing is welcome.
The plan is that I'll just merge the whole pile through the clk tree. If
the first five patches or the last three patches are better going
through another tree like arm-soc or architecture trees that's fine too,
but there are potential conflicts between trees so maybe it's better to
just leave it all in one tree.
Changes from v1:
* Fixed MIPS ralink build problem pointed out by Arnd
* Fixed meson mx sdio build due to bad Kconfig exposed by this change
* Picked up acks
Stephen Boyd (10):
ARM: Remove redundant COMMON_CLK selects
ARM: Remove redundant CLKDEV_LOOKUP selects
arm64: tegra: Remove redundant CLKDEV_LOOKUP selects
h8300: Remove redundant CLKDEV_LOOKUP selects
MIPS: Remove redundant CLKDEV_LOOKUP selects
mmc: meson-mx-sdio: Depend on OF_ADDRESS and not just OF
clk: Allow the common clk framework to be selectable
ARM: mmp: Remove legacy clk code
MIPS: Loongson64: Drop asm/clock.h include
clk: Move HAVE_CLK config out of architecture layer
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: <chenhc@lemote.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: <linux-c6x-dev@linux-c6x.org>
Cc: <linux-m68k@lists.linux-m68k.org>
Cc: <linux-mips@vger.kernel.org>
Cc: <linux-sh@vger.kernel.org>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Tony Prisk <linux@prisktech.co.nz>
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
arch/Kconfig | 6 --
arch/arm/Kconfig | 5 +-
arch/arm/mach-actions/Kconfig | 1 -
arch/arm/mach-clps711x/Kconfig | 1 -
arch/arm/mach-mmp/Kconfig | 1 -
arch/arm/mach-mmp/Makefile | 6 --
arch/arm/mach-mmp/clock-mmp2.c | 114 -------------------------------
arch/arm/mach-mmp/clock-pxa168.c | 94 -------------------------
arch/arm/mach-mmp/clock-pxa910.c | 70 -------------------
arch/arm/mach-mmp/clock.c | 105 ----------------------------
arch/arm/mach-mmp/clock.h | 65 ------------------
arch/arm/mach-vt8500/Kconfig | 1 -
arch/arm64/Kconfig.platforms | 1 -
arch/c6x/Kconfig | 1 +
arch/h8300/Kconfig | 1 -
arch/m68k/Kconfig.cpu | 2 +-
arch/mips/Kconfig | 7 +-
arch/mips/loongson2ef/Kconfig | 2 +-
arch/mips/loongson64/smp.c | 1 -
arch/mips/ralink/Kconfig | 4 ++
arch/sh/boards/Kconfig | 5 ++
arch/unicore32/Kconfig | 2 +-
drivers/clk/Kconfig | 23 +++++--
drivers/mmc/host/Kconfig | 2 +-
24 files changed, 38 insertions(+), 482 deletions(-)
delete mode 100644 arch/arm/mach-mmp/clock-mmp2.c
delete mode 100644 arch/arm/mach-mmp/clock-pxa168.c
delete mode 100644 arch/arm/mach-mmp/clock-pxa910.c
delete mode 100644 arch/arm/mach-mmp/clock.c
delete mode 100644 arch/arm/mach-mmp/clock.h
base-commit: 7111951b8d4973bda27ff663f2cf18b663d15b48
--
Sent by a computer, using git, on the internet
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 05/10] MIPS: Remove redundant CLKDEV_LOOKUP selects
2020-04-09 6:44 [PATCH v2 00/10] Allow COMMON_CLK to be selectable Stephen Boyd
@ 2020-04-09 6:44 ` Stephen Boyd
2020-05-14 19:56 ` Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 07/10] clk: Allow the common clk framework to be selectable Stephen Boyd
` (3 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2020-04-09 6:44 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, Thomas Bogendoerfer, linux-mips
The ATH79 config selects COMMON_CLK already, and the COMMON_CLK config
option already selects CLKDEV_LOOKUP, and CLKDEV_LOOKUP already selects
HAVE_CLK so it's redundant to have these selected again.
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: <linux-mips@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
arch/mips/Kconfig | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 797d7f1ad5fe..e53a8dd5c19b 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -209,9 +209,7 @@ config ATH79
select DMA_NONCOHERENT
select GPIOLIB
select PINCTRL
- select HAVE_CLK
select COMMON_CLK
- select CLKDEV_LOOKUP
select IRQ_MIPS_CPU
select SYS_HAS_CPU_MIPS32_R2
select SYS_HAS_EARLY_PRINTK
--
Sent by a computer, using git, on the internet
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 07/10] clk: Allow the common clk framework to be selectable
2020-04-09 6:44 [PATCH v2 00/10] Allow COMMON_CLK to be selectable Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 05/10] MIPS: Remove redundant CLKDEV_LOOKUP selects Stephen Boyd
@ 2020-04-09 6:44 ` Stephen Boyd
2020-04-09 10:53 ` Mark Brown
2020-05-14 19:57 ` Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 09/10] MIPS: Loongson64: Drop asm/clock.h include Stephen Boyd
` (2 subsequent siblings)
4 siblings, 2 replies; 12+ messages in thread
From: Stephen Boyd @ 2020-04-09 6:44 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, Mark Brown, Geert Uytterhoeven,
Mark Salter, Aurelien Jacquiot, Jiaxun Yang, Guan Xuetao,
Russell King, Arnd Bergmann, Yoshinori Sato, Rich Felker,
Thomas Bogendoerfer, linux-mips, linux-c6x-dev, linux-m68k,
linux-arm-kernel, linux-sh
Enable build testing and configuration control of the common clk
framework so that more code coverage and testing can be done on the
common clk framework across various architectures. This also nicely
removes the requirement that architectures must select the framework
when they don't use it in architecture code.
There's one snag with doing this, and that's making sure that randconfig
builds don't select this option when some architecture or platform
implements 'struct clk' outside of the common clk framework. Introduce a
new config option 'HAVE_LEGACY_CLK' to indicate those platforms that
haven't migrated to the common clk framework and therefore shouldn't be
allowed to select this new config option. Also add a note that we hope
one day to remove this config entirely.
Based on a patch by Mark Brown <broonie@kernel.org>.
Cc: Mark Brown <broonie@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: <linux-mips@vger.kernel.org>
Cc: <linux-c6x-dev@linux-c6x.org>
Cc: <linux-m68k@lists.linux-m68k.org>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: <linux-sh@vger.kernel.org>
Link: https://lore.kernel.org/r/1470915049-15249-1-git-send-email-broonie@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
arch/arm/Kconfig | 2 ++
arch/c6x/Kconfig | 1 +
arch/m68k/Kconfig.cpu | 2 +-
arch/mips/Kconfig | 5 +++--
arch/mips/loongson2ef/Kconfig | 2 +-
arch/mips/ralink/Kconfig | 4 ++++
arch/sh/boards/Kconfig | 5 +++++
arch/unicore32/Kconfig | 2 +-
drivers/clk/Kconfig | 17 +++++++++++++----
9 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index eeabdc5a3dd2..0606e1bbd7b6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -364,6 +364,7 @@ config ARCH_EP93XX
select CPU_ARM920T
select GENERIC_CLOCKEVENTS
select GPIOLIB
+ select HAVE_LEGACY_CLK
help
This enables support for the Cirrus EP93xx series of CPUs.
@@ -522,6 +523,7 @@ config ARCH_OMAP1
select GENERIC_IRQ_MULTI_HANDLER
select GPIOLIB
select HAVE_IDE
+ select HAVE_LEGACY_CLK
select IRQ_DOMAIN
select NEED_MACH_IO_H if PCCARD
select NEED_MACH_MEMORY_H
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index e65e8d82442a..6444ebfd06a6 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -11,6 +11,7 @@ config C6X
select ARCH_HAS_SYNC_DMA_FOR_CPU
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
select CLKDEV_LOOKUP
+ select HAVE_LEGACY_CLK
select GENERIC_ATOMIC64
select GENERIC_IRQ_SHOW
select HAVE_ARCH_TRACEHOOK
diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 60ac1cd8b96f..bd2d29c22a10 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -28,7 +28,7 @@ config COLDFIRE
select CPU_HAS_NO_MULDIV64
select GENERIC_CSUM
select GPIOLIB
- select HAVE_CLK
+ select HAVE_LEGACY_CLK
endchoice
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e53a8dd5c19b..fcfbe98e6bb2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -181,7 +181,7 @@ config AR7
select SYS_SUPPORTS_ZBOOT_UART16550
select GPIOLIB
select VLYNQ
- select HAVE_CLK
+ select HAVE_LEGACY_CLK
help
Support for the Texas Instruments AR7 System-on-a-Chip
family: TNETD7100, 7200 and 7300.
@@ -296,9 +296,9 @@ config BCM63XX
select SYS_HAS_EARLY_PRINTK
select SWAP_IO_SPACE
select GPIOLIB
- select HAVE_CLK
select MIPS_L1_CACHE_SHIFT_4
select CLKDEV_LOOKUP
+ select HAVE_LEGACY_CLK
help
Support for BCM63XX based boards
@@ -419,6 +419,7 @@ config LANTIQ
select SWAP_IO_SPACE
select BOOT_RAW
select CLKDEV_LOOKUP
+ select HAVE_LEGACY_CLK
select USE_OF
select PINCTRL
select PINCTRL_LANTIQ
diff --git a/arch/mips/loongson2ef/Kconfig b/arch/mips/loongson2ef/Kconfig
index 595dd48e1e4d..c9ec43afde73 100644
--- a/arch/mips/loongson2ef/Kconfig
+++ b/arch/mips/loongson2ef/Kconfig
@@ -46,7 +46,7 @@ config LEMOTE_MACH2F
select CSRC_R4K if ! MIPS_EXTERNAL_TIMER
select DMA_NONCOHERENT
select GENERIC_ISA_DMA_SUPPORT_BROKEN
- select HAVE_CLK
+ select HAVE_LEGACY_CLK
select FORCE_PCI
select I8259
select IRQ_MIPS_CPU
diff --git a/arch/mips/ralink/Kconfig b/arch/mips/ralink/Kconfig
index 94e9ce994494..1240e6e0c28d 100644
--- a/arch/mips/ralink/Kconfig
+++ b/arch/mips/ralink/Kconfig
@@ -27,18 +27,22 @@ choice
config SOC_RT288X
bool "RT288x"
select MIPS_L1_CACHE_SHIFT_4
+ select HAVE_LEGACY_CLK
select HAVE_PCI
config SOC_RT305X
bool "RT305x"
+ select HAVE_LEGACY_CLK
config SOC_RT3883
bool "RT3883"
+ select HAVE_LEGACY_CLK
select HAVE_PCI
config SOC_MT7620
bool "MT7620/8"
select CPU_MIPSR2_IRQ_VI
+ select HAVE_LEGACY_CLK
select HAVE_PCI
config SOC_MT7621
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index cee24c308337..fb0ca0c1efe1 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -7,6 +7,11 @@ config SOLUTION_ENGINE
config SH_ALPHA_BOARD
bool
+config SH_CUSTOM_CLK
+ def_bool y
+ depends on !SH_DEVICE_TREE
+ select HAVE_LEGACY_CLK
+
config SH_DEVICE_TREE
bool
select OF
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 41fe944005f8..11ba1839d198 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -70,7 +70,7 @@ config ARCH_PUV3
def_bool y
select CPU_UCV2
select GENERIC_CLOCKEVENTS
- select HAVE_CLK
+ select HAVE_LEGACY_CLK
select GPIOLIB
# CONFIGs for ARCH_PUV3
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index bcb257baed06..890bed62196d 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -7,8 +7,18 @@ config CLKDEV_LOOKUP
config HAVE_CLK_PREPARE
bool
-config COMMON_CLK
+config HAVE_LEGACY_CLK # TODO: Remove once all legacy users are migrated
bool
+ select HAVE_CLK
+ help
+ Select this option when the clock API in <linux/clk.h> is implemented
+ by platform/architecture code. This method is deprecated. Modern
+ code should select COMMON_CLK instead and not define a custom
+ 'struct clk'.
+
+menuconfig COMMON_CLK
+ bool "Common Clock Framework"
+ depends on !HAVE_LEGACY_CLK
select HAVE_CLK_PREPARE
select CLKDEV_LOOKUP
select SRCU
@@ -20,8 +30,7 @@ config COMMON_CLK
Architectures utilizing the common struct clk should select
this option.
-menu "Common Clock Framework"
- depends on COMMON_CLK
+if COMMON_CLK
config COMMON_CLK_WM831X
tristate "Clock driver for WM831x/2x PMICs"
@@ -362,4 +371,4 @@ source "drivers/clk/ti/Kconfig"
source "drivers/clk/uniphier/Kconfig"
source "drivers/clk/zynqmp/Kconfig"
-endmenu
+endif
--
Sent by a computer, using git, on the internet
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 09/10] MIPS: Loongson64: Drop asm/clock.h include
2020-04-09 6:44 [PATCH v2 00/10] Allow COMMON_CLK to be selectable Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 05/10] MIPS: Remove redundant CLKDEV_LOOKUP selects Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 07/10] clk: Allow the common clk framework to be selectable Stephen Boyd
@ 2020-04-09 6:44 ` Stephen Boyd
2020-05-14 19:57 ` Stephen Boyd
2020-04-09 8:58 ` [PATCH v2 00/10] Allow COMMON_CLK to be selectable Arnd Bergmann
2020-04-09 9:02 ` [PATCH] mips: loongsoon2ef: remove private clk api Arnd Bergmann
4 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2020-04-09 6:44 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, Jiaxun Yang, Paul Burton, linux-mips,
chenhc
This include isn't used by this file, so just remove it.
Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Paul Burton <paulburton@kernel.org>
Cc: <linux-mips@vger.kernel.org>
Cc: <chenhc@lemote.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
arch/mips/loongson64/smp.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c
index de8e0741ce2d..b48d9c566c5a 100644
--- a/arch/mips/loongson64/smp.c
+++ b/arch/mips/loongson64/smp.c
@@ -14,7 +14,6 @@
#include <linux/kexec.h>
#include <asm/processor.h>
#include <asm/time.h>
-#include <asm/clock.h>
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>
#include <loongson.h>
--
Sent by a computer, using git, on the internet
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 00/10] Allow COMMON_CLK to be selectable
2020-04-09 6:44 [PATCH v2 00/10] Allow COMMON_CLK to be selectable Stephen Boyd
` (2 preceding siblings ...)
2020-04-09 6:44 ` [PATCH v2 09/10] MIPS: Loongson64: Drop asm/clock.h include Stephen Boyd
@ 2020-04-09 8:58 ` Arnd Bergmann
2020-04-09 9:02 ` [PATCH] mips: loongsoon2ef: remove private clk api Arnd Bergmann
4 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2020-04-09 8:58 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, linux-kernel@vger.kernel.org, linux-clk,
Alexander Shiyan, Andreas Färber, Aurelien Jacquiot,
Catalin Marinas, Huacai Chen, Geert Uytterhoeven, Guan Xuetao,
Jiaxun Yang, Linux ARM, linux-c6x-dev, linux-m68k,
open list:BROADCOM NVRAM DRIVER, Linux-sh list, Lubomir Rintel,
Manivannan Sadhasivam, Mark Brown, Mark Salter, Neil Armstrong,
Paul Burton, Paul Walmsley, Rich Felker, Russell King,
Thierry Reding, Thomas Bogendoerfer, Tony Prisk,
moderated list:H8/300 ARCHITECTURE, Ulf Hansson, Will Deacon,
Yoshinori Sato
On Thu, Apr 9, 2020 at 8:44 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> This patch series cleans up a handful of selects that were redundant and
> deletes presumably dead code with the goal of making it possible to add
> kunit tests for the CCF in the future. To do that, we introduce a
> "legacy" clk Kconfig option to mark code that hasn't migrated to the
> common clk framework and then make the COMMON_CLK config option visible
> in the menuconfig as long as that legacy option isn't enabled. I've also
> included a couple patches at the end that may be more controversial but
> helped me consolidate all this logic/code.
>
> I haven't done more than compile test a few configs for arm, arm64,
> h8300, and mips. More testing is welcome.
>
> The plan is that I'll just merge the whole pile through the clk tree. If
> the first five patches or the last three patches are better going
> through another tree like arm-soc or architecture trees that's fine too,
> but there are potential conflicts between trees so maybe it's better to
> just leave it all in one tree.
>
> Changes from v1:
> * Fixed MIPS ralink build problem pointed out by Arnd
> * Fixed meson mx sdio build due to bad Kconfig exposed by this change
> * Picked up acks
Whole series
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
I also made a patch to completely remove the private clk implementation
for mips/loongson2f, but it obviously clashes with your series at the moment.
I'll send you what I have today and you can decide if you want to
add it to your series after it gets an Ack from the maintainers, or I'll
send it separately later.
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] mips: loongsoon2ef: remove private clk api
2020-04-09 6:44 [PATCH v2 00/10] Allow COMMON_CLK to be selectable Stephen Boyd
` (3 preceding siblings ...)
2020-04-09 8:58 ` [PATCH v2 00/10] Allow COMMON_CLK to be selectable Arnd Bergmann
@ 2020-04-09 9:02 ` Arnd Bergmann
2020-04-13 21:24 ` Philippe Mathieu-Daudé
2020-04-16 16:40 ` Thomas Bogendoerfer
4 siblings, 2 replies; 12+ messages in thread
From: Arnd Bergmann @ 2020-04-09 9:02 UTC (permalink / raw)
To: sboyd, jiaxun.yang, linux-mips
Cc: linux-kernel, linux-clk, chenhc, Paul Burton, Thomas Bogendoerfer,
mturquette, Arnd Bergmann
As platforms are moving to COMMON_CLK in general, loongson2ef
stuck out as something that has a private implementation but
does not actually use it except for setting the frequency of
the CPU itself from the loongson2_cpufreq driver.
Change that driver to call the register setting function directly
and remove the rest of the stub implementation.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/mips/include/asm/clock.h | 49 ----------
.../include/asm/mach-loongson2ef/loongson.h | 1 +
arch/mips/loongson2ef/Kconfig | 1 -
arch/mips/loongson2ef/lemote-2f/clock.c | 98 +------------------
arch/mips/loongson64/smp.c | 1 -
drivers/cpufreq/loongson2_cpufreq.c | 22 +----
6 files changed, 8 insertions(+), 164 deletions(-)
delete mode 100644 arch/mips/include/asm/clock.h
diff --git a/arch/mips/include/asm/clock.h b/arch/mips/include/asm/clock.h
deleted file mode 100644
index 5a8f96ebe5fa..000000000000
--- a/arch/mips/include/asm/clock.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __ASM_MIPS_CLOCK_H
-#define __ASM_MIPS_CLOCK_H
-
-#include <linux/kref.h>
-#include <linux/list.h>
-#include <linux/seq_file.h>
-#include <linux/clk.h>
-
-struct clk;
-
-struct clk_ops {
- void (*init) (struct clk *clk);
- void (*enable) (struct clk *clk);
- void (*disable) (struct clk *clk);
- void (*recalc) (struct clk *clk);
- int (*set_rate) (struct clk *clk, unsigned long rate, int algo_id);
- long (*round_rate) (struct clk *clk, unsigned long rate);
-};
-
-struct clk {
- struct list_head node;
- const char *name;
- int id;
- struct module *owner;
-
- struct clk *parent;
- struct clk_ops *ops;
-
- struct kref kref;
-
- unsigned long rate;
- unsigned long flags;
-};
-
-#define CLK_ALWAYS_ENABLED (1 << 0)
-#define CLK_RATE_PROPAGATES (1 << 1)
-
-int clk_init(void);
-
-int __clk_enable(struct clk *);
-void __clk_disable(struct clk *);
-
-void clk_recalc_rate(struct clk *);
-
-int clk_register(struct clk *);
-void clk_unregister(struct clk *);
-
-#endif /* __ASM_MIPS_CLOCK_H */
diff --git a/arch/mips/include/asm/mach-loongson2ef/loongson.h b/arch/mips/include/asm/mach-loongson2ef/loongson.h
index 5008af0a1a19..57e571128489 100644
--- a/arch/mips/include/asm/mach-loongson2ef/loongson.h
+++ b/arch/mips/include/asm/mach-loongson2ef/loongson.h
@@ -244,6 +244,7 @@ static inline void do_perfcnt_IRQ(void)
#ifdef CONFIG_CPU_SUPPORTS_CPUFREQ
#include <linux/cpufreq.h>
extern struct cpufreq_frequency_table loongson2_clockmod_table[];
+extern int loongson2_cpu_set_rate(unsigned long rate_khz);
#endif
/*
diff --git a/arch/mips/loongson2ef/Kconfig b/arch/mips/loongson2ef/Kconfig
index 595dd48e1e4d..96dc6eba4310 100644
--- a/arch/mips/loongson2ef/Kconfig
+++ b/arch/mips/loongson2ef/Kconfig
@@ -46,7 +46,6 @@ config LEMOTE_MACH2F
select CSRC_R4K if ! MIPS_EXTERNAL_TIMER
select DMA_NONCOHERENT
select GENERIC_ISA_DMA_SUPPORT_BROKEN
- select HAVE_CLK
select FORCE_PCI
select I8259
select IRQ_MIPS_CPU
diff --git a/arch/mips/loongson2ef/lemote-2f/clock.c b/arch/mips/loongson2ef/lemote-2f/clock.c
index 414f282c8ab5..850b6b9f8f15 100644
--- a/arch/mips/loongson2ef/lemote-2f/clock.c
+++ b/arch/mips/loongson2ef/lemote-2f/clock.c
@@ -6,22 +6,12 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
-#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <linux/errno.h>
#include <linux/export.h>
-#include <linux/list.h>
-#include <linux/mutex.h>
-#include <linux/spinlock.h>
-#include <asm/clock.h>
#include <asm/mach-loongson2ef/loongson.h>
-static LIST_HEAD(clock_list);
-static DEFINE_SPINLOCK(clock_lock);
-static DEFINE_MUTEX(clock_list_sem);
-
-/* Minimum CLK support */
enum {
DC_ZERO, DC_25PT = 2, DC_37PT, DC_50PT, DC_62PT, DC_75PT,
DC_87PT, DC_DISABLE, DC_RESV
@@ -41,103 +31,21 @@ struct cpufreq_frequency_table loongson2_clockmod_table[] = {
};
EXPORT_SYMBOL_GPL(loongson2_clockmod_table);
-static struct clk cpu_clk = {
- .name = "cpu_clk",
- .flags = CLK_ALWAYS_ENABLED | CLK_RATE_PROPAGATES,
- .rate = 800000000,
-};
-
-struct clk *clk_get(struct device *dev, const char *id)
-{
- return &cpu_clk;
-}
-EXPORT_SYMBOL(clk_get);
-
-static void propagate_rate(struct clk *clk)
-{
- struct clk *clkp;
-
- list_for_each_entry(clkp, &clock_list, node) {
- if (likely(clkp->parent != clk))
- continue;
- if (likely(clkp->ops && clkp->ops->recalc))
- clkp->ops->recalc(clkp);
- if (unlikely(clkp->flags & CLK_RATE_PROPAGATES))
- propagate_rate(clkp);
- }
-}
-
-int clk_enable(struct clk *clk)
-{
- return 0;
-}
-EXPORT_SYMBOL(clk_enable);
-
-void clk_disable(struct clk *clk)
+int loongson2_cpu_set_rate(unsigned long rate_khz)
{
-}
-EXPORT_SYMBOL(clk_disable);
-
-unsigned long clk_get_rate(struct clk *clk)
-{
- if (!clk)
- return 0;
-
- return (unsigned long)clk->rate;
-}
-EXPORT_SYMBOL(clk_get_rate);
-
-void clk_put(struct clk *clk)
-{
-}
-EXPORT_SYMBOL(clk_put);
-
-int clk_set_rate(struct clk *clk, unsigned long rate)
-{
- unsigned int rate_khz = rate / 1000;
struct cpufreq_frequency_table *pos;
- int ret = 0;
int regval;
- if (likely(clk->ops && clk->ops->set_rate)) {
- unsigned long flags;
-
- spin_lock_irqsave(&clock_lock, flags);
- ret = clk->ops->set_rate(clk, rate, 0);
- spin_unlock_irqrestore(&clock_lock, flags);
- }
-
- if (unlikely(clk->flags & CLK_RATE_PROPAGATES))
- propagate_rate(clk);
-
cpufreq_for_each_valid_entry(pos, loongson2_clockmod_table)
if (rate_khz == pos->frequency)
break;
if (rate_khz != pos->frequency)
return -ENOTSUPP;
- clk->rate = rate;
-
regval = readl(LOONGSON_CHIPCFG);
regval = (regval & ~0x7) | (pos->driver_data - 1);
writel(regval, LOONGSON_CHIPCFG);
- return ret;
-}
-EXPORT_SYMBOL_GPL(clk_set_rate);
-
-long clk_round_rate(struct clk *clk, unsigned long rate)
-{
- if (likely(clk->ops && clk->ops->round_rate)) {
- unsigned long flags, rounded;
-
- spin_lock_irqsave(&clock_lock, flags);
- rounded = clk->ops->round_rate(clk, rate);
- spin_unlock_irqrestore(&clock_lock, flags);
-
- return rounded;
- }
-
- return rate;
+ return 0;
}
-EXPORT_SYMBOL_GPL(clk_round_rate);
+EXPORT_SYMBOL_GPL(loongson2_cpu_set_rate);
diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c
index e1fe8bbb377d..e744e1bee49e 100644
--- a/arch/mips/loongson64/smp.c
+++ b/arch/mips/loongson64/smp.c
@@ -15,7 +15,6 @@
#include <linux/kexec.h>
#include <asm/processor.h>
#include <asm/time.h>
-#include <asm/clock.h>
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>
#include <loongson.h>
diff --git a/drivers/cpufreq/loongson2_cpufreq.c b/drivers/cpufreq/loongson2_cpufreq.c
index 909f40fbcde2..d05e761d9572 100644
--- a/drivers/cpufreq/loongson2_cpufreq.c
+++ b/drivers/cpufreq/loongson2_cpufreq.c
@@ -20,7 +20,6 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
-#include <asm/clock.h>
#include <asm/idle.h>
#include <asm/mach-loongson2ef/loongson.h>
@@ -58,29 +57,20 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
loongson2_clockmod_table[index].driver_data) / 8;
/* setting the cpu frequency */
- clk_set_rate(policy->clk, freq * 1000);
+ loongson2_cpu_set_rate(freq);
return 0;
}
static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
- struct clk *cpuclk;
int i;
unsigned long rate;
int ret;
- cpuclk = clk_get(NULL, "cpu_clk");
- if (IS_ERR(cpuclk)) {
- pr_err("couldn't get CPU clk\n");
- return PTR_ERR(cpuclk);
- }
-
rate = cpu_clock_freq / 1000;
- if (!rate) {
- clk_put(cpuclk);
+ if (!rate)
return -EINVAL;
- }
/* clock table init */
for (i = 2;
@@ -88,20 +78,16 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
i++)
loongson2_clockmod_table[i].frequency = (rate * i) / 8;
- ret = clk_set_rate(cpuclk, rate * 1000);
- if (ret) {
- clk_put(cpuclk);
+ ret = loongson2_cpu_set_rate(rate);
+ if (ret)
return ret;
- }
- policy->clk = cpuclk;
cpufreq_generic_init(policy, &loongson2_clockmod_table[0], 0);
return 0;
}
static int loongson2_cpufreq_exit(struct cpufreq_policy *policy)
{
- clk_put(policy->clk);
return 0;
}
--
2.26.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 07/10] clk: Allow the common clk framework to be selectable
2020-04-09 6:44 ` [PATCH v2 07/10] clk: Allow the common clk framework to be selectable Stephen Boyd
@ 2020-04-09 10:53 ` Mark Brown
2020-05-14 19:57 ` Stephen Boyd
1 sibling, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-04-09 10:53 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, linux-kernel, linux-clk, Geert Uytterhoeven,
Mark Salter, Aurelien Jacquiot, Jiaxun Yang, Guan Xuetao,
Russell King, Arnd Bergmann, Yoshinori Sato, Rich Felker,
Thomas Bogendoerfer, linux-mips, linux-c6x-dev, linux-m68k,
linux-arm-kernel, linux-sh
[-- Attachment #1: Type: text/plain, Size: 432 bytes --]
On Wed, Apr 08, 2020 at 11:44:13PM -0700, Stephen Boyd wrote:
> Enable build testing and configuration control of the common clk
> framework so that more code coverage and testing can be done on the
> common clk framework across various architectures. This also nicely
> removes the requirement that architectures must select the framework
> when they don't use it in architecture code.
Reviwed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mips: loongsoon2ef: remove private clk api
2020-04-09 9:02 ` [PATCH] mips: loongsoon2ef: remove private clk api Arnd Bergmann
@ 2020-04-13 21:24 ` Philippe Mathieu-Daudé
2020-04-16 16:40 ` Thomas Bogendoerfer
1 sibling, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-04-13 21:24 UTC (permalink / raw)
To: Arnd Bergmann, sboyd, jiaxun.yang, linux-mips
Cc: linux-kernel, linux-clk, chenhc, Paul Burton, Thomas Bogendoerfer,
mturquette
On 4/9/20 11:02 AM, Arnd Bergmann wrote:
> As platforms are moving to COMMON_CLK in general, loongson2ef
> stuck out as something that has a private implementation but
> does not actually use it except for setting the frequency of
> the CPU itself from the loongson2_cpufreq driver.
>
> Change that driver to call the register setting function directly
> and remove the rest of the stub implementation.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> arch/mips/include/asm/clock.h | 49 ----------
> .../include/asm/mach-loongson2ef/loongson.h | 1 +
> arch/mips/loongson2ef/Kconfig | 1 -
> arch/mips/loongson2ef/lemote-2f/clock.c | 98 +------------------
> arch/mips/loongson64/smp.c | 1 -
> drivers/cpufreq/loongson2_cpufreq.c | 22 +----
> 6 files changed, 8 insertions(+), 164 deletions(-)
> delete mode 100644 arch/mips/include/asm/clock.h
>
> diff --git a/arch/mips/include/asm/clock.h b/arch/mips/include/asm/clock.h
> deleted file mode 100644
> index 5a8f96ebe5fa..000000000000
> --- a/arch/mips/include/asm/clock.h
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef __ASM_MIPS_CLOCK_H
> -#define __ASM_MIPS_CLOCK_H
> -
> -#include <linux/kref.h>
> -#include <linux/list.h>
> -#include <linux/seq_file.h>
> -#include <linux/clk.h>
> -
> -struct clk;
> -
> -struct clk_ops {
> - void (*init) (struct clk *clk);
> - void (*enable) (struct clk *clk);
> - void (*disable) (struct clk *clk);
> - void (*recalc) (struct clk *clk);
> - int (*set_rate) (struct clk *clk, unsigned long rate, int algo_id);
> - long (*round_rate) (struct clk *clk, unsigned long rate);
> -};
> -
> -struct clk {
> - struct list_head node;
> - const char *name;
> - int id;
> - struct module *owner;
> -
> - struct clk *parent;
> - struct clk_ops *ops;
> -
> - struct kref kref;
> -
> - unsigned long rate;
> - unsigned long flags;
> -};
> -
> -#define CLK_ALWAYS_ENABLED (1 << 0)
> -#define CLK_RATE_PROPAGATES (1 << 1)
> -
> -int clk_init(void);
> -
> -int __clk_enable(struct clk *);
> -void __clk_disable(struct clk *);
> -
> -void clk_recalc_rate(struct clk *);
> -
> -int clk_register(struct clk *);
> -void clk_unregister(struct clk *);
> -
> -#endif /* __ASM_MIPS_CLOCK_H */
> diff --git a/arch/mips/include/asm/mach-loongson2ef/loongson.h b/arch/mips/include/asm/mach-loongson2ef/loongson.h
> index 5008af0a1a19..57e571128489 100644
> --- a/arch/mips/include/asm/mach-loongson2ef/loongson.h
> +++ b/arch/mips/include/asm/mach-loongson2ef/loongson.h
> @@ -244,6 +244,7 @@ static inline void do_perfcnt_IRQ(void)
> #ifdef CONFIG_CPU_SUPPORTS_CPUFREQ
> #include <linux/cpufreq.h>
> extern struct cpufreq_frequency_table loongson2_clockmod_table[];
> +extern int loongson2_cpu_set_rate(unsigned long rate_khz);
> #endif
>
> /*
> diff --git a/arch/mips/loongson2ef/Kconfig b/arch/mips/loongson2ef/Kconfig
> index 595dd48e1e4d..96dc6eba4310 100644
> --- a/arch/mips/loongson2ef/Kconfig
> +++ b/arch/mips/loongson2ef/Kconfig
> @@ -46,7 +46,6 @@ config LEMOTE_MACH2F
> select CSRC_R4K if ! MIPS_EXTERNAL_TIMER
> select DMA_NONCOHERENT
> select GENERIC_ISA_DMA_SUPPORT_BROKEN
> - select HAVE_CLK
> select FORCE_PCI
> select I8259
> select IRQ_MIPS_CPU
> diff --git a/arch/mips/loongson2ef/lemote-2f/clock.c b/arch/mips/loongson2ef/lemote-2f/clock.c
> index 414f282c8ab5..850b6b9f8f15 100644
> --- a/arch/mips/loongson2ef/lemote-2f/clock.c
> +++ b/arch/mips/loongson2ef/lemote-2f/clock.c
> @@ -6,22 +6,12 @@
> * License. See the file "COPYING" in the main directory of this archive
> * for more details.
> */
> -#include <linux/clk.h>
> #include <linux/cpufreq.h>
> #include <linux/errno.h>
> #include <linux/export.h>
> -#include <linux/list.h>
> -#include <linux/mutex.h>
> -#include <linux/spinlock.h>
>
> -#include <asm/clock.h>
> #include <asm/mach-loongson2ef/loongson.h>
>
> -static LIST_HEAD(clock_list);
> -static DEFINE_SPINLOCK(clock_lock);
> -static DEFINE_MUTEX(clock_list_sem);
> -
> -/* Minimum CLK support */
> enum {
> DC_ZERO, DC_25PT = 2, DC_37PT, DC_50PT, DC_62PT, DC_75PT,
> DC_87PT, DC_DISABLE, DC_RESV
> @@ -41,103 +31,21 @@ struct cpufreq_frequency_table loongson2_clockmod_table[] = {
> };
> EXPORT_SYMBOL_GPL(loongson2_clockmod_table);
>
> -static struct clk cpu_clk = {
> - .name = "cpu_clk",
> - .flags = CLK_ALWAYS_ENABLED | CLK_RATE_PROPAGATES,
> - .rate = 800000000,
> -};
> -
> -struct clk *clk_get(struct device *dev, const char *id)
> -{
> - return &cpu_clk;
> -}
> -EXPORT_SYMBOL(clk_get);
> -
> -static void propagate_rate(struct clk *clk)
> -{
> - struct clk *clkp;
> -
> - list_for_each_entry(clkp, &clock_list, node) {
> - if (likely(clkp->parent != clk))
> - continue;
> - if (likely(clkp->ops && clkp->ops->recalc))
> - clkp->ops->recalc(clkp);
> - if (unlikely(clkp->flags & CLK_RATE_PROPAGATES))
> - propagate_rate(clkp);
> - }
> -}
> -
> -int clk_enable(struct clk *clk)
> -{
> - return 0;
> -}
> -EXPORT_SYMBOL(clk_enable);
> -
> -void clk_disable(struct clk *clk)
> +int loongson2_cpu_set_rate(unsigned long rate_khz)
> {
> -}
> -EXPORT_SYMBOL(clk_disable);
> -
> -unsigned long clk_get_rate(struct clk *clk)
> -{
> - if (!clk)
> - return 0;
> -
> - return (unsigned long)clk->rate;
> -}
> -EXPORT_SYMBOL(clk_get_rate);
> -
> -void clk_put(struct clk *clk)
> -{
> -}
> -EXPORT_SYMBOL(clk_put);
> -
> -int clk_set_rate(struct clk *clk, unsigned long rate)
> -{
> - unsigned int rate_khz = rate / 1000;
> struct cpufreq_frequency_table *pos;
> - int ret = 0;
> int regval;
>
> - if (likely(clk->ops && clk->ops->set_rate)) {
> - unsigned long flags;
> -
> - spin_lock_irqsave(&clock_lock, flags);
> - ret = clk->ops->set_rate(clk, rate, 0);
> - spin_unlock_irqrestore(&clock_lock, flags);
> - }
> -
> - if (unlikely(clk->flags & CLK_RATE_PROPAGATES))
> - propagate_rate(clk);
> -
> cpufreq_for_each_valid_entry(pos, loongson2_clockmod_table)
> if (rate_khz == pos->frequency)
> break;
> if (rate_khz != pos->frequency)
> return -ENOTSUPP;
>
> - clk->rate = rate;
> -
> regval = readl(LOONGSON_CHIPCFG);
> regval = (regval & ~0x7) | (pos->driver_data - 1);
> writel(regval, LOONGSON_CHIPCFG);
>
> - return ret;
> -}
> -EXPORT_SYMBOL_GPL(clk_set_rate);
> -
> -long clk_round_rate(struct clk *clk, unsigned long rate)
> -{
> - if (likely(clk->ops && clk->ops->round_rate)) {
> - unsigned long flags, rounded;
> -
> - spin_lock_irqsave(&clock_lock, flags);
> - rounded = clk->ops->round_rate(clk, rate);
> - spin_unlock_irqrestore(&clock_lock, flags);
> -
> - return rounded;
> - }
> -
> - return rate;
> + return 0;
> }
> -EXPORT_SYMBOL_GPL(clk_round_rate);
> +EXPORT_SYMBOL_GPL(loongson2_cpu_set_rate);
> diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c
> index e1fe8bbb377d..e744e1bee49e 100644
> --- a/arch/mips/loongson64/smp.c
> +++ b/arch/mips/loongson64/smp.c
> @@ -15,7 +15,6 @@
> #include <linux/kexec.h>
> #include <asm/processor.h>
> #include <asm/time.h>
> -#include <asm/clock.h>
> #include <asm/tlbflush.h>
> #include <asm/cacheflush.h>
> #include <loongson.h>
> diff --git a/drivers/cpufreq/loongson2_cpufreq.c b/drivers/cpufreq/loongson2_cpufreq.c
> index 909f40fbcde2..d05e761d9572 100644
> --- a/drivers/cpufreq/loongson2_cpufreq.c
> +++ b/drivers/cpufreq/loongson2_cpufreq.c
> @@ -20,7 +20,6 @@
> #include <linux/delay.h>
> #include <linux/platform_device.h>
>
> -#include <asm/clock.h>
> #include <asm/idle.h>
>
> #include <asm/mach-loongson2ef/loongson.h>
> @@ -58,29 +57,20 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
> loongson2_clockmod_table[index].driver_data) / 8;
>
> /* setting the cpu frequency */
> - clk_set_rate(policy->clk, freq * 1000);
> + loongson2_cpu_set_rate(freq);
>
> return 0;
> }
>
> static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
> {
> - struct clk *cpuclk;
> int i;
> unsigned long rate;
> int ret;
>
> - cpuclk = clk_get(NULL, "cpu_clk");
> - if (IS_ERR(cpuclk)) {
> - pr_err("couldn't get CPU clk\n");
> - return PTR_ERR(cpuclk);
> - }
> -
> rate = cpu_clock_freq / 1000;
> - if (!rate) {
> - clk_put(cpuclk);
> + if (!rate)
> return -EINVAL;
> - }
>
> /* clock table init */
> for (i = 2;
> @@ -88,20 +78,16 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
> i++)
> loongson2_clockmod_table[i].frequency = (rate * i) / 8;
>
> - ret = clk_set_rate(cpuclk, rate * 1000);
> - if (ret) {
> - clk_put(cpuclk);
> + ret = loongson2_cpu_set_rate(rate);
> + if (ret)
> return ret;
> - }
>
> - policy->clk = cpuclk;
> cpufreq_generic_init(policy, &loongson2_clockmod_table[0], 0);
> return 0;
> }
>
> static int loongson2_cpufreq_exit(struct cpufreq_policy *policy)
> {
> - clk_put(policy->clk);
> return 0;
> }
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mips: loongsoon2ef: remove private clk api
2020-04-09 9:02 ` [PATCH] mips: loongsoon2ef: remove private clk api Arnd Bergmann
2020-04-13 21:24 ` Philippe Mathieu-Daudé
@ 2020-04-16 16:40 ` Thomas Bogendoerfer
1 sibling, 0 replies; 12+ messages in thread
From: Thomas Bogendoerfer @ 2020-04-16 16:40 UTC (permalink / raw)
To: Arnd Bergmann
Cc: sboyd, jiaxun.yang, linux-mips, linux-kernel, linux-clk, chenhc,
Paul Burton, mturquette
On Thu, Apr 09, 2020 at 11:02:28AM +0200, Arnd Bergmann wrote:
> As platforms are moving to COMMON_CLK in general, loongson2ef
> stuck out as something that has a private implementation but
> does not actually use it except for setting the frequency of
> the CPU itself from the loongson2_cpufreq driver.
>
> Change that driver to call the register setting function directly
> and remove the rest of the stub implementation.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/mips/include/asm/clock.h | 49 ----------
> .../include/asm/mach-loongson2ef/loongson.h | 1 +
> arch/mips/loongson2ef/Kconfig | 1 -
> arch/mips/loongson2ef/lemote-2f/clock.c | 98 +------------------
> arch/mips/loongson64/smp.c | 1 -
> drivers/cpufreq/loongson2_cpufreq.c | 22 +----
> 6 files changed, 8 insertions(+), 164 deletions(-)
> delete mode 100644 arch/mips/include/asm/clock.h
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 05/10] MIPS: Remove redundant CLKDEV_LOOKUP selects
2020-04-09 6:44 ` [PATCH v2 05/10] MIPS: Remove redundant CLKDEV_LOOKUP selects Stephen Boyd
@ 2020-05-14 19:56 ` Stephen Boyd
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2020-05-14 19:56 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, Thomas Bogendoerfer, linux-mips
Quoting Stephen Boyd (2020-04-08 23:44:11)
> The ATH79 config selects COMMON_CLK already, and the COMMON_CLK config
> option already selects CLKDEV_LOOKUP, and CLKDEV_LOOKUP already selects
> HAVE_CLK so it's redundant to have these selected again.
>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: <linux-mips@vger.kernel.org>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 07/10] clk: Allow the common clk framework to be selectable
2020-04-09 6:44 ` [PATCH v2 07/10] clk: Allow the common clk framework to be selectable Stephen Boyd
2020-04-09 10:53 ` Mark Brown
@ 2020-05-14 19:57 ` Stephen Boyd
1 sibling, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2020-05-14 19:57 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, Mark Brown, Geert Uytterhoeven,
Mark Salter, Aurelien Jacquiot, Jiaxun Yang, Guan Xuetao,
Russell King, Arnd Bergmann, Yoshinori Sato, Rich Felker,
Thomas Bogendoerfer, linux-mips, linux-c6x-dev, linux-m68k,
linux-arm-kernel, linux-sh
Quoting Stephen Boyd (2020-04-08 23:44:13)
> Enable build testing and configuration control of the common clk
> framework so that more code coverage and testing can be done on the
> common clk framework across various architectures. This also nicely
> removes the requirement that architectures must select the framework
> when they don't use it in architecture code.
>
> There's one snag with doing this, and that's making sure that randconfig
> builds don't select this option when some architecture or platform
> implements 'struct clk' outside of the common clk framework. Introduce a
> new config option 'HAVE_LEGACY_CLK' to indicate those platforms that
> haven't migrated to the common clk framework and therefore shouldn't be
> allowed to select this new config option. Also add a note that we hope
> one day to remove this config entirely.
>
> Based on a patch by Mark Brown <broonie@kernel.org>.
>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Mark Salter <msalter@redhat.com>
> Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Cc: Guan Xuetao <gxt@pku.edu.cn>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: <linux-mips@vger.kernel.org>
> Cc: <linux-c6x-dev@linux-c6x.org>
> Cc: <linux-m68k@lists.linux-m68k.org>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Cc: <linux-sh@vger.kernel.org>
> Link: https://lore.kernel.org/r/1470915049-15249-1-git-send-email-broonie@kernel.org
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 09/10] MIPS: Loongson64: Drop asm/clock.h include
2020-04-09 6:44 ` [PATCH v2 09/10] MIPS: Loongson64: Drop asm/clock.h include Stephen Boyd
@ 2020-05-14 19:57 ` Stephen Boyd
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2020-05-14 19:57 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, Jiaxun Yang, Paul Burton, linux-mips,
chenhc
Quoting Stephen Boyd (2020-04-08 23:44:15)
> This include isn't used by this file, so just remove it.
>
> Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: <linux-mips@vger.kernel.org>
> Cc: <chenhc@lemote.com>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-05-14 19:57 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-09 6:44 [PATCH v2 00/10] Allow COMMON_CLK to be selectable Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 05/10] MIPS: Remove redundant CLKDEV_LOOKUP selects Stephen Boyd
2020-05-14 19:56 ` Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 07/10] clk: Allow the common clk framework to be selectable Stephen Boyd
2020-04-09 10:53 ` Mark Brown
2020-05-14 19:57 ` Stephen Boyd
2020-04-09 6:44 ` [PATCH v2 09/10] MIPS: Loongson64: Drop asm/clock.h include Stephen Boyd
2020-05-14 19:57 ` Stephen Boyd
2020-04-09 8:58 ` [PATCH v2 00/10] Allow COMMON_CLK to be selectable Arnd Bergmann
2020-04-09 9:02 ` [PATCH] mips: loongsoon2ef: remove private clk api Arnd Bergmann
2020-04-13 21:24 ` Philippe Mathieu-Daudé
2020-04-16 16:40 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).