1. 24 10月, 2012 6 次提交
  2. 23 10月, 2012 7 次提交
    • K
      usb: renesas_usbhs: fixup dma transfer stall · 1cb60156
      Kuninori Morimoto 提交于
      renesas_usbhs driver can switch DMA/PIO transfer by using handler,
      and each handler have push/pop direction.
      But unfortunately, current dma push handler didn't a path
      which calls usbhs_pipe_enable(). Thus, dma transfer never happened.
      this patch fixes it.
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      1cb60156
    • K
      usb: renesas_usbhs: fixup: avoid NULL access on error case pipe detach · 4f053a24
      Kuninori Morimoto 提交于
      If renesas_usbhs or DMAEngine interrupt didn't happen by a certain cause,
      urb->ep will be NULL by usb time out.
      Then, host mode will access to it and crash kernel.
      This patch fixes it.
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4f053a24
    • W
      usb: gadget: net2272: fix missing unlock on error in net2272_irq() · 000b7f51
      Wei Yongjun 提交于
      Add the missing unlock on the error handle path in function
      net2272_irq().
      Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      000b7f51
    • D
      usb: musb: dsps: fix res_name length · ca749b2a
      Daniel Mack 提交于
      The res_name is used for the name construction of a DT property as
      follows:
      
        sprintf(res_name, "port%d-mode", id);
      
      Hence, res_name must be at least 11 characters long in order to store
      the name including the terminating '\0'.
      
      While at it, use to snprintf() rather than sprintf() when accessing this
      buffer.
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      ca749b2a
    • L
      usb/xhci: Remove (__force__ __u16) before assigning DeviceRemovable and assign directly. · 27c411c9
      Lan Tianyu 提交于
      Struct usb_hub_descriptor.ss.DeviceRemovable has been defined as __le16
      and (__force__ __u16) doesn't need.
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      27c411c9
    • L
      usb/xhci: release xhci->lock during turning on/off usb port's acpi power... · 170ed807
      Lan Tianyu 提交于
      usb/xhci: release xhci->lock during turning on/off usb port's acpi power resource and checking the existence of port's power resource
      
      When setting usb port's acpi power resource, there will be some xhci hub requests.
      This will cause dead lock since xhci->lock has been held before setting acpi power
      resource in the xhci_hub_control(). The usb_acpi_power_manageable() function might
      fall into sleep so release xhci->lock before invoking it.
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      170ed807
    • O
      usb hub: send clear_tt_buffer_complete events when canceling TT clear work · 3b6054da
      Octavian Purdila 提交于
      There is a race condition in the USB hub code with regard to handling
      TT clear requests that can get the HCD driver in a deadlock. Usually
      when an TT clear request is scheduled it will be executed immediately:
      
      <7>[    6.077583] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
      <3>[    6.078041] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
      <7>[    6.078299] hub_tt_work:731
      <7>[    9.309089] usb 2-1.5: link qh1-0e01/f4d506c0 start 0 [1/2 us]
      <7>[    9.324526] ehci_hcd 0000:00:1d.0: reused qh f4d4db00 schedule
      <7>[    9.324539] usb 2-1.3: link qh1-0e01/f4d4db00 start 0 [1/2 us]
      <7>[    9.341530] usb 1-1.1: link qh4-0e01/f397aec0 start 2 [1/2 us]
      <7>[   10.116159] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
      <3>[   10.116459] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
      <7>[   10.116537] hub_tt_work:731
      
      However, if a suspend operation is triggered before hub_tt_work is
      scheduled, hub_quiesce will cancel the work without notifying the HCD
      driver:
      
      <3>[   35.033941] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d80
      <5>[   35.034022] sd 0:0:0:0: [sda] Stopping disk
      <7>[   35.034039] hub 2-1:1.0: hub_suspend
      <7>[   35.034067] usb 2-1: unlink qh256-0001/f3b1ab00 start 1 [1/0 us]
      <7>[   35.035085] hub 1-0:1.0: hub_suspend
      <7>[   35.035102] usb usb1: bus suspend, wakeup 0
      <7>[   35.035106] ehci_hcd 0000:00:1a.0: suspend root hub
      <7>[   35.035298] hub 2-0:1.0: hub_suspend
      <7>[   35.035313] usb usb2: bus suspend, wakeup 0
      <7>[   35.035315] ehci_hcd 0000:00:1d.0: suspend root hub
      <6>[   35.250017] PM: suspend of devices complete after 216.979 msecs
      <6>[   35.250822] PM: late suspend of devices complete after 0.799 msecs
      <7>[   35.252343] ehci_hcd 0000:00:1d.0: wakeup: 1
      <7>[   35.262923] ehci_hcd 0000:00:1d.0: --> PCI D3hot
      <7>[   35.263302] ehci_hcd 0000:00:1a.0: wakeup: 1
      <7>[   35.273912] ehci_hcd 0000:00:1a.0: --> PCI D3hot
      <6>[   35.274254] PM: noirq suspend of devices complete after 23.442 msecs
      <6>[   35.274975] ACPI: Preparing to enter system sleep state S3
      <6>[   35.292666] PM: Saving platform NVS memory
      <7>[   35.295030] Disabling non-boot CPUs ...
      <6>[   35.297351] CPU 1 is now offline
      <6>[   35.300345] CPU 2 is now offline
      <6>[   35.303929] CPU 3 is now offline
      <7>[   35.303931] lockdep: fixing up alternatives.
      <6>[   35.304825] Extended CMOS year: 2000
      
      When the device will resume the EHCI driver will get stuck in
      ehci_endpoint_disable waiting for the tt_clearing flag to reset:
      
      <0>[   47.610967] usb 2-1.3: **** DPM device timeout ****
      <7>[   47.610972]  f2f11c60 00000092 f2f11c0c c10624a5 00000003 f4c6e880 c1c8a4c0 c1c8a4c0
      <7>[   47.610983]  15c55698 0000000b f56b34c0 f2a45b70 f4c6e880 00000082 f2a4602c f2f11c30
      <7>[   47.610993]  c10787f8 f4cac000 f2a45b70 00000000 f4cac010 f2f11c58 00000046 00000001
      <7>[   47.611004] Call Trace:
      <7>[   47.611006]  [<c10624a5>] ? sched_clock_cpu+0xf5/0x160
      <7>[   47.611019]  [<c10787f8>] ? lock_release_holdtime.part.22+0x88/0xf0
      <7>[   47.611026]  [<c103ed46>] ? lock_timer_base.isra.35+0x26/0x50
      <7>[   47.611034]  [<c17592d3>] ? schedule_timeout+0x133/0x290
      <7>[   47.611044]  [<c175b43e>] schedule+0x1e/0x50
      <7>[   47.611051]  [<c17592d8>] schedule_timeout+0x138/0x290
      <7>[   47.611057]  [<c10624a5>] ? sched_clock_cpu+0xf5/0x160
      <7>[   47.611063]  [<c103e560>] ? usleep_range+0x40/0x40
      <7>[   47.611070]  [<c1759445>] schedule_timeout_uninterruptible+0x15/0x20
      <7>[   47.611077]  [<c14935f4>] ehci_endpoint_disable+0x64/0x160
      <7>[   47.611084]  [<c147d1ee>] ? usb_hcd_flush_endpoint+0x10e/0x1d0
      <7>[   47.611092]  [<c1165663>] ? sysfs_add_file+0x13/0x20
      <7>[   47.611100]  [<c147d5a9>] usb_hcd_disable_endpoint+0x29/0x40
      <7>[   47.611107]  [<c147fafc>] usb_disable_endpoint+0x5c/0x80
      <7>[   47.611111]  [<c147fb57>] usb_disable_interface+0x37/0x50
      <7>[   47.611116]  [<c1477650>] usb_reset_and_verify_device+0x4b0/0x640
      <7>[   47.611122]  [<c1474665>] ? hub_port_status+0xb5/0x100
      <7>[   47.611129]  [<c147a975>] usb_port_resume+0xd5/0x220
      <7>[   47.611136]  [<c148877f>] generic_resume+0xf/0x30
      <7>[   47.611142]  [<c14821a3>] usb_resume+0x133/0x180
      <7>[   47.611147]  [<c1473b10>] ? usb_dev_thaw+0x10/0x10
      <7>[   47.611152]  [<c1473b1d>] usb_dev_resume+0xd/0x10
      <7>[   47.611157]  [<c13baa60>] dpm_run_callback+0x40/0xb0
      <7>[   47.611164]  [<c13bdb03>] ? pm_runtime_enable+0x43/0x70
      <7>[   47.611171]  [<c13bafc6>] device_resume+0x1a6/0x2c0
      <7>[   47.611177]  [<c13ba940>] ? dpm_show_time+0xe0/0xe0
      <7>[   47.611183]  [<c13bb0f9>] async_resume+0x19/0x40
      <7>[   47.611189]  [<c10580c4>] async_run_entry_fn+0x64/0x160
      <7>[   47.611196]  [<c104a244>] ? process_one_work+0x104/0x480
      <7>[   47.611203]  [<c104a24c>] ? process_one_work+0x10c/0x480
      <7>[   47.611209]  [<c104a2c0>] process_one_work+0x180/0x480
      <7>[   47.611215]  [<c104a244>] ? process_one_work+0x104/0x480
      <7>[   47.611220]  [<c1058060>] ? async_schedule+0x10/0x10
      <7>[   47.611226]  [<c104c15c>] worker_thread+0x11c/0x2f0
      <7>[   47.611233]  [<c104c040>] ? manage_workers.isra.27+0x1f0/0x1f0
      <7>[   47.611239]  [<c10507f8>] kthread+0x78/0x80
      <7>[   47.611244]  [<c1750000>] ? timer_cpu_notify+0xd6/0x20d
      <7>[   47.611253]  [<c1050780>] ? __init_kthread_worker+0x60/0x60
      <7>[   47.611258]  [<c176357e>] kernel_thread_helper+0x6/0xd
      <7>[   47.611283] ------------[ cut here ]------------
      
      This patch changes hub_quiesce behavior to flush the TT clear work
      instead of canceling it, to make sure that no TT clear request remains
      uncompleted before suspend.
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3b6054da
  3. 21 10月, 2012 2 次提交
  4. 20 10月, 2012 25 次提交
    • M
      arm64: fix alignment padding in assembly code · aeed41a9
      Marc Zyngier 提交于
      An interesting effect of using the generic version of linkage.h
      is that the padding is defined in terms of x86 NOPs, which can have
      even more interesting effects when the assembly code looks like this:
      
      ENTRY(func1)
      	mov	x0, xzr
      ENDPROC(func1)
      	// fall through
      ENTRY(func2)
      	mov	x0, #1
      	ret
      ENDPROC(func2)
      
      Admittedly, the code is not very nice. But having code from another
      architecture doesn't look completely sane either.
      
      The fix is to add arm64's version of linkage.h, which causes the insertion
      of proper AArch64 NOPs.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      aeed41a9
    • K
      use clamp_t in UNAME26 fix · 31fd84b9
      Kees Cook 提交于
      The min/max call needed to have explicit types on some architectures
      (e.g. mn10300). Use clamp_t instead to avoid the warning:
      
        kernel/sys.c: In function 'override_release':
        kernel/sys.c:1287:10: warning: comparison of distinct pointer types lacks a cast [enabled by default]
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31fd84b9
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8c1bee68
      Linus Torvalds 提交于
      Pull perf fixes from Ingo Molnar:
       "Assorted small fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf python: Properly link with libtraceevent
        perf hists browser: Add back callchain folding symbol
        perf tools: Fix build on sparc.
        perf python: Link with libtraceevent
        perf python: Initialize 'page_size' variable
        tools lib traceevent: Fix missed freeing of subargs in free_arg() in filter
        lib tools traceevent: Add back pevent assignment in __pevent_parse_format()
        perf hists browser: Fix off-by-two bug on the first column
        perf tools: Remove warnings on JIT samples for srcline sort key
        perf tools: Fix segfault when using srcline sort key
        perf: Require exclude_guest to use PEBS - kernel side enforcement
        perf tool: Precise mode requires exclude_guest
      8c1bee68
    • A
      perf python: Properly link with libtraceevent · 45bff41a
      Arnaldo Carvalho de Melo 提交于
      Namhyung Kim reported that the build fails with:
      
        GEN python/perf.so
        gcc: error: python_ext_build/tmp//../../libtraceevent.a: No such file or directory
        error: command 'gcc' failed with exit status 1
        cp: cannot stat `python_ext_build/lib/perf.so': No such file or directory
        make: *** [python/perf.so] Error 1
      
      We need to propagate the TE_PATH variable to the setup.py file.
      Reported-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://lkml.kernel.org/n/tip-8umiPbm4sxpknKivbjgykhut@git.kernel.org
      [ Fixed superfluous variable build error. ]
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      45bff41a
    • I
      Merge tag 'perf-urgent-for-mingo' of... · a448a031
      Ingo Molnar 提交于
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
      * The python binding needs to link with libtraceevent and to initialize
        the 'page_size' variable so that mmaping works again.
      
      * The callchain folding character that appears on the TUI just before
        the overhead had disappeared due to recent changes, add it back.
      
      * Intel PEBS in VT-x context uses the DS address as a guest linear address,
        even though its programmed by the host as a host linear address. This either
        results in guest memory corruption and or the hardware faulting and 'crashing'
        the virtual machine.  Therefore we have to disable PEBS on VT-x enter and
        re-enable on VT-x exit, enforcing a strict exclude_guest.
      
        Kernel side enforcement fix by Peter Zijlstra, tooling side fix by David Ahern.
      
      * Fix build on sparc due to UAPI, fix from David Miller.
      
      * Fixes for the srclike sort key for unresolved symbols and when processing
        samples in JITted code, where we don't have an ELF file, just an special
        symbol table, fixes from Namhyung Kim.
      
      * Fix some leaks in libtraceevent, from Steven Rostedt.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      a448a031
    • L
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 37820108
      Linus Torvalds 提交于
      Pull ARM soc fixes from Olof Johansson:
       "A set of fixes and some minor cleanups for -rc2:
      
         - A series from Arnd that fixes warnings in drivers and other code
           included by ARM defconfigs.  Most have been acked by corresponding
           maintainers (and seem quite hard to argue not picking up anyway in
           the few exception cases).
         - A few misc patches from the list for integrator/vt8500/i.MX
         - A batch of fixes to OMAP platforms, fixing:
           - boot problems on beaglebone,
           - regression fixes for local timers
           - clockdomain locking fixes
           - a few boot/sparse warnings
         - For Tegra:
           - Clock rate calculation overflow fix
           - Revert a change that removed timer clocks and a fix for symbol
             name clashes
         - For Renesas:
           - IO accessor / annotation cleanups to remove warnings
         - For Kirkwood/Dove/mvebu:
           - Fixes for device trees for Dove (some minor cleanups, some fixes)
           - Fixes for the mvebu gpio driver
           - Fix build problem for Feroceon due to missing ifdefs
           - Fix lsxl DTS files"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (31 commits)
        ARM: kirkwood: fix buttons on lsxl boards
        ARM: kirkwood: fix LEDs names for lsxl boards
        ARM: Kirkwood: fix disabling CACHE_FEROCEON_L2
        gpio: mvebu: Add missing breaks in mvebu_gpio_irq_set_type
        ARM: dove: Add crypto engine to DT
        ARM: dove: Remove watchdog from DT
        ARM: dove: Restructure SoC device tree descriptor
        ARM: dove: Fix clock names of sata and gbe
        ARM: dove: Fix tauros2 device tree init
        ARM: dove: Add pcie clock support
        ARM: OMAP2+: Allow kernel to boot even if GPMC fails to reserve memory
        ARM: OMAP: clockdomain: Fix locking on _clkdm_clk_hwmod_enable / disable
        ARM: s3c: mark s3c2440_clk_add as __init_refok
        spi/s3c64xx: use correct dma_transfer_direction type
        ARM: OMAP4: devices: fixup OMAP4 DMIC platform device error message
        ARM: OMAP2+: clock data: Add dev-id for the omap-gpmc dummy fck
        ARM: OMAP: resolve sparse warning concerning debug_card_init()
        ARM: OMAP4: Fix twd_local_timer_register regression
        ARM: tegra: add tegra_timer clock
        ARM: tegra: rename tegra system timer
        ...
      37820108
    • D
      MODSIGN: Move the magic string to the end of a module and eliminate the search · caabe240
      David Howells 提交于
      Emit the magic string that indicates a module has a signature after the
      signature data instead of before it.  This allows module_sig_check() to
      be made simpler and faster by the elimination of the search for the
      magic string.  Instead we just need to do a single memcmp().
      
      This works because at the end of the signature data there is the
      fixed-length signature information block.  This block then falls
      immediately prior to the magic number.
      
      From the contents of the information block, it is trivial to calculate
      the size of the signature data and thus the size of the actual module
      data.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caabe240
    • O
      Merge tag 'kirkwood_fixes_for_v3.7' of git://git.infradead.org/users/jcooper/linux into fixes · 70f3900e
      Olof Johansson 提交于
      From Jason Cooper:
       - improve #ifdef logic to prevent linker errors with CACHE_FEROCEON_L2
       - lsxl board dts fixes
      
      * tag 'kirkwood_fixes_for_v3.7' of git://git.infradead.org/users/jcooper/linux:
        ARM: kirkwood: fix buttons on lsxl boards
        ARM: kirkwood: fix LEDs names for lsxl boards
        ARM: Kirkwood: fix disabling CACHE_FEROCEON_L2
      70f3900e
    • D
      MODSIGN: Cleanup .gitignore · b6bb324d
      David Howells 提交于
      The module build process no longer creates intermediate files for module
      signing, so remove them from .gitignore.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b6bb324d
    • D
      MODSIGN: perlify sign-file and merge in x509keyid · b37d1bfb
      David Howells 提交于
      Turn sign-file into perl and merge in x509keyid.  The latter doesn't
      need to be a separate script as it doesn't actually need to work out the
      SHA1 sum of the X.509 certificate itself, since it can get that from the
      X.509 certificate.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b37d1bfb
    • O
      Merge branch 'testing/driver-warnings' of... · 068a565a
      Olof Johansson 提交于
      Merge branch 'testing/driver-warnings' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc into fixes
      
      A collection of warning fixes on non-ARM code from Arnd Bergmann:
      
      * 'testing/driver-warnings' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: s3c: mark s3c2440_clk_add as __init_refok
        spi/s3c64xx: use correct dma_transfer_direction type
        pcmcia: sharpsl: don't discard sharpsl_pcmcia_ops
        USB: EHCI: mark ehci_orion_conf_mbus_windows __devinit
        mm/slob: use min_t() to compare ARCH_SLAB_MINALIGN
        SCSI: ARM: make fas216_dumpinfo function conditional
        SCSI: ARM: ncr5380/oak uses no interrupts
      068a565a
    • K
      hold task->mempolicy while numa_maps scans. · 9e781440
      KAMEZAWA Hiroyuki 提交于
        /proc/<pid>/numa_maps scans vma and show mempolicy under
        mmap_sem. It sometimes accesses task->mempolicy which can
        be freed without mmap_sem and numa_maps can show some
        garbage while scanning.
      
      This patch tries to take reference count of task->mempolicy at reading
      numa_maps before calling get_vma_policy(). By this, task->mempolicy
      will not be freed until numa_maps reaches its end.
      
      V2->v3
        -  updated comments to be more verbose.
        -  removed task_lock() in numa_maps code.
      V1->V2
        -  access task->mempolicy only once and remember it.  Becase kernel/exit.c
           can overwrite it.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Acked-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9e781440
    • L
      Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3b641bf4
      Linus Torvalds 提交于
      Pull miscellaneous x86 fixes from Peter Anvin:
       "The biggest ones are fixing suspend/resume breakage on 32 bits, and an
        interrim fix for mapping over holes that allows AMD kit with more than
        1 TB.
      
        A final solution for the latter is in the works, but involves some
        fairly invasive changes that will probably mean it will only be
        appropriate for 3.8."
      
      * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, MCE: Remove bios_cmci_threshold sysfs attribute
        x86, amd, mce: Avoid NULL pointer reference on CPU northbridge lookup
        x86: Exclude E820_RESERVED regions and memory holes above 4 GB from direct mapping.
        x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs()
        x86/reboot: Remove quirk entry for SBC FITPC
        x86, suspend: Correct the restore of CR4, EFER; skip computing EFLAGS.ID
      3b641bf4
    • L
      Merge branch 'akpm' (Fixes from Andrew) · 4a1f2b0f
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "Seven fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (7 patches)
        lib/dma-debug.c: fix __hash_bucket_find()
        mm: compaction: correct the nr_strict va isolated check for CMA
        firmware/memmap: avoid type conflicts with the generic memmap_init()
        pidns: remove recursion from free_pid_ns()
        drivers/video/backlight/lm3639_bl.c: return proper error in lm3639_bled_mode_store() error paths
        kernel/sys.c: fix stack memory content leak via UNAME26
        linux/coredump.h needs asm/siginfo.h
      4a1f2b0f
    • M
      lib/dma-debug.c: fix __hash_bucket_find() · fe73fbe1
      Ming Lei 提交于
      If there is only one match, the unique matched entry should be returned.
      
      Without the fix, the upcoming dma debug interfaces ("dma-debug: new
      interfaces to debug dma mapping errors") can't work reliably because
      only device and dma_addr are passed to dma_mapping_error().
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Reported-by: NWu Fengguang <fengguang.wu@intel.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Tested-by: NShuah Khan <shuah.khan@hp.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Jakub Kicinski <kubakici@wp.pl>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fe73fbe1
    • M
      mm: compaction: correct the nr_strict va isolated check for CMA · 0db63d7e
      Mel Gorman 提交于
      Thierry reported that the "iron out" patch for isolate_freepages_block()
      had problems due to the strict check being too strict with "mm:
      compaction: Iron out isolate_freepages_block() and
      isolate_freepages_range() -fix1".  It's possible that more pages than
      necessary are isolated but the check still fails and I missed that this
      fix was not picked up before RC1.  This same problem has been identified
      in 3.7-RC1 by Tony Prisk and should be addressed by the following patch.
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Tested-by: NTony Prisk <linux@prisktech.co.nz>
      Reported-by: NThierry Reding <thierry.reding@avionic-design.de>
      Acked-by: NRik van Riel <riel@redhat.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Cc: Richard Davies <richard@arachsys.com>
      Cc: Shaohua Li <shli@kernel.org>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0db63d7e
    • F
      firmware/memmap: avoid type conflicts with the generic memmap_init() · bac71696
      Fengguang Wu 提交于
      Fix this build error:
      
        drivers/firmware/memmap.c:240:19: error: conflicting types for 'memmap_init'
        arch/ia64/include/asm/pgtable.h:565:17: note: previous declaration of 'memmap_init' was here
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Cc: Bernhard Walle <bwalle@suse.de>
      Cc: Glauber Costa <glommer@parallels.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bac71696
    • C
      pidns: remove recursion from free_pid_ns() · bbc2e3ef
      Cyrill Gorcunov 提交于
      free_pid_ns() operates in a recursive fashion:
      
      free_pid_ns(parent)
        put_pid_ns(parent)
          kref_put(&ns->kref, free_pid_ns);
            free_pid_ns
      
      thus if there was a huge nesting of namespaces the userspace may trigger
      avalanche calling of free_pid_ns leading to kernel stack exhausting and a
      panic eventually.
      
      This patch turns the recursion into an iterative loop.
      
      Based on a patch by Andrew Vagin.
      
      [akpm@linux-foundation.org: export put_pid_ns() to modules]
      Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Andrew Vagin <avagin@openvz.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bbc2e3ef
    • A
    • K
      kernel/sys.c: fix stack memory content leak via UNAME26 · 2702b152
      Kees Cook 提交于
      Calling uname() with the UNAME26 personality set allows a leak of kernel
      stack contents.  This fixes it by defensively calculating the length of
      copy_to_user() call, making the len argument unsigned, and initializing
      the stack buffer to zero (now technically unneeded, but hey, overkill).
      
      CVE-2012-0957
      Reported-by: NPaX Team <pageexec@freemail.hu>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: PaX Team <pageexec@freemail.hu>
      Cc: Brad Spengler <spender@grsecurity.net>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2702b152
    • R
      linux/coredump.h needs asm/siginfo.h · 1d46e232
      Richard Weinberger 提交于
      Commit 5ab1c309 ("coredump: pass siginfo_t* to do_coredump() and
      below, not merely signr") added siginfo_t to linux/coredump.h but forgot
      to include asm/siginfo.h.  This breaks the build for UML/i386.  (And any
      other arch where asm/siginfo.h is not magically preincluded...)
      
        In file included from arch/x86/um/elfcore.c:2:0: include/linux/coredump.h:15:25: error: unknown type name 'siginfo_t'
        make[1]: *** [arch/x86/um/elfcore.o] Error 1
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Cc: Denys Vlasenko <vda.linux@googlemail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Amerigo Wang <amwang@redhat.com>
      Cc: "Jonathan M. Foote" <jmfoote@cert.org>
      Cc: Roland McGrath <roland@hack.frob.com>
      Cc: Pedro Alves <palves@redhat.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1d46e232
    • L
      remap_file_pages: correctly handle the case of a NULL vm_ops pointer · deb521c4
      Linus Torvalds 提交于
      In commit 0b173bc4 ("mm: kill vma flag VM_CAN_NONLINEAR") we
      replaced the VM_CAN_NONLINEAR test with checking whether the mapping has
      a '->remap_pages()' vm operation, but there is no guarantee that there
      it even has a vm_ops pointer at all.
      
      Add the appropriate test for NULL vm_ops.
      Reported-by: NSasha Levin <levinsasha928@gmail.com>
      Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      deb521c4
    • L
      Merge tag 'xtensa-next-20121018' of git://github.com/czankel/xtensa-linux · 17dbe27d
      Linus Torvalds 提交于
      Pull Xtensa patchset from Chris Zankel:
       "These are all limited to the xtensa subtree and include some important
        changes (adding long missing system calls for newer libc versions and
        other fixes) and the UAPI changes"
      
      * tag 'xtensa-next-20121018' of git://github.com/czankel/xtensa-linux:
        xtensa: add missing system calls to the syscall table
        xtensa: minor compiler warning fix
        xtensa: Use Kbuild infrastructure to handle asm-generic headers
        UAPI: (Scripted) Disintegrate arch/xtensa/include/asm
        xtensa: fix unaligned usermode access
        xtensa: reorganize SR referencing
        xtensa: fix boot parameters parsing
        xtensa: fix missing return in do_page_fault for SIGBUS case
        xtensa: copy_thread with CLONE_VM must not copy live parent AR windows
        xtensa: fix memmove(), bcopy(), and memcpy().
        xtensa: ISS: fix rs_put_char
        xtensa: ISS: fix specific simcalls
      17dbe27d
    • L
      kbuild: Fix module signature generation · b05e585d
      Linus Torvalds 提交于
      Rusty had clearly not actually tested his module signing changes that I
      (trustingly) applied as commit e2a666d5 ("kbuild: sign the modules
      at install time"). That commit had multiple bugs:
      
       - using "${#VARIABLE}" to get the number of characters in a shell
         variable may look clever, but it's locale-dependent: it returns the
         number of *characters*, not bytes. And we do need bytes.
      
         So don't use "${#..}" expansion, do the stupid "wc -c" thing instead
         (where "c" stands for "bytes", not "characters", despite the letter.
      
       - Rusty had confused "siglen" and "signerlen", and his conversion
         didn't set "signerlen" at all, and incorrectly set "siglen" to the
         size of the signer, not the size of the signature.
      
      End result: the modified sign-file script did create something that
      superficially *looked* like a signature, but didn't actually work at
      all, and would fail the signature check. Oops.
      
      Tssk, tssk, Rusty.
      
      But Rusty was definitely right that this whole thing should be rewritten
      in perl by somebody who has the perl-fu to do so.  That is not me,
      though - I'm just doing an emergency fix for the shell script.
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b05e585d
    • L
      xen: Fix annoying compile-time warning · 16757372
      Linus Torvalds 提交于
      Commit cb6b6df1 ("xen/pv-on-hvm kexec: add quirk for Xen 3.4 and
      shutdown watches.") added the xen_strict_xenbus_quirk() function with an
      old K&R-style declaration without proper typing, causing gcc to rightly
      complain:
      
        drivers/xen/xenbus/xenbus_xs.c:628:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
      
      because we really don't live in caves using stone-age tools any more,
      and the kernel has always used properly typed ANSI C function
      declarations.
      
      So if a function doesn't take arguments, we tell the compiler so
      explicitly by adding the proper "void" in the prototype.
      
      I'm sure there are tons of other examples of this kind of stuff in the
      tree, but this is the one that hits my workstation config, so..
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      16757372