1. 25 10月, 2010 2 次提交
    • B
      mtd: edit comments on deprecation of ioctl ECCGETLAYOUT · 0ceacf36
      Brian Norris 提交于
      There were some improvements and additions necessary in the
      comments explaining of the expansion of nand_ecclayout, the
      introduction of nand_ecclayout_user, and the deprecation of the
      ioctl ECCGETLAYOUT.
      
      Also, I found a better placement for the macro MTD_MAX_ECCPOS_ENTRIES;
      next to the definition of MTD_MAX_OOBFREE_ENTRIES in mtd-abi.h. The macro
      is really only important for the ioctl code (found in drivers/mtd/mtdchar.c)
      but since there are small edits being made to the user-space header, I
      figured this is a better location.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      0ceacf36
    • B
      mtd: nand: expand nand_ecc_layout, deprecate ioctl ECCGETLAYOUT · cc26c3cd
      Brian Norris 提交于
      struct nand_ecclayout is too small for many new chips; OOB regions can be as
      large as 448 bytes and may increase more in the future. Thus, copying that
      struct to user-space with the ECCGETLAYOUT ioctl is not a good idea; the ioctl
      would have to be updated every time there's a change to the current largest
      size.
      
      Instead, the old nand_ecclayout is renamed to nand_ecclayout_user and a
      new struct nand_ecclayout is created that can accomodate larger sizes and
      expand without affecting the user-space. struct nand_ecclayout can still
      be used in board drivers without modification -- at least for now.
      
      A new function is provided to convert from the new to the old in order to
      allow the deprecated ioctl to continue to work with truncated data. Perhaps
      the ioctl, the conversion process, and the struct nand_ecclayout_user can be
      removed altogether in the future.
      
      Note: There are comments in nand/davinci_nand.c::nand_davinci_probe()
      regarding this issue; this driver (and maybe others) can be updated to
      account for extra space. All kernel drivers can use the expanded
      nand_ecclayout as a drop-in replacement and ignore its benefits.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      cc26c3cd
  2. 09 8月, 2010 2 次提交
  3. 04 8月, 2010 1 次提交
  4. 02 8月, 2010 1 次提交
  5. 22 5月, 2010 1 次提交
    • J
      drivers/mtd: Use memdup_user · df1f1d1c
      Julia Lawall 提交于
      Use memdup_user when user data is immediately copied into the
      allocated region.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression from,to,size,flag;
      position p;
      identifier l1,l2;
      @@
      
      -  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
      +  to = memdup_user(from,size);
         if (
      -      to==NULL
      +      IS_ERR(to)
                       || ...) {
         <+... when != goto l1;
      -  -ENOMEM
      +  PTR_ERR(to)
         ...+>
         }
      -  if (copy_from_user(to, from, size) != 0) {
      -    <+... when != goto l2;
      -    -EFAULT
      -    ...+>
      -  }
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      df1f1d1c
  6. 18 5月, 2010 1 次提交
  7. 17 5月, 2010 1 次提交
  8. 25 2月, 2010 4 次提交
  9. 29 5月, 2009 5 次提交
  10. 04 4月, 2009 1 次提交
    • D
      [MTD] driver model updates · 1f24b5a8
      David Brownell 提交于
      Update driver model support in the MTD framework, so it fits
      better into the current udev-based hotplug framework:
      
       - Each mtd_info now has a device node.  MTD drivers should set
         the dev.parent field to point to the physical device, before
         setting up partitions or otherwise declaring MTDs.
      
       - Those device nodes always map to /sys/class/mtdX device nodes,
         which no longer depend on MTD_CHARDEV.
      
       - Those mtdX sysfs nodes have a "starter set" of attributes;
         it's not yet sufficient to replace /proc/mtd.
      
       - Enabling MTD_CHARDEV provides /sys/class/mtdXro/ nodes and the
         /sys/class/mtd*/dev attributes (for udev, mdev, etc).
      
       - Include a MODULE_ALIAS_CHARDEV_MAJOR macro.  It'll work with
         udev creating the /dev/mtd* nodes, not just a static rootfs.
      
      So the sysfs structure is pretty much what you'd expect, except
      that readonly chardev nodes are a bit quirky.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      1f24b5a8
  11. 24 3月, 2009 1 次提交
  12. 21 3月, 2009 1 次提交
  13. 10 12月, 2008 1 次提交
    • A
      [MTD] update internal API to support 64-bit device size · 69423d99
      Adrian Hunter 提交于
      MTD internal API presently uses 32-bit values to represent
      device size.  This patch updates them to 64-bits but leaves
      the external API unchanged.  Extending the external API
      is a separate issue for several reasons.  First, no one
      needs it at the moment.  Secondly, whether the implementation
      is done with IOCTLs, sysfs or both is still debated.  Thirdly
      external API changes require the internal API to be accepted
      first.
      
      Note that although the MTD API will be able to support 64-bit
      device sizes, existing drivers do not and are not required
      to do so, although NAND base has been updated.
      
      In general, changing from 32-bit to 64-bit values cause little
      or no changes to the majority of the code with the following
      exceptions:
          	- printk message formats
          	- division and modulus of 64-bit values
          	- NAND base support
      	- 32-bit local variables used by mtdpart and mtdconcat
      	- naughtily assuming one structure maps to another
      	in MEMERASE ioctl
      Signed-off-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      69423d99
  14. 21 10月, 2008 1 次提交
  15. 17 10月, 2008 1 次提交
  16. 02 9月, 2008 1 次提交
  17. 02 8月, 2008 1 次提交
  18. 22 7月, 2008 1 次提交
  19. 11 7月, 2008 2 次提交
  20. 21 6月, 2008 1 次提交
  21. 05 6月, 2008 1 次提交
  22. 25 1月, 2008 1 次提交
  23. 08 1月, 2008 1 次提交
  24. 12 8月, 2007 1 次提交
  25. 29 6月, 2007 1 次提交
  26. 18 4月, 2007 1 次提交
  27. 13 2月, 2007 1 次提交
  28. 09 2月, 2007 1 次提交
  29. 29 11月, 2006 2 次提交