diff options
author | ZhaoLong Wang <wangzhaolong1@huawei.com> | 2022-10-25 10:52:49 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2023-02-02 21:13:43 +0100 |
commit | 7af73882dd1cea5d32ac0cc9eda263635295de50 (patch) | |
tree | 4d9dd2a5ad481a15064e6858b7144565f2ba1f74 /drivers/spi/spi-cavium.c | |
parent | ubifs: Fix memory leak in alloc_wbufs() (diff) | |
download | linux-7af73882dd1cea5d32ac0cc9eda263635295de50.tar.xz linux-7af73882dd1cea5d32ac0cc9eda263635295de50.zip |
ubi: fastmap: Add fastmap control support for module parameter
The UBI driver can use the IOCTL to disable the fastmap after the
mainline 669d204469c4 ("ubi: fastmap: Add fastmap control support
for 'UBI_IOCATT' ioctl"). To destroy the fastmap on a old image,
we need to reattach the device in user space.
However, if the UBI driver build in kernel and the UBI volume is
the root partition, the UBI device cannot be reattached in user
space. To disable fastmap in this case, the UBI must provide the
kernel cmdline parameters to disable fastmap during attach.
This patch add 'enable_fm' as 5th module init parameter of mtd=xx to
control fastmap enable or not. When the value is 0, fastmap will not
create and existed fastmap will destroyed for the given ubi device.
Default value is 0.
To enable or disable fastmap during module loading, fm_autoconvert
must be set to non-zero.
+-----------------+---------------+---------------------------+
| \ | enable_fm=0 | enable_fm=1 |
+-----------------+---------------+---------------------------+
|fm_autoconvert=Y | disable fm | enable fm |
+---------------------------------+---------------------------+
|fm_autoconvert=N | disable fm | Enable fastmap if fastmap |
| | | exists on the old image |
+-------------------------------------------------------------+
Example:
# - Attach mtd1 to ubi1, disable fastmap, mtd2 to ubi2, enable
fastmap.
# modprobe ubi mtd=1,0,0,1,0 mtd=2,0,0,2,1 fm_autoconvert=1
# - If 5th parameter is not specified, the value is 0, fastmap is
disable
# modprobe ubi mtd=1 fm_autoconvert=1
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216623
Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/spi/spi-cavium.c')
0 files changed, 0 insertions, 0 deletions