* [PATCH 1/2] mtd: tests: don't use mtd0 as a default
@ 2011-10-25 9:09 Wolfram Sang
2011-10-25 9:09 ` [PATCH 2/2] mtd: mark tests EXPERIMENTAL Wolfram Sang
` (3 more replies)
0 siblings, 4 replies; 21+ messages in thread
From: Wolfram Sang @ 2011-10-25 9:09 UTC (permalink / raw)
To: linux-mtd; +Cc: Roland Kletzing, Wolfram Sang, Artem Bityutskiy
mtd tests may erase the mtd device, so force the user to specify which
mtd device to test by using the module parameter. Disable the default
(using mtd0) since this may destroy a vital part of the flash if the
module is inserted accidently or carelessly.
Reported-by: Roland Kletzing <devzero@web.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
drivers/mtd/tests/mtd_oobtest.c | 2 +-
drivers/mtd/tests/mtd_pagetest.c | 2 +-
drivers/mtd/tests/mtd_readtest.c | 2 +-
drivers/mtd/tests/mtd_speedtest.c | 2 +-
drivers/mtd/tests/mtd_stresstest.c | 2 +-
drivers/mtd/tests/mtd_subpagetest.c | 2 +-
drivers/mtd/tests/mtd_torturetest.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
index dec92ae..ff77b8e 100644
--- a/drivers/mtd/tests/mtd_oobtest.c
+++ b/drivers/mtd/tests/mtd_oobtest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_oobtest: "
-static int dev;
+static int dev = -1;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c
index 00b937e..0b4db4e 100644
--- a/drivers/mtd/tests/mtd_pagetest.c
+++ b/drivers/mtd/tests/mtd_pagetest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_pagetest: "
-static int dev;
+static int dev = -1;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index afe71aa..1a285c4 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_readtest: "
-static int dev;
+static int dev = -1;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c
index 627d4e2..71c9457 100644
--- a/drivers/mtd/tests/mtd_speedtest.c
+++ b/drivers/mtd/tests/mtd_speedtest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_speedtest: "
-static int dev;
+static int dev = -1;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c
index 531625f..38bba93 100644
--- a/drivers/mtd/tests/mtd_stresstest.c
+++ b/drivers/mtd/tests/mtd_stresstest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_stresstest: "
-static int dev;
+static int dev = -1;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c
index 334eae5..6140be7 100644
--- a/drivers/mtd/tests/mtd_subpagetest.c
+++ b/drivers/mtd/tests/mtd_subpagetest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_subpagetest: "
-static int dev;
+static int dev = -1;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c
index 5c6c3d2..f339185 100644
--- a/drivers/mtd/tests/mtd_torturetest.c
+++ b/drivers/mtd/tests/mtd_torturetest.c
@@ -46,7 +46,7 @@ static int pgcnt;
module_param(pgcnt, int, S_IRUGO);
MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)");
-static int dev;
+static int dev = -1;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
--
1.7.6.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH 2/2] mtd: mark tests EXPERIMENTAL
2011-10-25 9:09 [PATCH 1/2] mtd: tests: don't use mtd0 as a default Wolfram Sang
@ 2011-10-25 9:09 ` Wolfram Sang
2011-10-29 20:30 ` Artem Bityutskiy
2011-10-25 11:34 ` [PATCH 1/2] mtd: tests: don't use mtd0 as a default Artem Bityutskiy
` (2 subsequent siblings)
3 siblings, 1 reply; 21+ messages in thread
From: Wolfram Sang @ 2011-10-25 9:09 UTC (permalink / raw)
To: linux-mtd; +Cc: Roland Kletzing, Wolfram Sang, Artem Bityutskiy
The tests may erase mtd devices, so mark them EXPERIMENTAL and emphasize
this fact in the Kconfig entry, so users will think twice before running
them.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
drivers/mtd/Kconfig | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 4be8373..81d9b92 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -27,12 +27,15 @@ config MTD_DEBUG_VERBOSE
config MTD_TESTS
tristate "MTD tests support"
- depends on m
+ depends on m && EXPERIMENTAL
help
This option includes various MTD tests into compilation. The tests
should normally be compiled as kernel modules. The modules perform
various checks and verifications when loaded.
+ WARNING: Some of the tests will ERASE THE CONTENT of mtd devices!
+ Do not use these tests unless you are sure you really need to.
+
config MTD_REDBOOT_PARTS
tristate "RedBoot partition table parsing"
---help---
--
1.7.6.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
2011-10-25 9:09 [PATCH 1/2] mtd: tests: don't use mtd0 as a default Wolfram Sang
2011-10-25 9:09 ` [PATCH 2/2] mtd: mark tests EXPERIMENTAL Wolfram Sang
@ 2011-10-25 11:34 ` Artem Bityutskiy
2011-10-29 20:25 ` Artem Bityutskiy
2011-10-29 20:28 ` Artem Bityutskiy
3 siblings, 0 replies; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-25 11:34 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Roland Kletzing, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]
On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
> mtd tests may erase the mtd device, so force the user to specify which
> mtd device to test by using the module parameter. Disable the default
> (using mtd0) since this may destroy a vital part of the flash if the
> module is inserted accidently or carelessly.
>
> Reported-by: Roland Kletzing <devzero@web.de>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
> drivers/mtd/tests/mtd_oobtest.c | 2 +-
> drivers/mtd/tests/mtd_pagetest.c | 2 +-
> drivers/mtd/tests/mtd_readtest.c | 2 +-
> drivers/mtd/tests/mtd_speedtest.c | 2 +-
> drivers/mtd/tests/mtd_stresstest.c | 2 +-
> drivers/mtd/tests/mtd_subpagetest.c | 2 +-
> drivers/mtd/tests/mtd_torturetest.c | 2 +-
> 7 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
> index dec92ae..ff77b8e 100644
> --- a/drivers/mtd/tests/mtd_oobtest.c
> +++ b/drivers/mtd/tests/mtd_oobtest.c
> @@ -30,7 +30,7 @@
>
> #define PRINT_PREF KERN_INFO "mtd_oobtest: "
>
> -static int dev;
> +static int dev = -1;
> module_param(dev, int, S_IRUGO);
> MODULE_PARM_DESC(dev, "MTD device number to use");
How about adding something like:
if (dev == -1) {
printk(KERN_WARN "Please, specify the test MTD device\n");
printk(KERN_WARN "WARNING: this test destroys the test MTD device's data\n");
return -1;
}
Of course for the readtest the warning should not be printed.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
2011-10-25 9:09 [PATCH 1/2] mtd: tests: don't use mtd0 as a default Wolfram Sang
2011-10-25 9:09 ` [PATCH 2/2] mtd: mark tests EXPERIMENTAL Wolfram Sang
2011-10-25 11:34 ` [PATCH 1/2] mtd: tests: don't use mtd0 as a default Artem Bityutskiy
@ 2011-10-29 20:25 ` Artem Bityutskiy
2011-10-29 20:28 ` Wolfram Sang
2011-11-02 22:11 ` [PATCH " Roland Kletzing
2011-10-29 20:28 ` Artem Bityutskiy
3 siblings, 2 replies; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-29 20:25 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Roland Kletzing, linux-mtd
On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
> mtd tests may erase the mtd device, so force the user to specify which
> mtd device to test by using the module parameter. Disable the default
> (using mtd0) since this may destroy a vital part of the flash if the
> module is inserted accidently or carelessly.
>
> Reported-by: Roland Kletzing <devzero@web.de>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Note, I've pushed this patch to l2-mtd-2.6.git, thanks!
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 20:25 ` Artem Bityutskiy
@ 2011-10-29 20:28 ` Wolfram Sang
2011-10-29 20:35 ` Artem Bityutskiy
2011-11-02 22:11 ` [PATCH " Roland Kletzing
1 sibling, 1 reply; 21+ messages in thread
From: Wolfram Sang @ 2011-10-29 20:28 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Roland Kletzing, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
On Sat, Oct 29, 2011 at 11:25:07PM +0300, Artem Bityutskiy wrote:
> On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
> > mtd tests may erase the mtd device, so force the user to specify which
> > mtd device to test by using the module parameter. Disable the default
> > (using mtd0) since this may destroy a vital part of the flash if the
> > module is inserted accidently or carelessly.
> >
> > Reported-by: Roland Kletzing <devzero@web.de>
> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
>
> Note, I've pushed this patch to l2-mtd-2.6.git, thanks!
Ah, I am just about to test V2 of this patch :)
You didn't like PATCH 2/2?
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
2011-10-25 9:09 [PATCH 1/2] mtd: tests: don't use mtd0 as a default Wolfram Sang
` (2 preceding siblings ...)
2011-10-29 20:25 ` Artem Bityutskiy
@ 2011-10-29 20:28 ` Artem Bityutskiy
3 siblings, 0 replies; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-29 20:28 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Roland Kletzing, linux-mtd
On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
> mtd tests may erase the mtd device, so force the user to specify which
> mtd device to test by using the module parameter. Disable the default
> (using mtd0) since this may destroy a vital part of the flash if the
> module is inserted accidently or carelessly.
>
> Reported-by: Roland Kletzing <devzero@web.de>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
On top of this I've added the following patch:
>From 16a50bac6deb68e56c49d64d18952ba9ce5621d1 Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
Date: Sat, 29 Oct 2011 23:20:34 +0300
Subject: [PATCH] mtd: add a scary warning
The MTD tests require mtd device number to be specified. If the user
does not specify it, print a message and warn that the tests are
destructive and will wipe whole MTD device. This is a measure to make
sure we do not have more reports from unhappy users accidentally losing
their data.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
---
drivers/mtd/tests/mtd_oobtest.c | 6 ++++++
drivers/mtd/tests/mtd_pagetest.c | 6 ++++++
drivers/mtd/tests/mtd_readtest.c | 5 +++++
drivers/mtd/tests/mtd_speedtest.c | 6 ++++++
drivers/mtd/tests/mtd_stresstest.c | 6 ++++++
drivers/mtd/tests/mtd_subpagetest.c | 6 ++++++
drivers/mtd/tests/mtd_torturetest.c | 6 ++++++
7 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
index f253acb..673f3d1 100644
--- a/drivers/mtd/tests/mtd_oobtest.c
+++ b/drivers/mtd/tests/mtd_oobtest.c
@@ -364,6 +364,12 @@ static int __init mtd_oobtest_init(void)
struct mtd_oob_ops ops;
loff_t addr = 0, addr0;
+ if (dev == -1) {
+ printk(KERN_ERR "Please, specify the MTD device\n");
+ printk(KERN_ALERT "Careful! This test will wipe the MTD device!\n");
+ return -EINVAL;
+ }
+
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "MTD device: %d\n", dev);
diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c
index f27b196..e4c263d 100644
--- a/drivers/mtd/tests/mtd_pagetest.c
+++ b/drivers/mtd/tests/mtd_pagetest.c
@@ -502,6 +502,12 @@ static int __init mtd_pagetest_init(void)
uint64_t tmp;
uint32_t i;
+ if (dev == -1) {
+ printk(KERN_ERR "Please, specify the MTD device\n");
+ printk(KERN_ALERT "Careful! This test will wipe the MTD device!\n");
+ return -EINVAL;
+ }
+
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "MTD device: %d\n", dev);
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index a40d860..7b44d57 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -168,6 +168,11 @@ static int __init mtd_readtest_init(void)
uint64_t tmp;
int err, i;
+ if (dev == -1) {
+ printk(KERN_ERR "Please, specify the MTD device\n");
+ return -EINVAL;
+ }
+
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "MTD device: %d\n", dev);
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c
index 7ce07f9..a82ac11 100644
--- a/drivers/mtd/tests/mtd_speedtest.c
+++ b/drivers/mtd/tests/mtd_speedtest.c
@@ -359,6 +359,12 @@ static int __init mtd_speedtest_init(void)
long speed;
uint64_t tmp;
+ if (dev == -1) {
+ printk(KERN_ERR "Please, specify the MTD device\n");
+ printk(KERN_ALERT "Careful! This test will wipe the MTD device!\n");
+ return -EINVAL;
+ }
+
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
if (count)
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c
index b4f8879..376fd16 100644
--- a/drivers/mtd/tests/mtd_stresstest.c
+++ b/drivers/mtd/tests/mtd_stresstest.c
@@ -248,6 +248,12 @@ static int __init mtd_stresstest_init(void)
int i, op;
uint64_t tmp;
+ if (dev == -1) {
+ printk(KERN_ERR "Please, specify the MTD device\n");
+ printk(KERN_ALERT "Careful! This test will wipe the MTD device!\n");
+ return -EINVAL;
+ }
+
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "MTD device: %d\n", dev);
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c
index 85a86a7..d6f983f 100644
--- a/drivers/mtd/tests/mtd_subpagetest.c
+++ b/drivers/mtd/tests/mtd_subpagetest.c
@@ -377,6 +377,12 @@ static int __init mtd_subpagetest_init(void)
uint32_t i;
uint64_t tmp;
+ if (dev == -1) {
+ printk(KERN_ERR "Please, specify the MTD device\n");
+ printk(KERN_ALERT "Careful! This test will wipe the MTD device!\n");
+ return -EINVAL;
+ }
+
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "MTD device: %d\n", dev);
diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c
index fb3b903..a08c3cd 100644
--- a/drivers/mtd/tests/mtd_torturetest.c
+++ b/drivers/mtd/tests/mtd_torturetest.c
@@ -209,6 +209,12 @@ static int __init tort_init(void)
int err = 0, i, infinite = !cycles_count;
int bad_ebs[ebcnt];
+ if (dev == -1) {
+ printk(KERN_ERR "Please, specify the MTD device\n");
+ printk(KERN_ALERT "Careful! This test will wipe the MTD device!\n");
+ return -EINVAL;
+ }
+
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "Warning: this program is trying to wear out your "
--
1.7.6
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 2/2] mtd: mark tests EXPERIMENTAL
2011-10-25 9:09 ` [PATCH 2/2] mtd: mark tests EXPERIMENTAL Wolfram Sang
@ 2011-10-29 20:30 ` Artem Bityutskiy
2011-10-29 20:40 ` Wolfram Sang
0 siblings, 1 reply; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-29 20:30 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Roland Kletzing, linux-mtd
On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
> The tests may erase mtd devices, so mark them EXPERIMENTAL and emphasize
> this fact in the Kconfig entry, so users will think twice before running
> them.
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
> drivers/mtd/Kconfig | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
> index 4be8373..81d9b92 100644
> --- a/drivers/mtd/Kconfig
> +++ b/drivers/mtd/Kconfig
> @@ -27,12 +27,15 @@ config MTD_DEBUG_VERBOSE
>
> config MTD_TESTS
> tristate "MTD tests support"
> - depends on m
> + depends on m && EXPERIMENTAL
> help
> This option includes various MTD tests into compilation. The tests
> should normally be compiled as kernel modules. The modules perform
> various checks and verifications when loaded.
>
> + WARNING: Some of the tests will ERASE THE CONTENT of mtd devices!
> + Do not use these tests unless you are sure you really need to.
> +
I am OK with this close, but I am not sure about the EXPERIMENTAL. I
though this is used for the code which is considered to be "not ready"
for real use, while the tests work well.
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 20:28 ` Wolfram Sang
@ 2011-10-29 20:35 ` Artem Bityutskiy
2011-10-29 20:56 ` [PATCH V2 " Wolfram Sang
0 siblings, 1 reply; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-29 20:35 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Roland Kletzing, linux-mtd
On Sat, 2011-10-29 at 22:28 +0200, Wolfram Sang wrote:
> On Sat, Oct 29, 2011 at 11:25:07PM +0300, Artem Bityutskiy wrote:
> > On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
> > > mtd tests may erase the mtd device, so force the user to specify which
> > > mtd device to test by using the module parameter. Disable the default
> > > (using mtd0) since this may destroy a vital part of the flash if the
> > > module is inserted accidently or carelessly.
> > >
> > > Reported-by: Roland Kletzing <devzero@web.de>
> > > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> >
> > Note, I've pushed this patch to l2-mtd-2.6.git, thanks!
>
> Ah, I am just about to test V2 of this patch :)
I thought we need to have a fix faster so decided to push your patch as
it is, and then add some printks on top of that.
> You didn't like PATCH 2/2?
Just replied - I am not sure about the EXPERIMENTAL dependency you add.
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/2] mtd: mark tests EXPERIMENTAL
2011-10-29 20:30 ` Artem Bityutskiy
@ 2011-10-29 20:40 ` Wolfram Sang
2011-10-30 12:29 ` Artem Bityutskiy
0 siblings, 1 reply; 21+ messages in thread
From: Wolfram Sang @ 2011-10-29 20:40 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Roland Kletzing, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 879 bytes --]
> > diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
> > index 4be8373..81d9b92 100644
> > --- a/drivers/mtd/Kconfig
> > +++ b/drivers/mtd/Kconfig
> > @@ -27,12 +27,15 @@ config MTD_DEBUG_VERBOSE
> >
> > config MTD_TESTS
> > tristate "MTD tests support"
> > - depends on m
> > + depends on m && EXPERIMENTAL
>
> I am OK with this close, but I am not sure about the EXPERIMENTAL. I
> though this is used for the code which is considered to be "not ready"
> for real use, while the tests work well.
Well, yeah, it is not perfect, but the closest I could come up with
(EXPERT is a lot worse). My reasoning went a bit in the direction of
"you usually need the tests for experimental drivers".
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH V2 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 20:35 ` Artem Bityutskiy
@ 2011-10-29 20:56 ` Wolfram Sang
2011-10-29 21:12 ` Artem Bityutskiy
2011-10-30 12:24 ` [PATCH V2 " Artem Bityutskiy
0 siblings, 2 replies; 21+ messages in thread
From: Wolfram Sang @ 2011-10-29 20:56 UTC (permalink / raw)
To: linux-mtd; +Cc: Wolfram Sang, Artem Bityutskiy
mtd tests may erase the mtd device, so force the user to specify which
mtd device to test by using the module parameter. Disable the default
(using mtd0) since this may destroy a vital part of the flash if the
module is inserted accidently or carelessly.
Reported-by: Roland Kletzing <devzero@web.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
OK I understood that you wanted the fixes out as fast as possible
(all the conferences here in Prague have kept me busy). Still,
here is my second take for completeness. I like this version a tad
better, but pick whatever you prefer, of course.
Changes since V1: print out extra error msg if no device was specified
drivers/mtd/tests/mtd_oobtest.c | 9 ++++++++-
drivers/mtd/tests/mtd_pagetest.c | 9 ++++++++-
drivers/mtd/tests/mtd_readtest.c | 8 +++++++-
drivers/mtd/tests/mtd_speedtest.c | 9 ++++++++-
drivers/mtd/tests/mtd_stresstest.c | 9 ++++++++-
drivers/mtd/tests/mtd_subpagetest.c | 9 ++++++++-
drivers/mtd/tests/mtd_torturetest.c | 9 ++++++++-
7 files changed, 55 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
index dec92ae..f74aa78 100644
--- a/drivers/mtd/tests/mtd_oobtest.c
+++ b/drivers/mtd/tests/mtd_oobtest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_oobtest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -366,6 +366,13 @@ static int __init mtd_oobtest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(PRINT_PREF "WARNING: The data on this device will be ERASED!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c
index 00b937e..435619c 100644
--- a/drivers/mtd/tests/mtd_pagetest.c
+++ b/drivers/mtd/tests/mtd_pagetest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_pagetest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -504,6 +504,13 @@ static int __init mtd_pagetest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(PRINT_PREF "WARNING: The data on this device will be ERASED!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index afe71aa..ce7ba4d 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_readtest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -169,6 +169,12 @@ static int __init mtd_readtest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c
index 627d4e2..cd968ed 100644
--- a/drivers/mtd/tests/mtd_speedtest.c
+++ b/drivers/mtd/tests/mtd_speedtest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_speedtest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -361,6 +361,13 @@ static int __init mtd_speedtest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(PRINT_PREF "WARNING: The data on this device will be ERASED!\n");
+ return -EINVAL;
+ }
+
if (count)
printk(PRINT_PREF "MTD device: %d count: %d\n", dev, count);
else
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c
index 531625f..3016945 100644
--- a/drivers/mtd/tests/mtd_stresstest.c
+++ b/drivers/mtd/tests/mtd_stresstest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_stresstest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -250,6 +250,13 @@ static int __init mtd_stresstest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(PRINT_PREF "WARNING: The data on this device will be ERASED!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c
index 334eae5..d63eede 100644
--- a/drivers/mtd/tests/mtd_subpagetest.c
+++ b/drivers/mtd/tests/mtd_subpagetest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_subpagetest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -379,6 +379,13 @@ static int __init mtd_subpagetest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(PRINT_PREF "WARNING: The data on this device will be ERASED!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c
index 5c6c3d2..d4728a3 100644
--- a/drivers/mtd/tests/mtd_torturetest.c
+++ b/drivers/mtd/tests/mtd_torturetest.c
@@ -46,7 +46,7 @@ static int pgcnt;
module_param(pgcnt, int, S_IRUGO);
MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)");
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -213,6 +213,13 @@ static int __init tort_init(void)
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "Warning: this program is trying to wear out your "
"flash, stop it if this is not wanted.\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(PRINT_PREF "WARNING: The data on this device will be ERASED!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
printk(PRINT_PREF "torture %d eraseblocks (%d-%d) of mtd%d\n",
ebcnt, eb, eb + ebcnt - 1, dev);
--
1.7.6.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH V2 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 20:56 ` [PATCH V2 " Wolfram Sang
@ 2011-10-29 21:12 ` Artem Bityutskiy
2011-10-29 22:11 ` [PATCH V3 " Wolfram Sang
2011-10-30 12:24 ` [PATCH V2 " Artem Bityutskiy
1 sibling, 1 reply; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-29 21:12 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mtd
On Sat, 2011-10-29 at 22:56 +0200, Wolfram Sang wrote:
> + if (dev < 0) {
> + printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
> + printk(PRINT_PREF "WARNING: The data on this device will be ERASED!\n");
> + return -EINVAL;
Thanks, but would it please be possible to use KERN_CRIT for the warning
to make sure the user actually sees it in the console?
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH V3 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 21:12 ` Artem Bityutskiy
@ 2011-10-29 22:11 ` Wolfram Sang
2011-10-30 12:32 ` Artem Bityutskiy
0 siblings, 1 reply; 21+ messages in thread
From: Wolfram Sang @ 2011-10-29 22:11 UTC (permalink / raw)
To: linux-mtd; +Cc: Wolfram Sang, Artem Bityutskiy
mtd tests may erase the mtd device, so force the user to specify which
mtd device to test by using the module parameter. Disable the default
(using mtd0) since this may destroy a vital part of the flash if the
module is inserted accidently or carelessly.
Reported-by: Roland Kletzing <devzero@web.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
Like this?
changes since v2: use KERN_CRIT and update message accordingly
drivers/mtd/tests/mtd_oobtest.c | 9 ++++++++-
drivers/mtd/tests/mtd_pagetest.c | 9 ++++++++-
drivers/mtd/tests/mtd_readtest.c | 8 +++++++-
drivers/mtd/tests/mtd_speedtest.c | 9 ++++++++-
drivers/mtd/tests/mtd_stresstest.c | 9 ++++++++-
drivers/mtd/tests/mtd_subpagetest.c | 9 ++++++++-
drivers/mtd/tests/mtd_torturetest.c | 9 ++++++++-
7 files changed, 55 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
index dec92ae..7a861c3 100644
--- a/drivers/mtd/tests/mtd_oobtest.c
+++ b/drivers/mtd/tests/mtd_oobtest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_oobtest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -366,6 +366,13 @@ static int __init mtd_oobtest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c
index 00b937e..2e4d183 100644
--- a/drivers/mtd/tests/mtd_pagetest.c
+++ b/drivers/mtd/tests/mtd_pagetest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_pagetest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -504,6 +504,13 @@ static int __init mtd_pagetest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index afe71aa..ce7ba4d 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_readtest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -169,6 +169,12 @@ static int __init mtd_readtest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c
index 627d4e2..612c87e 100644
--- a/drivers/mtd/tests/mtd_speedtest.c
+++ b/drivers/mtd/tests/mtd_speedtest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_speedtest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -361,6 +361,13 @@ static int __init mtd_speedtest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
+ return -EINVAL;
+ }
+
if (count)
printk(PRINT_PREF "MTD device: %d count: %d\n", dev, count);
else
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c
index 531625f..d48a39c 100644
--- a/drivers/mtd/tests/mtd_stresstest.c
+++ b/drivers/mtd/tests/mtd_stresstest.c
@@ -30,7 +30,7 @@
#define PRINT_PREF KERN_INFO "mtd_stresstest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -250,6 +250,13 @@ static int __init mtd_stresstest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c
index 334eae5..f43b909 100644
--- a/drivers/mtd/tests/mtd_subpagetest.c
+++ b/drivers/mtd/tests/mtd_subpagetest.c
@@ -29,7 +29,7 @@
#define PRINT_PREF KERN_INFO "mtd_subpagetest: "
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -379,6 +379,13 @@ static int __init mtd_subpagetest_init(void)
printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
mtd = get_mtd_device(NULL, dev);
diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c
index 5c6c3d2..65debad 100644
--- a/drivers/mtd/tests/mtd_torturetest.c
+++ b/drivers/mtd/tests/mtd_torturetest.c
@@ -46,7 +46,7 @@ static int pgcnt;
module_param(pgcnt, int, S_IRUGO);
MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)");
-static int dev;
+static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -213,6 +213,13 @@ static int __init tort_init(void)
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "Warning: this program is trying to wear out your "
"flash, stop it if this is not wanted.\n");
+
+ if (dev < 0) {
+ printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
+ printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
+ return -EINVAL;
+ }
+
printk(PRINT_PREF "MTD device: %d\n", dev);
printk(PRINT_PREF "torture %d eraseblocks (%d-%d) of mtd%d\n",
ebcnt, eb, eb + ebcnt - 1, dev);
--
1.7.6.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH V2 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 20:56 ` [PATCH V2 " Wolfram Sang
2011-10-29 21:12 ` Artem Bityutskiy
@ 2011-10-30 12:24 ` Artem Bityutskiy
1 sibling, 0 replies; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-30 12:24 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mtd
On Sat, 2011-10-29 at 22:56 +0200, Wolfram Sang wrote:
> mtd tests may erase the mtd device, so force the user to specify which
> mtd device to test by using the module parameter. Disable the default
> (using mtd0) since this may destroy a vital part of the flash if the
> module is inserted accidently or carelessly.
>
> Reported-by: Roland Kletzing <devzero@web.de>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Pushed this one to l2-mtd-2.6.git, thanks!
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/2] mtd: mark tests EXPERIMENTAL
2011-10-29 20:40 ` Wolfram Sang
@ 2011-10-30 12:29 ` Artem Bityutskiy
2011-10-30 16:28 ` [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig Wolfram Sang
0 siblings, 1 reply; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-30 12:29 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Roland Kletzing, linux-mtd
On Sat, 2011-10-29 at 22:40 +0200, Wolfram Sang wrote:
> > > diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
> > > index 4be8373..81d9b92 100644
> > > --- a/drivers/mtd/Kconfig
> > > +++ b/drivers/mtd/Kconfig
> > > @@ -27,12 +27,15 @@ config MTD_DEBUG_VERBOSE
> > >
> > > config MTD_TESTS
> > > tristate "MTD tests support"
> > > - depends on m
> > > + depends on m && EXPERIMENTAL
> >
> > I am OK with this close, but I am not sure about the EXPERIMENTAL. I
> > though this is used for the code which is considered to be "not ready"
> > for real use, while the tests work well.
>
> Well, yeah, it is not perfect, but the closest I could come up with
> (EXPERT is a lot worse). My reasoning went a bit in the direction of
> "you usually need the tests for experimental drivers".
I see, but I think that this is not what EXPERIMENTAL mean. It is better
to add "(DANGEROUS)" to the title as it is recommended in
Documentation/CodyngStyle.
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH V3 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 22:11 ` [PATCH V3 " Wolfram Sang
@ 2011-10-30 12:32 ` Artem Bityutskiy
0 siblings, 0 replies; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-30 12:32 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mtd
On Sun, 2011-10-30 at 00:11 +0200, Wolfram Sang wrote:
> mtd tests may erase the mtd device, so force the user to specify which
> mtd device to test by using the module parameter. Disable the default
> (using mtd0) since this may destroy a vital part of the flash if the
> module is inserted accidently or carelessly.
>
> Reported-by: Roland Kletzing <devzero@web.de>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Sorry for messy replies. I actually pushed V3 of the first patch and did
not take the 2/2 patch.
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig
2011-10-30 12:29 ` Artem Bityutskiy
@ 2011-10-30 16:28 ` Wolfram Sang
2011-10-30 20:34 ` Artem Bityutskiy
0 siblings, 1 reply; 21+ messages in thread
From: Wolfram Sang @ 2011-10-30 16:28 UTC (permalink / raw)
To: linux-mtd; +Cc: Wolfram Sang, Artem Bityutskiy
The tests may erase mtd devices, so annotate them as suggested per
coding style and add a paragraph to the help text as well.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
Thanks to Artem for letting me know of this coding style suggestion.
drivers/mtd/Kconfig | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 4be8373..cb1821b 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -26,13 +26,16 @@ config MTD_DEBUG_VERBOSE
Determines the verbosity level of the MTD debugging messages.
config MTD_TESTS
- tristate "MTD tests support"
+ tristate "MTD tests support (DANGEROUS)"
depends on m
help
This option includes various MTD tests into compilation. The tests
should normally be compiled as kernel modules. The modules perform
various checks and verifications when loaded.
+ WARNING: Some of the tests will ERASE THE CONTENT of mtd devices!
+ Do not use these tests unless you are sure you really need to.
+
config MTD_REDBOOT_PARTS
tristate "RedBoot partition table parsing"
---help---
--
1.7.6.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig
2011-10-30 16:28 ` [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig Wolfram Sang
@ 2011-10-30 20:34 ` Artem Bityutskiy
2011-10-30 20:37 ` Wolfram Sang
0 siblings, 1 reply; 21+ messages in thread
From: Artem Bityutskiy @ 2011-10-30 20:34 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mtd
On Sun, 2011-10-30 at 17:28 +0100, Wolfram Sang wrote:
> + WARNING: Some of the tests will ERASE THE CONTENT of mtd devices!
> + Do not use these tests unless you are sure you really need to.
Thanks, I've pushed this patch but amended the above text a bit:
+ WARNING: some of the tests will ERASE entire MTD device which they
+ test. Do not use these tests unless you really know what you do.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig
2011-10-30 20:34 ` Artem Bityutskiy
@ 2011-10-30 20:37 ` Wolfram Sang
2011-10-31 17:00 ` Brian Norris
0 siblings, 1 reply; 21+ messages in thread
From: Wolfram Sang @ 2011-10-30 20:37 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 708 bytes --]
On Sun, Oct 30, 2011 at 10:34:53PM +0200, Artem Bityutskiy wrote:
> On Sun, 2011-10-30 at 17:28 +0100, Wolfram Sang wrote:
> > + WARNING: Some of the tests will ERASE THE CONTENT of mtd devices!
> > + Do not use these tests unless you are sure you really need to.
>
> Thanks, I've pushed this patch but amended the above text a bit:
> + WARNING: some of the tests will ERASE entire MTD device which they
> + test. Do not use these tests unless you really know what you do.
OK, thanks! Seems we now finally have it :)
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig
2011-10-30 20:37 ` Wolfram Sang
@ 2011-10-31 17:00 ` Brian Norris
2011-11-08 20:35 ` Artem Bityutskiy
0 siblings, 1 reply; 21+ messages in thread
From: Brian Norris @ 2011-10-31 17:00 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mtd, Artem Bityutskiy
On Sun, Oct 30, 2011 at 1:37 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> On Sun, Oct 30, 2011 at 10:34:53PM +0200, Artem Bityutskiy wrote:
>> On Sun, 2011-10-30 at 17:28 +0100, Wolfram Sang wrote:
>> > + WARNING: Some of the tests will ERASE THE CONTENT of mtd devices!
>> > + Do not use these tests unless you are sure you really need to.
>>
>> Thanks, I've pushed this patch but amended the above text a bit:
>> + WARNING: some of the tests will ERASE entire MTD device which they
>> + test. Do not use these tests unless you really know what you do.
Amendment to the amendment, perhaps? I think "unless you really know
what you do" should be "unless you really know what you are doing".
> OK, thanks! Seems we now finally have it :)
Maybe now we have it?
BTW, I agree that EXPERIMENTAL was not quite the right way to go.
Brian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
2011-10-29 20:25 ` Artem Bityutskiy
2011-10-29 20:28 ` Wolfram Sang
@ 2011-11-02 22:11 ` Roland Kletzing
1 sibling, 0 replies; 21+ messages in thread
From: Roland Kletzing @ 2011-11-02 22:11 UTC (permalink / raw)
To: dedekind1, Wolfram Sang; +Cc: linux-mtd
Thanks for all your efforts !
--------------------------------------------------
From: "Artem Bityutskiy" <dedekind1@gmail.com>
Sent: Saturday, October 29, 2011 9:25 PM
To: "Wolfram Sang" <w.sang@pengutronix.de>
Cc: <linux-mtd@lists.infradead.org>; "Roland Kletzing" <devzero@web.de>
Subject: Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
> On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
>> mtd tests may erase the mtd device, so force the user to specify which
>> mtd device to test by using the module parameter. Disable the default
>> (using mtd0) since this may destroy a vital part of the flash if the
>> module is inserted accidently or carelessly.
>>
>> Reported-by: Roland Kletzing <devzero@web.de>
>> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
>
> Note, I've pushed this patch to l2-mtd-2.6.git, thanks!
>
> Artem.
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig
2011-10-31 17:00 ` Brian Norris
@ 2011-11-08 20:35 ` Artem Bityutskiy
0 siblings, 0 replies; 21+ messages in thread
From: Artem Bityutskiy @ 2011-11-08 20:35 UTC (permalink / raw)
To: Brian Norris; +Cc: linux-mtd, Wolfram Sang
On Mon, 2011-10-31 at 10:00 -0700, Brian Norris wrote:
> On Sun, Oct 30, 2011 at 1:37 PM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> > On Sun, Oct 30, 2011 at 10:34:53PM +0200, Artem Bityutskiy wrote:
> >> On Sun, 2011-10-30 at 17:28 +0100, Wolfram Sang wrote:
> >> > + WARNING: Some of the tests will ERASE THE CONTENT of mtd devices!
> >> > + Do not use these tests unless you are sure you really need to.
> >>
> >> Thanks, I've pushed this patch but amended the above text a bit:
> >> + WARNING: some of the tests will ERASE entire MTD device which they
> >> + test. Do not use these tests unless you really know what you do.
>
> Amendment to the amendment, perhaps? I think "unless you really know
> what you do" should be "unless you really know what you are doing".
Sorry, now it is a bit too late - this is merged, but should not be a
big issue I think.
Artem.
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2011-11-08 20:35 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 9:09 [PATCH 1/2] mtd: tests: don't use mtd0 as a default Wolfram Sang
2011-10-25 9:09 ` [PATCH 2/2] mtd: mark tests EXPERIMENTAL Wolfram Sang
2011-10-29 20:30 ` Artem Bityutskiy
2011-10-29 20:40 ` Wolfram Sang
2011-10-30 12:29 ` Artem Bityutskiy
2011-10-30 16:28 ` [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig Wolfram Sang
2011-10-30 20:34 ` Artem Bityutskiy
2011-10-30 20:37 ` Wolfram Sang
2011-10-31 17:00 ` Brian Norris
2011-11-08 20:35 ` Artem Bityutskiy
2011-10-25 11:34 ` [PATCH 1/2] mtd: tests: don't use mtd0 as a default Artem Bityutskiy
2011-10-29 20:25 ` Artem Bityutskiy
2011-10-29 20:28 ` Wolfram Sang
2011-10-29 20:35 ` Artem Bityutskiy
2011-10-29 20:56 ` [PATCH V2 " Wolfram Sang
2011-10-29 21:12 ` Artem Bityutskiy
2011-10-29 22:11 ` [PATCH V3 " Wolfram Sang
2011-10-30 12:32 ` Artem Bityutskiy
2011-10-30 12:24 ` [PATCH V2 " Artem Bityutskiy
2011-11-02 22:11 ` [PATCH " Roland Kletzing
2011-10-29 20:28 ` 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).