[PATCH 0/2] splitting UBI: replace MTD_UBI_BEB_LIMIT with user-space parameter

2012-08-16 Thread Richard Genoud
Artem, Here are the 2 patches you requested in place of [PATCH 4/4] UBI: replace MTD_UBI_BEB_LIMIT with user-space parameter I made some changes to correct some things that Shmulik pointed out: * max_beb_per1024 is now an unsigned. * ubi_mtd_param_parse can fail on kstrtouint error. Richard

[PATCH 2/2] UBI: add ioctl for max_beb_per1024

2012-08-16 Thread Richard Genoud
a kernel parameter, now we can also use UBI_IOCATT ioctl: struct ubi_attach_req { __s32 ubi_num; __s32 mtd_num; __s32 vid_hdr_offset; __u8 max_beb_per1024; __s8 padding[11]; }; Signed-off-by: Richard Genoud richard.gen...@gmail.com --- drivers/mtd/ubi/cdev.c

[PATCH 1/2] UBI: replace MTD_UBI_BEB_LIMIT with module parameter

2012-08-16 Thread Richard Genoud
|num|path[,vid_hdr_offs[,max_beb_per1024]] Signed-off-by: Richard Genoud richard.gen...@gmail.com --- arch/arm/configs/sam9_l9260_defconfig |1 - drivers/mtd/ubi/Kconfig | 26 - drivers/mtd/ubi/build.c | 93 ++--- drivers/mtd

[PATCH] UBI: use a config value for default BEB limit

2012-08-16 Thread Richard Genoud
-by: Richard Genoud richard.gen...@gmail.com --- arch/arm/configs/sam9_l9260_defconfig |1 + drivers/mtd/ubi/Kconfig | 29 + drivers/mtd/ubi/ubi.h |2 +- 3 files changed, 31 insertions(+), 1 deletions(-) diff --git a/arch/arm

[PATCH] trivial: pinctrl core: remove extraneous code lines

2012-08-10 Thread Richard Genoud
-by: Richard Genoud --- drivers/pinctrl/core.c | 10 ++ 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index fb7f3be..7365d46 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -657,11 +657,7 @@ static struct

[PATCH] Pinctrl header: trivial: declare struct device

2012-08-10 Thread Richard Genoud
As struct device is used as a function argument, it should at least be declared (device.h is not included). Signed-off-by: Richard Genoud --- include/linux/pinctrl/consumer.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/pinctrl/consumer.h b/include

[PATCH] Pinctrl header: trivial: declare struct device

2012-08-10 Thread Richard Genoud
As struct device is used as a function argument, it should at least be declared (device.h is not included). Signed-off-by: Richard Genoud richard.gen...@gmail.com --- include/linux/pinctrl/consumer.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/pinctrl

[PATCH] trivial: pinctrl core: remove extraneous code lines

2012-08-10 Thread Richard Genoud
-by: Richard Genoud richard.gen...@gmail.com --- drivers/pinctrl/core.c | 10 ++ 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index fb7f3be..7365d46 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -657,11

Re: [PATCH 3/4] UBI: use the whole MTD device size to get bad_peb_limit

2012-07-18 Thread Richard Genoud
2012/7/18 Artem Bityutskiy : > On Tue, 2012-07-10 at 18:23 +0200, Richard Genoud wrote: >> >> The Kconfig option is in per1024 blocks, thus it can have a default >> value of 20 which is *very* common for NAND devices. > > Why do you prefer per1024? I'd make it cent

Re: [PATCH 3/4] UBI: use the whole MTD device size to get bad_peb_limit

2012-07-18 Thread Richard Genoud
2012/7/18 Artem Bityutskiy dedeki...@gmail.com: On Tue, 2012-07-10 at 18:23 +0200, Richard Genoud wrote: The Kconfig option is in per1024 blocks, thus it can have a default value of 20 which is *very* common for NAND devices. Why do you prefer per1024? I'd make it centi-percent instead

[PATCH 1/4] mtd_is_partition: struct mtd_info should be const

2012-07-10 Thread Richard Genoud
struct mtd_info is not modified by mtd_is_partition so it should be a const. Signed-off-by: Richard Genoud --- drivers/mtd/mtdpart.c |2 +- include/linux/mtd/partitions.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd

[PATCH 3/4] UBI: use the whole MTD device size to get bad_peb_limit

2012-07-10 Thread Richard Genoud
ave a default value of 20 which is *very* common for NAND devices. Signed-off-by: Richard Genoud --- drivers/mtd/ubi/Kconfig | 14 ++ drivers/mtd/ubi/build.c | 17 ++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/

[PATCH 4/4] UBI: replace MTD_UBI_BEB_LIMIT with user-space parameter

2012-07-10 Thread Richard Genoud
r: ubi.mtd=[,[,max_beb_per1024]] and via UBI_IOCATT ioctl which is now: struct ubi_attach_req { __s32 ubi_num; __s32 mtd_num; __s32 vid_hdr_offset; __u8 max_beb_per1024; __s8 padding[11]; }; Signed-off-by: Richard Genoud --- drivers/mtd/ubi/Kcon

[PATCH] ubiattach: introduce max_beb_per1024 in UBI_IOCATT

2012-07-10 Thread Richard Genoud
appear every where on a flash device, in the worst case scenario they can all appear in one MTD partition. So the maximum number of expected erase blocks given by the NAND manufacturer should be reserve on each MTD partition. Signed-off-by: Richard Genoud --- include/mtd/ubi-user.h

[PATCH 2/4] MTD parts: introduce mtd_get_device_size()

2012-07-10 Thread Richard Genoud
mtd_get_device_size() returns the size of the whole MTD device, that is the mtd_info master size. This is used by UBI to calculate the maximum number of bad blocks (MBB) on a MTD device. Signed-off-by: Richard Genoud --- drivers/mtd/mtdpart.c | 14 ++ include/linux/mtd

[PATCH 0/4] UBI: Use the whole NAND device to calculate max bad block number

2012-07-10 Thread Richard Genoud
hen, patch 4 replace this option with user-space parameters (kernel parameter and a UBI_IOCATT ioctl) The patch on mtd-utils follows the serie. Richard Genoud (4): mtd_is_partition: struct mtd_info should be const MTD parts: introduce mtd_get_device_size() UBI: use the whole MTD device s

[PATCH 0/4] UBI: Use the whole NAND device to calculate max bad block number

2012-07-10 Thread Richard Genoud
replace this option with user-space parameters (kernel parameter and a UBI_IOCATT ioctl) The patch on mtd-utils follows the serie. Richard Genoud (4): mtd_is_partition: struct mtd_info should be const MTD parts: introduce mtd_get_device_size() UBI: use the whole MTD device size to get

[PATCH 2/4] MTD parts: introduce mtd_get_device_size()

2012-07-10 Thread Richard Genoud
mtd_get_device_size() returns the size of the whole MTD device, that is the mtd_info master size. This is used by UBI to calculate the maximum number of bad blocks (MBB) on a MTD device. Signed-off-by: Richard Genoud richard.gen...@gmail.com --- drivers/mtd/mtdpart.c | 14

[PATCH] ubiattach: introduce max_beb_per1024 in UBI_IOCATT

2012-07-10 Thread Richard Genoud
on a flash device, in the worst case scenario they can all appear in one MTD partition. So the maximum number of expected erase blocks given by the NAND manufacturer should be reserve on each MTD partition. Signed-off-by: Richard Genoud richard.gen...@gmail.com --- include/mtd/ubi-user.h

[PATCH 4/4] UBI: replace MTD_UBI_BEB_LIMIT with user-space parameter

2012-07-10 Thread Richard Genoud
|num|path[,vid_hdr_offs[,max_beb_per1024]] and via UBI_IOCATT ioctl which is now: struct ubi_attach_req { __s32 ubi_num; __s32 mtd_num; __s32 vid_hdr_offset; __u8 max_beb_per1024; __s8 padding[11]; }; Signed-off-by: Richard Genoud richard.gen...@gmail.com

[PATCH 3/4] UBI: use the whole MTD device size to get bad_peb_limit

2012-07-10 Thread Richard Genoud
a default value of 20 which is *very* common for NAND devices. Signed-off-by: Richard Genoud richard.gen...@gmail.com --- drivers/mtd/ubi/Kconfig | 14 ++ drivers/mtd/ubi/build.c | 17 ++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/ubi

[PATCH 1/4] mtd_is_partition: struct mtd_info should be const

2012-07-10 Thread Richard Genoud
struct mtd_info is not modified by mtd_is_partition so it should be a const. Signed-off-by: Richard Genoud richard.gen...@gmail.com --- drivers/mtd/mtdpart.c |2 +- include/linux/mtd/partitions.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd

Re: [PATCH 2/5] ubi: Limit amount of reserved eraseblocks for bad PEB handling

2012-07-09 Thread Richard Genoud
2012/7/4 Shmulik Ladkani : > diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c > index f6a7d7a..e9dcb83 100644 > --- a/drivers/mtd/ubi/misc.c > +++ b/drivers/mtd/ubi/misc.c > @@ -98,10 +98,18 @@ int ubi_check_volume(struct ubi_device *ubi, int vol_id) > */ > void

Re: [PATCH 0/5] ubi: Fix bad PEBs reserve caclulation

2012-07-09 Thread Richard Genoud
2012/7/7 Shmulik Ladkani : > Many thanks for testing. > > Could you please verify the crash only occurs with the patch? > > Can you provide the vmlinux matching this oops, so I may analyze the > exact null dereferencing point? > It seems to be somewhere in ubi_wl_init, however the patch seems not

Re: [PATCH 0/5] ubi: Fix bad PEBs reserve caclulation

2012-07-09 Thread Richard Genoud
2012/7/7 Shmulik Ladkani shmulik.ladk...@gmail.com: Many thanks for testing. Could you please verify the crash only occurs with the patch? Can you provide the vmlinux matching this oops, so I may analyze the exact null dereferencing point? It seems to be somewhere in ubi_wl_init, however

Re: [PATCH 2/5] ubi: Limit amount of reserved eraseblocks for bad PEB handling

2012-07-09 Thread Richard Genoud
2012/7/4 Shmulik Ladkani shmulik.ladk...@gmail.com: diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c index f6a7d7a..e9dcb83 100644 --- a/drivers/mtd/ubi/misc.c +++ b/drivers/mtd/ubi/misc.c @@ -98,10 +98,18 @@ int ubi_check_volume(struct ubi_device *ubi, int vol_id) */ void

Re: [PATCH 0/5] ubi: Fix bad PEBs reserve caclulation

2012-07-07 Thread Richard Genoud
2012/7/7 Shmulik Ladkani : > Many thanks for testing. > > Could you please verify the crash only occurs with the patch? > > Can you provide the vmlinux matching this oops, so I may analyze the > exact null dereferencing point? > It seems to be somewhere in ubi_wl_init, however the patch seems not

Re: [PATCH 0/5] ubi: Fix bad PEBs reserve caclulation

2012-07-07 Thread Richard Genoud
2012/7/7 Shmulik Ladkani shmulik.ladk...@gmail.com: Many thanks for testing. Could you please verify the crash only occurs with the patch? Can you provide the vmlinux matching this oops, so I may analyze the exact null dereferencing point? It seems to be somewhere in ubi_wl_init, however

Re: [PATCH 0/5] ubi: Fix bad PEBs reserve caclulation

2012-07-06 Thread Richard Genoud
I've got an oops... this is my dev-kernel in 3.5-rc5 + some work to be able to boot on my board NB: If I use ubi_format it's ok. the mtd1 device has 1984 PEB the 4 last are UBI reserved + BBT I didn't test without your patch, but anyway something is wrong there. # flash_erase /dev/mtd1 0 1980

Re: [PATCH 0/5] ubi: Fix bad PEBs reserve caclulation

2012-07-06 Thread Richard Genoud
I've got an oops... this is my dev-kernel in 3.5-rc5 + some work to be able to boot on my board NB: If I use ubi_format it's ok. the mtd1 device has 1984 PEB the 4 last are UBI reserved + BBT I didn't test without your patch, but anyway something is wrong there. # flash_erase /dev/mtd1 0 1980

<    4   5   6   7   8   9