linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* pxa2xx-flash.c
@ 2011-12-02 14:40 Anders Mørk-Pedersen
  2011-12-04 14:29 ` pxa2xx-flash.c Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Anders Mørk-Pedersen @ 2011-12-02 14:40 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

Hi,

I've noticed a problem with a patch for the pxa2xx-flash.c map, which has been committed to the nextline kernel (currently 3.2-rc3)

The problem is that hardcoded mtd partitions are no longer probed - and that breaks a lot of board support modules.

The patch is described as 
"mtd: pxa2xx-flash.c: use mtd_device_parse_register"

and can be seen here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=6fcdc92fce81eadcee262a7a66bf3207314fab87

I have created a small patch to address this.

Best regards
Anders Mork-Pedersen <amp@frogne.dk>
Finn Frogne A/S


[-- Attachment #2: pxa2xx-flash-hardcoded_partitions.patch --]
[-- Type: text/plain, Size: 894 bytes --]

diff -Nur linux-3.2-rc3/drivers/mtd/maps//pxa2xx-flash.c linux-3.2-rc3_patched/drivers/mtd/maps//pxa2xx-flash.c
--- linux-3.2-rc3/drivers/mtd/maps//pxa2xx-flash.c	2011-11-24 05:20:28.000000000 +0100
+++ linux-3.2-rc3_patched/drivers/mtd/maps//pxa2xx-flash.c	2011-12-02 12:50:38.000000000 +0100
@@ -54,6 +54,7 @@
 	struct flash_platform_data *flash = pdev->dev.platform_data;
 	struct pxa2xx_flash_info *info;
 	struct resource *res;
+	struct mtd_part_parser_data	ppdata;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -98,7 +99,10 @@
 	}
 	info->mtd->owner = THIS_MODULE;
 
-	mtd_device_parse_register(info->mtd, probes, 0, NULL, 0);
+	ppdata.of_node = pdev->dev.of_node;
+	mtd_device_parse_register(info->mtd, probes, &ppdata,
+			flash ? flash->parts : NULL,
+			flash ? flash->nr_parts : 0);
 
 	platform_set_drvdata(pdev, info);
 	return 0;

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

* Re: pxa2xx-flash.c
  2011-12-02 14:40 pxa2xx-flash.c Anders Mørk-Pedersen
@ 2011-12-04 14:29 ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2011-12-04 14:29 UTC (permalink / raw)
  To: Anders Mørk-Pedersen; +Cc: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

On Fri, 2011-12-02 at 15:40 +0100, Anders Mørk-Pedersen wrote:
> Hi,
> 
> I've noticed a problem with a patch for the pxa2xx-flash.c map, which has been committed to the nextline kernel (currently 3.2-rc3)
> 
> The problem is that hardcoded mtd partitions are no longer probed - and that breaks a lot of board support modules.
> 
> The patch is described as 
> "mtd: pxa2xx-flash.c: use mtd_device_parse_register"
> 
> and can be seen here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=6fcdc92fce81eadcee262a7a66bf3207314fab87
> 
> I have created a small patch to address this.

Looks OK, but could you please send a patch suitable for 'git am'? So
that I save your mail and give it to git-am and end up with a commit
which has you as the author, and a nice commit message. Also, please, CC
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com

Thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: pxa2xx-flash.c
  2011-12-05  7:05 pxa2xx-flash.c Anders Mørk-Pedersen
@ 2011-12-06 12:07 ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2011-12-06 12:07 UTC (permalink / raw)
  To: Anders Mørk-Pedersen; +Cc: linux-mtd

On Mon, 2011-12-05 at 08:05 +0100, Anders Mørk-Pedersen wrote:
> I have done as you instructed and created a patch for "git am" and
> attached it to this mail.
> 
> I've also sent a copy to: Dmitry Eremin-Solenikov
> <dbaryshkov@gmail.com>

Hi, I've just noticed that I already have this patch in my tree
which fixes your problem:

commit 84c692b1f408be52eb0f8ad2ce130b7800130a0c
Author: Jonathan Cameron <jic23@cam.ac.uk>
Date:   Fri Nov 11 17:06:20 2011 +0000

    mtd: pxa2xx-flash.c: It used to fall back to provided table.
    
    Make this work again.
    
    Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
    Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>

diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 411a17d..2a25b67 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -98,7 +98,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
        }
        info->mtd->owner = THIS_MODULE;
 
-       mtd_device_parse_register(info->mtd, probes, 0, NULL, 0);
+       mtd_device_parse_register(info->mtd, probes, 0, flash->parts, flash->nr_parts);
 
        platform_set_drvdata(pdev, info);
        return 0;

Artem.

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

* pxa2xx-flash.c
@ 2011-12-05  7:05 Anders Mørk-Pedersen
  2011-12-06 12:07 ` pxa2xx-flash.c Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Anders Mørk-Pedersen @ 2011-12-05  7:05 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

I have done as you instructed and created a patch for "git am" and
attached it to this mail.

I've also sent a copy to: Dmitry Eremin-Solenikov
<dbaryshkov@gmail.com>

Best regards
Anders


On Fri, 2011-12-02 at 15:40 +0100, Anders Mørk-Pedersen wrote:
> Hi,
> 
> I've noticed a problem with a patch for the pxa2xx-flash.c map, which
has been committed to the nextline kernel (currently 3.2-rc3)
> 
> The problem is that hardcoded mtd partitions are no longer probed -
and that breaks a lot of board support modules.
> 
> The patch is described as 
> "mtd: pxa2xx-flash.c: use mtd_device_parse_register"
> 
> and can be seen here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=6fcdc92fce81eadcee262a7a66bf3207314fab87
> 
> I have created a small patch to address this.

Looks OK, but could you please send a patch suitable for 'git am'? So
that I save your mail and give it to git-am and end up with a commit
which has you as the author, and a nice commit message. Also, please,
CC
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com

Thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: 0001-Enables-the-mtd-driver-to-use-hardcoded-partitions.patch --]
[-- Type: text/plain, Size: 1708 bytes --]

>From 4e2507e892c8ccb3726a549e52ffcafe7c477fae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Anders=20M=C3=B8rk-Pedersen?= <amp@frogne.dk>
Date: Mon, 5 Dec 2011 07:42:07 +0100
Subject: [PATCH] Enables the mtd-driver to use hardcoded partitions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

After the pxa2xx-flash driver was updated to use the mtd_device_parse_register interface (6fcdc92fce81eadce...), it has not been possible to define the partition layout in the board support package - as is often seen done. This breaks support for many pxa2xx-boards.

Signed-off-by: Anders Mørk-Pedersen <amp@frogne.dk>
---
 drivers/mtd/maps/pxa2xx-flash.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 411a17d..37709a6 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -54,6 +54,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
 	struct flash_platform_data *flash = pdev->dev.platform_data;
 	struct pxa2xx_flash_info *info;
 	struct resource *res;
+	struct mtd_part_parser_data	ppdata;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -98,7 +99,10 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
 	}
 	info->mtd->owner = THIS_MODULE;
 
-	mtd_device_parse_register(info->mtd, probes, 0, NULL, 0);
+	ppdata.of_node = pdev->dev.of_node;
+	mtd_device_parse_register(info->mtd, probes, &ppdata,
+			flash ? flash->parts : NULL,
+			flash ? flash->nr_parts : 0);
 
 	platform_set_drvdata(pdev, info);
 	return 0;
-- 
1.7.1


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

end of thread, other threads:[~2011-12-06 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-02 14:40 pxa2xx-flash.c Anders Mørk-Pedersen
2011-12-04 14:29 ` pxa2xx-flash.c Artem Bityutskiy
2011-12-05  7:05 pxa2xx-flash.c Anders Mørk-Pedersen
2011-12-06 12:07 ` pxa2xx-flash.c Artem Bityutskiy

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).