1. 28 8月, 2019 16 次提交
  2. 21 8月, 2019 5 次提交
    • A
      mtd: spi-nor: intel-spi: Whitelist 4B read commands · 913787ca
      Alexander Sverdlin 提交于
      spi-nor.c issues 4B commands for some Flash chips bigger than 16Mbytes.
      Xeon(R) D-1500 documentation mentions its Integrated PCH Logic supports
      Flash chips up to 64Mbytes.
      D-1500 Integrated PCH documenation however has inconsistencies regarding
      FADDR register width and says nothing about particular commands issued
      to support 64Mbytes of Flash.
      
      Nevetheless the tests on Xeon(R) CPU D-1548 with 512Mbit Flash chips
      Macronix MX25L51245G and Micron MT25QL512A showed that erase, write and
      read operations work just fine after SPINOR_OP_READ_4B and
      SPINOR_OP_READ_FAST_4B are white-listed (currently only
      SPINOR_OP_READ_FAST_4B is used and only for Macronix).
      Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      913787ca
    • W
      mtd: spi-nor: fix a memory leak bug · 313aca5a
      Wenwen Wang 提交于
      In spi_nor_parse_4bait(), 'dwords' is allocated through kmalloc(). However,
      it is not deallocated in the following execution if spi_nor_read_sfdp()
      fails, leading to a memory leak. To fix this issue, free 'dwords' before
      returning the error.
      
      Fixes: 816873ea ("mtd: spi-nor: parse SFDP 4-byte Address Instruction Table")
      Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu>
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      313aca5a
    • D
      mtd: spi-nor: Fix an error code in spi_nor_read_raw() · 3e9e38d9
      Dan Carpenter 提交于
      The problem is that if "ret" is negative then when we check if
      "ret > len", that condition is going to be true because of type
      promotion.  So this patch re-orders the code to check for negatives
      first and preserve those error codes.
      
      Fixes: f384b352 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      3e9e38d9
    • T
      mtd: spi-nor: Fix Cadence QSPI RCU Schedule Stall · 4262ee88
      Thor Thayer 提交于
      The current Cadence QSPI driver sometimes caused a
      "rcu_sched self-detected stall" while writing large files.
      
      Stall Report:
      '# mtd_debug write /dev/mtd1 0 48816464 blob.img
      [ 1815.454227] rcu: INFO: rcu_sched self-detected stall on CPU
      [ 1815.459789] rcu:     0-....: (2099 ticks this GP) idle=8c6/1/0x40000002
       softirq=6492/6492 fqs=935
      [ 1815.468442] rcu:      (t=2100 jiffies g=8749 q=247)
      	<snip> (abbreviated backtrace)
      [ 1815.772086] [<c05a3ea0>] (cqspi_exec_flash_cmd) (cqspi_read_reg)
      [ 1815.786203] [<c05a5488>] (cqspi_read_reg) from (read_sr)
      [ 1815.803790] [<c05a0330>] (read_sr) from
      	(spi_nor_wait_till_ready_with_timeout)
      [ 1815.816610] [<c05a182c>] (spi_nor_wait_till_ready_with_timeout) from
      	(spi_nor_write+0x104/0x1d0)
      [ 1815.836791] [<c05a1a44>] (spi_nor_write) from (part_write+0x50/0x58)
      	<snip>
      [ 1815.997961] cadence-qspi ff809000.spi: Flash command execution timed out.
      [ 1816.004733] error -110 reading SR
      file_to_flash: write, size 0x2e8e150, n 0x2e8e150
      write(): Connection timed out
      
      This was caused by a tight loop in cqspi_wait_for_bit(). Fix by using
      readl_relaxed_poll_timeout() which sleeps 10us while polling a register.
      
      Fit onto 80 character line by truncating the bool clear parameter
      
      Fixes: 14062341 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")
      Signed-off-by: NThor Thayer <thor.thayer@linux.intel.com>
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      4262ee88
    • G
      mtd: sa1100: Mark expected switch fall-through · 3f0289cb
      Gustavo A. R. Silva 提交于
      Mark switch cases where we are expecting to fall through.
      
      Fix the following warning (Building: assabet_defconfig arm):
      
      drivers/mtd/maps/sa1100-flash.c: In function ‘sa1100_probe_subdev’:
      drivers/mtd/maps/sa1100-flash.c:82:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         printk(KERN_WARNING "SA1100 flash: unknown base address "
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                "0x%08lx, assuming CS0\n", phys);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/mtd/maps/sa1100-flash.c:85:2: note: here
        case SA1100_CS0_PHYS:
        ^~~~
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      3f0289cb
  3. 20 8月, 2019 4 次提交
  4. 13 8月, 2019 1 次提交
  5. 12 8月, 2019 3 次提交
  6. 03 8月, 2019 3 次提交
  7. 26 7月, 2019 1 次提交
    • G
      mtd: onenand_base: Mark expected switch fall-through · cc407044
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/mtd/nand/onenand/onenand_base.c: In function ‘onenand_check_features’:
      drivers/mtd/nand/onenand/onenand_base.c:3264:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
         this->options |= ONENAND_HAS_NOP_1;
      drivers/mtd/nand/onenand/onenand_base.c:3265:2: note: here
        case ONENAND_DEVICE_DENSITY_4Gb:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Cc: Jonathan Bakker <xc-racer2@live.ca>
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      cc407044
  8. 15 7月, 2019 2 次提交
    • M
      docs: mtd: move it to the driver-api book · 43f6c078
      Mauro Carvalho Chehab 提交于
      While I was tempted to move it to admin-guide, as some docs
      there are more userspace-faced, there are some very technical
      discussions about memory error correction code from the Kernel
      implementer's PoV. So, let's place it inside the driver-api
      book.
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      43f6c078
    • M
      docs: mtd: convert to ReST · 6e58e2d8
      Mauro Carvalho Chehab 提交于
      Rename the mtd documentation files to ReST, add an
      index for them and adjust in order to produce a nice html
      output via the Sphinx build system.
      
      It should be noticed that Sphinx doesn't handle very well
      URLs with dots in the middle. Thankfully, internally, the '.'
      char is translated to %2E, so we can jus use %2E instead of
      dots, and this will work fine on both text and processed files.
      
      At its new index.rst, let's add a :orphan: while this is not linked to
      the main index.rst file, in order to avoid build warnings.
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      6e58e2d8
  9. 08 7月, 2019 3 次提交
  10. 06 7月, 2019 2 次提交