- 01 11月, 2019 1 次提交
-
-
由 Tudor Ambarus 提交于
All the core functions should begin with "spi_nor_". Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
- 23 10月, 2019 6 次提交
-
-
由 Tudor Ambarus 提交于
n_tx was never used, drop it. Replace 'const u8 *txbuf' with 'u8 opcode', to comply with the SPI NOR int (*read_reg)() method. The 'const' qualifier has no meaning for parameters passed by value, drop it. Going furher, the opcode was passed to cqspi_calc_rdreg() and never used, drop it. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Move all SPI NOR controller driver specific ops in a dedicated structure. 'struct spi_nor' becomes lighter. Use size_t for lengths in 'int (*write_reg)()' and 'int (*read_reg)()'. Rename wite/read_buf to buf, the name of the functions are suggestive enough. Constify buf in int (*write_reg). Comply with these changes in the SPI NOR controller drivers. Suggested-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
The pointer to 'struct spi_nor' is kzalloc'ed above in the code. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 DENG Qingfang 提交于
Tested on HiWiFi C526A Datasheet is available at: http://www.xinyahong.com/upLoad/product/month_1411/201411201256018276.pdfSigned-off-by: NDENG Qingfang <dqfext@gmail.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Jethro Beekman 提交于
Now that SPI flash controllers without a software sequencer are supported, it's trivial to add support for CNL and its PCI ID. Values from https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/300-series-chipset-pch-datasheet-vol-2.pdfSigned-off-by: NJethro Beekman <jethro@fortanix.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Jethro Beekman 提交于
Some flash controllers don't have a software sequencer. Avoid configuring the register addresses for it, and double check everywhere that its not accidentally trying to be used. Every use of `sregs` is now guarded by a check of `sregs` or `swseq_reg`. The check might be done in the calling function. Signed-off-by: NJethro Beekman <jethro@fortanix.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 07 10月, 2019 1 次提交
-
-
由 Paul Burton 提交于
Commit 7e534323 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks") modified the prototype of the struct nand_chip read_buf function pointer. In the au1550nd driver we have 2 implementations of read_buf. The previously mentioned commit modified the au_read_buf() implementation to match the function pointer, but not au_read_buf16(). This results in a compiler warning for MIPS db1xxx_defconfig builds: drivers/mtd/nand/raw/au1550nd.c:443:57: warning: pointer type mismatch in conditional expression Fix this by updating the prototype of au_read_buf16() to take a struct nand_chip pointer as its first argument, as is expected after commit 7e534323 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks"). Note that this shouldn't have caused any functional issues at runtime, since the offset of the struct mtd_info within struct nand_chip is 0 making mtd_to_nand() effectively a type-cast. Signed-off-by: NPaul Burton <paul.burton@mips.com> Fixes: 7e534323 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks") Cc: stable@vger.kernel.org # v4.20+ Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 05 10月, 2019 1 次提交
-
-
由 Tudor Ambarus 提交于
write_sr() sends data to the SPI memory, fix the direction. Fixes: b35b9a10 ("mtd: spi-nor: Move m25p80 code in spi-nor.c") Reported-by: NJohn Garry <john.garry@huawei.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Tested-by: NJohn Garry <john.garry@huawei.com> Acked-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 16 9月, 2019 14 次提交
-
-
由 zhengbin 提交于
Fixes gcc '-Wunused-but-set-variable' warning: drivers/mtd/devices/pmc551.c: In function pmc551_erase: drivers/mtd/devices/pmc551.c:142:15: warning: variable soff_lo set but not used [-Wunused-but-set-variable] drivers/mtd/devices/pmc551.c: In function pmc551_read: drivers/mtd/devices/pmc551.c:232:15: warning: variable soff_lo set but not used [-Wunused-but-set-variable] drivers/mtd/devices/pmc551.c: In function pmc551_write: drivers/mtd/devices/pmc551.c:289:15: warning: variable soff_lo set but not used [-Wunused-but-set-variable] It is not used since commit cdf0a7d1 ("[MTD] pmc551 whitespace cleanup") Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: Nzhengbin <zhengbin13@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Tokunori Ikegami 提交于
The chip state is set to erasing by the function after getting chip. So it should be to get chip as erasing mode at first. But previously it was to get chip as writing mode then fix as erasing. Signed-off-by: NTokunori Ikegami <ikegami.t@gmail.com> Cc: linux-mtd@lists.infradead.org Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Wenwen Wang 提交于
In sm_init_zone(), 'zone->lba_to_phys_table' is allocated through kmalloc_array() and 'zone->free_sectors' is allocated in kfifo_alloc() respectively. However, they are not deallocated in the following execution if sm_read_sector() fails, leading to memory leaks. To fix this issue, free them before returning -EIO. Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Linus Walleij 提交于
This moves the CMDLINE partition parser down into the parser subdirectory. No functional change. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Linus Walleij 提交于
This moves the OF/device tree partition parser down into the parser subdirectory. No functional change. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Linus Walleij 提交于
This moves the BCM63xx partition parser down into the parser subdirectory. No functional change. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Linus Walleij 提交于
This moves the BCM47xx partition parser down into the parser subdirectory. No functional change. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Linus Walleij 提交于
This moves the TI AR7 partition parser down into the parser subdirectory. No functional change. Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Wolfram Sang 提交于
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Xiaoming Ni 提交于
The phram code implements managing multiple devices through a linked list. However, due to the module parameter permission of 0, the /sys/module/phram/parameters/phram interface is missing. The command line arguments in insmod can only create one device. Therefore, add writable permissions to the module parameters, create /sys/module/phram/parameters/phram interface, and create multi-device support. Signed-off-by: NXiaoming Ni <nixiaoming@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Christoph Hellwig 提交于
pxa2xx-flash is the only user of ioremap_cached, which is an alias for ioremap_cache anyway. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
If volume size is not a multiple of 512, ubi block cuts off the last bytes of an volume since the block layer works on 512 byte sectors. This can happen especially on NOR flash with minimal io size of 1. To avoid unpleasant surprises, print a warning. Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Zhihao Cheng 提交于
Running stress test io_paral (A pressure ubi test in mtd-utils) on an UBI device with fewer PEBs (fastmap enabled) may cause ENOSPC errors and make UBI device read-only, but there are still free PEBs on the UBI device. This problem can be easily reproduced by performing the following steps on a 2-core machine: $ modprobe nandsim first_id_byte=0x20 second_id_byte=0x33 parts=80 $ modprobe ubi mtd="0,0" fm_autoconvert $ ./io_paral /dev/ubi0 We may see the following verbose: (output) [io_paral] update_volume():108: failed to write 380 bytes at offset 95920 of volume 2 [io_paral] update_volume():109: update: 97088 bytes [io_paral] write_thread():227: function pwrite() failed with error 28 (No space left on device) [io_paral] write_thread():229: cannot write 15872 bytes to offs 31744, wrote -1 (dmesg) ubi0 error: ubi_wl_get_peb [ubi]: Unable to get a free PEB from user WL pool ubi0 warning: ubi_eba_write_leb [ubi]: switch to read-only mode CPU: 0 PID: 2027 Comm: io_paral Not tainted 5.3.0-rc2-00001-g5986cd0 #9 ubi0 warning: try_write_vid_and_data [ubi]: failed to write VID header to LEB 2:5, PEB 18 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0 -0-ga698c8995f-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack+0x85/0xba ubi_eba_write_leb+0xa1e/0xa40 [ubi] vol_cdev_write+0x307/0x520 [ubi] vfs_write+0xfa/0x280 ksys_pwrite64+0xc5/0xe0 __x64_sys_pwrite64+0x22/0x30 do_syscall_64+0xbf/0x440 In function ubi_wl_get_peb, the operation of filling the pool (ubi_update_fastmap) with free PEBs and fetching a free PEB from the pool is not atomic. After thread A filling the pool with free PEB, free PEB may be taken away by thread B. When thread A checks the expression again, the condition is still unsatisfactory. At this time, there may still be free PEBs on UBI that can be filled into the pool. This patch increases the number of attempts to obtain PEB. An extreme case (No free PEBs left after creating test volumes) has been tested on different type of machines for 100 times. The biggest number of attempts are shown below: x86_64 arm64 2-core 4 4 4-core 8 4 8-core 4 4 Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Richard Weinberger 提交于
To make sure that Fastmap can use a PEB within the first 64 PEBs, UBI moves blocks away from that area. It uses regular wear-leveling for that job. An anchor move can be triggered if no PEB is free in this area or because of anticipation. In the latter case it can happen that UBI decides to move a block but finds a free PEB within the same area. This case is in vain an increases only erase counters. Catch this case and cancel wear-leveling if this happens. Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 06 9月, 2019 2 次提交
-
-
由 David Howells 提交于
Kill mount_mtd() as it has now been replaced by vfs_get_mtd_super() in the new mount API and nothing now uses it. Signed-off-by: NDavid Howells <dhowells@redhat.com> cc: David Woodhouse <dwmw2@infradead.org> cc: Brian Norris <computersforpeace@gmail.com> cc: Boris Brezillon <bbrezillon@kernel.org> cc: Marek Vasut <marek.vasut@gmail.com> cc: Richard Weinberger <richard@nod.at> cc: linux-mtd@lists.infradead.org Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
由 David Howells 提交于
Provide a function, get_tree_mtd(), to replace mount_mtd(), using an fs_context struct to hold the parameters. Signed-off-by: NDavid Howells <dhowells@redhat.com> cc: David Woodhouse <dwmw2@infradead.org> cc: Brian Norris <computersforpeace@gmail.com> cc: Boris Brezillon <bbrezillon@kernel.org> cc: Marek Vasut <marek.vasut@gmail.com> cc: Richard Weinberger <richard@nod.at> cc: linux-mtd@lists.infradead.org Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 30 8月, 2019 2 次提交
-
-
由 Ashish Kumar 提交于
n25q512a was rebranded to mt25qu512a after its spin off from STM. mt25qu512a is different only in terms of operating frequency, the JEDEC id is the same as in n25q512a. Dual reads are supported (0x3b, 0x3c), set the SPI_NOR_DUAL_READ flag. 4-byte opcodes are supported, set the SPI_NOR_4B_OPCODES flag. Tested Single I/O and QUAD I/O mode on LS1046FRWY. Signed-off-by: NKuldeep Singh <kuldeep.singh@nxp.com> Signed-off-by: NAshish Kumar <Ashish.Kumar@nxp.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com> [tudor.ambarus@microchip.com: rename entry to "mt25qu512a (n25q512a)", reword commit message, order entry by size, drop comment as it looked redundant] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Ashish Kumar 提交于
mt35xu02g is an Octal flash supporting Single and OCTAL I/O. Tested on LS1028ARDB. Signed-off-by: NKuldeep Singh <kuldeep.singh@nxp.com> Signed-off-by: NAshish Kumar <ashish.kumar@nxp.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com> [tudor.ambarus@microchip.com: reword commit message] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 29 8月, 2019 6 次提交
-
-
由 Randy Dunlap 提交于
lib/devres.c, which implements devm_ioremap_resource(), is only built when CONFIG_HAS_IOMEM is set/enabled, so MTD_HYPERBUS should depend on HAS_IOMEM. Fixes a build error and a Kconfig warning (as seen on UML builds): WARNING: unmet direct dependencies detected for MTD_COMPLEX_MAPPINGS Depends on [n]: MTD [=m] && HAS_IOMEM [=n] Selected by [m]: - MTD_HYPERBUS [=m] && MTD [=m] ERROR: "devm_ioremap_resource" [drivers/mtd/hyperbus/hyperbus-core.ko] undefined! Fixes: dcc7d344 ("mtd: Add support for HyperBus memory devices") Signed-off-by: NRandy Dunlap <rdunlap@infradead.org> Cc: Vignesh Raghavendra <vigneshr@ti.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: linux-mtd@lists.infradead.org Acked-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Sascha Hauer 提交于
omap_elm_correct_data() returns the number of bitflips for the whole page. This is wrong, it should return the maximum number of bitflips found in each ECC step. In my case with a 4k page size NAND mtcdore reported -EUCLEAN with only 12 bitflips on a page where we could correct up to 128 bits per page (provided they are distributed equally on the 8 ECC steps) Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Claire Lin 提交于
In brcmstb_nand_verify_erased_page(), the ECC chunk pointer calculation while correcting erased page bitflips is wrong, fix it. Fixes: 02b88eea ("mtd: brcmnand: Add check for erased page bitflips") Signed-off-by: NClaire Lin <claire.lin@broadcom.com> Reviewed-by: NRay Jui <ray.jui@broadcom.com> Signed-off-by: NKamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Tudor Ambarus 提交于
We already pass a pointer to nor, we can obtain the sector_size by dereferencing it. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Zhuohao Lee 提交于
This patch adds spi_nor_debugfs_init() for the debugfs initialization. With this patch, we can read the partname and partid through the debugfs. The output of new debugfs nodes on my device are: cat /sys/kernel/debug/mtd/mtd0/partid spi-nor:ef6017 cat /sys/kernel/debug/mtd/mtd0/partname w25q64dw Signed-off-by: NZhuohao Lee <zhuohao@chromium.org> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Zhuohao Lee 提交于
Currently, we don't have vfs nodes for querying the underlying flash name and flash id. This information is important especially when we want to know the flash detail of the defective system. In order to support the query, we add mtd_debugfs_populate() to create two debugfs nodes (ie. partname and partid). The upper driver can assign the pointer to partname and partid before calling mtd_device_register(). Signed-off-by: NZhuohao Lee <zhuohao@chromium.org> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 28 8月, 2019 7 次提交
-
-
由 Nishka Dasgupta 提交于
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a break from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the break. Issue found with Coccinelle. Signed-off-by: NNishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Nishka Dasgupta 提交于
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a break from the middle of the loop, there is no put, thus causing a memory leak. Upon termination of the loop (whether by break or a natural exit), either ret will have a non-zero value or child will be NULL. Hence add an of_node_put() that will execute only when ret has a non-zero value, as calling of_node_put() on a possible NULL value does not cause any further issues. Issue found with Coccinelle. Signed-off-by: NNishka Dasgupta <nishkadg.linux@gmail.com> Reviewed-by: NAndrew Jeffery <andrew@aj.id.au> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Tudor Ambarus 提交于
Dedicate a function for getting the pointer to the flash_info const struct. Trim a bit the spi_nor_scan() huge function. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Parsing of flash parameters were interleaved with setting of the nor addr width. Dedicate a function for setting nor addr width. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Bring all flash parameters default initialization in spi_nor_legacy_params_init(). Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
S3AN flashes use a specific opcode to read the status register. We currently use the SPI_S3AN flag to decide whether this specific SR read opcode should be used, but SPI_S3AN is about to disappear, so let's add a new flag. Note that we use the same bit as SPI_S3AN implies SPI_NOR_XSR_RDY and vice versa. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
s3an_nor_scan() was overriding the opcode selection done in spi_nor_default_setup(). Set nor->setup() method in order to avoid the unnecessary call to spi_nor_default_setup(). Now that the call to spi_nor_default_setup() is skipped, set mtd.erasesize to nor->info->sector_size, as it was when spi_nor_select_erase() was called. No dummy byte is required for the S3AN's Random Read command (0x03), so no need to set nor->read_dummy. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-