1. 08 5月, 2012 1 次提交
    • W
      mtd: fix oops in dataflash driver · 7a84477c
      Will Newton 提交于
      I'm seeing an oops in mtd_dataflash.c with Linux 3.3. What appears to
      be happening is that otp_select_filemode calls mtd_read_fact_prot_reg
      with -1 for offset and length and a NULL buffer to test if OTP
      operations are supported. This finds its way down to otp_read in
      mtd_dataflash.c and causes an oops when memcpying the returned data
      into the NULL buf.
      
      None of the checks in otp_read catches the negative length and offset.
      Changing the length of the dummy read to 0 prevents the oops.
      
      Cc: stable@kernel.org [3.3+]
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      7a84477c
  2. 09 4月, 2012 1 次提交
  3. 01 4月, 2012 1 次提交
  4. 27 3月, 2012 1 次提交
    • A
      mtd: add leading underscore to all mtd functions · 3c3c10bb
      Artem Bityutskiy 提交于
      This patch renames all MTD functions by adding a "_" prefix:
      
      mtd->erase -> mtd->_erase
      mtd->read_oob -> mtd->_read_oob
      ...
      
      The reason is that we are re-working the MTD API and from now on it is
      an error to use MTD function pointers directly - we have a corresponding
      API call for every pointer. By adding a leading "_" we achieve the following:
      
      1. Make sure we convert every direct pointer users
      2. A leading "_" suggests that this interface is internal and it becomes
         less likely that people will use them directly
      3. Make sure all the out-of-tree modules stop compiling and the owners
         spot the big API change and amend them.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      3c3c10bb
  5. 24 3月, 2012 1 次提交
  6. 10 1月, 2012 31 次提交
  7. 02 11月, 2011 1 次提交
  8. 21 9月, 2011 1 次提交
  9. 11 9月, 2011 2 次提交
    • B
      mtd: kill old field for `struct mtd_info_user' · 19fb4341
      Brian Norris 提交于
      The ecctype and eccsize fields have been obsolete for a while. Since they
      don't have any users, we can kill them and leave padding in their place
      for now.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      19fb4341
    • B
      mtd: add MEMWRITE ioctl · e99d8b08
      Brian Norris 提交于
      Implement a new ioctl for writing both page data and OOB to flash at the
      same time. This ioctl is intended to be a generic interface that can
      replace other ioctls (MEMWRITEOOB and MEMWRITEOOB64) and cover the
      functionality of several other old ones, e.g., MEMWRITE can:
      
      * write autoplaced OOB instead of using ECCGETLAYOUT (deprecated) and
        working around the reserved areas
      * write raw (no ECC) OOB instead of using MTDFILEMODE to set the
        per-file-descriptor MTD_FILE_MODE_RAW
      * write raw (no ECC) data instead of using MTDFILEMODE
        (MTD_FILE_MODE_RAW) and using standard character device "write"
      
      This ioctl is especially useful for MLC NAND, which cannot be written
      twice (i.e., we cannot successfully write the page data and OOB in two
      separate operations). Instead, MEMWRITE can write both in a single
      operation.
      
      Note that this ioctl is not affected by the MTD file mode (i.e.,
      MTD_FILE_MODE_RAW vs. MTD_FILE_MODE_NORMAL), since it receives its write
      mode as an input parameter.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
      e99d8b08