Skip to content

Commit 974099e

Browse files
committed
Merge tag 'devicetree-fixes-for-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree fixes from Rob Herring: - Disable kunit tests for arm64+ACPI - Fix refcount issue in kunit tests - Drop constraints on non-conformant 'interrupt-map' in fsl,ls-extirq - Drop type ref on 'msi-parent in fsl,qoriq-mc binding - Move elgin,jg10309-01 to its own binding from trivial-devices * tag 'devicetree-fixes-for-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: Skip kunit tests when arm64+ACPI doesn't populate root node of: Fix unbalanced of node refcount and memory leaks dt-bindings: interrupt-controller: fsl,ls-extirq: workaround wrong interrupt-map number dt-bindings: misc: fsl,qoriq-mc: remove ref for msi-parent dt-bindings: display: elgin,jg10309-01: Add own binding
2 parents 9066258 + 6e0391e commit 974099e

File tree

8 files changed

+103
-7
lines changed

8 files changed

+103
-7
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/elgin,jg10309-01.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Elgin JG10309-01 SPI-controlled display
8+
9+
maintainers:
10+
- Fabio Estevam <festevam@gmail.com>
11+
12+
description: |
13+
The Elgin JG10309-01 SPI-controlled display is used on the RV1108-Elgin-r1
14+
board and is a custom display.
15+
16+
allOf:
17+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
18+
19+
properties:
20+
compatible:
21+
const: elgin,jg10309-01
22+
23+
reg:
24+
maxItems: 1
25+
26+
spi-max-frequency:
27+
maximum: 24000000
28+
29+
spi-cpha: true
30+
31+
spi-cpol: true
32+
33+
required:
34+
- compatible
35+
- reg
36+
- spi-cpha
37+
- spi-cpol
38+
39+
additionalProperties: false
40+
41+
examples:
42+
- |
43+
spi {
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
47+
display@0 {
48+
compatible = "elgin,jg10309-01";
49+
reg = <0>;
50+
spi-max-frequency = <24000000>;
51+
spi-cpha;
52+
spi-cpol;
53+
};
54+
};

Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ allOf:
8282
enum:
8383
- fsl,ls1043a-extirq
8484
- fsl,ls1046a-extirq
85-
- fsl,ls1088a-extirq
86-
- fsl,ls2080a-extirq
87-
- fsl,lx2160a-extirq
8885
then:
8986
properties:
9087
interrupt-map:
@@ -95,6 +92,29 @@ allOf:
9592
- const: 0xf
9693
- const: 0
9794

95+
- if:
96+
properties:
97+
compatible:
98+
contains:
99+
enum:
100+
- fsl,ls1088a-extirq
101+
- fsl,ls2080a-extirq
102+
- fsl,lx2160a-extirq
103+
# The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
104+
# function to parser interrupt-map. So it doesn't consider '#address-size'
105+
# in parent interrupt controller, such as GIC.
106+
#
107+
# When dt-binding verify interrupt-map, item data matrix is spitted at
108+
# incorrect position. Remove interrupt-map restriction because it always
109+
# wrong.
110+
111+
then:
112+
properties:
113+
interrupt-map-mask:
114+
items:
115+
- const: 0xf
116+
- const: 0
117+
98118
additionalProperties: false
99119

100120
examples:

Documentation/devicetree/bindings/misc/fsl,qoriq-mc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ properties:
113113
114114
msi-parent:
115115
deprecated: true
116-
$ref: /schemas/types.yaml#/definitions/phandle
116+
maxItems: 1
117117
description:
118118
Describes the MSI controller node handling message
119119
interrupts for the MC. When there is no translation

Documentation/devicetree/bindings/trivial-devices.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ properties:
101101
- domintech,dmard09
102102
# DMARD10: 3-axis Accelerometer
103103
- domintech,dmard10
104-
# Elgin SPI-controlled LCD
105-
- elgin,jg10309-01
106104
# MMA7660FC: 3-Axis Orientation/Motion Detection Sensor
107105
- fsl,mma7660
108106
# MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer

drivers/of/of_kunit_helpers.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
#include <kunit/test.h>
1111
#include <kunit/resource.h>
1212

13+
#include "of_private.h"
14+
15+
/**
16+
* of_root_kunit_skip() - Skip test if the root node isn't populated
17+
* @test: test to skip if the root node isn't populated
18+
*/
19+
void of_root_kunit_skip(struct kunit *test)
20+
{
21+
if (IS_ENABLED(CONFIG_ARM64) && IS_ENABLED(CONFIG_ACPI) && !of_root)
22+
kunit_skip(test, "arm64+acpi doesn't populate a root node");
23+
}
24+
EXPORT_SYMBOL_GPL(of_root_kunit_skip);
25+
1326
#if defined(CONFIG_OF_OVERLAY) && defined(CONFIG_OF_EARLY_FLATTREE)
1427

1528
static void of_overlay_fdt_apply_kunit_exit(void *ovcs_id)
@@ -36,6 +49,8 @@ int of_overlay_fdt_apply_kunit(struct kunit *test, void *overlay_fdt,
3649
int ret;
3750
int *copy_id;
3851

52+
of_root_kunit_skip(test);
53+
3954
copy_id = kunit_kmalloc(test, sizeof(*copy_id), GFP_KERNEL);
4055
if (!copy_id)
4156
return -ENOMEM;

drivers/of/of_private.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ extern raw_spinlock_t devtree_lock;
4242
extern struct list_head aliases_lookup;
4343
extern struct kset *of_kset;
4444

45+
struct kunit;
46+
extern void of_root_kunit_skip(struct kunit *test);
47+
4548
#if defined(CONFIG_OF_DYNAMIC)
4649
extern int of_property_notify(int action, struct device_node *np,
4750
struct property *prop, struct property *old_prop);

drivers/of/of_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include <kunit/test.h>
99

10+
#include "of_private.h"
11+
1012
/*
1113
* Test that the root node "/" can be found by path.
1214
*/
@@ -36,6 +38,7 @@ static struct kunit_case of_dtb_test_cases[] = {
3638

3739
static int of_dtb_test_init(struct kunit *test)
3840
{
41+
of_root_kunit_skip(test);
3942
if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
4043
kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE");
4144

drivers/of/overlay_test.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <kunit/of.h>
1212
#include <kunit/test.h>
1313

14+
#include "of_private.h"
15+
1416
static const char * const kunit_node_name = "kunit-test";
1517
static const char * const kunit_compatible = "test,empty";
1618

@@ -62,6 +64,7 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
6264
struct device *dev;
6365
struct device_node *np;
6466

67+
of_root_kunit_skip(test);
6568
if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
6669
kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE for root node");
6770

@@ -73,7 +76,7 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
7376

7477
np = of_find_node_by_name(NULL, kunit_node_name);
7578
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, np);
76-
of_node_put_kunit(test, np);
79+
of_node_put_kunit(&fake, np);
7780

7881
pdev = of_find_device_by_node(np);
7982
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, pdev);

0 commit comments

Comments
 (0)