All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
@ 2017-10-17 15:28 Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 1/5] MTD: mtdram: properly handle the phys argument in the point method Nicolas Pitre
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-17 15:28 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger; +Cc: Chris Brandt, linux-mtd

This series improves or implements the point and unpoint driver methods
and reimplements mtd_get_unmapped_area() in terms of those. Because
mtd->_point() provides a superset of what mtd->_get_unmapped_area() does
then there is no reason for having both. Or worse: having one but not
the other.

This is motivated by my work on XIP cramfs for both MMU and !MMU systems
where I do need the more complete point functionality. And it just looks
like the right thing to do.

This is also available on top of Linux v4.14-rc3 via git here:

  http://git.linaro.org/people/nicolas.pitre/linux mtd_point


Changes from v1:

- Fix retlen computation in mtdram.c:ram_point().

- Added Richard Weinberger's REviewd-by tags.


diffstat:

 drivers/mtd/chips/map_ram.c  | 34 ++++++++++++++++++++--------------
 drivers/mtd/chips/map_rom.c  | 34 +++++++++++++++++++++-------------
 drivers/mtd/devices/mtdram.c | 36 ++++++++++++++++++++++--------------
 drivers/mtd/mtdconcat.c      | 27 ---------------------------
 drivers/mtd/mtdcore.c        | 17 ++++++++++++-----
 drivers/mtd/mtdpart.c        | 14 --------------
 include/linux/mtd/mtd.h      |  4 ----
 7 files changed, 75 insertions(+), 91 deletions(-)

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

* [PATCH v2 1/5] MTD: mtdram: properly handle the phys argument in the point method
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
@ 2017-10-17 15:28 ` Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 2/5] MTD: chips/map_ram.c: implement point and unpoint methods Nicolas Pitre
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-17 15:28 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger; +Cc: Chris Brandt, linux-mtd

When the phys pointer is non null, the point method is expected to return
the physical address for the pointed area. In the case of the mtdram
driver we have to retrieve the physical address for the corresponding
vmalloc area. However, there is no guarantee that the vmalloc area is
made of physically contiguous pages. In that case we simply limit retlen
to the actually contiguous pages.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/devices/mtdram.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index cbd8547d7a..4418629e8d 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -13,6 +13,7 @@
 #include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/vmalloc.h>
+#include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/mtdram.h>
@@ -69,6 +70,27 @@ static int ram_point(struct mtd_info *mtd, loff_t from, size_t len,
 {
 	*virt = mtd->priv + from;
 	*retlen = len;
+
+	if (phys) {
+		/* limit retlen to the number of contiguous physical pages */
+		unsigned long page_ofs = offset_in_page(*virt);
+		void *addr = *virt - page_ofs;
+		unsigned long pfn1, pfn0 = vmalloc_to_pfn(addr);
+
+		*phys = __pfn_to_phys(pfn0) + page_ofs;
+		len += page_ofs;
+		while (len > PAGE_SIZE) {
+			len -= PAGE_SIZE;
+			addr += PAGE_SIZE;
+			pfn0++;
+			pfn1 = vmalloc_to_pfn(addr);
+			if (pfn1 != pfn0) {
+				*retlen = addr - *virt;
+				break;
+			}
+		}
+	}
+
 	return 0;
 }
 
-- 
2.9.5

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

* [PATCH v2 2/5] MTD: chips/map_ram.c: implement point and unpoint methods
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 1/5] MTD: mtdram: properly handle the phys argument in the point method Nicolas Pitre
@ 2017-10-17 15:28 ` Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 3/5] MTD: chips/map_rom.c: " Nicolas Pitre
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-17 15:28 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger; +Cc: Chris Brandt, linux-mtd

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/chips/map_ram.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c
index afb43d5e17..c3939dd230 100644
--- a/drivers/mtd/chips/map_ram.c
+++ b/drivers/mtd/chips/map_ram.c
@@ -22,6 +22,9 @@ static void mapram_nop (struct mtd_info *);
 static struct mtd_info *map_ram_probe(struct map_info *map);
 static unsigned long mapram_unmapped_area(struct mtd_info *, unsigned long,
 					  unsigned long, unsigned long);
+static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len,
+			 size_t *retlen, void **virt, resource_size_t *phys);
+static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
 
 
 static struct mtd_chip_driver mapram_chipdrv = {
@@ -69,7 +72,9 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
 	mtd->_read = mapram_read;
 	mtd->_write = mapram_write;
 	mtd->_panic_write = mapram_write;
+	mtd->_point = mapram_point;
 	mtd->_sync = mapram_nop;
+	mtd->_unpoint = mapram_unpoint;
 	mtd->flags = MTD_CAP_RAM;
 	mtd->writesize = 1;
 
@@ -96,6 +101,25 @@ static unsigned long mapram_unmapped_area(struct mtd_info *mtd,
 	return (unsigned long) map->virt + offset;
 }
 
+static int mapram_point(struct mtd_info *mtd, loff_t from, size_t len,
+			size_t *retlen, void **virt, resource_size_t *phys)
+{
+	struct map_info *map = mtd->priv;
+
+	if (!map->virt)
+		return -EINVAL;
+	*virt = map->virt + from;
+	if (phys)
+		*phys = map->phys + from;
+	*retlen = len;
+	return 0;
+}
+
+static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
+{
+	return 0;
+}
+
 static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
 {
 	struct map_info *map = mtd->priv;
-- 
2.9.5

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

* [PATCH v2 3/5] MTD: chips/map_rom.c: implement point and unpoint methods
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 1/5] MTD: mtdram: properly handle the phys argument in the point method Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 2/5] MTD: chips/map_ram.c: implement point and unpoint methods Nicolas Pitre
@ 2017-10-17 15:28 ` Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 4/5] MTD: implement mtd_get_unmapped_area() using the point method Nicolas Pitre
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-17 15:28 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger; +Cc: Chris Brandt, linux-mtd

Signed-off-by: Nicolas Pitre <nico@linaro.org>
---
 drivers/mtd/chips/map_rom.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c
index e67f73ab44..722afb1cf4 100644
--- a/drivers/mtd/chips/map_rom.c
+++ b/drivers/mtd/chips/map_rom.c
@@ -22,6 +22,10 @@ static struct mtd_info *map_rom_probe(struct map_info *map);
 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
 static unsigned long maprom_unmapped_area(struct mtd_info *, unsigned long,
 					  unsigned long, unsigned long);
+static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len,
+			 size_t *retlen, void **virt, resource_size_t *phys);
+static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
+
 
 static struct mtd_chip_driver maprom_chipdrv = {
 	.probe	= map_rom_probe,
@@ -52,6 +56,8 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
 	mtd->type = MTD_ROM;
 	mtd->size = map->size;
 	mtd->_get_unmapped_area = maprom_unmapped_area;
+	mtd->_point = maprom_point;
+	mtd->_unpoint = maprom_unpoint;
 	mtd->_read = maprom_read;
 	mtd->_write = maprom_write;
 	mtd->_sync = maprom_nop;
@@ -78,6 +84,24 @@ static unsigned long maprom_unmapped_area(struct mtd_info *mtd,
 {
 	struct map_info *map = mtd->priv;
 	return (unsigned long) map->virt + offset;
+
+static int maprom_point(struct mtd_info *mtd, loff_t from, size_t len,
+			size_t *retlen, void **virt, resource_size_t *phys)
+{
+	struct map_info *map = mtd->priv;
+
+	if (!map->virt)
+		return -EINVAL;
+	*virt = map->virt + from;
+	if (phys)
+		*phys = map->phys + from;
+	*retlen = len;
+	return 0;
+}
+
+static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
+{
+	return 0;
 }
 
 static int maprom_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
-- 
2.9.5

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

* [PATCH v2 4/5] MTD: implement mtd_get_unmapped_area() using the point method
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
                   ` (2 preceding siblings ...)
  2017-10-17 15:28 ` [PATCH v2 3/5] MTD: chips/map_rom.c: " Nicolas Pitre
@ 2017-10-17 15:28 ` Nicolas Pitre
  2017-10-17 15:28 ` [PATCH v2 5/5] MTD: remove the get_unmapped_area method Nicolas Pitre
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-17 15:28 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger; +Cc: Chris Brandt, linux-mtd

The mtd->_point method is a superset of mtd->_get_unmapped_area.
Especially in the NOR flash case, the point method ensures the flash
memory is in array (data) mode and that it will stay that way which
is precisely what callers of mtd_get_unmapped_area() would expect.

Implement mtd_get_unmapped_area() in terms of mtd->_point now that all
drivers that provided a _get_unmapped_area method also have the _point
method implemented.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/mtdcore.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index e7ea842ba3..ecb0380158 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1022,11 +1022,18 @@ EXPORT_SYMBOL_GPL(mtd_unpoint);
 unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, unsigned long len,
 				    unsigned long offset, unsigned long flags)
 {
-	if (!mtd->_get_unmapped_area)
-		return -EOPNOTSUPP;
-	if (offset >= mtd->size || len > mtd->size - offset)
-		return -EINVAL;
-	return mtd->_get_unmapped_area(mtd, len, offset, flags);
+	size_t retlen;
+	void *virt;
+	int ret;
+
+	ret = mtd_point(mtd, offset, len, &retlen, &virt, NULL);
+	if (ret)
+		return ret;
+	if (retlen != len) {
+		mtd_unpoint(mtd, offset, retlen);
+		return -ENOSYS;
+	}
+	return (unsigned long)virt;
 }
 EXPORT_SYMBOL_GPL(mtd_get_unmapped_area);
 
-- 
2.9.5

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

* [PATCH v2 5/5] MTD: remove the get_unmapped_area method
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
                   ` (3 preceding siblings ...)
  2017-10-17 15:28 ` [PATCH v2 4/5] MTD: implement mtd_get_unmapped_area() using the point method Nicolas Pitre
@ 2017-10-17 15:28 ` Nicolas Pitre
  2017-10-24 17:22 ` [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-17 15:28 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger; +Cc: Chris Brandt, linux-mtd

It is now unused.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/chips/map_ram.c  | 18 ------------------
 drivers/mtd/chips/map_rom.c  | 16 ----------------
 drivers/mtd/devices/mtdram.c | 14 --------------
 drivers/mtd/mtdconcat.c      | 27 ---------------------------
 drivers/mtd/mtdpart.c        | 14 --------------
 include/linux/mtd/mtd.h      |  4 ----
 6 files changed, 93 deletions(-)

diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c
index c3939dd230..1cd0fff0e9 100644
--- a/drivers/mtd/chips/map_ram.c
+++ b/drivers/mtd/chips/map_ram.c
@@ -20,8 +20,6 @@ static int mapram_write (struct mtd_info *, loff_t, size_t, size_t *, const u_ch
 static int mapram_erase (struct mtd_info *, struct erase_info *);
 static void mapram_nop (struct mtd_info *);
 static struct mtd_info *map_ram_probe(struct map_info *map);
-static unsigned long mapram_unmapped_area(struct mtd_info *, unsigned long,
-					  unsigned long, unsigned long);
 static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len,
 			 size_t *retlen, void **virt, resource_size_t *phys);
 static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
@@ -68,7 +66,6 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
 	mtd->type = MTD_RAM;
 	mtd->size = map->size;
 	mtd->_erase = mapram_erase;
-	mtd->_get_unmapped_area = mapram_unmapped_area;
 	mtd->_read = mapram_read;
 	mtd->_write = mapram_write;
 	mtd->_panic_write = mapram_write;
@@ -86,21 +83,6 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
 	return mtd;
 }
 
-
-/*
- * Allow NOMMU mmap() to directly map the device (if not NULL)
- * - return the address to which the offset maps
- * - return -ENOSYS to indicate refusal to do the mapping
- */
-static unsigned long mapram_unmapped_area(struct mtd_info *mtd,
-					  unsigned long len,
-					  unsigned long offset,
-					  unsigned long flags)
-{
-	struct map_info *map = mtd->priv;
-	return (unsigned long) map->virt + offset;
-}
-
 static int mapram_point(struct mtd_info *mtd, loff_t from, size_t len,
 			size_t *retlen, void **virt, resource_size_t *phys)
 {
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c
index 722afb1cf4..20e3604b4d 100644
--- a/drivers/mtd/chips/map_rom.c
+++ b/drivers/mtd/chips/map_rom.c
@@ -20,8 +20,6 @@ static int maprom_write (struct mtd_info *, loff_t, size_t, size_t *, const u_ch
 static void maprom_nop (struct mtd_info *);
 static struct mtd_info *map_rom_probe(struct map_info *map);
 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
-static unsigned long maprom_unmapped_area(struct mtd_info *, unsigned long,
-					  unsigned long, unsigned long);
 static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len,
 			 size_t *retlen, void **virt, resource_size_t *phys);
 static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
@@ -55,7 +53,6 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
 	mtd->name = map->name;
 	mtd->type = MTD_ROM;
 	mtd->size = map->size;
-	mtd->_get_unmapped_area = maprom_unmapped_area;
 	mtd->_point = maprom_point;
 	mtd->_unpoint = maprom_unpoint;
 	mtd->_read = maprom_read;
@@ -72,19 +69,6 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
 }
 
 
-/*
- * Allow NOMMU mmap() to directly map the device (if not NULL)
- * - return the address to which the offset maps
- * - return -ENOSYS to indicate refusal to do the mapping
- */
-static unsigned long maprom_unmapped_area(struct mtd_info *mtd,
-					  unsigned long len,
-					  unsigned long offset,
-					  unsigned long flags)
-{
-	struct map_info *map = mtd->priv;
-	return (unsigned long) map->virt + offset;
-
 static int maprom_point(struct mtd_info *mtd, loff_t from, size_t len,
 			size_t *retlen, void **virt, resource_size_t *phys)
 {
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index 4418629e8d..0bf4aeaf0c 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -99,19 +99,6 @@ static int ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
 	return 0;
 }
 
-/*
- * Allow NOMMU mmap() to directly map the device (if not NULL)
- * - return the address to which the offset maps
- * - return -ENOSYS to indicate refusal to do the mapping
- */
-static unsigned long ram_get_unmapped_area(struct mtd_info *mtd,
-					   unsigned long len,
-					   unsigned long offset,
-					   unsigned long flags)
-{
-	return (unsigned long) mtd->priv + offset;
-}
-
 static int ram_read(struct mtd_info *mtd, loff_t from, size_t len,
 		size_t *retlen, u_char *buf)
 {
@@ -156,7 +143,6 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
 	mtd->_erase = ram_erase;
 	mtd->_point = ram_point;
 	mtd->_unpoint = ram_unpoint;
-	mtd->_get_unmapped_area = ram_get_unmapped_area;
 	mtd->_read = ram_read;
 	mtd->_write = ram_write;
 
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index d573606b91..60bf53df54 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -644,32 +644,6 @@ static int concat_block_markbad(struct mtd_info *mtd, loff_t ofs)
 }
 
 /*
- * try to support NOMMU mmaps on concatenated devices
- * - we don't support subdev spanning as we can't guarantee it'll work
- */
-static unsigned long concat_get_unmapped_area(struct mtd_info *mtd,
-					      unsigned long len,
-					      unsigned long offset,
-					      unsigned long flags)
-{
-	struct mtd_concat *concat = CONCAT(mtd);
-	int i;
-
-	for (i = 0; i < concat->num_subdev; i++) {
-		struct mtd_info *subdev = concat->subdev[i];
-
-		if (offset >= subdev->size) {
-			offset -= subdev->size;
-			continue;
-		}
-
-		return mtd_get_unmapped_area(subdev, len, offset, flags);
-	}
-
-	return (unsigned long) -ENOSYS;
-}
-
-/*
  * This function constructs a virtual MTD device by concatenating
  * num_devs MTD devices. A pointer to the new device object is
  * stored to *new_dev upon success. This function does _not_
@@ -790,7 +764,6 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[],	/* subdevices to c
 	concat->mtd._unlock = concat_unlock;
 	concat->mtd._suspend = concat_suspend;
 	concat->mtd._resume = concat_resume;
-	concat->mtd._get_unmapped_area = concat_get_unmapped_area;
 
 	/*
 	 * Combine the erase block size info of the subdevices:
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index a308e70739..be088bccd5 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -101,18 +101,6 @@ static int part_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
 	return part->parent->_unpoint(part->parent, from + part->offset, len);
 }
 
-static unsigned long part_get_unmapped_area(struct mtd_info *mtd,
-					    unsigned long len,
-					    unsigned long offset,
-					    unsigned long flags)
-{
-	struct mtd_part *part = mtd_to_part(mtd);
-
-	offset += part->offset;
-	return part->parent->_get_unmapped_area(part->parent, len, offset,
-						flags);
-}
-
 static int part_read_oob(struct mtd_info *mtd, loff_t from,
 		struct mtd_oob_ops *ops)
 {
@@ -458,8 +446,6 @@ static struct mtd_part *allocate_partition(struct mtd_info *parent,
 		slave->mtd._unpoint = part_unpoint;
 	}
 
-	if (parent->_get_unmapped_area)
-		slave->mtd._get_unmapped_area = part_get_unmapped_area;
 	if (parent->_read_oob)
 		slave->mtd._read_oob = part_read_oob;
 	if (parent->_write_oob)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 6cd0f6b765..0a0678a5e6 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -297,10 +297,6 @@ struct mtd_info {
 	int (*_point) (struct mtd_info *mtd, loff_t from, size_t len,
 		       size_t *retlen, void **virt, resource_size_t *phys);
 	int (*_unpoint) (struct mtd_info *mtd, loff_t from, size_t len);
-	unsigned long (*_get_unmapped_area) (struct mtd_info *mtd,
-					     unsigned long len,
-					     unsigned long offset,
-					     unsigned long flags);
 	int (*_read) (struct mtd_info *mtd, loff_t from, size_t len,
 		      size_t *retlen, u_char *buf);
 	int (*_write) (struct mtd_info *mtd, loff_t to, size_t len,
-- 
2.9.5

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

* Re: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
                   ` (4 preceding siblings ...)
  2017-10-17 15:28 ` [PATCH v2 5/5] MTD: remove the get_unmapped_area method Nicolas Pitre
@ 2017-10-24 17:22 ` Nicolas Pitre
  2017-10-25 12:24   ` Richard Weinberger
  2017-10-27 12:06 ` Boris Brezillon
  2017-10-30 18:12 ` Chris Brandt
  7 siblings, 1 reply; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-24 17:22 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger; +Cc: Chris Brandt, linux-mtd


Ping.

On Tue, 17 Oct 2017, Nicolas Pitre wrote:

> This series improves or implements the point and unpoint driver methods
> and reimplements mtd_get_unmapped_area() in terms of those. Because
> mtd->_point() provides a superset of what mtd->_get_unmapped_area() does
> then there is no reason for having both. Or worse: having one but not
> the other.
> 
> This is motivated by my work on XIP cramfs for both MMU and !MMU systems
> where I do need the more complete point functionality. And it just looks
> like the right thing to do.
> 
> This is also available on top of Linux v4.14-rc3 via git here:
> 
>   http://git.linaro.org/people/nicolas.pitre/linux mtd_point
> 
> 
> Changes from v1:
> 
> - Fix retlen computation in mtdram.c:ram_point().
> 
> - Added Richard Weinberger's REviewd-by tags.
> 
> 
> diffstat:
> 
>  drivers/mtd/chips/map_ram.c  | 34 ++++++++++++++++++++--------------
>  drivers/mtd/chips/map_rom.c  | 34 +++++++++++++++++++++-------------
>  drivers/mtd/devices/mtdram.c | 36 ++++++++++++++++++++++--------------
>  drivers/mtd/mtdconcat.c      | 27 ---------------------------
>  drivers/mtd/mtdcore.c        | 17 ++++++++++++-----
>  drivers/mtd/mtdpart.c        | 14 --------------
>  include/linux/mtd/mtd.h      |  4 ----
>  7 files changed, 75 insertions(+), 91 deletions(-)
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
> 

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

* Re: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-24 17:22 ` [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
@ 2017-10-25 12:24   ` Richard Weinberger
  2017-10-25 15:36     ` Nicolas Pitre
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2017-10-25 12:24 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Boris Brezillon, Richard Weinberger, Chris Brandt, linux-mtd

On Tue, Oct 24, 2017 at 7:22 PM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
>
> Ping.

I'm currently at ELCE and not really active.
But your patches are not in /dev/null. :-)

-- 
Thanks,
//richard

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

* Re: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-25 12:24   ` Richard Weinberger
@ 2017-10-25 15:36     ` Nicolas Pitre
  0 siblings, 0 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-25 15:36 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: Boris Brezillon, Richard Weinberger, Chris Brandt, linux-mtd

On Wed, 25 Oct 2017, Richard Weinberger wrote:

> On Tue, Oct 24, 2017 at 7:22 PM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> >
> > Ping.
> 
> I'm currently at ELCE and not really active.
> But your patches are not in /dev/null. :-)

OK, thanks for confirming.  I just want to not miss the next merge 
window as some other patches already queued for mainline rely on those 
MTD patches to work properly.


Nicolas

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

* Re: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
                   ` (5 preceding siblings ...)
  2017-10-24 17:22 ` [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
@ 2017-10-27 12:06 ` Boris Brezillon
  2017-10-27 15:27   ` Nicolas Pitre
  2017-10-30 18:12 ` Chris Brandt
  7 siblings, 1 reply; 16+ messages in thread
From: Boris Brezillon @ 2017-10-27 12:06 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Richard Weinberger, Chris Brandt, linux-mtd

Hi Nicolas,

Some of your commits do not have commit messages (just a subject and
that's all). I know you're an experimented kernel developer and you
might find this superfluous, but we try to push all MTD contributors to
write a commit message, even if it's just a one line description that
basically repeats what the subject line says. Would you mind adding a
short description to patch 2 and 3.

Other than that, the changes look good to me, so

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

On Tue, 17 Oct 2017 11:28:21 -0400
Nicolas Pitre <nicolas.pitre@linaro.org> wrote:

> This series improves or implements the point and unpoint driver methods
> and reimplements mtd_get_unmapped_area() in terms of those. Because
> mtd->_point() provides a superset of what mtd->_get_unmapped_area() does
> then there is no reason for having both. Or worse: having one but not
> the other.
> 
> This is motivated by my work on XIP cramfs for both MMU and !MMU systems
> where I do need the more complete point functionality. And it just looks
> like the right thing to do.
> 
> This is also available on top of Linux v4.14-rc3 via git here:
> 
>   http://git.linaro.org/people/nicolas.pitre/linux mtd_point
> 
> 
> Changes from v1:
> 
> - Fix retlen computation in mtdram.c:ram_point().
> 
> - Added Richard Weinberger's REviewd-by tags.
> 
> 
> diffstat:
> 
>  drivers/mtd/chips/map_ram.c  | 34 ++++++++++++++++++++--------------
>  drivers/mtd/chips/map_rom.c  | 34 +++++++++++++++++++++-------------
>  drivers/mtd/devices/mtdram.c | 36 ++++++++++++++++++++++--------------
>  drivers/mtd/mtdconcat.c      | 27 ---------------------------
>  drivers/mtd/mtdcore.c        | 17 ++++++++++++-----
>  drivers/mtd/mtdpart.c        | 14 --------------
>  include/linux/mtd/mtd.h      |  4 ----
>  7 files changed, 75 insertions(+), 91 deletions(-)
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-27 12:06 ` Boris Brezillon
@ 2017-10-27 15:27   ` Nicolas Pitre
  2017-10-30  8:58     ` Boris Brezillon
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-27 15:27 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: Richard Weinberger, Chris Brandt, linux-mtd

On Fri, 27 Oct 2017, Boris Brezillon wrote:

> Hi Nicolas,
> 
> Some of your commits do not have commit messages (just a subject and
> that's all). I know you're an experimented kernel developer and you
> might find this superfluous, but we try to push all MTD contributors to
> write a commit message, even if it's just a one line description that
> basically repeats what the subject line says. Would you mind adding a
> short description to patch 2 and 3.
> 
> Other than that, the changes look good to me, so
> 
> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

No problem.

I added a one-liner justification to those commits, and your ACK to the 
series.

This has been pushed here if you wish to pull it:

  http://git.linaro.org/people/nicolas.pitre/linux mtd_point

Or if you prefer that I repost the whole thing just say so and I'll 
oblige.

Thanks.


> On Tue, 17 Oct 2017 11:28:21 -0400
> Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> 
> > This series improves or implements the point and unpoint driver methods
> > and reimplements mtd_get_unmapped_area() in terms of those. Because
> > mtd->_point() provides a superset of what mtd->_get_unmapped_area() does
> > then there is no reason for having both. Or worse: having one but not
> > the other.
> > 
> > This is motivated by my work on XIP cramfs for both MMU and !MMU systems
> > where I do need the more complete point functionality. And it just looks
> > like the right thing to do.
> > 
> > This is also available on top of Linux v4.14-rc3 via git here:
> > 
> >   http://git.linaro.org/people/nicolas.pitre/linux mtd_point
> > 
> > 
> > Changes from v1:
> > 
> > - Fix retlen computation in mtdram.c:ram_point().
> > 
> > - Added Richard Weinberger's REviewd-by tags.
> > 
> > 
> > diffstat:
> > 
> >  drivers/mtd/chips/map_ram.c  | 34 ++++++++++++++++++++--------------
> >  drivers/mtd/chips/map_rom.c  | 34 +++++++++++++++++++++-------------
> >  drivers/mtd/devices/mtdram.c | 36 ++++++++++++++++++++++--------------
> >  drivers/mtd/mtdconcat.c      | 27 ---------------------------
> >  drivers/mtd/mtdcore.c        | 17 ++++++++++++-----
> >  drivers/mtd/mtdpart.c        | 14 --------------
> >  include/linux/mtd/mtd.h      |  4 ----
> >  7 files changed, 75 insertions(+), 91 deletions(-)
> > 
> > ______________________________________________________
> > Linux MTD discussion mailing list
> > http://lists.infradead.org/mailman/listinfo/linux-mtd/
> 
> 

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

* Re: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-27 15:27   ` Nicolas Pitre
@ 2017-10-30  8:58     ` Boris Brezillon
  2017-11-03  3:19       ` Nicolas Pitre
  0 siblings, 1 reply; 16+ messages in thread
From: Boris Brezillon @ 2017-10-30  8:58 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Richard Weinberger, Chris Brandt, linux-mtd

Hi Nicolas,

On Fri, 27 Oct 2017 11:27:46 -0400 (EDT)
Nicolas Pitre <nicolas.pitre@linaro.org> wrote:

> On Fri, 27 Oct 2017, Boris Brezillon wrote:
> 
> > Hi Nicolas,
> > 
> > Some of your commits do not have commit messages (just a subject and
> > that's all). I know you're an experimented kernel developer and you
> > might find this superfluous, but we try to push all MTD contributors to
> > write a commit message, even if it's just a one line description that
> > basically repeats what the subject line says. Would you mind adding a
> > short description to patch 2 and 3.
> > 
> > Other than that, the changes look good to me, so
> > 
> > Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>  
> 
> No problem.
> 
> I added a one-liner justification to those commits, and your ACK to the 
> series.
> 
> This has been pushed here if you wish to pull it:
> 
>   http://git.linaro.org/people/nicolas.pitre/linux mtd_point
> 
> Or if you prefer that I repost the whole thing just say so and I'll 
> oblige.

It's easier for us if you repost the whole series (we use patchwork to
track MTD patches, and I like to have the version that hits mainline
available on patchwork too).

Thanks,

Boris

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

* RE: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
                   ` (6 preceding siblings ...)
  2017-10-27 12:06 ` Boris Brezillon
@ 2017-10-30 18:12 ` Chris Brandt
  2017-10-30 18:34   ` Nicolas Pitre
  7 siblings, 1 reply; 16+ messages in thread
From: Chris Brandt @ 2017-10-30 18:12 UTC (permalink / raw)
  To: Nicolas Pitre, Boris Brezillon, Richard Weinberger; +Cc: linux-mtd

On Tuesday, October 17, 2017 1, Nicolas Pitre wrote:
> This series improves or implements the point and unpoint driver methods
> and reimplements mtd_get_unmapped_area() in terms of those. Because
> mtd->_point() provides a superset of what mtd->_get_unmapped_area() does
> then there is no reason for having both. Or worse: having one but not
> the other.
> 
> This is motivated by my work on XIP cramfs for both MMU and !MMU systems
> where I do need the more complete point functionality. And it just looks
> like the right thing to do.
> 
> This is also available on top of Linux v4.14-rc3 via git here:
> 
>   http://git.linaro.org/people/nicolas.pitre/linux mtd_point
> 
> 
> Changes from v1:
> 
> - Fix retlen computation in mtdram.c:ram_point().
> 
> - Added Richard Weinberger's REviewd-by tags.
> 
> 
> diffstat:
> 
>  drivers/mtd/chips/map_ram.c  | 34 ++++++++++++++++++++--------------
>  drivers/mtd/chips/map_rom.c  | 34 +++++++++++++++++++++-------------
>  drivers/mtd/devices/mtdram.c | 36 ++++++++++++++++++++++--------------
>  drivers/mtd/mtdconcat.c      | 27 ---------------------------
>  drivers/mtd/mtdcore.c        | 17 ++++++++++++-----
>  drivers/mtd/mtdpart.c        | 14 --------------
>  include/linux/mtd/mtd.h      |  4 ----
>  7 files changed, 75 insertions(+), 91 deletions(-)

I was able to boot my system with the following kernel options:

  "rootfstype=cramfs root=mtd:rootfs_xipcramfs"

This meant the cramfs image was one where the executable code pages 
remained in flash.


Therefore, for this MTD series, applied on top of the file system series 
"[PATCH v6 0/4] cramfs refresh for embedded usage":

Tested-by: Chris Brandt <chris.brandt@renesas.com>

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

* RE: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-30 18:12 ` Chris Brandt
@ 2017-10-30 18:34   ` Nicolas Pitre
  2017-10-30 18:41     ` Chris Brandt
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Pitre @ 2017-10-30 18:34 UTC (permalink / raw)
  To: Chris Brandt; +Cc: Boris Brezillon, Richard Weinberger, linux-mtd

On Mon, 30 Oct 2017, Chris Brandt wrote:

> I was able to boot my system with the following kernel options:
> 
>   "rootfstype=cramfs root=mtd:rootfs_xipcramfs"
> 
> This meant the cramfs image was one where the executable code pages 
> remained in flash.
> 
> 
> Therefore, for this MTD series, applied on top of the file system series 
> "[PATCH v6 0/4] cramfs refresh for embedded usage":
> 
> Tested-by: Chris Brandt <chris.brandt@renesas.com>

Thanks for testing!


Nicolas

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

* RE: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-30 18:34   ` Nicolas Pitre
@ 2017-10-30 18:41     ` Chris Brandt
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Brandt @ 2017-10-30 18:41 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Boris Brezillon, Richard Weinberger, linux-mtd

On Monday, October 30, 2017, Nicolas Pitre wrote:
> On Mon, 30 Oct 2017, Chris Brandt wrote:
> 
> > I was able to boot my system with the following kernel options:
> >
> >   "rootfstype=cramfs root=mtd:rootfs_xipcramfs"
> >
> > This meant the cramfs image was one where the executable code pages
> > remained in flash.
> >
> >
> > Therefore, for this MTD series, applied on top of the file system series
> > "[PATCH v6 0/4] cramfs refresh for embedded usage":
> >
> > Tested-by: Chris Brandt <chris.brandt@renesas.com>
> 
> Thanks for testing!
> 
> 
> Nicolas


Thank you for implementing!


I've been trying to keep AXFS up to date with recent kernels since it 
was my only solution for an XIP file system, but now that we'll have an 
in-kernel solution, it's not as critical anymore if/when AXFS breaks 
again.


Chris

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

* Re: [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods
  2017-10-30  8:58     ` Boris Brezillon
@ 2017-11-03  3:19       ` Nicolas Pitre
  0 siblings, 0 replies; 16+ messages in thread
From: Nicolas Pitre @ 2017-11-03  3:19 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: Richard Weinberger, Chris Brandt, linux-mtd

On Mon, 30 Oct 2017, Boris Brezillon wrote:

> Hi Nicolas,
> 
> On Fri, 27 Oct 2017 11:27:46 -0400 (EDT)
> Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> 
> > On Fri, 27 Oct 2017, Boris Brezillon wrote:
> > 
> > > Hi Nicolas,
> > > 
> > > Some of your commits do not have commit messages (just a subject and
> > > that's all). I know you're an experimented kernel developer and you
> > > might find this superfluous, but we try to push all MTD contributors to
> > > write a commit message, even if it's just a one line description that
> > > basically repeats what the subject line says. Would you mind adding a
> > > short description to patch 2 and 3.
> > > 
> > > Other than that, the changes look good to me, so
> > > 
> > > Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>  
> > 
> > No problem.
> > 
> > I added a one-liner justification to those commits, and your ACK to the 
> > series.
> > 
> > This has been pushed here if you wish to pull it:
> > 
> >   http://git.linaro.org/people/nicolas.pitre/linux mtd_point
> > 
> > Or if you prefer that I repost the whole thing just say so and I'll 
> > oblige.
> 
> It's easier for us if you repost the whole series (we use patchwork to
> track MTD patches, and I like to have the version that hits mainline
> available on patchwork too).

V3 were posted earlier this week. With the looming merge window I just 
want to confirm everything is fine on your side.

Thanks.


Nicolas

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

end of thread, other threads:[~2017-11-03  3:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 15:28 [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
2017-10-17 15:28 ` [PATCH v2 1/5] MTD: mtdram: properly handle the phys argument in the point method Nicolas Pitre
2017-10-17 15:28 ` [PATCH v2 2/5] MTD: chips/map_ram.c: implement point and unpoint methods Nicolas Pitre
2017-10-17 15:28 ` [PATCH v2 3/5] MTD: chips/map_rom.c: " Nicolas Pitre
2017-10-17 15:28 ` [PATCH v2 4/5] MTD: implement mtd_get_unmapped_area() using the point method Nicolas Pitre
2017-10-17 15:28 ` [PATCH v2 5/5] MTD: remove the get_unmapped_area method Nicolas Pitre
2017-10-24 17:22 ` [PATCH v2 0/5] unconfuse get_unmapped_area and point/unpoint driver methods Nicolas Pitre
2017-10-25 12:24   ` Richard Weinberger
2017-10-25 15:36     ` Nicolas Pitre
2017-10-27 12:06 ` Boris Brezillon
2017-10-27 15:27   ` Nicolas Pitre
2017-10-30  8:58     ` Boris Brezillon
2017-11-03  3:19       ` Nicolas Pitre
2017-10-30 18:12 ` Chris Brandt
2017-10-30 18:34   ` Nicolas Pitre
2017-10-30 18:41     ` Chris Brandt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.