Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] Allwinner clock changes for 4.18
From: Chen-Yu Tsai @ 2018-06-11  7:53 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAK7LNASgetmPKKS8AhYXqSSEFCi+q0ASZ68M0SECJT5EbAU4XQ@mail.gmail.com>

Hi,

On Mon, Jun 11, 2018 at 10:00 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Hi Maxime,
>
>
> 2018-05-21 20:59 GMT+09:00 Maxime Ripard <maxime.ripard@bootlin.com>:
>> Hi Mike, Stephen,
>>
>> Please merge the following changes for the next merge window, thanks!
>>
>> Maxime
>>
>> The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:
>>
>>   Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)
>>
>> are available in the Git repository at:
>>
>>   https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git tags/sunxi-clk-for-4.18
>>
>> for you to fetch changes up to 17de4c857b1f74b90967f7e7fd5ff81be61dc044:
>>
>>   clk: sunxi-ng: r40: export a regmap to access the GMAC register (2018-05-17 14:02:07 +0800)
>>
>> ----------------------------------------------------------------
>> Allwinner clock changes for 4.18
>>
>> Not a lot of changes for this release, but two quite important features
>> were added: the H6 PRCM clock support, and the needed changes to the R40
>> clock driver to allow for the EMAC to operate.
>>
>> ----------------------------------------------------------------
>> Icenowy Zheng (3):
>>       clk: sunxi-ng: add support for H6 PRCM CCU
>>       clk: sunxi-ng: r40: rewrite init code to a platform driver
>>       clk: sunxi-ng: r40: export a regmap to access the GMAC register
>>
>
>
>
> Why was my patch "clk: sunxi-ng: replace lib-y with obj-y"
> not included in the pull request?
>
>
> You said "I've picked it up"
> https://patchwork.kernel.org/patch/10348031/

It looks like it was accidentally dropped after a rebase.
Not quite sure what happened there. Maxime?

ChenYu

^ permalink raw reply

* [PATCH] arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag
From: Geert Uytterhoeven @ 2018-06-11  7:55 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180611051340.9024-1-m.szyprowski@samsung.com>

Hi Marek,

Thanks for your patch!

On Mon, Jun 11, 2018 at 7:14 AM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> dma_alloc_*() buffers might be exposed to userspace via mmap() call, so
> they should be cleared on allocation. In case of IOMMU-based dma-mapping
> implementation such buffer clearing was missing in the code path for
> DMA_ATTR_FORCE_CONTIGUOUS flag handling. This patch fixes this issue. For

Is it? The memory is allocated using dma_alloc_from_contiguous(..., gfp),
and __iommu_alloc_attrs() has

        /*
         * Some drivers rely on this, and we probably don't want the
         * possibility of stale kernel data being read by devices anyway.
         */
        gfp |= __GFP_ZERO;

at the top, before the allocation.

If cma_alloc() (called from dma_alloc_from_contiguous()) doesn't honor
__GFP_ZERO, I think cma_alloc() should be fixed instead.

> more information on clearing buffers allocated by dma_alloc_* functions,
> see commit 44176bb38fa4 ("arm64: dma-mapping: always clear allocated

6829e274a623

> buffers").
>
> Fixes: 44176bb38fa4 ("arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* [PATCH 2/2] ARM: dts: am437x: make edt-ft5x06 a wakeup source for imx6 boards
From: Tony Lindgren @ 2018-06-11  7:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180611074420.GF16091@dragon>

* Shawn Guo <shawnguo@kernel.org> [180611 07:47]:
> On Wed, May 23, 2018 at 10:30:13AM +0200, Daniel Mack wrote:
> > The touchscreen driver no longer configures the device as wakeup source by
> > default. A "wakeup-source" property is needed.
> > 
> > Signed-off-by: Daniel Mack <daniel@zonque.org>
> 
> This is not an imx6 board, and I have to leave it to relevant platform
> maintainer.  The patch subject should be fixed to drop 'imx6'.

Daniel, can you please resend after -rc1?

Thanks,

Tony

^ permalink raw reply

* [PATCH v1] ARM: imx: add imx7d-m4
From: Oleksij Rempel @ 2018-06-11  8:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180405115134.8036-1-o.rempel@pengutronix.de>

Hi all,

this patch was send 05.04.2018. Any comments?

@Shawn, can you please take it?

On 05.04.2018 13:51, Oleksij Rempel wrote:
> Provide basic support for Cortex-M4 located on NXP iMX7D.
> This code was tested in combination with imx-rproc driver
> which will upload with specially formatted ELF image containing
> kernel, device and CPIO rootfs.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  arch/arm/boot/dts/Makefile         |  2 +-
>  arch/arm/mach-imx/Kconfig          | 33 +++++++++++++++++++++------------
>  arch/arm/mach-imx/Makefile         |  3 ++-
>  arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
>  4 files changed, 45 insertions(+), 14 deletions(-)
>  create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 852452515bea..d49bb9a58aee 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
>  	imx6ul-tx6ul-0011.dtb \
>  	imx6ul-tx6ul-mainboard.dtb \
>  	imx6ull-14x14-evk.dtb
> -dtb-$(CONFIG_SOC_IMX7D) += \
> +dtb-$(CONFIG_SOC_IMX7D_CA7) += \
>  	imx7d-cl-som-imx7.dtb \
>  	imx7d-colibri-emmc-eval-v3.dtb \
>  	imx7d-colibri-eval-v3.dtb \
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 782699e67600..101c8599d952 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -528,18 +528,6 @@ config SOC_IMX6UL
>  	help
>  	  This enables support for Freescale i.MX6 UltraLite processor.
>  
> -config SOC_IMX7D
> -	bool "i.MX7 Dual support"
> -	select PINCTRL_IMX7D
> -	select ARM_GIC
> -	select HAVE_ARM_ARCH_TIMER
> -	select HAVE_IMX_ANATOP
> -	select HAVE_IMX_MMDC
> -	select HAVE_IMX_SRC
> -	select IMX_GPCV2
> -	help
> -		This enables support for Freescale i.MX7 Dual processor.
> -
>  config SOC_LS1021A
>  	bool "Freescale LS1021A support"
>  	select ARM_GIC
> @@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
>  
>  if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
>  
> +config SOC_IMX7D_CA7
> +	bool
> +	select ARM_GIC
> +	select HAVE_ARM_ARCH_TIMER
> +	select HAVE_IMX_ANATOP
> +	select HAVE_IMX_MMDC
> +	select HAVE_IMX_SRC
> +	select IMX_GPCV2
> +
> +config SOC_IMX7D_CM4
> +	bool
> +	select ARMV7M_SYSTICK
> +
> +config SOC_IMX7D
> +	bool "i.MX7 Dual support"
> +	select PINCTRL_IMX7D
> +	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
> +	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
> +	help
> +		This enables support for Freescale i.MX7 Dual processor.
> +
>  config SOC_VF610
>  	bool "Vybrid Family VF610 support"
>  	select ARM_GIC if ARCH_MULTI_V7
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index 8ff71058207d..68640f100ef3 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
>  obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
>  obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
>  obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
> -obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
> +obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
> +obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
>  
>  ifeq ($(CONFIG_SUSPEND),y)
>  AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
> diff --git a/arch/arm/mach-imx/mach-imx7d-cm4.c b/arch/arm/mach-imx/mach-imx7d-cm4.c
> new file mode 100644
> index 000000000000..c36dea79aeb8
> --- /dev/null
> +++ b/arch/arm/mach-imx/mach-imx7d-cm4.c
> @@ -0,0 +1,21 @@
> +/*
> + * Copyright 2017 Pengutronix
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/kernel.h>
> +#include <asm/v7m.h>
> +#include <asm/mach/arch.h>
> +
> +static const char * const imx7d_cm4_dt_compat[] __initconst = {
> +	"fsl,imx7d-cm4",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
> +	.dt_compat = imx7d_cm4_dt_compat,
> +	.restart = armv7m_restart,
> +MACHINE_END
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180611/6e28fea3/attachment.sig>

^ permalink raw reply

* [PATCH v2 0/5] Add R8A77980/Condor/V3HSK LVDS/HDMI support
From: Simon Horman @ 2018-06-11  8:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4069170.tduNOXLj45@avalon>

On Fri, Jun 08, 2018 at 05:27:19PM +0300, Laurent Pinchart wrote:
> Hi Sergei,
> 
> On Thursday, 7 June 2018 23:17:03 EEST Sergei Shtylyov wrote:
> > Hello!
> > 
> > Here's the set of 5 patches against Simon Horman's 'renesas.git' repo's
> > 'renesas-devel-20180604-v4.17' tag. We're adding the R8A77980 FCPVD/VSPD/
> > DU/LVDS device nodes and then describing the LVDS decoder and HDMI encoder
> > connected to the LVDS output. These patches depend on the Thine THC63LVD1024
> > driver and the R8A77980 LVDS support patch in order to work, and R8A77980
> > GPIO DT patches in order to apply/compile...
> > 
> > [1/5] arm64: dts: renesas: r8a77980: add FCPVD support
> > [2/5] arm64: dts: renesas: r8a77980: add VSPD support
> > [3/5] arm64: dts: renesas: r8a77980: add DU support
> > [4/5] arm64: dts: renesas: r8a77980: add LVDS support
> 
> Based on the recent request of the ARM SoC maintainers to avoid a plethora of 
> small patches, I think you can squash 1/5 to 4/5 all together.

Agreed.

Seregi could you please post a v2 with patches 1 - 4 squashed and the
register range for VSPD0 reduced to 0x5000? Thanks!

> > [5/5] arm64: dts: renesas: condor/v3hsk: add DU/LVDS/HDMI support

^ permalink raw reply

* [PATCH v1] ARM: imx: add imx7d-m4
From: Shawn Guo @ 2018-06-11  8:20 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <93e7b7ef-1bc0-2871-da2c-65ab3f070c07@pengutronix.de>

On Mon, Jun 11, 2018 at 10:02:53AM +0200, Oleksij Rempel wrote:
> Hi all,
> 
> this patch was send 05.04.2018. Any comments?
> 
> @Shawn, can you please take it?

Honestly I'm not sure how useful it will be.  If we can have some i.MX
developers ACK on it, I will be more comfortable to take it.

Shawn

> 
> On 05.04.2018 13:51, Oleksij Rempel wrote:
> > Provide basic support for Cortex-M4 located on NXP iMX7D.
> > This code was tested in combination with imx-rproc driver
> > which will upload with specially formatted ELF image containing
> > kernel, device and CPIO rootfs.
> > 
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >  arch/arm/boot/dts/Makefile         |  2 +-
> >  arch/arm/mach-imx/Kconfig          | 33 +++++++++++++++++++++------------
> >  arch/arm/mach-imx/Makefile         |  3 ++-
> >  arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
> >  4 files changed, 45 insertions(+), 14 deletions(-)
> >  create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
> > 
> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > index 852452515bea..d49bb9a58aee 100644
> > --- a/arch/arm/boot/dts/Makefile
> > +++ b/arch/arm/boot/dts/Makefile
> > @@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
> >  	imx6ul-tx6ul-0011.dtb \
> >  	imx6ul-tx6ul-mainboard.dtb \
> >  	imx6ull-14x14-evk.dtb
> > -dtb-$(CONFIG_SOC_IMX7D) += \
> > +dtb-$(CONFIG_SOC_IMX7D_CA7) += \
> >  	imx7d-cl-som-imx7.dtb \
> >  	imx7d-colibri-emmc-eval-v3.dtb \
> >  	imx7d-colibri-eval-v3.dtb \
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index 782699e67600..101c8599d952 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -528,18 +528,6 @@ config SOC_IMX6UL
> >  	help
> >  	  This enables support for Freescale i.MX6 UltraLite processor.
> >  
> > -config SOC_IMX7D
> > -	bool "i.MX7 Dual support"
> > -	select PINCTRL_IMX7D
> > -	select ARM_GIC
> > -	select HAVE_ARM_ARCH_TIMER
> > -	select HAVE_IMX_ANATOP
> > -	select HAVE_IMX_MMDC
> > -	select HAVE_IMX_SRC
> > -	select IMX_GPCV2
> > -	help
> > -		This enables support for Freescale i.MX7 Dual processor.
> > -
> >  config SOC_LS1021A
> >  	bool "Freescale LS1021A support"
> >  	select ARM_GIC
> > @@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
> >  
> >  if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
> >  
> > +config SOC_IMX7D_CA7
> > +	bool
> > +	select ARM_GIC
> > +	select HAVE_ARM_ARCH_TIMER
> > +	select HAVE_IMX_ANATOP
> > +	select HAVE_IMX_MMDC
> > +	select HAVE_IMX_SRC
> > +	select IMX_GPCV2
> > +
> > +config SOC_IMX7D_CM4
> > +	bool
> > +	select ARMV7M_SYSTICK
> > +
> > +config SOC_IMX7D
> > +	bool "i.MX7 Dual support"
> > +	select PINCTRL_IMX7D
> > +	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
> > +	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
> > +	help
> > +		This enables support for Freescale i.MX7 Dual processor.
> > +
> >  config SOC_VF610
> >  	bool "Vybrid Family VF610 support"
> >  	select ARM_GIC if ARCH_MULTI_V7
> > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> > index 8ff71058207d..68640f100ef3 100644
> > --- a/arch/arm/mach-imx/Makefile
> > +++ b/arch/arm/mach-imx/Makefile
> > @@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
> >  obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
> >  obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
> >  obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
> > -obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
> > +obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
> > +obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
> >  
> >  ifeq ($(CONFIG_SUSPEND),y)
> >  AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
> > diff --git a/arch/arm/mach-imx/mach-imx7d-cm4.c b/arch/arm/mach-imx/mach-imx7d-cm4.c
> > new file mode 100644
> > index 000000000000..c36dea79aeb8
> > --- /dev/null
> > +++ b/arch/arm/mach-imx/mach-imx7d-cm4.c
> > @@ -0,0 +1,21 @@
> > +/*
> > + * Copyright 2017 Pengutronix
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <asm/v7m.h>
> > +#include <asm/mach/arch.h>
> > +
> > +static const char * const imx7d_cm4_dt_compat[] __initconst = {
> > +	"fsl,imx7d-cm4",
> > +	NULL,
> > +};
> > +
> > +DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
> > +	.dt_compat = imx7d_cm4_dt_compat,
> > +	.restart = armv7m_restart,
> > +MACHINE_END
> > 
> 

^ permalink raw reply

* [PATCH/RFT 1/2] PCI: rcar: Add compatible string for r8a77965
From: Simon Horman @ 2018-06-11  8:20 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1528373494-18503-2-git-send-email-ykaneko0929@gmail.com>

On Thu, Jun 07, 2018 at 09:11:33PM +0900, Yoshihiro Kaneko wrote:
> This patch adds support for r8a77965 (R-Car M3-N)
> 
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  Documentation/devicetree/bindings/pci/rcar-pci.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/pci/rcar-pci.txt b/Documentation/devicetree/bindings/pci/rcar-pci.txt
> index 1fb614e..dd71cfe 100644
> --- a/Documentation/devicetree/bindings/pci/rcar-pci.txt
> +++ b/Documentation/devicetree/bindings/pci/rcar-pci.txt
> @@ -8,6 +8,7 @@ compatible: "renesas,pcie-r8a7743" for the R8A7743 SoC;
>  	    "renesas,pcie-r8a7793" for the R8A7793 SoC;
>  	    "renesas,pcie-r8a7795" for the R8A7795 SoC;
>  	    "renesas,pcie-r8a7796" for the R8A7796 SoC;
> +	    "renesas,pcie-r8a77965" for the R8A77965 SoC;
>  	    "renesas,pcie-rcar-gen2" for a generic R-Car Gen2 or
>  				     RZ/G1 compatible device.
>  	    "renesas,pcie-rcar-gen3" for a generic R-Car Gen3 compatible device.
> -- 
> 1.9.1
> 

^ permalink raw reply

* [PATCH v7 2/2] ARM: dts: imx: Add basic dts support for imx6sll EVK board
From: Shawn Guo @ 2018-06-11  8:24 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1527234127-11991-2-git-send-email-ping.bai@nxp.com>

On Fri, May 25, 2018 at 03:42:07PM +0800, Bai Ping wrote:
> Add dts file support for imx6sll EVK board.
> 
> Signed-off-by: Bai Ping <ping.bai@nxp.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Acked-by: Dong Aisheng <Aisheng.dong@nxp.com>
> ---
>  change v3->v4
>  - update the license indentifier
>  - remove leading zero of node
>  - remove unused pin from hog group
>  change v4->v5
>  - use generic name for device node
>  - remove unnecessary hog pin group
>  change v5->v6
>  - no
>  change v6->v7
>  - move the iomuxc node to the end of dts file
> ---
>  Documentation/devicetree/bindings/arm/fsl.txt |   4 +
>  arch/arm/boot/dts/Makefile                    |   2 +
>  arch/arm/boot/dts/imx6sll-evk.dts             | 317 ++++++++++++++++++++++++++
>  3 files changed, 323 insertions(+)
>  create mode 100644 arch/arm/boot/dts/imx6sll-evk.dts

<snip>

> +	pinctrl_i2c1: i2c1grp {
> +		fsl,pins = <
> +			MX6SLL_PAD_I2C1_SCL__I2C1_SCL	 0x4001b8b1
> +			MX6SLL_PAD_I2C1_SDA__I2C1_SDA	 0x4001b8b1
> +		>;
> +	};
> +};
> +
> +

The new blank line at EOF should be dropped.


I fixed it up and applied both patches.

Shawn

^ permalink raw reply

* [PATCH/RFT 2/2] arm64: dts: renesas: r8a77965: Add PCIe device nodes
From: Simon Horman @ 2018-06-11  8:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1528373494-18503-3-git-send-email-ykaneko0929@gmail.com>

On Thu, Jun 07, 2018 at 09:11:34PM +0900, Yoshihiro Kaneko wrote:
> From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> 
> This patch adds PCIe{0,1} device nodes to R8A77965 SoC.
> 
> Based on a similar patches of the R8A7796 device tree
> by Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>.
> 
> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>

Hi,

This looks fine to me but I will wait to see if there are other reviews
before applying.

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

^ permalink raw reply

* [PATCH v3 1/3] ASoC: simple-card-utils: move hp and mic detect gpios from simple-card
From: Katsuhiro Suzuki @ 2018-06-11  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

This patch moves headphone and microphone jack detection gpios from
simple-card driver. It is preparing for using this feature from other
drivers.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>

---

Changes from v2:
  - Nothing

Changes from v1:
  - Move changes of audio-graph-card to other patch
---
 include/sound/simple_card_utils.h     | 15 +++++++
 sound/soc/generic/simple-card-utils.c | 59 ++++++++++++++++++++++++
 sound/soc/generic/simple-card.c       | 64 ---------------------------
 3 files changed, 74 insertions(+), 64 deletions(-)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 7e25afce6566..f82acef3b992 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -12,6 +12,11 @@
 
 #include <sound/soc.h>
 
+#define asoc_simple_card_init_hp(card, sjack, prefix) \
+	asoc_simple_card_init_jack(card, sjack, 1, prefix)
+#define asoc_simple_card_init_mic(card, sjack, prefix) \
+	asoc_simple_card_init_jack(card, sjack, 0, prefix)
+
 struct asoc_simple_dai {
 	const char *name;
 	unsigned int sysclk;
@@ -28,6 +33,12 @@ struct asoc_simple_card_data {
 	u32 convert_channels;
 };
 
+struct asoc_simple_jack {
+	struct snd_soc_jack jack;
+	struct snd_soc_jack_pin pin;
+	struct snd_soc_jack_gpio gpio;
+};
+
 int asoc_simple_card_parse_daifmt(struct device *dev,
 				  struct device_node *node,
 				  struct device_node *codec,
@@ -107,4 +118,8 @@ int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
 int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card,
 				      char *prefix);
 
+int asoc_simple_card_init_jack(struct snd_soc_card *card,
+			       struct asoc_simple_jack *sjack,
+			       int is_hp, char *prefix);
+
 #endif /* __SIMPLE_CARD_UTILS_H */
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 3751a07de6aa..4398c9580929 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -8,9 +8,13 @@
  * published by the Free Software Foundation.
  */
 #include <linux/clk.h>
+#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_gpio.h>
 #include <linux/of_graph.h>
+#include <sound/jack.h>
 #include <sound/simple_card_utils.h>
 
 void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data,
@@ -419,6 +423,61 @@ int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_of_parse_widgets);
 
+int asoc_simple_card_init_jack(struct snd_soc_card *card,
+			       struct asoc_simple_jack *sjack,
+			       int is_hp, char *prefix)
+{
+	struct device *dev = card->dev;
+	enum of_gpio_flags flags;
+	char prop[128];
+	char *pin_name;
+	char *gpio_name;
+	int mask;
+	int det;
+
+	if (!prefix)
+		prefix = "";
+
+	sjack->gpio.gpio = -ENOENT;
+
+	if (is_hp) {
+		snprintf(prop, sizeof(prop), "%shp-det-gpio", prefix);
+		pin_name	= "Headphones";
+		gpio_name	= "Headphone detection";
+		mask		= SND_JACK_HEADPHONE;
+	} else {
+		snprintf(prop, sizeof(prop), "%smic-det-gpio", prefix);
+		pin_name	= "Mic Jack";
+		gpio_name	= "Mic detection";
+		mask		= SND_JACK_MICROPHONE;
+	}
+
+	det = of_get_named_gpio_flags(dev->of_node, prop, 0, &flags);
+	if (det == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
+
+	if (gpio_is_valid(det)) {
+		sjack->pin.pin		= pin_name;
+		sjack->pin.mask		= mask;
+
+		sjack->gpio.name	= gpio_name;
+		sjack->gpio.report	= mask;
+		sjack->gpio.gpio	= det;
+		sjack->gpio.invert	= !!(flags & OF_GPIO_ACTIVE_LOW);
+		sjack->gpio.debounce_time = 150;
+
+		snd_soc_card_jack_new(card, pin_name, mask,
+				      &sjack->jack,
+				      &sjack->pin, 1);
+
+		snd_soc_jack_add_gpios(&sjack->jack, 1,
+				       &sjack->gpio);
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(asoc_simple_card_init_jack);
+
 /* Module information */
 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
 MODULE_DESCRIPTION("ALSA SoC Simple Card Utils");
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 4a516c428b3d..1bbd9e46bf2a 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -10,23 +10,14 @@
  */
 #include <linux/clk.h>
 #include <linux/device.h>
-#include <linux/gpio.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
-#include <sound/jack.h>
 #include <sound/simple_card.h>
 #include <sound/soc-dai.h>
 #include <sound/soc.h>
 
-struct asoc_simple_jack {
-	struct snd_soc_jack jack;
-	struct snd_soc_jack_pin pin;
-	struct snd_soc_jack_gpio gpio;
-};
-
 struct simple_card_data {
 	struct snd_soc_card snd_card;
 	struct simple_dai_props {
@@ -49,61 +40,6 @@ struct simple_card_data {
 #define CELL	"#sound-dai-cells"
 #define PREFIX	"simple-audio-card,"
 
-#define asoc_simple_card_init_hp(card, sjack, prefix)\
-	asoc_simple_card_init_jack(card, sjack, 1, prefix)
-#define asoc_simple_card_init_mic(card, sjack, prefix)\
-	asoc_simple_card_init_jack(card, sjack, 0, prefix)
-static int asoc_simple_card_init_jack(struct snd_soc_card *card,
-				      struct asoc_simple_jack *sjack,
-				      int is_hp, char *prefix)
-{
-	struct device *dev = card->dev;
-	enum of_gpio_flags flags;
-	char prop[128];
-	char *pin_name;
-	char *gpio_name;
-	int mask;
-	int det;
-
-	sjack->gpio.gpio = -ENOENT;
-
-	if (is_hp) {
-		snprintf(prop, sizeof(prop), "%shp-det-gpio", prefix);
-		pin_name	= "Headphones";
-		gpio_name	= "Headphone detection";
-		mask		= SND_JACK_HEADPHONE;
-	} else {
-		snprintf(prop, sizeof(prop), "%smic-det-gpio", prefix);
-		pin_name	= "Mic Jack";
-		gpio_name	= "Mic detection";
-		mask		= SND_JACK_MICROPHONE;
-	}
-
-	det = of_get_named_gpio_flags(dev->of_node, prop, 0, &flags);
-	if (det == -EPROBE_DEFER)
-		return -EPROBE_DEFER;
-
-	if (gpio_is_valid(det)) {
-		sjack->pin.pin		= pin_name;
-		sjack->pin.mask		= mask;
-
-		sjack->gpio.name	= gpio_name;
-		sjack->gpio.report	= mask;
-		sjack->gpio.gpio	= det;
-		sjack->gpio.invert	= !!(flags & OF_GPIO_ACTIVE_LOW);
-		sjack->gpio.debounce_time = 150;
-
-		snd_soc_card_jack_new(card, pin_name, mask,
-				      &sjack->jack,
-				      &sjack->pin, 1);
-
-		snd_soc_jack_add_gpios(&sjack->jack, 1,
-				       &sjack->gpio);
-	}
-
-	return 0;
-}
-
 static int asoc_simple_card_startup(struct snd_pcm_substream *substream)
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-- 
2.17.1

^ permalink raw reply related

* [PATCH v3 2/3] ASoC: simple-card: move hp and mic detection to soc_card probe
From: Katsuhiro Suzuki @ 2018-06-11  8:32 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180611083214.16858-1-suzuki.katsuhiro@socionext.com>

This patch moves headphone and microphone detection to probe() of
snd_soc_card from init() of snd_soc_dai_link. This is because init()
is called (and an input device /dev/input/eventX is created too)
twice or above if simple card has two or more DAI links.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>

---

Changes from v2:
  - Keep PREFIX of hp/mic detection properties

Changes from v1:
  - Newly added
---
 sound/soc/generic/simple-card.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 1bbd9e46bf2a..da34016652c9 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -149,14 +149,6 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
 	if (ret < 0)
 		return ret;
 
-	ret = asoc_simple_card_init_hp(rtd->card, &priv->hp_jack, PREFIX);
-	if (ret < 0)
-		return ret;
-
-	ret = asoc_simple_card_init_mic(rtd->card, &priv->mic_jack, PREFIX);
-	if (ret < 0)
-		return ret;
-
 	return 0;
 }
 
@@ -350,6 +342,22 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
 	return ret;
 }
 
+static int asoc_simple_soc_card_probe(struct snd_soc_card *card)
+{
+	struct simple_card_data *priv = snd_soc_card_get_drvdata(card);
+	int ret;
+
+	ret = asoc_simple_card_init_hp(card, &priv->hp_jack, PREFIX);
+	if (ret < 0)
+		return ret;
+
+	ret = asoc_simple_card_init_mic(card, &priv->mic_jack, PREFIX);
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
 static int asoc_simple_card_probe(struct platform_device *pdev)
 {
 	struct simple_card_data *priv;
@@ -385,6 +393,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
 	card->dev		= dev;
 	card->dai_link		= priv->dai_link;
 	card->num_links		= num;
+	card->probe		= asoc_simple_soc_card_probe;
 
 	if (np && of_device_is_available(np)) {
 
-- 
2.17.1

^ permalink raw reply related

* [PATCH v3 3/3] ASoC: audio-graph-card: add hp and mic detect gpios same as simple-card
From: Katsuhiro Suzuki @ 2018-06-11  8:32 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180611083214.16858-1-suzuki.katsuhiro@socionext.com>

This patch adds headphone and microphone jack detection gpios as same
as simple-card driver.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>

---

Changes from v2:
  - Nothing

Changes from v1:
  - Move changes of audio-graph-card to other patch
---
 sound/soc/generic/audio-graph-card.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 1b6164249341..2baa60d3b3cc 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -21,7 +21,6 @@
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
-#include <sound/jack.h>
 #include <sound/simple_card_utils.h>
 
 struct graph_card_data {
@@ -32,6 +31,8 @@ struct graph_card_data {
 		unsigned int mclk_fs;
 	} *dai_props;
 	unsigned int mclk_fs;
+	struct asoc_simple_jack hp_jack;
+	struct asoc_simple_jack mic_jack;
 	struct snd_soc_dai_link *dai_link;
 	struct gpio_desc *pa_gpio;
 };
@@ -278,6 +279,22 @@ static int asoc_graph_get_dais_count(struct device *dev)
 	return count;
 }
 
+static int asoc_graph_soc_card_probe(struct snd_soc_card *card)
+{
+	struct graph_card_data *priv = snd_soc_card_get_drvdata(card);
+	int ret;
+
+	ret = asoc_simple_card_init_hp(card, &priv->hp_jack, NULL);
+	if (ret < 0)
+		return ret;
+
+	ret = asoc_simple_card_init_mic(card, &priv->mic_jack, NULL);
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
 static int asoc_graph_card_probe(struct platform_device *pdev)
 {
 	struct graph_card_data *priv;
@@ -319,6 +336,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)
 	card->num_links	= num;
 	card->dapm_widgets = asoc_graph_card_dapm_widgets;
 	card->num_dapm_widgets = ARRAY_SIZE(asoc_graph_card_dapm_widgets);
+	card->probe	= asoc_graph_soc_card_probe;
 
 	ret = asoc_graph_card_parse_of(priv);
 	if (ret < 0) {
-- 
2.17.1

^ permalink raw reply related

* [PATCH v1] ARM: imx: add imx7d-m4
From: Lucas Stach @ 2018-06-11  8:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180611082022.GG16091@dragon>

Hi Shawn,

Am Montag, den 11.06.2018, 16:20 +0800 schrieb Shawn Guo:
> On Mon, Jun 11, 2018 at 10:02:53AM +0200, Oleksij Rempel wrote:
> > Hi all,
> > 
> > this patch was send 05.04.2018. Any comments?
> > 
> > @Shawn, can you please take it?
> 
> Honestly I'm not sure how useful it will be.??If we can have some i.MX
> developers ACK on it, I will be more comfortable to take it.

This is all highly experimental and in PoC stage, but we see some value
in running a second Linux system on the M4 coprocessor. There are lots
of things that still need to be figured out, but we are working on this
from time to time when there are some hours to spare.

This patch seems like a good step in the right direction and IMHO the
amount of code and changes is small enough to carry it upstream without
impacting anything else. I would be happy if this could be pulled in.

Regards,
Lucas

> > 
> > On 05.04.2018 13:51, Oleksij Rempel wrote:
> > > Provide basic support for Cortex-M4 located on NXP iMX7D.
> > > This code was tested in combination with imx-rproc driver
> > > which will upload with specially formatted ELF image containing
> > > kernel, device and CPIO rootfs.
> > > 
> > > > > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > > ---
> > > ?arch/arm/boot/dts/Makefile?????????|??2 +-
> > > ?arch/arm/mach-imx/Kconfig??????????| 33 +++++++++++++++++++++------------
> > > ?arch/arm/mach-imx/Makefile?????????|??3 ++-
> > > ?arch/arm/mach-imx/mach-imx7d-cm4.c | 21 +++++++++++++++++++++
> > > ?4 files changed, 45 insertions(+), 14 deletions(-)
> > > ?create mode 100644 arch/arm/mach-imx/mach-imx7d-cm4.c
> > > 
> > > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > > index 852452515bea..d49bb9a58aee 100644
> > > --- a/arch/arm/boot/dts/Makefile
> > > +++ b/arch/arm/boot/dts/Makefile
> > > @@ -527,7 +527,7 @@ dtb-$(CONFIG_SOC_IMX6UL) += \
> > > > > > ?	imx6ul-tx6ul-0011.dtb \
> > > > > > ?	imx6ul-tx6ul-mainboard.dtb \
> > > > > > ?	imx6ull-14x14-evk.dtb
> > > -dtb-$(CONFIG_SOC_IMX7D) += \
> > > +dtb-$(CONFIG_SOC_IMX7D_CA7) += \
> > > > > > ?	imx7d-cl-som-imx7.dtb \
> > > > > > ?	imx7d-colibri-emmc-eval-v3.dtb \
> > > > > > ?	imx7d-colibri-eval-v3.dtb \
> > > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > > index 782699e67600..101c8599d952 100644
> > > --- a/arch/arm/mach-imx/Kconfig
> > > +++ b/arch/arm/mach-imx/Kconfig
> > > @@ -528,18 +528,6 @@ config SOC_IMX6UL
> > > > > > ?	help
> > > > > > ?	??This enables support for Freescale i.MX6 UltraLite processor.
> > > ?
> > > -config SOC_IMX7D
> > > > > > -	bool "i.MX7 Dual support"
> > > > > > -	select PINCTRL_IMX7D
> > > > > > -	select ARM_GIC
> > > > > > -	select HAVE_ARM_ARCH_TIMER
> > > > > > -	select HAVE_IMX_ANATOP
> > > > > > -	select HAVE_IMX_MMDC
> > > > > > -	select HAVE_IMX_SRC
> > > > > > -	select IMX_GPCV2
> > > > > > -	help
> > > > > > -		This enables support for Freescale i.MX7 Dual processor.
> > > -
> > > ?config SOC_LS1021A
> > > > > > ?	bool "Freescale LS1021A support"
> > > > > > ?	select ARM_GIC
> > > @@ -554,6 +542,27 @@ comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
> > > ?
> > > ?if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
> > > ?
> > > +config SOC_IMX7D_CA7
> > > > > > +	bool
> > > > > > +	select ARM_GIC
> > > > > > +	select HAVE_ARM_ARCH_TIMER
> > > > > > +	select HAVE_IMX_ANATOP
> > > > > > +	select HAVE_IMX_MMDC
> > > > > > +	select HAVE_IMX_SRC
> > > > > > +	select IMX_GPCV2
> > > +
> > > +config SOC_IMX7D_CM4
> > > > > > +	bool
> > > > > > +	select ARMV7M_SYSTICK
> > > +
> > > +config SOC_IMX7D
> > > > > > +	bool "i.MX7 Dual support"
> > > > > > +	select PINCTRL_IMX7D
> > > > > > +	select SOC_IMX7D_CA7 if ARCH_MULTI_V7
> > > > > > +	select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
> > > > > > +	help
> > > > > > +		This enables support for Freescale i.MX7 Dual processor.
> > > +
> > > ?config SOC_VF610
> > > > > > ?	bool "Vybrid Family VF610 support"
> > > > > > ?	select ARM_GIC if ARCH_MULTI_V7
> > > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> > > index 8ff71058207d..68640f100ef3 100644
> > > --- a/arch/arm/mach-imx/Makefile
> > > +++ b/arch/arm/mach-imx/Makefile
> > > @@ -80,7 +80,8 @@ obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
> > > ?obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
> > > ?obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
> > > ?obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o
> > > -obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
> > > +obj-$(CONFIG_SOC_IMX7D_CA7) += mach-imx7d.o
> > > +obj-$(CONFIG_SOC_IMX7D_CM4) += mach-imx7d-cm4.o
> > > ?
> > > ?ifeq ($(CONFIG_SUSPEND),y)
> > > ?AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
> > > diff --git a/arch/arm/mach-imx/mach-imx7d-cm4.c b/arch/arm/mach-imx/mach-imx7d-cm4.c
> > > new file mode 100644
> > > index 000000000000..c36dea79aeb8
> > > --- /dev/null
> > > +++ b/arch/arm/mach-imx/mach-imx7d-cm4.c
> > > @@ -0,0 +1,21 @@
> > > +/*
> > > + * Copyright 2017 Pengutronix
> > > + *
> > > + * This program is free software; you can redistribute it and/or modify
> > > + * it under the terms of the GNU General Public License version 2 as
> > > + * published by the Free Software Foundation.
> > > + */
> > > +
> > > +#include <linux/kernel.h>
> > > +#include <asm/v7m.h>
> > > +#include <asm/mach/arch.h>
> > > +
> > > +static const char * const imx7d_cm4_dt_compat[] __initconst = {
> > > > > > +	"fsl,imx7d-cm4",
> > > > > > +	NULL,
> > > +};
> > > +
> > > +DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual Cortex-M4 (Device Tree)")
> > > > > > +	.dt_compat = imx7d_cm4_dt_compat,
> > > > > > +	.restart = armv7m_restart,
> > > +MACHINE_END
> > > 
> 
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* [PATCH v3 1/3] ASoC: simple-card-utils: move hp and mic detect gpios from simple-card
From: Kuninori Morimoto @ 2018-06-11  8:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180611083214.16858-1-suzuki.katsuhiro@socionext.com>


Hi

> This patch moves headphone and microphone jack detection gpios from
> simple-card driver. It is preparing for using this feature from other
> drivers.
> 
> Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
> ---

For all patches

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

^ permalink raw reply

* [PATCH 1/2] arm64: avoid alloc memory on offline node
From: Michal Hocko @ 2018-06-11  8:52 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <a880df29-b656-d98d-3037-b04761c7ed78@huawei.com>

On Mon 11-06-18 11:23:18, Xie XiuQi wrote:
> Hi Michal,
> 
> On 2018/6/7 20:21, Michal Hocko wrote:
> > On Thu 07-06-18 19:55:53, Hanjun Guo wrote:
> >> On 2018/6/7 18:55, Michal Hocko wrote:
> > [...]
> >>> I am not sure I have the full context but pci_acpi_scan_root calls
> >>> kzalloc_node(sizeof(*info), GFP_KERNEL, node)
> >>> and that should fall back to whatever node that is online. Offline node
> >>> shouldn't keep any pages behind. So there must be something else going
> >>> on here and the patch is not the right way to handle it. What does
> >>> faddr2line __alloc_pages_nodemask+0xf0 tells on this kernel?
> >>
> >> The whole context is:
> >>
> >> The system is booted with a NUMA node has no memory attaching to it
> >> (memory-less NUMA node), also with NR_CPUS less than CPUs presented
> >> in MADT, so CPUs on this memory-less node are not brought up, and
> >> this NUMA node will not be online (but SRAT presents this NUMA node);
> >>
> >> Devices attaching to this NUMA node such as PCI host bridge still
> >> return the valid NUMA node via _PXM, but actually that valid NUMA node
> >> is not online which lead to this issue.
> > 
> > But we should have other numa nodes on the zonelists so the allocator
> > should fall back to other node. If the zonelist is not intiailized
> > properly, though, then this can indeed show up as a problem. Knowing
> > which exact place has blown up would help get a better picture...
> > 
> 
> I specific a non-exist node to allocate memory using kzalloc_node,
> and got this following error message.
>
> And I found out there is just a VM_WARN, but it does not prevent the memory
> allocation continue.
> 
> This nid would be use to access NODE_DADA(nid), so if nid is invalid,
> it would cause oops here.
> 
> 459 /*
> 460  * Allocate pages, preferring the node given as nid. The node must be valid and
> 461  * online. For more general interface, see alloc_pages_node().
> 462  */
> 463 static inline struct page *
> 464 __alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order)
> 465 {
> 466         VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
> 467         VM_WARN_ON(!node_online(nid));
> 468
> 469         return __alloc_pages(gfp_mask, order, nid);
> 470 }
> 471
> 
> (I wrote a ko, to allocate memory on a non-exist node using kzalloc_node().)

OK, so this is an artificialy broken code, right. You shouldn't get a
non-existent node via standard APIs AFAICS. The original report was
about an existing node which is offline AFAIU. That would be a different
case. If I am missing something and there are legitimate users that try
to allocate from non-existing nodes then we should handle that in
node_zonelist.

[...]
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply

* [PATCH 02/20] coresight: of: Fix refcounting for graph nodes
From: Suzuki K Poulose @ 2018-06-11  9:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180608195530.GB30587@xps15>

On 08/06/18 20:55, Mathieu Poirier wrote:
> On Tue, Jun 05, 2018 at 10:43:13PM +0100, Suzuki K Poulose wrote:
>> The coresight driver doesn't drop the references on the
>> remote endpoint/port nodes. Add the missing of_node_put()
>> calls. To make it easier to handle different corner cases
>> cleanly, move the parsing of an endpoint to separate
>> function.
> 
> Please split this as those are two different things.

Mathieu,

I can do that, its only that if someone were to backport
the fix for an older kernel, they would need to pick up these
two patches, which is still fine.

> 
>>
>> Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>>   drivers/hwtracing/coresight/of_coresight.c | 139 +++++++++++++++++------------
>>   1 file changed, 84 insertions(+), 55 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
>> index a33a92e..8a23c63 100644
>> --- a/drivers/hwtracing/coresight/of_coresight.c
>> +++ b/drivers/hwtracing/coresight/of_coresight.c

>> +static int of_coresight_parse_endpoint(struct device_node *ep,
>> +				       struct coresight_platform_data *pdata,
>> +				       int *i)
>> +{
>> +	int ret = 0;
>> +	struct of_endpoint endpoint, rendpoint;
>> +	struct device_node *rparent = NULL;
>> +	struct device_node *rport = NULL;
>> +	struct device *rdev = NULL;
>> +
>> +	do {

...

>> +	} while (0);
> 
> That's a clever way of coding a classic 'goto' block.
> 
>> +
>> +	if (rparent)
>> +		of_node_put(rparent);
>> +	if (rport)
>> +		of_node_put(rport);
> 
> Perfect - thank you for that.
> 

>>   	pdata->name = dev_name(dev);
>> +	pdata->cpu = of_coresight_get_cpu(node);
>>   
>>   	/* Get the number of input and output port for this component */
>>   	of_coresight_get_ports(node, &pdata->nr_inport, &pdata->nr_outport);
>>   
>> -	if (pdata->nr_outport) {
>> -		ret = of_coresight_alloc_memory(dev, pdata);
>> +	/* If there are not output connections, we are done */
> 
> /not/no

Thanks for spotting.

Suzuki

^ permalink raw reply

* [PATCH 08/20] coresight: dts: Cleanup device tree graph bindings
From: Suzuki K Poulose @ 2018-06-11  9:22 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180608212211.GG30587@xps15>

On 08/06/18 22:22, Mathieu Poirier wrote:
> On Tue, Jun 05, 2018 at 10:43:19PM +0100, Suzuki K Poulose wrote:
>> The coresight drivers relied on default bindings for graph
>> in DT, while reusing the "reg" field of the "ports" to indicate
>> the actual hardware port number for the connections. However,
>> with the rules getting stricter w.r.t to the address mismatch
>> with the label, it is no longer possible to use the port address
>> field for the hardware port number. Hence, we add an explicit
>> property to denote the hardware port number, "coresight,hwid"
>> which must be specified for each "endpoint".
>>
>> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
>> Cc: Sudeep Holla <sudeep.holla@arm.com>
>> Cc: Rob Herring <robh@kernel.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>>   .../devicetree/bindings/arm/coresight.txt          | 29 ++++++++++---
>>   drivers/hwtracing/coresight/of_coresight.c         | 49 +++++++++++++++++-----
>>   2 files changed, 62 insertions(+), 16 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt
>> index ed6b555..bf75ab3 100644
>> --- a/Documentation/devicetree/bindings/arm/coresight.txt
>> +++ b/Documentation/devicetree/bindings/arm/coresight.txt
>> @@ -108,8 +108,13 @@ following properties to uniquely identify the connection details.
>>   	"slave-mode"


>>   	};
> 
> For the binding part:
> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> 
>> diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
>> index d01a9ce..d23d7dd 100644
>> --- a/drivers/hwtracing/coresight/of_coresight.c
>> +++ b/drivers/hwtracing/coresight/of_coresight.c

...

>> +/*
>>    * of_coresight_parse_endpoint : Parse the given output endpoint @ep
>>    * and fill the connection information in *@pconn.
>>    *
>> @@ -109,11 +134,11 @@ EXPORT_SYMBOL_GPL(of_coresight_get_cpu);
>>    *	 0	- If the parsing completed without any fatal errors.

Please note the return value description here. Further comments below.

>>    *	-Errno	- Fatal error, abort the scanning.
>>    */
>> -static int of_coresight_parse_endpoint(struct device_node *ep,
>> +static int of_coresight_parse_endpoint(struct device *dev,
>> +				       struct device_node *ep,
>>   				       struct coresight_connection **pconn)
>>   {
>> -	int ret = 0;
>> -	struct of_endpoint endpoint, rendpoint;
>> +	int ret = 0, local_port, child_port;
>>   	struct device_node *rparent = NULL;
>>   	struct device_node *rep = NULL;
>>   	struct device *rdev = NULL;
>> @@ -128,7 +153,8 @@ static int of_coresight_parse_endpoint(struct device_node *ep,
>>   			break;
>>   
>>   		/* Parse the local port details */
>> -		if (of_graph_parse_endpoint(ep, &endpoint))
>> +		local_port = of_coresight_endpoint_get_port_id(dev, ep);
>> +		if (local_port < 0)
>>   			break;
>>   		/*
>>   		 * Get a handle on the remote endpoint and the device it is
>> @@ -140,9 +166,6 @@ static int of_coresight_parse_endpoint(struct device_node *ep,
>>   		rparent = of_graph_get_port_parent(rep);
>>   		if (!rparent)
>>   			break;
>> -		if (of_graph_parse_endpoint(rep, &rendpoint))
>> -			break;
>> -
>>   		/* If the remote device is not available, defer probing */
>>   		rdev = of_coresight_get_endpoint_device(rparent);
>>   		if (!rdev) {
>> @@ -150,9 +173,15 @@ static int of_coresight_parse_endpoint(struct device_node *ep,
>>   			break;
>>   		}
>>   
>> -		conn->outport = endpoint.port;
>> +		child_port = of_coresight_endpoint_get_port_id(rdev, rep);
>> +		if (child_port < 0) {
>> +			ret = 0;
> 
> Why returning '0' on an error condition?  Same for 'local_port' above.
> 

If we are unable to parse a port, we can simply ignore the port and continue, which
is what we have today with the existing code. I didn't change it and still think
it is the best effort thing. We could spit a warning for such cases, if really needed.
Also, the parsing code almost never fails at the moment. If it fails to find "reg" field,
it is assumed to be '0'. Either way ignoring it seems harmless. That said I am open
to suggestions.

Cheers
Suzuki

^ permalink raw reply

* [PATCH v2] irqchip/gic-v3-its: fix ITS queue timeout
From: Marc Zyngier @ 2018-06-11  9:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1528252824-15144-1-git-send-email-yangyingliang@huawei.com>

On 06/06/18 03:40, Yang Yingliang wrote:
> When the kernel booted with maxcpus=x, 'x' is smaller
> than actual cpu numbers, the TAs of offline cpus won't
> be set to its->collection.
> 
> If LPI is bind to offline cpu, sync cmd will use zero TA,
> it leads to ITS queue timeout.  Fix this by choosing a
> online cpu, if there is no online cpu in cpu_mask.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/irqchip/irq-gic-v3-its.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 5416f2b..d8b9539 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -2309,7 +2309,9 @@ static int its_irq_domain_activate(struct irq_domain *domain,
>  		cpu_mask = cpumask_of_node(its_dev->its->numa_node);
>  
>  	/* Bind the LPI to the first possible CPU */
> -	cpu = cpumask_first(cpu_mask);
> +	cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
> +	if (cpu >= nr_cpu_ids)
> +		cpu = cpumask_first(cpu_online_mask);

I've thought about this one a bit more, and apart from breaking TX1
in a very bad way, I think it is actually correct. It is just that
the commit message doesn't make much sense.

The way I understand it is:
- this is a NUMA system, with at least one node not online
- the SRAT table indicates that this ITS is local to an offline node

In that case, we need to pick an online CPU, and any will do (again,
ignoring the silly Cavium erratum). Explained like this, the above
hunk is sensible, and just needs to handle the TX1 quirk. Something like:

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 5416f2b2ac21..21b7b5151177 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2309,7 +2309,13 @@ static int its_irq_domain_activate(struct irq_domain *domain,
 		cpu_mask = cpumask_of_node(its_dev->its->numa_node);
 
 	/* Bind the LPI to the first possible CPU */
-	cpu = cpumask_first(cpu_mask);
+	cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
+	if (cpu >= nr_cpu_idx) {
+		if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144)
+			return -EINVAL;
+
+		cpu = cpumask_first(cpu_online_mask);
+	}
 	its_dev->event_map.col_map[event] = cpu;
 	irq_data_update_effective_affinity(d, cpumask_of(cpu));
 

>  	its_dev->event_map.col_map[event] = cpu;
>  	irq_data_update_effective_affinity(d, cpumask_of(cpu));
>  
> @@ -2466,7 +2468,10 @@ static int its_vpe_set_affinity(struct irq_data *d,
>  				bool force)
>  {
>  	struct its_vpe *vpe = irq_data_get_irq_chip_data(d);
> -	int cpu = cpumask_first(mask_val);
> +	int cpu = cpumask_first_and(mask_val, cpu_online_mask);
> +
> +	if (cpu >= nr_cpu_ids)
> +		cpu = cpumask_first(cpu_online_mask);
>  
>  	/*
>  	 * Changing affinity is mega expensive, so let's be as lazy as
> 

This hunk, on the other hand, is completely useless. Look how this is
called from vgic_v4_flush_hwstate():

	err = irq_set_affinity(irq, cpumask_of(smp_processor_id()));

The mask is always that of the CPU we run on, and we're in a non-premptible
section. So no way we can be targeting an offline CPU.

If you quickly respin this patch with a decent commit log, I'll take it.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply related

* [PATCH] media: stm32-dcmi: add power saving support
From: Hugues Fruchet @ 2018-06-11  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

Implements runtime & system sleep power management ops.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 80 ++++++++++++++++++++++++-------
 1 file changed, 64 insertions(+), 16 deletions(-)

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index 2e1933d..68da9ec 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -22,6 +22,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/reset.h>
 #include <linux/videodev2.h>
@@ -578,9 +579,9 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count)
 	u32 val = 0;
 	int ret;
 
-	ret = clk_enable(dcmi->mclk);
+	ret = pm_runtime_get_sync(dcmi->dev);
 	if (ret) {
-		dev_err(dcmi->dev, "%s: Failed to start streaming, cannot enable clock\n",
+		dev_err(dcmi->dev, "%s: Failed to start streaming, cannot get sync\n",
 			__func__);
 		goto err_release_buffers;
 	}
@@ -590,7 +591,7 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count)
 	if (ret && ret != -ENOIOCTLCMD) {
 		dev_err(dcmi->dev, "%s: Failed to start streaming, subdev streamon error",
 			__func__);
-		goto err_disable_clock;
+		goto err_pm_put;
 	}
 
 	spin_lock_irq(&dcmi->irqlock);
@@ -675,8 +676,8 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count)
 err_subdev_streamoff:
 	v4l2_subdev_call(dcmi->entity.subdev, video, s_stream, 0);
 
-err_disable_clock:
-	clk_disable(dcmi->mclk);
+err_pm_put:
+	pm_runtime_put(dcmi->dev);
 
 err_release_buffers:
 	spin_lock_irq(&dcmi->irqlock);
@@ -749,7 +750,7 @@ static void dcmi_stop_streaming(struct vb2_queue *vq)
 	/* Stop all pending DMA operations */
 	dmaengine_terminate_all(dcmi->dma_chan);
 
-	clk_disable(dcmi->mclk);
+	pm_runtime_put(dcmi->dev);
 
 	if (dcmi->errors_count)
 		dev_warn(dcmi->dev, "Some errors found while streaming: errors=%d (overrun=%d), buffers=%d\n",
@@ -1751,12 +1752,6 @@ static int dcmi_probe(struct platform_device *pdev)
 		return -EPROBE_DEFER;
 	}
 
-	ret = clk_prepare(mclk);
-	if (ret) {
-		dev_err(&pdev->dev, "Unable to prepare mclk %p\n", mclk);
-		goto err_dma_release;
-	}
-
 	spin_lock_init(&dcmi->irqlock);
 	mutex_init(&dcmi->lock);
 	init_completion(&dcmi->complete);
@@ -1772,7 +1767,7 @@ static int dcmi_probe(struct platform_device *pdev)
 	/* Initialize the top-level structure */
 	ret = v4l2_device_register(&pdev->dev, &dcmi->v4l2_dev);
 	if (ret)
-		goto err_clk_unprepare;
+		goto err_dma_release;
 
 	dcmi->vdev = video_device_alloc();
 	if (!dcmi->vdev) {
@@ -1832,14 +1827,15 @@ static int dcmi_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "Probe done\n");
 
 	platform_set_drvdata(pdev, dcmi);
+
+	pm_runtime_enable(&pdev->dev);
+
 	return 0;
 
 err_device_release:
 	video_device_release(dcmi->vdev);
 err_device_unregister:
 	v4l2_device_unregister(&dcmi->v4l2_dev);
-err_clk_unprepare:
-	clk_unprepare(dcmi->mclk);
 err_dma_release:
 	dma_release_channel(dcmi->dma_chan);
 
@@ -1850,20 +1846,72 @@ static int dcmi_remove(struct platform_device *pdev)
 {
 	struct stm32_dcmi *dcmi = platform_get_drvdata(pdev);
 
+	pm_runtime_disable(&pdev->dev);
+
 	v4l2_async_notifier_unregister(&dcmi->notifier);
 	v4l2_device_unregister(&dcmi->v4l2_dev);
-	clk_unprepare(dcmi->mclk);
+
 	dma_release_channel(dcmi->dma_chan);
 
 	return 0;
 }
 
+static __maybe_unused int dcmi_runtime_suspend(struct device *dev)
+{
+	struct stm32_dcmi *dcmi = dev_get_drvdata(dev);
+
+	clk_disable_unprepare(dcmi->mclk);
+
+	return 0;
+}
+
+static __maybe_unused int dcmi_runtime_resume(struct device *dev)
+{
+	struct stm32_dcmi *dcmi = dev_get_drvdata(dev);
+	int ret;
+
+	ret = clk_prepare_enable(dcmi->mclk);
+	if (ret)
+		dev_err(dev, "%s: Failed to prepare_enable clock\n", __func__);
+
+	return ret;
+}
+
+static __maybe_unused int dcmi_suspend(struct device *dev)
+{
+	/* disable clock */
+	pm_runtime_force_suspend(dev);
+
+	/* change pinctrl state */
+	pinctrl_pm_select_sleep_state(dev);
+
+	return 0;
+}
+
+static __maybe_unused int dcmi_resume(struct device *dev)
+{
+	/* restore pinctl default state */
+	pinctrl_pm_select_default_state(dev);
+
+	/* clock enable */
+	pm_runtime_force_resume(dev);
+
+	return 0;
+}
+
+static const struct dev_pm_ops dcmi_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(dcmi_suspend, dcmi_resume)
+	SET_RUNTIME_PM_OPS(dcmi_runtime_suspend,
+			   dcmi_runtime_resume, NULL)
+};
+
 static struct platform_driver stm32_dcmi_driver = {
 	.probe		= dcmi_probe,
 	.remove		= dcmi_remove,
 	.driver		= {
 		.name = DRV_NAME,
 		.of_match_table = of_match_ptr(stm32_dcmi_of_match),
+		.pm = &dcmi_pm_ops,
 	},
 };
 
-- 
1.9.1

^ permalink raw reply related

* [PATCH] media: stm32-dcmi: increase max width/height to 2592
From: Hugues Fruchet @ 2018-06-11  9:41 UTC (permalink / raw)
  To: linux-arm-kernel

DCMI can capture 5Mp raw frames, increase limit accordingly.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index 68da9ec..c55e6b5 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -90,14 +90,9 @@ enum state {
 };
 
 #define MIN_WIDTH	16U
-#define MAX_WIDTH	2048U
+#define MAX_WIDTH	2592U
 #define MIN_HEIGHT	16U
-#define MAX_HEIGHT	2048U
-
-#define MIN_JPEG_WIDTH	16U
-#define MAX_JPEG_WIDTH	2592U
-#define MIN_JPEG_HEIGHT	16U
-#define MAX_JPEG_HEIGHT	2592U
+#define MAX_HEIGHT	2592U
 
 #define TIMEOUT_MS	1000
 
@@ -844,14 +839,8 @@ static int dcmi_try_fmt(struct stm32_dcmi *dcmi, struct v4l2_format *f,
 	}
 
 	/* Limit to hardware capabilities */
-	if (pix->pixelformat == V4L2_PIX_FMT_JPEG) {
-		pix->width = clamp(pix->width, MIN_JPEG_WIDTH, MAX_JPEG_WIDTH);
-		pix->height =
-			clamp(pix->height, MIN_JPEG_HEIGHT, MAX_JPEG_HEIGHT);
-	} else {
-		pix->width = clamp(pix->width, MIN_WIDTH, MAX_WIDTH);
-		pix->height = clamp(pix->height, MIN_HEIGHT, MAX_HEIGHT);
-	}
+	pix->width = clamp(pix->width, MIN_WIDTH, MAX_WIDTH);
+	pix->height = clamp(pix->height, MIN_HEIGHT, MAX_HEIGHT);
 
 	/* No crop if JPEG is requested */
 	do_crop = dcmi->do_crop && (pix->pixelformat != V4L2_PIX_FMT_JPEG);
-- 
1.9.1

^ permalink raw reply related

* [PATCH 2/9] crypto: atmel-ecc: Silently ignore missing clock frequency
From: Tudor Ambarus @ 2018-06-11  9:46 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180605134950.6605-2-linus.walleij@linaro.org>

Hi, Linus, Wolfram,

On 06/05/2018 04:49 PM, Linus Walleij wrote:
> The Atmel ECC driver contains a check for the I2C bus clock
> frequency, so as to check that the I2C adapter in use
> satisfies the device specs.
> 
> If the device is connected to a device tree node that does not
> contain a clock frequency setting, such as an I2C mux or gate,
> this blocks the probe. Make the probe continue silently if
> no clock frequency can be found, assuming all is safe.

I don't think it's safe. We use bus_clk_rate to compute the ecc508's
wake token. If you can't wake the device, it will ignore all your
commands.

My proposal was to introduce a bus_freq_hz member in the i2c_adapter
structure (https://patchwork.kernel.org/patch/10307637/), but I haven't
received feedback yet, Wolfram?

I would say first to check the bus_freq_hz from adapter (if it will be
accepted) else to look into dt and, in the last case, if nowhere
provided, to block the probe.

Thanks,
ta

> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>   drivers/crypto/atmel-ecc.c | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c
> index e66f18a0ddd0..145ab3a39a56 100644
> --- a/drivers/crypto/atmel-ecc.c
> +++ b/drivers/crypto/atmel-ecc.c
> @@ -657,14 +657,13 @@ static int atmel_ecc_probe(struct i2c_client *client,
>   		return -ENODEV;
>   	}
>   
> +	/*
> +	 * Silently assume all is fine if there is no
> +	 * "clock-frequency" property.
> +	 */
>   	ret = of_property_read_u32(client->adapter->dev.of_node,
>   				   "clock-frequency", &bus_clk_rate);
> -	if (ret) {
> -		dev_err(dev, "of: failed to read clock-frequency property\n");
> -		return ret;
> -	}
> -
> -	if (bus_clk_rate > 1000000L) {
> +	if (!ret && (bus_clk_rate > 1000000L)) {
>   		dev_err(dev, "%d exceeds maximum supported clock frequency (1MHz)\n",
>   			bus_clk_rate);
>   		return -EINVAL;
> 

^ permalink raw reply

* [PATCH] media: stm32-dcmi: code cleanup
From: Hugues Fruchet @ 2018-06-11  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

Minor non-functional fixes around comments, variable namings
and trace point enhancement.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index c55e6b5..b796334 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -249,13 +249,12 @@ static int dcmi_restart_capture(struct stm32_dcmi *dcmi)
 static void dcmi_dma_callback(void *param)
 {
 	struct stm32_dcmi *dcmi = (struct stm32_dcmi *)param;
-	struct dma_chan *chan = dcmi->dma_chan;
 	struct dma_tx_state state;
 	enum dma_status status;
 	struct dcmi_buf *buf = dcmi->active;
 
 	/* Check DMA status */
-	status = dmaengine_tx_status(chan, dcmi->dma_cookie, &state);
+	status = dmaengine_tx_status(dcmi->dma_chan, dcmi->dma_cookie, &state);
 
 	switch (status) {
 	case DMA_IN_PROGRESS:
@@ -309,10 +308,11 @@ static int dcmi_start_dma(struct stm32_dcmi *dcmi,
 	/* Prepare a DMA transaction */
 	desc = dmaengine_prep_slave_single(dcmi->dma_chan, buf->paddr,
 					   buf->size,
-					   DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT);
+					   DMA_DEV_TO_MEM,
+					   DMA_PREP_INTERRUPT);
 	if (!desc) {
-		dev_err(dcmi->dev, "%s: DMA dmaengine_prep_slave_single failed for buffer size %zu\n",
-			__func__, buf->size);
+		dev_err(dcmi->dev, "%s: DMA dmaengine_prep_slave_single failed for buffer phy=%pad size=%zu\n",
+			__func__, &buf->paddr, buf->size);
 		return -EINVAL;
 	}
 
@@ -378,7 +378,6 @@ static void dcmi_process_jpeg(struct stm32_dcmi *dcmi)
 {
 	struct dma_tx_state state;
 	enum dma_status status;
-	struct dma_chan *chan = dcmi->dma_chan;
 	struct dcmi_buf *buf = dcmi->active;
 
 	if (!buf)
@@ -386,8 +385,7 @@ static void dcmi_process_jpeg(struct stm32_dcmi *dcmi)
 
 	/*
 	 * Because of variable JPEG buffer size sent by sensor,
-	 * DMA transfer never completes due to transfer size
-	 * never reached.
+	 * DMA transfer never completes due to transfer size never reached.
 	 * In order to ensure that all the JPEG data are transferred
 	 * in active buffer memory, DMA is drained.
 	 * Then DMA tx status gives the amount of data transferred
@@ -396,10 +394,10 @@ static void dcmi_process_jpeg(struct stm32_dcmi *dcmi)
 	 */
 
 	/* Drain DMA */
-	dmaengine_synchronize(chan);
+	dmaengine_synchronize(dcmi->dma_chan);
 
 	/* Get DMA residue to get JPEG size */
-	status = dmaengine_tx_status(chan, dcmi->dma_cookie, &state);
+	status = dmaengine_tx_status(dcmi->dma_chan, dcmi->dma_cookie, &state);
 	if (status != DMA_ERROR && state.residue < buf->size) {
 		/* Return JPEG buffer to V4L2 with received JPEG buffer size */
 		dcmi_buffer_done(dcmi, buf, buf->size - state.residue, 0);
-- 
1.9.1

^ permalink raw reply related

* [PATCH 0/4] Revisit and fix DCMI buffers handling
From: Hugues Fruchet @ 2018-06-11  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

Revisit and fix DCMI buffers handling.

Hugues Fruchet (4):
  media: stm32-dcmi: do not fall into error on buffer starvation
  media: stm32-dcmi: return buffer in error state on dma error
  media: stm32-dcmi: clarify state logic on buffer starvation
  media: stm32-dcmi: revisit buffer list management

 drivers/media/platform/stm32/stm32-dcmi.c | 80 ++++++++++++++++---------------
 1 file changed, 41 insertions(+), 39 deletions(-)

-- 
1.9.1

^ permalink raw reply

* [PATCH 1/4] media: stm32-dcmi: do not fall into error on buffer starvation
From: Hugues Fruchet @ 2018-06-11  9:50 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1528710627-8566-1-git-send-email-hugues.fruchet@st.com>

Return silently instead of falling into error when running
out of available buffers when restarting capture.
Capture will be restarted when new buffers will be
provided by V4L2 client.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index b796334..a3fbfac 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -228,13 +228,10 @@ static int dcmi_restart_capture(struct stm32_dcmi *dcmi)
 
 	/* Restart a new DMA transfer with next buffer */
 	if (list_empty(&dcmi->buffers)) {
-		dev_err(dcmi->dev, "%s: No more buffer queued, cannot capture buffer\n",
-			__func__);
-		dcmi->errors_count++;
+		dev_dbg(dcmi->dev, "Capture restart is deferred to next buffer queueing\n");
 		dcmi->active = NULL;
-
 		spin_unlock_irq(&dcmi->irqlock);
-		return -EINVAL;
+		return 0;
 	}
 
 	dcmi->active = list_entry(dcmi->buffers.next,
-- 
1.9.1

^ permalink raw reply related

* [PATCH 2/4] media: stm32-dcmi: return buffer in error state on dma error
From: Hugues Fruchet @ 2018-06-11  9:50 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1528710627-8566-1-git-send-email-hugues.fruchet@st.com>

Return buffer to V4L2 in error state if DMA error occurs.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
---
 drivers/media/platform/stm32/stm32-dcmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index a3fbfac..6ccf195 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -262,6 +262,9 @@ static void dcmi_dma_callback(void *param)
 		break;
 	case DMA_ERROR:
 		dev_err(dcmi->dev, "%s: Received DMA_ERROR\n", __func__);
+
+		/* Return buffer to V4L2 in error state */
+		dcmi_buffer_done(dcmi, buf, 0, -EIO);
 		break;
 	case DMA_COMPLETE:
 		dev_dbg(dcmi->dev, "%s: Received DMA_COMPLETE\n", __func__);
-- 
1.9.1

^ 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