Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] ARM: configs: stm32: Enable ARM_MPU
From: Alexandre Torgue @ 2017-12-12 18:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1513101746-18030-1-git-send-email-alexandre.torgue@st.com>

STM32 MCUs embed a Memory Protection Unit. Enabling this setting will
allow the Kernel to configure the MPU according to devicetree.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
index bb358ff..e642bdf9 100644
--- a/arch/arm/configs/stm32_defconfig
+++ b/arch/arm/configs/stm32_defconfig
@@ -24,6 +24,7 @@ CONFIG_SET_MEM_PARAM=y
 CONFIG_DRAM_BASE=0x90000000
 CONFIG_FLASH_MEM_BASE=0x08000000
 CONFIG_FLASH_SIZE=0x00200000
+CONFIG_ARM_MPU=y
 CONFIG_PREEMPT=y
 # CONFIG_ATAGS is not set
 CONFIG_ZBOOT_ROM_TEXT=0x0
-- 
2.7.4

^ permalink raw reply related

* [PATCH 1/3] ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
From: Alexandre Torgue @ 2017-12-12 18:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1513101746-18030-1-git-send-email-alexandre.torgue@st.com>

On cortex-M7 MCU, DMA have to use a non cache-able memory area. For this
reason a dedicated memory pool is created for DMA.
This patch creates a DMA memory pool of 1MB of each STM32 MCU which
embeds a cortex-M7 expect stm32f746-disco. Indeed, as stm32f746-disco has
only a 8MB SDRAM and it's tricky to reduce memory used by Kernel.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>

diff --git a/arch/arm/boot/dts/stm32746g-eval.dts b/arch/arm/boot/dts/stm32746g-eval.dts
index 2d4e717..3f52a7b 100644
--- a/arch/arm/boot/dts/stm32746g-eval.dts
+++ b/arch/arm/boot/dts/stm32746g-eval.dts
@@ -57,6 +57,19 @@
 		reg = <0xc0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
diff --git a/arch/arm/boot/dts/stm32f769-disco.dts b/arch/arm/boot/dts/stm32f769-disco.dts
index 4463ca1..08699a2 100644
--- a/arch/arm/boot/dts/stm32f769-disco.dts
+++ b/arch/arm/boot/dts/stm32f769-disco.dts
@@ -57,6 +57,19 @@
 		reg = <0xC0000000 0x1000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc0f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
diff --git a/arch/arm/boot/dts/stm32h743i-disco.dts b/arch/arm/boot/dts/stm32h743i-disco.dts
index 79e841d..104545a 100644
--- a/arch/arm/boot/dts/stm32h743i-disco.dts
+++ b/arch/arm/boot/dts/stm32h743i-disco.dts
@@ -57,6 +57,19 @@
 		reg = <0xd0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart2;
 	};
diff --git a/arch/arm/boot/dts/stm32h743i-eval.dts b/arch/arm/boot/dts/stm32h743i-eval.dts
index 9f0e72c..5bd4b16 100644
--- a/arch/arm/boot/dts/stm32h743i-eval.dts
+++ b/arch/arm/boot/dts/stm32h743i-eval.dts
@@ -57,6 +57,19 @@
 		reg = <0xd0000000 0x2000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		linux,dma {
+			compatible = "shared-dma-pool";
+			linux,dma-default;
+			no-map;
+			reg = <0xc1f00000 0x100000>;
+		};
+	};
+
 	aliases {
 		serial0 = &usart1;
 	};
-- 
2.7.4

^ permalink raw reply related

* [PATCH 0/3] Enable DMA on STM32 MCU based on cortex-M7
From: Alexandre Torgue @ 2017-12-12 18:02 UTC (permalink / raw)
  To: linux-arm-kernel

This series enable DMA on several STM32 MCU based on cortex-M7.
To make it possible, a dedicated dma pool memory area has to be
created. This patchset activate also ARM_MPU flag which will configure 
MPU (Memory Protection Unit) according to devicetree information (mem
and dma-pool). Note that on cortex-M7 DMA has to use a NO cache-able 
memory region.

Regards
Alex


Alexandre Torgue (3):
  ARM: dts: stm32: add DMA memory pool on MCU which embed a cortex-M7
  ARM: configs: stm32: Enable ARM_MPU
  ARM: dts: stm32: enable dma on MCU which embed a cortex-M7

 arch/arm/boot/dts/stm32746g-eval.dts   | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32f769-disco.dts  | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32h743i-disco.dts | 21 +++++++++++++++++++++
 arch/arm/boot/dts/stm32h743i-eval.dts  | 21 +++++++++++++++++++++
 arch/arm/configs/stm32_defconfig       |  1 +
 5 files changed, 85 insertions(+)

-- 
2.7.4

^ permalink raw reply

* [PATCH v2] ARM: dts: exynos: Enable Mixer node for Exynos5800 Peach Pi machine
From: Krzysztof Kozlowski @ 2017-12-12 17:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171212074208.30753-1-javierm@redhat.com>

On Tue, Dec 12, 2017 at 08:42:08AM +0100, Javier Martinez Canillas wrote:
> Commit 1cb686c08d12 ("ARM: dts: exynos: Add status property to Exynos 542x
> Mixer nodes") disabled the Mixer node by default in the DTSI and enabled
> for each Exynos 542x DTS. But unfortunately it missed to enable it for the
> Exynos5800 Peach Pi machine, since the 5800 is also an 542x SoC variant.
> 
> Fixes: 1cb686c08d12 ("ARM: dts: exynos: Add status property to Exynos 542x Mixer nodes")
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> 
> ---
> 
> Changes in v2:
> - Remove RFT tag.
> - Add Marek's Acked-by tag.
> - Add fixes tag.
> 
>  arch/arm/boot/dts/exynos5800-peach-pi.dts | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Thanks, applied for current cycle (fixes).

Best regards,
Krzysztof

^ permalink raw reply

* [PATCH 1/2] cpufreq: ARM: sort the Kconfig menu
From: Randy Dunlap @ 2017-12-12 17:45 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171212165419.752-2-gregory.clement@free-electrons.com>

On 12/12/2017 08:54 AM, Gregory CLEMENT wrote:
> Group all the related big LITTLE configuration together and sort the
> other entries in alphabetic order.
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  drivers/cpufreq/Kconfig.arm | 82 ++++++++++++++++++++++-----------------------
>  1 file changed, 41 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index bdce4488ded1..0baf43837b51 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -2,6 +2,23 @@
>  # ARM CPU Frequency scaling drivers
>  #
>  
> +config ACPI_CPPC_CPUFREQ
> +	tristate "CPUFreq driver based on the ACPI CPPC spec"
> +	depends on ACPI_PROCESSOR
> +	select ACPI_CPPC_LIB
> +	default n

Drop "default n" since that is the default default.

> +	help
> +	  This adds a CPUFreq driver which uses CPPC methods
> +	  as described in the ACPIv5.1 spec. CPPC stands for
> +	  Collaborative Processor Performance Controls. It
> +	  is based on an abstract continuous scale of CPU
> +	  performance values which allows the remote power
> +	  processor to flexibly optimize for power and
> +	  performance. CPPC relies on power management firmware
> +	  support for its operation.
> +
> +	  If in doubt, say N.
> +
>  # big LITTLE core layer and glue drivers
>  config ARM_BIG_LITTLE_CPUFREQ
>  	tristate "Generic ARM big LITTLE CPUfreq driver"
> @@ -12,6 +29,30 @@ config ARM_BIG_LITTLE_CPUFREQ
>  	help
>  	  This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
>  
> +config ARM_DT_BL_CPUFREQ
> +	tristate "Generic probing via DT for ARM big LITTLE CPUfreq driver"
> +	depends on ARM_BIG_LITTLE_CPUFREQ && OF
> +	help
> +	  This enables probing via DT for Generic CPUfreq driver for ARM
> +	  big.LITTLE platform. This gets frequency tables from DT.
> +
> +config ARM_SCPI_CPUFREQ
> +        tristate "SCPI based CPUfreq driver"
> +	depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI
> +        help

Fix the help and tristate lines -- use tab instead of spaces.

> +	  This adds the CPUfreq driver support for ARM big.LITTLE platforms
> +	  using SCPI protocol for CPU power management.
> +
> +	  This driver uses SCPI Message Protocol driver to interact with the
> +	  firmware providing the CPU DVFS functionality.
> +
> +config ARM_VEXPRESS_SPC_CPUFREQ
> +        tristate "Versatile Express SPC based CPUfreq driver"
> +	depends on ARM_BIG_LITTLE_CPUFREQ && ARCH_VEXPRESS_SPC
> +        help

Use tab instead of spaces above. Oh, and one line below.

> +          This add the CPUfreq driver support for Versatile Express
> +	  big.LITTLE platforms using SPC for power management.
> +
>  config ARM_BRCMSTB_AVS_CPUFREQ
>  	tristate "Broadcom STB AVS CPUfreq driver"
>  	depends on ARCH_BRCMSTB || COMPILE_TEST


-- 
~Randy

^ permalink raw reply

* [PATCH] pinctrl: rockchip: enable clock when reading pin direction register
From: Brian Norris @ 2017-12-12 17:43 UTC (permalink / raw)
  To: linux-arm-kernel

We generally leave the GPIO clock disabled, unless an interrupt is
requested or we're accessing IO registers. We forgot to do this for the
->get_direction() callback, which means we can sometimes [1] get
incorrect results [2] from, e.g., /sys/kernel/debug/gpio.

Enable the clock, so we get the right results!

[1] Sometimes, because many systems have 1 or mor interrupt requested on
each GPIO bank, so they always leave their clock on.

[2] Incorrect, meaning the register returns 0, and so we interpret that
as "input".

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 drivers/pinctrl/pinctrl-rockchip.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 2ba17548ad5b..073de6a9ed34 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -2014,8 +2014,16 @@ static int rockchip_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
 {
 	struct rockchip_pin_bank *bank = gpiochip_get_data(chip);
 	u32 data;
+	int ret;
 
+	ret = clk_enable(bank->clk);
+	if (ret < 0) {
+		dev_err(bank->drvdata->dev,
+			"failed to enable clock for bank %s\n", bank->name);
+		return ret;
+	}
 	data = readl_relaxed(bank->reg_base + GPIO_SWPORT_DDR);
+	clk_disable(bank->clk);
 
 	return !(data & BIT(offset));
 }
-- 
2.15.1.424.g9478a66081-goog

^ permalink raw reply related

* [PATCH] ARM: CPU hotplug: Delegate complete() to surviving CPU
From: Baruch Siach @ 2017-12-12 17:40 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171212172059.GA11875@linux.vnet.ibm.com>

Hi Paul,

On Tue, Dec 12, 2017 at 09:20:59AM -0800, Paul E. McKenney wrote:
> The ARM implementation of arch_cpu_idle_dead() invokes complete(), but
> does so after RCU has stopped watching the outgoing CPU, which results
> in lockdep complaints because complete() invokes functions containing RCU
> readers.  This patch therefore uses Thomas Gleixner's trick of delegating
> the complete() call to a surviving CPU via smp_call_function_single().
> 
> Reported-by: Peng Fan <van.freenix@gmail.com>
> Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Tested-by: Tested-by: Fabio Estevam <fabio.estevam@nxp.com>

Fabio reported only once, though he might have tested twice.

baruch

> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: <linux-arm-kernel@lists.infradead.org>
> 
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index b4fbf00ee4ad..75f85e20aafa 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -267,6 +267,14 @@ void __cpu_die(unsigned int cpu)
>  }
>  
>  /*
> + * Invoke complete() on behalf of the outgoing CPU.
> + */
> +static void arch_cpu_idle_dead_complete(void *arg)
> +{
> +	complete(&cpu_died);
> +}
> +
> +/*
>   * Called from the idle thread for the CPU which has been shutdown.
>   *
>   * Note that we disable IRQs here, but do not re-enable them
> @@ -293,9 +301,11 @@ void arch_cpu_idle_dead(void)
>  	/*
>  	 * Tell __cpu_die() that this CPU is now safe to dispose of.  Once
>  	 * this returns, power and/or clocks can be removed at any point
> -	 * from this CPU and its cache by platform_cpu_kill().
> +	 * from this CPU and its cache by platform_cpu_kill().  We cannot
> +	 * call complete() this late, so we delegate it to an online CPU.
>  	 */
> -	complete(&cpu_died);
> +	smp_call_function_single(cpumask_first(cpu_online_mask),
> +				 arch_cpu_idle_dead_complete, NULL, 0);
>  
>  	/*
>  	 * Ensure that the cache lines associated with that completion are

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply

* [PATCH] ARM: CPU hotplug: Delegate complete() to surviving CPU
From: Russell King - ARM Linux @ 2017-12-12 17:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171212172059.GA11875@linux.vnet.ibm.com>

On Tue, Dec 12, 2017 at 09:20:59AM -0800, Paul E. McKenney wrote:
> The ARM implementation of arch_cpu_idle_dead() invokes complete(), but
> does so after RCU has stopped watching the outgoing CPU, which results
> in lockdep complaints because complete() invokes functions containing RCU
> readers.  This patch therefore uses Thomas Gleixner's trick of delegating
> the complete() call to a surviving CPU via smp_call_function_single().
> 
> Reported-by: Peng Fan <van.freenix@gmail.com>
> Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Tested-by: Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: <linux-arm-kernel@lists.infradead.org>

As I just described in response to Fabio's testing, this doesn't solve
anything if CONFIG_BL_SWITCHER is enabled.  We could lose the unlock of
a spinlock in the GIC code for sending the IPI.  As I already said
previously in our discussion (but I guess you just don't believe me):

"2. there's some optional locking in the GIC driver that cause problems
   for the cpu dying path.

The concensus last time around was that the IPI solution is a non-
starter, so the seven year proven-reliable solution (disregarding the
RCU warning) persists because I don't think anyone came up with a
better solution."

Using smp_call_function_single() invokes the IPI paths.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply

* WARNING: suspicious RCU usage
From: Russell King - ARM Linux @ 2017-12-12 17:34 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOMZO5AftAWz339Sy+oxQ8K9Dr04Jyf8SV0R0JGrcPaL-VQLMQ@mail.gmail.com>

On Tue, Dec 12, 2017 at 02:56:18PM -0200, Fabio Estevam wrote:
> Hi Paul,
> 
> On Tue, Dec 12, 2017 at 2:49 PM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> 
> > On the perhaps unlikely off-chance that it is both useful and welcome,
> > the (untested, probably does not even build) patch below illustrates the
> > use of smp_call_function_single().  This is based on the patch Russell
> > sent -- for all I know, it might well be that there are other places
> > needing similar changes.
> >
> > But something to try out for anyone wishing to do so.
> >
> >                                                         Thanx, Paul
> >
> > ------------------------------------------------------------------------
> >
> > commit c579a1494ccbc7ebf5548115571a2988ea1a1fe5
> > Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > Date:   Mon Dec 11 09:40:58 2017 -0800
> >
> >     ARM: CPU hotplug: Delegate complete() to surviving CPU
> >
> >     The ARM implementation of arch_cpu_idle_dead() invokes complete(), but
> >     does so after RCU has stopped watching the outgoing CPU, which results
> >     in lockdep complaints because complete() invokes functions containing RCU
> >     readers.  This patch therefore uses Thomas Gleixner's trick of delegating
> >     the complete() call to a surviving CPU via smp_call_function_single().
> >
> >     This patch is untested, and probably does not even build.
> >
> >     Reported-by: Peng Fan <van.freenix@gmail.com>
> >     Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
> >     Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> With your patch applied I no longer get the RCU warning, thanks:
> 
> Tested-by: Fabio Estevam <fabio.estevam@nxp.com>

It's fundamentally unsafe.

You need to test with CONFIG_BL_SWITCHER enabled - there's spinlocks
in smp_call_function_single() path that are conditional on that symbol.
If CONFIG_BL_SWITCHER is disabled, then the spinlocks are not present.

The problem is that the IPI will be sent with the spinlock held.  The
IPI'd CPU will then do the completion, and the CPU requesting the
death will continue, and could power down the dying CPU _before_ the
unlock of that spinlock becomes visible to other CPUs in the system.

So, we end up with a spinlock permanently held.

Whether this happens or not depends on timing, and whether the unlock
gets evicted from the dying CPU.

If you attempt to clean the caches after the unlock to force that unlock
out, then you need a way to make the requesting CPU wait for the dying
CPU to finish that action... oh, that's what this complete() is trying
to do here in the first place.

So we're back to exactly where we were without this patch.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply

* [linux-sunxi] [PATCH v2 3/6] ARM: sun4i: Convert to CCU
From: Priit Laes @ 2017-12-12 17:26 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOi56cUjqjcZRz6VSwUWcrW=4RQyqyZHtm1vuM3HT2ypdPJ78g@mail.gmail.com>

On Mon, Dec 11, 2017 at 02:22:30PM -0800, Kevin Hilman wrote:
> On Sun, Mar 26, 2017 at 10:20 AM, Priit Laes <plaes@plaes.org> wrote:
> > Convert sun4i-a10.dtsi to new CCU driver.
> >
> > Signed-off-by: Priit Laes <plaes@plaes.org>
> 
> I finally got around to bisecting a mainline boot failure on
> sun4i-a10-cubieboard that's been happening for quite a while.  Based
> on on kernelci.org, it showed up sometime during the v4.15 merge
> window[1].  It bisected down to this commit (in mainline as commit
> 41193869f2bdb585ce09bfdd16d9482aadd560ad).
> 
> When it fails, there is no output on the serial console, so I don't
> know exactly how it's failing, just that it no longer boots.

We tried out latest 4.15 with various compilers and it works:
- gcc version 7.1.1 20170622 (Red Hat Cross 7.1.1-3) (GCC) - A10 Gemei G9 tablet
- gcc 7.2.0-debian - A10 Cubieboard

> 
> Kevin
> 
> [1] https://kernelci.org/boot/id/5a2e10cd59b51430a9afa173/
> 
> > ---
> >  arch/arm/boot/dts/sun4i-a10.dtsi | 636 ++++----------------------------
> >  1 file changed, 82 insertions(+), 554 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
> > index ba20b48..0d8320a 100644
> > --- a/arch/arm/boot/dts/sun4i-a10.dtsi
> > +++ b/arch/arm/boot/dts/sun4i-a10.dtsi
> > @@ -45,7 +45,8 @@
> >
> >  #include <dt-bindings/thermal/thermal.h>
> >
> > -#include <dt-bindings/clock/sun4i-a10-pll2.h>
> > +#include <dt-bindings/clock/sunxi-a10-a20-ccu.h>
> > +#include <dt-bindings/reset/sunxi-a10-a20-ccu.h>
> >  #include <dt-bindings/dma/sun4i-a10.h>
> >  #include <dt-bindings/pinctrl/sun4i-a10.h>
> >
> > @@ -65,9 +66,9 @@
> >                         compatible = "allwinner,simple-framebuffer",
> >                                      "simple-framebuffer";
> >                         allwinner,pipeline = "de_be0-lcd0-hdmi";
> > -                       clocks = <&ahb_gates 36>, <&ahb_gates 43>,
> > -                                <&ahb_gates 44>, <&de_be0_clk>,
> > -                                <&tcon0_ch1_clk>, <&dram_gates 26>;
> > +                       clocks = <&ccu CLK_AHB_LCD0>, <&ccu CLK_AHB_HDMI1>,
> > +                                <&ccu CLK_AHB_DE_BE0>, <&ccu CLK_DE_BE0>,
> > +                                <&ccu CLK_TCON0_CH1>, <&ccu CLK_DRAM_DE_BE0>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -75,10 +76,11 @@
> >                         compatible = "allwinner,simple-framebuffer",
> >                                      "simple-framebuffer";
> >                         allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi";
> > -                       clocks = <&ahb_gates 36>, <&ahb_gates 43>,
> > -                                <&ahb_gates 44>, <&ahb_gates 46>,
> > -                                <&de_be0_clk>, <&de_fe0_clk>, <&tcon0_ch1_clk>,
> > -                                <&dram_gates 25>, <&dram_gates 26>;
> > +                       clocks = <&ccu CLK_AHB_LCD0>, <&ccu CLK_AHB_HDMI1>,
> > +                                <&ccu CLK_AHB_DE_BE0>, <&ccu CLK_AHB_DE_FE0>,
> > +                                <&ccu CLK_DE_BE0>, <&ccu CLK_DE_FE0>,
> > +                                <&ccu CLK_TCON0_CH1>,
> > +                                <&ccu CLK_DRAM_DE_FE0>, <&ccu CLK_DRAM_DE_BE0>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -86,9 +88,10 @@
> >                         compatible = "allwinner,simple-framebuffer",
> >                                      "simple-framebuffer";
> >                         allwinner,pipeline = "de_fe0-de_be0-lcd0";
> > -                       clocks = <&ahb_gates 36>, <&ahb_gates 44>, <&ahb_gates 46>,
> > -                                <&de_be0_clk>, <&de_fe0_clk>, <&tcon0_ch0_clk>,
> > -                                <&dram_gates 25>, <&dram_gates 26>;
> > +                       clocks = <&ccu CLK_AHB_LCD0>, <&ccu CLK_AHB_DE_BE0>,
> > +                                <&ccu CLK_AHB_DE_FE0>, <&ccu CLK_DE_BE0>,
> > +                                <&ccu CLK_DE_FE0>, <&ccu CLK_TCON0_CH1>,
> > +                                <&ccu CLK_DRAM_DE_FE0>, <&ccu CLK_DRAM_DE_BE0>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -96,11 +99,11 @@
> >                         compatible = "allwinner,simple-framebuffer",
> >                                      "simple-framebuffer";
> >                         allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0";
> > -                       clocks = <&ahb_gates 34>, <&ahb_gates 36>,
> > -                                <&ahb_gates 44>, <&ahb_gates 46>,
> > -                                <&de_be0_clk>, <&de_fe0_clk>,
> > -                                <&tcon0_ch1_clk>, <&dram_gates 5>,
> > -                                <&dram_gates 25>, <&dram_gates 26>;
> > +                       clocks = <&ccu CLK_AHB_TVE0>, <&ccu CLK_AHB_LCD0>,
> > +                                <&ccu CLK_AHB_DE_BE0>, <&ccu CLK_AHB_DE_FE0>,
> > +                                <&ccu CLK_DE_BE0>, <&ccu CLK_DE_FE0>,
> > +                                <&ccu CLK_TCON0_CH1>, <&ccu CLK_DRAM_TVE0>,
> > +                                <&ccu CLK_DRAM_DE_FE0>, <&ccu CLK_DRAM_DE_BE0>;
> >                         status = "disabled";
> >                 };
> >         };
> > @@ -112,7 +115,7 @@
> >                         device_type = "cpu";
> >                         compatible = "arm,cortex-a8";
> >                         reg = <0x0>;
> > -                       clocks = <&cpu>;
> > +                       clocks = <&ccu CLK_CPU>;
> >                         clock-latency = <244144>; /* 8 32k periods */
> >                         operating-points = <
> >                                 /* kHz    uV */
> > @@ -168,18 +171,6 @@
> >                 #size-cells = <1>;
> >                 ranges;
> >
> > -               /*
> > -                * This is a dummy clock, to be used as placeholder on
> > -                * other mux clocks when a specific parent clock is not
> > -                * yet implemented. It should be dropped when the driver
> > -                * is complete.
> > -                */
> > -               dummy: dummy {
> > -                       #clock-cells = <0>;
> > -                       compatible = "fixed-clock";
> > -                       clock-frequency = <0>;
> > -               };
> > -
> >                 osc24M: clk at 01c20050 {
> >                         #clock-cells = <0>;
> >                         compatible = "allwinner,sun4i-a10-osc-clk";
> > @@ -188,487 +179,12 @@
> >                         clock-output-names = "osc24M";
> >                 };
> >
> > -               osc3M: osc3M_clk {
> > -                       compatible = "fixed-factor-clock";
> > -                       #clock-cells = <0>;
> > -                       clock-div = <8>;
> > -                       clock-mult = <1>;
> > -                       clocks = <&osc24M>;
> > -                       clock-output-names = "osc3M";
> > -               };
> > -
> >                 osc32k: clk at 0 {
> >                         #clock-cells = <0>;
> >                         compatible = "fixed-clock";
> >                         clock-frequency = <32768>;
> >                         clock-output-names = "osc32k";
> >                 };
> > -
> > -               pll1: clk at 01c20000 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-pll1-clk";
> > -                       reg = <0x01c20000 0x4>;
> > -                       clocks = <&osc24M>;
> > -                       clock-output-names = "pll1";
> > -               };
> > -
> > -               pll2: clk at 01c20008 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-pll2-clk";
> > -                       reg = <0x01c20008 0x8>;
> > -                       clocks = <&osc24M>;
> > -                       clock-output-names = "pll2-1x", "pll2-2x",
> > -                                            "pll2-4x", "pll2-8x";
> > -               };
> > -
> > -               pll3: clk at 01c20010 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-pll3-clk";
> > -                       reg = <0x01c20010 0x4>;
> > -                       clocks = <&osc3M>;
> > -                       clock-output-names = "pll3";
> > -               };
> > -
> > -               pll3x2: pll3x2_clk {
> > -                       compatible = "fixed-factor-clock";
> > -                       #clock-cells = <0>;
> > -                       clock-div = <1>;
> > -                       clock-mult = <2>;
> > -                       clocks = <&pll3>;
> > -                       clock-output-names = "pll3-2x";
> > -               };
> > -
> > -               pll4: clk at 01c20018 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-pll1-clk";
> > -                       reg = <0x01c20018 0x4>;
> > -                       clocks = <&osc24M>;
> > -                       clock-output-names = "pll4";
> > -               };
> > -
> > -               pll5: clk at 01c20020 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-pll5-clk";
> > -                       reg = <0x01c20020 0x4>;
> > -                       clocks = <&osc24M>;
> > -                       clock-output-names = "pll5_ddr", "pll5_other";
> > -               };
> > -
> > -               pll6: clk at 01c20028 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-pll6-clk";
> > -                       reg = <0x01c20028 0x4>;
> > -                       clocks = <&osc24M>;
> > -                       clock-output-names = "pll6_sata", "pll6_other", "pll6";
> > -               };
> > -
> > -               pll7: clk at 01c20030 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-pll3-clk";
> > -                       reg = <0x01c20030 0x4>;
> > -                       clocks = <&osc3M>;
> > -                       clock-output-names = "pll7";
> > -               };
> > -
> > -               pll7x2: pll7x2_clk {
> > -                       compatible = "fixed-factor-clock";
> > -                       #clock-cells = <0>;
> > -                       clock-div = <1>;
> > -                       clock-mult = <2>;
> > -                       clocks = <&pll7>;
> > -                       clock-output-names = "pll7-2x";
> > -               };
> > -
> > -               /* dummy is 200M */
> > -               cpu: cpu at 01c20054 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-cpu-clk";
> > -                       reg = <0x01c20054 0x4>;
> > -                       clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
> > -                       clock-output-names = "cpu";
> > -               };
> > -
> > -               axi: axi at 01c20054 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-axi-clk";
> > -                       reg = <0x01c20054 0x4>;
> > -                       clocks = <&cpu>;
> > -                       clock-output-names = "axi";
> > -               };
> > -
> > -               axi_gates: clk at 01c2005c {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-axi-gates-clk";
> > -                       reg = <0x01c2005c 0x4>;
> > -                       clocks = <&axi>;
> > -                       clock-indices = <0>;
> > -                       clock-output-names = "axi_dram";
> > -               };
> > -
> > -               ahb: ahb at 01c20054 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-ahb-clk";
> > -                       reg = <0x01c20054 0x4>;
> > -                       clocks = <&axi>;
> > -                       clock-output-names = "ahb";
> > -               };
> > -
> > -               ahb_gates: clk at 01c20060 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-ahb-gates-clk";
> > -                       reg = <0x01c20060 0x8>;
> > -                       clocks = <&ahb>;
> > -                       clock-indices = <0>, <1>,
> > -                                       <2>, <3>,
> > -                                       <4>, <5>, <6>,
> > -                                       <7>, <8>, <9>,
> > -                                       <10>, <11>, <12>,
> > -                                       <13>, <14>, <16>,
> > -                                       <17>, <18>, <20>,
> > -                                       <21>, <22>, <23>,
> > -                                       <24>, <25>, <26>,
> > -                                       <32>, <33>, <34>,
> > -                                       <35>, <36>, <37>,
> > -                                       <40>, <41>, <43>,
> > -                                       <44>, <45>,
> > -                                       <46>, <47>,
> > -                                       <50>, <52>;
> > -                       clock-output-names = "ahb_usb0", "ahb_ehci0",
> > -                                            "ahb_ohci0", "ahb_ehci1",
> > -                                            "ahb_ohci1", "ahb_ss", "ahb_dma",
> > -                                            "ahb_bist", "ahb_mmc0", "ahb_mmc1",
> > -                                            "ahb_mmc2", "ahb_mmc3", "ahb_ms",
> > -                                            "ahb_nand", "ahb_sdram", "ahb_ace",
> > -                                            "ahb_emac", "ahb_ts", "ahb_spi0",
> > -                                            "ahb_spi1", "ahb_spi2", "ahb_spi3",
> > -                                            "ahb_pata", "ahb_sata", "ahb_gps",
> > -                                            "ahb_ve", "ahb_tvd", "ahb_tve0",
> > -                                            "ahb_tve1", "ahb_lcd0", "ahb_lcd1",
> > -                                            "ahb_csi0", "ahb_csi1", "ahb_hdmi",
> > -                                            "ahb_de_be0", "ahb_de_be1",
> > -                                            "ahb_de_fe0", "ahb_de_fe1",
> > -                                            "ahb_mp", "ahb_mali400";
> > -               };
> > -
> > -               apb0: apb0 at 01c20054 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-apb0-clk";
> > -                       reg = <0x01c20054 0x4>;
> > -                       clocks = <&ahb>;
> > -                       clock-output-names = "apb0";
> > -               };
> > -
> > -               apb0_gates: clk at 01c20068 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-apb0-gates-clk";
> > -                       reg = <0x01c20068 0x4>;
> > -                       clocks = <&apb0>;
> > -                       clock-indices = <0>, <1>,
> > -                                       <2>, <3>,
> > -                                       <5>, <6>,
> > -                                       <7>, <10>;
> > -                       clock-output-names = "apb0_codec", "apb0_spdif",
> > -                                            "apb0_ac97", "apb0_iis",
> > -                                            "apb0_pio", "apb0_ir0",
> > -                                            "apb0_ir1", "apb0_keypad";
> > -               };
> > -
> > -               apb1: clk at 01c20058 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-apb1-clk";
> > -                       reg = <0x01c20058 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
> > -                       clock-output-names = "apb1";
> > -               };
> > -
> > -               apb1_gates: clk at 01c2006c {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-apb1-gates-clk";
> > -                       reg = <0x01c2006c 0x4>;
> > -                       clocks = <&apb1>;
> > -                       clock-indices = <0>, <1>,
> > -                                       <2>, <4>,
> > -                                       <5>, <6>,
> > -                                       <7>, <16>,
> > -                                       <17>, <18>,
> > -                                       <19>, <20>,
> > -                                       <21>, <22>,
> > -                                       <23>;
> > -                       clock-output-names = "apb1_i2c0", "apb1_i2c1",
> > -                                            "apb1_i2c2", "apb1_can",
> > -                                            "apb1_scr", "apb1_ps20",
> > -                                            "apb1_ps21", "apb1_uart0",
> > -                                            "apb1_uart1", "apb1_uart2",
> > -                                            "apb1_uart3", "apb1_uart4",
> > -                                            "apb1_uart5", "apb1_uart6",
> > -                                            "apb1_uart7";
> > -               };
> > -
> > -               nand_clk: clk at 01c20080 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c20080 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "nand";
> > -               };
> > -
> > -               ms_clk: clk at 01c20084 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c20084 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "ms";
> > -               };
> > -
> > -               mmc0_clk: clk at 01c20088 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-mmc-clk";
> > -                       reg = <0x01c20088 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "mmc0",
> > -                                            "mmc0_output",
> > -                                            "mmc0_sample";
> > -               };
> > -
> > -               mmc1_clk: clk at 01c2008c {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-mmc-clk";
> > -                       reg = <0x01c2008c 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "mmc1",
> > -                                            "mmc1_output",
> > -                                            "mmc1_sample";
> > -               };
> > -
> > -               mmc2_clk: clk at 01c20090 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-mmc-clk";
> > -                       reg = <0x01c20090 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "mmc2",
> > -                                            "mmc2_output",
> > -                                            "mmc2_sample";
> > -               };
> > -
> > -               mmc3_clk: clk at 01c20094 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-mmc-clk";
> > -                       reg = <0x01c20094 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "mmc3",
> > -                                            "mmc3_output",
> > -                                            "mmc3_sample";
> > -               };
> > -
> > -               ts_clk: clk at 01c20098 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c20098 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "ts";
> > -               };
> > -
> > -               ss_clk: clk at 01c2009c {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c2009c 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "ss";
> > -               };
> > -
> > -               spi0_clk: clk at 01c200a0 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c200a0 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "spi0";
> > -               };
> > -
> > -               spi1_clk: clk at 01c200a4 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c200a4 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "spi1";
> > -               };
> > -
> > -               spi2_clk: clk at 01c200a8 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c200a8 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "spi2";
> > -               };
> > -
> > -               pata_clk: clk at 01c200ac {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c200ac 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "pata";
> > -               };
> > -
> > -               ir0_clk: clk at 01c200b0 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c200b0 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "ir0";
> > -               };
> > -
> > -               ir1_clk: clk at 01c200b4 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c200b4 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "ir1";
> > -               };
> > -
> > -               spdif_clk: clk at 01c200c0 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod1-clk";
> > -                       reg = <0x01c200c0 0x4>;
> > -                       clocks = <&pll2 SUN4I_A10_PLL2_8X>,
> > -                                <&pll2 SUN4I_A10_PLL2_4X>,
> > -                                <&pll2 SUN4I_A10_PLL2_2X>,
> > -                                <&pll2 SUN4I_A10_PLL2_1X>;
> > -                       clock-output-names = "spdif";
> > -               };
> > -
> > -               usb_clk: clk at 01c200cc {
> > -                       #clock-cells = <1>;
> > -                       #reset-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-usb-clk";
> > -                       reg = <0x01c200cc 0x4>;
> > -                       clocks = <&pll6 1>;
> > -                       clock-output-names = "usb_ohci0", "usb_ohci1",
> > -                                            "usb_phy";
> > -               };
> > -
> > -               spi3_clk: clk at 01c200d4 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-mod0-clk";
> > -                       reg = <0x01c200d4 0x4>;
> > -                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
> > -                       clock-output-names = "spi3";
> > -               };
> > -
> > -               dram_gates: clk at 01c20100 {
> > -                       #clock-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-dram-gates-clk";
> > -                       reg = <0x01c20100 0x4>;
> > -                       clocks = <&pll5 0>;
> > -                       clock-indices = <0>,
> > -                                       <1>, <2>,
> > -                                       <3>,
> > -                                       <4>,
> > -                                       <5>, <6>,
> > -                                       <15>,
> > -                                       <24>, <25>,
> > -                                       <26>, <27>,
> > -                                       <28>, <29>;
> > -                       clock-output-names = "dram_ve",
> > -                                            "dram_csi0", "dram_csi1",
> > -                                            "dram_ts",
> > -                                            "dram_tvd",
> > -                                            "dram_tve0", "dram_tve1",
> > -                                            "dram_output",
> > -                                            "dram_de_fe1", "dram_de_fe0",
> > -                                            "dram_de_be0", "dram_de_be1",
> > -                                            "dram_de_mp", "dram_ace";
> > -               };
> > -
> > -               de_be0_clk: clk at 01c20104 {
> > -                       #clock-cells = <0>;
> > -                       #reset-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-display-clk";
> > -                       reg = <0x01c20104 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll5 1>;
> > -                       clock-output-names = "de-be0";
> > -               };
> > -
> > -               de_be1_clk: clk at 01c20108 {
> > -                       #clock-cells = <0>;
> > -                       #reset-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-display-clk";
> > -                       reg = <0x01c20108 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll5 1>;
> > -                       clock-output-names = "de-be1";
> > -               };
> > -
> > -               de_fe0_clk: clk at 01c2010c {
> > -                       #clock-cells = <0>;
> > -                       #reset-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-display-clk";
> > -                       reg = <0x01c2010c 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll5 1>;
> > -                       clock-output-names = "de-fe0";
> > -               };
> > -
> > -               de_fe1_clk: clk at 01c20110 {
> > -                       #clock-cells = <0>;
> > -                       #reset-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-display-clk";
> > -                       reg = <0x01c20110 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll5 1>;
> > -                       clock-output-names = "de-fe1";
> > -               };
> > -
> > -
> > -               tcon0_ch0_clk: clk at 01c20118 {
> > -                       #clock-cells = <0>;
> > -                       #reset-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-tcon-ch0-clk";
> > -                       reg = <0x01c20118 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll3x2>, <&pll7x2>;
> > -                       clock-output-names = "tcon0-ch0-sclk";
> > -
> > -               };
> > -
> > -               tcon1_ch0_clk: clk at 01c2011c {
> > -                       #clock-cells = <0>;
> > -                       #reset-cells = <1>;
> > -                       compatible = "allwinner,sun4i-a10-tcon-ch1-clk";
> > -                       reg = <0x01c2011c 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll3x2>, <&pll7x2>;
> > -                       clock-output-names = "tcon1-ch0-sclk";
> > -
> > -               };
> > -
> > -               tcon0_ch1_clk: clk at 01c2012c {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-tcon-ch0-clk";
> > -                       reg = <0x01c2012c 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll3x2>, <&pll7x2>;
> > -                       clock-output-names = "tcon0-ch1-sclk";
> > -
> > -               };
> > -
> > -               tcon1_ch1_clk: clk at 01c20130 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-tcon-ch1-clk";
> > -                       reg = <0x01c20130 0x4>;
> > -                       clocks = <&pll3>, <&pll7>, <&pll3x2>, <&pll7x2>;
> > -                       clock-output-names = "tcon1-ch1-sclk";
> > -
> > -               };
> > -
> > -               ve_clk: clk at 01c2013c {
> > -                       #clock-cells = <0>;
> > -                       #reset-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-ve-clk";
> > -                       reg = <0x01c2013c 0x4>;
> > -                       clocks = <&pll4>;
> > -                       clock-output-names = "ve";
> > -               };
> > -
> > -               codec_clk: clk at 01c20140 {
> > -                       #clock-cells = <0>;
> > -                       compatible = "allwinner,sun4i-a10-codec-clk";
> > -                       reg = <0x01c20140 0x4>;
> > -                       clocks = <&pll2 SUN4I_A10_PLL2_1X>;
> > -                       clock-output-names = "codec";
> > -               };
> >         };
> >
> >         soc at 01c00000 {
> > @@ -717,7 +233,7 @@
> >                         compatible = "allwinner,sun4i-a10-dma";
> >                         reg = <0x01c02000 0x1000>;
> >                         interrupts = <27>;
> > -                       clocks = <&ahb_gates 6>;
> > +                       clocks = <&ccu CLK_AHB_DMA>;
> >                         #dma-cells = <2>;
> >                 };
> >
> > @@ -725,7 +241,7 @@
> >                         compatible = "allwinner,sun4i-a10-nand";
> >                         reg = <0x01c03000 0x1000>;
> >                         interrupts = <37>;
> > -                       clocks = <&ahb_gates 13>, <&nand_clk>;
> > +                       clocks = <&ccu CLK_AHB_NAND>, <&ccu CLK_NAND>;
> >                         clock-names = "ahb", "mod";
> >                         dmas = <&dma SUN4I_DMA_DEDICATED 3>;
> >                         dma-names = "rxtx";
> > @@ -738,7 +254,7 @@
> >                         compatible = "allwinner,sun4i-a10-spi";
> >                         reg = <0x01c05000 0x1000>;
> >                         interrupts = <10>;
> > -                       clocks = <&ahb_gates 20>, <&spi0_clk>;
> > +                       clocks = <&ccu CLK_AHB_SPI0>, <&ccu CLK_SPI0>;
> >                         clock-names = "ahb", "mod";
> >                         dmas = <&dma SUN4I_DMA_DEDICATED 27>,
> >                                <&dma SUN4I_DMA_DEDICATED 26>;
> > @@ -752,7 +268,7 @@
> >                         compatible = "allwinner,sun4i-a10-spi";
> >                         reg = <0x01c06000 0x1000>;
> >                         interrupts = <11>;
> > -                       clocks = <&ahb_gates 21>, <&spi1_clk>;
> > +                       clocks = <&ccu CLK_AHB_SPI1>, <&ccu CLK_SPI1>;
> >                         clock-names = "ahb", "mod";
> >                         dmas = <&dma SUN4I_DMA_DEDICATED 9>,
> >                                <&dma SUN4I_DMA_DEDICATED 8>;
> > @@ -766,7 +282,7 @@
> >                         compatible = "allwinner,sun4i-a10-emac";
> >                         reg = <0x01c0b000 0x1000>;
> >                         interrupts = <55>;
> > -                       clocks = <&ahb_gates 17>;
> > +                       clocks = <&ccu CLK_AHB_EMAC>;
> >                         allwinner,sram = <&emac_sram 1>;
> >                         status = "disabled";
> >                 };
> > @@ -782,10 +298,10 @@
> >                 mmc0: mmc at 01c0f000 {
> >                         compatible = "allwinner,sun4i-a10-mmc";
> >                         reg = <0x01c0f000 0x1000>;
> > -                       clocks = <&ahb_gates 8>,
> > -                                <&mmc0_clk 0>,
> > -                                <&mmc0_clk 1>,
> > -                                <&mmc0_clk 2>;
> > +                       clocks = <&ccu CLK_AHB_MMC0>,
> > +                                <&ccu CLK_MMC0>,
> > +                                <&ccu CLK_MMC0_OUTPUT>,
> > +                                <&ccu CLK_MMC0_SAMPLE>;
> >                         clock-names = "ahb",
> >                                       "mmc",
> >                                       "output",
> > @@ -799,10 +315,10 @@
> >                 mmc1: mmc at 01c10000 {
> >                         compatible = "allwinner,sun4i-a10-mmc";
> >                         reg = <0x01c10000 0x1000>;
> > -                       clocks = <&ahb_gates 9>,
> > -                                <&mmc1_clk 0>,
> > -                                <&mmc1_clk 1>,
> > -                                <&mmc1_clk 2>;
> > +                       clocks = <&ccu CLK_AHB_MMC1>,
> > +                                <&ccu CLK_MMC1>,
> > +                                <&ccu CLK_MMC1_OUTPUT>,
> > +                                <&ccu CLK_MMC1_SAMPLE>;
> >                         clock-names = "ahb",
> >                                       "mmc",
> >                                       "output",
> > @@ -816,10 +332,10 @@
> >                 mmc2: mmc at 01c11000 {
> >                         compatible = "allwinner,sun4i-a10-mmc";
> >                         reg = <0x01c11000 0x1000>;
> > -                       clocks = <&ahb_gates 10>,
> > -                                <&mmc2_clk 0>,
> > -                                <&mmc2_clk 1>,
> > -                                <&mmc2_clk 2>;
> > +                       clocks = <&ccu CLK_AHB_MMC2>,
> > +                                <&ccu CLK_MMC2>,
> > +                                <&ccu CLK_MMC2_OUTPUT>,
> > +                                <&ccu CLK_MMC2_SAMPLE>;
> >                         clock-names = "ahb",
> >                                       "mmc",
> >                                       "output",
> > @@ -833,10 +349,10 @@
> >                 mmc3: mmc at 01c12000 {
> >                         compatible = "allwinner,sun4i-a10-mmc";
> >                         reg = <0x01c12000 0x1000>;
> > -                       clocks = <&ahb_gates 11>,
> > -                                <&mmc3_clk 0>,
> > -                                <&mmc3_clk 1>,
> > -                                <&mmc3_clk 2>;
> > +                       clocks = <&ccu CLK_AHB_MMC3>,
> > +                                <&ccu CLK_MMC3>,
> > +                                <&ccu CLK_MMC3_OUTPUT>,
> > +                                <&ccu CLK_MMC3_SAMPLE>;
> >                         clock-names = "ahb",
> >                                       "mmc",
> >                                       "output",
> > @@ -850,7 +366,7 @@
> >                 usb_otg: usb at 01c13000 {
> >                         compatible = "allwinner,sun4i-a10-musb";
> >                         reg = <0x01c13000 0x0400>;
> > -                       clocks = <&ahb_gates 0>;
> > +                       clocks = <&ccu CLK_AHB_OTG>;
> >                         interrupts = <38>;
> >                         interrupt-names = "mc";
> >                         phys = <&usbphy 0>;
> > @@ -865,9 +381,11 @@
> >                         compatible = "allwinner,sun4i-a10-usb-phy";
> >                         reg = <0x01c13400 0x10 0x01c14800 0x4 0x01c1c800 0x4>;
> >                         reg-names = "phy_ctrl", "pmu1", "pmu2";
> > -                       clocks = <&usb_clk 8>;
> > +                       clocks = <&ccu CLK_USB_PHY>;
> >                         clock-names = "usb_phy";
> > -                       resets = <&usb_clk 0>, <&usb_clk 1>, <&usb_clk 2>;
> > +                       resets = <&ccu RST_USB_PHY0>,
> > +                                <&ccu RST_USB_PHY1>,
> > +                                <&ccu RST_USB_PHY2>;
> >                         reset-names = "usb0_reset", "usb1_reset", "usb2_reset";
> >                         status = "disabled";
> >                 };
> > @@ -876,7 +394,7 @@
> >                         compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
> >                         reg = <0x01c14000 0x100>;
> >                         interrupts = <39>;
> > -                       clocks = <&ahb_gates 1>;
> > +                       clocks = <&ccu CLK_AHB_EHCI0>;
> >                         phys = <&usbphy 1>;
> >                         phy-names = "usb";
> >                         status = "disabled";
> > @@ -886,7 +404,7 @@
> >                         compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
> >                         reg = <0x01c14400 0x100>;
> >                         interrupts = <64>;
> > -                       clocks = <&usb_clk 6>, <&ahb_gates 2>;
> > +                       clocks = <&ccu CLK_USB_OHCI0>, <&ccu CLK_AHB_OHCI0>;
> >                         phys = <&usbphy 1>;
> >                         phy-names = "usb";
> >                         status = "disabled";
> > @@ -896,7 +414,7 @@
> >                         compatible = "allwinner,sun4i-a10-crypto";
> >                         reg = <0x01c15000 0x1000>;
> >                         interrupts = <86>;
> > -                       clocks = <&ahb_gates 5>, <&ss_clk>;
> > +                       clocks = <&ccu CLK_AHB_SS>, <&ccu CLK_SS>;
> >                         clock-names = "ahb", "mod";
> >                 };
> >
> > @@ -904,7 +422,7 @@
> >                         compatible = "allwinner,sun4i-a10-spi";
> >                         reg = <0x01c17000 0x1000>;
> >                         interrupts = <12>;
> > -                       clocks = <&ahb_gates 22>, <&spi2_clk>;
> > +                       clocks = <&ccu CLK_AHB_SPI2>, <&ccu CLK_SPI2>;
> >                         clock-names = "ahb", "mod";
> >                         dmas = <&dma SUN4I_DMA_DEDICATED 29>,
> >                                <&dma SUN4I_DMA_DEDICATED 28>;
> > @@ -918,7 +436,8 @@
> >                         compatible = "allwinner,sun4i-a10-ahci";
> >                         reg = <0x01c18000 0x1000>;
> >                         interrupts = <56>;
> > -                       clocks = <&pll6 0>, <&ahb_gates 25>;
> > +                       clocks = <&ccu CLK_PLL_PERIPH_SATA>,
> > +                                <&ccu CLK_AHB_SATA>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -926,7 +445,7 @@
> >                         compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
> >                         reg = <0x01c1c000 0x100>;
> >                         interrupts = <40>;
> > -                       clocks = <&ahb_gates 3>;
> > +                       clocks = <&ccu CLK_AHB_EHCI1>;
> >                         phys = <&usbphy 2>;
> >                         phy-names = "usb";
> >                         status = "disabled";
> > @@ -936,7 +455,7 @@
> >                         compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
> >                         reg = <0x01c1c400 0x100>;
> >                         interrupts = <65>;
> > -                       clocks = <&usb_clk 7>, <&ahb_gates 4>;
> > +                       clocks = <&ccu CLK_USB_OHCI1>, <&ccu CLK_AHB_OHCI1>;
> >                         phys = <&usbphy 2>;
> >                         phy-names = "usb";
> >                         status = "disabled";
> > @@ -946,7 +465,7 @@
> >                         compatible = "allwinner,sun4i-a10-spi";
> >                         reg = <0x01c1f000 0x1000>;
> >                         interrupts = <50>;
> > -                       clocks = <&ahb_gates 23>, <&spi3_clk>;
> > +                       clocks = <&ccu CLK_AHB_SPI3>, <&ccu CLK_SPI3>;
> >                         clock-names = "ahb", "mod";
> >                         dmas = <&dma SUN4I_DMA_DEDICATED 31>,
> >                                <&dma SUN4I_DMA_DEDICATED 30>;
> > @@ -956,6 +475,15 @@
> >                         #size-cells = <0>;
> >                 };
> >
> > +               ccu: clock at 01c20000 {
> > +                       compatible = "allwinner,sun4i-a10-ccu";
> > +                       reg = <0x01c20000 0x400>;
> > +                       clocks = <&osc24M>, <&osc32k>;
> > +                       clock-names = "hosc", "losc";
> > +                       #clock-cells = <1>;
> > +                       #reset-cells = <1>;
> > +               };
> > +
> >                 intc: interrupt-controller at 01c20400 {
> >                         compatible = "allwinner,sun4i-a10-ic";
> >                         reg = <0x01c20400 0x400>;
> > @@ -967,7 +495,7 @@
> >                         compatible = "allwinner,sun4i-a10-pinctrl";
> >                         reg = <0x01c20800 0x400>;
> >                         interrupts = <28>;
> > -                       clocks = <&apb0_gates 5>, <&osc24M>, <&osc32k>;
> > +                       clocks = <&ccu CLK_APB0_PIO>, <&osc24M>, <&osc32k>;
> >                         clock-names = "apb", "hosc", "losc";
> >                         gpio-controller;
> >                         interrupt-controller;
> > @@ -1145,7 +673,7 @@
> >                         compatible = "allwinner,sun4i-a10-spdif";
> >                         reg = <0x01c21000 0x400>;
> >                         interrupts = <13>;
> > -                       clocks = <&apb0_gates 1>, <&spdif_clk>;
> > +                       clocks = <&ccu CLK_APB0_SPDIF>, <&ccu CLK_SPDIF>;
> >                         clock-names = "apb", "spdif";
> >                         dmas = <&dma SUN4I_DMA_NORMAL 2>,
> >                                <&dma SUN4I_DMA_NORMAL 2>;
> > @@ -1155,7 +683,7 @@
> >
> >                 ir0: ir at 01c21800 {
> >                         compatible = "allwinner,sun4i-a10-ir";
> > -                       clocks = <&apb0_gates 6>, <&ir0_clk>;
> > +                       clocks = <&ccu CLK_APB0_IR0>, <&ccu CLK_IR0>;
> >                         clock-names = "apb", "ir";
> >                         interrupts = <5>;
> >                         reg = <0x01c21800 0x40>;
> > @@ -1164,7 +692,7 @@
> >
> >                 ir1: ir at 01c21c00 {
> >                         compatible = "allwinner,sun4i-a10-ir";
> > -                       clocks = <&apb0_gates 7>, <&ir1_clk>;
> > +                       clocks = <&ccu CLK_APB0_IR1>, <&ccu CLK_IR1>;
> >                         clock-names = "apb", "ir";
> >                         interrupts = <6>;
> >                         reg = <0x01c21c00 0x40>;
> > @@ -1183,7 +711,7 @@
> >                         compatible = "allwinner,sun4i-a10-codec";
> >                         reg = <0x01c22c00 0x40>;
> >                         interrupts = <30>;
> > -                       clocks = <&apb0_gates 0>, <&codec_clk>;
> > +                       clocks = <&ccu CLK_APB0_CODEC>, <&ccu CLK_CODEC>;
> >                         clock-names = "apb", "codec";
> >                         dmas = <&dma SUN4I_DMA_NORMAL 19>,
> >                                <&dma SUN4I_DMA_NORMAL 19>;
> > @@ -1209,7 +737,7 @@
> >                         interrupts = <1>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 16>;
> > +                       clocks = <&ccu CLK_APB1_UART0>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1219,7 +747,7 @@
> >                         interrupts = <2>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 17>;
> > +                       clocks = <&ccu CLK_APB1_UART1>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1229,7 +757,7 @@
> >                         interrupts = <3>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 18>;
> > +                       clocks = <&ccu CLK_APB1_UART2>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1239,7 +767,7 @@
> >                         interrupts = <4>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 19>;
> > +                       clocks = <&ccu CLK_APB1_UART3>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1249,7 +777,7 @@
> >                         interrupts = <17>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 20>;
> > +                       clocks = <&ccu CLK_APB1_UART4>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1259,7 +787,7 @@
> >                         interrupts = <18>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 21>;
> > +                       clocks = <&ccu CLK_APB1_UART5>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1269,7 +797,7 @@
> >                         interrupts = <19>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 22>;
> > +                       clocks = <&ccu CLK_APB1_UART6>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1279,7 +807,7 @@
> >                         interrupts = <20>;
> >                         reg-shift = <2>;
> >                         reg-io-width = <4>;
> > -                       clocks = <&apb1_gates 23>;
> > +                       clocks = <&ccu CLK_APB1_UART7>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1287,7 +815,7 @@
> >                         compatible = "allwinner,sun4i-a10-i2c";
> >                         reg = <0x01c2ac00 0x400>;
> >                         interrupts = <7>;
> > -                       clocks = <&apb1_gates 0>;
> > +                       clocks = <&ccu CLK_APB1_I2C0>;
> >                         status = "disabled";
> >                         #address-cells = <1>;
> >                         #size-cells = <0>;
> > @@ -1297,7 +825,7 @@
> >                         compatible = "allwinner,sun4i-a10-i2c";
> >                         reg = <0x01c2b000 0x400>;
> >                         interrupts = <8>;
> > -                       clocks = <&apb1_gates 1>;
> > +                       clocks = <&ccu CLK_APB1_I2C1>;
> >                         status = "disabled";
> >                         #address-cells = <1>;
> >                         #size-cells = <0>;
> > @@ -1307,7 +835,7 @@
> >                         compatible = "allwinner,sun4i-a10-i2c";
> >                         reg = <0x01c2b400 0x400>;
> >                         interrupts = <9>;
> > -                       clocks = <&apb1_gates 2>;
> > +                       clocks = <&ccu CLK_APB1_I2C2>;
> >                         status = "disabled";
> >                         #address-cells = <1>;
> >                         #size-cells = <0>;
> > @@ -1317,7 +845,7 @@
> >                         compatible = "allwinner,sun4i-a10-ps2";
> >                         reg = <0x01c2a000 0x400>;
> >                         interrupts = <62>;
> > -                       clocks = <&apb1_gates 6>;
> > +                       clocks = <&ccu CLK_APB1_PS20>;
> >                         status = "disabled";
> >                 };
> >
> > @@ -1325,7 +853,7 @@
> >                         compatible = "allwinner,sun4i-a10-ps2";
> >                         reg = <0x01c2a400 0x400>;
> >                         interrupts = <63>;
> > -                       clocks = <&apb1_gates 7>;
> > +                       clocks = <&ccu CLK_APB1_PS21>;
> >                         status = "disabled";
> >                 };
> >         };
> > --
> > git-series 0.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply

* [PATCH v2] PCI: keystone: fix interrupt-controller-node lookup
From: Bjorn Helgaas @ 2017-12-12 17:25 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171211104233.GB3225@red-moon>

On Mon, Dec 11, 2017 at 10:42:33AM +0000, Lorenzo Pieralisi wrote:
> On Mon, Dec 11, 2017 at 11:29:55AM +0100, Johan Hovold wrote:
> > On Fri, Nov 17, 2017 at 02:38:31PM +0100, Johan Hovold wrote:
> > > Fix child-node lookup during initialisation which was using the wrong
> > > OF-helper and ended up searching the whole device tree depth-first
> > > starting at the parent rather than just matching on its children.
> > > 
> > > To make things worse, the parent pci node could end up being prematurely
> > > freed as of_find_node_by_name() drops a reference to its first argument.
> > > Any matching child interrupt-controller node was also leaked.
> > > 
> > > Fixes: 0c4ffcfe1fbc ("PCI: keystone: Add TI Keystone PCIe driver")
> > > Cc: stable <stable@vger.kernel.org>     # 3.18
> > > Acked-by: Murali Karicheri <m-karicheri2@ti.com>
> > > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > > Signed-off-by: Johan Hovold <johan@kernel.org>
> > > ---
> > > 
> > > v2
> > >  - amend commit message and mention explicitly that of_find_node_by_name()
> > >    drops a reference to the start node
> > >  - add Murali's and Lorenzo's acks
> > 
> > This one hasn't shown up in linux-next, so sending a reminder to make
> > sure it doesn't fall between the cracks.
> 
> Hi Johan,
> 
> yes it is in the list of fixes to be sent upstream - I was about to
> ask Bjorn to apply it.

Is this something that needs to be merged for v4.15?  If so, I need to
be able to defend it to Linus as being a critical fix.  If the issue
been around for 3 years (v3.18 was tagged Dec 7 2014), that requires
pretty "clear and present danger."

>From the commit log, I see a sub-optimal search (not critical), a
possible use-after-free (could conceivably be critical if people are
tripping over this, but would need more specifics about that), and a
leak (not critical).

Given what I can see now, my inclination would be for Lorenzo to queue
it for v4.16, which would still get in linux-next soonish.

Bjorn

^ permalink raw reply

* [PATCH v5 4/9] drivers: base cacheinfo: Add support for ACPI based firmware tables
From: Rafael J. Wysocki @ 2017-12-12 17:25 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <5024a041-2ef4-3912-994f-b5fcc945e916@arm.com>

On Tue, Dec 12, 2017 at 6:03 PM, Jeremy Linton <jeremy.linton@arm.com> wrote:
> Hi,
>
>
> On 12/11/2017 07:11 PM, Rafael J. Wysocki wrote:
>>
>> On Friday, December 1, 2017 11:23:25 PM CET Jeremy Linton wrote:
>>>
>>> Add a entry to to struct cacheinfo to maintain a reference to the PPTT
>>> node which can be used to match identical caches across cores. Also
>>> stub out cache_setup_acpi() so that individual architectures can
>>> enable ACPI topology parsing.
>>>
>>> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
>>> ---
>>>   drivers/acpi/pptt.c       |  1 +
>>>   drivers/base/cacheinfo.c  | 20 ++++++++++++++------
>>>   include/linux/cacheinfo.h | 13 ++++++++++++-
>>>   3 files changed, 27 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
>>> index 0f8a1631af33..a35e457cefb7 100644
>>> --- a/drivers/acpi/pptt.c
>>> +++ b/drivers/acpi/pptt.c
>>> @@ -329,6 +329,7 @@ static void update_cache_properties(struct cacheinfo
>>> *this_leaf,
>>>   {
>>>         int valid_flags = 0;
>>>   +     this_leaf->firmware_node = cpu_node;
>>>         if (found_cache->flags & ACPI_PPTT_SIZE_PROPERTY_VALID) {
>>>                 this_leaf->size = found_cache->size;
>>>                 valid_flags++;
>>> diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
>>> index eb3af2739537..ba89f9310e6f 100644
>>> --- a/drivers/base/cacheinfo.c
>>> +++ b/drivers/base/cacheinfo.c
>>> @@ -86,7 +86,10 @@ static int cache_setup_of_node(unsigned int cpu)
>>>   static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
>>>                                            struct cacheinfo *sib_leaf)
>>>   {
>>> -       return sib_leaf->of_node == this_leaf->of_node;
>>> +       if (acpi_disabled)
>>> +               return sib_leaf->of_node == this_leaf->of_node;
>>> +       else
>>> +               return sib_leaf->firmware_node ==
>>> this_leaf->firmware_node;
>>>   }
>>>     /* OF properties to query for a given cache type */
>>> @@ -215,6 +218,11 @@ static inline bool cache_leaves_are_shared(struct
>>> cacheinfo *this_leaf,
>>>   }
>>>   #endif
>>>   +int __weak cache_setup_acpi(unsigned int cpu)
>>> +{
>>> +       return -ENOTSUPP;
>>> +}
>>> +
>>>   static int cache_shared_cpu_map_setup(unsigned int cpu)
>>>   {
>>>         struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
>>> @@ -225,11 +233,11 @@ static int cache_shared_cpu_map_setup(unsigned int
>>> cpu)
>>>         if (this_cpu_ci->cpu_map_populated)
>>>                 return 0;
>>>   -     if (of_have_populated_dt())
>>> +       if (!acpi_disabled)
>>> +               ret = cache_setup_acpi(cpu);
>>> +       else if (of_have_populated_dt())
>>>                 ret = cache_setup_of_node(cpu);
>>> -       else if (!acpi_disabled)
>>> -               /* No cache property/hierarchy support yet in ACPI */
>>> -               ret = -ENOTSUPP;
>>> +
>>>         if (ret)
>>>                 return ret;
>>>   @@ -286,7 +294,7 @@ static void cache_shared_cpu_map_remove(unsigned
>>> int cpu)
>>>     static void cache_override_properties(unsigned int cpu)
>>>   {
>>> -       if (of_have_populated_dt())
>>> +       if (acpi_disabled && of_have_populated_dt())
>>>                 return cache_of_override_properties(cpu);
>>>   }
>>>   diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
>>> index 3d9805297cda..7ebff157ae6c 100644
>>> --- a/include/linux/cacheinfo.h
>>> +++ b/include/linux/cacheinfo.h
>>> @@ -37,6 +37,8 @@ enum cache_type {
>>>    * @of_node: if devicetree is used, this represents either the cpu node
>>> in
>>>    *    case there's no explicit cache node or the cache node itself in
>>> the
>>>    *    device tree
>>> + * @firmware_node: When not using DT, this may contain pointers to other
>>> + *     firmware based values. Particularly ACPI/PPTT unique values.
>>>    * @disable_sysfs: indicates whether this node is visible to the user
>>> via
>>>    *    sysfs or not
>>>    * @priv: pointer to any private data structure specific to particular
>>> @@ -65,8 +67,8 @@ struct cacheinfo {
>>>   #define CACHE_ALLOCATE_POLICY_MASK    \
>>>         (CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE)
>>>   #define CACHE_ID              BIT(4)
>>> -
>>>         struct device_node *of_node;
>>> +       void *firmware_node;
>>
>>
>> What about converting this to using struct fwnode instead of adding
>> fields to it?
>
>
> I didn't really want to add another field here, but I've also pointed out
> how I thought converting it to a fwnode wasn't a good choice.
>
> https://lkml.org/lkml/2017/11/20/502
>
> Mostly because IMHO its even more misleading (lacking any fwnode_operations)
> than misusing the of_node as a void *.

I'm not sure what you mean.

Anyway, the idea is to have one pointer in there instead of two that
cannot be used at the same time and there's no reason why of_node
should be special.

of_node should just be one of multiple choices.

> Given that I'm in the minority thinking this, how far down the fwnode path
> on the ACPI side do we want to go?

I have no idea. :-)

> Is simply treating it as a void pointer
> sufficient for the ACPI side, considering all the PPTT code needs is a
> unique token?

I guess you can think about it as of_node under a different name, but
whether or not this is sufficient depends on what you need it for.

Thanks,
Rafael

^ permalink raw reply

* WARNING: suspicious RCU usage
From: Paul E. McKenney @ 2017-12-12 17:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOMZO5AftAWz339Sy+oxQ8K9Dr04Jyf8SV0R0JGrcPaL-VQLMQ@mail.gmail.com>

On Tue, Dec 12, 2017 at 02:56:18PM -0200, Fabio Estevam wrote:
> Hi Paul,
> 
> On Tue, Dec 12, 2017 at 2:49 PM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> 
> > On the perhaps unlikely off-chance that it is both useful and welcome,
> > the (untested, probably does not even build) patch below illustrates the
> > use of smp_call_function_single().  This is based on the patch Russell
> > sent -- for all I know, it might well be that there are other places
> > needing similar changes.
> >
> > But something to try out for anyone wishing to do so.
> >
> >                                                         Thanx, Paul
> >
> > ------------------------------------------------------------------------
> >
> > commit c579a1494ccbc7ebf5548115571a2988ea1a1fe5
> > Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > Date:   Mon Dec 11 09:40:58 2017 -0800
> >
> >     ARM: CPU hotplug: Delegate complete() to surviving CPU
> >
> >     The ARM implementation of arch_cpu_idle_dead() invokes complete(), but
> >     does so after RCU has stopped watching the outgoing CPU, which results
> >     in lockdep complaints because complete() invokes functions containing RCU
> >     readers.  This patch therefore uses Thomas Gleixner's trick of delegating
> >     the complete() call to a surviving CPU via smp_call_function_single().
> >
> >     This patch is untested, and probably does not even build.
> >
> >     Reported-by: Peng Fan <van.freenix@gmail.com>
> >     Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
> >     Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> With your patch applied I no longer get the RCU warning, thanks:
> 
> Tested-by: Fabio Estevam <fabio.estevam@nxp.com>

Well, I guess that it is no longer untested, and thank you for that.  ;-)

I sent a more official posting of the patch.

							Thanx, Paul

^ permalink raw reply

* [PATCH] ARM: CPU hotplug: Delegate complete() to surviving CPU
From: Paul E. McKenney @ 2017-12-12 17:20 UTC (permalink / raw)
  To: linux-arm-kernel

The ARM implementation of arch_cpu_idle_dead() invokes complete(), but
does so after RCU has stopped watching the outgoing CPU, which results
in lockdep complaints because complete() invokes functions containing RCU
readers.  This patch therefore uses Thomas Gleixner's trick of delegating
the complete() call to a surviving CPU via smp_call_function_single().

Reported-by: Peng Fan <van.freenix@gmail.com>
Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <linux-arm-kernel@lists.infradead.org>

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index b4fbf00ee4ad..75f85e20aafa 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -267,6 +267,14 @@ void __cpu_die(unsigned int cpu)
 }
 
 /*
+ * Invoke complete() on behalf of the outgoing CPU.
+ */
+static void arch_cpu_idle_dead_complete(void *arg)
+{
+	complete(&cpu_died);
+}
+
+/*
  * Called from the idle thread for the CPU which has been shutdown.
  *
  * Note that we disable IRQs here, but do not re-enable them
@@ -293,9 +301,11 @@ void arch_cpu_idle_dead(void)
 	/*
 	 * Tell __cpu_die() that this CPU is now safe to dispose of.  Once
 	 * this returns, power and/or clocks can be removed at any point
-	 * from this CPU and its cache by platform_cpu_kill().
+	 * from this CPU and its cache by platform_cpu_kill().  We cannot
+	 * call complete() this late, so we delegate it to an online CPU.
 	 */
-	complete(&cpu_died);
+	smp_call_function_single(cpumask_first(cpu_online_mask),
+				 arch_cpu_idle_dead_complete, NULL, 0);
 
 	/*
 	 * Ensure that the cache lines associated with that completion are

^ permalink raw reply related

* [PATCH] mmc: sdhci-of-arasan: Disable clk_xin clock in the remove
From: Flavio Ceolin @ 2017-12-12 17:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <3d975547-3f25-eaab-29fe-c06ee4cb206b@xilinx.com>

Hi Michal,

> On 12.12.2017 09:19, Flavio Ceolin wrote:
>> clk_xin is properly prepared/enabled on sdhci_arasan_probe(), and
>> unprepared/disabled in the error path, but it is not being
>> unprepared/disabled on sdhci_arasan_remove().
>> 
>> Found by Linux Driver Verification project (linuxtesting.org).
>> 
>> Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
>> ---
>>  drivers/mmc/host/sdhci-of-arasan.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
>> index 0720ea7..69bd260 100644
>> --- a/drivers/mmc/host/sdhci-of-arasan.c
>> +++ b/drivers/mmc/host/sdhci-of-arasan.c
>> @@ -692,6 +692,7 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
>>  	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
>>  	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
>>  	struct clk *clk_ahb = sdhci_arasan->clk_ahb;
>> +	struct clk *clk_xin = devm_clk_get(&pdev->dev, "clk_xin");
>
> I don't think this is right. You have already asked for this clock in
> probe. It means you should reuse pltfm_host->clk = clk_xin;
>
> And if you look at sdhci_pltfm_unregister you will find out that
> clk_disable_unprepare(pltfm_host->clk);
> is called there.

Yep, I confirm that. You're right, the patch is wrong, sorry for that :)
>
>>  
>>  	if (!IS_ERR(sdhci_arasan->phy)) {
>>  		if (sdhci_arasan->is_phy_on)
>> @@ -705,6 +706,9 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
>>  
>>  	clk_disable_unprepare(clk_ahb);
>>  
>> +	if (!IS_ERR(clk_xin))
>
> And clk_xin is required property.
>
>> +		clk_disable_unprepare(clk_xin);
>> +
>>  	return ret;
>>  }
>>  
>> 
>
> It means NACK from me.
>
> Thanks,
> Michal

Regards,
Flavio Ceolin

^ permalink raw reply

* [PATCH net-next v5 1/2] net: add support for Cavium PTP coprocessor
From: Richard Cochran @ 2017-12-12 17:12 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <d1e2faeb-ba5e-f324-efb5-da64e4b3ced3@cavium.com>

On Tue, Dec 12, 2017 at 12:41:35PM +0300, Aleksey Makarov wrote:
> If ptp_clock_register() returns NULL, the device is still paired with the driver,
> but the driver is not registered in the PTP core.  When ethernet driver needs
> the reference to this cavium PTP driver, it calls cavium_ptp_get() that checks
> if ptp->ptp_clock is NULL and, if so, returns -ENODEV.

The pointer clock->ptp_clock can be NULL.

Yet you de-reference it here:

> +static void cavium_ptp_remove(struct pci_dev *pdev)
> +{
> +	struct cavium_ptp *clock = pci_get_drvdata(pdev);
> +	u64 clock_cfg;
> +
> +	pci_set_drvdata(pdev, NULL);
> +
> +	ptp_clock_unregister(clock->ptp_clock);
> +
> +	clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG);
> +	clock_cfg &= ~PTP_CLOCK_CFG_PTP_EN;
> +	writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG);
> +}

and here:

> +static inline int cavium_ptp_clock_index(struct cavium_ptp *clock)
> +{
> +	return ptp_clock_index(clock->ptp_clock);
> +}

That needs to be fixed.

Thanks,
Richard

^ permalink raw reply

* [PATCH v5 4/9] drivers: base cacheinfo: Add support for ACPI based firmware tables
From: Jeremy Linton @ 2017-12-12 17:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <2078459.JrYtfXc8fv@aspire.rjw.lan>

Hi,

On 12/11/2017 07:11 PM, Rafael J. Wysocki wrote:
> On Friday, December 1, 2017 11:23:25 PM CET Jeremy Linton wrote:
>> Add a entry to to struct cacheinfo to maintain a reference to the PPTT
>> node which can be used to match identical caches across cores. Also
>> stub out cache_setup_acpi() so that individual architectures can
>> enable ACPI topology parsing.
>>
>> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
>> ---
>>   drivers/acpi/pptt.c       |  1 +
>>   drivers/base/cacheinfo.c  | 20 ++++++++++++++------
>>   include/linux/cacheinfo.h | 13 ++++++++++++-
>>   3 files changed, 27 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
>> index 0f8a1631af33..a35e457cefb7 100644
>> --- a/drivers/acpi/pptt.c
>> +++ b/drivers/acpi/pptt.c
>> @@ -329,6 +329,7 @@ static void update_cache_properties(struct cacheinfo *this_leaf,
>>   {
>>   	int valid_flags = 0;
>>   
>> +	this_leaf->firmware_node = cpu_node;
>>   	if (found_cache->flags & ACPI_PPTT_SIZE_PROPERTY_VALID) {
>>   		this_leaf->size = found_cache->size;
>>   		valid_flags++;
>> diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
>> index eb3af2739537..ba89f9310e6f 100644
>> --- a/drivers/base/cacheinfo.c
>> +++ b/drivers/base/cacheinfo.c
>> @@ -86,7 +86,10 @@ static int cache_setup_of_node(unsigned int cpu)
>>   static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
>>   					   struct cacheinfo *sib_leaf)
>>   {
>> -	return sib_leaf->of_node == this_leaf->of_node;
>> +	if (acpi_disabled)
>> +		return sib_leaf->of_node == this_leaf->of_node;
>> +	else
>> +		return sib_leaf->firmware_node == this_leaf->firmware_node;
>>   }
>>   
>>   /* OF properties to query for a given cache type */
>> @@ -215,6 +218,11 @@ static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
>>   }
>>   #endif
>>   
>> +int __weak cache_setup_acpi(unsigned int cpu)
>> +{
>> +	return -ENOTSUPP;
>> +}
>> +
>>   static int cache_shared_cpu_map_setup(unsigned int cpu)
>>   {
>>   	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
>> @@ -225,11 +233,11 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
>>   	if (this_cpu_ci->cpu_map_populated)
>>   		return 0;
>>   
>> -	if (of_have_populated_dt())
>> +	if (!acpi_disabled)
>> +		ret = cache_setup_acpi(cpu);
>> +	else if (of_have_populated_dt())
>>   		ret = cache_setup_of_node(cpu);
>> -	else if (!acpi_disabled)
>> -		/* No cache property/hierarchy support yet in ACPI */
>> -		ret = -ENOTSUPP;
>> +
>>   	if (ret)
>>   		return ret;
>>   
>> @@ -286,7 +294,7 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
>>   
>>   static void cache_override_properties(unsigned int cpu)
>>   {
>> -	if (of_have_populated_dt())
>> +	if (acpi_disabled && of_have_populated_dt())
>>   		return cache_of_override_properties(cpu);
>>   }
>>   
>> diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
>> index 3d9805297cda..7ebff157ae6c 100644
>> --- a/include/linux/cacheinfo.h
>> +++ b/include/linux/cacheinfo.h
>> @@ -37,6 +37,8 @@ enum cache_type {
>>    * @of_node: if devicetree is used, this represents either the cpu node in
>>    *	case there's no explicit cache node or the cache node itself in the
>>    *	device tree
>> + * @firmware_node: When not using DT, this may contain pointers to other
>> + *	firmware based values. Particularly ACPI/PPTT unique values.
>>    * @disable_sysfs: indicates whether this node is visible to the user via
>>    *	sysfs or not
>>    * @priv: pointer to any private data structure specific to particular
>> @@ -65,8 +67,8 @@ struct cacheinfo {
>>   #define CACHE_ALLOCATE_POLICY_MASK	\
>>   	(CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE)
>>   #define CACHE_ID		BIT(4)
>> -
>>   	struct device_node *of_node;
>> +	void *firmware_node;
> 
> What about converting this to using struct fwnode instead of adding
> fields to it?

I didn't really want to add another field here, but I've also pointed 
out how I thought converting it to a fwnode wasn't a good choice.

https://lkml.org/lkml/2017/11/20/502

Mostly because IMHO its even more misleading (lacking any 
fwnode_operations) than misusing the of_node as a void *.

Given that I'm in the minority thinking this, how far down the fwnode 
path on the ACPI side do we want to go? Is simply treating it as a void 
pointer sufficient for the ACPI side, considering all the PPTT code 
needs is a unique token?


> 
>>   	bool disable_sysfs;
>>   	void *priv;
>>   };
>> @@ -99,6 +101,15 @@ int func(unsigned int cpu)					\
>>   struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
>>   int init_cache_level(unsigned int cpu);
>>   int populate_cache_leaves(unsigned int cpu);
>> +int cache_setup_acpi(unsigned int cpu);
>> +int acpi_find_last_cache_level(unsigned int cpu);
>> +#ifndef CONFIG_ACPI
>> +int acpi_find_last_cache_level(unsigned int cpu)
>> +{
>> +	/*ACPI kernels should be built with PPTT support*/
>> +	return 0;
>> +}
>> +#endif
>>   
>>   const struct attribute_group *cache_get_priv_group(struct cacheinfo *this_leaf);
>>   
>>
> 
> Thanks,
> Rafael
> 

^ permalink raw reply

* [PATCH v5 1/8] clocksource: dmtimer: Remove all the exports
From: Tony Lindgren @ 2017-12-12 17:00 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <7c92b0c2-8784-9c14-66b0-a19fe68f08ad@ti.com>

* Keerthy <j-keerthy@ti.com> [171212 08:25]:
> 
> 
> On Tuesday 12 December 2017 01:49 PM, Ladislav Michl wrote:
> > On Tue, Dec 12, 2017 at 01:38:04PM +0530, Keerthy wrote:
> >> On Tuesday 12 December 2017 01:31 PM, Ladislav Michl wrote:
> >>> On Tue, Dec 12, 2017 at 01:01:51PM +0530, Keerthy wrote:
> >>>>
> >>>>
> >>>> On Tuesday 12 December 2017 12:46 PM, Ladislav Michl wrote:
> >>>>> Keerthy,
> >>>>>
> >>>>> On Tue, Dec 12, 2017 at 11:42:10AM +0530, Keerthy wrote:
> >>>>>> Remove all the unwanted exports from the driver
> >>>>>
> >>>>> I'm adding event capture capability to the pwm-omap driver and so far used
> >>>>> v4.15-rc3 as codebase.
> >>>>>
> >>>>> Intended use is an IR receiver; for that I need to measure pulses width and
> >>>>> spaces between pulses. So DM timer was setup to generate interupt after
> >>>>> both TCAR1 and TCAR2 are filled, values are passed to IR decoder and
> >>>>> TCAR_IT_FLAG is cleared.
> >>>>>
> >>>>> Of course, this is just proof of concept and needs to be polished and
> >>>>> generalized, but to make it at least work I need functions you just
> >>>>> unexported (plus some new).
> >>>>>
> >>>>> Question is whenever we need this level of indirection (omap_dm_timer_ops)
> >>>>> or plain exports are enough.
> >>>>
> >>>> The general guidance is not to do plain exports and go via
> >>>> omap_dm_timer_ops.
> >>>
> >>> ...in contrary what other clocksource drivers are doing.

Hmm what do you mean? We don't want to export tons of custom functions from
the timers in and then be in trouble when at some point we have a Linux
generic hw timer framework. We already had to deal with these custom
exports earlier with conversion to multiarch and then again with
device tree.

For now, it's best to pass the timer information to the pwm driver in
platform data. In the long run that will be much easier to deal with than
fixing random drivers tinkering with the timer registers directly.

> >>> Now I'm assuming it is okay to extend omap_dm_timer_ops. That would mean
> >>> check for ops members to be assigned should be also extended or we should
> >>> delete it altogether and assume all members are populated?
> >>
> >> It should be fine to extend omap_dm_timer_ops. What are the ops missing
> >> for your new implementation?
> > 
> > Read capture registers, configure capture and ack interrupt. Perhaps set_pwm
> > could be extended to configure capture as well.
> > 
> > I'll update my code on top of your changes and we'll see how it would work.

Ideally the pwm driver would just do a request_irq from the dmtimer code
where dmtimer code would implement an interrupt controller. That would
be already most fo the Linux generic hardware timer framework right there :)

Regards,

Tony

^ permalink raw reply

* [PATCH 04/41] drm/rockchip: Respect page offset for PRIME mmap calls
From: Heiko Stuebner @ 2017-12-12 16:58 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20170310043305.17216-5-seanpaul@chromium.org>

Hi,

Am Donnerstag, 9. M?rz 2017, 23:32:19 CET schrieb Sean Paul:
> From: ?rjan Eide <orjan.eide@arm.com>
> 
> When mapping external DMA-bufs through the PRIME mmap call, we might be
> given an offset which has to be respected. However for the internal DRM
> GEM mmap path, we have to ignore the fake mmap offset used to identify
> the buffer only. Currently the code always zeroes out vma->vm_pgoff,
> which breaks the former.
> 
> This patch fixes the problem by moving the vm_pgoff assignment to a
> function that is used only for GEM mmap path, so that the PRIME path
> retains the original offset.
> 
> BUG=chrome-os-partner:56615
> TEST=graphics_GLBench

Unneeded chromeos-cruft.

> Cc: Daniel Kurtz <djkurtz@chromium.org>
> Signed-off-by: ?rjan Eide <orjan.eide@arm.com>
> Signed-off-by: Tomasz Figa <tfiga@chromium.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

With the same testas patch 3  (rk3328 + lima)
Tested-by: Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply

* arm64: unhandled level 0 translation fault
From: Will Deacon @ 2017-12-12 16:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAMuHMdVnFyFv0Q6PaBEb6RpfJYkSzpvNUy8XtEWczES+uEO=6Q@mail.gmail.com>

On Tue, Dec 12, 2017 at 05:00:33PM +0100, Geert Uytterhoeven wrote:
> On Tue, Dec 12, 2017 at 4:11 PM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > On Tue, Dec 12, 2017 at 11:36 AM, Will Deacon <will.deacon@arm.com> wrote:
> >> On Tue, Dec 12, 2017 at 11:20:09AM +0100, Geert Uytterhoeven wrote:
> >>> During userspace (Debian jessie NFS root) boot on arm64:
> >>>
> >>> rpcbind[1083]: unhandled level 0 translation fault (11) at 0x00000008,
> >>> esr 0x92000004, in dash[aaaaadf77000+1a000]
> >>> CPU: 0 PID: 1083 Comm: rpcbind Not tainted
> >>> 4.15.0-rc3-arm64-renesas-02176-g14f9a1826e48e355 #51
> >>> Hardware name: Renesas Salvator-X 2nd version board based on r8a7795 ES2.0+ (DT)
> >>> pstate: 80000000 (Nzcv daif -PAN -UAO)
> >>> pc : 0xaaaaadf8a51c
> >>> lr : 0xaaaaadf8ac08
> >>> sp : 0000ffffcffeac00
> >>> x29: 0000ffffcffeac00 x28: 0000aaaaadfa1000
> >>> x27: 0000ffffcffebf7c x26: 0000ffffcffead20
> >>> x25: 0000aaaacea1c5f0 x24: 0000000000000000
> >>> x23: 0000aaaaadfa1000 x22: 0000aaaaadfa1000
> >>> x21: 0000000000000000 x20: 0000000000000008
> >>> x19: 0000000000000000 x18: 0000ffffcffeb500
> >>> x17: 0000ffffa22babfc x16: 0000aaaaadfa1ae8
> >>> x15: 0000ffffa2363588 x14: ffffffffffffffff
> >>> x13: 0000000000000020 x12: 0000000000000010
> >>> x11: 0101010101010101 x10: 0000aaaaadfa1000
> >>> x9 : 00000000ffffff81 x8 : 0000aaaaadfa2000
> >>> x7 : 0000000000000000 x6 : 0000000000000000
> >>> x5 : 0000aaaaadfa2338 x4 : 0000aaaaadfa2000
> >>> x3 : 0000aaaaadfa2338 x2 : 0000000000000000
> >>> x1 : 0000aaaaadfa28b0 x0 : 0000aaaaadfa4c30
> >>>
> >>> Sometimes it happens with other processes, but the main address, esr, and
> >>> pstate values are always the same.
> >>>
> >>> I regularly run arm64/for-next/core (through bi-weekly renesas-drivers
> >>> releases, so the last time was two weeks ago), but never saw the issue
> >>> before until today, so probably v4.15-rc1 is OK.
> >>> Unfortunately it doesn't happen during every boot, which makes it
> >>> cumbersome to bisect.
> >>>
> >>> My first guess was UNMAP_KERNEL_AT_EL0, but even after disabling that,
> >>> and even without today's arm64/for-next/core merged in, I still managed to
> >>> reproduce the issue, so I believe it was introduced in v4.15-rc2 or
> >>> v4.15-rc3.
> >>
> >> Urgh, this looks nasty. Thanks for the report! A few questions:
> >>
> >>  - Can you share your .config somewhere please?
> >
> > I managed to reproduce it on plain v4.15-rc3 using both arm64_defconfig, and
> > renesas_defconfig (from Simon's repo).
> 
> v4.15-rc2 is affected, too.

Do you reckon you can bisect between -rc1 and -rc2? We've been unable to
reproduce this on any of our systems, unfortunately.

Will

^ permalink raw reply

* WARNING: suspicious RCU usage
From: Fabio Estevam @ 2017-12-12 16:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171212164900.GA6673@linux.vnet.ibm.com>

Hi Paul,

On Tue, Dec 12, 2017 at 2:49 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:

> On the perhaps unlikely off-chance that it is both useful and welcome,
> the (untested, probably does not even build) patch below illustrates the
> use of smp_call_function_single().  This is based on the patch Russell
> sent -- for all I know, it might well be that there are other places
> needing similar changes.
>
> But something to try out for anyone wishing to do so.
>
>                                                         Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit c579a1494ccbc7ebf5548115571a2988ea1a1fe5
> Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Date:   Mon Dec 11 09:40:58 2017 -0800
>
>     ARM: CPU hotplug: Delegate complete() to surviving CPU
>
>     The ARM implementation of arch_cpu_idle_dead() invokes complete(), but
>     does so after RCU has stopped watching the outgoing CPU, which results
>     in lockdep complaints because complete() invokes functions containing RCU
>     readers.  This patch therefore uses Thomas Gleixner's trick of delegating
>     the complete() call to a surviving CPU via smp_call_function_single().
>
>     This patch is untested, and probably does not even build.
>
>     Reported-by: Peng Fan <van.freenix@gmail.com>
>     Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
>     Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

With your patch applied I no longer get the RCU warning, thanks:

Tested-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply

* [PATCH 2/2] cpufreq: sort the drivers in ARM part
From: Gregory CLEMENT @ 2017-12-12 16:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171212165419.752-1-gregory.clement@free-electrons.com>

Keep the driver files alphabetically sorted.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/cpufreq/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 812f9e0d01a3..d762e76887e7 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -53,22 +53,24 @@ obj-$(CONFIG_ARM_BIG_LITTLE_CPUFREQ)	+= arm_big_little.o
 obj-$(CONFIG_ARM_DT_BL_CPUFREQ)		+= arm_big_little_dt.o
 
 obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ)	+= brcmstb-avs-cpufreq.o
+obj-$(CONFIG_ACPI_CPPC_CPUFREQ)		+= cppc_cpufreq.o
 obj-$(CONFIG_ARCH_DAVINCI)		+= davinci-cpufreq.o
 obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ)	+= exynos5440-cpufreq.o
 obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ)	+= highbank-cpufreq.o
 obj-$(CONFIG_ARM_IMX6Q_CPUFREQ)		+= imx6q-cpufreq.o
 obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ)	+= kirkwood-cpufreq.o
 obj-$(CONFIG_ARM_MEDIATEK_CPUFREQ)	+= mediatek-cpufreq.o
+obj-$(CONFIG_MACH_MVEBU_V7)		+= mvebu-cpufreq.o
 obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ)	+= omap-cpufreq.o
 obj-$(CONFIG_ARM_PXA2xx_CPUFREQ)	+= pxa2xx-cpufreq.o
 obj-$(CONFIG_PXA3xx)			+= pxa3xx-cpufreq.o
-obj-$(CONFIG_ARM_S3C24XX_CPUFREQ)	+= s3c24xx-cpufreq.o
-obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o
 obj-$(CONFIG_ARM_S3C2410_CPUFREQ)	+= s3c2410-cpufreq.o
 obj-$(CONFIG_ARM_S3C2412_CPUFREQ)	+= s3c2412-cpufreq.o
 obj-$(CONFIG_ARM_S3C2416_CPUFREQ)	+= s3c2416-cpufreq.o
 obj-$(CONFIG_ARM_S3C2440_CPUFREQ)	+= s3c2440-cpufreq.o
 obj-$(CONFIG_ARM_S3C64XX_CPUFREQ)	+= s3c64xx-cpufreq.o
+obj-$(CONFIG_ARM_S3C24XX_CPUFREQ)	+= s3c24xx-cpufreq.o
+obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o
 obj-$(CONFIG_ARM_S5PV210_CPUFREQ)	+= s5pv210-cpufreq.o
 obj-$(CONFIG_ARM_SA1100_CPUFREQ)	+= sa1100-cpufreq.o
 obj-$(CONFIG_ARM_SA1110_CPUFREQ)	+= sa1110-cpufreq.o
@@ -81,8 +83,6 @@ obj-$(CONFIG_ARM_TEGRA124_CPUFREQ)	+= tegra124-cpufreq.o
 obj-$(CONFIG_ARM_TEGRA186_CPUFREQ)	+= tegra186-cpufreq.o
 obj-$(CONFIG_ARM_TI_CPUFREQ)		+= ti-cpufreq.o
 obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ)	+= vexpress-spc-cpufreq.o
-obj-$(CONFIG_ACPI_CPPC_CPUFREQ) += cppc_cpufreq.o
-obj-$(CONFIG_MACH_MVEBU_V7)		+= mvebu-cpufreq.o
 
 
 ##################################################################################
-- 
2.15.1

^ permalink raw reply related

* [PATCH 1/2] cpufreq: ARM: sort the Kconfig menu
From: Gregory CLEMENT @ 2017-12-12 16:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171212165419.752-1-gregory.clement@free-electrons.com>

Group all the related big LITTLE configuration together and sort the
other entries in alphabetic order.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/cpufreq/Kconfig.arm | 82 ++++++++++++++++++++++-----------------------
 1 file changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index bdce4488ded1..0baf43837b51 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -2,6 +2,23 @@
 # ARM CPU Frequency scaling drivers
 #
 
+config ACPI_CPPC_CPUFREQ
+	tristate "CPUFreq driver based on the ACPI CPPC spec"
+	depends on ACPI_PROCESSOR
+	select ACPI_CPPC_LIB
+	default n
+	help
+	  This adds a CPUFreq driver which uses CPPC methods
+	  as described in the ACPIv5.1 spec. CPPC stands for
+	  Collaborative Processor Performance Controls. It
+	  is based on an abstract continuous scale of CPU
+	  performance values which allows the remote power
+	  processor to flexibly optimize for power and
+	  performance. CPPC relies on power management firmware
+	  support for its operation.
+
+	  If in doubt, say N.
+
 # big LITTLE core layer and glue drivers
 config ARM_BIG_LITTLE_CPUFREQ
 	tristate "Generic ARM big LITTLE CPUfreq driver"
@@ -12,6 +29,30 @@ config ARM_BIG_LITTLE_CPUFREQ
 	help
 	  This enables the Generic CPUfreq driver for ARM big.LITTLE platforms.
 
+config ARM_DT_BL_CPUFREQ
+	tristate "Generic probing via DT for ARM big LITTLE CPUfreq driver"
+	depends on ARM_BIG_LITTLE_CPUFREQ && OF
+	help
+	  This enables probing via DT for Generic CPUfreq driver for ARM
+	  big.LITTLE platform. This gets frequency tables from DT.
+
+config ARM_SCPI_CPUFREQ
+        tristate "SCPI based CPUfreq driver"
+	depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI
+        help
+	  This adds the CPUfreq driver support for ARM big.LITTLE platforms
+	  using SCPI protocol for CPU power management.
+
+	  This driver uses SCPI Message Protocol driver to interact with the
+	  firmware providing the CPU DVFS functionality.
+
+config ARM_VEXPRESS_SPC_CPUFREQ
+        tristate "Versatile Express SPC based CPUfreq driver"
+	depends on ARM_BIG_LITTLE_CPUFREQ && ARCH_VEXPRESS_SPC
+        help
+          This add the CPUfreq driver support for Versatile Express
+	  big.LITTLE platforms using SPC for power management.
+
 config ARM_BRCMSTB_AVS_CPUFREQ
 	tristate "Broadcom STB AVS CPUfreq driver"
 	depends on ARCH_BRCMSTB || COMPILE_TEST
@@ -33,20 +74,6 @@ config ARM_BRCMSTB_AVS_CPUFREQ_DEBUG
 
 	  If in doubt, say N.
 
-config ARM_DT_BL_CPUFREQ
-	tristate "Generic probing via DT for ARM big LITTLE CPUfreq driver"
-	depends on ARM_BIG_LITTLE_CPUFREQ && OF
-	help
-	  This enables probing via DT for Generic CPUfreq driver for ARM
-	  big.LITTLE platform. This gets frequency tables from DT.
-
-config ARM_VEXPRESS_SPC_CPUFREQ
-        tristate "Versatile Express SPC based CPUfreq driver"
-	depends on ARM_BIG_LITTLE_CPUFREQ && ARCH_VEXPRESS_SPC
-        help
-          This add the CPUfreq driver support for Versatile Express
-	  big.LITTLE platforms using SPC for power management.
-
 config ARM_EXYNOS5440_CPUFREQ
 	tristate "SAMSUNG EXYNOS5440"
 	depends on SOC_EXYNOS5440
@@ -205,16 +232,6 @@ config ARM_SA1100_CPUFREQ
 config ARM_SA1110_CPUFREQ
 	bool
 
-config ARM_SCPI_CPUFREQ
-        tristate "SCPI based CPUfreq driver"
-	depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI
-        help
-	  This adds the CPUfreq driver support for ARM big.LITTLE platforms
-	  using SCPI protocol for CPU power management.
-
-	  This driver uses SCPI Message Protocol driver to interact with the
-	  firmware providing the CPU DVFS functionality.
-
 config ARM_SPEAR_CPUFREQ
 	bool "SPEAr CPUFreq support"
 	depends on PLAT_SPEAR
@@ -275,20 +292,3 @@ config ARM_PXA2xx_CPUFREQ
 	  This add the CPUFreq driver support for Intel PXA2xx SOCs.
 
 	  If in doubt, say N.
-
-config ACPI_CPPC_CPUFREQ
-	tristate "CPUFreq driver based on the ACPI CPPC spec"
-	depends on ACPI_PROCESSOR
-	select ACPI_CPPC_LIB
-	default n
-	help
-	  This adds a CPUFreq driver which uses CPPC methods
-	  as described in the ACPIv5.1 spec. CPPC stands for
-	  Collaborative Processor Performance Controls. It
-	  is based on an abstract continuous scale of CPU
-	  performance values which allows the remote power
-	  processor to flexibly optimize for power and
-	  performance. CPPC relies on power management firmware
-	  support for its operation.
-
-	  If in doubt, say N.
-- 
2.15.1

^ permalink raw reply related

* [PATCH 0/2] cpufreq: Sort Kconfig and Makefile
From: Gregory CLEMENT @ 2017-12-12 16:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

The patch of this series was originally part of the series "Add CPU
Frequency scaling support on Armada 37xx" [1].

As requested by Rafael J. Wysocki, these 2 patches are extracted in a
independent series, in the meantime, Viresh Kumar gave his acked-by
that I added to the patches.

Thanks,

Gregory

[1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-December/546709.html

Gregory CLEMENT (2):
  cpufreq: ARM: sort the Kconfig menu
  cpufreq: sort the drivers in ARM part

 drivers/cpufreq/Kconfig.arm | 82 ++++++++++++++++++++++-----------------------
 drivers/cpufreq/Makefile    |  8 ++---
 2 files changed, 45 insertions(+), 45 deletions(-)

-- 
2.15.1

^ permalink raw reply

* WARNING: suspicious RCU usage
From: Paul E. McKenney @ 2017-12-12 16:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20171210213930.GL7829@linux.vnet.ibm.com>

On Sun, Dec 10, 2017 at 01:39:30PM -0800, Paul E. McKenney wrote:
> On Sun, Dec 10, 2017 at 07:34:39PM +0000, Russell King - ARM Linux wrote:
> > On Sun, Dec 10, 2017 at 11:07:27AM -0800, Paul E. McKenney wrote:
> > > On Sun, Dec 10, 2017 at 12:00:12PM +0000, Russell King - ARM Linux wrote:
> > > > +Paul
> > > > 
> > > > Annoyingly, it looks like calling "complete()" from a dying CPU is
> > > > triggering the RCU usage warning.  From what I remember, this is an
> > > > old problem, and we still have no better solution for this other than
> > > > to persist with the warning.
> > > 
> > > I thought that this issue was resolved with tglx's use of IPIs from
> > > the outgoing CPU.  Or is this due to an additional complete() from the
> > > ARM code?  If so, could it also use tglx's IPI trick?
> > 
> > I don't think it was tglx's IPI trick, I've had code sitting in my tree
> > for a while for it, but it has its own set of problems which are not
> > resolvable:
> > 
> > 1. it needs more IPIs than we have available on all platforms
> 
> OK, I will ask the stupid question...  Is it possible to multiplex
> the IPIs, for example, by using smp_call_function_single()?

On the perhaps unlikely off-chance that it is both useful and welcome,
the (untested, probably does not even build) patch below illustrates the
use of smp_call_function_single().  This is based on the patch Russell
sent -- for all I know, it might well be that there are other places
needing similar changes.

But something to try out for anyone wishing to do so.

							Thanx, Paul

------------------------------------------------------------------------

commit c579a1494ccbc7ebf5548115571a2988ea1a1fe5
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Mon Dec 11 09:40:58 2017 -0800

    ARM: CPU hotplug: Delegate complete() to surviving CPU
    
    The ARM implementation of arch_cpu_idle_dead() invokes complete(), but
    does so after RCU has stopped watching the outgoing CPU, which results
    in lockdep complaints because complete() invokes functions containing RCU
    readers.  This patch therefore uses Thomas Gleixner's trick of delegating
    the complete() call to a surviving CPU via smp_call_function_single().
    
    This patch is untested, and probably does not even build.

    Reported-by: Peng Fan <van.freenix@gmail.com>
    Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index b4fbf00ee4ad..75f85e20aafa 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -267,6 +267,14 @@ void __cpu_die(unsigned int cpu)
 }
 
 /*
+ * Invoke complete() on behalf of the outgoing CPU.
+ */
+static void arch_cpu_idle_dead_complete(void *arg)
+{
+	complete(&cpu_died);
+}
+
+/*
  * Called from the idle thread for the CPU which has been shutdown.
  *
  * Note that we disable IRQs here, but do not re-enable them
@@ -293,9 +301,11 @@ void arch_cpu_idle_dead(void)
 	/*
 	 * Tell __cpu_die() that this CPU is now safe to dispose of.  Once
 	 * this returns, power and/or clocks can be removed at any point
-	 * from this CPU and its cache by platform_cpu_kill().
+	 * from this CPU and its cache by platform_cpu_kill().  We cannot
+	 * call complete() this late, so we delegate it to an online CPU.
 	 */
-	complete(&cpu_died);
+	smp_call_function_single(cpumask_first(cpu_online_mask),
+				 arch_cpu_idle_dead_complete, NULL, 0);
 
 	/*
 	 * Ensure that the cache lines associated with that completion are

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox