devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] mtd: improve block2mtd + airoha parser
@ 2024-08-06 11:41 Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible Christian Marangi
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 11:41 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Christian Marangi, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

This small series handle 2 problems.

It does try to ""standardize"" the usage of block2mtd module with
MTD OF nodes.

It is very easy to add support for MTD parser by just adding an
OF node to the mtd created for block2mtd.

This apply only if the root block is used for block2mtd to allow
scenario where the full eMMC or an NVME is used for MTD and it doesn't
have any partition table.

To also support NVME, similar to how it's done with eMMC, we introduce
a subnode to the NVME controller that needs to have the "nvme-card"
compatible where a dev can define fixed-paritions for MTD parser usage.

This series also add support for the Airoha partition table where
the last partition is always ART and is placed at the end of the flash.

This require dynamic calculation of the offset as some dedicated
driver for bad block management might be used that reserve some space
at the end of the flash for block accounting.

New aarch64 Airoha SoC make use of this partition table and use block2mtd
for eMMC to treat them as MTD with custom bad block management and block
tracking.

Changes v3:
- Fix compilation error for missing slab.h header
- Add compatible to partitions.yaml
Changes v2:
- Fix typo in DT patch
- Fix compilation error for non-OF platform
- Fix compilation error due to recent changes in block2mtd module

Christian Marangi (6):
  dt-bindings: nvme: Document nvme-card compatible
  nvme: assign of_node to nvme device
  dt-bindings: mmc: add property for partitions node in mmc-card node
  block2mtd: attach device OF node to MTD device
  dt-bindings: mtd: Add Documentation for Airoha fixed-partitions
  mtd: parser: add support for Airoha parser

 .../devicetree/bindings/mmc/mmc-card.yaml     | 40 ++++++++++
 .../partitions/airoha,fixed-partitions.yaml   | 80 +++++++++++++++++++
 .../bindings/mtd/partitions/partitions.yaml   |  1 +
 .../devicetree/bindings/nvme/nvme-card.yaml   | 78 ++++++++++++++++++
 drivers/mtd/devices/block2mtd.c               | 12 +++
 drivers/mtd/parsers/Kconfig                   | 10 +++
 drivers/mtd/parsers/Makefile                  |  1 +
 drivers/mtd/parsers/ofpart_airoha.c           | 57 +++++++++++++
 drivers/mtd/parsers/ofpart_airoha.h           | 18 +++++
 drivers/mtd/parsers/ofpart_core.c             |  6 ++
 drivers/nvme/host/core.c                      |  4 +
 11 files changed, 307 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml
 create mode 100644 Documentation/devicetree/bindings/nvme/nvme-card.yaml
 create mode 100644 drivers/mtd/parsers/ofpart_airoha.c
 create mode 100644 drivers/mtd/parsers/ofpart_airoha.h

-- 
2.45.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible
  2024-08-06 11:41 [PATCH v3 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
@ 2024-08-06 11:41 ` Christian Marangi
  2024-08-06 12:42   ` Christoph Hellwig
  2024-08-06 11:41 ` [PATCH v3 2/6] nvme: assign of_node to nvme device Christian Marangi
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 11:41 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Christian Marangi, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

Document new nvme-card compatible to permit defining fixed-partition in
DT by the use of the block2mtd module to use block devices as MTD.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 .../devicetree/bindings/nvme/nvme-card.yaml   | 78 +++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvme/nvme-card.yaml

diff --git a/Documentation/devicetree/bindings/nvme/nvme-card.yaml b/Documentation/devicetree/bindings/nvme/nvme-card.yaml
new file mode 100644
index 000000000000..20e9a877fac4
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvme/nvme-card.yaml
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvme/nvme-card.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVME Card
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+description: |
+  This documents describes the devicetree bindings for a NVME controller
+  child node describing a nvme-card.
+
+properties:
+  compatible:
+    const: nvme-card
+
+  partitions:
+    $ref: /schemas/mtd/partitions/partitions.yaml
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    pcie {
+        #address-cells = <3>;
+        #size-cells = <2>;
+
+        bridge@0,0 {
+            reg = <0x00000000 0 0 0 0>;
+            #address-cells = <3>;
+            #size-cells = <2>;
+            ranges;
+
+            nvme@1,0 {
+                compatible = "pci144d,a809";
+
+                reg = <0x00010000 0 0 0 0>;
+                #address-cells = <1>;
+                #size-cells = <1>;
+
+                card {
+                    compatible = "nvme-card";
+
+                    partitions {
+                        compatible = "fixed-partitions";
+                        #address-cells = <1>;
+                        #size-cells = <1>;
+
+                        bootloader@0 {
+                          label = "bootloader";
+                          reg = <0x00000000 0x00080000>;
+                        };
+
+                        tclinux@80000 {
+                          label = "tclinux";
+                          reg = <0x00080000 0x02800000>;
+                        };
+
+                        tclinux_slave@2880000 {
+                          label = "tclinux_slave";
+                          reg = <0x02880000 0x02800000>;
+                        };
+
+                        rootfs_data@5080000 {
+                          label = "rootfs_data";
+                          reg = <0x5080000 0x00800000>;
+                        };
+                    };
+                };
+            };
+        };
+    };
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 2/6] nvme: assign of_node to nvme device
  2024-08-06 11:41 [PATCH v3 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible Christian Marangi
@ 2024-08-06 11:41 ` Christian Marangi
  2024-08-06 12:43   ` Christoph Hellwig
  2024-08-06 11:41 ` [PATCH v3 3/6] dt-bindings: mmc: add property for partitions node in mmc-card node Christian Marangi
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 11:41 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Christian Marangi, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

Introduce support for a dedicated node for a nvme card. This will be a
subnode of the nvme controller node that will have the "nvme-card"
compatible.

This follow a similar implementation done for mmc where the specific mmc
card have a dedicated of_node.

This can be used for scenario where block2mtd module is used to declare
partition in DT and block2mtd is called on the root block of the nvme
card, permitting the usage of fixed-partition parser or alternative
ones.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/nvme/host/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 053d5b4909cd..344523274d1b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/backing-dev.h>
+#include <linux/of.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/pr.h>
@@ -4651,6 +4652,7 @@ void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
 	nvme_hwmon_exit(ctrl);
 	nvme_fault_inject_fini(&ctrl->fault_inject);
 	dev_pm_qos_hide_latency_tolerance(ctrl->device);
+	of_node_put(ctrl->device->of_node);
 	cdev_device_del(&ctrl->cdev, ctrl->device);
 	nvme_put_ctrl(ctrl);
 }
@@ -4771,6 +4773,8 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
 	else
 		ctrl->device->groups = nvme_dev_attr_groups;
 	ctrl->device->release = nvme_free_ctrl;
+	ctrl->device->of_node = of_get_compatible_child(ctrl->dev->of_node,
+							"nvme-card");
 	dev_set_drvdata(ctrl->device, ctrl);
 
 	return ret;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 3/6] dt-bindings: mmc: add property for partitions node in mmc-card node
  2024-08-06 11:41 [PATCH v3 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 2/6] nvme: assign of_node to nvme device Christian Marangi
@ 2024-08-06 11:41 ` Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 4/6] block2mtd: attach device OF node to MTD device Christian Marangi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 11:41 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Christian Marangi, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

Add property for defining partitions node in mmc-card node to define
partitions in DT by the use of the block2mtd module to use block
devices as MTD.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 .../devicetree/bindings/mmc/mmc-card.yaml     | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
index fd347126449a..0f32d24417bc 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-card.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml
@@ -26,6 +26,9 @@ properties:
       Use this to indicate that the mmc-card has a broken hpi
       implementation, and that hpi should not be used.
 
+  partitions:
+    $ref: /schemas/mtd/partitions/partitions.yaml
+
 required:
   - compatible
   - reg
@@ -45,4 +48,41 @@ examples:
         };
     };
 
+    mmc1 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        card@0 {
+            compatible = "mmc-card";
+            reg = <0>;
+            broken-hpi;
+
+            partitions {
+                compatible = "fixed-partitions";
+                #address-cells = <1>;
+                #size-cells = <1>;
+
+                bootloader@0 {
+                  label = "bootloader";
+                  reg = <0x00000000 0x00080000>;
+                };
+
+                tclinux@80000 {
+                  label = "tclinux";
+                  reg = <0x00080000 0x02800000>;
+                };
+
+                tclinux_slave@2880000 {
+                  label = "tclinux_slave";
+                  reg = <0x02880000 0x02800000>;
+                };
+
+                rootfs_data@5080000 {
+                  label = "rootfs_data";
+                  reg = <0x5080000 0x00800000>;
+                };
+            };
+        };
+    };
+
 ...
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 4/6] block2mtd: attach device OF node to MTD device
  2024-08-06 11:41 [PATCH v3 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
                   ` (2 preceding siblings ...)
  2024-08-06 11:41 ` [PATCH v3 3/6] dt-bindings: mmc: add property for partitions node in mmc-card node Christian Marangi
@ 2024-08-06 11:41 ` Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 5/6] dt-bindings: mtd: Add Documentation for Airoha fixed-partitions Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 6/6] mtd: parser: add support for Airoha parser Christian Marangi
  5 siblings, 0 replies; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 11:41 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Christian Marangi, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

Attach device OF node to MTD device if defined and the root blockdev is
being used to add support for partitions defined in DT node.

This permits the usage of fixed-partition or alternative parser with the
use of block2mtd module.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/mtd/devices/block2mtd.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index b06c8dd51562..8ff9787edc24 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -265,6 +265,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,
 	struct file *bdev_file;
 	struct block_device *bdev;
 	struct block2mtd_dev *dev;
+	struct device *ddev;
 	loff_t size;
 	char *name;
 
@@ -324,6 +325,15 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,
 	dev->mtd.priv = dev;
 	dev->mtd.owner = THIS_MODULE;
 
+	/*
+	 * Check if we are using root blockdev.
+	 * If it's the case, connect the MTD of_node to the ddev parent
+	 * to support providing partition in DT node.
+	 */
+	ddev = disk_to_dev(bdev->bd_disk);
+	if (ddev == &bdev->bd_device)
+		dev->mtd.dev.of_node = of_node_get(ddev->parent->of_node);
+
 	if (mtd_device_register(&dev->mtd, NULL, 0)) {
 		/* Device didn't get added, so free the entry */
 		goto err_destroy_mutex;
@@ -337,6 +347,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,
 	return dev;
 
 err_destroy_mutex:
+	of_node_put(dev->mtd.dev.of_node);
 	mutex_destroy(&dev->write_mutex);
 err_free_block2mtd:
 	block2mtd_free_device(dev);
@@ -515,6 +526,7 @@ static void block2mtd_exit(void)
 		struct block2mtd_dev *dev = list_entry(pos, typeof(*dev), list);
 		block2mtd_sync(&dev->mtd);
 		mtd_device_unregister(&dev->mtd);
+		of_node_put(dev->mtd.dev.of_node);
 		mutex_destroy(&dev->write_mutex);
 		pr_info("mtd%d: [%s] removed\n",
 			dev->mtd.index,
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 5/6] dt-bindings: mtd: Add Documentation for Airoha fixed-partitions
  2024-08-06 11:41 [PATCH v3 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
                   ` (3 preceding siblings ...)
  2024-08-06 11:41 ` [PATCH v3 4/6] block2mtd: attach device OF node to MTD device Christian Marangi
@ 2024-08-06 11:41 ` Christian Marangi
  2024-08-06 11:41 ` [PATCH v3 6/6] mtd: parser: add support for Airoha parser Christian Marangi
  5 siblings, 0 replies; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 11:41 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Christian Marangi, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

Add Documentation for Airoha fixed-partitions compatibles.

Airoha based SoC declare a dedicated partition at the end of the flash to
store calibration and device specific data, in addition to fixed
partitions.
The offset of this special partition is not well defined as it depends on
flash bad block management that might require reserving additional space
at the end of the flash.

This binding allows defining all fixed partitions and marking the last one
to detect the correct offset.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 .../partitions/airoha,fixed-partitions.yaml   | 80 +++++++++++++++++++
 .../bindings/mtd/partitions/partitions.yaml   |  1 +
 2 files changed, 81 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml

diff --git a/Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml
new file mode 100644
index 000000000000..8d7221561f51
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/partitions/airoha,fixed-partitions.yaml
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mtd/partitions/airoha,fixed-partitions.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha SoC partitioning
+
+description: |
+  Airoha based SoC declare a dedicated partition at the end of the flash to
+  store calibration and device specific data, in addition to fixed partitions.
+  The offset of this special partition is not well defined as it depends on
+  flash bad block management that might require reserving additional space at the
+  end of the flash.
+
+  This binding allows defining all fixed partitions and marking the last one to
+  detect the correct offset.
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+select: false
+
+properties:
+  compatible:
+    const: airoha,fixed-partitions
+
+  "#address-cells":
+    enum: [ 1, 2 ]
+
+  "#size-cells":
+    enum: [ 1, 2 ]
+
+patternProperties:
+  "^partition@[0-9a-f]+$":
+    $ref: partition.yaml#
+    properties:
+      compatible:
+        const: airoha,dynamic-art
+    unevaluatedProperties: false
+
+required:
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    partitions {
+        compatible = "airoha,fixed-partitions";
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        partition@0 {
+          label = "bootloader";
+          reg = <0x00000000 0x00080000>;
+        };
+
+        partition@80000 {
+          label = "tclinux";
+          reg = <0x00080000 0x02800000>;
+        };
+
+        partition@2880000 {
+          label = "tclinux_slave";
+          reg = <0x02880000 0x02800000>;
+        };
+
+        partition@5080000 {
+          label = "rootfs_data";
+          reg = <0x5080000 0x00800000>;
+        };
+
+        partition@ffffffff {
+          compatible = "airoha,dynamic-art";
+          label = "art";
+          reg = <0xffffffff 0x00300000>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
index 1dda2c80747b..ec254e03adf0 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
@@ -14,6 +14,7 @@ maintainers:
   - Miquel Raynal <miquel.raynal@bootlin.com>
 
 oneOf:
+  - $ref: airoha,fixed-partitions.yaml
   - $ref: arm,arm-firmware-suite.yaml
   - $ref: brcm,bcm4908-partitions.yaml
   - $ref: brcm,bcm947xx-cfe-partitions.yaml
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 6/6] mtd: parser: add support for Airoha parser
  2024-08-06 11:41 [PATCH v3 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
                   ` (4 preceding siblings ...)
  2024-08-06 11:41 ` [PATCH v3 5/6] dt-bindings: mtd: Add Documentation for Airoha fixed-partitions Christian Marangi
@ 2024-08-06 11:41 ` Christian Marangi
  2024-08-07 21:27   ` kernel test robot
  5 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 11:41 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Christian Marangi, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

Add support for Airoha parser based on a post parse ofpart function.

Airoha partition table follow normal fixed-partition implementation
with a special implementation for the ART partition. This is always the
last partition and is placed from the end of the flash - the partition
size.

To enable this special implementation for ART partition, the relevant
node require the "airoha,dynamic-art" compatible. With that declared,
offset value is ignored and real offset is updated with the calculated
value.

Due to usage of specific bad block management driver, the MTD size might
vary hence the ART partition offset needs to be dynamically parsed and
can't be declared statically.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/mtd/parsers/Kconfig         | 10 +++++
 drivers/mtd/parsers/Makefile        |  1 +
 drivers/mtd/parsers/ofpart_airoha.c | 57 +++++++++++++++++++++++++++++
 drivers/mtd/parsers/ofpart_airoha.h | 18 +++++++++
 drivers/mtd/parsers/ofpart_core.c   |  6 +++
 5 files changed, 92 insertions(+)
 create mode 100644 drivers/mtd/parsers/ofpart_airoha.c
 create mode 100644 drivers/mtd/parsers/ofpart_airoha.h

diff --git a/drivers/mtd/parsers/Kconfig b/drivers/mtd/parsers/Kconfig
index da03ab6efe04..d6c53aa16ea6 100644
--- a/drivers/mtd/parsers/Kconfig
+++ b/drivers/mtd/parsers/Kconfig
@@ -72,6 +72,16 @@ config MTD_OF_PARTS
 	  flash memory node, as described in
 	  Documentation/devicetree/bindings/mtd/mtd.yaml.
 
+config MTD_OF_PARTS_AIROHA
+	bool "Airoha EN7815 partitioning support"
+	depends on MTD_OF_PARTS && (ARCH_AIROHA || COMPILE_TEST)
+	default ARCH_AIROHA
+	help
+	  This provides partitions parser for Airoha EN7815 family devices
+	  that can have dynamic "ART" partition at the end of the flash.
+	  It takes care of finding the correct offset and update property
+	  with it.
+
 config MTD_OF_PARTS_BCM4908
 	bool "BCM4908 partitioning support"
 	depends on MTD_OF_PARTS && (ARCH_BCMBCA || COMPILE_TEST)
diff --git a/drivers/mtd/parsers/Makefile b/drivers/mtd/parsers/Makefile
index 9b00c62b837a..d67f9b4d39ac 100644
--- a/drivers/mtd/parsers/Makefile
+++ b/drivers/mtd/parsers/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_MTD_BRCM_U_BOOT)		+= brcm_u-boot.o
 obj-$(CONFIG_MTD_CMDLINE_PARTS)		+= cmdlinepart.o
 obj-$(CONFIG_MTD_OF_PARTS)		+= ofpart.o
 ofpart-y				+= ofpart_core.o
+ofpart-$(CONFIG_MTD_OF_PARTS_AIROHA)	+= ofpart_airoha.o
 ofpart-$(CONFIG_MTD_OF_PARTS_BCM4908)	+= ofpart_bcm4908.o
 ofpart-$(CONFIG_MTD_OF_PARTS_LINKSYS_NS)+= ofpart_linksys_ns.o
 obj-$(CONFIG_MTD_PARSER_IMAGETAG)	+= parser_imagetag.o
diff --git a/drivers/mtd/parsers/ofpart_airoha.c b/drivers/mtd/parsers/ofpart_airoha.c
new file mode 100644
index 000000000000..5e2cc7b6376b
--- /dev/null
+++ b/drivers/mtd/parsers/ofpart_airoha.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2024 Christian Marangi <ansuelsmth@gmail.com>
+ */
+
+#include <linux/mtd/mtd.h>
+#include <linux/slab.h>
+#include <linux/mtd/partitions.h>
+
+#include "ofpart_airoha.h"
+
+int airoha_partitions_post_parse(struct mtd_info *mtd,
+				 struct mtd_partition *parts,
+				 int nr_parts)
+{
+	struct mtd_partition *part;
+	int len, a_cells, s_cells;
+	struct device_node *pp;
+	struct property *prop;
+	const __be32 *reg;
+	__be32 *new_reg;
+
+	part = &parts[nr_parts - 1];
+	pp = part->of_node;
+
+	/* Skip if ART partition have a valid offset instead of a dynamic one */
+	if (!of_device_is_compatible(pp, "airoha,dynamic-art"))
+		return 0;
+
+	/* ART partition is set at the end of flash - size */
+	part->offset = mtd->size - part->size;
+
+	/* Update the offset with the new calculate value in DT */
+	prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+	if (!prop)
+		return -ENOMEM;
+
+	/* Reg already validated by fixed-partition parser */
+	reg = of_get_property(pp, "reg", &len);
+
+	/* Fixed partition */
+	a_cells = of_n_addr_cells(pp);
+	s_cells = of_n_size_cells(pp);
+
+	prop->name = "reg";
+	prop->length = (a_cells + s_cells) * sizeof(__be32);
+	prop->value = kmemdup(reg, (a_cells + s_cells) * sizeof(__be32),
+			      GFP_KERNEL);
+	new_reg = prop->value;
+	memset(new_reg, 0, a_cells * sizeof(__be32));
+	new_reg[a_cells - 1] = cpu_to_be32(part->offset);
+	if (a_cells > 1)
+		new_reg[0] = cpu_to_be32(part->offset >> 32);
+	of_update_property(pp, prop);
+
+	return 0;
+}
diff --git a/drivers/mtd/parsers/ofpart_airoha.h b/drivers/mtd/parsers/ofpart_airoha.h
new file mode 100644
index 000000000000..3e8a8456c13a
--- /dev/null
+++ b/drivers/mtd/parsers/ofpart_airoha.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __OFPART_AIROHA_H
+#define __OFPART_AIROHA_H
+
+#ifdef CONFIG_MTD_OF_PARTS_AIROHA
+int airoha_partitions_post_parse(struct mtd_info *mtd,
+				 struct mtd_partition *parts,
+				 int nr_parts);
+#else
+static inline int airoha_partitions_post_parse(struct mtd_info *mtd,
+					       struct mtd_partition *parts,
+					       int nr_parts)
+{
+	return -EOPNOTSUPP;
+}
+#endif
+
+#endif
diff --git a/drivers/mtd/parsers/ofpart_core.c b/drivers/mtd/parsers/ofpart_core.c
index e7b8e9d0a910..9e078636d158 100644
--- a/drivers/mtd/parsers/ofpart_core.c
+++ b/drivers/mtd/parsers/ofpart_core.c
@@ -16,6 +16,7 @@
 #include <linux/slab.h>
 #include <linux/mtd/partitions.h>
 
+#include "ofpart_airoha.h"
 #include "ofpart_bcm4908.h"
 #include "ofpart_linksys_ns.h"
 
@@ -23,6 +24,10 @@ struct fixed_partitions_quirks {
 	int (*post_parse)(struct mtd_info *mtd, struct mtd_partition *parts, int nr_parts);
 };
 
+static struct fixed_partitions_quirks airoha_partitions_quirks = {
+	.post_parse = airoha_partitions_post_parse,
+};
+
 static struct fixed_partitions_quirks bcm4908_partitions_quirks = {
 	.post_parse = bcm4908_partitions_post_parse,
 };
@@ -192,6 +197,7 @@ static const struct of_device_id parse_ofpart_match_table[] = {
 	/* Generic */
 	{ .compatible = "fixed-partitions" },
 	/* Customized */
+	{ .compatible = "airoha,fixed-partitions", .data = &airoha_partitions_quirks, },
 	{ .compatible = "brcm,bcm4908-partitions", .data = &bcm4908_partitions_quirks, },
 	{ .compatible = "linksys,ns-partitions", .data = &linksys_ns_partitions_quirks, },
 	{},
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible
  2024-08-06 11:41 ` [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible Christian Marangi
@ 2024-08-06 12:42   ` Christoph Hellwig
  2024-08-06 12:55     ` Christian Marangi
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2024-08-06 12:42 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

On Tue, Aug 06, 2024 at 01:41:11PM +0200, Christian Marangi wrote:
> Document new nvme-card compatible to permit defining fixed-partition in
> DT by the use of the block2mtd module to use block devices as MTD.
 
What does nvme card mean?  Is this about nvmem or nvme?  If this is nvme,
are you talking about nvme-pci?  Why would that needs a device binding
when it is a PCI device?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/6] nvme: assign of_node to nvme device
  2024-08-06 11:41 ` [PATCH v3 2/6] nvme: assign of_node to nvme device Christian Marangi
@ 2024-08-06 12:43   ` Christoph Hellwig
  2024-08-06 13:03     ` Christian Marangi
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2024-08-06 12:43 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

On Tue, Aug 06, 2024 at 01:41:12PM +0200, Christian Marangi wrote:
> Introduce support for a dedicated node for a nvme card. This will be a
> subnode of the nvme controller node that will have the "nvme-card"
> compatible.
> 
> This follow a similar implementation done for mmc where the specific mmc
> card have a dedicated of_node.
> 
> This can be used for scenario where block2mtd module is used to declare
> partition in DT and block2mtd is called on the root block of the nvme
> card, permitting the usage of fixed-partition parser or alternative
> ones.

Err, hell no.  Why would you wire up a purely PCIe device to OF?
PCIe is self-discovering.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible
  2024-08-06 12:42   ` Christoph Hellwig
@ 2024-08-06 12:55     ` Christian Marangi
  2024-08-06 13:00       ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 12:55 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Sagi Grimberg, Wolfram Sang,
	Florian Fainelli, Thomas Bogendoerfer, linux-mmc, devicetree,
	linux-kernel, linux-mtd, linux-nvme

On Tue, Aug 06, 2024 at 02:42:24PM +0200, Christoph Hellwig wrote:
> On Tue, Aug 06, 2024 at 01:41:11PM +0200, Christian Marangi wrote:
> > Document new nvme-card compatible to permit defining fixed-partition in
> > DT by the use of the block2mtd module to use block devices as MTD.
>  
> What does nvme card mean?  Is this about nvmem or nvme?  If this is nvme,
> are you talking about nvme-pci?  Why would that needs a device binding
> when it is a PCI device?
>

It's similar to how it's done with mmc and it's to keep the property
consistent with block devices.

emmc have something like

mmc {
	mmc-card {
		specific-property;

		partitions...
	};
};

The same will be with nvme with

nvme {
	compatible = "pci_id"

	nvme-card {
		quirks maybe in the future?
		partitions...
	};
};

The following implementation permits in block2mtd to not complicate the
implementation with all the add_disk functions works with parenting
struct and how they are initialized.

(alternative is to have in block2mtd all kind of extra logic with switch
case to check for major block ID that deviates from a common schema)

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible
  2024-08-06 12:55     ` Christian Marangi
@ 2024-08-06 13:00       ` Christoph Hellwig
  2024-08-06 13:17         ` Christian Marangi
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2024-08-06 13:00 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Christoph Hellwig, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Joern Engel, Keith Busch, Jens Axboe,
	Sagi Grimberg, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

I don't see how this works.  There is absolutely nothing nvme specific
in there, and we really should not bring OF into NVMe.

> (alternative is to have in block2mtd all kind of extra logic with switch
> case to check for major block ID that deviates from a common schema)

What common scheme?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/6] nvme: assign of_node to nvme device
  2024-08-06 12:43   ` Christoph Hellwig
@ 2024-08-06 13:03     ` Christian Marangi
  2024-08-06 13:09       ` Christoph Hellwig
  2024-08-06 15:39       ` Dragan Simic
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 13:03 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Sagi Grimberg, Wolfram Sang,
	Florian Fainelli, Thomas Bogendoerfer, linux-mmc, devicetree,
	linux-kernel, linux-mtd, linux-nvme

On Tue, Aug 06, 2024 at 02:43:12PM +0200, Christoph Hellwig wrote:
> On Tue, Aug 06, 2024 at 01:41:12PM +0200, Christian Marangi wrote:
> > Introduce support for a dedicated node for a nvme card. This will be a
> > subnode of the nvme controller node that will have the "nvme-card"
> > compatible.
> > 
> > This follow a similar implementation done for mmc where the specific mmc
> > card have a dedicated of_node.
> > 
> > This can be used for scenario where block2mtd module is used to declare
> > partition in DT and block2mtd is called on the root block of the nvme
> > card, permitting the usage of fixed-partition parser or alternative
> > ones.
> 
> Err, hell no.  Why would you wire up a purely PCIe device to OF?
> PCIe is self-discovering.
>

Well on embedded pure PCIe card most of the time are not a thing...
Unless it's an enterprise product, everything is integrated in the pcb
and not detachable for cost saving measure or also if the thing use PCIe
protocol but it tighlty coupled with the SoC.

This implementation is already very common for all kind of pcie devices
like wireless card, gpio expander that are integrated in the PCB and
require property in DT like calibration data, quirks or GPIO pin
definitions, i2c...

In modern SoC we are seeing an influx of using cheap flash storage
option instead of NAND or NOR as modern hw require more space and price
increase is not that high... Almost any high tier device is switching to
using emmc and even attached NVME and simulating MTD with them for easy
usage.

Please consider this well used scenario in emebedded where PCIe is just
a comunication way and the concept of detachable doesn't exist at all
and things can be described in DT as static. Also these storage are used
for rootfs mount so userspace is not so viable.

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/6] nvme: assign of_node to nvme device
  2024-08-06 13:03     ` Christian Marangi
@ 2024-08-06 13:09       ` Christoph Hellwig
  2024-08-06 13:26         ` Christian Marangi
  2024-08-06 15:39       ` Dragan Simic
  1 sibling, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2024-08-06 13:09 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Christoph Hellwig, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Joern Engel, Keith Busch, Jens Axboe,
	Sagi Grimberg, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

On Tue, Aug 06, 2024 at 03:03:24PM +0200, Christian Marangi wrote:
> Well on embedded pure PCIe card most of the time are not a thing...
> Unless it's an enterprise product, everything is integrated in the pcb
> and not detachable for cost saving measure or also if the thing use PCIe
> protocol but it tighlty coupled with the SoC.

Yes, PCIe has a bunch of form factors, including just soldered on BGA
devices, but none of that matters at all for the logical protocol.

> This implementation is already very common for all kind of pcie devices
> like wireless card, gpio expander that are integrated in the PCB and
> require property in DT like calibration data, quirks or GPIO pin
> definitions, i2c...

Do you have a document on that/


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible
  2024-08-06 13:00       ` Christoph Hellwig
@ 2024-08-06 13:17         ` Christian Marangi
  0 siblings, 0 replies; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 13:17 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Sagi Grimberg, Wolfram Sang,
	Florian Fainelli, Thomas Bogendoerfer, linux-mmc, devicetree,
	linux-kernel, linux-mtd, linux-nvme

On Tue, Aug 06, 2024 at 03:00:03PM +0200, Christoph Hellwig wrote:
> I don't see how this works.  There is absolutely nothing nvme specific
> in there, and we really should not bring OF into NVMe.
>

Thing is that OF for PCIe devices is already a thing so NVMe already
have OF support. And that is totally OK if the PCIe is not removable.

So it's really a simple subnode to keep things organized in DT and
permit common code. Why this would be problematic, the implications of
adding support for this are really none, only additional support for the
new devices that are taking this path. (you would be surprised by the
amount of hacks they use downstream so about times to stabilize this the
correct way)

> > (alternative is to have in block2mtd all kind of extra logic with switch
> > case to check for major block ID that deviates from a common schema)
> 
> What common scheme?
> 

The emmc one and also nand attached to spi. They all follow this.

controller {
	card {
	};
};

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/6] nvme: assign of_node to nvme device
  2024-08-06 13:09       ` Christoph Hellwig
@ 2024-08-06 13:26         ` Christian Marangi
  0 siblings, 0 replies; 17+ messages in thread
From: Christian Marangi @ 2024-08-06 13:26 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Joern Engel, Keith Busch, Jens Axboe, Sagi Grimberg, Wolfram Sang,
	Florian Fainelli, Thomas Bogendoerfer, linux-mmc, devicetree,
	linux-kernel, linux-mtd, linux-nvme

On Tue, Aug 06, 2024 at 03:09:38PM +0200, Christoph Hellwig wrote:
> On Tue, Aug 06, 2024 at 03:03:24PM +0200, Christian Marangi wrote:
> > Well on embedded pure PCIe card most of the time are not a thing...
> > Unless it's an enterprise product, everything is integrated in the pcb
> > and not detachable for cost saving measure or also if the thing use PCIe
> > protocol but it tighlty coupled with the SoC.
> 
> Yes, PCIe has a bunch of form factors, including just soldered on BGA
> devices, but none of that matters at all for the logical protocol.
>

Correct, for the context of soldered stuff tho things can be
malfunctioning (problem in the PCIe driver) or working so it's possibile
to make assumption and attach OF node in DT. Consider that the thing is
probed only if the card is correctly detected. Card not present ->
nothing is done.

> > This implementation is already very common for all kind of pcie devices
> > like wireless card, gpio expander that are integrated in the PCB and
> > require property in DT like calibration data, quirks or GPIO pin
> > definitions, i2c...
> 
> Do you have a document on that/
> 

You mean example of PCIe that makes use of OF? Pretty much ath10k-11k
mediatek and in general all wireless card. Example ath11k-pci.yaml [1]

Compatible is set to the ID. PCIe will attach an OF node if found in the
pcie child nodes (already supported)

On NVMe driver side, the NVMe controller will already have an OF node
present.

We are now just adding an additional subnode "nvme-card" and attach it
on the root disk when it's created.

[1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/net/wireless/qcom%2Cath11k-pci.yaml

-- 
	Ansuel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/6] nvme: assign of_node to nvme device
  2024-08-06 13:03     ` Christian Marangi
  2024-08-06 13:09       ` Christoph Hellwig
@ 2024-08-06 15:39       ` Dragan Simic
  1 sibling, 0 replies; 17+ messages in thread
From: Dragan Simic @ 2024-08-06 15:39 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Christoph Hellwig, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Joern Engel, Keith Busch, Jens Axboe,
	Sagi Grimberg, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme

Hello all,

On 2024-08-06 15:03, Christian Marangi wrote:
> On Tue, Aug 06, 2024 at 02:43:12PM +0200, Christoph Hellwig wrote:
>> On Tue, Aug 06, 2024 at 01:41:12PM +0200, Christian Marangi wrote:
>> > Introduce support for a dedicated node for a nvme card. This will be a
>> > subnode of the nvme controller node that will have the "nvme-card"
>> > compatible.
>> >
>> > This follow a similar implementation done for mmc where the specific mmc
>> > card have a dedicated of_node.
>> >
>> > This can be used for scenario where block2mtd module is used to declare
>> > partition in DT and block2mtd is called on the root block of the nvme
>> > card, permitting the usage of fixed-partition parser or alternative
>> > ones.
>> 
>> Err, hell no.  Why would you wire up a purely PCIe device to OF?
>> PCIe is self-discovering.
>> 
> 
> Well on embedded pure PCIe card most of the time are not a thing...
> Unless it's an enterprise product, everything is integrated in the pcb
> and not detachable for cost saving measure or also if the thing use 
> PCIe
> protocol but it tighlty coupled with the SoC.
> 
> This implementation is already very common for all kind of pcie devices
> like wireless card, gpio expander that are integrated in the PCB and
> require property in DT like calibration data, quirks or GPIO pin
> definitions, i2c...
> 
> In modern SoC we are seeing an influx of using cheap flash storage
> option instead of NAND or NOR as modern hw require more space and price
> increase is not that high... Almost any high tier device is switching 
> to
> using emmc and even attached NVME and simulating MTD with them for easy
> usage.
> 
> Please consider this well used scenario in emebedded where PCIe is just
> a comunication way and the concept of detachable doesn't exist at all
> and things can be described in DT as static. Also these storage are 
> used
> for rootfs mount so userspace is not so viable.

As a note, perhaps this is another good example of a "fixed layout"
PCIe device found on an SBC:

https://lore.kernel.org/linux-rockchip/20240805073425.3492078-1-jacobe.zang@wesion.com/T/#u

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 6/6] mtd: parser: add support for Airoha parser
  2024-08-06 11:41 ` [PATCH v3 6/6] mtd: parser: add support for Airoha parser Christian Marangi
@ 2024-08-07 21:27   ` kernel test robot
  0 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2024-08-07 21:27 UTC (permalink / raw)
  To: Christian Marangi, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Joern Engel, Keith Busch, Jens Axboe,
	Christoph Hellwig, Sagi Grimberg, Wolfram Sang, Florian Fainelli,
	Thomas Bogendoerfer, linux-mmc, devicetree, linux-kernel,
	linux-mtd, linux-nvme
  Cc: oe-kbuild-all

Hi Christian,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on mtd/mtd/fixes linus/master v6.11-rc2 next-20240807]
[cannot apply to mtd/mtd/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/dt-bindings-nvme-Document-nvme-card-compatible/20240806-195029
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20240806114118.17198-7-ansuelsmth%40gmail.com
patch subject: [PATCH v3 6/6] mtd: parser: add support for Airoha parser
config: arc-randconfig-r121-20240807 (https://download.01.org/0day-ci/archive/20240808/202408080559.nVw5Qez6-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240808/202408080559.nVw5Qez6-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408080559.nVw5Qez6-lkp@intel.com/

All errors (new ones prefixed by >>, old ones prefixed by <<):

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/devfreq/governor_performance.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-core.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-master-hub.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-master-gpio.o
>> ERROR: modpost: "of_update_property" [drivers/mtd/parsers/ofpart.ko] undefined!

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-08-07 21:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06 11:41 [PATCH v3 0/6] mtd: improve block2mtd + airoha parser Christian Marangi
2024-08-06 11:41 ` [PATCH v3 1/6] dt-bindings: nvme: Document nvme-card compatible Christian Marangi
2024-08-06 12:42   ` Christoph Hellwig
2024-08-06 12:55     ` Christian Marangi
2024-08-06 13:00       ` Christoph Hellwig
2024-08-06 13:17         ` Christian Marangi
2024-08-06 11:41 ` [PATCH v3 2/6] nvme: assign of_node to nvme device Christian Marangi
2024-08-06 12:43   ` Christoph Hellwig
2024-08-06 13:03     ` Christian Marangi
2024-08-06 13:09       ` Christoph Hellwig
2024-08-06 13:26         ` Christian Marangi
2024-08-06 15:39       ` Dragan Simic
2024-08-06 11:41 ` [PATCH v3 3/6] dt-bindings: mmc: add property for partitions node in mmc-card node Christian Marangi
2024-08-06 11:41 ` [PATCH v3 4/6] block2mtd: attach device OF node to MTD device Christian Marangi
2024-08-06 11:41 ` [PATCH v3 5/6] dt-bindings: mtd: Add Documentation for Airoha fixed-partitions Christian Marangi
2024-08-06 11:41 ` [PATCH v3 6/6] mtd: parser: add support for Airoha parser Christian Marangi
2024-08-07 21:27   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).