Skip to content

Use MbedCRC for LittleFS #7824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 5, 2018
Merged

Use MbedCRC for LittleFS #7824

merged 3 commits into from
Sep 5, 2018

Conversation

deepikabhavnani
Copy link

@deepikabhavnani deepikabhavnani commented Aug 17, 2018

Description

916dec9fe4d7f7fc376c5979550b17a247d7173b : CRC used in LittleFS is Reversed ANSI, hence new polynomial added. Reversed polynomials perform shift in reverse direction of standard polynomial, and we do not have option to notify reverse shift to hardware. Hence this option is available in software only.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

Dependent on #7793

@deepikabhavnani
Copy link
Author

Preceding PR merged, hence rebased

// Only compile if user does not provide custom config
#ifndef LFS_CONFIG

#ifdef __MBED__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could this be moved to the header file? And just make the crc function declared LittleFileSystem.cpp named "lfs_crc"?

@geky
Copy link
Contributor

geky commented Aug 21, 2018

Looks good 👍 Though need to double check that the resulting disk image is portable.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 22, 2018

@deepikabhavnani Is this ready for review or still needs work?

@deepikabhavnani
Copy link
Author

@0xc0170 - Its ready for review

@0xc0170 0xc0170 requested a review from a team August 23, 2018 12:50


// Software CRC implementation with small lookup table
#ifndef __MBED__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we rather provide LFS_CONFIG than changing directly littlefs (another update might replace this?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170 - Yes we can but I assumed LFS_CONFIG is apart from mbed-os changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFS_CONFIG was added after we first integrated LittleFS into Mbed OS, so that's why lfs_util.c/h have been modified directly.

git subtrees handle this surprisingly gracefully, so moving to LFS_CONFIG has been low priority.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of this PR, shall we update "lfs_util.c/h" or add separate files?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, adding separate files can be a separate PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, adding separate files can be a separate PR

Will stay with this for now. Thanks

@geky
Copy link
Contributor

geky commented Aug 23, 2018

This has a risk of effecting LittleFS structures on disk. @cmonr Could I request we hold off on this until 5.10?

@cmonr
Copy link
Contributor

cmonr commented Aug 24, 2018

This has a risk of effecting LittleFS structures on disk. @cmonr Could I request we hold off on this until 5.10?

This is why I like to tag PRs as soon as possible :)

@deepikabhavnani
Copy link
Author

Code freeze for 5.10 is before 5.9.7 and this PR is on top of other 3 CRC PR’s. Please tag all 4 to same release

@cmonr
Copy link
Contributor

cmonr commented Aug 29, 2018

@geky @0xc0170 Good with this PR?

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 30, 2018

@geky please finalize the review

@geky
Copy link
Contributor

geky commented Aug 30, 2018

Sorry for delay, I wanted to verify that this did not break portability. It looks good to me 👍

@deepikabhavnani, thanks for putting this together

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

Build : SUCCESS

Build number : 2990
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7824/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 3, 2018

2 test failures related to the filesystem, please review

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

When length is zero, the buffer is not accessed. The CRC functions are used
inside several other layers where a 0-length buffer may have meanings in
different contexts and being able to pass 0-length NULL buffers to CRC as a
noop simplifies the code.
@adbridge
Copy link
Contributor

adbridge commented Sep 3, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

Build : SUCCESS

Build number : 2997
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7824/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2018

@cmonr
Copy link
Contributor

cmonr commented Sep 4, 2018

Marking this for RC2.

@cmonr
Copy link
Contributor

cmonr commented Sep 4, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Sep 4, 2018

@cmonr
Copy link
Contributor

cmonr commented Sep 5, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Sep 5, 2018

@cmonr cmonr merged commit f940443 into ARMmbed:master Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants