summaryrefslogtreecommitdiff
path: root/drivers/mtd
AgeCommit message (Collapse)Author
2012-06-07UBI: correct ubi_wl_flush lockingArtem Bityutskiy
Commit "62f38455 UBI: modify ubi_wl_flush function to clear work queue for a lnum" takes the 'work_sem' semaphore in write mode for the entire loop, which is not very good because it will block other workers for potentially long time. We do not need to have it in write mode - read mode is enough, and we do not need to hole it over the entire loop. So this patch turns changes the locking: takes 'work_sem' in read mode and pushes it down to the loop. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-06-07UBI: fix debugfs-less systems supportArtem Bityutskiy
Commit "aa44d1d UBI: remove Kconfig debugging option" broke UBI and it refuses to initialize if debugfs (CONFIG_DEBUG_FS) is disabled. I incorrectly assumed that debugfs files creation function will return success if debugfs is disabled, but they actually return -ENODEV. This patch fixes the issue. Reported-by: Paul Parsons <lost.distance@yahoo.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Tested-by: Paul Parsons <lost.distance@yahoo.com>
2012-06-01Merge tag 'for-linus-3.5-20120601' of git://git.infradead.org/linux-mtdLinus Torvalds
Pull mtd update from David Woodhouse: - More robust parsing especially of xattr data in JFFS2 - Updates to mxc_nand and gpmi drivers to support new boards and device tree - Improve consistency of information about ECC strength in NAND devices - Clean up partition handling of plat_nand - Support NAND drivers without dedicated access to OOB area - BCH hardware ECC support for OMAP - Other fixes and cleanups, and a few new device IDs Fixed trivial conflict in drivers/mtd/nand/gpmi-nand/gpmi-nand.c due to added include files next to each other. * tag 'for-linus-3.5-20120601' of git://git.infradead.org/linux-mtd: (75 commits) mtd: mxc_nand: move ecc strengh setup before nand_scan_tail mtd: block2mtd: fix recursive call of mtd_writev mtd: gpmi-nand: define ecc.strength mtd: of_parts: fix breakage in Kconfig mtd: nand: fix scan_read_raw_oob mtd: docg3 fix in-middle of blocks reads mtd: cfi_cmdset_0002: Slight cleanup of fixup messages mtd: add fixup for S29NS512P NOR flash. jffs2: allow to complete xattr integrity check on first GC scan jffs2: allow to discriminate between recoverable and non-recoverable errors mtd: nand: omap: add support for hardware BCH ecc ARM: OMAP3: gpmc: add BCH ecc api and modes mtd: nand: check the return code of 'read_oob/read_oob_raw' mtd: nand: remove 'sndcmd' parameter of 'read_oob/read_oob_raw' mtd: m25p80: Add support for Winbond W25Q80BW jffs2: get rid of jffs2_sync_super jffs2: remove unnecessary GC pass on sync jffs2: remove unnecessary GC pass on umount jffs2: remove lock_super mtd: gpmi: add gpmi support for mx6q ...
2012-06-01mtd: mxc_nand: move ecc strengh setup before nand_scan_tailSascha Hauer
Since commit 6a918bade9dab40aaef80559bd1169c69e8d69cb, the mxc_nand driver fails with: Driver must set ecc.strength when using hardware ECC This is because nand_scan_tail checks for correct ecc strength settings, so we must set them up before nand_scan_tail. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: stable@vger.kernel.org [3.4+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-06-01mtd: block2mtd: fix recursive call of mtd_writevGabor Juhos
The 'mtd_writev' interface calls the function assigned to the '_write' field of a given mtd device if that is not NULL. The block2mtd driver sets the '_writev' field to the 'mtd_writev' function itself and thus causes a endless loop. This is caused by 1dbebd32562b3c2caeca35960e5cb00bfcc12900 (mtd: harmonize mtd_writev usage). Remove the assignment from the block2mtd driver to fix the issue. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: stable@kernel.org [3.3+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-06-01mtd: gpmi-nand: define ecc.strengthMarek Vasut
Fix an issue which was introduced by the recent addition of ecc.strength. The ecc.strength wasn't set in gpmi-nand, resulting in the following crash: [ 2.550000] kernel BUG at drivers/mtd/nand/nand_base.c:3347! ... [ 2.550000] [<c020841c>] (nand_scan_tail+0x328/0x650) from [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) [ 2.550000] [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) from [<c01f6618>] (platform_drv_probe+0x14/0x18) [ 2.550000] [<c01f6618>] (platform_drv_probe+0x14/0x18) from [<c01f55b0>] (driver_probe_device+0x74/0x1fc) [ 2.550000] [<c01f55b0>] (driver_probe_device+0x74/0x1fc) from [<c01f57cc>] (__driver_attach+0x94/0x98) [ 2.550000] [<c01f57cc>] (__driver_attach+0x94/0x98) from [<c01f3d40>] (bus_for_each_dev+0x50/0x80) [ 2.550000] [<c01f3d40>] (bus_for_each_dev+0x50/0x80) from [<c01f4e18>] (bus_add_driver+0x188/0x25c) [ 2.550000] [<c01f4e18>] (bus_add_driver+0x188/0x25c) from [<c01f5a70>] (driver_register+0x78/0x138) [ 2.550000] [<c01f5a70>] (driver_register+0x78/0x138) from [<c043dc7c>] (gpmi_nand_init+0xc/0x30) [ 2.550000] [<c043dc7c>] (gpmi_nand_init+0xc/0x30) from [<c0008824>] (do_one_initcall+0x108/0x17c) [ 2.550000] [<c0008824>] (do_one_initcall+0x108/0x17c) from [<c042a8b8>] (kernel_init+0xfc/0x1bc) [ 2.550000] [<c042a8b8>] (kernel_init+0xfc/0x1bc) from [<c000fab4>] (kernel_thread_exit+0x0/0x8) Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-06-01mtd: of_parts: fix breakage in KconfigFrank Svendsboe
MTD_OF_PARTS and the default setting is not working due to using 'Y' instead of 'y', introduced in commit d6137badeff1ef64b4e0092ec249ebdeaeb3ff37. This made our board, and possibly other boards using DTS defined partitions and not having CONFIG_MTD_OF_PARTS=y defined in the defconfig, fail to mount root. Signed-off-by: Frank Svendsboe <frank.svendsboe@gmail.com> Cc: stable@kernel.org [3.2+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-05-30Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linusLinus Torvalds
Pull MIPS updates from Ralf Baechle: "The whole series has been sitting in -next for quite a while with no complaints. The last change to the series was before the weekend the removal of an SPI patch which Grant - even though previously acked by himself - appeared to raise objections. So I removed it until the situation is clarified. Other than that all the patches have the acks from their respective maintainers, all MIPS and x86 defconfigs are building fine and I'm not aware of any problems introduced by this series. Among the key features for this patch series is a sizable patchset for Lantiq which among other things introduces support for Lantiq's flagship product, the FALCON SOC. It also means that the opensource developers behind this patchset have overtaken Lantiq's competing inhouse development team that was working behind closed doors. Less noteworthy the ath79 patchset which adds support for a few more chip variants, cleanups and fixes. Finally the usual dose of tweaking of generic code." Fix up trivial conflicts in arch/mips/lantiq/xway/gpio_{ebu,stp}.c where printk spelling fixes clashed with file move and eventual removal of the printk. * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (81 commits) MIPS: lantiq: remove orphaned code MIPS: Remove all -Wall and almost all -Werror usage from arch/mips. MIPS: lantiq: implement support for FALCON soc MTD: MIPS: lantiq: verify that the NOR interface is available on falcon soc MTD: MIPS: lantiq: implement OF support watchdog: MIPS: lantiq: implement OF support and minor fixes SERIAL: MIPS: lantiq: implement OF support GPIO: MIPS: lantiq: convert gpio-stp-xway to OF GPIO: MIPS: lantiq: convert gpio-mm-lantiq to OF and of_mm_gpio GPIO: MIPS: lantiq: move gpio-stp and gpio-ebu to the subsystem folder MIPS: pci: convert lantiq driver to OF MIPS: lantiq: convert dma to platform driver MIPS: lantiq: implement support for clkdev api MIPS: lantiq: drop ltq_gpio_request() and gpio_to_irq() OF: MIPS: lantiq: implement irq_domain support OF: MIPS: lantiq: implement OF support MIPS: lantiq: drop mips_machine support OF: PCI: const usage needed by MIPS MIPS: Cavium: Remove smp_reserve_lock. MIPS: Move cache setup to setup_arch(). ...
2012-05-29mtd: nand: fix scan_read_raw_oobDmitry Maluka
It seems there is a bug in scan_read_raw_oob() in nand_bbt.c which should cause wrong functioning of NAND_BBT_SCANALLPAGES option. Artem: the patch did not apply and I had to amend it a bit. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: stable@kernel.org
2012-05-29mtd: docg3 fix in-middle of blocks readsRobert Jarzmik
Corner case reads do not work, and return false data and ECC. This case is typically seen in a ubifs usage, with a read of type: - docg3 docg3: doc_read_oob(from=14882415, mode=1, data=(c30eca40:12), oob=( (null):0)) This results in the following reads: - docg3 docg3: doc_read_data_area(buf= (null), len=111) - docg3 docg3: doc_read_data_area(buf=c30eca40, len=12) - docg3 docg3: doc_read_data_area(buf= (null), len=389) - docg3 docg3: doc_read_data_area(buf= (null), len=0) - docg3 docg3: doc_read_data_area(buf= (null), len=16) If we suppose that the pages content is : - bytes 0 .. 111 : 0x0a - bytes 112 .. 255 : 0x0f Then the returned bytes will be : - 111 times 0x0a (correct) - 0x0a 2 times and 0x0f 10 times (incorrect, should be 0x0a,0x0f) - 0x0f 389 times (correct) - nothing - correct OOB The reason seams that the first 111 bytes read ends between the 2 docg3 planes, and that the first following read (in the 12 bytes sequence, read of 16 bit word) returns the byte of the rightmost plane duplicated in high and lower byte of the word. Fix this behaviour by ensuring that if the previous read ended up in-between the 2 planes, there will be a first 1 byte read to get back to the beginning of leftmost plane. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-26Merge tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds
Pull arm-soc clock driver changes from Olof Johansson: "The new clock subsystem was merged in linux-3.4 without any users, this now moves the first three platforms over to it: imx, mxs and spear. The series also contains the changes for the clock subsystem itself, since Mike preferred to have it together with the platforms that require these changes, in order to avoid interdependencies and conflicts." Fix up trivial conflicts in arch/arm/mach-kirkwood/common.c (code removed in one branch, added OF support in another) and drivers/dma/imx-sdma.c (independent changes next to each other). * tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits) clk: Fix CLK_SET_RATE_GATE flag validation in clk_set_rate(). clk: Provide dummy clk_unregister() SPEAr: Update defconfigs SPEAr: Add SMI NOR partition info in dts files SPEAr: Switch to common clock framework SPEAr: Call clk_prepare() before calling clk_enable SPEAr: clk: Add General Purpose Timer Synthesizer clock SPEAr: clk: Add Fractional Synthesizer clock SPEAr: clk: Add Auxiliary Synthesizer clock SPEAr: clk: Add VCO-PLL Synthesizer clock SPEAr: Add DT bindings for SPEAr's timer ARM i.MX: remove now unused clock files ARM: i.MX6: implement clocks using common clock framework ARM i.MX35: implement clocks using common clock framework ARM i.MX5: implement clocks using common clock framework ARM: Kirkwood: Replace clock gating ARM: Orion: Audio: Add clk/clkdev support ARM: Orion: PCIE: Add support for clk ARM: Orion: XOR: Add support for clk ARM: Orion: CESA: Add support for clk ...
2012-05-23Merge tag 'upstream-3.5-rc1' of git://git.infradead.org/linux-ubifsLinus Torvalds
Pull UBI and UBIFS updates from Artem Bityutskiy: UBIFS: * Always support xattrs (remove the Kconfig option) * Always support debugging (remove the Kconfig option) * A fix for a memory leak on error path * A number of clean-ups UBI: * Always support debugging (remove the Kconfig option) * Remove "data type" hint support * Huge amount of renames to prepare for the fastmap wor * A lot of clean-ups * tag 'upstream-3.5-rc1' of git://git.infradead.org/linux-ubifs: (54 commits) UBI: modify ubi_wl_flush function to clear work queue for a lnum UBI: introduce UBI_ALL constant UBI: add lnum and vol_id to struct ubi_work UBI: add volume id struct ubi_ainf_peb UBI: add in hex the value for UBI_INTERNAL_VOL_START to comment UBI: rename scan.c to attach.c UBI: remove scan.h UBI: rename UBI_SCAN_UNKNOWN_EC UBI: move and rename attach_by_scanning UBI: rename _init_scan functions UBI: amend comments after all the renamings UBI: rename ubi_scan_leb_slab UBI: rename ubi_scan_move_to_list UBI: rename ubi_scan_destroy_ai UBI: rename ubi_scan_get_free_peb UBI: rename ubi_scan_rm_volume UBI: rename ubi_scan_find_av UBI: rename ubi_scan_add_used UBI: remove unused function UBI: make ubi_scan_erase_peb static and rename ...
2012-05-23Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial updates from Jiri Kosina: "As usual, it's mostly typo fixes, redundant code elimination and some documentation updates." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits) edac, mips: don't change code that has been removed in edac/mips tree xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer lib: Change mail address of Oskar Schirmer net: Change mail address of Oskar Schirmer arm/m68k: Change mail address of Sebastian Hess i2c: Change mail address of Oskar Schirmer net: Fix tcp_build_and_update_options comment in struct tcp_sock atomic64_32.h: fix parameter naming mismatch Kconfig: replace "--- help ---" with "---help---" c2port: fix bogus Kconfig "default no" edac: Fix spelling errors. qla1280: Remove redundant NULL check before release_firmware() call remoteproc: remove redundant NULL check before release_firmware() qla2xxx: Remove redundant NULL check before release_firmware() call. aic94xx: Get rid of redundant NULL check before release_firmware() call tehuti: delete redundant NULL check before release_firmware() qlogic: get rid of a redundant test for NULL before call to release_firmware() bna: remove redundant NULL test before release_firmware() tg3: remove redundant NULL test before release_firmware() call typhoon: get rid of redundant conditional before all to release_firmware() ...
2012-05-22Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds
Pull arm-soc board specific changes from Olof Johansson: "While we generally attempt to get rid of board specific files and replace them with device tree based descriptions, a lot of platforms have not come that far: In shmobile, we add two new board files because their recently started effort to add DT support has not proceeded enough to use it for all of the important hardware. In Kirkwood, we are adding support for new boards with a combination of DT and board file contents in multiple cases. pxa/mmp and imx are extending support for existing board files but not adding new ones." Fix up trivial conflicts in arch/arm/mach-{mmp/ttc_dkb.c,shmobile/{Kconfig,Makefile}} * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (94 commits) ARM: shmobile: fix smp build ARM: kirkwood: Add support for RaidSonic IB-NAS6210/6220 using devicetree kirkwood: Add iconnect support orion/kirkwood: create a generic function for gpio led blinking kirkwood/orion: fix orion_gpio_set_blink ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt kirkwood: Allow nand to be configured via. devicetree mtd: Add orion_nand devicetree bindings ARM: kirkwood: Basic support for DNS-320 and DNS-325 ARM: mach-shmobile: Use DT_MACHINE for armadillo 800 eva ARM: mach-shmobile: Use DT_MACHINE for KZM9G ARM: pxa: hx4700: Add Synaptics NavPoint touchpad ARM: pxa: Use REGULATOR_SUPPLY macro ARM: mach-shmobile: kzm9g: enable SMP boot ARM: mach-shmobile: kzm9g: defconfig update ARM: mach-shmobile: kzm9g: add PCF8757 gpio-key ARM: mach-shmobile: kzm9g: add SDHI support ARM: mach-shmobile: kzm9g: add MMCIF support ARM: mach-shmobile: kzm9g: correct screen direction ARM: mach-shmobile: sh73a0.h: add GPIO_NR ...
2012-05-22Merge tag 'pinctrl' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds
Pull arm soc-specific pinctrl changes from Olof Johansson: "With this, five platforms are moving to the relatively new pinctrl subsystem for their pin management, replacing the older soc specific in-kernel interfaces with common code. There is quite a bit of net addition of code for each platform being added to the pinctrl subsystem. But the payback comes later when adding new boards can be done by only providing new device trees instead." Fix up trivial conflicts in arch/arm/mach-ux500/{Makefile,board-mop500.c} * tag 'pinctrl' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (61 commits) mtd: nand: gpmi: fix compile error caused by pinctrl call ARM: PRIMA2: select PINCTRL and PINCTRL_SIRF in Kconfig ARM: nomadik: enable PINCTRL_NOMADIK where needed ARM: mxs: enable pinctrl support video: mxsfb: adopt pinctrl support ASoC: mxs-saif: adopt pinctrl support i2c: mxs: adopt pinctrl support mtd: nand: gpmi: adopt pinctrl support mmc: mxs-mmc: adopt pinctrl support serial: mxs-auart: adopt pinctrl support serial: amba-pl011: adopt pinctrl support spi/imx: adopt pinctrl support i2c: imx: adopt pinctrl support can: flexcan: adopt pinctrl support net: fec: adopt pinctrl support ARM: ux500: switch MSP to using pinctrl for pins ARM: ux500: alter MSP registration to return a device pointer ARM: ux500: switch to using pinctrl for uart0 ARM: ux500: delete custom pin control system ARM: ux500: switch over to Nomadik pinctrl driver ...
2012-05-22Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds
Pull first batch of arm-soc cleanups from Olof Johansson: "These cleanups are basically all over the place. The idea is to collect changes with minimal impact but large number of changes so we can avoid them from distracting in the diffstat in the other series. A significant number of lines get removed here, in particular because the ixp2000 and ixp23xx platforms get removed. These have never been extremely popular and have fallen into disuse over time with no active maintainer taking care of them. The u5500 soc never made it into a product, so we are removing it from the ux500 platform. Many good cleanups also went into the at91 and omap platforms, as has been the case for a number of releases." Trivial modify-delete conflicts in arch/arm/mach-{ixp2000,ixp23xx} * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (152 commits) ARM: clps711x: Cleanup IRQ handling ARM clps711x: Removed unused header mach/time.h ARM: clps711x: Added note about support EP731x CPU to Kconfig ARM: clps711x: Added missing register definitions ARM: clps711x: Used own subarch directory for store header file Dove: Fix Section mismatch warnings ARM: orion5x: ts78xx debugging changes ARM: orion5x: remove PM dependency from ts78xx ARM: orion5x: ts78xx fix NAND resource off by one ARM: orion5x: ts78xx whitespace cleanups Orion5x: Fix Section mismatch warnings Orion5x: Fix warning: struct pci_dev declared inside paramter list ARM: clps711x: Combine header files into one for clps711x-targets ARM: S3C24XX: Use common macro to define resources on mach-qt2410.c ARM: S3C24XX: Use common macro to define resources on mach-osiris.c ARM: EXYNOS: Adapt to cpuidle core time keeping and irq enable ARM: S5PV210: Use common macro to define resources on mach-smdkv210.c ARM: S5PV210: Use common macro to define resources on dev-audio.c ARM: S5PC100: Use common macro to define resources on dev-audio.c ARM: S5P64X0: Use common macro to define resources on dev-audio.c ...
2012-05-21MTD: MIPS: lantiq: verify that the NOR interface is available on falcon socJohn Crispin
When running on a FALC-ON SoC, we need to check the bootstrap options to see if NOR is available. Signed-off-by: John Crispin <blogic@openwrt.org> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: linux-mtd@lists.infradead.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3815/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2012-05-21MTD: MIPS: lantiq: implement OF supportJohn Crispin
Adds bindings for OF and make use of module_platform_driver for lantiq based socs. Signed-off-by: John Crispin <blogic@openwrt.org> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: linux-mtd@lists.infradead.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3811/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2012-05-21UBI: modify ubi_wl_flush function to clear work queue for a lnumJoel Reardon
This patch modifies ubi_wl_flush to force the erasure of particular volume id / logical eraseblock number pairs. Previous functionality is preserved when passing UBI_ALL for both values. The locations where ubi_wl_flush were called are appropriately changed: ubi_leb_erase only flushes for the erased LEB, and ubi_create_volume forces only flushing for its volume id. External code can call this new feature via the new function ubi_flush() added to kapi.c, which simply passes through to ubi_wl_flush(). This was tested by disabling the call to do_work in ubi thread, which results in the work queue remaining unless explicitly called to remove. UBIFS was changed to call ubifs_leb_change 50 times for four different LEBs. Then the new function was called to clear the queue: passing wrong volume ids / lnum, correct ones, and finally UBI_ALL for both to ensure it was finally all cleard. The work queue was dumped each time and the selective removal of the particular LEB numbers was observed. Extra checks were enabled and ubifs's integck was also run. Finally, the drive was repeatedly filled and emptied to ensure that the queue was cleared normally. Artem: amended the patch. Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-21UBI: introduce UBI_ALL constantArtem Bityutskiy
Joel will use it in his 'ubi_flush()' extention to specify all eraseblocks. Also amend the comment for UBI_UNKNOWN - it is used beyond attaching info structure now. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-21UBI: add lnum and vol_id to struct ubi_workJoel Reardon
This is part of a multipart patch to allow UBI to force the erasure of particular logical eraseblock numbers. In this patch, the volume id and LEB number are added to ubi_work data structure, and both are also passed as a parameter to schedule erase to set it appropriately. Whenever ubi_wl_put_peb is called, the lnum is also passed to be forwarded to schedule erase. Later, a new ubi_sync_lnum will be added to execute immediately all work related to that lnum. This was tested by outputting the vol_id and lnum during the schedule of erasure. The ubi thread was disabled and two ubifs drives on separate partitions repeated changed a small number of LEBs. The ubi module was readded, and all the erased LEBs, corresponding to the volumes, were added to the schedule erase queue. Artem: minor tweaks Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-21UBI: add volume id struct ubi_ainf_pebJoel Reardon
This patch adds the volume id to struct ubi_ainf_peb when scanning the LEBs at startup. PEBs now added to the erase queue will know their original LEB number and volume id, if available, and will be -1 otherwise (for instance, if the VID header is unreadable). This was tested by creating an ubi device with 3 volumes and disabiling the ubi_thread's do_work functionality. The different ubi volumes were formatted to ubifs and had files created and erased. The ubi modules was reloaded and the list of LEB's added to the erased list was outputted, confirming the volume ids and LEB numbers were appropriate. Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: add in hex the value for UBI_INTERNAL_VOL_START to commentJoel Reardon
Explicitly provide the first internal volume ID value in the comment for UBI_INTERNAL_VOL_START. This allows developers who, when adding features related to volume ids and observe unexpected very large volume ids, to grep for the observed value in the source code and find out immediately that it is expected behaviour. Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename scan.c to attach.cArtem Bityutskiy
Finally, rename the scan.c file. Now adding fastmap support won't look that hacky anymore. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: remove scan.hArtem Bityutskiy
This file is small and it does not make sense to have it separate from where everything else lives, so merge it with ubi.h. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename UBI_SCAN_UNKNOWN_ECArtem Bityutskiy
Rename the constant to UBI_UNKNOWN, for the same reason that we are going to add nother attaching method and re-use the same data structures, so the "SCAN" in the name becomes incorrect. I've also removed the "_EC" part because Joel is going to use this constant for other fields in the attaching info data structures. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: move and rename attach_by_scanningArtem Bityutskiy
Rename the 'attach_by_scanning()' function to 'ubi_attach()' and move it to scan.c. Richard will plug his fastmap stuff there. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename _init_scan functionsArtem Bityutskiy
We have a couple of initialization funcntionsn left which have "_scan" suffic - rename them: ubi_eba_init_scan() -> ubi_eba_init() ubi_wl_init_scan() -> ubi_wl_init() Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: amend comments after all the renamingsArtem Bityutskiy
This patch amends commentaries in scan.[ch] to match the new logic. Reminder - we did the restructuring to prepare the code for adding the fastmap. This patch also renames a couple of functions - it was too difficult to separate out that change and I decided that it is not too bad to have it in the same patch with commentaries changes. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_scan_leb_slabArtem Bityutskiy
The old name is not logical anymore - rename it to 'aeb_slab_cache'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_scan_move_to_listArtem Bityutskiy
The old name is not logical anymore - rename it to 'ubi_move_aeb_to_list()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_scan_destroy_aiArtem Bityutskiy
The old name is not logical anymore - rename it to 'ubi_destroy_ai()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_scan_get_free_pebArtem Bityutskiy
The old name is not logical anymore - rename it to 'ubi_early_get_peb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_scan_rm_volumeArtem Bityutskiy
The old name is not logical anymore - rename it to 'ubi_remove_av()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_scan_find_avArtem Bityutskiy
The old name is not logical anymore - rename it to 'ubi_find_av()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_scan_add_usedArtem Bityutskiy
The old name is not logical anymore - rename it to 'ubi_add_to_av()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: remove unused functionArtem Bityutskiy
The 'ubi_scan_find_aeb()' function is unused and thus can be removed. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: make ubi_scan_erase_peb static and renameArtem Bityutskiy
The 'ubi_scan_erase_peb()' is used only in scan.c so can be static. Also re-name it to 'early_erase_peb()' because we tend to use "ubi_" prefix only for non-static fuction and also because the new name is better. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename sv to avArtem Bityutskiy
After re-naming the 'struct ubi_scan_volume' we should adjust all variables named 'sv' to something else, because 'sv' stands for "scanning volume". Let's rename it to 'av' which stands for "attaching volume" which is a bit more consistent and has the same length, which makes re-naming easy. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename si to aiArtem Bityutskiy
After re-naming the 'struct ubi_scan_info' we should adjust all variables named 'si' to something else, because 'si' stands for "scanning info". Let's rename it to 'ai' which stands for "attaching info" which is a bit more consistent and has the same length, which makes re-naming easy. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename seb to aebArtem Bityutskiy
After re-naming the 'struct ubi_scan_leb' we should adjust all variables named 'seb' to something else, because 'seb' stands for "scanning eraseblock". Let's rename it to 'aeb' which stands for "attaching eraseblock" which is a bit more consistend and has the same length. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: amend comments after renaming in scan.cArtem Bityutskiy
Now some commentaries are out-of-date, after we re-named the data structures - amend them. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename struct ubi_scan_infoArtem Bityutskiy
Rename 'struct ubi_scan_info' to 'struct ubi_attach_info'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename struct ubi_scan_volumeArtem Bityutskiy
Rename 'struct ubi_scan_volume' to 'struct ubi_ainf_volume'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word and use "ainf" instead which stands for "attach information". It has the same length as "scan" so re-naming is trivial. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename struct ubi_scan_lebArtem Bityutskiy
Rename 'struct ubi_scan_leb' to 'struct ubi_ainf_leb'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word and use "ainf" instead which stands for "attach information". It has the same length as "scan" so re-naming is trivial. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename few functions for consistencyArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: get rid of dbg_errArtem Bityutskiy
This patch removes the 'dbg_err()' macro and we now use 'ubi_err' instead. The idea of 'dbg_err()' was to compile out some error message to make the binary a bit smaller - but I think it was a bad idea. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: more of clean-up terminology for self-checksArtem Bityutskiy
We have the "sefl-check" feature in UBI, but for historical reasons many corresponding functions and commentaries in the code use term "paranoid check" instead. Let's clean this up and use "self-check" everywhere. This patch renames functions, amends messages and kills several redundant debugging messages. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: clean-up terminology for self-checks in io.cArtem Bityutskiy
We have the "sefl-check" feature in UBI, but for historical reasons many corresponding functions and commentaries in the code use term "paranoid check" instead. Let's clean this up and use "self-check" everywhere. This patch renames functions, amends comments and messages. It touches only the io.c file. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: remove Kconfig debugging optionArtem Bityutskiy
This patch kills the UBI debugging Kconfig option completely and makes all the debugging stuff to be always compiled-in. It was pain in the neck to maintain this useless option because all users I am aware of have debugging enabled anyway - how else will you diagnose errors otherwise? Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>