1. 28 8月, 2019 16 次提交
  2. 21 8月, 2019 4 次提交
    • 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
  3. 20 8月, 2019 4 次提交
  4. 13 8月, 2019 1 次提交
  5. 12 8月, 2019 3 次提交
  6. 27 6月, 2019 2 次提交
  7. 24 6月, 2019 1 次提交
    • T
      mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes · 191f5c2e
      Tudor Ambarus 提交于
      SPI memory devices from different manufacturers have widely
      different configurations for Status, Control and Configuration
      registers. JEDEC 216C defines a new map for these common register
      bits and their functions, and describes how the individual bits may
      be accessed for a specific device. For the JEDEC 216B compliant
      flashes, we can partially deduce Status and Configuration registers
      functions by inspecting the 16th DWORD of BFPT. Older flashes that
      don't declare the SFDP tables (SPANSION FL512SAIFG1 311QQ063 A ©11
      SPANSION) let the software decide how to interact with these registers.
      
      The commit dcb4b22e ("spi-nor: s25fl512s supports region locking")
      uncovered a probe error for s25fl512s, when the Quad Enable bit CR[1]
      was set to one in the bootloader. When this bit is one, only the Write
      Status (01h) command with two data byts may be used, the 01h command with
      one data byte is not recognized and hence the error when trying to clear
      the block protection bits.
      
      Fix the above by using the Write Status (01h) command with two data bytes
      when the Quad Enable bit is one.
      
      Backward compatibility should be fine. The newly introduced
      spi_nor_spansion_clear_sr_bp() is tightly coupled with the
      spansion_quad_enable() function. Both assume that the Write Register
      with 16 bits, together with the Read Configuration Register (35h)
      instructions are supported.
      
      Fixes: dcb4b22e ("spi-nor: s25fl512s supports region locking")
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      Tested-by: NJonas Bonn <jonas@norrbonn.se>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
      Tested-by: NVignesh Raghavendra <vigneshr@ti.com>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      191f5c2e
  8. 22 6月, 2019 4 次提交
  9. 19 6月, 2019 2 次提交
  10. 07 6月, 2019 3 次提交