1. 12 Nov, 2013 1 commit
  2. 09 Nov, 2013 5 commits
    • Chen Gang's avatar
      ARM: 7868/1: arm/arm64: remove atomic_clear_mask() in "include/asm/atomic.h" · aed3a4ed
      Chen Gang authored
      In current kernel wide source code, except other architectures, only
      s390 scsi drivers use atomic_clear_mask(), and arm/arm64 need not
      support s390 drivers.
      
      So remove atomic_clear_mask() from "arm[64]/include/asm/atomic.h".
      Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      aed3a4ed
    • Chen Gang's avatar
      ARM: 7867/1: include: asm: use 'int' instead of 'unsigned long' for 'oldval' in atomic_cmpxchg(). · 4dcc1cf7
      Chen Gang authored
      For atomic_cmpxchg(), the type of 'oldval' need be 'int' to match the
      type of "*ptr" (used by 'ldrex' instruction) and 'old' (used by 'teq'
      instruction).
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      4dcc1cf7
    • Chen Gang's avatar
      ARM: 7866/1: include: asm: use 'long long' instead of 'u64' within atomic.h · 237f1233
      Chen Gang authored
      atomic* value is signed value, and atomic* functions need also process
      signed value (parameter value, and return value), so 32-bit arm need
      use 'long long' instead of 'u64'.
      
      After replacement, it will also fix a bug for atomic64_add_negative():
      "u64 is never less than 0".
      
      The modifications are:
      
        in vim, use "1,% s/\<u64\>/long long/g" command.
        remove '__aligned(8)' which is useless for 64-bit.
        be sure of 80 column limitation after replacement.
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      237f1233
    • Michal Simek's avatar
      ARM: 7871/1: amba: Extend number of IRQS · 4d8981f6
      Michal Simek authored
      Xilinx Zynq pl330 dma driver has 9 irqs which all have to
      be used by the driver to get it work properly.
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      4d8981f6
    • Stephen Boyd's avatar
      ARM: 7887/1: Don't smp_cross_call() on UP devices in arch_irq_work_raise() · c682e51d
      Stephen Boyd authored
      If we're running a kernel compiled with SMP_ON_UP=y and the
      hardware only supports UP operation there isn't any
      smp_cross_call function assigned. Unfortunately, we call
      smp_cross_call() unconditionally in arch_irq_work_raise() and
      crash the kernel on UP devices. Check to make sure we're running
      on an SMP device before calling smp_cross_call() here.
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = c0004000
      [00000000] *pgd=00000000
      Internal error: Oops: 80000005 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-rc6-00018-g8d451442-dirty #16
      task: de05b440 ti: de05c000 task.ti: de05c000
      PC is at 0x0
      LR is at arch_irq_work_raise+0x3c/0x48
      pc : [<00000000>]    lr : [<c0019590>]    psr: 60000193
      sp : de05dd60  ip : 00000001  fp : 00000000
      r10: c085e2f0  r9 : de05c000  r8 : c07be0a4
      r7 : de05c000  r6 : de05c000  r5 : c07c5778  r4 : c0824554
      r3 : 00000000  r2 : 00000000  r1 : 00000006  r0 : c0529a58
      Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM Segment kernel
      Control: 10c5387d  Table: 80004019  DAC: 00000017
      Process swapper/0 (pid: 1, stack limit = 0xde05c248)
      Stack: (0xde05dd60 to 0xde05e000)
      dd60: c07b9dbc c00cb2dc 00000001 c08242c0 c08242c0 60000113 c07be0a8 c00b0590
      dd80: de05c000 c085e2f0 c08242c0 c08242c0 c1414c28 c00b07cc de05b440 c1414c28
      dda0: c08242c0 c00b0af8 c0862bb0 c0862db0 c1414cd8 de05c028 c0824840 de05ddb8
      ddc0: 00000000 00000009 00000001 00000024 c07be0a8 c07be0a4 de05c000 c085e2f0
      dde0: 00000000 c004a4b0 00000010 de00d2dc 00000054 00000100 00000024 00000000
      de00: de05c028 0000000a ffff8ae7 00200040 00000016 de05c000 60000193 de05c000
      de20: 00000054 00000000 00000000 00000000 00000000 c004a704 00000000 de05c008
      de40: c07ba254 c004aa1c c07c5778 c0014b70 fa200000 00000054 de05de80 c0861244
      de60: 00000000 c0008634 de05b440 c051c778 20000113 ffffffff de05deb4 c051d0a4
      de80: 00000001 00000001 00000000 de05b440 c082afac de057ac0 de057ac0 de0443c0
      dea0: 00000000 00000000 00000000 00000000 c082afbc de05dec8 c009f2a0 c051c778
      dec0: 20000113 ffffffff 00000000 c016edb0 00000000 000002b0 de057ac0 de057ac0
      dee0: 00000000 c016ee40 c0875e50 de05df2e de057ac0 00000000 00000013 00000000
      df00: 00000000 c016f054 de043600 de0443c0 c008eb38 de004ec0 c0875e50 c008eb44
      df20: 00000012 00000000 00000000 3931f0f8 00000000 00000000 00000014 c0822e84
      df40: 00000000 c008ed2c 00000000 00000000 00000000 c07b7490 c07b7490 c075ab3c
      df60: 00000000 c00701ac 00000002 00000000 c0070160 dffadb73 7bf8edb4 00000000
      df80: c051092c 00000000 00000000 00000000 00000000 00000000 00000000 c0510934
      dfa0: de05aa40 00000000 c051092c c0013ce8 00000000 00000000 00000000 00000000
      dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 07efffe5 4dfac6f5
      [<c0019590>] (arch_irq_work_raise+0x3c/0x48) from [<c00cb2dc>] (irq_work_queue+0xe4/0xf8)
      [<c00cb2dc>] (irq_work_queue+0xe4/0xf8) from [<c00b0590>] (rcu_accelerate_cbs+0x1d4/0x1d8)
      [<c00b0590>] (rcu_accelerate_cbs+0x1d4/0x1d8) from [<c00b07cc>] (rcu_start_gp+0x34/0x48)
      [<c00b07cc>] (rcu_start_gp+0x34/0x48) from [<c00b0af8>] (rcu_process_callbacks+0x318/0x608)
      [<c00b0af8>] (rcu_process_callbacks+0x318/0x608) from [<c004a4b0>] (__do_softirq+0x114/0x2a0)
      [<c004a4b0>] (__do_softirq+0x114/0x2a0) from [<c004a704>] (do_softirq+0x6c/0x74)
      [<c004a704>] (do_softirq+0x6c/0x74) from [<c004aa1c>] (irq_exit+0xac/0x100)
      [<c004aa1c>] (irq_exit+0xac/0x100) from [<c0014b70>] (handle_IRQ+0x54/0xb4)
      [<c0014b70>] (handle_IRQ+0x54/0xb4) from [<c0008634>] (omap3_intc_handle_irq+0x60/0x74)
      [<c0008634>] (omap3_intc_handle_irq+0x60/0x74) from [<c051d0a4>] (__irq_svc+0x44/0x5c)
      Exception stack(0xde05de80 to 0xde05dec8)
      de80: 00000001 00000001 00000000 de05b440 c082afac de057ac0 de057ac0 de0443c0
      dea0: 00000000 00000000 00000000 00000000 c082afbc de05dec8 c009f2a0 c051c778
      dec0: 20000113 ffffffff
      [<c051d0a4>] (__irq_svc+0x44/0x5c) from [<c051c778>] (_raw_spin_unlock_irq+0x28/0x2c)
      [<c051c778>] (_raw_spin_unlock_irq+0x28/0x2c) from [<c016edb0>] (proc_alloc_inum+0x30/0xa8)
      [<c016edb0>] (proc_alloc_inum+0x30/0xa8) from [<c016ee40>] (proc_register+0x18/0x130)
      [<c016ee40>] (proc_register+0x18/0x130) from [<c016f054>] (proc_mkdir_data+0x44/0x6c)
      [<c016f054>] (proc_mkdir_data+0x44/0x6c) from [<c008eb44>] (register_irq_proc+0x6c/0x128)
      [<c008eb44>] (register_irq_proc+0x6c/0x128) from [<c008ed2c>] (init_irq_proc+0x74/0xb0)
      [<c008ed2c>] (init_irq_proc+0x74/0xb0) from [<c075ab3c>] (kernel_init_freeable+0x84/0x1c8)
      [<c075ab3c>] (kernel_init_freeable+0x84/0x1c8) from [<c0510934>] (kernel_init+0x8/0x150)
      [<c0510934>] (kernel_init+0x8/0x150) from [<c0013ce8>] (ret_from_fork+0x14/0x2c)
      Code: bad PC value
      
      Fixes: bf18525f "ARM: 7872/1: Support arch_irq_work_raise() via self IPIs"
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Tested-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      c682e51d
  3. 07 Nov, 2013 1 commit
    • Stephen Boyd's avatar
      ARM: 7872/1: Support arch_irq_work_raise() via self IPIs · bf18525f
      Stephen Boyd authored
      By default, IRQ work is run from the tick interrupt (see
      irq_work_run() in update_process_times()). When we're in full
      NOHZ mode, restarting the tick requires the use of IRQ work and
      if the only place we run IRQ work is in the tick interrupt we
      have an unbreakable cycle. Implement arch_irq_work_raise() via
      self IPIs to break this cycle and get the tick started again.
      Note that we implement this via IPIs which are only available on
      SMP builds. This shouldn't be a problem because full NOHZ is only
      supported on SMP builds anyway.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Reviewed-by: default avatarKevin Hilman <khilman@linaro.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      bf18525f
  4. 31 Oct, 2013 1 commit
    • Russell King's avatar
      ARM: footbridge: fix build warnings for netwinder · 8d451442
      Russell King authored
      arch/arm/mach-footbridge/netwinder-hw.c:695:2: warning: passing argument 1 of 'spinlock_check' from incompatible pointer type
      arch/arm/mach-footbridge/netwinder-hw.c:702:2: warning: passing argument 1 of 'spin_unlock_irqrestore' from incompatible pointer type
      arch/arm/mach-footbridge/netwinder-hw.c:712:2: warning: passing argument 1 of 'spinlock_check' from incompatible pointer type
      arch/arm/mach-footbridge/netwinder-hw.c:714:2: warning: passing argument 1 of 'spin_unlock_irqrestore' from incompatible pointer type
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      8d451442
  5. 29 Oct, 2013 17 commits
  6. 27 Oct, 2013 8 commits
    • Linus Torvalds's avatar
      Linux 3.12-rc7 · 959f5854
      Linus Torvalds authored
      959f5854
    • Linus Torvalds's avatar
      Merge branch 'parisc-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · a2ff8206
      Linus Torvalds authored
      Pull parisc fix from Helge Deller:
       "This is a 2-line patch to save the CPU register which holds our task
        thread info pointer before calling a firmware function and then to
        restore it again afterwards.
      
        This is necessary because on some 64bit machines the high-order 32bits
        are being clobbered by the firmware call, and thus we failed to bring
        up secondary CPUs (and instead crashed the kernel) in some situations
        eg if we had more than 4GB RAM.  This patch fixes a bug which has been
        since ever in the parisc linux kernel and which prevented some people
        to use a 64bit kernel"
      
      * 'parisc-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Do not crash 64bit SMP kernels on machines with >= 4GB RAM
      a2ff8206
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · aff22d3f
      Linus Torvalds authored
      Pull timer fix from Ingo Molnar:
       "This tree contains a clockevents regression fix for certain ARM
        subarchitectures"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clockevents: Sanitize ticks to nsec conversion
      aff22d3f
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e2756f5e
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "The tree contains three fixes:
      
         - Two tooling fixes
      
         - Reversal of the new 'MMAP2' extended mmap record ABI, introduced in
           this merge window.  (Patches were proposed to fix it but it was all
           a bit late and we felt it's safer to just delay the ABI one more
           kernel release and do it right)"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf: Disable PERF_RECORD_MMAP2 support
        perf scripting perl: Fix build error on Fedora 12
        perf probe: Fix to initialize fname always before use it
      e2756f5e
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1c99ca43
      Linus Torvalds authored
      Pull locking fix from Ingo Molnar:
       "This tree fixes a boot crash in CONFIG_DEBUG_MUTEXES=y kernels, on
        kernels built with GCC 3.x (there are still such distros)"
      
      Side note: it's not just a fix for old gcc versions, it's also removing
      an incredibly broken/subtle check that LLVM had issues with, and that
      made no sense.
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        mutex: Avoid gcc version dependent __builtin_constant_p() usage
      1c99ca43
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · acda24c4
      Linus Torvalds authored
      Pull SCSI target fixes from Nicholas Bellinger:
       "Here are the outstanding target pending fixes for v3.12-rc7.
      
        This includes a number of EXTENDED_COPY related fixes as a result of
        Thomas and Doug's continuing testing and feedback.
      
        Also included is an important vhost/scsi fix that addresses a long
        standing issue where the 'write' parameter for get_user_pages_fast()
        was incorrectly set for virtio-scsi WRITEs -> DMA_TO_DEVICE, and not
        for virtio-scsi READs -> DMA_FROM_DEVICE.
      
        This resulted in random userspace segfaults and other unpleasantness
        on KVM host, and unfortunately has been an issue since the initial
        merge of vhost/scsi in v3.6.  This patch is CC'ed to stable, along
        with two other less critical items"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter
        target/pscsi: fix return value check
        target: Fail XCOPY for non matching source + destination block_size
        target: Generate failure for XCOPY I/O with non-zero scsi_status
        target: Add missing XCOPY I/O operation sense_buffer
        iser-target: check device before dereferencing its variable
        target: Return an error for WRITE SAME with ANCHOR==1
        target: Fix assignment of LUN in tracepoints
        target: Reject EXTENDED_COPY when emulate_3pc is disabled
        target: Allow non zero ListID in EXTENDED_COPY parameter list
        target: Make target_do_xcopy failures return INVALID_PARAMETER_LIST
      acda24c4
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · 63e65608
      Linus Torvalds authored
      Pull slave-dmaengine fixes from Vinod Koul:
       "Here is the late fixes pull request for dmaengine while you fly back
        from KS.
      
        We have a new dmaengine ML hosted by vger so a patch for that along
        with addition of Dave as driver mainatainer for ioat.  Other fixes are
        memeory leak fixes on edma driver, small fixes on rcar-hpbdma driver
        by Sergei"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: edma: fix another memory leak
        dma: edma: Fix memory leak
        MAINTAINERS: add to ioatdma maintainer list
        MAINTAINERS: add the new dmaengine mailing list
      63e65608
    • Helge Deller's avatar
      parisc: Do not crash 64bit SMP kernels on machines with >= 4GB RAM · 54e181e0
      Helge Deller authored
      Since the beginning of the parisc-linux port, sometimes 64bit SMP kernels were
      not able to bring up other CPUs than the monarch CPU and instead crashed the
      kernel.  The reason was unclear, esp. since it involved various machines (e.g.
      J5600, J6750 and SuperDome). Testing showed, that those crashes didn't happened
      when less than 4GB were installed, or if a 32bit Linux kernel was booted.
      
      In the end, the fix for those SMP problems is trivial:
      During the early phase of the initialization of the CPUs, including the monarch
      CPU, the PDC_PSW firmware function to enable WIDE (=64bit) mode is called.
      It's documented that this firmware function may clobber various registers, and
      one one of those possibly clobbered registers is %cr30 which holds the task
      thread info pointer.
      
      Now, if %cr30 would always have been clobbered, then this bug would have been
      detected much earlier. But lots of testing finally showed, that - at least for
      %cr30 - on some machines only the upper 32bits of the 64bit register suddenly
      turned zero after the firmware call.
      
      So, after finding the root cause, the explanation for the various crashes
      became clear:
      - On 32bit SMP Linux kernels all upper 32bit were zero, so we didn't faced this
        problem.
      - Monarch CPUs in 64bit mode always booted sucessfully, because the inital task
        thread info pointer was below 4GB.
      - Secondary CPUs booted sucessfully on machines with less than 4GB RAM because
        the upper 32bit were zero anyay.
      - Secondary CPus failed to boot if we had more than 4GB RAM and the task thread
        info pointer was located above the 4GB boundary.
      
      Finally, the patch to fix this problem is trivial by saving the %cr30 register
      before the firmware call and restoring it afterwards.
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarJohn David Anglin <dave.anglin@bell.net>
      Cc: <stable@vger.kernel.org> # 2.6.12+
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      54e181e0
  7. 26 Oct, 2013 1 commit
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-3.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 20582e34
      Linus Torvalds authored
      Pull ACPI and power management fixes from
       "These fix two bugs in the intel_pstate driver, a hibernate bug leading
        to nasty resume failures sometimes and acpi-cpufreq initialization bug
        that causes problems to happen during module unload when intel_pstate
        is in use.
      
        Specifics:
      
         - Fix for rounding errors in intel_pstate causing CPU utilization to
           be underestimated from Brennan Shacklett.
      
         - intel_pstate fix to always use the correct max pstate value when
           computing the min pstate from Dirk Brandewie.
      
         - Hibernation fix for deadlocking resume in cases when the probing of
           the device containing the image is deferred from Russ Dill.
      
         - acpi-cpufreq fix to prevent the module from staying in memory when
           the driver cannot be registered and then attempting to unregister
           things that have never been registered on exit"
      
      * tag 'pm+acpi-3.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        acpi-cpufreq: Fail initialization if driver cannot be registered
        PM / hibernate: Move software_resume to late_initcall_sync
        intel_pstate: Correct calculation of min pstate value
        intel_pstate: Improve accuracy by not truncating until final result
      20582e34
  8. 25 Oct, 2013 6 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20131025' of git://git.infradead.org/linux-mtd · d255c59a
      Linus Torvalds authored
      Pull final mtd fixes from Brian Norris:
       "A few more last-minute regression fixes, prepared jointly by me and
        David Woodhouse:
      
         - Revert pxa3xx to its old name to avoid breaking existing
           'mtdparts=' boot strings.
      
         - Return GPMI NAND to its legacy ECC layout for backwards
           compatibility.  We will revisit this in 3.13.
      
        A note from David on the latter fix: 'This leaves a harmless cosmetic
        warning about an unused function.  At this point in the cycle I really
        don't care.'"
      
      * tag 'for-linus-20131025' of git://git.infradead.org/linux-mtd:
        mtd: gpmi: fix ECC regression
        mtd: nand: pxa3xx: Fix registered MTD name
      d255c59a
    • Nicholas Bellinger's avatar
      vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter · 60a01f55
      Nicholas Bellinger authored
      This patch addresses a long-standing bug where the get_user_pages_fast()
      write parameter used for setting the underlying page table entry permission
      bits was incorrectly set to write=1 for data_direction=DMA_TO_DEVICE, and
      passed into get_user_pages_fast() via vhost_scsi_map_iov_to_sgl().
      
      However, this parameter is intended to signal WRITEs to pinned userspace
      PTEs for the virtio-scsi DMA_FROM_DEVICE -> READ payload case, and *not*
      for the virtio-scsi DMA_TO_DEVICE -> WRITE payload case.
      
      This bug would manifest itself as random process segmentation faults on
      KVM host after repeated vhost starts + stops and/or with lots of vhost
      endpoints + LUNs.
      
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Asias He <asias@redhat.com>
      Cc: <stable@vger.kernel.org> # 3.6+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      60a01f55
    • Wei Yongjun's avatar
      target/pscsi: fix return value check · 58932e96
      Wei Yongjun authored
      In case of error, the function scsi_host_lookup() returns NULL
      pointer not ERR_PTR(). The IS_ERR() test in the return value check
      should be replaced with NULL test.
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      58932e96
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · f55ac56d
      Linus Torvalds authored
      Pull vfs fixes (try two) from Al Viro:
       "nfsd performance regression fix + seq_file lseek(2) fix"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        seq_file: always update file->f_pos in seq_lseek()
        nfsd regression since delayed fput()
      f55ac56d
    • David Woodhouse's avatar
      mtd: gpmi: fix ECC regression · 031e2777
      David Woodhouse authored
      The "legacy" ECC layout used until 3.12-rc1 uses all the OOB area by
      computing the ECC strength and ECC step size ourselves.
      
      Commit 2febcdf8 ("mtd: gpmi: set the BCHs geometry with the ecc info")
      makes the driver use the ECC info (ECC strength and ECC step size)
      provided by the MTD code, and creates a different NAND ECC layout
      for the BCH, and use the new ECC layout. This causes a regression:
      
         We can not mount the ubifs which was created by the old NAND ECC layout.
      
      This patch fixes this issue by reverting to the legacy ECC layout.
      
      We will probably introduce a new device-tree property to indicate that
      the new ECC layout can be used. For now though, for the imminent 3.12
      release, we just unconditionally revert to the 3.11 behaviour.
      
      This leaves a harmless cosmetic warning about an unused function. At
      this point in the cycle I really don't care.
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Acked-by: default avatarHuang Shijie <b32955@freescale.com>
      Acked-by: default avatarMarek Vasut <marex@denx.de>
      Tested-by: default avatarMarek Vasut <marex@denx.de>
      031e2777
    • Gu Zheng's avatar
      seq_file: always update file->f_pos in seq_lseek() · 05e16745
      Gu Zheng authored
      This issue was first pointed out by Jiaxing Wang several months ago, but no
      further comments:
      https://lkml.org/lkml/2013/6/29/41
      
      As we know pread() does not change f_pos, so after pread(), file->f_pos
      and m->read_pos become different. And seq_lseek() does not update file->f_pos
      if offset equals to m->read_pos, so after pread() and seq_lseek()(lseek to
      m->read_pos), then a subsequent read may read from a wrong position, the
      following program produces the problem:
      
          char str1[32] = { 0 };
          char str2[32] = { 0 };
          int poffset = 10;
          int count = 20;
      
          /*open any seq file*/
          int fd = open("/proc/modules", O_RDONLY);
      
          pread(fd, str1, count, poffset);
          printf("pread:%s\n", str1);
      
          /*seek to where m->read_pos is*/
          lseek(fd, poffset+count, SEEK_SET);
      
          /*supposed to read from poffset+count, but this read from position 0*/
          read(fd, str2, count);
          printf("read:%s\n", str2);
      
      out put:
      pread:
       ck_netbios_ns 12665
      read:
       nf_conntrack_netbios
      
      /proc/modules:
      nf_conntrack_netbios_ns 12665 0 - Live 0xffffffffa038b000
      nf_conntrack_broadcast 12589 1 nf_conntrack_netbios_ns, Live 0xffffffffa0386000
      
      So we always update file->f_pos to offset in seq_lseek() to fix this issue.
      Signed-off-by: default avatarJiaxing Wang <hello.wjx@gmail.com>
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      05e16745