2019-05-23 11:14:39 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-08-08 20:58:20 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-11-07 00:14:42 +01:00
|
|
|
|
|
|
|
|
|
2007-08-10 13:01:06 -07:00
|
|
|
|
2006-10-11 14:52:47 +03:00
|
|
|
|
2005-11-07 00:14:42 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-11-07 00:14:42 +01:00
|
|
|
|
|
|
|
|
|
2010-06-02 14:28:52 +02:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2010-05-17 16:55:47 +03:00
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
2012-03-23 15:01:50 -07:00
|
|
|
|
2013-10-13 18:05:23 -03:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
2010-06-15 09:30:15 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-12-24 11:46:01 -08:00
|
|
|
|
2005-06-30 01:23:27 +01:00
|
|
|
|
mtd: merge mtdchar module with mtdcore
The MTD subsystem has historically tried to be as configurable as possible. The
side-effect of this is that its configuration menu is rather large, and we are
gradually shrinking it. For example, we recently merged partitions support with
the mtdcore.
This patch does the next step - it merges the mtdchar module to mtdcore. And in
this case this is not only about eliminating too fine-grained separation and
simplifying the configuration menu. This is also about eliminating seemingly
useless kernel module.
Indeed, mtdchar is a module that allows user-space making use of MTD devices
via /dev/mtd* character devices. If users do not enable it, they simply cannot
use MTD devices at all. They cannot read or write the flash contents. Is it a
sane and useful setup? I believe not. And everyone just enables mtdchar.
Having mtdchar separate is also a little bit harmful. People sometimes miss the
fact that they need to enable an additional configuration option to have
user-space MTD interfaces, and then they wonder why on earth the kernel does
not allow using the flash? They spend time asking around.
Thus, let's just get rid of this module and make it part of mtd core.
Note, mtdchar had additional configuration option to enable OTP interfaces,
which are present on some flashes. I removed that option as well - it saves a
really tiny amount space.
[dwmw2: Strictly speaking, you can mount file systems on MTD devices just
fine without the mtdchar (or mtdblock) devices; you just can't do
other manipulations directly on the underlying device. But still I
agree that it makes sense to make this unconditional. And Yay! we
get to kill off an instance of checking CONFIG_foo_MODULE, which is
an abomination that should never happen.]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-03-14 13:27:40 +02:00
|
|
|
|
|
|
|
|
|
2005-02-08 19:12:53 +00:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-07-20 09:53:42 -07:00
|
|
|
|
2005-02-08 19:12:53 +00:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2013-06-16 20:27:42 +04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-15 10:10:37 -06:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-07-19 10:06:09 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-09-02 15:28:45 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2021-02-17 22:18:44 +01:00
|
|
|
|
|
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2008-05-15 10:10:37 -06:00
|
|
|
|
2012-04-09 01:36:28 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-02 15:28:45 -04:00
|
|
|
|
2008-05-15 10:10:37 -06:00
|
|
|
|
2015-01-14 10:42:32 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2008-05-15 10:10:37 -06:00
|
|
|
|
2015-01-14 10:42:32 +01:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-09 01:36:28 -04:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2012-04-09 01:36:28 -04:00
|
|
|
|
|
|
|
|
|
2008-05-15 10:10:37 -06:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-07-19 10:06:09 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-06-27 00:56:40 +02:00
|
|
|
|
2011-12-30 16:35:35 +02:00
|
|
|
|
2011-12-23 19:03:12 +02:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-04-08 08:51:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
mtd: remove extra retlen assignment
MTD functions always assign the 'retlen' argument to 0 at the very
beginning - the callers do not have to do this.
I used the following semantic patch to find these places:
@@
identifier retlen;
expression a, b, c, d, e;
constant C;
type T;
@@
(
- retlen = C;
|
T
-retlen = C
+ retlen
;
)
... when != retlen
when exists
(
mtd_read(a, b, c, &retlen, d)
|
mtd_write(a, b, c, &retlen, d)
|
mtd_panic_write(a, b, c, &retlen, d)
|
mtd_point(a, b, c, &retlen, d, e)
|
mtd_read_fact_prot_reg(a, b, c, &retlen, d)
|
mtd_write_user_prot_reg(a, b, c, &retlen, d)
|
mtd_read_user_prot_reg(a, b, c, &retlen, d)
|
mtd_writev(a, b, c, d, &retlen)
)
I ran it twice, because there were cases of double zero assigments
in mtd tests. Then I went through the patch to verify that spatch
did not find any false positives.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2011-12-29 15:16:28 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-08 08:51:33 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2011-07-19 10:06:09 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2018-07-07 05:37:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2011-04-08 08:51:33 -07:00
|
|
|
|
2006-04-17 17:38:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-04-08 08:51:33 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2011-12-23 18:40:06 +02:00
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2011-12-23 18:47:59 +02:00
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2019-09-19 21:06:21 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:40 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 18:27:05 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-12-23 17:30:16 +02:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-06-23 14:12:08 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-06-23 14:12:08 -07:00
|
|
|
|
2006-05-29 14:56:39 +02:00
|
|
|
|
2011-03-30 22:57:33 -03:00
|
|
|
|
2006-05-29 14:56:39 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-20 18:34:25 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-05-28 11:01:53 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-04-17 17:38:15 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2011-04-08 08:51:33 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-19 10:06:09 -07:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2018-07-07 05:37:22 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-08 08:51:33 -07:00
|
|
|
|
2006-04-17 17:38:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-04-08 08:51:33 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2011-12-23 18:50:04 +02:00
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2019-09-19 21:06:21 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:40 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2011-06-06 15:50:58 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2011-12-23 18:29:55 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-12-23 17:35:41 +02:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2014-03-06 12:42:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-04-17 17:38:15 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-29 10:06:32 +02:00
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2013-03-04 17:35:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-29 10:06:32 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2013-03-04 17:35:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-29 10:06:32 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2013-03-04 17:35:24 +01:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2013-03-04 17:35:24 +01:00
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2013-03-04 17:35:24 +01:00
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-14 10:09:52 +01:00
|
|
|
|
2011-08-30 18:45:37 -07:00
|
|
|
|
2019-09-19 21:06:21 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-14 10:09:52 +01:00
|
|
|
|
2017-09-29 13:55:19 -04:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
mtd: do not assume oobsize is power of 2
Previous generations of MTDs all used OOB sizes that were powers of 2,
(e.g., 64, 128). However, newer generations of flash, especially NAND,
use irregular OOB sizes that are not powers of 2 (e.g., 218, 224, 448).
This means we cannot use masks like "mtd->oobsize - 1" to assume that we
will get a proper bitmask for OOB operations.
These masks are really only intended to hide the "page" portion of the
offset, leaving any OOB offset intact, so a masking with the writesize
(which *is* always a power of 2) is valid and makes more sense.
This has been tested for read/write of NAND devices (nanddump/nandwrite)
using nandsim and actual NAND flash.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-08-23 17:17:32 -07:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2011-08-30 18:45:40 -07:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-22 10:22:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
mtd: do not assume oobsize is power of 2
Previous generations of MTDs all used OOB sizes that were powers of 2,
(e.g., 64, 128). However, newer generations of flash, especially NAND,
use irregular OOB sizes that are not powers of 2 (e.g., 218, 224, 448).
This means we cannot use masks like "mtd->oobsize - 1" to assume that we
will get a proper bitmask for OOB operations.
These masks are really only intended to hide the "page" portion of the
offset, leaving any OOB offset intact, so a masking with the writesize
(which *is* always a power of 2) is valid and makes more sense.
This has been tested for read/write of NAND devices (nanddump/nandwrite)
using nandsim and actual NAND flash.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-08-23 17:17:32 -07:00
|
|
|
|
2011-12-23 18:29:55 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2011-08-30 18:45:38 -07:00
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2011-08-30 18:45:38 -07:00
|
|
|
|
2019-09-19 21:06:21 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mtd: do not assume oobsize is power of 2
Previous generations of MTDs all used OOB sizes that were powers of 2,
(e.g., 64, 128). However, newer generations of flash, especially NAND,
use irregular OOB sizes that are not powers of 2 (e.g., 218, 224, 448).
This means we cannot use masks like "mtd->oobsize - 1" to assume that we
will get a proper bitmask for OOB operations.
These masks are really only intended to hide the "page" portion of the
offset, leaving any OOB offset intact, so a masking with the writesize
(which *is* always a power of 2) is valid and makes more sense.
This has been tested for read/write of NAND devices (nanddump/nandwrite)
using nandsim and actual NAND flash.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-08-23 17:17:32 -07:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2011-08-30 18:45:40 -07:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mtd: do not assume oobsize is power of 2
Previous generations of MTDs all used OOB sizes that were powers of 2,
(e.g., 64, 128). However, newer generations of flash, especially NAND,
use irregular OOB sizes that are not powers of 2 (e.g., 218, 224, 448).
This means we cannot use masks like "mtd->oobsize - 1" to assume that we
will get a proper bitmask for OOB operations.
These masks are really only intended to hide the "page" portion of the
offset, leaving any OOB offset intact, so a masking with the writesize
(which *is* always a power of 2) is valid and makes more sense.
This has been tested for read/write of NAND devices (nanddump/nandwrite)
using nandsim and actual NAND flash.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-08-23 17:17:32 -07:00
|
|
|
|
2011-12-23 18:27:05 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-23 16:45:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-27 10:36:38 +09:00
|
|
|
|
2011-06-23 16:45:24 -07:00
|
|
|
|
|
|
|
|
|
2011-06-28 16:29:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-23 16:45:24 -07:00
|
|
|
|
2011-09-20 18:34:25 -07:00
|
|
|
|
2011-06-23 16:45:24 -07:00
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
2016-02-04 10:16:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-11 15:59:07 +08:00
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
|
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-11 15:59:07 +08:00
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2015-09-21 13:26:59 -07:00
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-21 13:26:59 -07:00
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
|
|
|
|
|
2015-09-21 13:26:59 -07:00
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
|
|
|
|
|
2010-11-23 14:17:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-21 19:08:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-18 10:54:44 +02:00
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-17 22:56:50 +02:00
|
|
|
|
|
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
2020-01-14 10:09:52 +01:00
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
2014-05-01 20:40:54 +02:00
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-30 15:32:34 +03:00
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
2014-05-01 20:40:54 +02:00
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
2014-05-01 20:40:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-14 10:09:52 +01:00
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
|
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-16 09:06:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-30 15:32:34 +03:00
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-16 09:06:01 +02:00
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
|
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
2022-05-16 09:06:01 +02:00
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
2022-05-16 09:06:01 +02:00
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
2021-11-30 12:31:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-16 09:06:01 +02:00
|
|
|
|
|
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-17 22:56:50 +02:00
|
|
|
|
|
|
|
|
|
mtdchar: add MEMREAD ioctl
User-space applications making use of MTD devices via /dev/mtd*
character devices currently have limited capabilities for reading data:
- only deprecated methods of accessing OOB layout information exist,
- there is no way to explicitly specify MTD operation mode to use; it
is auto-selected based on the MTD file mode (MTD_FILE_MODE_*) set
for the character device; in particular, this prevents using
MTD_OPS_AUTO_OOB for reads,
- all existing user-space interfaces which cause mtd_read() or
mtd_read_oob() to be called (via mtdchar_read() and
mtdchar_read_oob(), respectively) return success even when those
functions return -EUCLEAN or -EBADMSG; this renders user-space
applications using these interfaces unaware of any corrected
bitflips or uncorrectable ECC errors detected during reads.
Note that the existing MEMWRITE ioctl allows the MTD operation mode to
be explicitly set, allowing user-space applications to write page data
and OOB data without requiring them to know anything about the OOB
layout of the MTD device they are writing to (MTD_OPS_AUTO_OOB). Also,
the MEMWRITE ioctl does not mangle the return value of mtd_write_oob().
Add a new ioctl, MEMREAD, which addresses the above issues. It is
intended to be a read-side counterpart of the existing MEMWRITE ioctl.
Similarly to the latter, the read operation is performed in a loop which
processes at most mtd->erasesize bytes in each iteration. This is done
to prevent unbounded memory allocations caused by calling kmalloc() with
the 'size' argument taken directly from the struct mtd_read_req provided
by user space. However, the new ioctl is implemented so that the values
it returns match those that would have been returned if just a single
mtd_read_oob() call was issued to handle the entire read operation in
one go.
Note that while just returning -EUCLEAN or -EBADMSG to user space would
already be a valid and useful indication of the ECC algorithm detecting
errors during a read operation, that signal would not be granular enough
to cover all use cases. For example, knowing the maximum number of
bitflips detected in a single ECC step during a read operation performed
on a given page may be useful when dealing with an MTD partition whose
ECC layout varies across pages (e.g. a partition consisting of a
bootloader area using a "custom" ECC layout followed by data pages using
a "standard" ECC layout). To address that, include ECC statistics in
the structure returned to user space by the new MEMREAD ioctl.
Link: https://www.infradead.org/pipermail/linux-mtd/2016-April/067085.html
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-5-kernel@kempniu.pl
2022-06-29 14:57:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-30 15:32:34 +03:00
|
|
|
|
mtdchar: add MEMREAD ioctl
User-space applications making use of MTD devices via /dev/mtd*
character devices currently have limited capabilities for reading data:
- only deprecated methods of accessing OOB layout information exist,
- there is no way to explicitly specify MTD operation mode to use; it
is auto-selected based on the MTD file mode (MTD_FILE_MODE_*) set
for the character device; in particular, this prevents using
MTD_OPS_AUTO_OOB for reads,
- all existing user-space interfaces which cause mtd_read() or
mtd_read_oob() to be called (via mtdchar_read() and
mtdchar_read_oob(), respectively) return success even when those
functions return -EUCLEAN or -EBADMSG; this renders user-space
applications using these interfaces unaware of any corrected
bitflips or uncorrectable ECC errors detected during reads.
Note that the existing MEMWRITE ioctl allows the MTD operation mode to
be explicitly set, allowing user-space applications to write page data
and OOB data without requiring them to know anything about the OOB
layout of the MTD device they are writing to (MTD_OPS_AUTO_OOB). Also,
the MEMWRITE ioctl does not mangle the return value of mtd_write_oob().
Add a new ioctl, MEMREAD, which addresses the above issues. It is
intended to be a read-side counterpart of the existing MEMWRITE ioctl.
Similarly to the latter, the read operation is performed in a loop which
processes at most mtd->erasesize bytes in each iteration. This is done
to prevent unbounded memory allocations caused by calling kmalloc() with
the 'size' argument taken directly from the struct mtd_read_req provided
by user space. However, the new ioctl is implemented so that the values
it returns match those that would have been returned if just a single
mtd_read_oob() call was issued to handle the entire read operation in
one go.
Note that while just returning -EUCLEAN or -EBADMSG to user space would
already be a valid and useful indication of the ECC algorithm detecting
errors during a read operation, that signal would not be granular enough
to cover all use cases. For example, knowing the maximum number of
bitflips detected in a single ECC step during a read operation performed
on a given page may be useful when dealing with an MTD partition whose
ECC layout varies across pages (e.g. a partition consisting of a
bootloader area using a "custom" ECC layout followed by data pages using
a "standard" ECC layout). To address that, include ECC statistics in
the structure returned to user space by the new MEMREAD ioctl.
Link: https://www.infradead.org/pipermail/linux-mtd/2016-April/067085.html
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-5-kernel@kempniu.pl
2022-06-29 14:57:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-30 15:32:34 +03:00
|
|
|
|
mtdchar: add MEMREAD ioctl
User-space applications making use of MTD devices via /dev/mtd*
character devices currently have limited capabilities for reading data:
- only deprecated methods of accessing OOB layout information exist,
- there is no way to explicitly specify MTD operation mode to use; it
is auto-selected based on the MTD file mode (MTD_FILE_MODE_*) set
for the character device; in particular, this prevents using
MTD_OPS_AUTO_OOB for reads,
- all existing user-space interfaces which cause mtd_read() or
mtd_read_oob() to be called (via mtdchar_read() and
mtdchar_read_oob(), respectively) return success even when those
functions return -EUCLEAN or -EBADMSG; this renders user-space
applications using these interfaces unaware of any corrected
bitflips or uncorrectable ECC errors detected during reads.
Note that the existing MEMWRITE ioctl allows the MTD operation mode to
be explicitly set, allowing user-space applications to write page data
and OOB data without requiring them to know anything about the OOB
layout of the MTD device they are writing to (MTD_OPS_AUTO_OOB). Also,
the MEMWRITE ioctl does not mangle the return value of mtd_write_oob().
Add a new ioctl, MEMREAD, which addresses the above issues. It is
intended to be a read-side counterpart of the existing MEMWRITE ioctl.
Similarly to the latter, the read operation is performed in a loop which
processes at most mtd->erasesize bytes in each iteration. This is done
to prevent unbounded memory allocations caused by calling kmalloc() with
the 'size' argument taken directly from the struct mtd_read_req provided
by user space. However, the new ioctl is implemented so that the values
it returns match those that would have been returned if just a single
mtd_read_oob() call was issued to handle the entire read operation in
one go.
Note that while just returning -EUCLEAN or -EBADMSG to user space would
already be a valid and useful indication of the ECC algorithm detecting
errors during a read operation, that signal would not be granular enough
to cover all use cases. For example, knowing the maximum number of
bitflips detected in a single ECC step during a read operation performed
on a given page may be useful when dealing with an MTD partition whose
ECC layout varies across pages (e.g. a partition consisting of a
bootloader area using a "custom" ECC layout followed by data pages using
a "standard" ECC layout). To address that, include ECC statistics in
the structure returned to user space by the new MEMREAD ioctl.
Link: https://www.infradead.org/pipermail/linux-mtd/2016-April/067085.html
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-5-kernel@kempniu.pl
2022-06-29 14:57:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2020-01-14 10:09:52 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-05-30 14:25:35 +02:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2011-07-19 10:06:09 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-07-16 13:53:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mtdchar: add MEMREAD ioctl
User-space applications making use of MTD devices via /dev/mtd*
character devices currently have limited capabilities for reading data:
- only deprecated methods of accessing OOB layout information exist,
- there is no way to explicitly specify MTD operation mode to use; it
is auto-selected based on the MTD file mode (MTD_FILE_MODE_*) set
for the character device; in particular, this prevents using
MTD_OPS_AUTO_OOB for reads,
- all existing user-space interfaces which cause mtd_read() or
mtd_read_oob() to be called (via mtdchar_read() and
mtdchar_read_oob(), respectively) return success even when those
functions return -EUCLEAN or -EBADMSG; this renders user-space
applications using these interfaces unaware of any corrected
bitflips or uncorrectable ECC errors detected during reads.
Note that the existing MEMWRITE ioctl allows the MTD operation mode to
be explicitly set, allowing user-space applications to write page data
and OOB data without requiring them to know anything about the OOB
layout of the MTD device they are writing to (MTD_OPS_AUTO_OOB). Also,
the MEMWRITE ioctl does not mangle the return value of mtd_write_oob().
Add a new ioctl, MEMREAD, which addresses the above issues. It is
intended to be a read-side counterpart of the existing MEMWRITE ioctl.
Similarly to the latter, the read operation is performed in a loop which
processes at most mtd->erasesize bytes in each iteration. This is done
to prevent unbounded memory allocations caused by calling kmalloc() with
the 'size' argument taken directly from the struct mtd_read_req provided
by user space. However, the new ioctl is implemented so that the values
it returns match those that would have been returned if just a single
mtd_read_oob() call was issued to handle the entire read operation in
one go.
Note that while just returning -EUCLEAN or -EBADMSG to user space would
already be a valid and useful indication of the ECC algorithm detecting
errors during a read operation, that signal would not be granular enough
to cover all use cases. For example, knowing the maximum number of
bitflips detected in a single ECC step during a read operation performed
on a given page may be useful when dealing with an MTD partition whose
ECC layout varies across pages (e.g. a partition consisting of a
bootloader area using a "custom" ECC layout followed by data pages using
a "standard" ECC layout). To address that, include ECC statistics in
the structure returned to user space by the new MEMREAD ioctl.
Link: https://www.infradead.org/pipermail/linux-mtd/2016-April/067085.html
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-5-kernel@kempniu.pl
2022-06-29 14:57:37 +02:00
|
|
|
|
2020-07-16 13:53:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-03 16:57:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-16 13:53:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-03 16:57:35 +01:00
|
|
|
|
2021-03-03 21:18:19 +01:00
|
|
|
|
2020-07-16 13:53:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-01 05:02:12 -07:00
|
|
|
|
|
|
|
|
|
2010-01-15 11:25:38 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-09-01 05:02:12 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-09-08 21:39:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-01 05:02:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-09-01 05:02:12 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-06 17:41:24 +03:00
|
|
|
|
2006-05-30 14:25:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-30 18:45:46 -07:00
|
|
|
|
|
|
|
|
|
2006-05-30 14:25:35 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:52:28 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:52:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2011-12-23 15:25:39 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2011-09-09 09:59:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mtdchar: add MEMREAD ioctl
User-space applications making use of MTD devices via /dev/mtd*
character devices currently have limited capabilities for reading data:
- only deprecated methods of accessing OOB layout information exist,
- there is no way to explicitly specify MTD operation mode to use; it
is auto-selected based on the MTD file mode (MTD_FILE_MODE_*) set
for the character device; in particular, this prevents using
MTD_OPS_AUTO_OOB for reads,
- all existing user-space interfaces which cause mtd_read() or
mtd_read_oob() to be called (via mtdchar_read() and
mtdchar_read_oob(), respectively) return success even when those
functions return -EUCLEAN or -EBADMSG; this renders user-space
applications using these interfaces unaware of any corrected
bitflips or uncorrectable ECC errors detected during reads.
Note that the existing MEMWRITE ioctl allows the MTD operation mode to
be explicitly set, allowing user-space applications to write page data
and OOB data without requiring them to know anything about the OOB
layout of the MTD device they are writing to (MTD_OPS_AUTO_OOB). Also,
the MEMWRITE ioctl does not mangle the return value of mtd_write_oob().
Add a new ioctl, MEMREAD, which addresses the above issues. It is
intended to be a read-side counterpart of the existing MEMWRITE ioctl.
Similarly to the latter, the read operation is performed in a loop which
processes at most mtd->erasesize bytes in each iteration. This is done
to prevent unbounded memory allocations caused by calling kmalloc() with
the 'size' argument taken directly from the struct mtd_read_req provided
by user space. However, the new ioctl is implemented so that the values
it returns match those that would have been returned if just a single
mtd_read_oob() call was issued to handle the entire read operation in
one go.
Note that while just returning -EUCLEAN or -EBADMSG to user space would
already be a valid and useful indication of the ECC algorithm detecting
errors during a read operation, that signal would not be granular enough
to cover all use cases. For example, knowing the maximum number of
bitflips detected in a single ECC step during a read operation performed
on a given page may be useful when dealing with an MTD partition whose
ECC layout varies across pages (e.g. a partition consisting of a
bootloader area using a "custom" ECC layout followed by data pages using
a "standard" ECC layout). To address that, include ECC statistics in
the structure returned to user space by the new MEMREAD ioctl.
Link: https://www.infradead.org/pipermail/linux-mtd/2016-April/067085.html
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-5-kernel@kempniu.pl
2022-06-29 14:57:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-07-03 23:40:14 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-07-03 23:40:14 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-12-30 17:00:35 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-03 23:40:14 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-07-03 23:40:14 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-12-30 17:00:35 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-14 18:10:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-30 17:00:35 +02:00
|
|
|
|
2010-06-14 18:10:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-05-27 22:16:10 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-05-27 22:16:10 +02:00
|
|
|
|
|
|
|
|
|
2020-01-14 10:09:52 +01:00
|
|
|
|
2006-05-27 22:16:10 +02:00
|
|
|
|
|
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-05-27 22:16:10 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-07 11:15:26 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2012-01-02 13:48:54 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-02 13:59:12 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-01 16:36:15 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-28 09:29:44 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2014-01-28 09:29:44 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2014-01-28 09:29:44 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-12-28 18:47:46 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2014-01-28 09:29:44 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2014-01-28 09:29:44 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
2014-01-28 09:29:44 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-03 21:18:19 +01:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2008-07-03 23:40:14 -07:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2008-07-03 23:40:14 -07:00
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
2021-03-03 21:18:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-02-08 17:45:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-23 14:12:08 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
|
|
|
|
|
2020-01-14 10:09:52 +01:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-03 20:10:30 +01:00
|
|
|
|
2010-08-24 18:12:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
|
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2011-12-28 18:35:07 +02:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
2021-03-05 02:22:24 -06:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
2011-08-30 18:45:41 -07:00
|
|
|
|
2006-05-30 00:37:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
|
|
|
|
|
2015-09-21 13:26:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-17 13:31:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2010-04-27 00:24:05 +02:00
|
|
|
|
2021-02-17 22:18:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-27 00:24:05 +02:00
|
|
|
|
|
|
|
|
|
2021-02-17 22:18:45 +01:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2021-02-17 22:18:45 +01:00
|
|
|
|
2010-04-27 00:24:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-17 22:18:45 +01:00
|
|
|
|
2009-05-29 16:09:08 +01:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
2021-02-17 22:18:45 +01:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-16 13:53:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-21 13:26:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
2021-02-17 22:18:45 +01:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-30 14:31:57 +02:00
|
|
|
|
|
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2011-12-30 14:31:57 +02:00
|
|
|
|
|
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2011-12-30 14:31:57 +02:00
|
|
|
|
|
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2011-12-30 14:31:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2011-12-30 14:31:57 +02:00
|
|
|
|
2013-10-28 18:08:15 +02:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2015-01-14 10:42:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-15 09:30:15 +02:00
|
|
|
|
|
|
|
|
|
2012-10-09 15:08:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-15 09:30:15 +02:00
|
|
|
|
2013-04-19 09:53:07 -07:00
|
|
|
|
2010-06-15 09:30:15 +02:00
|
|
|
|
|
|
|
|
|
2013-04-19 09:53:07 -07:00
|
|
|
|
2010-06-15 09:30:15 +02:00
|
|
|
|
2013-10-28 18:08:15 +02:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2013-10-28 18:08:15 +02:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:34 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2009-04-08 22:53:13 -07:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2011-12-23 17:27:46 +02:00
|
|
|
|
2015-01-14 10:42:32 +01:00
|
|
|
|
2009-02-12 10:40:00 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
mtd: merge mtdchar module with mtdcore
The MTD subsystem has historically tried to be as configurable as possible. The
side-effect of this is that its configuration menu is rather large, and we are
gradually shrinking it. For example, we recently merged partitions support with
the mtdcore.
This patch does the next step - it merges the mtdchar module to mtdcore. And in
this case this is not only about eliminating too fine-grained separation and
simplifying the configuration menu. This is also about eliminating seemingly
useless kernel module.
Indeed, mtdchar is a module that allows user-space making use of MTD devices
via /dev/mtd* character devices. If users do not enable it, they simply cannot
use MTD devices at all. They cannot read or write the flash contents. Is it a
sane and useful setup? I believe not. And everyone just enables mtdchar.
Having mtdchar separate is also a little bit harmful. People sometimes miss the
fact that they need to enable an additional configuration option to have
user-space MTD interfaces, and then they wonder why on earth the kernel does
not allow using the flash? They spend time asking around.
Thus, let's just get rid of this module and make it part of mtd core.
Note, mtdchar had additional configuration option to enable OTP interfaces,
which are present on some flashes. I removed that option as well - it saves a
really tiny amount space.
[dwmw2: Strictly speaking, you can mount file systems on MTD devices just
fine without the mtdchar (or mtdblock) devices; you just can't do
other manipulations directly on the underlying device. But still I
agree that it makes sense to make this unconditional. And Yay! we
get to kill off an instance of checking CONFIG_foo_MODULE, which is
an abomination that should never happen.]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-03-14 13:27:40 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-05-17 16:55:47 +03:00
|
|
|
|
2009-03-26 00:42:41 -07:00
|
|
|
|
2010-05-17 16:55:47 +03:00
|
|
|
|
2010-01-29 21:00:04 +00:00
|
|
|
|
2010-05-17 16:55:47 +03:00
|
|
|
|
2013-03-15 12:59:36 +02:00
|
|
|
|
|
|
|
|
|
2010-05-17 16:55:47 +03:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-05-17 16:55:47 +03:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
mtd: merge mtdchar module with mtdcore
The MTD subsystem has historically tried to be as configurable as possible. The
side-effect of this is that its configuration menu is rather large, and we are
gradually shrinking it. For example, we recently merged partitions support with
the mtdcore.
This patch does the next step - it merges the mtdchar module to mtdcore. And in
this case this is not only about eliminating too fine-grained separation and
simplifying the configuration menu. This is also about eliminating seemingly
useless kernel module.
Indeed, mtdchar is a module that allows user-space making use of MTD devices
via /dev/mtd* character devices. If users do not enable it, they simply cannot
use MTD devices at all. They cannot read or write the flash contents. Is it a
sane and useful setup? I believe not. And everyone just enables mtdchar.
Having mtdchar separate is also a little bit harmful. People sometimes miss the
fact that they need to enable an additional configuration option to have
user-space MTD interfaces, and then they wonder why on earth the kernel does
not allow using the flash? They spend time asking around.
Thus, let's just get rid of this module and make it part of mtd core.
Note, mtdchar had additional configuration option to enable OTP interfaces,
which are present on some flashes. I removed that option as well - it saves a
really tiny amount space.
[dwmw2: Strictly speaking, you can mount file systems on MTD devices just
fine without the mtdchar (or mtdblock) devices; you just can't do
other manipulations directly on the underlying device. But still I
agree that it makes sense to make this unconditional. And Yay! we
get to kill off an instance of checking CONFIG_foo_MODULE, which is
an abomination that should never happen.]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-03-14 13:27:40 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-01-29 21:00:04 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2009-03-02 18:42:39 +00:00
|
|
|
|