kernel: update v6.3 of patches
authorRafał Miłecki <rafal@milecki.pl>
Fri, 17 Mar 2023 15:36:08 +0000 (16:36 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Fri, 17 Mar 2023 15:47:09 +0000 (16:47 +0100)
1. Use final (accepted) patches
2. Add two more required for v6.4 nvmem stuff

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
12 files changed:
target/linux/generic/backport-5.10/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch
target/linux/generic/backport-5.10/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch
target/linux/generic/backport-5.10/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch
target/linux/generic/backport-5.10/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch [new file with mode: 0644]
target/linux/generic/backport-5.10/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch [new file with mode: 0644]
target/linux/generic/backport-5.10/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch [deleted file]
target/linux/generic/backport-5.15/827-v6.3-0001-of-base-add-of_parse_phandle_with_optional_args.patch
target/linux/generic/backport-5.15/827-v6.3-0002-of-property-make-.-cells-optional-for-simple-props.patch
target/linux/generic/backport-5.15/827-v6.3-0003-of-property-add-nvmem-cell-cells-property.patch
target/linux/generic/backport-5.15/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch [new file with mode: 0644]
target/linux/generic/backport-5.15/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch [new file with mode: 0644]
target/linux/generic/backport-5.15/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch [deleted file]

index a3df3ce75c630b22344a888de164e6ccd7525a5c..3606034b9b2cac72a58547cb2f0cb7b607a1016e 100644 (file)
@@ -1,6 +1,6 @@
-From 8eddceb280f5deb8046fcb660de9f9f683b408b9 Mon Sep 17 00:00:00 2001
+From c5d264d4b527c96ae8903376a4b195df47b05203 Mon Sep 17 00:00:00 2001
 From: Michael Walle <michael@walle.cc>
-Date: Tue, 6 Dec 2022 21:07:21 +0100
+Date: Mon, 6 Feb 2023 13:43:43 +0000
 Subject: [PATCH] of: base: add of_parse_phandle_with_optional_args()
 
 Add a new variant of the of_parse_phandle_with_args() which treats the
@@ -16,6 +16,8 @@ this property.
 Signed-off-by: Michael Walle <michael@walle.cc>
 Reviewed-by: Rob Herring <robh@kernel.org>
 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-10-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  include/linux/of.h | 25 +++++++++++++++++++++++++
  1 file changed, 25 insertions(+)
index 95b0e60d564c54f3c228d89d64b3a1550bcc7467..0c45679e9dd317a20056a38800f1fbfdc601c72c 100644 (file)
@@ -1,6 +1,6 @@
-From 4f4145c9fee8c7a445dbbbadceccce5391e6b287 Mon Sep 17 00:00:00 2001
+From ff24fed10ba414d19579e26e60b126fad2f2bb07 Mon Sep 17 00:00:00 2001
 From: Michael Walle <michael@walle.cc>
-Date: Tue, 6 Dec 2022 21:07:22 +0100
+Date: Mon, 6 Feb 2023 13:43:44 +0000
 Subject: [PATCH] of: property: make #.*-cells optional for simple props
 
 Sometimes, future bindings for phandles will get additional arguments.
@@ -13,19 +13,21 @@ Signed-off-by: Michael Walle <michael@walle.cc>
 Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
 Reviewed-by: Rob Herring <robh@kernel.org>
 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-11-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  drivers/of/property.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 --- a/drivers/of/property.c
 +++ b/drivers/of/property.c
-@@ -1267,8 +1267,8 @@ static struct device_node *parse_suffix_
-       if (strcmp_suffix(prop_name, suffix))
+@@ -1213,8 +1213,8 @@ static struct device_node *parse_prop_ce
+       if (strcmp(prop_name, list_name))
                return NULL;
  
--      if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
+-      if (of_parse_phandle_with_args(np, list_name, cells_name, index,
 -                                     &sup_args))
-+      if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
++      if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
 +                                       &sup_args))
                return NULL;
  
index 5d1df95ff1ea80c2afc524f489100bdd69dcbe7c..75ade3923246bc768cc290ab3deb54e510cffc40 100644 (file)
@@ -1,6 +1,6 @@
-From 9cf9486a6a7e8a3d76154d0c506051ba3740e8b6 Mon Sep 17 00:00:00 2001
+From e2d8172043d2e50df19fcd59c11e5593de8188d7 Mon Sep 17 00:00:00 2001
 From: Michael Walle <michael@walle.cc>
-Date: Tue, 6 Dec 2022 21:07:23 +0100
+Date: Mon, 6 Feb 2023 13:43:45 +0000
 Subject: [PATCH] of: property: add #nvmem-cell-cells property
 
 Bindings describe the new '#nvmem-cell-cells' property. Now that the
@@ -11,6 +11,8 @@ Signed-off-by: Michael Walle <michael@walle.cc>
 Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
 Reviewed-by: Rob Herring <robh@kernel.org>
 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-12-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  drivers/of/property.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/linux/generic/backport-5.10/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch b/target/linux/generic/backport-5.10/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch
new file mode 100644 (file)
index 0000000..eed9dcc
--- /dev/null
@@ -0,0 +1,37 @@
+From 553bd29700145e1849698985e9800f14e967da49 Mon Sep 17 00:00:00 2001
+From: Alexander Stein <alexander.stein@ew.tq-group.com>
+Date: Tue, 7 Feb 2023 12:05:29 +0100
+Subject: [PATCH] of: device: Ignore modalias of reused nodes
+
+If of_node is reused, do not use that node's modalias. This will hide
+the name of the actual device. This is rather prominent in USB glue
+drivers creating a platform device for the host controller.
+
+Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
+Reviewed-by: Rob Herring <robh@kernel.org>
+Link: https://lore.kernel.org/r/20230207110531.1060252-2-alexander.stein@ew.tq-group.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/of/device.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/of/device.c
++++ b/drivers/of/device.c
+@@ -223,7 +223,7 @@ static ssize_t of_device_get_modalias(st
+       ssize_t csize;
+       ssize_t tsize;
+-      if ((!dev) || (!dev->of_node))
++      if ((!dev) || (!dev->of_node) || dev->of_node_reused)
+               return -ENODEV;
+       /* Name & Type */
+@@ -338,7 +338,7 @@ int of_device_uevent_modalias(struct dev
+ {
+       int sl;
+-      if ((!dev) || (!dev->of_node))
++      if ((!dev) || (!dev->of_node) || dev->of_node_reused)
+               return -ENODEV;
+       /* Devicetree modalias is tricky, we add it in 2 steps */
diff --git a/target/linux/generic/backport-5.10/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch b/target/linux/generic/backport-5.10/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch
new file mode 100644 (file)
index 0000000..64a2a20
--- /dev/null
@@ -0,0 +1,29 @@
+From 2295bed9bebe8d1eef276194fed5b5fbe89c5363 Mon Sep 17 00:00:00 2001
+From: Alexander Stein <alexander.stein@ew.tq-group.com>
+Date: Tue, 7 Feb 2023 12:05:30 +0100
+Subject: [PATCH] of: device: Do not ignore error code in
+ of_device_uevent_modalias
+
+of_device_get_modalias might return an error code, propagate that one.
+Otherwise the negative, signed integer is propagated to unsigned integer
+for the comparison resulting in a huge 'sl' size.
+
+Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
+Reviewed-by: Rob Herring <robh@kernel.org>
+Link: https://lore.kernel.org/r/20230207110531.1060252-3-alexander.stein@ew.tq-group.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/of/device.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/of/device.c
++++ b/drivers/of/device.c
+@@ -347,6 +347,8 @@ int of_device_uevent_modalias(struct dev
+       sl = of_device_get_modalias(dev, &env->buf[env->buflen-1],
+                                   sizeof(env->buf) - env->buflen);
++      if (sl < 0)
++              return sl;
+       if (sl >= (sizeof(env->buf) - env->buflen))
+               return -ENOMEM;
+       env->buflen += sl;
diff --git a/target/linux/generic/backport-5.10/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch b/target/linux/generic/backport-5.10/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch
deleted file mode 100644 (file)
index 848ec37..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-From ef26c0349eb5a615dab2272d08d1d5de4ac9cd4c Mon Sep 17 00:00:00 2001
-From: Michael Walle <michael@walle.cc>
-Date: Wed, 11 Jan 2023 00:30:56 +0100
-Subject: [PATCH] of: property: fix #nvmem-cell-cells parsing
-
-Commit 67b8497f005f ("of: property: make #.*-cells optional for simple
-props") claims to make the cells-name property optional for simple
-properties, but changed the code for the wrong property, i.e. for
-DEFINE_SUFFIX_PROP(). Fix that.
-
-Fixes: 67b8497f005f ("of: property: make #.*-cells optional for simple props")
-Reported-by: Peng Fan <peng.fan@nxp.com>
-Signed-off-by: Michael Walle <michael@walle.cc>
-Acked-by: Rob Herring <robh@kernel.org>
-Tested-by: Robert Marko <robimarko@gmail.com>
-Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
----
- drivers/of/property.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/of/property.c
-+++ b/drivers/of/property.c
-@@ -1213,8 +1213,8 @@ static struct device_node *parse_prop_ce
-       if (strcmp(prop_name, list_name))
-               return NULL;
--      if (of_parse_phandle_with_args(np, list_name, cells_name, index,
--                                     &sup_args))
-+      if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
-+                                       &sup_args))
-               return NULL;
-       return sup_args.np;
-@@ -1267,8 +1267,8 @@ static struct device_node *parse_suffix_
-       if (strcmp_suffix(prop_name, suffix))
-               return NULL;
--      if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
--                                       &sup_args))
-+      if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
-+                                     &sup_args))
-               return NULL;
-       return sup_args.np;
index b829f21cfacf2b2aa07b06eb2fa6eee98902a24e..2b2a60e096bef2a72a9b506a253b03d76d9bbf13 100644 (file)
@@ -1,6 +1,6 @@
-From 8eddceb280f5deb8046fcb660de9f9f683b408b9 Mon Sep 17 00:00:00 2001
+From c5d264d4b527c96ae8903376a4b195df47b05203 Mon Sep 17 00:00:00 2001
 From: Michael Walle <michael@walle.cc>
-Date: Tue, 6 Dec 2022 21:07:21 +0100
+Date: Mon, 6 Feb 2023 13:43:43 +0000
 Subject: [PATCH] of: base: add of_parse_phandle_with_optional_args()
 
 Add a new variant of the of_parse_phandle_with_args() which treats the
@@ -16,6 +16,8 @@ this property.
 Signed-off-by: Michael Walle <michael@walle.cc>
 Reviewed-by: Rob Herring <robh@kernel.org>
 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-10-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  include/linux/of.h | 25 +++++++++++++++++++++++++
  1 file changed, 25 insertions(+)
index 4cf11ca34bb4974bff39164d05c7926fc5d5cec3..39d9fae7239af52c292880ac9db6a44a009d8013 100644 (file)
@@ -1,6 +1,6 @@
-From 4f4145c9fee8c7a445dbbbadceccce5391e6b287 Mon Sep 17 00:00:00 2001
+From ff24fed10ba414d19579e26e60b126fad2f2bb07 Mon Sep 17 00:00:00 2001
 From: Michael Walle <michael@walle.cc>
-Date: Tue, 6 Dec 2022 21:07:22 +0100
+Date: Mon, 6 Feb 2023 13:43:44 +0000
 Subject: [PATCH] of: property: make #.*-cells optional for simple props
 
 Sometimes, future bindings for phandles will get additional arguments.
@@ -13,19 +13,21 @@ Signed-off-by: Michael Walle <michael@walle.cc>
 Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
 Reviewed-by: Rob Herring <robh@kernel.org>
 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-11-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  drivers/of/property.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 --- a/drivers/of/property.c
 +++ b/drivers/of/property.c
-@@ -1227,8 +1227,8 @@ static struct device_node *parse_suffix_
-       if (strcmp_suffix(prop_name, suffix))
+@@ -1173,8 +1173,8 @@ static struct device_node *parse_prop_ce
+       if (strcmp(prop_name, list_name))
                return NULL;
  
--      if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
+-      if (of_parse_phandle_with_args(np, list_name, cells_name, index,
 -                                     &sup_args))
-+      if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
++      if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
 +                                       &sup_args))
                return NULL;
  
index 8c047e685d352de162256cf01bc61e209d883e30..774e793ca5a62cd98992e0cd8bbffc4f2b8e7613 100644 (file)
@@ -1,6 +1,6 @@
-From 9cf9486a6a7e8a3d76154d0c506051ba3740e8b6 Mon Sep 17 00:00:00 2001
+From e2d8172043d2e50df19fcd59c11e5593de8188d7 Mon Sep 17 00:00:00 2001
 From: Michael Walle <michael@walle.cc>
-Date: Tue, 6 Dec 2022 21:07:23 +0100
+Date: Mon, 6 Feb 2023 13:43:45 +0000
 Subject: [PATCH] of: property: add #nvmem-cell-cells property
 
 Bindings describe the new '#nvmem-cell-cells' property. Now that the
@@ -11,6 +11,8 @@ Signed-off-by: Michael Walle <michael@walle.cc>
 Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
 Reviewed-by: Rob Herring <robh@kernel.org>
 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-12-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  drivers/of/property.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/linux/generic/backport-5.15/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch b/target/linux/generic/backport-5.15/827-v6.3-0004-of-device-Ignore-modalias-of-reused-nodes.patch
new file mode 100644 (file)
index 0000000..39e4df0
--- /dev/null
@@ -0,0 +1,37 @@
+From 553bd29700145e1849698985e9800f14e967da49 Mon Sep 17 00:00:00 2001
+From: Alexander Stein <alexander.stein@ew.tq-group.com>
+Date: Tue, 7 Feb 2023 12:05:29 +0100
+Subject: [PATCH] of: device: Ignore modalias of reused nodes
+
+If of_node is reused, do not use that node's modalias. This will hide
+the name of the actual device. This is rather prominent in USB glue
+drivers creating a platform device for the host controller.
+
+Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
+Reviewed-by: Rob Herring <robh@kernel.org>
+Link: https://lore.kernel.org/r/20230207110531.1060252-2-alexander.stein@ew.tq-group.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/of/device.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/of/device.c
++++ b/drivers/of/device.c
+@@ -249,7 +249,7 @@ static ssize_t of_device_get_modalias(st
+       ssize_t csize;
+       ssize_t tsize;
+-      if ((!dev) || (!dev->of_node))
++      if ((!dev) || (!dev->of_node) || dev->of_node_reused)
+               return -ENODEV;
+       /* Name & Type */
+@@ -369,7 +369,7 @@ int of_device_uevent_modalias(struct dev
+ {
+       int sl;
+-      if ((!dev) || (!dev->of_node))
++      if ((!dev) || (!dev->of_node) || dev->of_node_reused)
+               return -ENODEV;
+       /* Devicetree modalias is tricky, we add it in 2 steps */
diff --git a/target/linux/generic/backport-5.15/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch b/target/linux/generic/backport-5.15/827-v6.3-0005-of-device-Do-not-ignore-error-code-in-of_device_ueve.patch
new file mode 100644 (file)
index 0000000..b06e0f5
--- /dev/null
@@ -0,0 +1,29 @@
+From 2295bed9bebe8d1eef276194fed5b5fbe89c5363 Mon Sep 17 00:00:00 2001
+From: Alexander Stein <alexander.stein@ew.tq-group.com>
+Date: Tue, 7 Feb 2023 12:05:30 +0100
+Subject: [PATCH] of: device: Do not ignore error code in
+ of_device_uevent_modalias
+
+of_device_get_modalias might return an error code, propagate that one.
+Otherwise the negative, signed integer is propagated to unsigned integer
+for the comparison resulting in a huge 'sl' size.
+
+Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
+Reviewed-by: Rob Herring <robh@kernel.org>
+Link: https://lore.kernel.org/r/20230207110531.1060252-3-alexander.stein@ew.tq-group.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/of/device.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/of/device.c
++++ b/drivers/of/device.c
+@@ -378,6 +378,8 @@ int of_device_uevent_modalias(struct dev
+       sl = of_device_get_modalias(dev, &env->buf[env->buflen-1],
+                                   sizeof(env->buf) - env->buflen);
++      if (sl < 0)
++              return sl;
+       if (sl >= (sizeof(env->buf) - env->buflen))
+               return -ENOMEM;
+       env->buflen += sl;
diff --git a/target/linux/generic/backport-5.15/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch b/target/linux/generic/backport-5.15/828-v6.3-of-property-fix-nvmem-cell-cells-parsing.patch
deleted file mode 100644 (file)
index f17cc1f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-From ef26c0349eb5a615dab2272d08d1d5de4ac9cd4c Mon Sep 17 00:00:00 2001
-From: Michael Walle <michael@walle.cc>
-Date: Wed, 11 Jan 2023 00:30:56 +0100
-Subject: [PATCH] of: property: fix #nvmem-cell-cells parsing
-
-Commit 67b8497f005f ("of: property: make #.*-cells optional for simple
-props") claims to make the cells-name property optional for simple
-properties, but changed the code for the wrong property, i.e. for
-DEFINE_SUFFIX_PROP(). Fix that.
-
-Fixes: 67b8497f005f ("of: property: make #.*-cells optional for simple props")
-Reported-by: Peng Fan <peng.fan@nxp.com>
-Signed-off-by: Michael Walle <michael@walle.cc>
-Acked-by: Rob Herring <robh@kernel.org>
-Tested-by: Robert Marko <robimarko@gmail.com>
-Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
----
- drivers/of/property.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/of/property.c
-+++ b/drivers/of/property.c
-@@ -1173,8 +1173,8 @@ static struct device_node *parse_prop_ce
-       if (strcmp(prop_name, list_name))
-               return NULL;
--      if (of_parse_phandle_with_args(np, list_name, cells_name, index,
--                                     &sup_args))
-+      if (__of_parse_phandle_with_args(np, list_name, cells_name, 0, index,
-+                                       &sup_args))
-               return NULL;
-       return sup_args.np;
-@@ -1227,8 +1227,8 @@ static struct device_node *parse_suffix_
-       if (strcmp_suffix(prop_name, suffix))
-               return NULL;
--      if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
--                                       &sup_args))
-+      if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
-+                                     &sup_args))
-               return NULL;
-       return sup_args.np;