summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/fastmap-wl.c
AgeCommit message (Collapse)Author
2016-10-02ubi: Fix races around ubi_refill_pools()Richard Weinberger
When writing a new Fastmap the first thing that happens is refilling the pools in memory. At this stage it is possible that new PEBs from the new pools get already claimed and written with data. If this happens before the new Fastmap data structure hits the flash and we face power cut the freshly written PEB will not scanned and unnoticed. Solve the issue by locking the pools until Fastmap is written. Cc: <stable@vger.kernel.org> Fixes: dbb7d2a88d ("UBI: Add fastmap core") Signed-off-by: Richard Weinberger <richard@nod.at>
2015-10-03ubi: fastmap: Implement produce_free_peb()Richard Weinberger
If fastmap requests a free PEB for a pool and UBI is busy with erasing PEBs we need to offer a function to wait for one. We can reuse produce_free_peb() from the non-fastmap WL code but with different locking semantics. Cc: stable@vger.kernel.org # 4.1.x- Reported-and-tested-by: Jörg Krause <joerg.krause@embedded.rocks> Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26UBI: Fastmap: Remove is_fm_block()Richard Weinberger
This function was added to fastmap in a very early stage to have paranoid assertions. With the current fastmap implementation this assert will never trigger as fastmap PEBs are not seen by the WL sub-system. Remove it to save us some CPU cycles. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26UBI: Fastmap: Add blank line after declarationsRichard Weinberger
Another checkpatch complaint: WARNING: Missing a blank line after declarations Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26UBI: Fastmap: Remove else after return.Richard Weinberger
checkpatch.pl complains: WARNING: else is not generally useful after a break or return Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26UBI: Fastmap: Introduce may_reserve_for_fm()Richard Weinberger
...and kill another #ifdef. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26UBI: Move fastmap specific functions out of wl.cRichard Weinberger
Fastmap is tightly connected to the WL sub-system, many fastmap-specific functionslive in wl.c. To get rid of most #ifdefs in wl.c move this functions into a new file and include it into wl.c Signed-off-by: Richard Weinberger <richard@nod.at>