1. 21 May, 2012 9 commits
  2. 07 May, 2012 2 commits
  3. 06 May, 2012 2 commits
  4. 05 May, 2012 1 commit
    • Jiri Slaby's avatar
      TTY: pdc_cons, fix regression in close · 49a5f3cf
      Jiri Slaby authored
      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: default avatarJiri Slaby <jslaby@suse.cz>
      Reported-and-tested-by: default avatarMikulas 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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  5. 04 May, 2012 1 commit
  6. 03 May, 2012 1 commit
    • Linus Torvalds's avatar
      vfs: make word-at-a-time accesses handle a non-existing page · e419b4cc
      Linus Torvalds authored
      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
      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: default avatarJana Saout <jana@saout.de>
      Cc:  Peter Anvin <hpa@zytor.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  7. 02 May, 2012 4 commits
  8. 30 Apr, 2012 2 commits
  9. 29 Apr, 2012 3 commits
    • Gavin Shan's avatar
      powerpc/pseries: Rivet CONFIG_EEH for pSeries platform · e49f7a99
      Gavin Shan authored
      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: default avatarGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    • Grant Likely's avatar
      powerpc/irqdomain: Fix broken NR_IRQ references · 4013369f
      Grant Likely authored
      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: default avatarGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    • Grant Likely's avatar
      powerpc/8xx: Fix NR_IRQ bugs and refactor 8xx interrupt controller · 8751ed14
      Grant Likely authored
      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: default avatarGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
  10. 28 Apr, 2012 4 commits
    • Will Deacon's avatar
      ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs · 5e7371de
      Will Deacon authored
      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: default avatarLeif Lindholm <leif.lindholm@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    • Will Deacon's avatar
      ARM: 7405/1: kexec: call platform_cpu_kill on the killer rather than the victim · 6fa99b7f
      Will Deacon authored
      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
      Cc: stable@vger.kernel.org
      Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    • Will Deacon's avatar
      ARM: 7403/1: tls: remove covert channel via TPIDRURW · 6a1c5312
      Will Deacon authored
      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: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    • Stephen Boyd's avatar
      ARM: 7401/1: mm: Fix section mismatches · 14904927
      Stephen Boyd authored
      WARNING: vmlinux.o(.text+0x111b8): Section mismatch in reference
      from the function arm_memory_present() to the function
      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
      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: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
  11. 27 Apr, 2012 4 commits
  12. 26 Apr, 2012 7 commits
    • Igor Grinberg's avatar
      ARM: PXA2xx: MFP: fix potential direction bug · ef7c7c69
      Igor Grinberg authored
      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
      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
      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: default avatarPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
      Tested-by: default avatarPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
    • Igor Grinberg's avatar
      ARM: PXA2xx: MFP: fix bug with MFP_LPM_KEEP_OUTPUT · a13b8787
      Igor Grinberg authored
      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: default avatarPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
      Tested-by: default avatarPaul Parsons <lost.distance@yahoo.com>
      Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
    • Dmitry Artamonow's avatar
      arm/sa1100: fix sa1100-rtc memory resource · 9f9d27e3
      Dmitry Artamonow authored
      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: default avatarDmitry Artamonow <mad_soft@inbox.ru>
      Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
    • Robert Jarzmik's avatar
      ARM: pxa: fix gpio wakeup setting · b95ace54
      Robert Jarzmik authored
      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()
      Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
    • Konrad Rzeszutek Wilk's avatar
      xen/smp: Fix crash when booting with ACPI hotplug CPUs. · cf405ae6
      Konrad Rzeszutek Wilk authored
      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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    • Nobuhiro Iwamatsu's avatar
      sh: Fix up tracepoint build fallout from static key introduction. · ec2ccd88
      Nobuhiro Iwamatsu authored
      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: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
    • Antony Pavlov's avatar
      MIPS: JZ4740: Fix the JZ4740_IRQ_DMA macro · 05c8be02
      Antony Pavlov authored
      Signed-off-by: default avatarAntony 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: default avatarRalf Baechle <ralf@linux-mips.org>