Date   

[PATCH 4.4.y-cip 07/12] ARM: dts: r8a7744: Add thermal device to DT

Biju Das <biju.das@...>
 

commit ef9d757c06e9b0258b10fcb19c3be2d8cbbc0a30 upstream.

This patch instantiates the thermal sensor module with thermal-zone
support.

Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...>
Signed-off-by: Simon Horman <horms+renesas@...>
[biju: Removed reset and updated clk and power domain properties]
Signed-off-by: Biju Das <biju.das@...>
---
arch/arm/boot/dts/r8a7744.dtsi | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7744.dtsi b/arch/arm/boot/dts/r8a7744.dtsi
index 1e7e410..5fab84f 100644
--- a/arch/arm/boot/dts/r8a7744.dtsi
+++ b/arch/arm/boot/dts/r8a7744.dtsi
@@ -290,6 +290,16 @@
power-domains = <&cpg_clocks>;
};

+ thermal: thermal@e61f0000 {
+ compatible = "renesas,thermal-r8a7744",
+ "renesas,rcar-gen2-thermal";
+ reg = <0 0xe61f0000 0 0x10>, <0 0xe61f0100 0 0x38>;
+ interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp5_clks R8A7744_CLK_THERMAL>;
+ power-domains = <&cpg_clocks>;
+ #thermal-sensor-cells = <0>;
+ };
+
icram0: sram@e63a0000 {
compatible = "mmio-sram";
reg = <0 0xe63a0000 0 0x12000>;
@@ -1506,6 +1516,26 @@
};
};

+ thermal-zones {
+ cpu_thermal: cpu-thermal {
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+
+ thermal-sensors = <&thermal>;
+
+ trips {
+ cpu-crit {
+ temperature = <95000>;
+ hysteresis = <0>;
+ type = "critical";
+ };
+ };
+
+ cooling-maps {
+ };
+ };
+ };
+
timer {
compatible = "arm,armv7-timer";
interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
--
2.7.4


[PATCH 4.4.y-cip 06/12] dt-bindings: thermal: rcar: Add device tree support for r8a7744

Biju Das <biju.das@...>
 

commit 304d9b486b3c6994c193b6693c601b463987e6ac upstream.

Add thermal sensor support for r8a7744 SoC. The Renesas RZ/G1N
(r8a7744) thermal sensor module is identical to the R-Car Gen2 family.

No driver change is needed due to the fallback compatible value
"renesas,rcar-gen2-thermal".

Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Chris Paterson <Chris.Paterson2@...>
Reviewed-by: Daniel Lezcano <daniel.lezcano@...>
Reviewed-by: Simon Horman <horms+renesas@...>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...>
Signed-off-by: Eduardo Valentin <edubezval@...>
---
Documentation/devicetree/bindings/thermal/rcar-thermal.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
index 689e7e8..1e0f837 100644
--- a/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.txt
@@ -7,6 +7,7 @@ Required properties:
Examples with soctypes are:
- "renesas,thermal-r8a73a4" (R-Mobile APE6)
- "renesas,thermal-r8a7743" (RZ/G1M)
+ - "renesas,thermal-r8a7744" (RZ/G1N)
- "renesas,thermal-r8a7779" (R-Car H1)
- "renesas,thermal-r8a7790" (R-Car H2)
- "renesas,thermal-r8a7791" (R-Car M2-W)
--
2.7.4


[PATCH 4.4.y-cip 05/12] thermal: trip_point_temp_store() calls thermal_zone_device_update()

Biju Das <biju.das@...>
 

From: Kuninori Morimoto <kuninori.morimoto.gx@...>

commit ad74e46cb3ba9e706f91f3f71baf816d2d8e45db upstream.

trip_point_temp_store() updates trip temperature. It should call
thermal_zone_device_update() immediately.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...>
Signed-off-by: Eduardo Valentin <edubezval@...>
Signed-off-by: Biju Das <biju.das@...>
---
drivers/thermal/thermal_core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 929092f..0e919c3 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -700,8 +700,12 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
return -EINVAL;

ret = tz->ops->set_trip_temp(tz, trip, temperature);
+ if (ret)
+ return ret;

- return ret ? ret : count;
+ thermal_zone_device_update(tz);
+
+ return count;
}

static ssize_t
--
2.7.4


[PATCH 4.4.y-cip 04/12] ARM: dts: r8a7744: Add IRQC support

Biju Das <biju.das@...>
 

commit 154a05f0c870e6c49753cda689d2209c0915996e upstream.

Describe the IRQC interrupt controller in the r8a7744 device tree.

Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...>
Signed-off-by: Simon Horman <horms+renesas@...>
[biju: Removed reset and updated clk and power domain properties]
Signed-off-by: Biju Das <biju.das@...>
---
arch/arm/boot/dts/r8a7744.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7744.dtsi b/arch/arm/boot/dts/r8a7744.dtsi
index 4538689..1e7e410 100644
--- a/arch/arm/boot/dts/r8a7744.dtsi
+++ b/arch/arm/boot/dts/r8a7744.dtsi
@@ -271,6 +271,25 @@
reg = <0 0xe6160000 0 0x100>;
};

+ irqc: interrupt-controller@e61c0000 {
+ compatible = "renesas,irqc-r8a7744", "renesas,irqc";
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ reg = <0 0xe61c0000 0 0x200>;
+ interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp4_clks R8A7744_CLK_IRQC>;
+ power-domains = <&cpg_clocks>;
+ };
+
icram0: sram@e63a0000 {
compatible = "mmio-sram";
reg = <0 0xe63a0000 0 0x12000>;
--
2.7.4


[PATCH 4.4.y-cip 03/12] dt-bindings: irqchip: renesas-irqc: Document r8a7744 support

Biju Das <biju.das@...>
 

commit 0c4cb97d4ec9d98fc5e30317326f28ed206f3ac6 upstream.

Document RZ/G1N (R8A7744) SoC bindings.

Reviewed-by: Chris Paterson <Chris.Paterson2@...>
Reviewed-by: Simon Horman <horms+renesas@...>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...>
Signed-off-by: Biju Das <biju.das@...>
Signed-off-by: Marc Zyngier <marc.zyngier@...>
---
Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt b/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
index 1ed382e..eea4c7b 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,irqc.txt
@@ -6,6 +6,7 @@ Required properties:
Examples with soctypes are:
- "renesas,irqc-r8a73a4" (R-Mobile APE6)
- "renesas,irqc-r8a7743" (RZ/G1M)
+ - "renesas,irqc-r8a7744" (RZ/G1N)
- "renesas,irqc-r8a7745" (RZ/G1E)
- "renesas,irqc-r8a77470" (RZ/G1C)
- "renesas,irqc-r8a7790" (R-Car H2)
--
2.7.4


[PATCH 4.4.y-cip 02/12] ARM: dts: r8a7744: Add CAN support

Biju Das <biju.das@...>
 

commit 56f1896093043c63c6ecd8a53080aa89d6b41070 upstream.

Add the definitions for can0 and can1 to the r8a7744 SoC dtsi.

Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...>
Signed-off-by: Simon Horman <horms+renesas@...>
[biju: Removed reset and updated clk and power domain properties]
Signed-off-by: Biju Das <biju.das@...>
---
arch/arm/boot/dts/r8a7744.dtsi | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7744.dtsi b/arch/arm/boot/dts/r8a7744.dtsi
index c73269c..4538689 100644
--- a/arch/arm/boot/dts/r8a7744.dtsi
+++ b/arch/arm/boot/dts/r8a7744.dtsi
@@ -819,13 +819,29 @@
};

can0: can@e6e80000 {
+ compatible = "renesas,can-r8a7744",
+ "renesas,rcar-gen2-can";
reg = <0 0xe6e80000 0 0x1000>;
- /* placeholder */
+ interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7744_CLK_RCAN0>,
+ <&cpg_clocks R8A7744_CLK_RCAN>,
+ <&can_clk>;
+ clock-names = "clkp1", "clkp2", "can_clk";
+ power-domains = <&cpg_clocks>;
+ status = "disabled";
};

can1: can@e6e88000 {
+ compatible = "renesas,can-r8a7744",
+ "renesas,rcar-gen2-can";
reg = <0 0xe6e88000 0 0x1000>;
- /* placeholder */
+ interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7744_CLK_RCAN1>,
+ <&cpg_clocks R8A7744_CLK_RCAN>,
+ <&can_clk>;
+ clock-names = "clkp1", "clkp2", "can_clk";
+ power-domains = <&cpg_clocks>;
+ status = "disabled";
};

rcar_sound: sound@ec500000 {
--
2.7.4


[PATCH 4.4.y-cip 01/12] dt-bindings: can: rcar_can: Add r8a7744 support

Biju Das <biju.das@...>
 

commit 700992d361c7912923d1e570681eed65b54a6d9b upstream.

Document RZ/G1N (r8a7744) SoC specific bindings.

Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Chris Paterson <Chris.Paterson2@...>
Reviewed-by: Simon Horman <horms+renesas@...>
Signed-off-by: Rob Herring <robh@...>
---
Documentation/devicetree/bindings/net/can/rcar_can.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/net/can/rcar_can.txt b/Documentation/devicetree/bindings/net/can/rcar_can.txt
index 6f81b1f..fbad4d5 100644
--- a/Documentation/devicetree/bindings/net/can/rcar_can.txt
+++ b/Documentation/devicetree/bindings/net/can/rcar_can.txt
@@ -3,6 +3,7 @@ Renesas R-Car CAN controller Device Tree Bindings

Required properties:
- compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC.
+ "renesas,can-r8a7744" if CAN controller is a part of R8A7744 SoC.
"renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.
"renesas,can-r8a7778" if CAN controller is a part of R8A7778 SoC.
"renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC.
--
2.7.4


[PATCH 4.4.y-cip 00/12] Add CAN/IRQC/THERMAL/VIN/Audio support

Biju Das <biju.das@...>
 

This patch series add CAN/IRQC/THERMAL/VIN/Audio support for iWave iwg20d platform based on RZ/G1N.

This patch series is based on linux-4.4.y-cip and all the patches in this series are cherry-picked from linux rc tree.


Biju Das (11):
dt-bindings: can: rcar_can: Add r8a7744 support
ARM: dts: r8a7744: Add CAN support
dt-bindings: irqchip: renesas-irqc: Document r8a7744 support
ARM: dts: r8a7744: Add IRQC support
dt-bindings: thermal: rcar: Add device tree support for r8a7744
ARM: dts: r8a7744: Add thermal device to DT
media: dt-bindings: media: rcar_vin: add device tree support for
r8a7744
ARM: dts: r8a7744: add VIN dt support
ASoC: rsnd: Add r8a7744 support
ARM: dts: r8a7744: Add audio support
ARM: dts: r8a7744-iwg20d-q7-dbcm-ca: Add device tree for camera DB

Kuninori Morimoto (1):
thermal: trip_point_temp_store() calls thermal_zone_device_update()

.../bindings/interrupt-controller/renesas,irqc.txt | 1 +
.../devicetree/bindings/media/rcar_vin.txt | 1 +
.../devicetree/bindings/net/can/rcar_can.txt | 1 +
.../devicetree/bindings/sound/renesas,rsnd.txt | 1 +
.../devicetree/bindings/thermal/rcar-thermal.txt | 1 +
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/r8a7744-iwg20d-q7-dbcm-ca.dts | 17 ++
arch/arm/boot/dts/r8a7744.dtsi | 334 ++++++++++++++++++++-
drivers/thermal/thermal_core.c | 6 +-
9 files changed, 352 insertions(+), 11 deletions(-)
create mode 100644 arch/arm/boot/dts/r8a7744-iwg20d-q7-dbcm-ca.dts

--
2.7.4


Re: [PATCH linux-4.4.y-cip v3] gpiolib: Fix bad of_node pointer

johnsonch.chen@moxa.com
 

Dear all,

Thanks for this patch. It help us a lot!

Best regards,
Johnson

From: cip-dev <cip-dev-bounces@...> On Behalf Of
nobuhiro1.iwamatsu@...
Sent: Friday, December 6, 2019 6:56 AM
To: Chris.Paterson2@...; fabrizio.castro@...;
cip-dev@...
Cc: biju.das@...
Subject: Re: [cip-dev] [PATCH linux-4.4.y-cip v3] gpiolib: Fix bad
of_node pointer

Hi,

-----Original Message-----
From: Chris Paterson [mailto:Chris.Paterson2@...]
Sent: Friday, December 6, 2019 3:52 AM
To: Fabrizio Castro <fabrizio.castro@...>;
cip-dev@...
Cc: iwamatsu nobuhiro(岩松 信洋 ○SWC□OST)
<nobuhiro1.iwamatsu@...>; pavel@...; Biju Das
<biju.das@...>; Fabrizio Castro
<fabrizio.castro@...>
Subject: RE: [cip-dev][PATCH linux-4.4.y-cip v3] gpiolib: Fix bad
of_node pointer

Hello,

From: Fabrizio Castro <fabrizio.castro@...>
Sent: 05 December 2019 13:40

Not every driver initialises of_node from struct gpio_chip,
therefore the replacement of of_node from struct gpio_chip with
dev->of_node in the below commit won't work on every
platform:
baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges' property")
The final result is that on some platforms the kernel will try to
dereference a NULL pointer, with obvious consequences.

This patch makes sure the pointer gets initialised before its
first usage.

Fixes: baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges'
property")
Reported-by: Johnson CH Chen <JohnsonCH.Chen@...>
Signed-off-by: Fabrizio Castro <fabrizio.castro@...>

---
Hi guys,

sorry for the trouble.
v2 broke Intel builds (thank you Chris for spotting this), v3
fixes
that.

I've tested v3 (current linux-v4.4.y-cip 7b4a8ef7 + a revert for v2)
and all builds pass:
https://gitlab.com/cip-project/cip-kernel/linux-cip/pipelines/100999
517
Thanks for test report.


Are you happy to replace v2 with v3 on linux-4.4.y-cip?
I guess this depends on CIP's rules on force-pushing ??
I applied v3 instead of v2 and force-push.

Best regards,
Nobuhiro
_______________________________________________
cip-dev mailing list
cip-dev@...
https://lists.cip-project.org/mailman/listinfo/cip-dev


Re: [PATCH linux-4.4.y-cip v3] gpiolib: Fix bad of_node pointer

Nobuhiro Iwamatsu
 

Hi,

-----Original Message-----
From: Chris Paterson [mailto:Chris.Paterson2@...]
Sent: Friday, December 6, 2019 3:52 AM
To: Fabrizio Castro <fabrizio.castro@...>;
cip-dev@...
Cc: iwamatsu nobuhiro(岩松 信洋 ○SWC□OST)
<nobuhiro1.iwamatsu@...>; pavel@...; Biju Das
<biju.das@...>; Fabrizio Castro
<fabrizio.castro@...>
Subject: RE: [cip-dev][PATCH linux-4.4.y-cip v3] gpiolib: Fix bad of_node
pointer

Hello,

From: Fabrizio Castro <fabrizio.castro@...>
Sent: 05 December 2019 13:40

Not every driver initialises of_node from struct gpio_chip, therefore
the replacement of of_node from struct gpio_chip with dev->of_node in
the below commit won't work on every
platform:
baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges' property") The
final result is that on some platforms the kernel will try to
dereference a NULL pointer, with obvious consequences.

This patch makes sure the pointer gets initialised before its first
usage.

Fixes: baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges'
property")
Reported-by: Johnson CH Chen <JohnsonCH.Chen@...>
Signed-off-by: Fabrizio Castro <fabrizio.castro@...>

---
Hi guys,

sorry for the trouble.
v2 broke Intel builds (thank you Chris for spotting this), v3 fixes
that.

I've tested v3 (current linux-v4.4.y-cip 7b4a8ef7 + a revert for v2) and
all builds pass:
https://gitlab.com/cip-project/cip-kernel/linux-cip/pipelines/100999
517
Thanks for test report.


Are you happy to replace v2 with v3 on linux-4.4.y-cip?
I guess this depends on CIP's rules on force-pushing ??
I applied v3 instead of v2 and force-push.

Best regards,
Nobuhiro


Re: [PATCH linux-4.4.y-cip v3] gpiolib: Fix bad of_node pointer

Chris Paterson
 

Hello,

From: Fabrizio Castro <fabrizio.castro@...>
Sent: 05 December 2019 13:40

Not every driver initialises of_node from struct gpio_chip,
therefore the replacement of of_node from struct gpio_chip
with dev->of_node in the below commit won't work on every
platform:
baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges' property")
The final result is that on some platforms the kernel will
try to dereference a NULL pointer, with obvious consequences.

This patch makes sure the pointer gets initialised before its
first usage.

Fixes: baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges' property")
Reported-by: Johnson CH Chen <JohnsonCH.Chen@...>
Signed-off-by: Fabrizio Castro <fabrizio.castro@...>

---
Hi guys,

sorry for the trouble.
v2 broke Intel builds (thank you Chris for spotting this), v3 fixes that.
I've tested v3 (current linux-v4.4.y-cip 7b4a8ef7 + a revert for v2) and all builds pass:
https://gitlab.com/cip-project/cip-kernel/linux-cip/pipelines/100999517

Are you happy to replace v2 with v3 on linux-4.4.y-cip?
I guess this depends on CIP's rules on force-pushing ??

Kind regards, Chris


Thanks,
Fab

v2->v3:
* v2 was accessing chip->of_node regardless of CONFIG_OF_GPIO
being enabled or not. v3 compiles that out in case CONFIG_OF_GPIO
is not enabled.
v1->v2:
* v1 was for testing purposes only, but no point in sending
out a dirty patch, therefore cleaned it up
---
drivers/gpio/gpiolib-of.c | 2 +-
drivers/gpio/gpiolib.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index ec642bf..6fa1818 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -338,7 +338,7 @@ static void of_gpiochip_init_valid_mask(struct
gpio_chip *chip)
{
int len, i;
u32 start, count;
- struct device_node *np = chip->dev->of_node;
+ struct device_node *np = chip->of_node;

len = of_property_count_u32_elems(np, "gpio-reserved-ranges");
if (len < 0 || len % 2 != 0)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index d72218f..516498e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -296,7 +296,7 @@ static int gpiochip_init_valid_mask(struct gpio_chip
*gpiochip)
{
#ifdef CONFIG_OF_GPIO
int size;
- struct device_node *np = gpiochip->dev->of_node;
+ struct device_node *np = gpiochip->of_node;

size = of_property_count_u32_elems(np, "gpio-reserved-ranges");
if (size > 0 && size % 2 == 0)
@@ -360,6 +360,11 @@ int gpiochip_add_data(struct gpio_chip *chip, void
*data)

chip->data = data;

+#ifdef CONFIG_OF_GPIO
+ if ((!chip->of_node) && (chip->dev))
+ chip->of_node = chip->dev->of_node;
+#endif
+
spin_lock_irqsave(&gpio_lock, flags);

if (base < 0) {
--
2.7.4


[PATCH linux-4.4.y-cip v3] gpiolib: Fix bad of_node pointer

Fabrizio Castro <fabrizio.castro@...>
 

Not every driver initialises of_node from struct gpio_chip,
therefore the replacement of of_node from struct gpio_chip
with dev->of_node in the below commit won't work on every
platform:
baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges' property")
The final result is that on some platforms the kernel will
try to dereference a NULL pointer, with obvious consequences.

This patch makes sure the pointer gets initialised before its
first usage.

Fixes: baff4777cdb8 ("gpiolib: Support 'gpio-reserved-ranges' property")
Reported-by: Johnson CH Chen <JohnsonCH.Chen@...>
Signed-off-by: Fabrizio Castro <fabrizio.castro@...>

---
Hi guys,

sorry for the trouble.
v2 broke Intel builds (thank you Chris for spotting this), v3 fixes that.
Are you happy to replace v2 with v3 on linux-4.4.y-cip?

Thanks,
Fab

v2->v3:
* v2 was accessing chip->of_node regardless of CONFIG_OF_GPIO
being enabled or not. v3 compiles that out in case CONFIG_OF_GPIO
is not enabled.
v1->v2:
* v1 was for testing purposes only, but no point in sending
out a dirty patch, therefore cleaned it up
---
drivers/gpio/gpiolib-of.c | 2 +-
drivers/gpio/gpiolib.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index ec642bf..6fa1818 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -338,7 +338,7 @@ static void of_gpiochip_init_valid_mask(struct gpio_chip *chip)
{
int len, i;
u32 start, count;
- struct device_node *np = chip->dev->of_node;
+ struct device_node *np = chip->of_node;

len = of_property_count_u32_elems(np, "gpio-reserved-ranges");
if (len < 0 || len % 2 != 0)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index d72218f..516498e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -296,7 +296,7 @@ static int gpiochip_init_valid_mask(struct gpio_chip *gpiochip)
{
#ifdef CONFIG_OF_GPIO
int size;
- struct device_node *np = gpiochip->dev->of_node;
+ struct device_node *np = gpiochip->of_node;

size = of_property_count_u32_elems(np, "gpio-reserved-ranges");
if (size > 0 && size % 2 == 0)
@@ -360,6 +360,11 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data)

chip->data = data;

+#ifdef CONFIG_OF_GPIO
+ if ((!chip->of_node) && (chip->dev))
+ chip->of_node = chip->dev->of_node;
+#endif
+
spin_lock_irqsave(&gpio_lock, flags);

if (base < 0) {
--
2.7.4


Re: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Fabrizio Castro <fabrizio.castro@...>
 

Hi Chris,

Thank you for your feedback!

From: Chris Paterson <Chris.Paterson2@...>
Sent: 05 December 2019 09:44
To: nobuhiro1.iwamatsu@...; pavel@...
Cc: Fabrizio Castro <fabrizio.castro@...>; stefan-koch@...; cip-dev@...; Biju Das
<biju.das@...>
Subject: RE: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Hello all,

From: nobuhiro1.iwamatsu@...
<nobuhiro1.iwamatsu@...>
Sent: 04 December 2019 23:21

From: Pavel Machek [mailto:pavel@...]
Sent: Wednesday, December 4, 2019 9:37 PM

Hi!

That's a known problem, please have a look at:
https://patchwork.kernel.org/patch/11235267/

Pavel, Iwamatsu-san, could you please take patch:
https://patchwork.kernel.org/patch/11235267/

I think this is quite urgent as others will stumble across the
problem and will try and fix it.
OK, I will apply this with following comment if there is no other opinion.

NOTE: gpiochip_add_data()'s fixes is based on
6ff0497402ef7269ee6a72f62eb85adaa7a4768e.

Sounds good to me.
Applied.
This patch seems to have broken builds for 2/16 of our v4.4.y-cip configurations.
Pipeline: https://gitlab.com/cip-project/cip-kernel/linux-cip/pipelines/100757773

1) x86_plathome_obsvx1.config: https://gitlab.com/cip-project/cip-kernel/linux-cip/-/jobs/369871332

Error log:
3274 drivers/gpio/gpiolib.c: In function 'gpiochip_add_data':
3275 drivers/gpio/gpiolib.c:363:12: error: 'struct gpio_chip' has no member named 'of_node'
3276 if ((!chip->of_node) && (chip->dev))
3277 ^~
3278 drivers/gpio/gpiolib.c:364:7: error: 'struct gpio_chip' has no member named 'of_node'
3279 chip->of_node = chip->dev->of_node;
3280 ^~
3281 CC drivers/dma/ioat/prep.o
3282 scripts/Makefile.build:277: recipe for target 'drivers/gpio/gpiolib.o' failed
3283 make[2]: *** [drivers/gpio/gpiolib.o] Error 1
3284 scripts/Makefile.build:484: recipe for target 'drivers/gpio' failed
3285 make[1]: *** [drivers/gpio] Error 2
3286 make[1]: *** Waiting for unfinished jobs....


2) x86_siemens_iot2000.config: https://gitlab.com/cip-project/cip-kernel/linux-cip/-/jobs/369871333

Error log:
2729 drivers/gpio/gpiolib.c: In function 'gpiochip_add_data':
2730 drivers/gpio/gpiolib.c:363:12: error: 'struct gpio_chip' has no member named 'of_node'
2731 if ((!chip->of_node) && (chip->dev))
2732 ^~
2733 drivers/gpio/gpiolib.c:364:7: error: 'struct gpio_chip' has no member named 'of_node'
2734 chip->of_node = chip->dev->of_node;
2735 ^~
2736 scripts/Makefile.build:277: recipe for target 'drivers/gpio/gpiolib.o' failed
2737 make[2]: *** [drivers/gpio/gpiolib.o] Error 1
2738 make[1]: *** [drivers/gpio] Error 2
2739 make[1]: *** Waiting for unfinished jobs....
2740 scripts/Makefile.build:484: recipe for target 'drivers/gpio' failed
This makes a lot of sense, Intel would not have CONFIG_OF_GPIO set!
I'll send another version.

Thanks,
Fab



Kind regards, Chris


Best regards,
Nobuhiro


Re: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Chris Paterson
 

Hello all,

From: nobuhiro1.iwamatsu@...
<nobuhiro1.iwamatsu@...>
Sent: 04 December 2019 23:21

From: Pavel Machek [mailto:pavel@...]
Sent: Wednesday, December 4, 2019 9:37 PM

Hi!

That's a known problem, please have a look at:
https://patchwork.kernel.org/patch/11235267/

Pavel, Iwamatsu-san, could you please take patch:
https://patchwork.kernel.org/patch/11235267/

I think this is quite urgent as others will stumble across the
problem and will try and fix it.
OK, I will apply this with following comment if there is no other opinion.

NOTE: gpiochip_add_data()'s fixes is based on
6ff0497402ef7269ee6a72f62eb85adaa7a4768e.

Sounds good to me.
Applied.
This patch seems to have broken builds for 2/16 of our v4.4.y-cip configurations.
Pipeline: https://gitlab.com/cip-project/cip-kernel/linux-cip/pipelines/100757773

1) x86_plathome_obsvx1.config: https://gitlab.com/cip-project/cip-kernel/linux-cip/-/jobs/369871332

Error log:
3274 drivers/gpio/gpiolib.c: In function 'gpiochip_add_data':
3275 drivers/gpio/gpiolib.c:363:12: error: 'struct gpio_chip' has no member named 'of_node'
3276 if ((!chip->of_node) && (chip->dev))
3277 ^~
3278 drivers/gpio/gpiolib.c:364:7: error: 'struct gpio_chip' has no member named 'of_node'
3279 chip->of_node = chip->dev->of_node;
3280 ^~
3281 CC drivers/dma/ioat/prep.o
3282 scripts/Makefile.build:277: recipe for target 'drivers/gpio/gpiolib.o' failed
3283 make[2]: *** [drivers/gpio/gpiolib.o] Error 1
3284 scripts/Makefile.build:484: recipe for target 'drivers/gpio' failed
3285 make[1]: *** [drivers/gpio] Error 2
3286 make[1]: *** Waiting for unfinished jobs....


2) x86_siemens_iot2000.config: https://gitlab.com/cip-project/cip-kernel/linux-cip/-/jobs/369871333

Error log:
2729 drivers/gpio/gpiolib.c: In function 'gpiochip_add_data':
2730 drivers/gpio/gpiolib.c:363:12: error: 'struct gpio_chip' has no member named 'of_node'
2731 if ((!chip->of_node) && (chip->dev))
2732 ^~
2733 drivers/gpio/gpiolib.c:364:7: error: 'struct gpio_chip' has no member named 'of_node'
2734 chip->of_node = chip->dev->of_node;
2735 ^~
2736 scripts/Makefile.build:277: recipe for target 'drivers/gpio/gpiolib.o' failed
2737 make[2]: *** [drivers/gpio/gpiolib.o] Error 1
2738 make[1]: *** [drivers/gpio] Error 2
2739 make[1]: *** Waiting for unfinished jobs....
2740 scripts/Makefile.build:484: recipe for target 'drivers/gpio' failed


Kind regards, Chris


Best regards,
Nobuhiro


CIP IRC weekly meeting today

masashi.kudo@...
 

Hi all,

Kindly be reminded to attend the weekly meeting through IRC to discuss technical topics with CIP kernel today.
I, Masashi Kudo (IRC ID: masashi910), will chair meetings starting today by taking over SZ-san's role.

*Please note that the IRC meeting was rescheduled to UTC (GMT) 09:00 starting from the first week of Apr. according to TSC meeting*
https://www.timeanddate.com/worldclock/meetingdetails.html?year=2019&month=11&day=28&hour=9&min=0&sec=0&p1=241&p2=137&p3=179&p4=136&p5=37&p6=248

US-West US-East UK DE TW JP
01:00 04:00 09:00 10:00 17:00 18:00

Channel:
* irc:chat.freenode.net:6667/cip

Last week's meeting minutes:
https://irclogs.baserock.org/meetings/cip/2019/11/cip.2019-11-28-09.00.log.html

Agenda:
* Action item
1. Test LTS (pre)releases directly - patersonc
2. Create a way/process to run LTP only for release tests - patersonc
3. Combine rootfilesystem with kselftest binary - Iwamatsu-san
4. Document a process on how to add tests to the CIP test setup - patersonc

* Kernel maintenance updates
* Kernel testing
* CIP Core
* Software update
* AOB

The meeting will take 30 min, although it can be extended to an hour if it makes sense and those involved in the topics can stay. Otherwise, the topic will be taken offline or in the next meeting.

Best regards,
--
M. Kudo
Cybertrust Japan Co., Ltd.


Re: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Nobuhiro Iwamatsu
 

-----Original Message-----
From: Pavel Machek [mailto:pavel@...]
Sent: Wednesday, December 4, 2019 9:37 PM
To: iwamatsu nobuhiro(岩松 信洋 ○SWC□OST)
<nobuhiro1.iwamatsu@...>
Cc: fabrizio.castro@...; stefan-koch@...;
cip-dev@...; pavel@...;
Chris.Paterson2@...; biju.das@...
Subject: Re: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Hi!

That's a known problem, please have a look at:
https://patchwork.kernel.org/patch/11235267/

Pavel, Iwamatsu-san, could you please take patch:
https://patchwork.kernel.org/patch/11235267/

I think this is quite urgent as others will stumble across the
problem and will try and fix it.
OK, I will apply this with following comment if there is no other opinion.

NOTE: gpiochip_add_data()'s fixes is based on
6ff0497402ef7269ee6a72f62eb85adaa7a4768e.

Sounds good to me.
Applied.

Best regards,
Nobuhiro


Re: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Pavel Machek
 

Hi!

That's a known problem, please have a look at:
https://patchwork.kernel.org/patch/11235267/

Pavel, Iwamatsu-san, could you please take patch:
https://patchwork.kernel.org/patch/11235267/

I think this is quite urgent as others will stumble across the problem
and will try and fix it.
OK, I will apply this with following comment if there is no other opinion.

NOTE: gpiochip_add_data()'s fixes is based on 6ff0497402ef7269ee6a72f62eb85adaa7a4768e.
Sounds good to me.

Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


[ANNOUNCE] v4.19.82-cip14-rt5

Pavel Machek
 

Hi!

v4.19.82-cip14-rt5 should be available at kernel.org.

Trees are available at

https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/log/?h=linux-4.19.y-cip-rt

https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/log/?h=linux-4.19.y-cip-rt-rebase

I made a mistake and -rt-rebase still has localversion-rt and
different .yml file in tree. I believe that should not be huge
problem. (I already signed the tag and pushed the tree, so I'm not
exactly sure how to fix it without creating duplicate tags).

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Re: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Fabrizio Castro <fabrizio.castro@...>
 

Hi Iwamatsu-san,

Thank you for your feedback!

From: nobuhiro1.iwamatsu@... <nobuhiro1.iwamatsu@...>
Sent: 04 December 2019 00:20
Subject: RE: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Hi Fabrizio, Stefan,

-----Original Message-----
From: Fabrizio Castro [mailto:fabrizio.castro@...]
Sent: Tuesday, December 3, 2019 12:43 AM
To: Koch, Stefan <stefan-koch@...>;
cip-dev@...
Cc: pavel@...; iwamatsu nobuhiro(岩松 信洋 ○SWC□OST)
<nobuhiro1.iwamatsu@...>; Chris Paterson
<Chris.Paterson2@...>; Biju Das <biju.das@...>
Subject: RE: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Hi Stefan,

That's a known problem, please have a look at:
https://patchwork.kernel.org/patch/11235267/

Pavel, Iwamatsu-san, could you please take patch:
https://patchwork.kernel.org/patch/11235267/

I think this is quite urgent as others will stumble across the problem
and will try and fix it.
OK, I will apply this with following comment if there is no other opinion.

NOTE: gpiochip_add_data()'s fixes is based on 6ff0497402ef7269ee6a72f62eb85adaa7a4768e.
Great, thanks!

Fab


Best regards,
Nobuhiro


Re: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Nobuhiro Iwamatsu
 

Hi Fabrizio, Stefan,

-----Original Message-----
From: Fabrizio Castro [mailto:fabrizio.castro@...]
Sent: Tuesday, December 3, 2019 12:43 AM
To: Koch, Stefan <stefan-koch@...>;
cip-dev@...
Cc: pavel@...; iwamatsu nobuhiro(岩松 信洋 ○SWC□OST)
<nobuhiro1.iwamatsu@...>; Chris Paterson
<Chris.Paterson2@...>; Biju Das <biju.das@...>
Subject: RE: [PATCH 4.4.y-cip] gpiolib: Fix invalid access of nullptr

Hi Stefan,

That's a known problem, please have a look at:
https://patchwork.kernel.org/patch/11235267/

Pavel, Iwamatsu-san, could you please take patch:
https://patchwork.kernel.org/patch/11235267/

I think this is quite urgent as others will stumble across the problem
and will try and fix it.
OK, I will apply this with following comment if there is no other opinion.

NOTE: gpiochip_add_data()'s fixes is based on 6ff0497402ef7269ee6a72f62eb85adaa7a4768e.

Best regards,
Nobuhiro

6501 - 6520 of 10495