1. 25 Aug, 2012 6 commits
    • Stephen Boyd's avatar
    • Will Deacon's avatar
      ARM: 7495/1: mutex: use generic atomic_dec-based implementation for ARMv6+ · 08928e7a
      Will Deacon authored
      Commit a76d7bd9 ("ARM: 7467/1: mutex: use generic xchg-based
      implementation for ARMv6+") removed the barrier-less, ARM-specific
      mutex implementation in favour of the generic xchg-based code.
      
      Since then, a bug was uncovered in the xchg code when running on SMP
      platforms, due to interactions between the locking paths and the
      MUTEX_SPIN_ON_OWNER code. This was fixed in 0bce9c46 ("mutex: place
      lock in contended state after fastpath_lock failure"), however, the
      atomic_dec-based mutex algorithm is now marginally more efficient for
      ARM (~0.5% improvement in hackbench scores on dual A15).
      
      This patch moves ARMv6+ platforms to the atomic_dec-based mutex code.
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      08928e7a
    • Rob Herring's avatar
      ARM: 7494/1: use generic termios.h · e780c452
      Rob Herring authored
      As pointed out by Arnd Bergmann, this fixes a couple of issues but will
      increase code size:
      
      The original macro user_termio_to_kernel_termios was not endian safe. It
      used an unsigned short ptr to access the low bits in a 32-bit word.
      
      Both user_termio_to_kernel_termios and kernel_termios_to_user_termio are
      missing error checking on put_user/get_user and copy_to/from_user.
      Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Tested-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      e780c452
    • Rob Herring's avatar
      ARM: 7493/1: use generic unaligned.h · d25c881a
      Rob Herring authored
      This moves ARM over to the asm-generic/unaligned.h header. This has the
      benefit of better code generated especially for ARMv7 on gcc 4.7+
      compilers.
      
      As Arnd Bergmann, points out: The asm-generic version uses the "struct"
      version for native-endian unaligned access and the "byteshift" version
      for the opposite endianess. The current ARM version however uses the
      "byteshift" implementation for both.
      
      Thanks to Nicolas Pitre for the excellent analysis:
      
      Test case:
      
      int foo (int *x) { return get_unaligned(x); }
      long long bar (long long *x) { return get_unaligned(x); }
      
      With the current ARM version:
      
      foo:
      	ldrb	r3, [r0, #2]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 2B], MEM[(const u8 *)x_1(D) + 2B]
      	ldrb	r1, [r0, #1]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 1B], MEM[(const u8 *)x_1(D) + 1B]
      	ldrb	r2, [r0, #0]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D)], MEM[(const u8 *)x_1(D)]
      	mov	r3, r3, asl #16	@ tmp154, MEM[(const u8 *)x_1(D) + 2B],
      	ldrb	r0, [r0, #3]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 3B], MEM[(const u8 *)x_1(D) + 3B]
      	orr	r3, r3, r1, asl #8	@, tmp155, tmp154, MEM[(const u8 *)x_1(D) + 1B],
      	orr	r3, r3, r2	@ tmp157, tmp155, MEM[(const u8 *)x_1(D)]
      	orr	r0, r3, r0, asl #24	@,, tmp157, MEM[(const u8 *)x_1(D) + 3B],
      	bx	lr	@
      
      bar:
      	stmfd	sp!, {r4, r5, r6, r7}	@,
      	mov	r2, #0	@ tmp184,
      	ldrb	r5, [r0, #6]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 6B], MEM[(const u8 *)x_1(D) + 6B]
      	ldrb	r4, [r0, #5]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 5B], MEM[(const u8 *)x_1(D) + 5B]
      	ldrb	ip, [r0, #2]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 2B], MEM[(const u8 *)x_1(D) + 2B]
      	ldrb	r1, [r0, #4]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 4B], MEM[(const u8 *)x_1(D) + 4B]
      	mov	r5, r5, asl #16	@ tmp175, MEM[(const u8 *)x_1(D) + 6B],
      	ldrb	r7, [r0, #1]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 1B], MEM[(const u8 *)x_1(D) + 1B]
      	orr	r5, r5, r4, asl #8	@, tmp176, tmp175, MEM[(const u8 *)x_1(D) + 5B],
      	ldrb	r6, [r0, #7]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 7B], MEM[(const u8 *)x_1(D) + 7B]
      	orr	r5, r5, r1	@ tmp178, tmp176, MEM[(const u8 *)x_1(D) + 4B]
      	ldrb	r4, [r0, #0]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D)], MEM[(const u8 *)x_1(D)]
      	mov	ip, ip, asl #16	@ tmp188, MEM[(const u8 *)x_1(D) + 2B],
      	ldrb	r1, [r0, #3]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 3B], MEM[(const u8 *)x_1(D) + 3B]
      	orr	ip, ip, r7, asl #8	@, tmp189, tmp188, MEM[(const u8 *)x_1(D) + 1B],
      	orr	r3, r5, r6, asl #24	@,, tmp178, MEM[(const u8 *)x_1(D) + 7B],
      	orr	ip, ip, r4	@ tmp191, tmp189, MEM[(const u8 *)x_1(D)]
      	orr	ip, ip, r1, asl #24	@, tmp194, tmp191, MEM[(const u8 *)x_1(D) + 3B],
      	mov	r1, r3	@,
      	orr	r0, r2, ip	@ tmp171, tmp184, tmp194
      	ldmfd	sp!, {r4, r5, r6, r7}
      	bx	lr
      
      In both cases the code is slightly suboptimal.  One may wonder why
      wasting r2 with the constant 0 in the second case for example.  And all
      the mov's could be folded in subsequent orr's, etc.
      
      Now with the asm-generic version:
      
      foo:
      	ldr	r0, [r0, #0]	@ unaligned	@,* x
      	bx	lr	@
      
      bar:
      	mov	r3, r0	@ x, x
      	ldr	r0, [r0, #0]	@ unaligned	@,* x
      	ldr	r1, [r3, #4]	@ unaligned	@,
      	bx	lr	@
      
      This is way better of course, but only because this was compiled for
      ARMv7. In this case the compiler knows that the hardware can do
      unaligned word access.  This isn't that obvious for foo(), but if we
      remove the get_unaligned() from bar as follows:
      
      long long bar (long long *x) {return *x; }
      
      then the resulting code is:
      
      bar:
      	ldmia	r0, {r0, r1}	@ x,,
      	bx	lr	@
      
      So this proves that the presumed aligned vs unaligned cases does have
      influence on the instructions the compiler may use and that the above
      unaligned code results are not just an accident.
      
      Still... this isn't fully conclusive without at least looking at the
      resulting assembly fron a pre ARMv6 compilation.  Let's see with an
      ARMv5 target:
      
      foo:
      	ldrb	r3, [r0, #0]	@ zero_extendqisi2	@ tmp139,* x
      	ldrb	r1, [r0, #1]	@ zero_extendqisi2	@ tmp140,
      	ldrb	r2, [r0, #2]	@ zero_extendqisi2	@ tmp143,
      	ldrb	r0, [r0, #3]	@ zero_extendqisi2	@ tmp146,
      	orr	r3, r3, r1, asl #8	@, tmp142, tmp139, tmp140,
      	orr	r3, r3, r2, asl #16	@, tmp145, tmp142, tmp143,
      	orr	r0, r3, r0, asl #24	@,, tmp145, tmp146,
      	bx	lr	@
      
      bar:
      	stmfd	sp!, {r4, r5, r6, r7}	@,
      	ldrb	r2, [r0, #0]	@ zero_extendqisi2	@ tmp139,* x
      	ldrb	r7, [r0, #1]	@ zero_extendqisi2	@ tmp140,
      	ldrb	r3, [r0, #4]	@ zero_extendqisi2	@ tmp149,
      	ldrb	r6, [r0, #5]	@ zero_extendqisi2	@ tmp150,
      	ldrb	r5, [r0, #2]	@ zero_extendqisi2	@ tmp143,
      	ldrb	r4, [r0, #6]	@ zero_extendqisi2	@ tmp153,
      	ldrb	r1, [r0, #7]	@ zero_extendqisi2	@ tmp156,
      	ldrb	ip, [r0, #3]	@ zero_extendqisi2	@ tmp146,
      	orr	r2, r2, r7, asl #8	@, tmp142, tmp139, tmp140,
      	orr	r3, r3, r6, asl #8	@, tmp152, tmp149, tmp150,
      	orr	r2, r2, r5, asl #16	@, tmp145, tmp142, tmp143,
      	orr	r3, r3, r4, asl #16	@, tmp155, tmp152, tmp153,
      	orr	r0, r2, ip, asl #24	@,, tmp145, tmp146,
      	orr	r1, r3, r1, asl #24	@,, tmp155, tmp156,
      	ldmfd	sp!, {r4, r5, r6, r7}
      	bx	lr
      
      Compared to the initial results, this is really nicely optimized and I
      couldn't do much better if I were to hand code it myself.
      Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Tested-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      d25c881a
    • Rob Herring's avatar
      ARM: 7492/1: add strstr declaration for decompressors · ef1c2096
      Rob Herring authored
      With the generic unaligned.h, more kernel headers get pulled in including
      dynamic_debug.h which needs strstr. As it is not really used, we only need
      a declaration here.
      Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
      Tested-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      ef1c2096
    • Rob Herring's avatar
      ARM: 7491/1: use generic version of identical asm headers · 4a8052d8
      Rob Herring authored
      Inspired by the AArgh64 claim that it should be separate from ARM and one
      reason was being able to use more asm-generic headers. Doing a diff of
      arch/arm/include/asm and include/asm-generic there are numerous asm
      headers which are functionally identical to their asm-generic counterparts.
      Delete the ARM version and use the generic ones.
      Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Tested-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      4a8052d8
  2. 12 Aug, 2012 1 commit
  3. 11 Aug, 2012 1 commit
  4. 08 Aug, 2012 5 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · f4ba394c
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Missed rcu_assign_pointer() in mac80211 scanning, from Johannes
          Berg.
      
       2) Allow devices to limit the number of segments that an individual
          TCP TSO packet can use at a time, to deal with device and/or driver
          specific limitations.  From Ben Hutchings.
      
       3) Fix unexpected hard IPSEC expiration after setting the date.  From
          Fan Du.
      
       4) Memory leak fix in bxn2x driver, from Jesper Juhl.
      
       5) Fix two memory leaks in libertas driver, from Daniel Drake.
      
       6) Fix deref of out-of-range array index in packet scheduler generic
          actions layer.  From Hiroaki SHIMODA.
      
       7) Fix TX flow control errors in mlx4 driver, from Yevgeny Petrilin.
      
       8) Fix CRIS eth_v10.c driver build, from Randy Dunlap.
      
       9) Fix wrong SKB freeing in LLC protocol layer, from Sorin Dumitru.
      
      10) The IP output path checks neigh lookup errors incorrectly, it needs
          to use IS_ERR().  From Vasiliy Kulikov.
      
      11) An estimator leak leads to deref of freed memory in timer handler,
          fix from Hiroaki SHIMODA.
      
      12) TCP early demux in ipv6 needs to use DST cookies in order to
          validate the RX route properly.  Fix from Eric Dumazet.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (43 commits)
        net: ipv6: fix TCP early demux
        net: Use PTR_RET rather than if(IS_ERR(.. [1]
        net_sched: act: Delete estimator in error path.
        ip: fix error handling in ip_finish_output2()
        llc: free the right skb
        ixp4xx_eth: fix ptp_ixp46x build failure
        drivers/atm/iphase.c: fix error return code
        tcp_output: fix sparse warning for tcp_wfree
        drivers/net/phy/mdio-mux-gpio.c: drop devm_kfree of devm_kzalloc'd data
        batman-adv: select an internet gateway if none was chosen
        mISDN: Bugfix for layer2 fixed TEI mode
        igb: don't break user visible strings over multiple lines in igb_ethtool.c
        igb: correct hardware type (i210/i211) check in igb_loopback_test()
        igb: Fix for failure to init on some 82576 devices.
        cris: fix eth_v10.c build error
        cdc-ncm: tag Ericsson WWAN devices (eg F5521gw) with FLAG_WWAN
        isdnloop: fix and simplify isdnloop_init()
        hyperv: Move wait completion msg code into rndis_filter_halt_device()
        net/mlx4_core: Remove port type restrictions
        net/mlx4_en: Fixing TX queue stop/wake flow
        ...
      f4ba394c
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-fixes-for-v3.6-rc1' of... · bf44ce83
      Linus Torvalds authored
      Merge tag 'pinctrl-fixes-for-v3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
      
      Pull pinctrl fixes from Linus Walleij:
       - Move MXS pinctrl registration to poscore_initcall
       - Fix up various devm_* managed resources code paths
       - Fix one function group in the Nomadik driver
       - Update MAINTAINERS
      
      * tag 'pinctrl-fixes-for-v3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        drivers/pinctrl/pinctrl-nomadik.c: drop devm_kfree of devm_kzalloc'd data
        MAINTAINERS: fix a few pinctrl related entries
        pinctrl-sirf: remove devm_kfree at error path
        pinctrl/nomadik: fix hsi function group list
        pinctrl/pinctrl-u300: remove unneeded devm_kfree call
        pinctrl: mxs: register driver at postcore_initcall time
      bf44ce83
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 7f46f9c1
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
       "These patches fix a couple of issues.  First of all a few problems
        with ACS on x86 introduced in the last merge window, where ACS did not
        work on AMD and a NULL pointer dereference when there ran against
        SR-IOV devices.
      
        The patches fallen out of coccinelle checks fix a possible invalid
        memory reference and a possible memory leak.  The other patches mostly
        fix build errors and warnings and a wrong return value."
      
      * tag 'iommu-fixes-v3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/amd: Fix ACS path checking
        iommu/intel: Fix ACS path checking
        iommu/amd: Fix pci_request_acs() call-place
        iommu/exynos: Fix build error
        iommu/tegra: smmu: Fix error initial value at domain_init
        iommu/tegra: smmu: Cleanup with lesser nest
        iommu: Add missing forward declaration in include file
        iommu: Include linux/types.h
        iommu/intel: add missing free_domain_mem
        iommu/tegra: remove invalid reference to list iterator variable
      7f46f9c1
    • Linus Torvalds's avatar
      Merge tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 6666cabf
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Containing only a few really small/trivial fixes.  The only urgent fix
        is a regression fix of HDMI codec probing, introduced in 3.6-rc1.  The
        rest are HD-audio specific fixes and a copule of minor bug fixes in
        PCM core and the old emu10k1."
      
      * tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad
        ALSA: hda - Fix ugly debug prints with CONFIG_SND_VERBOSE_PRINTK=y
        ALSA: hda - remove redundant auto quirks for conexant 506x
        ALSA: hda - remove quirk for Dell Vostro 1015
        ALSA: hda - add dock support for Thinkpad X230
        ALSA: hda - Fix regression of HDMI codec probing
        ALSA: hda - add dock support for Thinkpad T430s
        ALSA: emu10k1: Avoid access to invalid pages when period=1
        ALSA: PCM: Fix possible memory leaks in the error path
      6666cabf
    • David Henningsson's avatar
      ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad · 012e7eb1
      David Henningsson authored
      The same ID is twice in the quirk table, so the second one is not used.
      Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
      Cc: <stable@vger.kernel.org> [v3.2+]
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      012e7eb1
  5. 07 Aug, 2012 8 commits
  6. 06 Aug, 2012 16 commits
  7. 05 Aug, 2012 3 commits
    • Linus Torvalds's avatar
      Merge branches 'timers-urgent-for-linus' and 'perf-urgent-for-linus' of... · 42a579a0
      Linus Torvalds authored
      Merge branches 'timers-urgent-for-linus' and 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
      
      Pull timers and perf fixes from Ingo Molnar:
       "Timers:
       - Fix another timekeeping bug
      
       Pef:
         - Make clean brace expansion fix for some shells, from Palmer Cox
      
         - Warn user just once per guest kernel when not finding kernel info,
           from David Ahern
      
         - perf test fix from Jiri Olsa
      
         - Fix error handling on event creation in perf top, from David Ahern
      
         - Fix check on perf_target__strnerror, from Namhyung Kim
      
         - Save the whole cmdline, from David Ahern
      
        There's this infrastructure change:
      
         - Prep work for the DWARF CFI post unwinder, so that it doesn't use
           perf_session in lots of places, just evlist/evsel is enough.
      
        which is a late infrastructure change that prepare for future feature
        work - we wanted it upstream to simplify the fixes/development patch
        flows."
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        time: Fix adjustment cleanup bug in timekeeping_adjust()
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools: Remove brace expansion from clean target
        perf kvm top: Limit guest kernel info message to once
        perf tools: Introduce intlist
        perf tools: Change strlist to use the new rblist
        perf tools: Introducing rblist
        perf kvm: Use strtol for walking guestmount directory
        perf tool: Save cmdline from user in file header vs what is passed to record
        perf top: Error handling for counter creation should parallel perf-record
        perf session: Remove no longer used synthesize_sample method
        perf evsel: Adopt parse_sample method from perf_event
        perf evlist: Introduce perf_evlist__parse_sample
        perf session: Use perf_evlist__id_hdr_size more extensively
        perf session: Use perf_evlist__sample_id_all more extensively
        perf session: Use perf_evlist__sample_type more extensively
        perf evsel: Precalculate the sample size
        perf target: Fix check on buffer size
        perf symbols: Fix array sizes for binary types arrays
        perf test: Fix parse events automated tests
      42a579a0
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 8a06bf14
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/core fixes and some late updates from Arnaldo Carvalho de Melo:
      
       * Make clean brace expansion fix for some shells, from Palmer Cox
      
       * Warn user just once per guest kernel when not finding kernel info,
         from David Ahern
      
       * perf test fix from Jiri Olsa
      
       * Fix error handling on event creation in perf top, from David Ahern
      
       * Fix check on perf_target__strnerror, from Namhyung Kim
      
       * Save the whole cmdline, from David Ahern
      
       * Prep work for the DWARF CFI post unwinder, so that it doesn't
         uses perf_session in lots of places, just evlist/evsel is enough.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8a06bf14
    • Ingo Molnar's avatar
      time: Fix adjustment cleanup bug in timekeeping_adjust() · 1d17d174
      Ingo Molnar authored
      Tetsuo Handa reported that sporadically the system clock starts
      counting up too quickly which is enough to confuse the hangcheck
      timer to print a bogus stall warning.
      
      Commit 2a8c0883 "time: Move xtime_nsec adjustment underflow handling
      timekeeping_adjust" overlooked this exit path:
      
              } else
                      return;
      
      which should really be a proper exit sequence, fixing the bug as a
      side effect.
      
      Also make the flow more readable by properly balancing curly
      braces.
      
      Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:
      Tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: john.stultz@linaro.org
      Cc: a.p.zijlstra@chello.nl
      Cc: richardcochran@gmail.com
      Cc: prarit@redhat.com
      Link: http://lkml.kernel.org/r/20120804192114.GA28347@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1d17d174