Patchwork MTD: MIPS: lantiq: reintroduce support for cmdline partitions

login
register
mail settings
Submitter John Crispin
Date Feb. 23, 2012, 4:59 p.m.
Message ID <1330016389-20973-1-git-send-email-blogic@openwrt.org>
Download mbox | patch
Permalink /patch/142674/
State New
Headers show

Comments

John Crispin - Feb. 23, 2012, 4:59 p.m.
From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>

Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the
command line parsing of MTD partitions does not work anymore.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/mtd/maps/lantiq-flash.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Artem Bityutskiy - March 9, 2012, 8:40 a.m.
On Thu, 2012-02-23 at 17:59 +0100, John Crispin wrote:
> From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> 
> Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the
> command line parsing of MTD partitions does not work anymore.
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> Signed-off-by: John Crispin <blogic@openwrt.org>


I would like to compile-test this patch. I've got this error when
compiling with mips-linux-gcc-4.6.0 and the attached defconfig:

                 from include/linux/sched.h:55,
                 from arch/mips/kernel/asm-offsets.c:13:
include/linux/bitops.h: In function 'hweight_long':
include/linux/bitops.h:55:26: warning: signed and unsigned type in conditional expression [-Wsign-compare]
arch/mips/kernel/asm-offsets.c: At top level:
arch/mips/kernel/asm-offsets.c:21:6: warning: no previous prototype for 'output_ptreg_defines' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:76:6: warning: no previous prototype for 'output_task_defines' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:88:6: warning: no previous prototype for 'output_thread_info_defines' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:105:6: warning: no previous prototype for 'output_thread_defines' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:136:6: warning: no previous prototype for 'output_thread_fpu_defines' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:175:6: warning: no previous prototype for 'output_mm_defines' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:211:6: warning: no previous prototype for 'output_sc_defines' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:257:6: warning: no previous prototype for 'output_signal_defined' [-Wmissing-prototypes]
arch/mips/kernel/asm-offsets.c:295:6: warning: no previous prototype for 'output_irq_cpustat_t_defines' [-Wmissing-prototypes]
In file included from include/linux/kernel.h:17:0,
                 from arch/mips/kernel/cpu-probe.c:15:
include/linux/bitops.h: In function 'hweight_long':
include/linux/bitops.h:55:26: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
arch/mips/kernel/cpu-probe.c: At top level:
arch/mips/kernel/cpu-probe.c:64:6: error: no previous prototype for 'r4k_wait_irqoff' [-Werror=missing-prototypes]
arch/mips/kernel/cpu-probe.c:154:13: error: no previous prototype for 'check_wait' [-Werror=missing-prototypes]
cc1: all warnings being treated as errors

I use W=1 when compiling. Any suggestions?
John Crispin - March 9, 2012, 8:58 a.m.
On 09/03/12 09:40, Artem Bityutskiy wrote:
> On Thu, 2012-02-23 at 17:59 +0100, John Crispin wrote:
>> From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
>>
>> Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the
>> command line parsing of MTD partitions does not work anymore.
>>
>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
>> Signed-off-by: John Crispin <blogic@openwrt.org>
>

Hi Artem,

i have tested this patch using arch/mips/configs/xway_defconfig and
gcc4.6+linaro

i will try a build with your config in a moment

which git-tree are you building on top of ?

thanks,
John
Artem Bityutskiy - March 9, 2012, 9:08 a.m.
On Fri, 2012-03-09 at 09:58 +0100, John Crispin wrote:
> On 09/03/12 09:40, Artem Bityutskiy wrote:
> > On Thu, 2012-02-23 at 17:59 +0100, John Crispin wrote:
> >> From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> >>
> >> Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the
> >> command line parsing of MTD partitions does not work anymore.
> >>
> >> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> >> Signed-off-by: John Crispin <blogic@openwrt.org>
> >
> 
> Hi Artem,
> 
> i have tested this patch using arch/mips/configs/xway_defconfig and
> gcc4.6+linaro
> 
> i will try a build with your config in a moment
> 
> which git-tree are you building on top of ?

l2-mtd.git: http://git.infradead.org/users/dedekind/l2-mtd.git
John Crispin - March 9, 2012, 10:59 a.m.
On 09/03/12 09:40, Artem Bityutskiy wrote:
> I would like to compile-test this patch. I've got this error when
> compiling with mips-linux-gcc-4.6.0 and the attached defconfig:
>
>                  from include/linux/sched.h:55,
>                  from arch/mips/kernel/asm-offsets.c:13:
> include/linux/bitops.h: In function 'hweight_long':
> include/linux/bitops.h:55:26: warning: signed and unsigned type in conditional expression [-Wsign-compare]
> arch/mips/kernel/asm-offsets.c: At top level:
> arch/mips/kernel/asm-offsets.c:21:6: warning: no previous prototype for 'output_ptreg_defines' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:76:6: warning: no previous prototype for 'output_task_defines' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:88:6: warning: no previous prototype for 'output_thread_info_defines' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:105:6: warning: no previous prototype for 'output_thread_defines' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:136:6: warning: no previous prototype for 'output_thread_fpu_defines' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:175:6: warning: no previous prototype for 'output_mm_defines' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:211:6: warning: no previous prototype for 'output_sc_defines' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:257:6: warning: no previous prototype for 'output_signal_defined' [-Wmissing-prototypes]
> arch/mips/kernel/asm-offsets.c:295:6: warning: no previous prototype for 'output_irq_cpustat_t_defines' [-Wmissing-prototypes]
> In file included from include/linux/kernel.h:17:0,
>                  from arch/mips/kernel/cpu-probe.c:15:
> include/linux/bitops.h: In function 'hweight_long':
> include/linux/bitops.h:55:26: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
> arch/mips/kernel/cpu-probe.c: At top level:
> arch/mips/kernel/cpu-probe.c:64:6: error: no previous prototype for 'r4k_wait_irqoff' [-Werror=missing-prototypes]
> arch/mips/kernel/cpu-probe.c:154:13: error: no previous prototype for 'check_wait' [-Werror=missing-prototypes]
> cc1: all warnings being treated as errors
>
> I use W=1 when compiling. Any suggestions?

Hi,

just tried 4.5 where the same happens. The errors don't seem to have
been introduced by 4.6.

apart from that the -Werror is set by arch/mips/ as follows
bcm63xx/boards/Makefile:ccflags-y := -Werror
fw/arc/Makefile:ccflags-y                       := -Werror
jz4740/Makefile:ccflags-y := -Werror -Wall
Kbuild:subdir-ccflags-y := -Werror
oprofile/Makefile:ccflags-y := -Werror
pmc-sierra/yosemite/Makefile:ccflags-y := -Werror
powertv/asic/Makefile:ccflags-y := -Wall -Werror
powertv/pci/Makefile:ccflags-y := -Wall -Werror

There seems to be some need to clean this up.
I guess for now you will need to drop the W=1 to build an image.

I will talk to Ralf about this.

Thanks,
John
Artem Bityutskiy - March 9, 2012, 11:09 a.m.
On Fri, 2012-03-09 at 09:58 +0100, John Crispin wrote:
> i have tested this patch using arch/mips/configs/xway_defconfig and

This defconfig is not in upstream AFAICS.
Artem Bityutskiy - March 9, 2012, 11:16 a.m.
On Fri, 2012-03-09 at 11:59 +0100, John Crispin wrote:
> On 09/03/12 09:40, Artem Bityutskiy wrote:
> > I would like to compile-test this patch. I've got this error when
> > compiling with mips-linux-gcc-4.6.0 and the attached defconfig:
> >
> >                  from include/linux/sched.h:55,
> >                  from arch/mips/kernel/asm-offsets.c:13:
> > include/linux/bitops.h: In function 'hweight_long':
> > include/linux/bitops.h:55:26: warning: signed and unsigned type in conditional expression [-Wsign-compare]
> > arch/mips/kernel/asm-offsets.c: At top level:
> > arch/mips/kernel/asm-offsets.c:21:6: warning: no previous prototype for 'output_ptreg_defines' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:76:6: warning: no previous prototype for 'output_task_defines' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:88:6: warning: no previous prototype for 'output_thread_info_defines' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:105:6: warning: no previous prototype for 'output_thread_defines' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:136:6: warning: no previous prototype for 'output_thread_fpu_defines' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:175:6: warning: no previous prototype for 'output_mm_defines' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:211:6: warning: no previous prototype for 'output_sc_defines' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:257:6: warning: no previous prototype for 'output_signal_defined' [-Wmissing-prototypes]
> > arch/mips/kernel/asm-offsets.c:295:6: warning: no previous prototype for 'output_irq_cpustat_t_defines' [-Wmissing-prototypes]
> > In file included from include/linux/kernel.h:17:0,
> >                  from arch/mips/kernel/cpu-probe.c:15:
> > include/linux/bitops.h: In function 'hweight_long':
> > include/linux/bitops.h:55:26: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
> > arch/mips/kernel/cpu-probe.c: At top level:
> > arch/mips/kernel/cpu-probe.c:64:6: error: no previous prototype for 'r4k_wait_irqoff' [-Werror=missing-prototypes]
> > arch/mips/kernel/cpu-probe.c:154:13: error: no previous prototype for 'check_wait' [-Werror=missing-prototypes]
> > cc1: all warnings being treated as errors
> >
> > I use W=1 when compiling. Any suggestions?
> 
> Hi,
> 
> just tried 4.5 where the same happens. The errors don't seem to have
> been introduced by 4.6.
> 
> apart from that the -Werror is set by arch/mips/ as follows
> bcm63xx/boards/Makefile:ccflags-y := -Werror
> fw/arc/Makefile:ccflags-y                       := -Werror
> jz4740/Makefile:ccflags-y := -Werror -Wall
> Kbuild:subdir-ccflags-y := -Werror
> oprofile/Makefile:ccflags-y := -Werror
> pmc-sierra/yosemite/Makefile:ccflags-y := -Werror
> powertv/asic/Makefile:ccflags-y := -Wall -Werror
> powertv/pci/Makefile:ccflags-y := -Wall -Werror
> 
> There seems to be some need to clean this up.
> I guess for now you will need to drop the W=1 to build an image.

I believe mips should either fix all warnings or remove -Werror. Indeed,
I have build-check scripts which work fine for many architectures with
W=1, but not for mips, and from my POW introducing exceptions for mips
is inconsistent.
Artem Bityutskiy - March 9, 2012, 11:27 a.m.
On Thu, 2012-02-23 at 17:59 +0100, John Crispin wrote:
> From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> 
> Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the
> command line parsing of MTD partitions does not work anymore.
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> Signed-off-by: John Crispin <blogic@openwrt.org>

Pushed to l2-mtd.git and added:
Cc: stable@kernel.org [3.2+]

since this is a regression. Please, confirm that CCing the stable tree
is fine with you.

Thanks!
John Crispin - March 9, 2012, 11:29 a.m.
On 09/03/12 12:27, Artem Bityutskiy wrote:
> On Thu, 2012-02-23 at 17:59 +0100, John Crispin wrote:
>> From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
>>
>> Since commit ca97dec2ab5c87e9fbdf7e882e1820004a3966fa the
>> command line parsing of MTD partitions does not work anymore.
>>
>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
>> Signed-off-by: John Crispin <blogic@openwrt.org>
> Pushed to l2-mtd.git and added:
> Cc: stable@kernel.org [3.2+]
>
> since this is a regression. Please, confirm that CCing the stable tree
> is fine with you.
Acked-by: John Crispin <blogic@openwrt.org>

Patch

diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
index 395ebfe..ccc6954 100644
--- a/drivers/mtd/maps/lantiq-flash.c
+++ b/drivers/mtd/maps/lantiq-flash.c
@@ -45,6 +45,7 @@  struct ltq_mtd {
 };
 
 static char ltq_map_name[] = "ltq_nor";
+static const char *ltq_probe_types[] __devinitconst = { "cmdlinepart", NULL };
 
 static map_word
 ltq_read16(struct map_info *map, unsigned long adr)
@@ -168,7 +169,7 @@  ltq_mtd_probe(struct platform_device *pdev)
 	cfi->addr_unlock1 ^= 1;
 	cfi->addr_unlock2 ^= 1;
 
-	err = mtd_device_parse_register(ltq_mtd->mtd, NULL, 0,
+	err = mtd_device_parse_register(ltq_mtd->mtd, ltq_probe_types, 0,
 			ltq_mtd_data->parts, ltq_mtd_data->nr_parts);
 	if (err) {
 		dev_err(&pdev->dev, "failed to add partitions\n");