09 Oct, 2012

4 commits

  • This code was broken because it assumed that all MTD devices were map-based.
    Disable it for now, until it can be fixed properly for the next merge window.

    Signed-off-by: David Woodhouse

    David Woodhouse
     
  • UAPI Disintegration 2012-10-09

    Conflicts:
    MAINTAINERS
    arch/arm/configs/bcmring_defconfig
    arch/arm/mach-imx/clk-imx51-imx53.c
    drivers/mtd/nand/Kconfig
    drivers/mtd/nand/bcm_umi_nand.c
    drivers/mtd/nand/nand_bcm_umi.h
    drivers/mtd/nand/orion_nand.c

    David Woodhouse
     
  • A long time ago, in v2.4, VM_RESERVED kept swapout process off VMA,
    currently it lost original meaning but still has some effects:

    | effect | alternative flags
    -+------------------------+---------------------------------------------
    1| account as reserved_vm | VM_IO
    2| skip in core dump | VM_IO, VM_DONTDUMP
    3| do not merge or expand | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
    4| do not mlock | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP

    This patch removes reserved_vm counter from mm_struct. Seems like nobody
    cares about it, it does not exported into userspace directly, it only
    reduces total_vm showed in proc.

    Thus VM_RESERVED can be replaced with VM_IO or pair VM_DONTEXPAND | VM_DONTDUMP.

    remap_pfn_range() and io_remap_pfn_range() set VM_IO|VM_DONTEXPAND|VM_DONTDUMP.
    remap_vmalloc_range() set VM_DONTEXPAND | VM_DONTDUMP.

    [akpm@linux-foundation.org: drivers/vfio/pci/vfio_pci.c fixup]
    Signed-off-by: Konstantin Khlebnikov
    Cc: Alexander Viro
    Cc: Carsten Otte
    Cc: Chris Metcalf
    Cc: Cyrill Gorcunov
    Cc: Eric Paris
    Cc: H. Peter Anvin
    Cc: Hugh Dickins
    Cc: Ingo Molnar
    Cc: James Morris
    Cc: Jason Baron
    Cc: Kentaro Takeda
    Cc: Matt Helsley
    Cc: Nick Piggin
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Suresh Siddha
    Cc: Tetsuo Handa
    Cc: Venkatesh Pallipadi
    Acked-by: Linus Torvalds
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Konstantin Khlebnikov
     
  • When transparent huge pages were introduced, memory compaction and swap
    storms were an issue, and the kernel had to be careful to not make THP
    allocations cause pageout or compaction.

    Now that we have working compaction deferral, kswapd is smart enough to
    invoke compaction and the quadratic behaviour around isolate_free_pages
    has been fixed, it should be safe to remove __GFP_NO_KSWAPD.

    [minchan@kernel.org: Comment fix]
    [mgorman@suse.de: Avoid direct reclaim for deferred compaction]
    Cc: Andrea Arcangeli
    Signed-off-by: Rik van Riel
    Signed-off-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rik van Riel
     

08 Oct, 2012

1 commit

  • Pull UBI fastmap changes from Artem Bityutskiy:
    "This pull request contains the UBI fastmap support implemented by
    Richard Weinberger from Linutronix. Fastmap is designed to address
    UBI's slow scanning issues. Namely, it introduces a new on-flash
    data-structure called "fastmap", which stores the information about
    logicalphysical eraseblocks mappings. So now to get this
    information just read the fastmap, instead of doing full scan. More
    information here can be found in Richard's announcement in LKML
    (Subject: UBI: Fastmap request for inclusion (v19)):

    http://thread.gmane.org/gmane.linux.kernel/1364922/focus=1369109

    One thing I want to explicitly say is that fastmap did not have large
    enough linux-next exposure. It is partially my fault - I did not
    respond quickly enough. I _really_ apologize for this. But it had
    good testing and disabled by default, so I do not expect that we'll
    break anything.

    Fastmap is declared as experimental so far, and it is off by default.
    We did declare that the on-flash format may be changed. The reason
    for this is that no one used it in real production so far, so there is
    a high risk that something is missing. Besides, we do not have
    user-space tools supporting fastmap so far.

    Nevertheless, I suggest we merge this feature. Many people want UBI's
    scanning bottleneck to be fixed and merging fastmap now should
    accelerate its production use. The plan is to make it bullet-prove,
    somewhat clean-up, and make it the default for UBI. I do not know how
    many kernel releases will it take.

    Basically, I what I want to do for fastmap is something like Linus did
    for btrfs few years ago."

    * tag 'upstream-3.7-rc1-fastmap' of git://git.infradead.org/linux-ubi:
    UBI: Wire-up fastmap
    UBI: Add fastmap core
    UBI: Add fastmap support to the WL sub-system
    UBI: Add fastmap stuff to attach.c
    UBI: Wire-up ->fm_sem
    UBI: Add fastmap bits to build.c
    UBI: Add self_check_eba()
    UBI: Export next_sqnum()
    UBI: Add fastmap stuff to ubi.h
    UBI: Add fastmap on-flash data structures

    Linus Torvalds
     

06 Oct, 2012

1 commit

  • Pull powerpc updates from Benjamin Herrenschmidt:
    "Some highlights in addition to the usual batch of fixes:

    - 64TB address space support for 64-bit processes by Aneesh Kumar

    - Gavin Shan did a major cleanup & re-organization of our EEH support
    code (IBM fancy PCI error handling & recovery infrastructure) which
    paves the way for supporting different platform backends, along
    with some rework of the PCIe code for the PowerNV platform in order
    to remove home made resource allocations and instead use the
    generic code (which is possible after some small improvements to it
    done by Gavin).

    - Uprobes support by Ananth N Mavinakayanahalli

    - A pile of embedded updates from Freescale folks, including new SoC
    and board supports, more KVM stuff including preparing for 64-bit
    BookE KVM support, ePAPR 1.1 updates, etc..."

    Fixup trivial conflicts in drivers/scsi/ipr.c

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (146 commits)
    powerpc/iommu: Fix multiple issues with IOMMU pools code
    powerpc: Fix VMX fix for memcpy case
    driver/mtd:IFC NAND:Initialise internal SRAM before any write
    powerpc/fsl-pci: use 'Header Type' to identify PCIE mode
    powerpc/eeh: Don't release eeh_mutex in eeh_phb_pe_get
    powerpc: Remove tlb batching hack for nighthawk
    powerpc: Set paca->data_offset = 0 for boot cpu
    powerpc/perf: Sample only if SIAR-Valid bit is set in P7+
    powerpc/fsl-pci: fix warning when CONFIG_SWIOTLB is disabled
    powerpc/mpc85xx: Update interrupt handling for IFC controller
    powerpc/85xx: Enable USB support in p1023rds_defconfig
    powerpc/smp: Do not disable IPI interrupts during suspend
    powerpc/eeh: Fix crash on converting OF node to edev
    powerpc/eeh: Lock module while handling EEH event
    powerpc/kprobe: Don't emulate store when kprobe stwu r1
    powerpc/kprobe: Complete kprobe and migrate exception frame
    powerpc/kprobe: Introduce a new thread flag
    powerpc: Remove unused __get_user64() and __put_user64()
    powerpc/eeh: Global mutex to protect PE tree
    powerpc/eeh: Remove EEH PE for normal PCI hotplug
    ...

    Linus Torvalds
     

03 Oct, 2012

12 commits

  • Make fastmap known to Kconfig, UBI Makefile and MAINTAINERS.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • To make fastmap possible the WL sub-system needs some
    changes.
    Mostly to support fastmaps pools.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • - Export compare_lebs() as fastmap needs this function.
    - Implement fastmap scan logic.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • Fastmap uses ->fm_sem to stop EBA changes while writing
    a new fastmap.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • self_check_eba() compares two ubi_attach_info objects.
    Fastmap uses this function for self checks.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • Fastmap needs next_sqnum(), rename it to ubi_next_sqnum()
    and make it non-static.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • This patch adds fastmap specific data structures to ubi.h.
    It moves also struct ubi_work to ubi.h as it is now needed
    for more than one c file.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • Add the on-flash data structures neeed by fastmap
    to ubi-media.h

    Signed-off-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Richard Weinberger
     
  • Pull UBI changes from Artem Bityutskiy:
    "The main change is the way we reserve eraseblocks for bad blocks
    handling. We used to reserve 2% of the partition, but now we are more
    aggressive and we reserve 2% of the entire chip, which is what
    actually manufacturers specify in data sheets. We introduced an
    option to users to override the default, though.

    There are a couple of fixes as well, and a number of cleanups."

    * tag 'upstream-3.7-rc1' of git://git.infradead.org/linux-ubi: (24 commits)
    UBI: fix trivial typo 'it' => 'is'
    UBI: load after mtd device drivers
    UBI: print less
    UBI: use pr_ helper instead of printk
    UBI: comply with coding style
    UBI: erase free PEB with bitflip in EC header
    UBI: fix autoresize handling in R/O mode
    UBI: add max_beb_per1024 to attach ioctl
    UBI: allow specifying bad PEBs limit using module parameter
    UBI: check max_beb_per1024 value in ubi_attach_mtd_dev
    UBI: prepare for max_beb_per1024 module parameter addition
    UBI: introduce MTD_PARAM_MAX_COUNT
    UBI: separate bad_peb_limit in a function
    arm: sam9_l9260_defconfig: correct CONFIG_MTD_UBI_BEB_LIMIT
    UBI: use the whole MTD device size to get bad_peb_limit
    mtd: mtdparts: introduce mtd_get_device_size
    mtd: mark mtd_is_partition argument as constant
    arm: sam9_l9260_defconfig: remove non-existing config option
    UBI: kill CONFIG_MTD_UBI_BEB_RESERVE
    UBI: limit amount of reserved eraseblocks for bad PEB handling
    ...

    Linus Torvalds
     
  • Pull workqueue changes from Tejun Heo:
    "This is workqueue updates for v3.7-rc1. A lot of activities this
    round including considerable API and behavior cleanups.

    * delayed_work combines a timer and a work item. The handling of the
    timer part has always been a bit clunky leading to confusing
    cancelation API with weird corner-case behaviors. delayed_work is
    updated to use new IRQ safe timer and cancelation now works as
    expected.

    * Another deficiency of delayed_work was lack of the counterpart of
    mod_timer() which led to cancel+queue combinations or open-coded
    timer+work usages. mod_delayed_work[_on]() are added.

    These two delayed_work changes make delayed_work provide interface
    and behave like timer which is executed with process context.

    * A work item could be executed concurrently on multiple CPUs, which
    is rather unintuitive and made flush_work() behavior confusing and
    half-broken under certain circumstances. This problem doesn't
    exist for non-reentrant workqueues. While non-reentrancy check
    isn't free, the overhead is incurred only when a work item bounces
    across different CPUs and even in simulated pathological scenario
    the overhead isn't too high.

    All workqueues are made non-reentrant. This removes the
    distinction between flush_[delayed_]work() and
    flush_[delayed_]_work_sync(). The former is now as strong as the
    latter and the specified work item is guaranteed to have finished
    execution of any previous queueing on return.

    * In addition to the various bug fixes, Lai redid and simplified CPU
    hotplug handling significantly.

    * Joonsoo introduced system_highpri_wq and used it during CPU
    hotplug.

    There are two merge commits - one to pull in IRQ safe timer from
    tip/timers/core and the other to pull in CPU hotplug fixes from
    wq/for-3.6-fixes as Lai's hotplug restructuring depended on them."

    Fixed a number of trivial conflicts, but the more interesting conflicts
    were silent ones where the deprecated interfaces had been used by new
    code in the merge window, and thus didn't cause any real data conflicts.

    Tejun pointed out a few of them, I fixed a couple more.

    * 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (46 commits)
    workqueue: remove spurious WARN_ON_ONCE(in_irq()) from try_to_grab_pending()
    workqueue: use cwq_set_max_active() helper for workqueue_set_max_active()
    workqueue: introduce cwq_set_max_active() helper for thaw_workqueues()
    workqueue: remove @delayed from cwq_dec_nr_in_flight()
    workqueue: fix possible stall on try_to_grab_pending() of a delayed work item
    workqueue: use hotcpu_notifier() for workqueue_cpu_down_callback()
    workqueue: use __cpuinit instead of __devinit for cpu callbacks
    workqueue: rename manager_mutex to assoc_mutex
    workqueue: WORKER_REBIND is no longer necessary for idle rebinding
    workqueue: WORKER_REBIND is no longer necessary for busy rebinding
    workqueue: reimplement idle worker rebinding
    workqueue: deprecate __cancel_delayed_work()
    workqueue: reimplement cancel_delayed_work() using try_to_grab_pending()
    workqueue: use mod_delayed_work() instead of __cancel + queue
    workqueue: use irqsafe timer for delayed_work
    workqueue: clean up delayed_work initializers and add missing one
    workqueue: make deferrable delayed_work initializer names consistent
    workqueue: cosmetic whitespace updates for macro definitions
    workqueue: deprecate system_nrt[_freezable]_wq
    workqueue: deprecate flush[_delayed]_work_sync()
    ...

    Linus Torvalds
     

02 Oct, 2012

4 commits

  • Pull ARM soc multiplatform enablement from Olof Johansson:
    "This is a pretty significant branch. It's the introduction of the
    first multiplatform support on ARM, and with this (and the later
    branch) merged, it is now possible to build one kernel that contains
    support for highbank, vexpress, mvebu, socfpga, and picoxcell. More
    platforms will be convered over in the next few releases.

    Two critical last things had to be done for this to be practical and
    possible:
    * Today each platform has its own include directory under
    mach-/include/mach/*, and traditionally that is where a lot
    of driver/platform shared definitions have gone, such as platform
    data structures. They now need to move out to a common location
    instead, and this branch moves a large number of those out to
    include/linux/platform_data.
    * Each platform used to list the device trees to compile for its
    boards in mach-/Makefile.boot.

    Both of the above changes will mean that there are some merge
    conflicts to come (and some to resolve here). It's a one-time move
    and once it settles in, we should be good for quite a while. Sorry
    for the overhead."

    Fix conflicts as per Olof.

    * tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (51 commits)
    ARM: add v7 multi-platform defconfig
    ARM: msm: Move core.h contents into common.h
    ARM: highbank: call highbank_pm_init from .init_machine
    ARM: dtb: move all dtb targets to common Makefile
    ARM: spear: move platform_data definitions
    ARM: samsung: move platform_data definitions
    ARM: orion: move platform_data definitions
    ARM: vexpress: convert to multi-platform
    ARM: initial multiplatform support
    ARM: mvebu: move armada-370-xp.h in mach dir
    ARM: vexpress: remove dependency on mach/* headers
    ARM: picoxcell: remove dependency on mach/* headers
    ARM: move all dtb targets out of Makefile.boot
    ARM: picoxcell: move debug macros to include/debug
    ARM: socfpga: move debug macros to include/debug
    ARM: mvebu: move debug macros to include/debug
    ARM: vexpress: move debug macros to include/debug
    ARM: highbank: move debug macros to include/debug
    ARM: move debug macros to common location
    ARM: make mach/gpio.h headers optional
    ...

    Linus Torvalds
     
  • Pull ARM soc driver specific changes from Olof Johansson:
    - A long-coming conversion of various platforms to a common LED
    infrastructure
    - AT91 is moved over to use the newer MCI driver for MMC
    - Pincontrol conversions for samsung platforms
    - DT bindings for gscaler on samsung
    - i2c driver fixes for tegra, acked by i2c maintainer

    Fix up conflicts as per Olof.

    * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (48 commits)
    drivers: bus: omap_l3: use resources instead of hardcoded irqs
    pinctrl: exynos: Fix wakeup IRQ domain registration check
    pinctrl: samsung: Uninline samsung_pinctrl_get_soc_data
    pinctrl: exynos: Correct the detection of wakeup-eint node
    pinctrl: exynos: Mark exynos_irq_demux_eint as inline
    pinctrl: exynos: Handle only unmasked wakeup interrupts
    pinctrl: exynos: Fix typos in gpio/wkup _irq_mask
    pinctrl: exynos: Set pin function to EINT in irq_set_type of GPIO EINTa
    drivers: bus: Move the OMAP interconnect driver to drivers/bus/
    i2c: tegra: dynamically control fast clk
    i2c: tegra: I2_M_NOSTART functionality not supported in Tegra20
    ARM: tegra: clock: remove unused clock entry for i2c
    ARM: tegra: clock: add connection name in i2c clock entry
    i2c: tegra: pass proper name for getting clock
    ARM: tegra: clock: add i2c fast clock entry in clock table
    ARM: EXYNOS: Adds G-Scaler device from Device Tree
    ARM: EXYNOS: Add clock support for G-Scaler
    ARM: EXYNOS: Enable pinctrl driver support for EXYNOS4 device tree enabled platform
    ARM: dts: Add pinctrl node entries for SAMSUNG EXYNOS4210 SoC
    ARM: EXYNOS: skip wakeup interrupt setup if pinctrl driver is used
    ...

    Linus Torvalds
     
  • Pull ARM soc device tree updates from Olof Johansson:
    "Device tree conversion and enablement branch. Mostly a bunch of new
    bindings and setup for various platforms, but the Via/Winchip VT8500
    platform is also converted over from being 100% legacy to now use
    device tree for probing. More of that will come for 3.8."

    Trivial conflicts due to removal of vt8500 files, and one documentation
    file that was added with slightly different contents both here and in
    the USb tree.

    * tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (212 commits)
    arm: vt8500: Fixup for missing gpio.h
    ARM: LPC32xx: LED fix in PHY3250 DTS file
    ARM: dt: mmp-dma: add binding file
    arm: vt8500: Update arch-vt8500 to devicetree support.
    arm: vt8500: gpio: Devicetree support for arch-vt8500
    arm: vt8500: doc: Add device tree bindings for arch-vt8500 devices
    arm: vt8500: clk: Add Common Clock Framework support
    video: vt8500: Add devicetree support for vt8500-fb and wm8505-fb
    serial: vt8500: Add devicetree support for vt8500-serial
    rtc: vt8500: Add devicetree support for vt8500-rtc
    arm: vt8500: Add device tree files for VIA/Wondermedia SoC's
    ARM: tegra: Add Avionic Design Tamonten Evaluation Carrier support
    ARM: tegra: Add Avionic Design Medcom-Wide support
    ARM: tegra: Add Avionic Design Plutux support
    ARM: tegra: Add Avionic Design Tamonten support
    ARM: tegra: dts: Add pwm label
    ARM: ux500: Fix SSP register address format
    ARM: ux500: Apply tc3589x's GPIO/IRQ properties to HREF's DT
    ARM: ux500: Remove redundant #gpio-cell properties from Snowball DT
    ARM: ux500: Add all encompassing sound node to the HREF Device Tree
    ...

    Linus Torvalds
     
  • Pull ARM soc general cleanups from Olof Johansson:
    "This is a large branch that contains a handful of different cleanups:

    - Fixing up the I/O space remapping on PCI on ARM. This is a series
    from Rob Herring that restructures how all pci devices allocate I/O
    space, and it's part of the work to allow multiplatform kernels.
    - A number of cleanup series for OMAP, moving and removing some
    headers, sparse irq rework and in general preparation for
    multiplatform.
    - Final removal of all non-DT boards for Tegra, it is now
    device-tree-only!
    - Removal of a stale platform, nxp4008. It's an old mobile chipset
    that is no longer in use, and was very likely never really used
    with a mainline kernel. We have not been able to find anyone
    interested in keeping it around in the kernel.
    - Removal of the legacy dmaengine driver on tegra

    + A handful of other things that I haven't described above."

    Fix up some conflicts with the staging tree (and because nxp4008 was
    removed)

    * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (184 commits)
    ARM: OMAP2+: serial: Change MAX_HSUART_PORTS to 6
    ARM: OMAP4: twl-common: Support for additional devices on i2c1 bus
    ARM: mmp: using for_each_set_bit to simplify the code
    ARM: tegra: harmony: fix ldo7 regulator-name
    ARM: OMAP2+: Make omap4-keypad.h local
    ARM: OMAP2+: Make l4_3xxx.h local
    ARM: OMAP2+: Make l4_2xxx.h local
    ARM: OMAP2+: Make l3_3xxx.h local
    ARM: OMAP2+: Make l3_2xxx.h local
    ARM: OMAP1: Move irda.h from plat to mach
    ARM: OMAP2+: Make hdq1w.h local
    ARM: OMAP2+: Make gpmc-smsc911x.h local
    ARM: OMAP2+: Make gpmc-smc91x.h local
    ARM: OMAP1: Move flash.h from plat to mach
    ARM: OMAP2+: Make debug-devices.h local
    ARM: OMAP1: Move board-voiceblue.h from plat to mach
    ARM: OMAP1: Move board-sx1.h from plat to mach
    ARM: OMAP2+: Make omap-wakeupgen.h local
    ARM: OMAP2+: Make omap-secure.h local
    ARM: OMAP2+: Make ctrl_module_wkup_44xx.h local
    ...

    Linus Torvalds
     

29 Sep, 2012

18 commits

  • Datasheets for the following Samsung NAND parts (both MLC and SLC) describe
    extensions to the Samsung 6-byte extended ID decoding table:

    K9GBG08U0A (MLC, 6-byte ID)
    K9GAG08U0F (MLC, 6-byte ID)
    K9FAG08U0M (SLC, 6-byte ID)

    The table found in K9GAG08U0F, p.44, contains a superset of the information
    found in other previous datasheets.

    This patch adds support for all of these chips, with 512B and 640B OOB sizes.
    It also changes the detection pattern such that this table applies to all
    Samsung 6-byte ID NAND, not just MLC. This is safe, according to the NAND
    parameter data I have collected:

    Note that nand_base.c does not yet support the bad block marker scheme defined
    for these chips (i.e., scan 1st and last page for BB markers).

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • Hynix has introduced a new ID decoding scheme for their newer MLC, some of
    which don't support ONFI. The following devices all follow the pattern given in
    the datasheet for Hynix H27UBG8T2B, p.22:

    Hynix H27UAG8T2A
    Hynix H27UBG8T2A
    Hynix H27UBG8T2B

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • When decoding the extended ID bytes of a NAND chip, we have to calculate the ID
    length according to some heuristic patterns (e.g., Does the ID wrap around?
    Does it end in trailing zeros?). Currently, these heuristics are built into
    complicated if/else blocks that can be hard to understand.

    Now, these checks can be done generically in a function, making them more
    robust and reusable. In fact, this sort of calculation is needed in future
    additions to nand_base.c. And with this advancement, we get the added benefit
    of a more readable "extended ID decode".

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • When detecting NAND parameters, the code gets a little ugly so that the
    logic is obscured. Try to remedy that by moving code to separate functions
    that have well-defined purposes.

    This patch splits out the simple ID decode functionality, where all the
    information regarding NAND size/blocksize/pagesize/oobsize/busw is encoded in
    the first two bytes of the ID string.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • When detecting NAND parameters, the code gets a little ugly so that the
    logic is obscured. Try to remedy that by moving code to separate functions
    that have well-defined purposes.

    This patch splits out the extended ID decode functionality, which handles
    decoding the 3rd-8th ID bytes to determine NAND device parameters.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • When detecting NAND parameters, the code gets a little ugly so that the
    logic is obscured. Try to remedy that by moving code to separate functions
    that have well-defined purposes.

    This patch splits the bad block marker options detection into its own function,
    away from the other parameters (e.g., chip size, page size, etc.).

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • Instead of reading 2 bytes then later 8 bytes, we can simply read all 8
    bytes from the start.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • We don't actually use the 'ret' variable; we set it, test it, and then it dies.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • While building an allyesconfig for UML I received this error message(s):
    drivers/mtd/nand/docg4.c: In function 'probe_docg4':
    drivers/mtd/nand/docg4.c:1272:2: error: implicit declaration of function
    'ioremap' [-Werror=implicit-function-declaration]
    drivers/mtd/nand/docg4.c:1272:10: warning: assignment makes pointer from
    integer without a cast [enabled by default]
    drivers/mtd/nand/docg4.c:1327:2: error: implicit declaration of function
    'iounmap' [-Werror=implicit-function-declaration]

    which is caused by the missing implementations on UML.

    This patch adds this missing HAS_IOMEM dependency and prevents the driver from
    being build on platforms with no HAS_IOMEM

    Signed-off-by: Peter Huewe
    Acked-by: Mike Dunn
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Peter Huewe
     
  • The current code initializes the timing registers at very time
    we call the gpmi_begin(). This really wastes the cpu cycles.

    Add a new flag to let the gpmi driver initializes the timing registers
    only one time.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • When the frequency on the nand chip pins is above 33MHz,
    the nand EDO(extended Data Out) timing could be applied.
    The GPMI implements a Feedback read strobe to sample the read data in
    the EDO timing mode.

    This patch adds the EDO feature for the gpmi-nand driver.

    For some onfi nand chips, the mode 4 is the fastest;
    while for other onfi nand chips, the mode 5 is the fastest.
    This patch only adds the support for the fastest asynchronous timing mode.
    So this patch only supports the mode 4 and mode 5.

    I tested several Micron's ONFI nand chips with EDO enabled,
    take Micron MT29F32G08MAA for example (in mode 5, 100MHz):

    1) The test result BEFORE we add the EDO feature:
    =================================================
    mtd_speedtest: MTD device: 2
    mtd_speedtest: MTD device size 209715200, eraseblock size 524288,
    page size 4096, count of eraseblocks 400,
    pages per eraseblock 128, OOB size 218
    .......................................
    mtd_speedtest: testing eraseblock read speed
    mtd_speedtest: eraseblock read speed is 3632 KiB/s
    .......................................
    mtd_speedtest: testing page read speed
    mtd_speedtest: page read speed is 3554 KiB/s
    .......................................
    mtd_speedtest: testing 2 page read speed
    mtd_speedtest: 2 page read speed is 3592 KiB/s
    .......................................
    =================================================

    2) The test result AFTER we add the EDO feature:
    =================================================
    mtd_speedtest: MTD device: 2
    mtd_speedtest: MTD device size 209715200, eraseblock size 524288,
    page size 4096, count of eraseblocks 400,
    pages per eraseblock 128, OOB size 218
    .......................................
    mtd_speedtest: testing eraseblock read speed
    mtd_speedtest: eraseblock read speed is 19555 KiB/s
    .......................................
    mtd_speedtest: testing page read speed
    mtd_speedtest: page read speed is 17319 KiB/s
    .......................................
    mtd_speedtest: testing 2 page read speed
    mtd_speedtest: 2 page read speed is 18339 KiB/s
    .......................................
    =================================================

    3) The read data performance is much improved by more then 5 times.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • The default frequencies of the extra clocks are 200MHz.
    The current code sets the extra clocks to 44.5MHz.

    When i add the EDO feature to gpmi, i have to revert the extra clocks
    to 200MHz.

    So it is better that we do not set the default values for the extra
    clocks. The driver runs well even when we do not set the default values for
    extra clocks.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • The setting DLL code is a little mess.
    Just simplify the code and the comments.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • add the WRN_DLY_SEL field for HW_GPMI_CTRL1.
    This field is used as delay for gpmi write strobe.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • The current code will gets the clock frequency which is used by
    gpmi_nfc_compute_hardware_timing(). It makes the code a little mess.

    So move the `get clock frequency` code to the
    gpmi_nfc_compute_hardware_timing() itself. This makes the code tidy
    and clean.

    This patch also uses the macro NSEC_PER_SEC to replace the `1000000000`.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • The gpmi_nfc_compute_hardware_timing{} should contains all the
    fields setting for gpmi timing registers. It already contains the fields
    for HW_GPMI_TIMING0 and HW_GPMI_CTRL1.

    So it is better to add a new field setting for HW_GPMI_TIMING1 in
    this data structure. This makes the code more clear in logic.

    This patch also changes some comments to make the code more readable.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • Add the set-features(0xef)/get-features(0xee) helpers for ONFI nand.
    Also add the necessary macros.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • drivers/mtd/nand/fsl_ifc_nand.c:196:34: warning: cast removes address space of expression [sparse]
    drivers/mtd/nand/fsl_ifc_nand.c:196:34: warning: incorrect type in initializer (different address spaces) [sparse]
    drivers/mtd/nand/fsl_ifc_nand.c:196:34: expected unsigned int [noderef] [usertype] *mainarea [sparse]
    drivers/mtd/nand/fsl_ifc_nand.c:196:34: got unsigned int [usertype] * [sparse]
    ...

    Signed-off-by: Kim Phillips
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Kim Phillips