1. 21 5月, 2012 8 次提交
  2. 07 5月, 2012 4 次提交
  3. 06 5月, 2012 1 次提交
    • J
      TTY: pdc_cons, fix regression in close · 49a5f3cf
      Jiri Slaby 提交于
      The test in pdc_console_tty_close '!tty->count' was always wrong
      because tty->count is decremented after tty->ops->close is called and
      thus can never be zero. Hence the 'then' branch was never executed and
      the timer never deleted.
      
      This did not matter until commit 5dd5bc40 ("TTY: pdc_cons, use
      tty_port").  There we needed to set TTY in tty_port to NULL, but this
      never happened due to the bug above.
      
      So change the test to really trigger at the last close by changing the
      condition to 'tty->count == 1'.
      
      Well, the driver should not touch tty->count at all.  It should use
      tty_port->count and count open count there itself.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Reported-and-tested-by: NMikulas Patocka <mpatocka@redhat.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49a5f3cf
  4. 05 5月, 2012 1 次提交
  5. 04 5月, 2012 1 次提交
    • L
      vfs: make word-at-a-time accesses handle a non-existing page · e419b4cc
      Linus Torvalds 提交于
      It turns out that there are more cases than CONFIG_DEBUG_PAGEALLOC that
      can have holes in the kernel address space: it seems to happen easily
      with Xen, and it looks like the AMD gart64 code will also punch holes
      dynamically.
      
      Actually hitting that case is still very unlikely, so just do the
      access, and take an exception and fix it up for the very unlikely case
      of it being a page-crosser with no next page.
      
      And hey, this abstraction might even help other architectures that have
      other issues with unaligned word accesses than the possible missing next
      page.  IOW, this could do the byte order magic too.
      
      Peter Anvin fixed a thinko in the shifting for the exception case.
      Reported-and-tested-by: NJana Saout <jana@saout.de>
      Cc:  Peter Anvin <hpa@zytor.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e419b4cc
  6. 03 5月, 2012 4 次提交
  7. 01 5月, 2012 2 次提交
  8. 30 4月, 2012 3 次提交
    • G
      powerpc/pseries: Rivet CONFIG_EEH for pSeries platform · e49f7a99
      Gavin Shan 提交于
      Recently, Ryan Wang tried to compile PPC pSeries platform without
      CONFIG_EEH and eventually run into errors. Nishanth Aravamudan
      helped to narrow down the root cause. Actually, the pSeries platform
      depends on CONFIG_EEH heavily and that won't work properly without
      EEH support.
      
      According to Ben's suggestion, the patch make CONFIG_EEH invisible
      and keep it as always selected on pSeries platform.
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e49f7a99
    • G
      powerpc/irqdomain: Fix broken NR_IRQ references · 4013369f
      Grant Likely 提交于
      The switch from using irq_map to irq_alloc_desc*() for managing irq
      number allocations introduced new bugs in some of the powerpc
      interrupt code.  Several functions rely on the value of NR_IRQS to
      determine the maximum irq number that could get allocated.  However,
      with sparse_irq and using irq_alloc_desc*() the maximum possible irq
      number is now specified with 'nr_irqs' which may be a number larger
      than NR_IRQS.  This has caused breakage on powermac when
      CONFIG_NR_IRQS is set to 32.
      
      This patch removes most of the direct references to NR_IRQS in the
      powerpc code and replaces them with either a nr_irqs reference or by
      using the common for_each_irq_desc() macro.  The powerpc-specific
      for_each_irq() macro is removed at the same time.
      
      Also, the Cell axon_msi driver is refactored to remove the global
      build assumption on the size of NR_IRQS and instead add a limit to the
      maximum irq number when calling irq_domain_add_nomap().
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4013369f
    • G
      powerpc/8xx: Fix NR_IRQ bugs and refactor 8xx interrupt controller · 8751ed14
      Grant Likely 提交于
      The mpc8xx driver uses a reference to NR_IRQS that is buggy.  It uses
      NR_IRQs for the array size of the ppc_cached_irq_mask bitmap, but
      NR_IRQs could be smaller than the number of hardware irqs that
      ppc_cached_irq_mask tracks.
      
      Also, while fixing that problem, it became apparent that the interrupt
      controller only supports 32 interrupt numbers, but it is written as if
      it supports multiple register banks which is more complicated.
      
      This patch pulls out the buggy reference to NR_IRQs and fixes the size
      of the ppc_cached_irq_mask to match the number of HW irqs.  It also
      drops the now-unnecessary code since ppc_cached_irq_mask is no longer
      an array.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8751ed14
  9. 28 4月, 2012 6 次提交
    • W
      ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs · 5e7371de
      Will Deacon 提交于
      When a CPU is hotplugged off, we migrate any IRQs currently affine to it
      away and onto another online CPU by calling the irq_set_affinity
      function of the relevant interrupt controller chip. This function
      returns either IRQ_SET_MASK_OK or IRQ_SET_MASK_OK_NOCOPY, to indicate
      whether irq_data.affinity was updated.
      
      If we are forcefully migrating an interrupt (because the affinity mask
      no longer identifies any online CPUs) then we should update the IRQ
      affinity mask to reflect the new CPU set. Failure to do so can
      potentially leave /proc/irq/n/smp_affinity identifying only offline
      CPUs, which may confuse userspace IRQ balancing daemons.
      
      This patch updates migrate_one_irq to copy the affinity mask when
      the interrupt chip returns IRQ_SET_MASK_OK after forcefully changing the
      affinity of an interrupt.
      
      Cc: stable@vger.kernel.org
      Reported-by: NLeif Lindholm <leif.lindholm@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      5e7371de
    • W
      ARM: 7405/1: kexec: call platform_cpu_kill on the killer rather than the victim · 6fa99b7f
      Will Deacon 提交于
      When performing a kexec on an SMP system, the secondary cores are stopped
      by calling machine_shutdown(), which in turn issues IPIs to offline the
      other CPUs. Unfortunately, this isn't enough to reboot the cores into
      a new kernel (since they are just executing a cpu_relax loop somewhere
      in memory) so we make use of platform_cpu_kill, part of the CPU hotplug
      implementation, to place the cores somewhere safe. This function expects
      to be called on the killing CPU for each core that it takes out.
      
      This patch moves the platform_cpu_kill callback out of the IPI handler
      and into smp_send_stop, therefore ensuring that it executes on the
      killing CPU rather than on the victim, matching what the hotplug code
      requires.
      
      Cc: stable@vger.kernel.org
      Reported-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6fa99b7f
    • W
      ARM: 7403/1: tls: remove covert channel via TPIDRURW · 6a1c5312
      Will Deacon 提交于
      TPIDRURW is a user read/write register forming part of the group of
      thread registers in more recent versions of the ARM architecture (~v6+).
      
      Currently, the kernel does not touch this register, which allows tasks
      to communicate covertly by reading and writing to the register without
      context-switching affecting its contents.
      
      This patch clears TPIDRURW when TPIDRURO is updated via the set_tls
      macro, which is called directly from __switch_to. Since the current
      behaviour makes the register useless to userspace as far as thread
      pointers are concerned, simply clearing the register (rather than saving
      and restoring it) will not cause any problems to userspace.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6a1c5312
    • S
      ARM: 7401/1: mm: Fix section mismatches · 14904927
      Stephen Boyd 提交于
      WARNING: vmlinux.o(.text+0x111b8): Section mismatch in reference
      from the function arm_memory_present() to the function
      .init.text:memory_present()
      The function arm_memory_present() references
      the function __init memory_present().
      This is often because arm_memory_present lacks a __init
      annotation or the annotation of memory_present is wrong.
      
      WARNING: arch/arm/mm/built-in.o(.text+0x1edc): Section mismatch
      in reference from the function alloc_init_pud() to the function
      .init.text:alloc_init_section()
      The function alloc_init_pud() references
      the function __init alloc_init_section().
      This is often because alloc_init_pud lacks a __init
      annotation or the annotation of alloc_init_section is wrong.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      14904927
    • D
      xen: correctly check for pending events when restoring irq flags · 7eb7ce4d
      David Vrabel 提交于
      In xen_restore_fl_direct(), xen_force_evtchn_callback() was being
      called even if no events were pending.  This resulted in (depending on
      workload) about a 100 times as many xen_version hypercalls as
      necessary.
      
      Fix this by correcting the sense of the conditional jump.
      
      This seems to give a significant performance benefit for some
      workloads.
      
      There is some subtle tricksy "..since the check here is trying to
      check both pending and masked in a single cmpw, but I think this is
      correct. It will call check_events now only when the combined
      mask+pending word is 0x0001 (aka unmasked, pending)." (Ian)
      
      CC: stable@kernel.org
      Acked-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      7eb7ce4d
    • D
      MIPS: Remove get_current_pgd(). · dc5efaa0
      David Daney 提交于
      It is unused in the tree.
      Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/3557/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      dc5efaa0
  10. 27 4月, 2012 10 次提交
    • A
      x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it · f7f286a9
      Andreas Herrmann 提交于
      BIOS will switch off the corresponding feature flag on family
      15h models 10h-1fh non-desktop CPUs.
      
      The topology extension CPUID leafs are required to detect which
      cores belong to the same compute unit. (thread siblings mask is
      set accordingly and also correct information about L1i and L2
      cache sharing depends on this).
      
      W/o this patch we wouldn't see which cores belong to the same
      compute unit and also cache sharing information for L1i and L2
      would be incorrect on such systems.
      Signed-off-by: NAndreas Herrmann <andreas.herrmann3@amd.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      f7f286a9
    • G
      MIPS: ath79: fix AR933X WMAC reset code · de14ca6a
      Gabor Juhos 提交于
      The current code puts the built-in WMAC device of the
      AR933X SoCs into reset instead of starting it. This
      causes a hard lock on AR933X based boards when the
      wireless driver tries to access the device.
      Signed-off-by: NGabor Juhos <juhosg@openwrt.org>
      Cc: stable@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/3484/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      de14ca6a
    • I
      ARM: PXA2xx: MFP: fix potential direction bug · ef7c7c69
      Igor Grinberg 提交于
      Pins configured as input and have MFP_LPM_DRIVE_* flag set, can have a
      wrong output value for some period of time (spike) during the suspend
      sequence.
      This can happen because the direction of the pins (GPDR) is set by
      software and the output level is set by hardware (PGSR) at a later
      stage.
      
      Fix the above potential bug by setting the output levels first.
      Also save the actual levels of the pins before the suspend and restore
      them after the resume, but before the direction settings take place, so
      the same bug as described above will not happen in the resume sequence.
      Reported-by: NPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: NIgor Grinberg <grinberg@compulab.co.il>
      Tested-by: NPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      ef7c7c69
    • I
      ARM: PXA2xx: MFP: fix bug with MFP_LPM_KEEP_OUTPUT · a13b8787
      Igor Grinberg 提交于
      Pins that have MFP_LPM_KEEP_OUTPUT set and are configured for output
      must retain the output state in low power mode.
      Currently, the pin direction configuration is overrided with values
      in gpdr_lpm[] array and do not obey the MFP_LPM_KEEP_OUTPUT setting.
      
      Fix the above bug and add some documentation to clarify the
      MFP_LPM_KEEP_OUTPUT setting purpose.
      Reported-by: NPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: NIgor Grinberg <grinberg@compulab.co.il>
      Tested-by: NPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      a13b8787
    • D
      arm/sa1100: fix sa1100-rtc memory resource · 9f9d27e3
      Dmitry Artamonow 提交于
      DEFINE_RES_MEM() takes the size of resource as a second argument,
      not the end address. Passing end address leads to following error
      in runtime during device registration:
      sa1100-rtc: failed to claim resource 0
      
      Fix it.
      Signed-off-by: NDmitry Artamonow <mad_soft@inbox.ru>
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      9f9d27e3
    • R
      ARM: pxa: fix gpio wakeup setting · b95ace54
      Robert Jarzmik 提交于
      In 3.3, gpio wakeup setting was broken. The call
      enable_irq_wake() didn't set up the PXA gpio registers
      (PWER, ...) anymore.
      
      Fix it at least for pxa27x. The driver doesn't seem to be
      used in pxa25x (weird ...), and the fix doesn't extend to
      pxa3xx and pxa95x (which don't have a gpio_set_wake()
      available).
      Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      b95ace54
    • K
      xen/smp: Fix crash when booting with ACPI hotplug CPUs. · cf405ae6
      Konrad Rzeszutek Wilk 提交于
      When we boot on a machine that can hotplug CPUs and we
      are using 'dom0_max_vcpus=X' on the Xen hypervisor line
      to clip the amount of CPUs available to the initial domain,
      we get this:
      
      (XEN) Command line: com1=115200,8n1 dom0_mem=8G noreboot dom0_max_vcpus=8 sync_console mce_verbosity=verbose console=com1,vga loglvl=all guest_loglvl=all
      .. snip..
      DMI: Intel Corporation S2600CP/S2600CP, BIOS SE5C600.86B.99.99.x032.072520111118 07/25/2011
      .. snip.
      SMP: Allowing 64 CPUs, 32 hotplug CPUs
      installing Xen timer for CPU 7
      cpu 7 spinlock event irq 361
      NMI watchdog: disabled (cpu7): hardware events not enabled
      Brought up 8 CPUs
      .. snip..
      	[acpi processor finds the CPUs are not initialized and starts calling
      	arch_register_cpu, which creates /sys/devices/system/cpu/cpu8/online]
      CPU 8 got hotplugged
      CPU 9 got hotplugged
      CPU 10 got hotplugged
      .. snip..
      initcall 1_acpi_battery_init_async+0x0/0x1b returned 0 after 406 usecs
      calling  erst_init+0x0/0x2bb @ 1
      
      	[and the scheduler sticks newly started tasks on the new CPUs, but
      	said CPUs cannot be initialized b/c the hypervisor has limited the
      	amount of vCPUS to 8 - as per the dom0_max_vcpus=8 flag.
      	The spinlock tries to kick the other CPU, but the structure for that
      	is not initialized and we crash.]
      BUG: unable to handle kernel paging request at fffffffffffffed8
      IP: [<ffffffff81035289>] xen_spin_lock+0x29/0x60
      PGD 180d067 PUD 180e067 PMD 0
      Oops: 0002 [#1] SMP
      CPU 7
      Modules linked in:
      
      Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc2upstream-00001-gf5154e8 #1 Intel Corporation S2600CP/S2600CP
      RIP: e030:[<ffffffff81035289>]  [<ffffffff81035289>] xen_spin_lock+0x29/0x60
      RSP: e02b:ffff8801fb9b3a70  EFLAGS: 00010282
      
      With this patch, we cap the amount of vCPUS that the initial domain
      can run, to exactly what dom0_max_vcpus=X has specified.
      
      In the future, if there is a hypercall that will allow a running
      domain to expand past its initial set of vCPUS, this patch should
      be re-evaluated.
      
      CC: stable@kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      cf405ae6
    • N
      sh: Fix up tracepoint build fallout from static key introduction. · ec2ccd88
      Nobuhiro Iwamatsu 提交于
      With the introduction of static keys, anything using tracepoints blows up
      in the following manner:
      
      include/trace/events/oom.h:8:13: error: initializer element is not constant
      include/trace/events/oom.h:8:13: error: (near initialization for '__tracepoint_oom_score_adj_update')
      include/trace/events/oom.h:8:13: error: initializer element is not constant
      include/trace/events/oom.h:8:13: error: (near initialization for '__tracepoint_oom_score_adj_update.key')
      
      This is a result of the STATIC_KEY_INIT_xxx defs wrapping ATOMIC_INIT()
      which on sh includes an atomic_t typecast. Given that we don't really
      need the typecast for anything anymore, the simplest solution is simply
      to kill off the cast.
      Signed-off-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      ec2ccd88
    • A
      MIPS: JZ4740: Fix the JZ4740_IRQ_DMA macro · 05c8be02
      Antony Pavlov 提交于
      Signed-off-by: NAntony Pavlov <antonynpavlov@gmail.com>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/3459/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      05c8be02
    • M
      MIPS: Use set_current_blocked() and block_sigmask() · 8598f3cd
      Matt Fleming 提交于
      As described in e6fa16ab ("signal: sigprocmask() should do
      retarget_shared_pending()") the modification of current->blocked is
      incorrect as we need to check whether the signal we're about to block
      is pending in the shared queue.
      
      Also, use the new helper function introduced in commit 5e6292c0
      ("signal: add block_sigmask() for adding sigmask to current->blocked")
      which centralises the code for updating current->blocked after
      successfully delivering a signal and reduces the amount of duplicate
      code across architectures. In the past some architectures got this
      code wrong, so using this helper function should stop that from
      happening again.
      
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: David Daney <ddaney@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      Patchwork: https://patchwork.linux-mips.org/patch/3363/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8598f3cd