Bug 216623
Summary: | ubi: support disabling fastmap by module parameter | ||
---|---|---|---|
Product: | Drivers | Reporter: | wangzhaolong1 |
Component: | Other | Assignee: | drivers_other |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 6.1.0 -rc2 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
A patch to verify test cases
Shell script of test cases |
Description
wangzhaolong1
2022-10-25 02:03:39 UTC
I try to add 'enable_fm' as 5th module init parameter of mtd=xx to control fastmap enable or not. If the value is non-zero, fastmap is enabled.. Default value is 0. For historical reasons, to enable or disable fastmap during module loading, fm_autoconvert must be set to non-zero. The following table lists the parameter combinations and expected results. +-----------------+---------------+---------------------------+ | \ | 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 | +-------------------------------------------------------------+ The old image has fastmap. case 1 : fm_autoconvert=Y, enable_fm=0 -- fastmap disabled case 2 : fm_autoconvert=Y, enable_fm=1 -- fastmap enabled case 3 : fm_autoconvert=N, enable_fm=0 -- fastmap disabled case 4 : fm_autoconvert=N, enable_fm=1 -- fastmap enabled The old image does not have fastmap. case 5 : fm_autoconvert=Y, enable_fm=0 -- fastmap disabled case 6 : fm_autoconvert=Y, enable_fm=1 -- fastmap enabled case 7 : fm_autoconvert=N, enable_fm=0 -- fastmap disabled case 8 : fm_autoconvert=N, enable_fm=1 -- fastmap disabled (In reply to wangzhaolong1 from comment #1) > I try to add 'enable_fm' as 5th module init parameter of mtd=xx to control > fastmap enable or not. If the value is non-zero, fastmap is enabled.. > Default value is 0. > > For historical reasons, to enable or disable fastmap during module loading, > fm_autoconvert must be set to non-zero. > > The following table lists the parameter combinations and expected results. > > +-----------------+---------------+---------------------------+ > | \ | 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 | > +-------------------------------------------------------------+ > > The old image has fastmap. > > case 1 : fm_autoconvert=Y, enable_fm=0 -- fastmap disabled > case 2 : fm_autoconvert=Y, enable_fm=1 -- fastmap enabled > case 3 : fm_autoconvert=N, enable_fm=0 -- fastmap disabled > case 4 : fm_autoconvert=N, enable_fm=1 -- fastmap enabled > > > The old image does not have fastmap. > > case 5 : fm_autoconvert=Y, enable_fm=0 -- fastmap disabled > case 6 : fm_autoconvert=Y, enable_fm=1 -- fastmap enabled > case 7 : fm_autoconvert=N, enable_fm=0 -- fastmap disabled > case 8 : fm_autoconvert=N, enable_fm=1 -- fastmap disabled The prerequisite is that CONFIG_MTD_UBI_FASTMAP=y Created attachment 303081 [details]
A patch to verify test cases
Created attachment 303082 [details]
Shell script of test cases
Run Test Cases: 1.Apply the patch for verification. git apply verify.diff 2.kernel config: CONFIG_MTD_NAND_NANDSIM=m CONFIG_MTD_UBI=m CONFIG_MTD_UBI_FASTMAP=y 3.Start a VM environment. 4../test.sh Get the output: The old image has fastmap: Test cases 1 to 4 are successful The old image does not have fastmap: Test cases 5 to 8 are successful TEST CASES PASSED done |