Re: [GIT PULL FOR renesas-drivers] Display List Optimizations

2017-08-16 Thread Geert Uytterhoeven
Hi Kieran,

On Mon, Aug 14, 2017 at 7:07 PM, Kieran Bingham
 wrote:
> Please consider pulling the following changes into renesas-drivers.
>
> This series is based upon a merge of my previous pa-improvements/v4 and
> airlied-drm/drm-next to base on top of all pending VSP1 changes.

OK, so I'll drop your vsp1/pa-improvements/v2.

> The following changes since commit f44bd631453bf7dcbe57f79b924db3a6dd038bff:
>
>   Merge remote-tracking branch 'airlied-drm/drm-next' into vsp1/next 
> (2017-08-08 19:51:06 +0100)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git 
> tags/vsp1/tlb-optimise-v2
>
> for you to fetch changes up to fa078611769415d7adbad208f1299d05bee3bda8:
>
>   v4l: vsp1: Reduce display list body size (2017-08-14 15:58:38 +0100)

Thank you, merges cleanly into today's linux-next.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH] clk: renesas: rcar-gen3: Fix SD divider setting

2017-08-16 Thread Geert Uytterhoeven
Hi Stephen,

On Fri, Jul 21, 2017 at 10:16 PM, Stephen Boyd  wrote:
> On 04/20, Yoshihiro Kaneko wrote:
>> From: Takeshi Kihara 
>>
>> This patch fixed the SD divider settiing for corresponding to the change
>> in the HS200/HS400 mode.
>>
>> Signed-off-by: Takeshi Kihara 
>> Signed-off-by: Yoshihiro Kaneko 
>> ---
>> This patch is based on the clk-next branch of linux-clk tree.
>
> Geert?

This patch was superseded by Wolfram's series "[PATCH 0/3] clk: renesas:
rcar-gen3-cpg: updates to SD divider table", which he retracted after noticing
issues on some SoCs.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH] ARM: debug-ll: Add support for r8a7745

2017-08-16 Thread Geert Uytterhoeven
Hi Fabrizio,

On Tue, Aug 15, 2017 at 6:21 PM, Fabrizio Castro
 wrote:
> Enable low-level debugging support for RZ/G1E (r8a7745). RZ/G1E uses
> SCIF4 for the debug console.
>
> Signed-off-by: Fabrizio Castro 
> Reviewed-by: Chris Paterson 

> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug

> @@ -1568,6 +1576,7 @@ config DEBUG_UART_PHYS
> default 0xe6c4 if DEBUG_RMOBILE_SCIFA0
> default 0xe6c5 if DEBUG_RMOBILE_SCIFA1
> default 0xe6c8 if DEBUG_RMOBILE_SCIFA4
> +   default 0xe6ee if DEBUG_RCAR_GEN2_SCIF4

Please keep the list sorted by physical address.

> default 0xe6e58000 if DEBUG_RCAR_GEN2_SCIF2
> default 0xe6e6 if DEBUG_RCAR_GEN2_SCIF0
> default 0xe8008000 if DEBUG_R7S72100_SCIF2

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [GIT PULL FOR renesas-drivers] Display List Optimizations

2017-08-16 Thread Kieran Bingham
Hi Geert,

>>
>> This series is based upon a merge of my previous pa-improvements/v4 and
>> airlied-drm/drm-next to base on top of all pending VSP1 changes.
> 
> OK, so I'll drop your vsp1/pa-improvements/v2.

That sounds reasonable :D

>>   git://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git 
>> tags/vsp1/tlb-optimise-v2
>>
>> for you to fetch changes up to fa078611769415d7adbad208f1299d05bee3bda8:
>>
>>   v4l: vsp1: Reduce display list body size (2017-08-14 15:58:38 +0100)
> 
> Thank you, merges cleanly into today's linux-next.

Great thanks!

--
Kieran


Re: [PATCH 1/2] pinctrl: sh-pfc: r8a7796: Add USB2.0 host pins, groups and functions

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 2, 2017 at 2:51 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> This patch adds USB{0,1} (USB2.0 host) pins, groups and functions to
> R8A7796 SoC.
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 2/2] pinctrl: sh-pfc: r8a7796: Add USB3.0 host pins, groups and functions

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 2, 2017 at 2:51 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> This patch adds USB30 (USB3.0 host) pin, group and function to R8A7796
> SoC.
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


[PATCH v2] ARM: debug-ll: Add support for r8a7745

2017-08-16 Thread Fabrizio Castro
Enable low-level debugging support for RZ/G1E (r8a7745). RZ/G1E uses
SCIF4 for the debug console.

Signed-off-by: Fabrizio Castro 
Reviewed-by: Chris Paterson 
---
Changes in v2:
  - Keep the list sorted by physical address

 arch/arm/Kconfig.debug | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 6dcea8e..31bf312 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -911,6 +911,13 @@ choice
  Say Y here if you want kernel low-level debugging support
  via SCIF2 on Renesas R-Car E2 (R8A7794).
 
+   config DEBUG_RCAR_GEN2_SCIF4
+   bool "Kernel low-level debugging messages via SCIF4 on R8A7745"
+   depends on ARCH_R8A7745
+   help
+ Say Y here if you want kernel low-level debugging support
+ via SCIF4 on Renesas RZ/G1E (R8A7745).
+
config DEBUG_RMOBILE_SCIFA0
bool "Kernel low-level debugging messages via SCIFA0 on R8A73A4"
depends on ARCH_R8A73A4
@@ -1451,6 +1458,7 @@ config DEBUG_LL_INCLUDE
default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF2
default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF0
default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF2
+   default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF4
default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA0
default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA1
default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4
@@ -1570,6 +1578,7 @@ config DEBUG_UART_PHYS
default 0xe6c8 if DEBUG_RMOBILE_SCIFA4
default 0xe6e58000 if DEBUG_RCAR_GEN2_SCIF2
default 0xe6e6 if DEBUG_RCAR_GEN2_SCIF0
+   default 0xe6ee if DEBUG_RCAR_GEN2_SCIF4
default 0xe8008000 if DEBUG_R7S72100_SCIF2
default 0xfbe0 if ARCH_EBSA110
default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE
@@ -1604,6 +1613,7 @@ config DEBUG_UART_PHYS
DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \
DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \
DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
+   DEBUG_RCAR_GEN2_SCIF4 || \
DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
DEBUG_S3C64XX_UART || \
-- 
2.7.4



Re: [PATCH 2/8] pinctrl: sh-pfc: Initial R8A77995 PFC support

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> This patch adds initial pinctrl driver to support for the R8A77995 SoC.
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

Looks good, i.e. will queue in sh-pfc-for-v4.14 with some whitespace fixes
reported by checkpatch.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 3/8] pinctrl: sh-pfc: r8a77995: Add SCIF pins, groups and functions

2017-08-16 Thread Geert Uytterhoeven
Hi Shimoda-san,

On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> This patch adds SCIF{0,1,2,3,4,5} pins, groups and functions to R8A77995
> SoC.
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

> --- a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c

> +/* - SCIF3 
> -- */
> +static const unsigned int scif3_data_a_pins[] = {
> +   /* RX, TX */
> +   RCAR_GP_PIN(2, 31), RCAR_GP_PIN(4, 00),
> +};
> +static const unsigned int scif3_data_a_mux[] = {
> +   RX3_A_MARK, TX3_A_MARK,
> +};
> +static const unsigned int scif3_clk_a_pins[] = {
> +   /* SCK */
> +   RCAR_GP_PIN(2, 30),
> +};
> +static const unsigned int scif3_clk_a_mux[] = {
> +   SCK3_A_MARK,
> +};
> +static const unsigned int scif3_data_b_pins[] = {
> +   /* RX, TX */
> +   RCAR_GP_PIN(1, 29), RCAR_GP_PIN(1, 31),

RX3_B is GP1_30...

> +};
> +static const unsigned int scif3_data_b_mux[] = {
> +   RX3_B_MARK, TX3_B_MARK,
> +};
> +static const unsigned int scif3_clk_b_pins[] = {
> +   /* SCK */
> +   RCAR_GP_PIN(1, 30),

... and SCK3_B is GP1_29 according to Rev0.4 of the R-Car D3 pin function
datasheet.

> +};
> +static const unsigned int scif3_clk_b_mux[] = {
> +   SCK3_B_MARK,
> +};

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with the above fixed.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 1/2] pinctrl: sh-pfc: r8a7795: Change USB3_{OVC,PWEN} definitions

2017-08-16 Thread Geert Uytterhoeven
On Wed, Jul 26, 2017 at 1:28 PM, Yoshihiro Shimoda
 wrote:
> Since the latest datasheet revises the names, this patch changes
> the definitions from USB3_{OVC,PWEN} to USB2_CH3_{OVC,PWEN}.
>
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 1/8] pinctrl: sh-pfc: Add PORT_GP_{10,2[01]} helper macros

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> This follows the style of existion PORT_GP_X macros and
> will be used by a follow-up patch for the r8a77995 SoC.
>
> Extracted from the initial r8a77995 patch in the BSP by Takeshi Kihara.
>
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 1/8] pinctrl: sh-pfc: Add PORT_GP_{10,2[01]} helper macros

2017-08-16 Thread Geert Uytterhoeven
Hi Shimoda-san,

On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> This follows the style of existion PORT_GP_X macros and
> will be used by a follow-up patch for the r8a77995 SoC.

Apparently PORT_GP_20 won't be used by the follow-up patches ;-)
But I don't care...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


[PATCH v2] ARM: dts: iwg20d-q7: Add RTC support

2017-08-16 Thread Chris Paterson
From: Biju Das 

Define the iWave RainboW-G20D-Qseven board dependent part of the
RTC device node.

Signed-off-by: Biju Das 
[chris: corrected bq32000 compatible string]
Signed-off-by: Chris Paterson 
---
v1 -> v2
Added ti to bq32000 compatible string - Thanks Geert

 arch/arm/boot/dts/r8a7743-iwg20d-q7.dts | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7743-iwg20d-q7.dts 
b/arch/arm/boot/dts/r8a7743-iwg20d-q7.dts
index 081af01..2c81ea7 100644
--- a/arch/arm/boot/dts/r8a7743-iwg20d-q7.dts
+++ b/arch/arm/boot/dts/r8a7743-iwg20d-q7.dts
@@ -31,6 +31,11 @@
groups = "avb_mdio", "avb_gmii";
function = "avb";
};
+
+   i2c2_pins: i2c2 {
+   groups = "i2c2";
+   function = "i2c2";
+   };
 };
 
  {
@@ -54,3 +59,16 @@
micrel,led-mode = <1>;
};
 };
+
+ {
+   pinctrl-0 = <_pins>;
+   pinctrl-names = "default";
+
+   status = "okay";
+   clock-frequency = <40>;
+
+   rtc@68 {
+   compatible = "ti,bq32000";
+   reg = <0x68>;
+   };
+};
-- 
1.9.1



Re: [PATCH 2/2] pinctrl: sh-pfc: r8a7795: Add USB 2.0 pins, groups and functions

2017-08-16 Thread Geert Uytterhoeven
On Wed, Jul 26, 2017 at 1:28 PM, Yoshihiro Shimoda
 wrote:
> Add pins, groups, and functions for USB 2.0 on R-Car H3 ES2.0.
>
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 6/8] pinctrl: sh-pfc: r8a77995: Add USB2.0 host support

2017-08-16 Thread Geert Uytterhoeven
Hi Shimoda-san, Kihara-san,

On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 
> ---
>  drivers/pinctrl/sh-pfc/pfc-r8a77995.c | 15 +++
>  1 file changed, 15 insertions(+)
>
> diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c 
> b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
> index 9eb0cef..5c0a94f 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
> @@ -1302,6 +1302,15 @@ enum {
> SCIF_CLK_MARK,
>  };
>
> +/* - USB0 
> --- */
> +static const unsigned int usb0_pins[] = {
> +   /* PWEN, OVC */
> +   RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
> +};
> +static const unsigned int usb0_mux[] = {
> +   USB0_PWEN_MARK, USB0_OVC_MARK,
> +};

What about USB0_IDPU and USB0_IDIN?
Are they needed for normal operation, or can they be added later?

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 7/8] pinctrl: sh-pfc: r8a77995: Add MMC pins, groups and functions

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 1/9] pinctrl: sh-pfc: r8a7795: Fix MOD_SEL1 bit[25:24] to 0x3 when using STP_ISEN_1_D

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch fixes the implementation incorrect of MOD_SEL1 bit[25:24]
> value when STP_ISEN_1_D pin function is selected for IPSR17 bit[27:24].
>
> This is a correction to the incorrect implementation of MOD_SEL register
> pin assignment for R8A7795 SoC specification of R-Car Gen3 Hardware
> User's Manual Rev.0.51E or later.
>
> Fixes: 0b0ffc96dbe3 ("pinctrl: sh-pfc: Initial R8A7795 PFC support)
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 4/8] pinctrl: sh-pfc: r8a77995: Add I2C pins, groups and functions

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 5/8] pinctrl: sh-pfc: r8a77995: Add EthernetAVB pins, groups and functions

2017-08-16 Thread Geert Uytterhoeven
Hi Shimoda-san, Kihara-san,

On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

But before I apply this, please see my question below...

> --- a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c

> +static const char * const avb0_groups[] = {
> +   "avb0_td",
> +   "avb0_rd",
> +   "avb0_tx_ctl",
> +   "avb0_rx_ctl",
> +   "avb0_txc",
> +   "avb0_rxc",
> +   "avb0_txcrefclk",
> +   "avb0_link",
> +   "avb0_magic",
> +   "avb0_phy_int",
> +   "avb0_mdc",
> +   "avb0_mdio",
> +   "avb0_avtp_pps_a",
> +   "avb0_avtp_match_a",
> +   "avb0_avtp_capture_a",
> +   "avb0_avtp_pps_b",
> +   "avb0_avtp_match_b",
> +   "avb0_avtp_capture_b",
> +};

Is there any specific reason this uses a different split than the
EtherAVB groups
in pinctrl drivers for other SoCs?

Note that I do understand that the different prefix ("avb0" vs. "avb")
was used to
match the R-Car D3 datasheet, which is thus OK.

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


[PATCH ] gpio: rcar: Add r8a7745 (RZ/G1E) support

2017-08-16 Thread Biju Das
Renesas RZ/G1E (R8A7745) SoC GPIO blocks are identical to the R-Car Gen2
family. Add support for its GPIO controllers.

Signed-off-by: Biju Das <biju@bp.renesas.com>
---
This patch is tested against linux-next tag next-20170816 as well as gpio-devel.

 Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt 
b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
index 48634b0..51c86f6 100644
--- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
+++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
@@ -4,6 +4,7 @@ Required Properties:
 
   - compatible: should contain one or more of the following:
 - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller.
+- "renesas,gpio-r8a7745": for R8A7745 (RZ/G1E) compatible GPIO controller.
 - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO 
controller.
 - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO 
controller.
 - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO 
controller.
-- 
1.9.1



Re: [PATCH 2/9] pinctrl: sh-pfc: r8a7795: Fix MOD_SEL2 bit26 to 0x0 when using SCK5_A

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch fixes the implementation incorrect of MOD_SEL2 bit26 value
> when SCK5_A pin function is selected for IPSR16 bit[31:28].
>
> This is a correction to the incorrect implementation of MOD_SEL register
> pin assignment for R8A7795 ES2.0 SoC specification of R-Car Gen3 Hardware
> User's Manual Rev.0.51E or later.
>
> Fixes: 12f5d9a1dc7f ("pinctrl: sh-pfc: r8a7795: Replace for Renesas R8A7795 
> ES2.0 SoC")

That commit is not in upstream. The proper one is:
Fixes: b205914c8f822ef2 ("pinctrl: sh-pfc: r8a7795: Add support for
R-Car H3 ES2.0")

> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with the above fixed.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 5/9] pinctrl: sh-pfc: r8a7795: Fix NFDATA{0..13} and NF{ALE,CLE,WE_N,RE_N} pin function definitions

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch fixes the implementation incorrect of IPSR register value
> definitions for NFDATA{0..13} and NF{ALE,CLE,WE_N,RE_N} pins function.
>
> This is a correction to the incorrect implementation of IPSR register pin
> assignment of the specifications updated for R8A7795 ES2.0 SoC in R-Car
> Gen3 Hardware User's Manual Rev.0.53E.
>
> Fixes: 12f5d9a1dc7f ("pinctrl: sh-pfc: r8a7795: Replace for Renesas R8A7795 
> ES2.0 SoC")
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with reference corrected.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 6/9] pinctrl: sh-pfc: r8a7795: Fix MOD_SEL register pin assignment for TCLK{1,2}_{A,B} pins group

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch fixes to set MOD_SEL2 bit19 when using TCLK2_A pin function is
> selected for IPSR16 bit[23:20] or using TCLK2_B pin function is selected
> for IPSR17 bit[27:24]. And renames MOD_SEL2 bit26 value definition name
> to SEL_TIMER_TMU1.
>
> This is a correction because MOD_SEL register specification for R8A7795
> ES2.0 SoC was changed in R-Car Gen3 Hardware User's Manual Rev.0.53E.
>
> Fixes: 12f5d9a1dc7f ("pinctrl: sh-pfc: r8a7795: Replace for Renesas R8A7795 
> ES2.0 SoC")
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with reference corrected.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 7/9] pinctrl: sh-pfc: r8a7795: Fix to delete FSCLKST pin and IPSR7 bit[15:12] register definitions

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch fixes the macro definitions of FSCLKST pins function and IPSR7
> bit[15:12] register deleted.
>
> This is a correction because IPSR register specification for R8A7795
> ES2.0 SoC was changed in R-Car Gen3 Hardware User's Manual Rev.0.53E or
> later.
>
> Fixes: 12f5d9a1dc7f ("pinctrl: sh-pfc: r8a7795: Replace for Renesas R8A7795 
> ES2.0 SoC")
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with reference corrected.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 8/9] pinctrl: sh-pfc: r8a7795: Rename CS1# pin function definitions

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch renames the pin function macro definitions of the GPSR1 and
> IPSR4 registers value for the CS1# pin.
>
> This is a correction because GPSR and IPSR register specification for
> R8A7795 ES2.0 SoC was changed in R-Car Gen3 Hardware User's Manual
> Rev.0.54E.
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 1/3] ARM: dts: r8a7745: add PFC support

2017-08-16 Thread Sergei Shtylyov

On 08/15/2017 07:00 PM, Simon Horman wrote:


Define the generic R8A7745 part of the PFC device node.

Signed-off-by: Sergei Shtylyov 


Reviewed-by: Geert Uytterhoeven 


It looks like the dependencies for this patch are met now [1].

Are you happy to accept this patch? (and presumably the others in the series 
for the sk-rzg1e board).

We plan to add GPIO support for r8a7745, but need this patch in place first.


[1] https://patchwork.kernel.org/patch/9705249/


Actually, R8A774x PFC support has hit the Linus' tree in the meanwhile.
Simon, please merge the .dts patches.


Kind regards, Chris


Thanks, I have applied the series for v4.14.


   Are you going to finally push the devel branch? I'm not seeing changes 
since the Monday tags.


MBR, Sergei


Re: [PATCH 4/9] pinctrl: sh-pfc: r8a7795: Fix FMCLK{_C,_D} and FMIN{_C,_D} pin function definitions

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch fixes the implementation incorrect of IPSR register value
> definitions for FMCLK{_C,_D} and FMIN{_C,_D} pins function.
>
> This is a correction to the incorrect implementation of IPSR register pin
> assignment of the specifications updated for R8A7795 ES2.0 SoC in R-Car
> Gen3 Hardware User's Manual Rev.0.53E.
>
> Fixes: 12f5d9a1dc7f ("pinctrl: sh-pfc: r8a7795: Replace for Renesas R8A7795 
> ES2.0 SoC")
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with reference corrected.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 9/9] pinctrl: sh-pfc: r8a7795: Fix to reserved MOD_SEL2 bit22

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This is a correction because MOD_SEL register specification for R8A7795
> ES2.0 SoC was changed in R-Car Gen3 Hardware User's Manual Rev.0.54E.
>
> Fixes: 12f5d9a1dc7f ("pinctrl: sh-pfc: r8a7795: Replace for Renesas R8A7795 
> ES2.0 SoC")
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with reference corrected.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 8/8] pinctrl: sh-pfc: r8a77995: Add voltage switch operations for MMC

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 9, 2017 at 2:19 PM, Yoshihiro Shimoda
 wrote:
> From: Takeshi Kihara 
>
> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH 3/9] pinctrl: sh-pfc: r8a7795: Fix SCIF_CLK_{A,B} pin's MOD_SEL assignment to MOD_SEL1 bit10

2017-08-16 Thread Geert Uytterhoeven
On Fri, Jul 28, 2017 at 1:41 PM, Yoshihiro Kaneko  wrote:
> From: Takeshi Kihara 
>
> This patch fixes SCIF_CLK_{A,B} pin's MOD_SEL assignment from MOD_SEL1
> bit11 to MOD_SEL1 bit10.
>
> This is a correction to the incorrect implementation of IPSR register
> pin assignment for R8A7795 ES2.0 SoC specification of R-Car Gen3 Hardware
> User's Manual Rev.0.53E or later.
>
> Fixes: 12f5d9a1dc7f ("pinctrl: sh-pfc: r8a7795: Replace for Renesas R8A7795 
> ES2.0 SoC")

Wrong reference.

> Signed-off-by: Takeshi Kihara 
> Signed-off-by: Yoshihiro Kaneko 

Reviewed-by: Geert Uytterhoeven 

i.e. will queue in sh-pfc-for-v4.14 with reference corrected.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH] arm64: dts: renesas: r8a77995: add pfc device node

2017-08-16 Thread Geert Uytterhoeven
On Wed, Aug 9, 2017 at 2:20 PM, Yoshihiro Shimoda
 wrote:
> Signed-off-by: Yoshihiro Shimoda 

Reviewed-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


[PATCH 6/6] dt-bindings: slave-device: add reg property

2017-08-16 Thread Ulrich Hecht
This adds a new DT property to define the index used by a multiplexer to
select the device.

Signed-off-by: Ulrich Hecht 
---
 Documentation/devicetree/bindings/serial/slave-device.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/slave-device.txt 
b/Documentation/devicetree/bindings/serial/slave-device.txt
index 40110e0..f9b0783 100644
--- a/Documentation/devicetree/bindings/serial/slave-device.txt
+++ b/Documentation/devicetree/bindings/serial/slave-device.txt
@@ -30,6 +30,8 @@ Optional Properties:
  way to reset the device
* device baud rate is configured by its firmware but
  there is no way to request the actual settings
+- reg  : Index used to select the device if it is controlled by a
+ multiplexer.
 
 Example:
 
-- 
2.7.4



[PATCH 5/6] ARM: dts: blanche: add SCIF1 and MAX9260 deserializer

2017-08-16 Thread Ulrich Hecht
Adds serial port SCIF1 and the MAX9260 deserializers connected to it.

Signed-off-by: Ulrich Hecht 
---
 arch/arm/boot/dts/r8a7792-blanche.dts | 52 +++
 1 file changed, 52 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7792-blanche.dts 
b/arch/arm/boot/dts/r8a7792-blanche.dts
index 9b67dca..0c1a6a0 100644
--- a/arch/arm/boot/dts/r8a7792-blanche.dts
+++ b/arch/arm/boot/dts/r8a7792-blanche.dts
@@ -21,6 +21,7 @@
aliases {
serial0 = 
serial1 = 
+   serial2 = 
};
 
chosen {
@@ -186,6 +187,16 @@
gpio = < 12 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
+
+   mux: mux-controller {
+   compatible = "gpio-mux";
+   #mux-control-cells = <0>;
+
+   mux-gpios = < 12 GPIO_ACTIVE_HIGH>,
+   < 13 GPIO_ACTIVE_HIGH>,
+   < 14 GPIO_ACTIVE_HIGH>,
+   < 15 GPIO_ACTIVE_HIGH>;
+   };
 };
 
 _clk {
@@ -202,6 +213,11 @@
function = "scif0";
};
 
+   scif1_pins: scif1 {
+   groups = "scif1_data";
+   function = "scif1";
+   };
+
scif3_pins: scif3 {
groups = "scif3_data";
function = "scif3";
@@ -246,6 +262,42 @@
status = "okay";
 };
 
+ {
+   pinctrl-0 = <_pins>;
+   pinctrl-names = "default";
+
+   status = "okay";
+
+   mux-controls = <>;
+
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gmsl-deserializer@8 {
+   compatible = "maxim,max9260";
+   reg = <0x8>;
+   };
+   gmsl-deserializer@9 {
+   compatible = "maxim,max9260";
+   reg = <0x9>;
+   };
+   gmsl-deserializer@a {
+   compatible = "maxim,max9260";
+   reg = <0xa>;
+   };
+   gmsl-deserializer@b {
+   compatible = "maxim,max9260";
+   reg = <0xb>;
+   };
+   gmsl-deserializer@4 {
+   compatible = "maxim,max9260";
+   reg = <0x4>;
+   };
+   gmsl-deserializer@5 {
+   compatible = "maxim,max9260";
+   reg = <0x5>;
+   };
+};
+
  {
pinctrl-0 = <_pins>;
pinctrl-names = "default";
-- 
2.7.4



[PATCH 2/6] serdev: add multiplexer support

2017-08-16 Thread Ulrich Hecht
Adds an interface for slave device multiplexing using the mux subsystem.

Signed-off-by: Ulrich Hecht 
---
 drivers/tty/serdev/Kconfig  |  1 +
 drivers/tty/serdev/Makefile |  2 +-
 drivers/tty/serdev/core.c   | 13 -
 drivers/tty/serdev/mux.c| 66 +
 include/linux/serdev.h  | 14 --
 5 files changed, 92 insertions(+), 4 deletions(-)
 create mode 100644 drivers/tty/serdev/mux.c

diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
index cdc6b82..8fd75cb 100644
--- a/drivers/tty/serdev/Kconfig
+++ b/drivers/tty/serdev/Kconfig
@@ -3,6 +3,7 @@
 #
 menuconfig SERIAL_DEV_BUS
tristate "Serial device bus"
+   select MULTIPLEXER
help
  Core support for devices connected via a serial port.
 
diff --git a/drivers/tty/serdev/Makefile b/drivers/tty/serdev/Makefile
index 0cbdb94..abe5b2a 100644
--- a/drivers/tty/serdev/Makefile
+++ b/drivers/tty/serdev/Makefile
@@ -1,5 +1,5 @@
 serdev-objs := core.o
 
-obj-$(CONFIG_SERIAL_DEV_BUS) += serdev.o
+obj-$(CONFIG_SERIAL_DEV_BUS) += serdev.o mux.o
 
 obj-$(CONFIG_SERIAL_DEV_CTRL_TTYPORT) += serdev-ttyport.o
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 8491056..22acd08 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -307,7 +307,8 @@ struct serdev_device *serdev_device_alloc(struct 
serdev_controller *ctrl)
return NULL;
 
serdev->ctrl = ctrl;
-   ctrl->serdev = serdev;
+   if (!ctrl->serdev)
+   ctrl->serdev = serdev;
device_initialize(>dev);
serdev->dev.parent = >dev;
serdev->dev.bus = _bus_type;
@@ -370,6 +371,7 @@ static int of_serdev_register_devices(struct 
serdev_controller *ctrl)
struct serdev_device *serdev = NULL;
int err;
bool found = false;
+   u32 reg;
 
for_each_available_child_of_node(ctrl->dev.of_node, node) {
if (!of_get_property(node, "compatible", NULL))
@@ -383,6 +385,11 @@ static int of_serdev_register_devices(struct 
serdev_controller *ctrl)
 
serdev->dev.of_node = node;
 
+   if (!of_property_read_u32(node, "reg", )) {
+   serdev->mux_addr = reg;
+   serdev->nr = reg;
+   }
+
err = serdev_device_add(serdev);
if (err) {
dev_err(>dev,
@@ -416,6 +423,10 @@ int serdev_controller_add(struct serdev_controller *ctrl)
if (ret)
return ret;
 
+   if (ctrl->dev.of_node &&
+   of_serdev_register_mux(ctrl) == -EPROBE_DEFER)
+   return -EPROBE_DEFER;
+
ret = of_serdev_register_devices(ctrl);
if (ret)
goto out_dev_del;
diff --git a/drivers/tty/serdev/mux.c b/drivers/tty/serdev/mux.c
new file mode 100644
index 000..fc9405b
--- /dev/null
+++ b/drivers/tty/serdev/mux.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2017 Ulrich Hecht
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int serdev_device_mux_select(struct serdev_device *serdev)
+{
+   struct mux_control *mux = serdev->ctrl->mux;
+   int ret;
+
+   if (!mux)
+   return -EINVAL;
+
+   ret = mux_control_select(mux, serdev->mux_addr);
+   serdev->ctrl->mux_do_not_deselect = ret < 0;
+
+   serdev->ctrl->serdev = serdev;
+
+   return ret;
+}
+
+int serdev_device_mux_deselect(struct serdev_device *serdev)
+{
+   struct mux_control *mux = serdev->ctrl->mux;
+
+   if (!mux)
+   return -EINVAL;
+
+   if (!serdev->ctrl->mux_do_not_deselect)
+   return mux_control_deselect(mux);
+   else
+   return 0;
+}
+
+int of_serdev_register_mux(struct serdev_controller *ctrl)
+{
+   struct mux_control *mux;
+   struct device *dev = >dev;
+
+   mux = devm_mux_control_get(dev, NULL);
+
+   if (IS_ERR(mux)) {
+   if (PTR_ERR(mux) != -EPROBE_DEFER)
+   dev_err(dev, "failed to get control mux\n");
+   return PTR_ERR(mux);
+   }
+
+   ctrl->mux = mux;
+
+   return 0;
+}
+
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index 8f60f11..3ed0f75 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct serdev_controller;
 struct serdev_device;
@@ -51,6 +52,7 @@ struct serdev_device {
const struct 

[PATCH 4/6] max9260: add driver for i2c over GMSL passthrough

2017-08-16 Thread Ulrich Hecht
This driver implements tunnelling of i2c requests over GMSL via a
MAX9260 deserializer. It provides an i2c adapter that can be used
to reach devices on the far side of the link.

Signed-off-by: Ulrich Hecht 
---
 drivers/media/i2c/Kconfig   |   6 +
 drivers/media/i2c/Makefile  |   1 +
 drivers/media/i2c/max9260.c | 300 
 3 files changed, 307 insertions(+)
 create mode 100644 drivers/media/i2c/max9260.c

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index fa2e7d8..b85ae78 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -424,6 +424,12 @@ config VIDEO_VPX3220
  To compile this driver as a module, choose M here: the
  module will be called vpx3220.
 
+config VIDEO_MAX9260
+   tristate "Maxim MAX9260 GMSL deserializer support"
+   depends on I2C
+   ---help---
+ This driver supports the Maxim MAX9260 GMSL deserializer.
+
 comment "Video and audio decoders"
 
 config VIDEO_SAA717X
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index 30e856c..3b6f6f2 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_OV7640) += ov7640.o
 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
 obj-$(CONFIG_VIDEO_OV9650) += ov9650.o
 obj-$(CONFIG_VIDEO_OV13858) += ov13858.o
+obj-$(CONFIG_VIDEO_MAX9260) += max9260.o
 obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o
 obj-$(CONFIG_VIDEO_MT9M111) += mt9m111.o
 obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
diff --git a/drivers/media/i2c/max9260.c b/drivers/media/i2c/max9260.c
new file mode 100644
index 000..9c890ab
--- /dev/null
+++ b/drivers/media/i2c/max9260.c
@@ -0,0 +1,300 @@
+/*
+ * Maxim MAX9260 GMSL Deserializer Driver
+ *
+ * Copyright (C) 2017 Ulrich Hecht
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define SYNC   0x79
+#define ACK0xc3
+
+#define REG_ID 0x1e
+
+#define ID_MAX9260 0x02
+
+enum max9260_rx_state {
+   RX_FINISHED,
+   RX_FRAME_ERROR,
+   RX_EXPECT_ACK,
+   RX_EXPECT_ACK_DATA,
+   RX_EXPECT_DATA,
+};
+
+struct max9260_device {
+   struct serdev_device *serdev;
+   u8 *rx_buf;
+   size_t rx_len;
+   enum max9260_rx_state rx_state;
+   wait_queue_head_t rx_wq;
+   struct i2c_adapter adap;
+};
+
+static void max9260_wait_for_transaction(struct max9260_device *dev)
+{
+   wait_event_timeout(dev->rx_wq, dev->rx_state <= RX_FRAME_ERROR,
+   HZ/2);
+}
+
+static void max9260_transact(struct max9260_device *dev,
+int expect,
+const u8 *request, int len,
+u8 *rx_buf, int rx_len)
+{
+   dev->rx_buf = rx_buf;
+   dev->rx_len = rx_len;
+
+   serdev_device_mux_select(dev->serdev);
+
+   serdev_device_set_baudrate(dev->serdev, 115200);
+   serdev_device_set_parity(dev->serdev, SERDEV_PARITY_EVEN);
+
+   dev->rx_state = expect;
+   serdev_device_write_buf(dev->serdev, request, len);
+
+   max9260_wait_for_transaction(dev);
+
+   serdev_device_mux_deselect(dev->serdev);
+}
+
+static int max9260_read_reg(struct max9260_device *dev, int reg)
+{
+   u8 request[] = { SYNC, 0x91, reg, 1 };
+   u8 rx;
+
+   dev->rx_len = 1;
+   dev->rx_buf = 
+
+   max9260_transact(dev, RX_EXPECT_ACK_DATA, request,
+ARRAY_SIZE(request),
+, 1);
+
+   if (dev->rx_state == RX_FINISHED)
+   return rx;
+
+   return -EIO;
+}
+
+static int max9260_setup(struct max9260_device *dev)
+{
+   int ret;
+
+   ret = max9260_read_reg(dev, REG_ID);
+
+   if (ret != ID_MAX9260) {
+   dev_err(>serdev->dev,
+   "device does not identify as MAX9260\n");
+   return -ENODEV;
+   }
+
+   return 0;
+}
+
+static void max9260_uart_write_wakeup(struct serdev_device *serdev)
+{
+}
+
+static int max9260_uart_receive_buf(struct serdev_device *serdev,
+   const u8 *data, size_t count)
+{
+   struct max9260_device *dev = serdev_device_get_drvdata(serdev);
+   size_t accepted;
+
+   switch (dev->rx_state) {
+   case RX_FINISHED:
+   dev_dbg(>serdev->dev, "excess data ignored\n");
+   return count;
+
+   case RX_EXPECT_ACK:
+   case RX_EXPECT_ACK_DATA:
+   if (data[0] != ACK) {
+   dev_dbg(>serdev->dev, "frame error");
+   dev->rx_state = RX_FRAME_ERROR;
+   wake_up_interruptible(>rx_wq);
+   return 1;

Re: [RFC v2 3/6] serdev: add multiplexer support

2017-08-16 Thread Ulrich Hecht
On Wed, Jul 19, 2017 at 1:06 AM, Rob Herring  wrote:
>>  static inline struct serdev_controller *to_serdev_controller(struct device 
>> *d)
>> @@ -172,7 +180,7 @@ static inline void serdev_controller_write_wakeup(struct 
>> serdev_controller *ctrl
>>  {
>> struct serdev_device *serdev = ctrl->serdev;
>>
>> -   if (!serdev || !serdev->ops->write_wakeup)
>> +   if (!serdev || !serdev->ops || !serdev->ops->write_wakeup)
>
> When is ops ever NULL? Should be a separate change AFIACT.

I dumped it; IIRC that happened once during development due to a bug elsewhere.

CU
Uli


Re: [RFC v2 5/6] max9260: add driver for i2c over GMSL passthrough

2017-08-16 Thread Ulrich Hecht
On Mon, Jul 31, 2017 at 1:13 PM, Laurent Pinchart
 wrote:
>> +static int max9260_probe(struct serdev_device *serdev)
>> +{
>> + struct max9260_device *dev;
>> + struct i2c_adapter *adap;
>> + int ret;
>> +
>> + dev = kzalloc(sizeof(*dev), GFP_KERNEL);
>> + if (!dev)
>> + return -ENOMEM;
>> +
>> + init_waitqueue_head(>rx_wq);
>> +
>> + dev->serdev = serdev;
>> + serdev_device_open(serdev);
>> + serdev_device_set_drvdata(serdev, dev);
>> +
>> + serdev_device_set_client_ops(serdev, _serdev_client_ops);
>> +
>> + ret = max9260_setup(dev);
>> + if (ret < 0)
>> + goto err_free;
>> +
>> + adap = >adap;
>> + i2c_set_adapdata(adap, dev);
>> +
>> + adap->owner = THIS_MODULE;
>> + adap->algo = _i2c_algorithm;
>> + adap->dev.parent = >dev;
>> + adap->retries = 5;
>> + strlcpy(adap->name, dev_name(>dev), sizeof(adap->name));
>> +
>> + ret = i2c_add_adapter(adap);
>> + if (ret < 0)
>> + return ret;
>> +
>> + return 0;
>> +
>> +err_free:
>
> No need for a serdev_device_close() ?

serdev_device_{open,close}() actually operate on the controller, so
that would pull the rug from under the other devices connected to that
controller.

CU
Uli


[PATCH 1/6] serdev: add method to set parity

2017-08-16 Thread Ulrich Hecht
Adds serdev_device_set_parity() and an implementation for ttyport.

Signed-off-by: Ulrich Hecht 
---
 drivers/tty/serdev/core.c   | 12 
 drivers/tty/serdev/serdev-ttyport.c | 18 ++
 include/linux/serdev.h  | 10 ++
 3 files changed, 40 insertions(+)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index ae1aaa0..8491056 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -242,6 +242,18 @@ int serdev_device_set_tiocm(struct serdev_device *serdev, 
int set, int clear)
 }
 EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);
 
+int serdev_device_set_parity(struct serdev_device *serdev,
+enum serdev_parity parity)
+{
+   struct serdev_controller *ctrl = serdev->ctrl;
+
+   if (!ctrl || !ctrl->ops->set_parity)
+   return -ENOTSUPP;
+
+   return ctrl->ops->set_parity(ctrl, parity);
+}
+EXPORT_SYMBOL_GPL(serdev_device_set_parity);
+
 static int serdev_drv_probe(struct device *dev)
 {
const struct serdev_device_driver *sdrv = 
to_serdev_device_driver(dev->driver);
diff --git a/drivers/tty/serdev/serdev-ttyport.c 
b/drivers/tty/serdev/serdev-ttyport.c
index 302018d..2883f12 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -195,6 +195,23 @@ static int ttyport_set_tiocm(struct serdev_controller 
*ctrl, unsigned int set, u
return tty->driver->ops->tiocmset(tty, set, clear);
 }
 
+static int ttyport_set_parity(struct serdev_controller *ctrl,
+ enum serdev_parity parity)
+{
+   struct serport *serport = serdev_controller_get_drvdata(ctrl);
+   struct tty_struct *tty = serport->tty;
+   struct ktermios ktermios = tty->termios;
+
+   ktermios.c_cflag &= ~(PARENB | PARODD);
+   if (parity != SERDEV_PARITY_NONE) {
+   ktermios.c_cflag |= PARENB;
+   if (parity == SERDEV_PARITY_ODD)
+   ktermios.c_cflag |= PARODD;
+   }
+
+   return tty_set_termios(tty, );
+}
+
 static const struct serdev_controller_ops ctrl_ops = {
.write_buf = ttyport_write_buf,
.write_flush = ttyport_write_flush,
@@ -206,6 +223,7 @@ static const struct serdev_controller_ops ctrl_ops = {
.wait_until_sent = ttyport_wait_until_sent,
.get_tiocm = ttyport_get_tiocm,
.set_tiocm = ttyport_set_tiocm,
+   .set_parity = ttyport_set_parity,
 };
 
 struct device *serdev_tty_port_register(struct tty_port *port,
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index e69402d..8f60f11 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -76,6 +76,12 @@ static inline struct serdev_device_driver 
*to_serdev_device_driver(struct device
return container_of(d, struct serdev_device_driver, driver);
 }
 
+enum serdev_parity {
+   SERDEV_PARITY_NONE,
+   SERDEV_PARITY_EVEN,
+   SERDEV_PARITY_ODD,
+};
+
 /*
  * serdev controller structures
  */
@@ -90,6 +96,7 @@ struct serdev_controller_ops {
void (*wait_until_sent)(struct serdev_controller *, long);
int (*get_tiocm)(struct serdev_controller *);
int (*set_tiocm)(struct serdev_controller *, unsigned int, unsigned 
int);
+   int (*set_parity)(struct serdev_controller *, enum serdev_parity);
 };
 
 /**
@@ -298,6 +305,9 @@ static inline int serdev_device_set_rts(struct 
serdev_device *serdev, bool enabl
return serdev_device_set_tiocm(serdev, 0, TIOCM_RTS);
 }
 
+int serdev_device_set_parity(struct serdev_device *serdev,
+enum serdev_parity parity);
+
 /*
  * serdev hooks into TTY core
  */
-- 
2.7.4



Re: [RFC v2 5/6] max9260: add driver for i2c over GMSL passthrough

2017-08-16 Thread Ulrich Hecht
On Wed, Jul 19, 2017 at 5:00 PM, Wolfram Sang  wrote:
>> +{
>> + wait_event_interruptible_timeout(dev->rx_wq,
>> + dev->rx_state <= RX_FRAME_ERROR,
>> + HZ/2);
>
> I'd suggest to drop the interruptible. It can be done but it is usually
> not trivial to abort the operation gracefully when a signal comes in.
>
> Also, timeout is superfluous since you don't get the return value?

Be that as it may, I still want a timeout; wouldn't wait_event() block forever?

CU
Uli


Re: [PATCH 6/6] dt-bindings: slave-device: add reg property

2017-08-16 Thread Laurent Pinchart
Hi Ulrich,

Thank you for the patch.

On Wednesday 16 Aug 2017 15:22:28 Ulrich Hecht wrote:
> This adds a new DT property to define the index used by a multiplexer to
> select the device.
> 
> Signed-off-by: Ulrich Hecht 
> ---
>  Documentation/devicetree/bindings/serial/slave-device.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/serial/slave-device.txt
> b/Documentation/devicetree/bindings/serial/slave-device.txt index
> 40110e0..f9b0783 100644
> --- a/Documentation/devicetree/bindings/serial/slave-device.txt
> +++ b/Documentation/devicetree/bindings/serial/slave-device.txt
> @@ -30,6 +30,8 @@ Optional Properties:
> way to reset the device
>   * device baud rate is configured by its firmware but
> there is no way to request the actual settings
> +- reg: Index used to select the device if it is controlled 
by a
> +   multiplexer.

The reg property should describe the device address on the bus it is connected 
to. This seems like an abuse of the property to me. The device shouldn't care 
about the multiplexer, I think you should describe the hardware by adding the 
serial device's DT node as a child of the multiplexer's port it is connected 
to.

>  Example:

-- 
Regards,

Laurent Pinchart



[PATCH 0/6] serdev multiplexing support

2017-08-16 Thread Ulrich Hecht
Hi!

Here's a new version of serdev multiplexing support. Thanks to everybody who
commented; I think I have included all non-optional suggestions. :)
Changes are manifold, please refer to the changelog below.

This version drops "mux: include compiler.h from mux/consumer.h",
which is on its way upstream by now.

CU
Uli


Changes since RFC v2:
- parity: use an enum instead of the traditional enable/odd flags
- mux: include it in the serdev core, remove option
- mux: add "select MULTIPLEXER" to Kconfig
- serdev: use device "reg" node as serdev_device::nr
- mux: check if device has an of_node before trying to register mux
- serdev: remove check for !serdev->ops in,
  serdev_controller_write_wakeup(), it is not needed
- max9260: replace register numbers, magic protocol bytes and device ID with
  macros
- max9260: use enum instead of macros for the rx_state
- max9260: use wait_event_timeout() instead of
  wait_event_interruptible_timeout()
- max9260: pass all parameters for max9260_transact() as arguments
- max9260: add "max9260_" prefix to max9260_wait_for_transaction()
- max9260: return -ENODEV instead of -EINVAL if the device does not respond
  correctly
- max9260: change a number of length-bearing variables to size_t
- dt: number max9260 devices according to their "reg" node


Ulrich Hecht (6):
  serdev: add method to set parity
  serdev: add multiplexer support
  serial: core: support deferring serdev controller registration
  max9260: add driver for i2c over GMSL passthrough
  ARM: dts: blanche: add SCIF1 and MAX9260 deserializer
  dt-bindings: slave-device: add reg property

 .../devicetree/bindings/serial/slave-device.txt|   2 +
 arch/arm/boot/dts/r8a7792-blanche.dts  |  52 
 drivers/media/i2c/Kconfig  |   6 +
 drivers/media/i2c/Makefile |   1 +
 drivers/media/i2c/max9260.c| 300 +
 drivers/tty/serdev/Kconfig |   1 +
 drivers/tty/serdev/Makefile|   2 +-
 drivers/tty/serdev/core.c  |  25 +-
 drivers/tty/serdev/mux.c   |  66 +
 drivers/tty/serdev/serdev-ttyport.c|  18 ++
 drivers/tty/serial/serial_core.c   |   4 +
 include/linux/serdev.h |  24 +-
 12 files changed, 497 insertions(+), 4 deletions(-)
 create mode 100644 drivers/media/i2c/max9260.c
 create mode 100644 drivers/tty/serdev/mux.c

-- 
2.7.4



Re: [RFC v2 5/6] max9260: add driver for i2c over GMSL passthrough

2017-08-16 Thread Laurent Pinchart
Hi Ulrich,

On Wednesday 16 Aug 2017 15:23:52 Ulrich Hecht wrote:
> On Wed, Jul 19, 2017 at 5:00 PM, Wolfram Sang  wrote:
> >> +{
> >> + wait_event_interruptible_timeout(dev->rx_wq,
> >> + dev->rx_state <= RX_FRAME_ERROR,
> >> + HZ/2);
> > 
> > I'd suggest to drop the interruptible. It can be done but it is usually
> > not trivial to abort the operation gracefully when a signal comes in.
> > 
> > Also, timeout is superfluous since you don't get the return value?
> 
> Be that as it may, I still want a timeout; wouldn't wait_event() block
> forever?

I think that Wolfram's point is that you should report the timeout error up to 
the upper layers.

-- 
Regards,

Laurent Pinchart



Re: [GIT PULL for renesas-drivers] ADV748x v5 driver.

2017-08-16 Thread Geert Uytterhoeven
Hi Kieran,

On Wed, Jun 14, 2017 at 10:23 PM, Kieran Bingham  wrote:
> Please consider this pull request for the next renesas-drivers release.
>
> This driver is based on linux-media/master branch
>
> --
> Regards
>
> Kieran
>
> The following changes since commit acec3630155763c170c7ae6508cf973355464508:
>
>   [media] s3c-camif: fix arguments position in a function call (2017-06-13 
> 14:21:24 -0300)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git 
> adv748x/driver
>
> for you to fetch changes up to e261761c366279a26490f3dc8aca7422a73ba720:
>
>   media: i2c: adv748x: add adv748x driver (2017-06-14 15:39:37 +0100)

Dropped, as this has been merged upstream.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PULL REQUEST] renesas/topic/i2c-core-dma for renesas drivers

2017-08-16 Thread Geert Uytterhoeven
Hi Wolfram,

On Thu, Jun 15, 2017 at 9:25 PM, Wolfram Sang  wrote:
> here is a topic branch for renesas-drivers adding better DMA support to
> the I2C core. It is based on i2c/for-next with the branch
> 'renesas/arm64-dt-for-v4.13' from Simon merged as well. Please pull.
>
> Kind regards,
>
>Wolfram
>
>
> The following changes since commit b41c5497755a66628e2ebf4641ce2849c79bb731:
>
>   Merge remote-tracking branch 'renesas/arm64-dt-for-v4.13' into 
> renesas/topic/i2c-core-dma (2017-06-15 16:14:46 +0200)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git 
> renesas/topic/i2c-core-dma

I took the liberty to upgrade to renesas/topic/i2c-core-dma-v3.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [GIT PULL FOR renesas-drivers] R-Car H3 ES2.0 display support, v2

2017-08-16 Thread Geert Uytterhoeven
Hi Laurent,

On Mon, Jun 26, 2017 at 8:58 PM, Laurent Pinchart
 wrote:
> The following changes implement display support for the R-Car H3 ES2.0. They
> have been split in two distinct branches:

> - tags/drm-h3-es2-vsp-du-20170626 contains the VSP changes and is based on top
> of the latest DRM -next branch
>
> The following changes since commit 047b8e21e3bfa9faa4ed9a0c337fe0c687710251:
>
>   Merge tag 'drm-misc-next-2017-06-19_0' of
> git://anongit.freedesktop.org/git/drm-misc into drm-next (2017-06-21 08:57:34
> +1000)
>
> are available in the git repository at:
>
>   git://linuxtv.org/pinchartl/media.git tags/drm-h3-es2-vsp-du-20170626
>
> for you to fetch changes up to 8d09cbf4a12a4c79619c0edf23f9e219e29f5749:
>
>   drm: rcar-du: Configure DPAD0 routing through last group on Gen3 (2017-06-26
> 19:08:54 +0300)

Dropped, as it looks like a newer version has been merged upstream.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH v3 1/4] i2c: add helpers to ease DMA handling

2017-08-16 Thread Geert Uytterhoeven
Hi Wolfram,

On Tue, Jul 18, 2017 at 12:23 PM, Wolfram Sang
 wrote:
> One helper checks if DMA is suitable and optionally creates a bounce
> buffer, if not. The other function returns the bounce buffer and makes
> sure the data is properly copied back to the message.
>
> Signed-off-by: Wolfram Sang 
> ---
> Changes since v2:
>
> * rebased to v4.13-rc1
> * helper functions are not inlined anymore but moved to i2c core
> * __must_check has been added to the buffer check helper
> * the release function has been renamed to contain 'dma' as well

Right:

drivers/i2c/i2c-core-base.c:2310:15: error: 'i2c_release_bounce_buf'
undeclared here (not in a function)
 EXPORT_SYMBOL_GPL(i2c_release_bounce_buf);

> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c

> +/**
> + * i2c_release_bounce_buf - copy data back from bounce buffer and release it
  ^^
> + * @msg: the message to be copied back to
> + * @bounce_buf: the bounce buffer obtained from i2c_check_msg_for_dma().
> + * May be NULL.
> + */
> +void i2c_release_dma_bounce_buf(struct i2c_msg *msg, u8 *bounce_buf)
> +{
> +   if (!bounce_buf)
> +   return;
> +
> +   if (msg->flags & I2C_M_RD)
> +   memcpy(msg->buf, bounce_buf, msg->len);
> +
> +   kfree(bounce_buf);
> +}
> +EXPORT_SYMBOL_GPL(i2c_release_bounce_buf);
 ^^

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH v3 1/4] i2c: add helpers to ease DMA handling

2017-08-16 Thread Wolfram Sang

> Right:
> 
> drivers/i2c/i2c-core-base.c:2310:15: error: 'i2c_release_bounce_buf'
> undeclared here (not in a function)
>  EXPORT_SYMBOL_GPL(i2c_release_bounce_buf);

Thanks. I am just now working on V4 currently which is a redesign.
I'll write more in an hour or so.



signature.asc
Description: PGP signature


Re: [GIT PULL] Renesas ARM Based SoC DT Bindings Updates for v4.14

2017-08-16 Thread Arnd Bergmann
On Mon, Jul 31, 2017 at 5:04 PM, Simon Horman
 wrote:
> Renesas ARM Based SoC DT Bindings Updates for v4.14
>
> * Document R-Car D3 (r8a77995) SoC and Draak board
>
> * Document reserved SRAM for the SMP jump stub on R-Car Gen2 and RZ/G1 SoCs
>
>   Geert Uytterhoeven says, "+Renesas R-Car Gen2 and RZ/G1 SoCs need a small
>   piece of SRAM for the jump stub +for secondary CPU bringup and CPU
>   hotplug.  +This memory is reserved by adding a child node to a
>   "mmio-sram" node..."
>
> * Add a VSP channel index to DU vsps
>
>   Laurent Pinchart says, "multiple LIF instances in the VSP. The current DT
>   bindings don't support specifying that kind of SoC integration scheme.
>   Extend them with a VSP channel index."
>
> * Add R-Car M3-W (r8a7796) HDMI TX DT bindings
>
>   This is compatible with existing R-Car H3 (r8a7795) support

Pulled into next/dt, thanks!

   Arnd


Re: [GIT PULL] Renesas ARM64 Based SoC DT Updates for v4.14

2017-08-16 Thread Arnd Bergmann
On Mon, Jul 31, 2017 at 5:03 PM, Simon Horman
 wrote:
> 
> Renesas ARM64 Based SoC DT Updates for v4.14
>
> * Add usb2.0 for R-Car H3 (r8a7795) ES2.0 SoC
>
> * Add R-Car D3 (r8a77995) SoC and Draak board support
>
>   Adds minimal support for the R-Car D3 SoC and the Draak development
>   board, allowing to boot from a ramdisk using a serial console.
>
> * Add Add VC6 clock generator to R-Car H3 (r8a7795)/Salvator-XS board
>
>   The VC6 is an I2C-controlled programmable clock generator, used on the
>   board to provide a display dot clock. Add it to DT.
>
> * Add missing second pair of DMA names to MSIOF nodes to
>   R-Car M3-W (r8a7796) SoC
>
>   MSIOF0 and MSIOF1 are tied to two DMA controllers through two pairs of
>   DMA specifiers.  However, the second pair of corresponding DMA names was
>   missing.
>
> * Add support for the DU to R-Car H3 (r8a7795) SoC
>
>   Add a compatible string and VSP links to the DU node. The H3 ES1.x and H3
>   ES2.0 are compatible save for the links to the VSPs that are described
>   explicitly in DT, so there's no need for a new ES2-specific compatible
>   string.
>
> * Enable HDMI on R-Car H3 (r8a7795) and M3-W (r8a7796) ULCB boards
>
> * Enable DU on R-Car M3-W (r8a7796) Salvator-X board
>
> * Enable I2C for DVFS on R-Car H3 (r8a7795) and M3-W (r8a7796) ULCB boards
>
> * Add Add DRIF support to R-Car H3 (r8a7795) and M3-W (r8a7796) SoCs
>
>   Ramesh Shanmugasundaram says, "R-Car Gen3 DRIF is a SPI like receive only
>   slave device."
>
> * Move CPG_AUDIO_CLK_I from board to soc files
>
>   Geert Uytterhoeven says, "The definition of CPG_AUDIO_CLK_I is
>   SoC-specific, not board-specific."
>
> * Add IMR-LX4 support to R-Car H3 (r8a7795) and M3-W (r8a7796) SoCs
>
>   Sergei Shtylyov says, "The image renderer light extended 4 (IMR-LX4) or
>   the distortion correction engine is a drawing processor with a simple
>   instruction system capable of referencing data on an external memory as
>   2D texture data and performing texture mapping and drawing with respect
>   to any shape that is split into triangular objects."

Pulled into next/dt64, thanks!

   Arnd


[renesas-drivers:clk-renesas-for-v4.14 10/11] drivers/clk/renesas/rcar-usb2-clock-sel.c:149:5-17: duplicated argument to && or || (fwd)

2017-08-16 Thread Julia Lawall
On line 149, it looks like one extal should instead be xtal.

julia

-- Forwarded message --
Date: Thu, 17 Aug 2017 02:43:28 +0800
From: kbuild test robot 
To: kbu...@01.org
Cc: Julia Lawall 
Subject: [renesas-drivers:clk-renesas-for-v4.14 10/11]
drivers/clk/renesas/rcar-usb2-clock-sel.c:149:5-17: duplicated argument to
&& or ||

CC: kbuild-...@01.org
CC: linux-renesas-soc@vger.kernel.org
TO: Yoshihiro Shimoda 
CC: Geert Uytterhoeven 

tree:   
https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git 
clk-renesas-for-v4.14
head:   344fae7f354bdb869115212a56d39d5f2034466d
commit: 0b2934329320899150286a7fdec9c7d143d0bdb9 [10/11] clk: renesas: 
rcar-usb2-clock-sel: Add R-Car USB 2.0 clock selector PHY
:: branch date: 11 hours ago
:: commit date: 11 hours ago

>> drivers/clk/renesas/rcar-usb2-clock-sel.c:149:5-17: duplicated argument to 
>> && or ||

# 
https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/commit/?id=0b2934329320899150286a7fdec9c7d143d0bdb9
git remote add renesas-drivers 
https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git
git remote update renesas-drivers
git checkout 0b2934329320899150286a7fdec9c7d143d0bdb9
vim +149 drivers/clk/renesas/rcar-usb2-clock-sel.c

0b293432 Yoshihiro Shimoda 2017-07-25  116
0b293432 Yoshihiro Shimoda 2017-07-25  117  static int 
rcar_usb2_clock_sel_probe(struct platform_device *pdev)
0b293432 Yoshihiro Shimoda 2017-07-25  118  {
0b293432 Yoshihiro Shimoda 2017-07-25  119  struct device *dev = >dev;
0b293432 Yoshihiro Shimoda 2017-07-25  120  struct device_node *np = 
dev->of_node;
0b293432 Yoshihiro Shimoda 2017-07-25  121  struct usb2_clock_sel_priv 
*priv;
0b293432 Yoshihiro Shimoda 2017-07-25  122  struct resource *res;
0b293432 Yoshihiro Shimoda 2017-07-25  123  struct clk *clk;
0b293432 Yoshihiro Shimoda 2017-07-25  124  struct clk_init_data init;
0b293432 Yoshihiro Shimoda 2017-07-25  125
0b293432 Yoshihiro Shimoda 2017-07-25  126  priv = devm_kzalloc(dev, 
sizeof(*priv), GFP_KERNEL);
0b293432 Yoshihiro Shimoda 2017-07-25  127  if (!priv)
0b293432 Yoshihiro Shimoda 2017-07-25  128  return -ENOMEM;
0b293432 Yoshihiro Shimoda 2017-07-25  129
0b293432 Yoshihiro Shimoda 2017-07-25  130  res = 
platform_get_resource(pdev, IORESOURCE_MEM, 0);
0b293432 Yoshihiro Shimoda 2017-07-25  131  priv->base = 
devm_ioremap_resource(dev, res);
0b293432 Yoshihiro Shimoda 2017-07-25  132  if (IS_ERR(priv->base))
0b293432 Yoshihiro Shimoda 2017-07-25  133  return 
PTR_ERR(priv->base);
0b293432 Yoshihiro Shimoda 2017-07-25  134
0b293432 Yoshihiro Shimoda 2017-07-25  135  pm_runtime_enable(dev);
0b293432 Yoshihiro Shimoda 2017-07-25  136  pm_runtime_get_sync(dev);
0b293432 Yoshihiro Shimoda 2017-07-25  137
0b293432 Yoshihiro Shimoda 2017-07-25  138  clk = devm_clk_get(dev, 
"usb_extal");
0b293432 Yoshihiro Shimoda 2017-07-25  139  if (!IS_ERR(clk) && 
!clk_prepare_enable(clk)) {
0b293432 Yoshihiro Shimoda 2017-07-25  140  priv->extal = 
!!clk_get_rate(clk);
0b293432 Yoshihiro Shimoda 2017-07-25  141  
clk_disable_unprepare(clk);
0b293432 Yoshihiro Shimoda 2017-07-25  142  }
0b293432 Yoshihiro Shimoda 2017-07-25  143  clk = devm_clk_get(dev, 
"usb_xtal");
0b293432 Yoshihiro Shimoda 2017-07-25  144  if (!IS_ERR(clk) && 
!clk_prepare_enable(clk)) {
0b293432 Yoshihiro Shimoda 2017-07-25  145  priv->xtal = 
!!clk_get_rate(clk);
0b293432 Yoshihiro Shimoda 2017-07-25  146  
clk_disable_unprepare(clk);
0b293432 Yoshihiro Shimoda 2017-07-25  147  }
0b293432 Yoshihiro Shimoda 2017-07-25  148
0b293432 Yoshihiro Shimoda 2017-07-25 @149  if (!priv->extal && 
!priv->extal) {
0b293432 Yoshihiro Shimoda 2017-07-25  150  dev_err(dev, "This 
driver needs usb_extal or usb_xtal\n");
0b293432 Yoshihiro Shimoda 2017-07-25  151  return -ENOENT;
0b293432 Yoshihiro Shimoda 2017-07-25  152  }
0b293432 Yoshihiro Shimoda 2017-07-25  153
0b293432 Yoshihiro Shimoda 2017-07-25  154  platform_set_drvdata(pdev, 
priv);
0b293432 Yoshihiro Shimoda 2017-07-25  155  dev_set_drvdata(dev, priv);
0b293432 Yoshihiro Shimoda 2017-07-25  156
0b293432 Yoshihiro Shimoda 2017-07-25  157  init.name = 
"rcar_usb2_clock_sel";
0b293432 Yoshihiro Shimoda 2017-07-25  158  init.ops = 
_clock_sel_clock_ops;
0b293432 Yoshihiro Shimoda 2017-07-25  159  init.flags = 0;
0b293432 Yoshihiro Shimoda 2017-07-25  160  init.parent_names = NULL;
0b293432 Yoshihiro Shimoda 2017-07-25  161  init.num_parents = 0;
0b293432 Yoshihiro Shimoda 2017-07-25  162  priv->hw.init = 
0b293432 Yoshihiro Shimoda 2017-07-25  163
0b293432 Yoshihiro Shimoda 2017-07-25  164  clk = clk_register(NULL, 
>hw);
0b293432 Yoshihiro Shimoda 2017-07-25  165  if 

Re: [PATCH] soc: Convert to using %pOF instead of full_name

2017-08-16 Thread Arnd Bergmann
On Thu, Aug 10, 2017 at 12:09 AM, Rob Herring  wrote:
> On Tue, Jul 18, 2017 at 4:43 PM, Rob Herring  wrote:
>> Now that we have a custom printf format specifier, convert users of
>> full_name to use %pOF instead. This is preparation to remove storing
>> of the full path string for each node.
>>
>> Signed-off-by: Rob Herring 
>> Cc: Scott Wood 
>> Cc: Qiang Zhao 
>> Cc: Matthias Brugger 
>> Cc: Simon Horman 
>> Cc: Magnus Damm 
>> Cc: Kukjin Kim 
>> Cc: Krzysztof Kozlowski 
>> Cc: Javier Martinez Canillas 

> Arnd, Olof,
>
> Can you please apply this one.

Applied to next/drivers with the various Acks, thanks!

  Arnd


Re: [GIT PULL] Renesas ARM Based SoC Drivers Updates for v4.14

2017-08-16 Thread Arnd Bergmann
On Mon, Jul 31, 2017 at 5:04 PM, Simon Horman
 wrote:
> 
> Renesas ARM Based SoC Drivers Updates for v4.14
>
> Add R-Car D3 (r8a77995) support to the Renesas-specific SoC drivers
> - SoC identification
> - System controller
> - Reset controller

Pulled into next/drivers, thanks!

   Arnd


renesas-drivers-2017-08-16-v4.13-rc5

2017-08-16 Thread Geert Uytterhoeven
I have pushed renesas-drivers-2017-08-16-v4.13-rc5 to
https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git

This tree is meant to ease development of platform support and drivers
for Renesas ARM SoCs. It is created by merging (a) the for-next branches
of various subsystem trees and (b) branches with driver code submitted
or planned for submission to maintainers into the development branch of
Simon Horman's renesas.git tree.

Today's version is based on renesas-devel-20170814-v4.13-rc5.

Due to board farm refactoring, this release has received less testing than
usually.

Included branches with driver code:
  - clk-renesas-for-v4.14
  - sh-pfc-for-v4.14
  - topic/suspend-to-idle-v1
  - topic/sh-sh7722-sh7757-sh7264-sh7269-fix-pinctrl-v2
  - topic/r8a77995-integration
  - topic/rcar2-cpg-mssr-dt-v2
  - git://git.ragnatech.se/linux#for-renesas-drivers
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#renesas/topic/i2c-core-dma-v3
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git#tags/vsp1/tlb-optimise-v2

Included fixes:
  - CPI: SPCR: Add missing opening brace
  - i2c: Fix kerneldoc and exported symbol for i2c_release_dma_bounce_buf()
  - of_mdio: Fix broken PHY IRQ in case of probe deferral
  - rcar-vin: Fix section mismatch from rcar_vin_probe()
  - media: rcar-csi2: Fix section mismatch from rcar_csi2_probe()

Included subsystem trees (the last one is new):
  - git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git#linux-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git#clk-next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git#for-next
  - git://git.infradead.org/users/dedekind/l2-mtd-2.6.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git#tty-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#i2c/for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git#usb-next
  - git://people.freedesktop.org/~airlied/linux#drm-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git#next
  - git://linuxtv.org/mchehab/media-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git#for-next
  - git://git.linaro.org/people/daniel.lezcano/linux.git#clockevents/next
  - git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git#testing/next
  - git://git.infradead.org/users/vkoul/slave-dma.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git#staging-next
  - git://git.armlinux.org.uk/~rmk/linux-arm.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git#next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git#for-next
  - git://git.infradead.org/users/jcooper/linux.git#irqchip/for-next
  - git://github.com/bzolnier/linux.git#fbdev-for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git#for-next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git#for-next
  - git://www.linux-watchdog.org/linux-watchdog-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git#for-next/core
  - git://anongit.freedesktop.org/drm/drm-misc#for-linux-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git#next
  - git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git#next
  - git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git#for-mfd-next

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [GIT PULL] Renesas ARM Based SoC Updates for v4.14

2017-08-16 Thread Arnd Bergmann
On Mon, Jul 31, 2017 at 5:05 PM, Simon Horman
 wrote:
>
> * Add debug-ll support to RZ/G1M (r8a7743) SoC
>
>   Chris Paterson says, "RZ/G1M uses SCIF0 for the debug console, like most
>   of the R-Car Gen2 SoCs."
>
> * Remove ARCH_SHMOBILE_MULTI
>
>   Geert Uytterhoeven says, "The migration from ARCH_SHMOBILE_MULTI to
>   ARCH_RENESAS has been completed in v4.12..."
>
> * Correct arch timer frequency on RZ/G1M (r8a7743) SoC
>
>   Geert Uytterhoeven says, "According to the datasheet, the frequency of
>   the ARM architecture timer on RZ/G1E depends on the frequency of the ZS
>   clock..."
>
> * Add support for CPG/MSSR bindings
>
>   Geert Uytterhoeven says, "When using the new CPG/MSSR bindings, there is
>   no longer a "renesas,rcar-gen2-cpg-clocks" node, and the code to obtain
>   the external clock crystal frequency falls back to a default of 20 MHz.
>   While this is correct for all upstream R-Car Gen2 and RZ/G1 boards, this
>   is not necessarily the case for out-of-tree third party boards.
>
>   Add support for finding the external clock crystal oscillator on RZ/G1M,
>   and on R-Car H2, M2-W, and M2-N using the new CPG/MSSR bindings, through
>   the corresponding "renesas,r8a77xx-cpg-mssr" nodes."
>
> * Obtain jump stub region from DT
>
>   Geert Uytterhoeven says, "Add support for obtaining from DT the SRAM
>   region to store the jump stub for CPU core bringup, according to the
>   renesas,smp-sram DT bindings."

Pulled into next/soc, thanks!

  Arnd


Re: [PATCH v3 1/4] i2c: add helpers to ease DMA handling

2017-08-16 Thread Wolfram Sang
Hi Jonathan,

> I like the basic idea of this patch set a lot btw!

Thanks!

> Jonathan

Could you delete irrelevant parts of the message, please? I nearly
missed your other comment which would have been a great loss!

> I'm trying to get my head around whether this is a sufficient set of 
> conditions
> for a dma safe buffer and I'm not sure it is.
> 
> We go to a lot of effort with SPI buffers to ensure they are in their own 
> cache
> lines.  Do we not need to do the same here?  The issue would be the
> classic case of embedding a buffer inside a larger structure which is on
> the stack.  Need the magic of __cacheline_aligned to force it into it's
> own line for devices with dma-incoherent caches.
> DMA-API-HOWTO.txt (not read that for a while at it is a rather good
> at describing this stuff these days!)
> 
> So that one is easy enough to check by checking if it is cache line aligned,
> but what do you do to know there is nothing much after it?

Thank you, really!

This patch series addressed all cases I have created, but I also
wondered if there are cases left which I missed. Now, also because you
mentioned cacheline alignments, the faint idea of "maybe it could be
fragile" became a strong "it is too fragile"! lib/dma-debug.c is >40KB
for a reason. I just rewrote this series...

> Not sure there is a way around this short of auditing i2c drivers to
> change any that do this.

... to do something like this, more precisely: an opt-in approach. I
introduce a new flag for i2c_msg, namely I2C_M_DMA_SAFE which can opt-in
DMA if we know the i2c_msg buffer is DMA safe. I finished a
proof-of-concept this evening and pushed it here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git 
renesas/topic/i2c-core-dma-rfc-v4

I will test it on HW tomorrow and send it out, then. There are still
some bits missing, but for getting opinions, it should be good enough.

Thanks and kind regards,

   Wolfram



signature.asc
Description: PGP signature


Re: [GIT PULL] Renesas ARM Based SoC DT Updates for v4.14

2017-08-16 Thread Arnd Bergmann
On Mon, Jul 31, 2017 at 5:19 PM, Simon Horman
 wrote:
> Renesas ARM Based SoC DT Updates for v4.14
>
> Changes of note:
>
> * Add pin controller support to the RZ/G1M (r8a7743) SoC and
>   RZ/A1 (r7s72100) SoCs now that the driver is available in v4.13-rc1.
>
> * Add GPIO support to the RZ/G1M (r8a7743) SoC now that the driver
>   is availabe in v4.13-rc1.
>
> * Enable MMCIF0 and Ethernet AVB support on the RZ/G1M (r8a7743) SoC and
>   the iWave-RZG1M-20M Qseven SOM. This depends on newly added pin
>   controller support noted above.
>
> * Use R-Car Gen 2 fallback binding for vin nodes
>
>   This makes binding use consistent across R-Car Gen 2 SoCs.
>   It does not have any run-time effect
>
> * Use SMP jump stub SRAM region from DT on R-Car Gen 2 SoCs
>
>   Geert Uytterhoeven says, "The R-Car Gen2 platform code for CPU core
>   bringup needs to copy a jump stub to on-SoC SRAM.  Currently it uses a
>   hardcoded address pointing to ICRAM1."
>
> * Add Inter Connect RAM to R-Car Gen 2 and RZ/G1 SoCs
>
>   Geert Uytterhoeven says, "R-Car Gen2 and RZ/G1 SoCs contain two or three
>   blocks of SRAM, which can be used for several purposes.  One such purpose
>   is holding a jump stub for CPU core bringup."
> * Use generic compatible string for I2C EEPROM for RZ/A1 (r7s72100) SoC
>   and koelsch board.
>
>   This is part of a tree-wide cleanup by Javier Martinez Canillas

Pulled into next/dt, thanks!

   Arnd


Re: [PATCH v2 1/8] v4l: vsp1: Protect fragments against overflow

2017-08-16 Thread Laurent Pinchart
Hi Kieran,

Thank you for the patch.

On Monday 14 Aug 2017 16:13:24 Kieran Bingham wrote:
> The fragment write function relies on the code never asking it to
> write more than the entries available in the list.
> 
> Currently with each list body containing 256 entries, this is fine,
> but we can reduce this number greatly saving memory.
> 
> In preparation of this - add a level of protection to catch any
> buffer overflows.
> 
> Signed-off-by: Kieran Bingham 
> ---
>  drivers/media/platform/vsp1/vsp1_dl.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_dl.c
> b/drivers/media/platform/vsp1/vsp1_dl.c index 8b5cbb6b7a70..cb4625ae13c2
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_dl.c
> +++ b/drivers/media/platform/vsp1/vsp1_dl.c
> @@ -50,6 +50,7 @@ struct vsp1_dl_entry {
>   * @dma: DMA address of the entries
>   * @size: size of the DMA memory in bytes
>   * @num_entries: number of stored entries
> + * @max_entries: number of entries available
>   */
>  struct vsp1_dl_body {
>   struct list_head list;
> @@ -60,6 +61,7 @@ struct vsp1_dl_body {
>   size_t size;
> 
>   unsigned int num_entries;
> + unsigned int max_entries;
>  };
> 
>  /**
> @@ -138,6 +140,7 @@ static int vsp1_dl_body_init(struct vsp1_device *vsp1,
> 
>   dlb->vsp1 = vsp1;
>   dlb->size = size;
> + dlb->max_entries = num_entries;
> 
>   dlb->entries = dma_alloc_wc(vsp1->bus_master, dlb->size, >dma,
>   GFP_KERNEL);
> @@ -220,6 +223,11 @@ void vsp1_dl_fragment_free(struct vsp1_dl_body *dlb)
>   */
>  void vsp1_dl_fragment_write(struct vsp1_dl_body *dlb, u32 reg, u32 data)
>  {
> + if (unlikely(dlb->num_entries >= dlb->max_entries)) {
> + WARN_ONCE(true, "DLB size exceeded (max %u)", dlb-
>max_entries);
> + return;
> + }

How about

if (WARN_ONCE(dlb->num_entries >= dlb->max_entries,
  "DLB size exceeded (max %u)", dlb->max_entries))
return;

(WARN_ONCE contains the unlikely() already)

I'm not fussed either way,

Reviewed-by: Laurent Pinchart 

>   dlb->entries[dlb->num_entries].addr = reg;
>   dlb->entries[dlb->num_entries].data = data;
>   dlb->num_entries++;

-- 
Regards,

Laurent Pinchart



Re: [PATCH v2] ARM: Convert to using %pOF instead of full_name

2017-08-16 Thread Arnd Bergmann
On Thu, Aug 10, 2017 at 12:06 AM, Rob Herring  wrote:
> On Fri, Jul 21, 2017 at 2:28 PM, Rob Herring  wrote:
>> Now that we have a custom printf format specifier, convert users of
>> full_name to use %pOF instead. This is preparation to remove storing
>> of the full path string for each node.
>>
>> Signed-off-by: Rob Herring 
>> Acked-by: Krzysztof Kozlowski 
>> Acked-by: Heiko Stuebner 
>> Reviewed-by: Geert Uytterhoeven 
>> Acked-by: Gregory CLEMENT 
>>
>>  arch/arm/kernel/cpuidle.c| 4 ++--
>>  arch/arm/kernel/devtree.c| 5 ++---
>>  arch/arm/kernel/topology.c   | 3 +--
>>  arch/arm/mach-exynos/suspend.c   | 7 +++
>>  arch/arm/mach-imx/gpc.c  | 4 ++--
>>  arch/arm/mach-mvebu/kirkwood.c   | 3 +--
>>  arch/arm/mach-omap2/omap-wakeupgen.c | 4 ++--
>>  arch/arm/mach-omap2/omap_hwmod.c | 4 ++--
>>  arch/arm/mach-rockchip/platsmp.c | 4 ++--
>>  arch/arm/mach-shmobile/pm-rmobile.c  | 7 +++
>>  10 files changed, 20 insertions(+), 25 deletions(-)
>
> Arnd, Olof,
>
> Can you please apply this one.

Applied to next/cleanup now, with the Acks. I think that should be the last
patch of this series that you wanted me to apply. Can you double-check
and maybe re-submit any patches I may have missed?

Arnd