1. 08 May, 2012 1 commit
  2. 06 May, 2012 1 commit
  3. 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>
  4. 04 May, 2012 1 commit
  5. 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>
  6. 02 May, 2012 4 commits
  7. 30 Apr, 2012 2 commits
  8. 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>
  9. 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>
  10. 27 Apr, 2012 4 commits
  11. 26 Apr, 2012 11 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>
    • Matt Fleming's avatar
      MIPS: Use set_current_blocked() and block_sigmask() · 8598f3cd
      Matt Fleming authored
      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: default avatarMatt Fleming <matt.fleming@intel.com>
      Patchwork: https://patchwork.linux-mips.org/patch/3363/
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    • Paul Gortmaker's avatar
      xtensa: fix build fail on undefined ack_bad_irq · 8e12a038
      Paul Gortmaker authored
      Commit e520c410
          "xtensa: convert to asm-generic/hardirq.h"
      converted over to using the asm-generic parts, but it also
      added the sentinel
      	#define ack_bad_irq ack_bad_irq
      which tells asm-generic to _not_ use the common ack_bad_irq.
      Since e520c410
       deleted the duplicated code from the arch specific
      file, we _do_ want the asm-generic one in scope.  So delete
      the trigger define above which hides it.  In doing so we'll
      realize that we've got to delete the almost-duplicate prototype
      as well to avoid "static declaration ... follows non-static".
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Chris Zankel <chris@zankel.net>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
    • Konrad Rzeszutek Wilk's avatar
      xen/enlighten: Disable MWAIT_LEAF so that acpi-pad won't be loaded. · df88b2d9
      Konrad Rzeszutek Wilk authored
      There are exactly four users of __monitor and __mwait:
       - cstate.c (which allows acpi_processor_ffh_cstate_enter to be called
         when the cpuidle API drivers are used. However patch
         "cpuidle: replace xen access to x86 pm_idle and default_idle"
         provides a mechanism to disable the cpuidle and use safe_halt.
       - smpboot (which allows mwait_play_dead to be called). However
         safe_halt is always used so we skip that.
       - intel_idle (same deal as above).
       - acpi_pad.c. This the one that we do not want to run as we
         will hit the below crash.
      Why do we want to expose MWAIT_LEAF in the first place?
      We want it for the xen-acpi-processor driver - which uploads
      C-states to the hypervisor. If MWAIT_LEAF is set, the cstate.c
      sets the proper address in the C-states so that the hypervisor
      can benefit from using the MWAIT functionality. And that is
      the sole reason for using it.
      Without this patch, if a module performs mwait or monitor we
      get this:
      invalid opcode: 0000 [#1] SMP
      CPU 2
      .. snip..
      Pid: 5036, comm: insmod Tainted: G           O 3.4.0-rc2upstream-dirty #2 Intel Corporation S2600CP/S2600CP
      RIP: e030:[<ffffffffa000a017>]  [<ffffffffa000a017>] mwait_check_init+0x17/0x1000 [mwait_check]
      RSP: e02b:ffff8801c298bf18  EFLAGS: 00010282
      RAX: ffff8801c298a010 RBX: ffffffffa03b2000 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffff8801c29800d8 RDI: ffff8801ff097200
      RBP: ffff8801c298bf18 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
      R13: ffffffffa000a000 R14: 0000005148db7294 R15: 0000000000000003
      FS:  00007fbb364f2700(0000) GS:ffff8801ff08c000(0000) knlGS:0000000000000000
      CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 000000000179f038 CR3: 00000001c9469000 CR4: 0000000000002660
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process insmod (pid: 5036, threadinfo ffff8801c298a000, task ffff8801c29cd7e0)
       ffff8801c298bf48 ffffffff81002124 ffffffffa03b2000 00000000000081fd
       000000000178f010 000000000178f030 ffff8801c298bf78 ffffffff810c41e6
       00007fff3fb30db9 00007fff3fb30db9 00000000000081fd 0000000000010000
      Call Trace:
       [<ffffffff81002124>] do_one_initcall+0x124/0x170
       [<ffffffff810c41e6>] sys_init_module+0xc6/0x220
       [<ffffffff815b15b9>] system_call_fastpath+0x16/0x1b
      Code: <0f> 01 c8 31 c0 0f 01 c9 c9 c3 00 00 00 00 00 00 00 00 00 00 00 00
      RIP  [<ffffffffa000a017>] mwait_check_init+0x17/0x1000 [mwait_check]
       RSP <ffff8801c298bf18>
      ---[ end trace 16582fc8a3d1e29a ]---
      Kernel panic - not syncing: Fatal exception
      With this module (which is what acpi_pad.c would hit):
      MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
      static int __init mwait_check_init(void)
      	__monitor((void *)&current_thread_info()->flags, 0, 0);
      	__mwait(0, 0);
      	return 0;
      static void __exit mwait_check_exit(void)
      Reported-by: default avatarLiu, Jinsong <jinsong.liu@intel.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    • Paul Gortmaker's avatar
      blackfin: fix ifdef fustercluck in mach-bf538/boards/ezkit.c · fa83af7e
      Paul Gortmaker authored
      This file has lots and lots of ifdef, around structure decls
      and structure usages.  The failure issue was that we would
      build the BF538-EZKIT_defconfig and get:
       arch/blackfin/mach-bf538/boards/ezkit.c:924:3: error: 'bfin_lq035q1_device'
       undeclared here (not in a function)
      even though the same ifdef _appeared_ to enable both the struct
      declaration and the code that used it.  Yet cpp was telling us we
      didn't have the struct, but we still had the usage of it.
      However, _appeared_ is the operative word.  After marking all the
      anonymous #endif with their parent #ifdef config options, it was
      _then_ clear that there was a misplaced #endif that was hiding
      the struct declaration.
      The real guts of the patch boils down to this:
      +#endif /* CONFIG_MTD_M25P80 */
      +#endif /* CONFIG_SPI_BFIN5XX */
      -#endif  /* spi master and devices */
      but since I had to tag the #endif with their respective #ifdef
      options to find this misplaced SPI endif, it would be silly to
      then go and delete them all.  So they stay.
      Cc: Sonic Zhang <sonic.zhang@analog.com>
      Cc: Bob Liu <lliubbo@gmail.com>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
  12. 25 Apr, 2012 4 commits
  13. 24 Apr, 2012 3 commits