From 9cf7c9cb6b4d869cc26fafd3fe54c2cb69fc81ac Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 16 Apr 2018 12:00:02 -0500 Subject: [PATCH 01/25] of/numa: drop export of of_node_to_nid The "generic" implementation of of_node_to_nid is only used by arm64 and only in built-in code, so remove its export. Any device with a struct device should be able to use dev_to_node() instead. Also, exporting of_node_to_nid doesn't actually work if we build a module on an arch that doesn't select OF_NUMA nor provide its own of_node_to_nid implementation. Cc: Frank Rowand Signed-off-by: Rob Herring --- drivers/of/of_numa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index f9d5480a4ae5..27d9b4bba535 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c @@ -177,7 +177,6 @@ int of_node_to_nid(struct device_node *device) return NUMA_NO_NODE; } -EXPORT_SYMBOL(of_node_to_nid); int __init of_numa_init(void) { From 304a39b4bc94525b357083d44d766ff318f208e0 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 17 Apr 2018 08:53:39 -0500 Subject: [PATCH 02/25] dt-bindings: more status property removal from examples Whack-a-mole some more occurrences of status in examples. Acked-by: Vinod Koul Cc: Mark Rutland Cc: Ralf Baechle Cc: James Hogan Cc: Ulf Hansson Cc: David Woodhouse Cc: Brian Norris Cc: Boris Brezillon Cc: Marek Vasut Cc: Richard Weinberger Cc: Matthias Brugger Cc: Tanmay Inamdar Cc: Bjorn Helgaas Cc: Rodolfo Giometti Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/dma/k3dma.txt | 1 - Documentation/devicetree/bindings/dma/ti-edma.txt | 1 - Documentation/devicetree/bindings/mips/lantiq/rcu.txt | 2 -- Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 4 ---- Documentation/devicetree/bindings/mtd/mtk-nand.txt | 4 ---- Documentation/devicetree/bindings/pci/xgene-pci.txt | 7 ------- Documentation/devicetree/bindings/pps/pps-gpio.txt | 1 - 7 files changed, 20 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/k3dma.txt b/Documentation/devicetree/bindings/dma/k3dma.txt index 23f8d712c3ce..4945aeac4dc4 100644 --- a/Documentation/devicetree/bindings/dma/k3dma.txt +++ b/Documentation/devicetree/bindings/dma/k3dma.txt @@ -23,7 +23,6 @@ Controller: dma-requests = <27>; interrupts = <0 12 4>; clocks = <&pclk>; - status = "disable"; }; Client: diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt b/Documentation/devicetree/bindings/dma/ti-edma.txt index 66026dcf53e1..3f15f6644527 100644 --- a/Documentation/devicetree/bindings/dma/ti-edma.txt +++ b/Documentation/devicetree/bindings/dma/ti-edma.txt @@ -190,7 +190,6 @@ mmc0: mmc@23000000 { power-domains = <&k2g_pds 0xb>; clocks = <&k2g_clks 0xb 1>, <&k2g_clks 0xb 2>; clock-names = "fck", "mmchsdb_fck"; - status = "disabled"; }; ------------------------------------------------------------------------------ diff --git a/Documentation/devicetree/bindings/mips/lantiq/rcu.txt b/Documentation/devicetree/bindings/mips/lantiq/rcu.txt index a086f1e1cdd7..7f0822b4beae 100644 --- a/Documentation/devicetree/bindings/mips/lantiq/rcu.txt +++ b/Documentation/devicetree/bindings/mips/lantiq/rcu.txt @@ -61,7 +61,6 @@ Example of the RCU bindings on a xRX200 SoC: usb_phy0: usb2-phy@18 { compatible = "lantiq,xrx200-usb2-phy"; reg = <0x18 4>, <0x38 4>; - status = "disabled"; resets = <&reset1 4 4>, <&reset0 4 4>; reset-names = "phy", "ctrl"; @@ -71,7 +70,6 @@ Example of the RCU bindings on a xRX200 SoC: usb_phy1: usb2-phy@34 { compatible = "lantiq,xrx200-usb2-phy"; reg = <0x34 4>, <0x3C 4>; - status = "disabled"; resets = <&reset1 5 4>, <&reset0 4 4>; reset-names = "phy", "ctrl"; diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt index 2d5287eeed95..634bb66fc49c 100644 --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt @@ -67,7 +67,6 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes max-frequency = <195000000>; power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; resets = <&cpg 314>; - status = "disabled"; }; sdhi1: sd@ee120000 { @@ -81,7 +80,6 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes max-frequency = <195000000>; power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; resets = <&cpg 313>; - status = "disabled"; }; sdhi2: sd@ee140000 { @@ -95,7 +93,6 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes max-frequency = <97500000>; power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; resets = <&cpg 312>; - status = "disabled"; }; sdhi3: sd@ee160000 { @@ -109,5 +106,4 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes max-frequency = <97500000>; power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; resets = <&cpg 311>; - status = "disabled"; }; diff --git a/Documentation/devicetree/bindings/mtd/mtk-nand.txt b/Documentation/devicetree/bindings/mtd/mtk-nand.txt index 1c88526dedfc..c5ba6a4ba1f2 100644 --- a/Documentation/devicetree/bindings/mtd/mtk-nand.txt +++ b/Documentation/devicetree/bindings/mtd/mtk-nand.txt @@ -20,7 +20,6 @@ Required NFI properties: - interrupts: Interrupts of NFI. - clocks: NFI required clocks. - clock-names: NFI clocks internal name. -- status: Disabled default. Then set "okay" by platform. - ecc-engine: Required ECC Engine node. - #address-cells: NAND chip index, should be 1. - #size-cells: Should be 0. @@ -34,7 +33,6 @@ Example: clocks = <&pericfg CLK_PERI_NFI>, <&pericfg CLK_PERI_NFI_PAD>; clock-names = "nfi_clk", "pad_clk"; - status = "disabled"; ecc-engine = <&bch>; #address-cells = <1>; #size-cells = <0>; @@ -152,7 +150,6 @@ Required BCH properties: - interrupts: Interrupts of ECC. - clocks: ECC required clocks. - clock-names: ECC clocks internal name. -- status: Disabled default. Then set "okay" by platform. Example: @@ -162,5 +159,4 @@ Example: interrupts = ; clocks = <&pericfg CLK_PERI_NFI_ECC>; clock-names = "nfiecc_clk"; - status = "disabled"; }; diff --git a/Documentation/devicetree/bindings/pci/xgene-pci.txt b/Documentation/devicetree/bindings/pci/xgene-pci.txt index 6fd2decfa66c..92490330dc1c 100644 --- a/Documentation/devicetree/bindings/pci/xgene-pci.txt +++ b/Documentation/devicetree/bindings/pci/xgene-pci.txt @@ -25,8 +25,6 @@ Optional properties: Example: -SoC-specific DT Entry: - pcie0: pcie@1f2b0000 { status = "disabled"; device_type = "pci"; @@ -50,8 +48,3 @@ SoC-specific DT Entry: clocks = <&pcie0clk 0>; }; - -Board-specific DT Entry: - &pcie0 { - status = "ok"; - }; diff --git a/Documentation/devicetree/bindings/pps/pps-gpio.txt b/Documentation/devicetree/bindings/pps/pps-gpio.txt index 0de23b793657..3683874832ae 100644 --- a/Documentation/devicetree/bindings/pps/pps-gpio.txt +++ b/Documentation/devicetree/bindings/pps/pps-gpio.txt @@ -20,5 +20,4 @@ Example: assert-falling-edge; compatible = "pps-gpio"; - status = "okay"; }; From 4550fe6370ab01f6b1dff97ceffc284d1f38e70c Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Tue, 17 Apr 2018 11:57:34 +0530 Subject: [PATCH 03/25] of: Don't create device for OPP tables The OPP tables are present as separate nodes, whose phandle is used in the "operating-points-v2" property of devices. Currently the OF core creates a device for the OPP table unconditionally, which is not used by any kernel code. This patch creates another OF device_id table for the nodes which must be skipped while creating devices and OPP is the only user of it for now. Reported-by: Stephen Boyd Signed-off-by: Viresh Kumar Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring --- drivers/of/platform.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index c00d81dfac0b..d75050b85d0c 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -32,6 +32,11 @@ const struct of_device_id of_default_bus_match_table[] = { {} /* Empty terminated list */ }; +static const struct of_device_id of_skipped_node_table[] = { + { .compatible = "operating-points-v2", }, + {} /* Empty terminated list */ +}; + static int of_dev_node_match(struct device *dev, void *data) { return dev->of_node == data; @@ -356,6 +361,12 @@ static int of_platform_bus_create(struct device_node *bus, return 0; } + /* Skip nodes for which we don't want to create devices */ + if (unlikely(of_match_node(of_skipped_node_table, bus))) { + pr_debug("%s() - skipping %pOF node\n", __func__, bus); + return 0; + } + if (of_node_check_flag(bus, OF_POPULATED_BUS)) { pr_debug("%s() - skipping %pOF, already populated\n", __func__, bus); From 3711a32f719b3208c044b5b6814f02a899f0049f Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Tue, 17 Apr 2018 10:31:15 +0200 Subject: [PATCH 04/25] doc: Add vendor prefix for Kaohsiung The 'koe' entry has been added to vendor-prefixes.txt to indicate products from Kaohsiung Opto-Electronics Inc. Signed-off-by: Lukasz Majewski Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index b5f978a4cac6..3a237d372cc9 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -184,6 +184,7 @@ keymile Keymile GmbH khadas Khadas kinetic Kinetic Technologies kingnovel Kingnovel Technology Co., Ltd. +koe Kaohsiung Opto-Electronics Inc. kosagi Sutajio Ko-Usagi PTE Ltd. kyo Kyocera Corporation lacie LaCie From 2564fd43f6b24a3fc593c58a714461076943c276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 17 Apr 2018 22:49:58 +0200 Subject: [PATCH 05/25] dt-bindings: thermal: rcar-gen3-thermal: update register size in example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The datasheet has been expanded with more registers and the DT files have been updated with the new size. This change updates the example so writing new DT files can use the enhanced driver which uses the new registers. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman [robh: s/have/has/, s/enchanted/enhanced/] Signed-off-by: Rob Herring --- .../devicetree/bindings/thermal/rcar-gen3-thermal.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt index fdf5caa6229b..39e7d4e61a63 100644 --- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt +++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt @@ -27,9 +27,9 @@ Example: tsc: thermal@e6198000 { compatible = "renesas,r8a7795-thermal"; - reg = <0 0xe6198000 0 0x68>, - <0 0xe61a0000 0 0x5c>, - <0 0xe61a8000 0 0x5c>; + reg = <0 0xe6198000 0 0x100>, + <0 0xe61a0000 0 0x100>, + <0 0xe61a8000 0 0x100>; interrupts = , , ; From 2359ccddc1c3f4752f43cc19b3db189710b15791 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 25 Apr 2018 14:24:59 -0500 Subject: [PATCH 06/25] dt-bindings: move various timer bindings to timer/ directory Bindings are supposed to be organized by device class/function. Move bindings for various timers to timer/ binding directory. Cc: Linus Walleij Acked-by: Thierry Reding Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/arm/ux500/boards.txt | 2 +- Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt | 2 +- .../bindings/{nios2/timer.txt => timer/altr,timer-1.0.txt} | 0 .../bindings/{arm/arch_timer.txt => timer/arm,arch_timer.txt} | 0 .../{arm/armv7m_systick.txt => timer/arm,armv7m-systick.txt} | 0 .../{arm/global_timer.txt => timer/arm,global_timer.txt} | 0 .../devicetree/bindings/{arm/twd.txt => timer/arm,twd.txt} | 0 .../bindings/{powerpc/fsl/gtm.txt => timer/fsl,gtm.txt} | 0 .../bindings/{arm/mrvl/timer.txt => timer/mrvl,mmp-timer.txt} | 0 .../bindings/{arm/msm/timer.txt => timer/qcom,msm-timer.txt} | 0 .../bindings/{arm/spear-timer.txt => timer/st,spear-timer.txt} | 0 .../bindings/{c6x/timer64.txt => timer/ti,c64x+timer64.txt} | 0 .../bindings/{arm/omap/timer.txt => timer/ti,timer.txt} | 0 .../bindings/{arm/vt8500 => timer}/via,vt8500-timer.txt | 0 14 files changed, 2 insertions(+), 2 deletions(-) rename Documentation/devicetree/bindings/{nios2/timer.txt => timer/altr,timer-1.0.txt} (100%) rename Documentation/devicetree/bindings/{arm/arch_timer.txt => timer/arm,arch_timer.txt} (100%) rename Documentation/devicetree/bindings/{arm/armv7m_systick.txt => timer/arm,armv7m-systick.txt} (100%) rename Documentation/devicetree/bindings/{arm/global_timer.txt => timer/arm,global_timer.txt} (100%) rename Documentation/devicetree/bindings/{arm/twd.txt => timer/arm,twd.txt} (100%) rename Documentation/devicetree/bindings/{powerpc/fsl/gtm.txt => timer/fsl,gtm.txt} (100%) rename Documentation/devicetree/bindings/{arm/mrvl/timer.txt => timer/mrvl,mmp-timer.txt} (100%) rename Documentation/devicetree/bindings/{arm/msm/timer.txt => timer/qcom,msm-timer.txt} (100%) rename Documentation/devicetree/bindings/{arm/spear-timer.txt => timer/st,spear-timer.txt} (100%) rename Documentation/devicetree/bindings/{c6x/timer64.txt => timer/ti,c64x+timer64.txt} (100%) rename Documentation/devicetree/bindings/{arm/omap/timer.txt => timer/ti,timer.txt} (100%) rename Documentation/devicetree/bindings/{arm/vt8500 => timer}/via,vt8500-timer.txt (100%) diff --git a/Documentation/devicetree/bindings/arm/ux500/boards.txt b/Documentation/devicetree/bindings/arm/ux500/boards.txt index 7334c24625fc..0fa429534f49 100644 --- a/Documentation/devicetree/bindings/arm/ux500/boards.txt +++ b/Documentation/devicetree/bindings/arm/ux500/boards.txt @@ -26,7 +26,7 @@ interrupt-controller: see binding for interrupt-controller/arm,gic.txt timer: - see binding for arm/twd.txt + see binding for timer/arm,twd.txt clocks: see binding for clocks/ux500.txt diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt index 2e53324fb720..5ccfcc82da08 100644 --- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt +++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt @@ -2,7 +2,7 @@ Required properties: - compatible: Shall contain "ti,omap-dmtimer-pwm". -- ti,timers: phandle to PWM capable OMAP timer. See arm/omap/timer.txt for info +- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer.txt for info about these timers. - #pwm-cells: Should be 3. See pwm.txt in this directory for a description of the cells format. diff --git a/Documentation/devicetree/bindings/nios2/timer.txt b/Documentation/devicetree/bindings/timer/altr,timer-1.0.txt similarity index 100% rename from Documentation/devicetree/bindings/nios2/timer.txt rename to Documentation/devicetree/bindings/timer/altr,timer-1.0.txt diff --git a/Documentation/devicetree/bindings/arm/arch_timer.txt b/Documentation/devicetree/bindings/timer/arm,arch_timer.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/arch_timer.txt rename to Documentation/devicetree/bindings/timer/arm,arch_timer.txt diff --git a/Documentation/devicetree/bindings/arm/armv7m_systick.txt b/Documentation/devicetree/bindings/timer/arm,armv7m-systick.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/armv7m_systick.txt rename to Documentation/devicetree/bindings/timer/arm,armv7m-systick.txt diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/timer/arm,global_timer.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/global_timer.txt rename to Documentation/devicetree/bindings/timer/arm,global_timer.txt diff --git a/Documentation/devicetree/bindings/arm/twd.txt b/Documentation/devicetree/bindings/timer/arm,twd.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/twd.txt rename to Documentation/devicetree/bindings/timer/arm,twd.txt diff --git a/Documentation/devicetree/bindings/powerpc/fsl/gtm.txt b/Documentation/devicetree/bindings/timer/fsl,gtm.txt similarity index 100% rename from Documentation/devicetree/bindings/powerpc/fsl/gtm.txt rename to Documentation/devicetree/bindings/timer/fsl,gtm.txt diff --git a/Documentation/devicetree/bindings/arm/mrvl/timer.txt b/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/mrvl/timer.txt rename to Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt diff --git a/Documentation/devicetree/bindings/arm/msm/timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/msm/timer.txt rename to Documentation/devicetree/bindings/timer/qcom,msm-timer.txt diff --git a/Documentation/devicetree/bindings/arm/spear-timer.txt b/Documentation/devicetree/bindings/timer/st,spear-timer.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/spear-timer.txt rename to Documentation/devicetree/bindings/timer/st,spear-timer.txt diff --git a/Documentation/devicetree/bindings/c6x/timer64.txt b/Documentation/devicetree/bindings/timer/ti,c64x+timer64.txt similarity index 100% rename from Documentation/devicetree/bindings/c6x/timer64.txt rename to Documentation/devicetree/bindings/timer/ti,c64x+timer64.txt diff --git a/Documentation/devicetree/bindings/arm/omap/timer.txt b/Documentation/devicetree/bindings/timer/ti,timer.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/omap/timer.txt rename to Documentation/devicetree/bindings/timer/ti,timer.txt diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt b/Documentation/devicetree/bindings/timer/via,vt8500-timer.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt rename to Documentation/devicetree/bindings/timer/via,vt8500-timer.txt From b48e7dad437323812d963e4d92906eac9e55b449 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 25 Apr 2018 20:35:54 -0500 Subject: [PATCH 07/25] dt-bindings: move various RNG bindings to rng/ directory Bindings are supposed to be organized by device class/function. Move bindings for various RNGs to rng/ binding directory. Signed-off-by: Rob Herring --- .../samsung,exynos-rng4.txt => rng/samsung,exynos4-rng.txt} | 0 .../devicetree/bindings/{ => rng}/sparc_sun_oracle_rng.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Documentation/devicetree/bindings/{crypto/samsung,exynos-rng4.txt => rng/samsung,exynos4-rng.txt} (100%) rename Documentation/devicetree/bindings/{ => rng}/sparc_sun_oracle_rng.txt (100%) diff --git a/Documentation/devicetree/bindings/crypto/samsung,exynos-rng4.txt b/Documentation/devicetree/bindings/rng/samsung,exynos4-rng.txt similarity index 100% rename from Documentation/devicetree/bindings/crypto/samsung,exynos-rng4.txt rename to Documentation/devicetree/bindings/rng/samsung,exynos4-rng.txt diff --git a/Documentation/devicetree/bindings/sparc_sun_oracle_rng.txt b/Documentation/devicetree/bindings/rng/sparc_sun_oracle_rng.txt similarity index 100% rename from Documentation/devicetree/bindings/sparc_sun_oracle_rng.txt rename to Documentation/devicetree/bindings/rng/sparc_sun_oracle_rng.txt From e21f9e2e862e9eb3dd64eaddb6256b3e5098660f Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 25 Apr 2018 21:07:13 -0500 Subject: [PATCH 08/25] dt-bindings: powerpc/4xx: move 4xx NDFC and EMAC bindings to subsystem directories Bindings are supposed to be organized by device class/function. Move a couple of powerpc 4xx bindings to the correct binding directory. Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- .../bindings/{powerpc/4xx/ndfc.txt => mtd/ibm,ndfc.txt} | 0 .../bindings/{powerpc/4xx/emac.txt => net/ibm,emac.txt} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Documentation/devicetree/bindings/{powerpc/4xx/ndfc.txt => mtd/ibm,ndfc.txt} (100%) rename Documentation/devicetree/bindings/{powerpc/4xx/emac.txt => net/ibm,emac.txt} (100%) diff --git a/Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt b/Documentation/devicetree/bindings/mtd/ibm,ndfc.txt similarity index 100% rename from Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt rename to Documentation/devicetree/bindings/mtd/ibm,ndfc.txt diff --git a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt b/Documentation/devicetree/bindings/net/ibm,emac.txt similarity index 100% rename from Documentation/devicetree/bindings/powerpc/4xx/emac.txt rename to Documentation/devicetree/bindings/net/ibm,emac.txt From f6c207aebafb4b591f3787ddd6116502d6aa211c Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Thu, 26 Apr 2018 15:42:43 -0500 Subject: [PATCH 09/25] dt-bindings: exynos: move ADC binding to iio/adc/ directory Bindings are supposed to be organized by device class/function. Move the binding for Exynos ADC to the iio/adc/ binding directory. Signed-off-by: Rob Herring --- .../samsung/exynos-adc.txt => iio/adc/samsung,exynos-adc.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation/devicetree/bindings/{arm/samsung/exynos-adc.txt => iio/adc/samsung,exynos-adc.txt} (100%) diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt rename to Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt From e0359c461d8cfdef3fc9b02efda2352dd1de8198 Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" Date: Fri, 27 Apr 2018 15:59:57 -0700 Subject: [PATCH 10/25] dt-bindings: Add "sifive" vendor prefix This adds a vendor prefix "sifive" for SiFive, Inc. We make chips. Signed-off-by: Wesley W. Terpstra Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 3a237d372cc9..d91915101aaa 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -318,6 +318,7 @@ sgx SGX Sensortech sharp Sharp Corporation shimafuji Shimafuji Electric, Inc. si-en Si-En Technology Ltd. +sifive SiFive, Inc. sigma Sigma Designs, Inc. sii Seiko Instruments, Inc. sil Silicon Image From ed0d3a6af53501fdd4b03d9162ceb9ee4e38ec24 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 27 Apr 2018 11:18:14 +0200 Subject: [PATCH 11/25] dt-bindings: Relocate Tegra20 memory controller bindings Move the device tree bindings for the Tegra20 memory controller to the same location as the Tegra30 (and later) memory controller bindings. Signed-off-by: Thierry Reding Reviewed-by: Dmitry Osipenko Signed-off-by: Rob Herring --- .../{arm/tegra => memory-controllers}/nvidia,tegra20-mc.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation/devicetree/bindings/{arm/tegra => memory-controllers}/nvidia,tegra20-mc.txt (100%) diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-mc.txt b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt similarity index 100% rename from Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-mc.txt rename to Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt From 05685f80086d25bd1ce242a0c8aff6cf4b1d9c3c Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 2 May 2018 10:17:57 +0200 Subject: [PATCH 12/25] dt-bindings: Add vendor prefix for Avnet, Inc. "Avnet, Inc. is one of the world's largest distributors of electronic components and embedded solutions." - Wikipedia.org Website: www.avnet.com Signed-off-by: Michal Simek Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index d91915101aaa..804c4943ee07 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -47,6 +47,7 @@ auvidea Auvidea GmbH avago Avago Technologies avia avia semiconductor avic Shanghai AVIC Optoelectronics Co., Ltd. +avnet Avnet, Inc. axentia Axentia Technologies AB axis Axis Communications AB bananapi BIPAI KEJI LIMITED From a593bff82cae2dac34ba5630d5dc231d59ed559e Mon Sep 17 00:00:00 2001 From: "H. Nikolaus Schaller" Date: Thu, 3 May 2018 11:35:46 +0200 Subject: [PATCH 13/25] dt-bindings: define vendor prefix for Wi2Wi, Inc. Introduce vendor prefix for Wi2Wi, Inc. for W2SG0004 GPS module and W2CBW003 Bluetooth/WiFi combo (CSR/Marvell). Signed-off-by: H. Nikolaus Schaller Acked-by: Rob Herring Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 804c4943ee07..c7a703ab480c 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -395,6 +395,7 @@ vot Vision Optical Technology Co., Ltd. wd Western Digital Corp. wetek WeTek Electronics, limited. wexler Wexler +wi2wi Wi2Wi, Inc. winbond Winbond Electronics corp. winstar Winstar Display Corp. wlf Wolfson Microelectronics From 2ff0e41ac5a7b5c3f1ac1a82f4bbf6083ae09d8d Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Fri, 27 Apr 2018 18:31:20 -0700 Subject: [PATCH 14/25] MAINTAINERS: add keyword for devicetree overlay notifiers Devicetree overlay notifiers have a chance to potentially get pointers into the overlay unflattened devicetree and overlay FDT. The only protection against these pointers being accessed after the underlying data has been released by kfree() is by source code review of patches. Add a keyword line to the devicetree overlay maintainers entry to try to catch overlay notifier related patches. The keyword line is added to the devicetree overlay entry instead of the devicetree entry so that not all maintainers will receive the additional review traffic. Add Frank Rowand (already a maintainer in the devicetree entry) so that he will receive the additional review traffic. Signed-off-by: Frank Rowand Signed-off-by: Rob Herring --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0a1410d5a621..1dce07f4e1fc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10394,12 +10394,14 @@ F: drivers/infiniband/ulp/opa_vnic OPEN FIRMWARE AND DEVICE TREE OVERLAYS M: Pantelis Antoniou +M: Frank Rowand L: devicetree@vger.kernel.org S: Maintained F: Documentation/devicetree/dynamic-resolution-notes.txt F: Documentation/devicetree/overlay-notes.txt F: drivers/of/overlay.c F: drivers/of/resolver.c +K: of_overlay_notifier_ OPEN FIRMWARE AND FLATTENED DEVICE TREE M: Rob Herring From 50aafd60898a8b3edf2f60e014a8288da3b2e5e3 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 8 May 2018 13:07:49 -0500 Subject: [PATCH 15/25] scripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc This adds the following commits from upstream: 84e414b0b5bc tests: Add a test case for the omit-if-no-ref keyword 4038fd90056e dtc: add ability to make nodes conditional on them being referenced e1f139ea4900 checks: drop warning for missing PCI bridge bus-range f4eba68d89ee checks: Print duplicate node name instead of parent name 46df1fb1b211 .travis.yml: Run valgrind checks via Travis 14a3002a1aee tests: Update valgrind suppressions for sw_tree1 02c5fe9debc0 tests: Remove valgrind error from tests/get_path df536831d02c checks: add graph binding checks 2347c96edcbe checks: add a check for duplicate unit-addresses of child nodes 8f1b35f88395 Correct overlay syntactic sugar for generating target-path fragments afbddcd418fb Suppress warnings on overlay fragments 119e27300359 Improve tests for dtc overlay generation Signed-off-by: Rob Herring --- scripts/dtc/checks.c | 199 +++++++++++++++++++++++++++++++++++++- scripts/dtc/dtc-lexer.l | 7 ++ scripts/dtc/dtc-parser.y | 39 +++++--- scripts/dtc/dtc.h | 4 + scripts/dtc/livetree.c | 26 ++++- scripts/dtc/version_gen.h | 2 +- 6 files changed, 261 insertions(+), 16 deletions(-) diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c index 815eaf140ab5..a2cc1036c915 100644 --- a/scripts/dtc/checks.c +++ b/scripts/dtc/checks.c @@ -255,7 +255,7 @@ static void check_duplicate_node_names(struct check *c, struct dt_info *dti, child2; child2 = child2->next_sibling) if (streq(child->name, child2->name)) - FAIL(c, dti, node, "Duplicate node name"); + FAIL(c, dti, child2, "Duplicate node name"); } ERROR(duplicate_node_names, check_duplicate_node_names, NULL); @@ -317,6 +317,11 @@ static void check_unit_address_vs_reg(struct check *c, struct dt_info *dti, const char *unitname = get_unitname(node); struct property *prop = get_property(node, "reg"); + if (get_subnode(node, "__overlay__")) { + /* HACK: Overlay fragments are a special case */ + return; + } + if (!prop) { prop = get_property(node, "ranges"); if (prop && !prop->val.len) @@ -579,6 +584,8 @@ static void fixup_phandle_references(struct check *c, struct dt_info *dti, phandle = get_node_phandle(dt, refnode); *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); + + reference_node(refnode); } } } @@ -609,11 +616,21 @@ static void fixup_path_references(struct check *c, struct dt_info *dti, path = refnode->fullpath; prop->val = data_insert_at_marker(prop->val, m, path, strlen(path) + 1); + + reference_node(refnode); } } } ERROR(path_references, fixup_path_references, NULL, &duplicate_node_names); +static void fixup_omit_unused_nodes(struct check *c, struct dt_info *dti, + struct node *node) +{ + if (node->omit_if_unused && !node->is_referenced) + delete_node(node); +} +ERROR(omit_unused_nodes, fixup_omit_unused_nodes, NULL, &phandle_references, &path_references); + /* * Semantic checks */ @@ -1017,6 +1034,36 @@ static void check_avoid_unnecessary_addr_size(struct check *c, struct dt_info *d } WARNING(avoid_unnecessary_addr_size, check_avoid_unnecessary_addr_size, NULL, &avoid_default_addr_size); +static void check_unique_unit_address(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct node *childa; + + if (node->addr_cells < 0 || node->size_cells < 0) + return; + + if (!node->children) + return; + + for_each_child(node, childa) { + struct node *childb; + const char *addr_a = get_unitname(childa); + + if (!strlen(addr_a)) + continue; + + for_each_child(node, childb) { + const char *addr_b = get_unitname(childb); + if (childa == childb) + break; + + if (streq(addr_a, addr_b)) + FAIL(c, dti, childb, "duplicate unit-address (also used in node %s)", childa->fullpath); + } + } +} +WARNING(unique_unit_address, check_unique_unit_address, NULL, &avoid_default_addr_size); + static void check_obsolete_chosen_interrupt_controller(struct check *c, struct dt_info *dti, struct node *node) @@ -1357,6 +1404,152 @@ static void check_interrupts_property(struct check *c, } WARNING(interrupts_property, check_interrupts_property, &phandle_references); +static const struct bus_type graph_port_bus = { + .name = "graph-port", +}; + +static const struct bus_type graph_ports_bus = { + .name = "graph-ports", +}; + +static void check_graph_nodes(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct node *child; + + for_each_child(node, child) { + if (!(strprefixeq(child->name, child->basenamelen, "endpoint") || + get_property(child, "remote-endpoint"))) + continue; + + node->bus = &graph_port_bus; + + /* The parent of 'port' nodes can be either 'ports' or a device */ + if (!node->parent->bus && + (streq(node->parent->name, "ports") || get_property(node, "reg"))) + node->parent->bus = &graph_ports_bus; + + break; + } + +} +WARNING(graph_nodes, check_graph_nodes, NULL); + +static void check_graph_child_address(struct check *c, struct dt_info *dti, + struct node *node) +{ + int cnt = 0; + struct node *child; + + if (node->bus != &graph_ports_bus && node->bus != &graph_port_bus) + return; + + for_each_child(node, child) { + struct property *prop = get_property(child, "reg"); + + /* No error if we have any non-zero unit address */ + if (prop && propval_cell(prop) != 0) + return; + + cnt++; + } + + if (cnt == 1 && node->addr_cells != -1) + FAIL(c, dti, node, "graph node has single child node '%s', #address-cells/#size-cells are not necessary", + node->children->name); +} +WARNING(graph_child_address, check_graph_child_address, NULL, &graph_nodes); + +static void check_graph_reg(struct check *c, struct dt_info *dti, + struct node *node) +{ + char unit_addr[9]; + const char *unitname = get_unitname(node); + struct property *prop; + + prop = get_property(node, "reg"); + if (!prop || !unitname) + return; + + if (!(prop->val.val && prop->val.len == sizeof(cell_t))) { + FAIL(c, dti, node, "graph node malformed 'reg' property"); + return; + } + + snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop)); + if (!streq(unitname, unit_addr)) + FAIL(c, dti, node, "graph node unit address error, expected \"%s\"", + unit_addr); + + if (node->parent->addr_cells != 1) + FAIL_PROP(c, dti, node, get_property(node, "#address-cells"), + "graph node '#address-cells' is %d, must be 1", + node->parent->addr_cells); + if (node->parent->size_cells != 0) + FAIL_PROP(c, dti, node, get_property(node, "#size-cells"), + "graph node '#size-cells' is %d, must be 0", + node->parent->size_cells); +} + +static void check_graph_port(struct check *c, struct dt_info *dti, + struct node *node) +{ + if (node->bus != &graph_port_bus) + return; + + if (!strprefixeq(node->name, node->basenamelen, "port")) + FAIL(c, dti, node, "graph port node name should be 'port'"); + + check_graph_reg(c, dti, node); +} +WARNING(graph_port, check_graph_port, NULL, &graph_nodes); + +static struct node *get_remote_endpoint(struct check *c, struct dt_info *dti, + struct node *endpoint) +{ + int phandle; + struct node *node; + struct property *prop; + + prop = get_property(endpoint, "remote-endpoint"); + if (!prop) + return NULL; + + phandle = propval_cell(prop); + /* Give up if this is an overlay with external references */ + if (phandle == 0 || phandle == -1) + return NULL; + + node = get_node_by_phandle(dti->dt, phandle); + if (!node) + FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid"); + + return node; +} + +static void check_graph_endpoint(struct check *c, struct dt_info *dti, + struct node *node) +{ + struct node *remote_node; + + if (!node->parent || node->parent->bus != &graph_port_bus) + return; + + if (!strprefixeq(node->name, node->basenamelen, "endpoint")) + FAIL(c, dti, node, "graph endpont node name should be 'endpoint'"); + + check_graph_reg(c, dti, node); + + remote_node = get_remote_endpoint(c, dti, node); + if (!remote_node) + return; + + if (get_remote_endpoint(c, dti, remote_node) != node) + FAIL(c, dti, node, "graph connection to node '%s' is not bidirectional", + remote_node->fullpath); +} +WARNING(graph_endpoint, check_graph_endpoint, NULL, &graph_nodes); + static struct check *check_table[] = { &duplicate_node_names, &duplicate_property_names, &node_name_chars, &node_name_format, &property_name_chars, @@ -1366,6 +1559,7 @@ static struct check *check_table[] = { &explicit_phandles, &phandle_references, &path_references, + &omit_unused_nodes, &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell, &device_type_is_string, &model_is_string, &status_is_string, @@ -1390,6 +1584,7 @@ static struct check *check_table[] = { &avoid_default_addr_size, &avoid_unnecessary_addr_size, + &unique_unit_address, &obsolete_chosen_interrupt_controller, &chosen_node_is_root, &chosen_node_bootargs, &chosen_node_stdout_path, @@ -1416,6 +1611,8 @@ static struct check *check_table[] = { &alias_paths, + &graph_nodes, &graph_child_address, &graph_port, &graph_endpoint, + &always_fail, }; diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l index fd825ebba69c..615b7ec6588f 100644 --- a/scripts/dtc/dtc-lexer.l +++ b/scripts/dtc/dtc-lexer.l @@ -153,6 +153,13 @@ static void PRINTF(1, 2) lexical_error(const char *fmt, ...); return DT_DEL_NODE; } +<*>"/omit-if-no-ref/" { + DPRINT("Keyword: /omit-if-no-ref/\n"); + DPRINT("\n"); + BEGIN(PROPNODENAME); + return DT_OMIT_NO_REF; + } + <*>{LABEL}: { DPRINT("Label: %s\n", yytext); yylval.labelref = xstrdup(yytext); diff --git a/scripts/dtc/dtc-parser.y b/scripts/dtc/dtc-parser.y index 44af170abfea..011a5b25539a 100644 --- a/scripts/dtc/dtc-parser.y +++ b/scripts/dtc/dtc-parser.y @@ -63,6 +63,7 @@ extern bool treesource_error; %token DT_BITS %token DT_DEL_PROP %token DT_DEL_NODE +%token DT_OMIT_NO_REF %token DT_PROPNODENAME %token DT_LITERAL %token DT_CHAR_LITERAL @@ -190,18 +191,18 @@ devicetree: } | devicetree DT_REF nodedef { - struct node *target = get_node_by_ref($1, $2); - - if (target) { - merge_nodes(target, $3); + /* + * We rely on the rule being always: + * versioninfo plugindecl memreserves devicetree + * so $-1 is what we want (plugindecl) + */ + if ($-1 & DTSF_PLUGIN) { + add_orphan_node($1, $3, $2); } else { - /* - * We rely on the rule being always: - * versioninfo plugindecl memreserves devicetree - * so $-1 is what we want (plugindecl) - */ - if ($-1 & DTSF_PLUGIN) - add_orphan_node($1, $3, $2); + struct node *target = get_node_by_ref($1, $2); + + if (target) + merge_nodes(target, $3); else ERROR(&@2, "Label or path %s not found", $2); } @@ -217,6 +218,18 @@ devicetree: ERROR(&@3, "Label or path %s not found", $3); + $$ = $1; + } + | devicetree DT_OMIT_NO_REF DT_REF ';' + { + struct node *target = get_node_by_ref($1, $3); + + if (target) + omit_node_if_unused(target); + else + ERROR(&@3, "Label or path %s not found", $3); + + $$ = $1; } ; @@ -523,6 +536,10 @@ subnode: { $$ = name_node(build_node_delete(), $2); } + | DT_OMIT_NO_REF subnode + { + $$ = omit_node_if_unused($2); + } | DT_LABEL subnode { add_label(&$2->labels, $1); diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h index 3b18a42b866e..6d667701ab6a 100644 --- a/scripts/dtc/dtc.h +++ b/scripts/dtc/dtc.h @@ -168,6 +168,8 @@ struct node { struct label *labels; const struct bus_type *bus; + + bool omit_if_unused, is_referenced; }; #define for_each_label_withdel(l0, l) \ @@ -202,6 +204,8 @@ struct property *reverse_properties(struct property *first); struct node *build_node(struct property *proplist, struct node *children); struct node *build_node_delete(void); struct node *name_node(struct node *node, char *name); +struct node *omit_node_if_unused(struct node *node); +struct node *reference_node(struct node *node); struct node *chain_node(struct node *first, struct node *list); struct node *merge_nodes(struct node *old_node, struct node *new_node); struct node *add_orphan_node(struct node *old_node, struct node *new_node, char *ref); diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c index 57b7db2ed153..6e4c367f54b3 100644 --- a/scripts/dtc/livetree.c +++ b/scripts/dtc/livetree.c @@ -134,6 +134,20 @@ struct node *name_node(struct node *node, char *name) return node; } +struct node *omit_node_if_unused(struct node *node) +{ + node->omit_if_unused = 1; + + return node; +} + +struct node *reference_node(struct node *node) +{ + node->is_referenced = 1; + + return node; +} + struct node *merge_nodes(struct node *old_node, struct node *new_node) { struct property *new_prop, *old_prop; @@ -224,10 +238,16 @@ struct node * add_orphan_node(struct node *dt, struct node *new_node, char *ref) struct data d = empty_data; char *name; - d = data_add_marker(d, REF_PHANDLE, ref); - d = data_append_integer(d, 0xffffffff, 32); + if (ref[0] == '/') { + d = data_append_data(d, ref, strlen(ref) + 1); - p = build_property("target", d); + p = build_property("target-path", d); + } else { + d = data_add_marker(d, REF_PHANDLE, ref); + d = data_append_integer(d, 0xffffffff, 32); + + p = build_property("target", d); + } xasprintf(&name, "fragment@%u", next_orphan_fragment++); diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h index ad87849e333b..b00f14ff7a17 100644 --- a/scripts/dtc/version_gen.h +++ b/scripts/dtc/version_gen.h @@ -1 +1 @@ -#define DTC_VERSION "DTC 1.4.6-gaadd0b65" +#define DTC_VERSION "DTC 1.4.6-g84e414b0" From 74656b682902c803493959dfc79dd0e0e8e31351 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 7 May 2018 16:46:47 -0500 Subject: [PATCH 16/25] kbuild: disable new dtc graph and unit-address warnings dtc gained some new warnings for OF graphs and unique unit addresses, but they are currently much too noisy. So turn off 'graph_child_address', 'graph_port', and 'unique_unit_address' warnings by default. They can be enabled by building dtbs with W=1. Acked-by: Masahiro Yamada Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org Signed-off-by: Rob Herring --- scripts/Makefile.lib | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 07d07409f16f..26fa6d3845b9 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -251,6 +251,9 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ -Wno-unit_address_format \ -Wno-avoid_unnecessary_addr_size \ -Wno-alias_paths \ + -Wno-graph_child_address \ + -Wno-graph_port \ + -Wno-unique_unit_address \ -Wno-pci_device_reg endif From 3098e5b7eebc5dd923562fcbf8acc5990c9e3c64 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 11 May 2018 09:23:33 -0500 Subject: [PATCH 17/25] drm: rcar-du: disable dtc graph-endpoint warnings on DT overlays The rcar DT overlays are missing symetrical remote-endpoint properties in their graph nodes because the remote-endpoint is fixed up at run-time. Disable the dtc 'graph-endpoint' warnings when compiling these overlays. If this becomes a common problem for overlays, then perhaps this check needs to be disabled for all overlays. Reported-by: Stephen Rothwell Cc: Laurent Pinchart Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org Acked-by: Simon Horman Signed-off-by: Rob Herring --- drivers/gpu/drm/rcar-du/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/Makefile b/drivers/gpu/drm/rcar-du/Makefile index 3e58ed93d5b1..2a3b8d7972b5 100644 --- a/drivers/gpu/drm/rcar-du/Makefile +++ b/drivers/gpu/drm/rcar-du/Makefile @@ -17,3 +17,10 @@ rcar-du-drm-$(CONFIG_DRM_RCAR_VSP) += rcar_du_vsp.o obj-$(CONFIG_DRM_RCAR_DU) += rcar-du-drm.o obj-$(CONFIG_DRM_RCAR_DW_HDMI) += rcar_dw_hdmi.o obj-$(CONFIG_DRM_RCAR_LVDS) += rcar_lvds.o + +# 'remote-endpoint' is fixed up at run-time +DTC_FLAGS_rcar_du_of_lvds_r8a7790 += -Wno-graph_endpoint +DTC_FLAGS_rcar_du_of_lvds_r8a7791 += -Wno-graph_endpoint +DTC_FLAGS_rcar_du_of_lvds_r8a7793 += -Wno-graph_endpoint +DTC_FLAGS_rcar_du_of_lvds_r8a7795 += -Wno-graph_endpoint +DTC_FLAGS_rcar_du_of_lvds_r8a7796 += -Wno-graph_endpoint From 3b9cf7905fe3ab35ab437b5072c883e609d3498d Mon Sep 17 00:00:00 2001 From: Stefan M Schaeckeler Date: Mon, 21 May 2018 16:26:14 -0700 Subject: [PATCH 18/25] of: unittest: for strings, account for trailing \0 in property length field For strings, account for trailing \0 in property length field: This is consistent with how dtc builds string properties. Function __of_prop_dup() would misbehave on such properties as it duplicates properties based on the property length field creating new string values without trailing \0s. Signed-off-by: Stefan M Schaeckeler Reviewed-by: Frank Rowand Tested-by: Frank Rowand Cc: Signed-off-by: Rob Herring --- drivers/of/unittest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 6bb37c18292a..ecee50d10d14 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -165,20 +165,20 @@ static void __init of_unittest_dynamic(void) /* Add a new property - should pass*/ prop->name = "new-property"; prop->value = "new-property-data"; - prop->length = strlen(prop->value); + prop->length = strlen(prop->value) + 1; unittest(of_add_property(np, prop) == 0, "Adding a new property failed\n"); /* Try to add an existing property - should fail */ prop++; prop->name = "new-property"; prop->value = "new-property-data-should-fail"; - prop->length = strlen(prop->value); + prop->length = strlen(prop->value) + 1; unittest(of_add_property(np, prop) != 0, "Adding an existing property should have failed\n"); /* Try to modify an existing property - should pass */ prop->value = "modify-property-data-should-pass"; - prop->length = strlen(prop->value); + prop->length = strlen(prop->value) + 1; unittest(of_update_property(np, prop) == 0, "Updating an existing property should have passed\n"); @@ -186,7 +186,7 @@ static void __init of_unittest_dynamic(void) prop++; prop->name = "modify-property"; prop->value = "modify-missing-property-data-should-pass"; - prop->length = strlen(prop->value); + prop->length = strlen(prop->value) + 1; unittest(of_update_property(np, prop) == 0, "Updating a missing property should have passed\n"); From 482137bf2aecd887ebfa8756456764a2f6a0e545 Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Wed, 16 May 2018 21:19:51 -0700 Subject: [PATCH 19/25] of: overlay: validate offset from property fixups The smatch static checker marks the data in offset as untrusted, leading it to warn: drivers/of/resolver.c:125 update_usages_of_a_phandle_reference() error: buffer underflow 'prop->value' 's32min-s32max' Add check to verify that offset is within the property data. Reported-by: Dan Carpenter Signed-off-by: Frank Rowand Cc: Signed-off-by: Rob Herring --- drivers/of/resolver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index 65d0b7adfcd4..7edfac6f1914 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -122,6 +122,11 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay, goto err_fail; } + if (offset < 0 || offset + sizeof(__be32) > prop->length) { + err = -EINVAL; + goto err_fail; + } + *(__be32 *)(prop->value + offset) = cpu_to_be32(phandle); } From 399d9e0695775e17a6f100bd5f89a1ec6466e6a1 Mon Sep 17 00:00:00 2001 From: Vladimir Zapolskiy Date: Tue, 22 May 2018 00:59:46 +0300 Subject: [PATCH 20/25] dt-bindings: Add vendor prefix for Logic PD Logic PD is an electronics design, engineering and manufacturing company, which offers system on module and baseboard products. Website: https://www.logicpd.com/ Signed-off-by: Vladimir Zapolskiy Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index d63a218e732b..b695d62410e7 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -201,6 +201,7 @@ linaro Linaro Limited linksys Belkin International, Inc. (Linksys) linux Linux-specific binding lltc Linear Technology Corporation +logicpd Logic PD, Inc. lsi LSI Corp. (LSI Logic) lwn Liebherr-Werk Nenzing GmbH macnica Macnica Americas From b4fb3aa5b9301a089b98f89a319fd9272fcc93e8 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 29 May 2018 11:43:40 +1000 Subject: [PATCH 21/25] dt-bindings: fsi-master-gpio: Document "no-gpio-delays" property Support for this is being added to the driver but the original patch forgot to add this documentation. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt b/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt index a767259dedad..1e442450747f 100644 --- a/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt +++ b/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt @@ -11,6 +11,10 @@ Optional properties: - trans-gpios = ; : GPIO for voltage translator enable - mux-gpios = ; : GPIO for pin multiplexing with other functions (eg, external FSI masters) + - no-gpio-delays; : Don't add extra delays between GPIO + accesses. This is useful when the HW + GPIO block is running at a low enough + frequency. Examples: From 650bb42094aae5f923f55da36827fec73f5bb1db Mon Sep 17 00:00:00 2001 From: Manivannan Sadhasivam Date: Tue, 29 May 2018 10:22:57 +0530 Subject: [PATCH 22/25] dt-bindings: Add vendor prefix for ArcherMind Add vendor prefix for ArcherMind Technology (Nanjing) Co., Ltd. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index b695d62410e7..58e0db10a92e 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -32,6 +32,7 @@ andestech Andes Technology Corporation apm Applied Micro Circuits Corporation (APM) aptina Aptina Imaging arasan Arasan Chip Systems +archermind ArcherMind Technology (Nanjing) Co., Ltd. arctic Arctic Sand aries Aries Embedded GmbH arm ARM Ltd. From 7824b54dd72ddd1f1d26aa48604b7ea17cfaebc3 Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Fri, 11 May 2018 12:18:56 +0900 Subject: [PATCH 23/25] dt-bindings: net: ravb: Add support for r8a77990 SoC Add documentation for r8a77990 compatible string to renesas ravb device tree bindings documentation. Signed-off-by: Yoshihiro Shimoda Acked-by: Sergei Shtylyov Reviewed-by: Simon Horman Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/net/renesas,ravb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/renesas,ravb.txt b/Documentation/devicetree/bindings/net/renesas,ravb.txt index 890526dbfc26..fac897d54423 100644 --- a/Documentation/devicetree/bindings/net/renesas,ravb.txt +++ b/Documentation/devicetree/bindings/net/renesas,ravb.txt @@ -21,6 +21,7 @@ Required properties: - "renesas,etheravb-r8a77965" for the R8A77965 SoC. - "renesas,etheravb-r8a77970" for the R8A77970 SoC. - "renesas,etheravb-r8a77980" for the R8A77980 SoC. + - "renesas,etheravb-r8a77990" for the R8A77990 SoC. - "renesas,etheravb-r8a77995" for the R8A77995 SoC. - "renesas,etheravb-rcar-gen3" as a fallback for the above R-Car Gen3 devices. From 522811e944ed9b36806faa019faec10f9d259cca Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Mon, 4 Jun 2018 15:14:08 +0100 Subject: [PATCH 24/25] of: platform: stop accessing invalid dev in of_platform_device_destroy Immediately after the platform_device_unregister() the device will be cleaned up. Accessing the freed pointer immediately after that will crash the system. Found this bug when kernel is built with CONFIG_PAGE_POISONING and testing loading/unloading audio drivers in a loop on Qcom platforms. Fix this by moving of_node_clear_flag() just before the unregister calls. Below is the crash trace: Unable to handle kernel paging request at virtual address 6b6b6b6b6b6c03 Mem abort info: ESR = 0x96000021 Exception class = DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000021 CM = 0, WnR = 0 [006b6b6b6b6b6c03] address between user and kernel address ranges Internal error: Oops: 96000021 [#1] PREEMPT SMP Modules linked in: CPU: 2 PID: 1784 Comm: sh Tainted: G W 4.17.0-rc7-02230-ge3a63a7ef641-dirty #204 Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT) pstate: 80000005 (Nzcv daif -PAN -UAO) pc : clear_bit+0x18/0x2c lr : of_platform_device_destroy+0x64/0xb8 sp : ffff00000c9c3930 x29: ffff00000c9c3930 x28: ffff80003d39b200 x27: ffff000008bb1000 x26: 0000000000000040 x25: 0000000000000124 x24: ffff80003a9a3080 x23: 0000000000000060 x22: ffff00000939f518 x21: ffff80003aa79e98 x20: ffff80003aa3dae0 x19: ffff80003aa3c890 x18: ffff800009feb794 x17: 0000000000000000 x16: 0000000000000000 x15: ffff800009feb790 x14: 0000000000000000 x13: ffff80003a058778 x12: ffff80003a058728 x11: ffff80003a058750 x10: 0000000000000000 x9 : 0000000000000006 x8 : ffff80003a825988 x7 : bbbbbbbbbbbbbbbb x6 : 0000000000000001 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000008 x2 : 0000000000000001 x1 : 6b6b6b6b6b6b6c03 x0 : 0000000000000000 Process sh (pid: 1784, stack limit = 0x (ptrval)) Call trace: clear_bit+0x18/0x2c q6afe_remove+0x20/0x38 apr_device_remove+0x30/0x70 device_release_driver_internal+0x170/0x208 device_release_driver+0x14/0x20 bus_remove_device+0xcc/0x150 device_del+0x10c/0x310 device_unregister+0x1c/0x70 apr_remove_device+0xc/0x18 device_for_each_child+0x50/0x80 apr_remove+0x18/0x20 rpmsg_dev_remove+0x38/0x68 device_release_driver_internal+0x170/0x208 device_release_driver+0x14/0x20 bus_remove_device+0xcc/0x150 device_del+0x10c/0x310 device_unregister+0x1c/0x70 qcom_smd_remove_device+0xc/0x18 device_for_each_child+0x50/0x80 qcom_smd_unregister_edge+0x3c/0x70 smd_subdev_remove+0x18/0x28 rproc_stop+0x48/0xd8 rproc_shutdown+0x60/0xe8 state_store+0xbc/0xf8 dev_attr_store+0x18/0x28 sysfs_kf_write+0x3c/0x50 kernfs_fop_write+0x118/0x1e0 __vfs_write+0x18/0x110 vfs_write+0xa4/0x1a8 ksys_write+0x48/0xb0 sys_write+0xc/0x18 el0_svc_naked+0x30/0x34 Code: d2800022 8b400c21 f9800031 9ac32043 (c85f7c22) ---[ end trace 32020935775616a2 ]--- Signed-off-by: Srinivas Kandagatla Cc: stable@vger.kernel.org Signed-off-by: Rob Herring --- drivers/of/platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index d75050b85d0c..0b49a62b38a3 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -548,6 +548,9 @@ int of_platform_device_destroy(struct device *dev, void *data) if (of_node_check_flag(dev->of_node, OF_POPULATED_BUS)) device_for_each_child(dev, NULL, of_platform_device_destroy); + of_node_clear_flag(dev->of_node, OF_POPULATED); + of_node_clear_flag(dev->of_node, OF_POPULATED_BUS); + if (dev->bus == &platform_bus_type) platform_device_unregister(to_platform_device(dev)); #ifdef CONFIG_ARM_AMBA @@ -555,8 +558,6 @@ int of_platform_device_destroy(struct device *dev, void *data) amba_device_unregister(to_amba_device(dev)); #endif - of_node_clear_flag(dev->of_node, OF_POPULATED); - of_node_clear_flag(dev->of_node, OF_POPULATED_BUS); return 0; } EXPORT_SYMBOL_GPL(of_platform_device_destroy); From 44acf10587907ff77c28fd97906220b2d8eb4f05 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 5 Jun 2018 16:37:47 -0600 Subject: [PATCH 25/25] dt-bindings: submitting-patches: add guidance on patch content and subject Clarify that binding patches should also include include/dt-bindings/* as part of them. The binding doc defines the ABI and the includes are part of that. Add some details on the preferred subject prefix and contents. Signed-off-by: Rob Herring --- Documentation/devicetree/bindings/submitting-patches.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/submitting-patches.txt b/Documentation/devicetree/bindings/submitting-patches.txt index 274058c583dd..de0d6090c0fd 100644 --- a/Documentation/devicetree/bindings/submitting-patches.txt +++ b/Documentation/devicetree/bindings/submitting-patches.txt @@ -6,7 +6,14 @@ I. For patch submitters 0) Normal patch submission rules from Documentation/process/submitting-patches.rst applies. - 1) The Documentation/ portion of the patch should be a separate patch. + 1) The Documentation/ and include/dt-bindings/ portion of the patch should + be a separate patch. The preferred subject prefix for binding patches is: + + "dt-bindings: : ..." + + The 80 characters of the subject are precious. It is recommended to not + use "Documentation" or "doc" because that is implied. All bindings are + docs. Repeating "binding" again should also be avoided. 2) Submit the entire series to the devicetree mailinglist at