summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vmt.c
Commit message (Collapse)AuthorAgeFilesLines
* drivers: Introduce dev_set_name()Andrey Smirnov2018-10-181-2/+2
| | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: hide EBA internalsBoris Brezillon2018-08-311-22/+16
| | | | | | | | | | | | | | | Create a private ubi_eba_table struct to hide EBA internals and provide helpers to allocate, destroy, copy and assing an EBA table to a volume. Now that external EBA users are using helpers to query/modify the EBA state we can safely change the internal representation, which will be needed to support the LEB consolidation concept. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Richard Weinberger <richard@nod.at> [Fix conflicts] Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: Make volume resize power cut awareRichard Weinberger2018-08-311-7/+18
| | | | | | | | | | | | | | | | | | | When the volume resize operation shrinks a volume, LEBs will be unmapped. Since unmapping will not erase these LEBs immediately we have to wait for that operation to finish. Otherwise in case of a power cut right after writing the new volume table the UBI attach process can find more LEBs than the volume table knows. This will render the UBI image unattachable. Fix this issue by waiting for erase to complete and write the new volume table afterward. Cc: <stable@vger.kernel.org> Reported-by: Boris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: Clean up return in ubi_remove_volume()Dan Carpenter2018-08-311-1/+1
| | | | | | | | | | | My static checker says that "err" can be uninitialized if "vol->reserved_pebs" is <= 0. I don't think that can happen but returning a literal is cleaner anyway. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: add API call to rename volumes.Giorgio Dal Molin2016-09-271-0/+3
| | | | | Signed-off-by: Giorgio Dal Molin <iw3gtf@arcor.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: Init vol->reserved_pebs by assignmentshengyong2016-05-271-2/+2
| | | | | | | | | | `vol' is a newly allocated value by kzalloc. Initialize it by assignment instead of `+='. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: Extend UBI layer debug/messaging capabilitiesTanya Brokhman2016-05-271-32/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is more then one UBI device mounted, there is no way to distinguish between messages from different UBI devices. Add device number to all ubi layer message types. The R/O block driver messages were replaced by pr_* since ubi_device structure is not used by it. Amended a bit by Artem. Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Conflicts: drivers/mtd/ubi/block.c drivers/mtd/ubi/build.c drivers/mtd/ubi/cdev.c drivers/mtd/ubi/debug.c drivers/mtd/ubi/fastmap.c drivers/mtd/ubi/io.c drivers/mtd/ubi/ubi.h drivers/mtd/ubi/vmt.c drivers/mtd/ubi/wl.c Reworked it for barebox. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove address of the Free Software FoundationAntony Pavlov2014-06-111-4/+0
| | | | | | | | | | | | | | | | | | The FSF address has changed; The FSF site says that address is Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA (see http://www.fsf.org/about/contact/) Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: register ubi devices and volumes as devicesSascha Hauer2014-02-261-0/+17
| | | | | | | | struct ubi_device and struct ubi_volume have devices attached to them. Register them to make them part of the barebox device hierarchy. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: implement ubi_volume_notifySascha Hauer2013-07-271-0/+4
| | | | | | This is necessary to update the fastmap after ubi manipulations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: reimport UBI from Linux v3.10Sascha Hauer2013-07-251-0/+620
| | | | | | | | | | | This is a fresh UBI import from Linux v3.10 This is done mainly to get fastmap support. This was tested with the i.MX nand driver, the MXS nand driver and on CFI NOR flash. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: remove old ubi supportSascha Hauer2013-07-241-863/+0
| | | | | | | To update to the latest UBI support from the Kernel first remove the old UBI support. Without it the update will be even less reviewable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox ubi changesSascha Hauer2010-07-051-7/+7
| | | | | | This adds the layer between barebox and UBI. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add ubi support from u-boot. Just enough to compile and scanSascha Hauer2010-07-051-0/+866
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>