]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agopowerpc+of: Rename and fix OF reconfig notifier error inject module
Benjamin Herrenschmidt [Thu, 13 Dec 2012 23:32:52 +0000 (10:32 +1100)]
powerpc+of: Rename and fix OF reconfig notifier error inject module

This module used to inject errors in the pSeries specific dynamic
reconfiguration notifiers. Those are gone however, replaced by
generic notifiers for changes to the device-tree. So let's update
the module to deal with these instead and rename it along the way.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
11 years agopowerpc+of: Export of_reconfig_notifier_[register,unregister]
Nathan Fontenot [Wed, 28 Nov 2012 09:42:26 +0000 (09:42 +0000)]
powerpc+of: Export of_reconfig_notifier_[register,unregister]

The of reconfiguration notification chains should be exported for use
by modules.

Signed-off-by:Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoMerge remote-tracking branch 'kumar/next' into next
Benjamin Herrenschmidt [Sun, 25 Nov 2012 22:25:25 +0000 (09:25 +1100)]
Merge remote-tracking branch 'kumar/next' into next

Freescale updates from Kumar

11 years agoMerge branch 'merge' into next
Benjamin Herrenschmidt [Sun, 25 Nov 2012 22:23:57 +0000 (09:23 +1100)]
Merge branch 'merge' into next

Merge my own merge branch to get various fixes from there
and upstream, especially the hvc console tty refcouting fixes
which which testing is quite a bit harder...

11 years agopowerpc/eeh: Do not invalidate PE properly
Gavin Shan [Thu, 22 Nov 2012 21:58:26 +0000 (21:58 +0000)]
powerpc/eeh: Do not invalidate PE properly

While the EEH does recovery on the specific PE that has PCI errors,
the PCI devices belonging to the PE will be removed and the PE will
be marked as invalid since we still need the information stored in
the PE. We only invalidate the PE when it doesn't have associated
EEH devices and valid child PEs. However, the code used to check
that is wrong. The patch fixes that.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/dma/raidengine: add raidengine device
Xuelin Shi [Wed, 21 Nov 2012 09:01:20 +0000 (17:01 +0800)]
powerpc/dma/raidengine: add raidengine device

The RaidEngine is a new Freescale hardware that used for parity
computation offloading in RAID5/6.

This patch adds the device node in device tree and related binding
documentation.

Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
Signed-off-by: Naveen Burmi <naveenburmi@freescale.com>
Signed-off-by: Xuelin Shi <b29237@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
11 years agopowerpc/iommu/fsl: Add PAMU bypass enable register to ccsr_guts struct
Varun Sethi [Tue, 20 Nov 2012 13:54:55 +0000 (19:24 +0530)]
powerpc/iommu/fsl: Add PAMU bypass enable register to ccsr_guts struct

PAMU bypass enable register added to the ccsr_guts structure.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
11 years agopowerpc/mpc85xx: Change spin table to cached memory
York Sun [Sat, 29 Sep 2012 23:44:35 +0000 (16:44 -0700)]
powerpc/mpc85xx: Change spin table to cached memory

ePAPR v1.1 requires the spin table to be in cached memory. So we need
to change the call argument of ioremap to enable cache and coherence.
We also flush the cache after writing to spin table to keep it compatible
with previous cache-inhibit spin table. Flushing before and after
accessing spin table is recommended by ePAPR.

Signed-off-by: York Sun <yorksun@freescale.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
11 years agopowerpc/fsl-pci: Add PCI controller ATMU PM support
Jia Hongtao [Thu, 8 Nov 2012 02:11:07 +0000 (10:11 +0800)]
powerpc/fsl-pci: Add PCI controller ATMU PM support

Power supply for PCI controller ATMU registers is off when system go to
deep-sleep state. So ATMU registers should be re-setup during PCI
controllers resume from sleep.

Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
11 years agopowerpc/86xx: fsl_pcibios_fixup_bus requires CONFIG_PCI
Timur Tabi [Mon, 15 Oct 2012 19:52:21 +0000 (14:52 -0500)]
powerpc/86xx: fsl_pcibios_fixup_bus requires CONFIG_PCI

Function fsl_pcibios_fixup_bus() is available only if PCI is enabled.  The
MPC8610 HPCD platform file was not protecting the assigned with an #ifdef,
which results in a link failure when PCI is disabled.  Every other platform
already has this #ifdef.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
11 years agodrivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS]
Timur Tabi [Thu, 17 May 2012 19:10:27 +0000 (14:10 -0500)]
drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS]

The MSR[GS] bit indicates whether the kernel is running in processor guest
state mode, but such a check is unnecessary.  The driver already checks
for the /hypervisor node and the fsl,hv-version property, so it already
knows that it's running under the Freescale hypervisor.

There is nothing in the driver that inherently requires guest state,
anyway.

This fixes a break that can occur in some randconfig builds.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
11 years agopowerpc/85xx: p1022ds: Use NULL instead of 0 for pointers
Tushar Behera [Tue, 20 Nov 2012 04:31:51 +0000 (10:01 +0530)]
powerpc/85xx: p1022ds: Use NULL instead of 0 for pointers

The third argument for of_get_property() is a pointer, hence pass
NULL instead of 0.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
11 years agopowerpc/pseries: Fix oops with MSIs when missing EEH PEs
Alexey Kardashevskiy [Fri, 23 Nov 2012 02:25:39 +0000 (13:25 +1100)]
powerpc/pseries: Fix oops with MSIs when missing EEH PEs

The new EEH code introduced a small regression, if the EEH PEs
are missin (which happens currently in qemu for example), it
will deref a NULL pointer in the MSI code.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoMerge remote-tracking branch 'agust/merge' into merge
Benjamin Herrenschmidt [Wed, 21 Nov 2012 02:24:49 +0000 (13:24 +1100)]
Merge remote-tracking branch 'agust/merge' into merge

Anatolij 52xx updates:

Patch for pcm030 device tree fixing the probe() in pcm030-audio-fabric
driver. Changes to this driver have been merged in 3.7-rc1 via ASoC
tree, but this required device tree patch was submitted separately to
the linux-ppc list and is still missing in mainline. Without this patch
the probe() in pcm030-audio-fabric driver wrongly returns -ENODEV.

A patch from Wolfram fixing wrong invalid critical irq warnings for
all mpc5200 boards.

Another patch for all mpc5200 device trees fixing wrong L1 cell in
the LPB FIFO interrupt property and moving the LPB FIFO node to the
common mpc5200b.dtsi file so that this common node will be present
in all mpc5200 device trees.

11 years agopowerpc: Disable relocation on exceptions when kexecing
Ian Munsie [Thu, 8 Nov 2012 05:40:28 +0000 (16:40 +1100)]
powerpc: Disable relocation on exceptions when kexecing

Since we don't know if they new kernel we are kexecing into has been
built to support relocation on exceptions, we disable them before we
kexec.

We do NOT disable them if we are execing a kdump kernel, because we
want to change as little state as possible and it is likely that we are
execing ourselves and will be able to handle them anyway.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Enable relocation on during exceptions at boot
Ian Munsie [Thu, 8 Nov 2012 05:03:14 +0000 (16:03 +1100)]
powerpc: Enable relocation on during exceptions at boot

We currently do this synchronously at boot from setup_arch. On a large
system this could hypothetically take a little while to complete, so
currently we will give up if we are asked to wait for more than a second
in total.

If we actually start hitting that timeout in practice we can always move
this code into a kernel thread to take care of it in the background.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function
Ian Munsie [Thu, 8 Nov 2012 05:10:29 +0000 (16:10 +1100)]
powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function

I am going to use this in the next patch, better to have this code in
one place rather than three.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add wrappers to enable/disable relocation on exceptions
Ian Munsie [Thu, 8 Nov 2012 04:57:04 +0000 (15:57 +1100)]
powerpc: Add wrappers to enable/disable relocation on exceptions

These wrappers hide the parameters that have to be passed to H_SET_MODE
to enable/disable relocation on during exceptions.

As noted in the comments, since these have partition wide scope, they
may take some time to complete and must be periodically retried until
H_SUCCESS is returned.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add set_mode hcall
Ian Munsie [Tue, 6 Nov 2012 05:15:17 +0000 (16:15 +1100)]
powerpc: Add set_mode hcall

This new hcall in POWER8 is used to set various resource mode registers.
eg. it can set address translation mode on interrupt (note: partition wide
scope)

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Setup relocation on exceptions for bare metal systems
Michael Neuling [Fri, 2 Nov 2012 05:41:58 +0000 (16:41 +1100)]
powerpc: Setup relocation on exceptions for bare metal systems

This turns on MMU on execptions via AIL field in the LPCR.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Move initial mfspr LPCR out of __init_LPCR
Michael Neuling [Mon, 5 Nov 2012 03:40:18 +0000 (14:40 +1100)]
powerpc: Move initial mfspr LPCR out of __init_LPCR

We want to change what's initially set in the LPCR, so start by taking the move
from LPCR out of the function and into the caller.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add relocation on exception vector handlers
Michael Neuling [Fri, 2 Nov 2012 06:21:43 +0000 (17:21 +1100)]
powerpc: Add relocation on exception vector handlers

POWER8/v2.07 allows exceptions to be taken with the MMU still on.

A new set of exception vectors is added at 0xc000_0000_0000_4xxx.  When the HW
takes us here, MSR IR/DR will be set already and we no longer need a costly
RFID to turn the MMU back on again.

The original 0x0 based exception vectors remain for when the HW can't leave the
MMU on.  Examples of this are when we can't trust the current MMU mappings,
like when we are changing from guest to hypervisor (HV 0 -> 1) or when the MMU
was off already.  In these cases the HW will take us to the original 0x0 based
exception vectors with the MMU off as before.

This uses the new macros added previously too implement these new execption
vectors at 0xc000_0000_0000_4xxx.  We exit these exception vectors using
mflr/blr (rather than mtspr SSR0/RFID), since we don't need the costly MMU
switch anymore.

This moves the __end_interrupts marker down past these new 0x4000 vectors since
they will need to be copied down to 0x0 when the kernel is not at 0x0.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add new macros needed for relocation on exceptions
Michael Neuling [Fri, 2 Nov 2012 06:21:28 +0000 (17:21 +1100)]
powerpc: Add new macros needed for relocation on exceptions

POWER8/v2.07 allows exceptions to be taken with the MMU still on.

A new set of exception vectors is added at 0xc000_0000_0000_4xxx.  When the HW
takes us here, MSR IR/DR will be set already and we no longer need a costly
RFID to turn the MMU back on again.

The original 0x0 based exception vectors remain for when the HW can't leave the
MMU on.  Examples of this are when we can't trust the current the MMU mappings,
like when we are changing from guest to hypervisor (HV 0 -> 1) or when the MMU
was off already.  In these cases the HW will take us to the original 0x0 based
exception vectors with the MMU off as before.

The below macros are copies of the macros used at the 0x0 offset but modified
to handle the MMU being on.  In these macros we use the link register to jump
to the secondary handlers rather than using RFID (RFID was also use to turn on
the MMU).

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Turn syscall handler into macros
Michael Neuling [Fri, 2 Nov 2012 06:16:01 +0000 (17:16 +1100)]
powerpc: Turn syscall handler into macros

This turns the syscall handler into macros as we are going to want to reuse
them again later.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Make load_hander handle upto 64k offset
Michael Neuling [Mon, 5 Nov 2012 06:10:35 +0000 (17:10 +1100)]
powerpc: Make load_hander handle upto 64k offset

If we change load_hander() to use an ori instead of addi, we can load handlers
upto 64k away provided we are still 64k aligned.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Remove unessessary 0x3000 location enforcement
Michael Neuling [Fri, 2 Nov 2012 02:53:36 +0000 (13:53 +1100)]
powerpc: Remove unessessary 0x3000 location enforcement

This removes the large gap between 0x1800 and 0x3000.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Whitespace changes in exception64s.S
Michael Neuling [Fri, 2 Nov 2012 03:11:51 +0000 (14:11 +1100)]
powerpc: Whitespace changes in exception64s.S

Remove redundancy spaces and make tab usage consistent.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoMerge branch 'dt' into next
Benjamin Herrenschmidt [Thu, 15 Nov 2012 04:02:44 +0000 (15:02 +1100)]
Merge branch 'dt' into next

11 years agopowerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build
Anton Blanchard [Sun, 11 Nov 2012 19:01:05 +0000 (19:01 +0000)]
powerpc: Fix CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n build

If we build a kernel with CONFIG_RELOCATABLE=y CONFIG_CRASH_DUMP=n,
the kernel fails when we run at a non zero offset. It turns out
we were incorrectly wrapping some of the relocatable kernel code
with CONFIG_CRASH_DUMP.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add POWER8 architected mode to cputable
Michael Neuling [Thu, 8 Nov 2012 20:26:42 +0000 (20:26 +0000)]
powerpc: Add POWER8 architected mode to cputable

A PVR of 0x0F000004 means we are arch v2.07 complicate ie, POWER8.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/pseries: Update ibm,architecture.vec for PAPR 2.7/POWER8
Michael Neuling [Thu, 8 Nov 2012 20:23:11 +0000 (20:23 +0000)]
powerpc/pseries: Update ibm,architecture.vec for PAPR 2.7/POWER8

Update ibm,architecture.vec for POWER8 and allows us to support more
than one parition per core.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Change free_bootmem() to kfree()
JoonSoo Kim [Mon, 12 Nov 2012 06:40:33 +0000 (06:40 +0000)]
powerpc: Change free_bootmem() to kfree()

commit ea96025a('Don't use alloc_bootmem() in init_IRQ() path')
changed alloc_bootmem() to kzalloc(),
but missed to change free_bootmem() to kfree().
So correct it.

Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/ptrace: Enable hardware breakpoint upon re-registering
Aravinda Prasad [Sun, 4 Nov 2012 22:15:28 +0000 (22:15 +0000)]
powerpc/ptrace: Enable hardware breakpoint upon re-registering

On powerpc, ptrace will disable hardware breakpoint request once the
breakpoint is hit. It is the responsibility of the caller to set it
again. However, when the caller sets the hardware breakpoint again
using ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, addr), the hardware
breakpoint is not enabled.

While gdb's approach is to unregister and re-register the hardware
breakpoint every time the breakpoint is hit - which is working fine,
this could affect other programs trying to re-register hardware
breakpoint without unregistering.

This patch enables hardware breakpoint if the caller is re-registering.

Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Use asm-generic/bitops/le.h
Akinobu Mita [Sun, 4 Nov 2012 02:03:45 +0000 (02:03 +0000)]
powerpc: Use asm-generic/bitops/le.h

The only difference between powerpc and asm-generic le-bitops is
test_bit_le().  Usually all bitops require a long aligned bitmap.
But powerpc test_bit_le() can take an unaligned address.

There is no special callsite of test_bit_le() that needs unaligned
access in powerpc as far as I can see.  So convert to use
asm-generic/bitops/le.h for powerpc.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Remove BITOP_MASK and BITOP_WORD from asm/bitops.h
Akinobu Mita [Sun, 4 Nov 2012 02:03:44 +0000 (02:03 +0000)]
powerpc: Remove BITOP_MASK and BITOP_WORD from asm/bitops.h

Replace BITOP_MASK and BITOP_WORD with BIT_MASK and BIT_WORD defined
in linux/bitops.h and remove BITOP_* which are not used anymore.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/iommu: Use bitmap library
Akinobu Mita [Sun, 4 Nov 2012 02:03:43 +0000 (02:03 +0000)]
powerpc/iommu: Use bitmap library

- Caluculate the bitmap size with BITS_TO_LONGS()
 - Use bitmap_empty() to verify that all bits are cleared

This also includes a printk to pr_warn() conversion.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/perf: Use uapi/unistd.h to fix build error
Sukadev Bhattiprolu [Wed, 31 Oct 2012 18:21:28 +0000 (11:21 -0700)]
powerpc/perf: Use uapi/unistd.h to fix build error

Use the 'unistd.h' from arch/powerpc/include/uapi to build the perf tool.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Fix typos in Freescale copyright claims
Yang Li [Thu, 1 Nov 2012 18:53:42 +0000 (18:53 +0000)]
powerpc: Fix typos in Freescale copyright claims

There are many cases that Semiconductor is misspelled.  The patch
fix these typos.

Signed-off-by: Li Yang <leoli@freescale.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Remove stale function prototypes from setup.h
Anton Blanchard [Thu, 1 Nov 2012 14:55:55 +0000 (14:55 +0000)]
powerpc: Remove stale function prototypes from setup.h

I noticed a couple of function prototypes for functions that
no longer exist. Remove them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Move most of setup.h out of uapi
Anton Blanchard [Thu, 1 Nov 2012 14:55:04 +0000 (14:55 +0000)]
powerpc: Move most of setup.h out of uapi

Most of setup.h should not be exported to userspace, so move it
back. All we are left with is the asm-generic include to pick
up the COMMAND_LINE_SIZE define.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Fix denorm symbol name
Michael Neuling [Wed, 31 Oct 2012 18:58:36 +0000 (18:58 +0000)]
powerpc: Fix denorm symbol name

Fix global symbol name to match actual denorm_exception_hv label.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: POWER8 cputable entry
Michael Neuling [Tue, 30 Oct 2012 19:34:15 +0000 (19:34 +0000)]
powerpc: POWER8 cputable entry

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add POWER8 setup code
Michael Neuling [Tue, 30 Oct 2012 19:34:14 +0000 (19:34 +0000)]
powerpc: Add POWER8 setup code

Just a copy of POWER7 for now.  Will update with new code later.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: make POWER7 setup code name generic
Michael Neuling [Tue, 30 Oct 2012 19:34:13 +0000 (19:34 +0000)]
powerpc: make POWER7 setup code name generic

We are going to reuse this in POWER8 so make the name generic.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/perf: Add missing L2 constraint handling in Power7 PMU
Michael Ellerman [Tue, 30 Oct 2012 16:09:56 +0000 (16:09 +0000)]
powerpc/perf: Add missing L2 constraint handling in Power7 PMU

If we have two cache events that require different settings of the L2SEL
bits in MMCR1 then we can not schedule those events simultaneously. Add
logic to the constraint handling to express that.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powermac/cpufreq_32: Set non-infinite transition time for 7447A driver
Andreas Schwab [Sun, 28 Oct 2012 23:15:14 +0000 (23:15 +0000)]
powerpc/powermac/cpufreq_32: Set non-infinite transition time for 7447A driver

The transition time for the 7447A is around 8ms which makes it possible
to use the ondemand governor.  This has been tested on the iBook G4
(PowerBook6,7).

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Tested-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/ptrace: Remove unused addr parameter in ppc_del_hwdebug()
Michael Neuling [Sun, 28 Oct 2012 15:13:17 +0000 (15:13 +0000)]
powerpc/ptrace: Remove unused addr parameter in ppc_del_hwdebug()

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/ptrace: Fix spelling mistake
Michael Neuling [Sun, 28 Oct 2012 15:13:16 +0000 (15:13 +0000)]
powerpc/ptrace: Fix spelling mistake

s/intruction/instruction/

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/hw-breakpoint: Use generic hw-breakpoint interfaces for new PPC ptrace flags
K.Prasad [Sun, 28 Oct 2012 15:13:15 +0000 (15:13 +0000)]
powerpc/hw-breakpoint: Use generic hw-breakpoint interfaces for new PPC ptrace flags

PPC_PTRACE_GETHWDBGINFO, PPC_PTRACE_SETHWDEBUG and PPC_PTRACE_DELHWDEBUG are
PowerPC specific ptrace flags that use the watchpoint register. While they are
targeted primarily towards BookE users, user-space applications such as GDB
have started using them for BookS too. This patch enables the use of generic
hardware breakpoint interfaces for these new flags.

Apart from the usual benefits of using generic hw-breakpoint interfaces, these
changes allow debuggers (such as GDB) to use a common set of ptrace flags for
their watchpoint needs and allow more precise breakpoint specification (length
of the variable can be specified).

Mikey added: rebased and added dbginfo.features around #ifdef
             CONFIG_HAVE_HW_BREAKPOINT

Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Remove no longer used ppc_md.idle_loop()
Michael Ellerman [Wed, 24 Oct 2012 17:21:09 +0000 (17:21 +0000)]
powerpc: Remove no longer used ppc_md.idle_loop()

The last user of ppc_md.idle_loop() was removed when we dropped the
legacy iSeries code, in commit 8ee3e0d.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning !
Li Zhong [Mon, 22 Oct 2012 23:46:27 +0000 (23:46 +0000)]
powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning !

This patch tries to fix the following BUG report:

[    0.012313] BUG: MAX_STACK_TRACE_ENTRIES too low!
[    0.012318] turning off the locking correctness validator.
[    0.012321] Call Trace:
[    0.012330] [c00000017666f6d0] [c000000000012128] .show_stack+0x78/0x184 (unreliable)
[    0.012339] [c00000017666f780] [c0000000000b6348] .save_trace+0x12c/0x14c
[    0.012345] [c00000017666f800] [c0000000000b7448] .mark_lock+0x2bc/0x710
[    0.012351] [c00000017666f8b0] [c0000000000bb198] .__lock_acquire+0x748/0xaec
[    0.012357] [c00000017666f9b0] [c0000000000bb684] .lock_acquire+0x148/0x194
[    0.012365] [c00000017666fa80] [c00000000069371c] .mutex_lock_nested+0x84/0x4ec
[    0.012372] [c00000017666fb90] [c000000000096998] .smpboot_register_percpu_thread+0x3c/0x10c
[    0.012380] [c00000017666fc30] [c0000000009ba910] .spawn_ksoftirqd+0x28/0x48
[    0.012386] [c00000017666fcb0] [c00000000000a98c] .do_one_initcall+0xd8/0x1d0
[    0.012392] [c00000017666fd60] [c00000000000b1f8] .kernel_init+0x120/0x398

[    0.012398] [c00000017666fe30] [c000000000009ad4] .ret_from_kernel_thread+0x5c/0x64
[    0.012404] [c00000017666fa00] [c00000017666fb20] 0xc00000017666fb20
[    0.012410] [c00000017666fa80] [c00000000069371c] .mutex_lock_nested+0x84/0x4ec
[    0.012416] [c00000017666fb90] [c000000000096998] .smpboot_register_percpu_thread+0x3c/0x10c
[    0.012422] [c00000017666fc30] [c0000000009ba910] .spawn_ksoftirqd+0x28/0x48
[    0.012427] [c00000017666fcb0] [c00000000000a98c] .do_one_initcall+0xd8/0x1d0
[    0.012433] [c00000017666fd60] [c00000000000b1f8] .kernel_init+0x120/0x398

[    0.012439] [c00000017666fe30] [c000000000009ad4] .ret_from_kernel_thread+0x5c/0x64
.......

The reason is that the back chain of c00000017666fe30
(ret_from_kernel_thread) contains some invalid value, which might form a
loop.

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/powernv: Fix OPAL debug entry
Benjamin Herrenschmidt [Sun, 21 Oct 2012 14:30:52 +0000 (14:30 +0000)]
powerpc/powernv: Fix OPAL debug entry

OPAL provides the firmware base/entry in registers at boot time
for debugging purposes. We had a bug in the code trying to stash
these into the appropriate kernel globals (a line of code was
probably dropped by accident back when this was merged)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/rtas_flash: Eliminate possible double free
Julia Lawall [Sun, 21 Oct 2012 00:52:05 +0000 (00:52 +0000)]
powerpc/rtas_flash: Eliminate possible double free

The function initialize_flash_pde_data is only called four times.  All four
calls are in the function rtas_flash_init, and on the failure of any of the
calls, remove_flash_pde is called on the third argument of each of the
calls.  There is thus no need for initialize_flash_pde_data to call
remove_flash_pde on the same argument.  remove_flash_pde kfrees the data
field of its argument, and does not clear that field, so this amounts ot a
possible double free.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier f,free,a;
parameter list[n] ps;
type T;
expression e;
@@

f(ps,T a,...) {
  ... when any
      when != a = e
  if(...) { ... free(a); ... return ...; }
  ... when any
}

@@
identifier r.f,r.free;
expression x,a;
expression list[r.n] xs;
@@

* x = f(xs,a,...);
  if (...) { ... free(a); ... return ...; }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/pnv: Avoid bogus output
Gavin Shan [Wed, 17 Oct 2012 19:53:30 +0000 (19:53 +0000)]
powerpc/pnv: Avoid bogus output

There're couples of functions defined to print debugging messages
during initializing P7IOC. However, we got bogus output from those
functions like pe_info(). The problem here is that the message
level (the first parameter to printk()) isn't printable and that
caused the bogus output.

The patch fixes the issue by merging __pe_printk() to the macro
define_pe_printk_level() so that we can pass the message level
directly to printk().

Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/sysdev: Use module_platform_driver macro
Srinivas Kandagatla [Wed, 10 Oct 2012 08:32:30 +0000 (08:32 +0000)]
powerpc/sysdev: Use module_platform_driver macro

This patch removes some code duplication by using
module_platform_driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Fallback to printk() in xmon_printf() if udbg is not setup
Michael Ellerman [Tue, 9 Oct 2012 04:20:47 +0000 (04:20 +0000)]
powerpc/xmon: Fallback to printk() in xmon_printf() if udbg is not setup

It is possible to configure a kernel which has xmon enabled, but has no
udbg backend to provide IO. This can make xmon rather confusing, as it
produces no output, blocks for two seconds, and then returns.

As a last resort we can instead try to printk(), which may deadlock or
otherwise crash, but tries quite hard not to.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Fiddle xmon_depth_to_print logic in xmon_show_stack()
Michael Ellerman [Tue, 9 Oct 2012 04:20:36 +0000 (04:20 +0000)]
powerpc/xmon: Fiddle xmon_depth_to_print logic in xmon_show_stack()

Currently xmon_depth_to_print is static and global, but it's only
ever used in xmon_show_stack().

At least with a modern compiler it's inlined, so there's no point
in it being static, we could #define it but it's only used in one
place.

By reworking the logic we can drop count and just decrement the
max value as a loop counter. Also switch to a while loop so we
actually print no more than 64 frames as you'd expect based on the
variable name.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack()
Michael Ellerman [Tue, 9 Oct 2012 04:20:35 +0000 (04:20 +0000)]
powerpc/xmon: Use STACK_FRAME_OVERHEAD in xmon_show_stack()

We use STACK_FRAME_OVERHEAD in the exception vectors to establish
the exception frame, so it should be good enough to use here.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Remove unused #defines
Michael Ellerman [Tue, 9 Oct 2012 04:20:34 +0000 (04:20 +0000)]
powerpc/xmon: Remove unused #defines

Neither REGS_PER_LINE or LAST_VOLATILE are used, nor have they ever
been as far back as I can see.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Remove renaming #defines of scanhex() and skipbl()
Michael Ellerman [Tue, 9 Oct 2012 04:20:33 +0000 (04:20 +0000)]
powerpc/xmon: Remove renaming #defines of scanhex() and skipbl()

We have two #defines that rename scanhex() and skipbl() to
xmon_scanhex() and xmon_skipbl() - but no one ever uses those
names.

So the only effect is to rename the actual symbols in the generated
code, and AFACIS there is no reason to do that, so drop them.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Merge start.c into nonstdio.c
Michael Ellerman [Tue, 9 Oct 2012 04:20:32 +0000 (04:20 +0000)]
powerpc/xmon: Merge start.c into nonstdio.c

The routines in start.c are only ever called from nonstdio.c, so if we
move them in there they can become static which is nice.

I suspect the idea behind the separation was that start.c could be
replaced in order to build xmon in userland. If anyone still cares about
doing that we could handle that with an ifdef or two.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Make xmon_getchar() static
Michael Ellerman [Tue, 9 Oct 2012 04:20:31 +0000 (04:20 +0000)]
powerpc/xmon: Make xmon_getchar() static

xmon_getchar() is only called from within nonstdio.c, so make it static.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Remove empty xmon_map_scc()
Michael Ellerman [Tue, 9 Oct 2012 04:20:30 +0000 (04:20 +0000)]
powerpc/xmon: Remove empty xmon_map_scc()

This has been empty since 2005, commit 51d3082 "Unify udbg (#2)".

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/xmon: Remove unused xmon_expect() & xmon_read_poll()
Michael Ellerman [Tue, 9 Oct 2012 04:20:29 +0000 (04:20 +0000)]
powerpc/xmon: Remove unused xmon_expect() & xmon_read_poll()

It looks like xmon_expect() was used for doing xmon over a modem (!?),
that code was dropped in 2005 in commit 51d3082 "Unify udbg (#2)".

Once xmon_expect() is gone xmon_read_poll() is unused, drop it too.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/udbg: Remove unused udbg_read()
Michael Ellerman [Tue, 9 Oct 2012 04:20:28 +0000 (04:20 +0000)]
powerpc/udbg: Remove unused udbg_read()

The last user of udbg_read() was removed in 2005, in commit fca5dcd
"Simplify and clean up the xmon terminal I/O".

Given we haven't needed it for 7 years we can probably drop it.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/windfarm: Use module_i2c_driver to simplify the code
Wei Yongjun [Mon, 8 Oct 2012 03:00:04 +0000 (03:00 +0000)]
powerpc/windfarm: Use module_i2c_driver to simplify the code

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: Add asm/debug.h to get powerpc_debugfs_root
Tony Breeds [Tue, 2 Oct 2012 15:52:41 +0000 (15:52 +0000)]
powerpc: Add asm/debug.h to get powerpc_debugfs_root

Since the "Disintegrate asm/system.h for PowerPC"
(ae3a197e3d0bfe3f4bf1693723e82dc018c096f3) This has been failing when
DEBUG is #defined.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/47x: Use the new ppc-opcode infrastructure
Tony Breeds [Tue, 2 Oct 2012 15:52:19 +0000 (15:52 +0000)]
powerpc/47x: Use the new ppc-opcode infrastructure

Don't use 47x only #defines for TLBIVAX or ICBT, supply and use helpers
in ppc-opcode.h

This fixes a compile breakage.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc: dtc is required to build dtb files
Matthew McClintock [Tue, 18 Sep 2012 09:50:55 +0000 (09:50 +0000)]
powerpc: dtc is required to build dtb files

Fixes this following:

$ make distclean; make corenet32_smp_defconfig; make p4080ds.dtb
  CLEAN   arch/powerpc/boot
  CLEAN   scripts/basic
  CLEAN   scripts/dtc
  CLEAN   scripts/genksyms
  CLEAN   scripts/kconfig
  CLEAN   scripts/mod
  CLEAN   scripts
  CLEAN   include/config include/generated
  CLEAN   .config
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
  DTC     arch/powerpc/boot/p4080ds.dtb
/bin/sh: /local/home/mattsm/git/linux/scripts/dtc/dtc: No such file or directory
make[1]: *** [arch/powerpc/boot/p4080ds.dtb] Error 1
make: *** [p4080ds.dtb] Error 2

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc/pseries: Double NR_CPUS in defconfig
Nishanth Aravamudan [Wed, 12 Sep 2012 07:47:07 +0000 (07:47 +0000)]
powerpc/pseries: Double NR_CPUS in defconfig

Anticipating growth in coming years, we should ensure we are getting a
good lead on testing.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agofbdev: Add GXT4000P and GXT6500P support to the gxt4500 driver
Dan Horák [Wed, 12 Sep 2012 06:06:44 +0000 (06:06 +0000)]
fbdev: Add GXT4000P and GXT6500P support to the gxt4500 driver

I'm reviving an old patch from 2009 that adds support for GXT4000P and GXT6500P
adapter to the gxt4500 driver.

See threads at http://marc.info/?l=linux-fbdev-devel&m=124345080216952&w=2
and https://lists.ozlabs.org/pipermail/linuxppc-dev/2009-June/072672.html
for more details.

This patch adds support for GXT4000P and GXT6500P cards found on some
IBM pSeries machines.
GXT4000P/6000P and GXT4500P/6500P  couples are  identical from
software's point of view and are based on the same  Raster Engine
(RC1000), except for a different reference clock for the PLL.
GXT6x00P models are equipped with an additional Geometry Engine
(GT1000) but this driver doesn't use it.

Signed-off-by: Nico Macrionitis <acrux@cruxppc.org>
Signed-off-by: Giuseppe Coviello <cjg@cruxppc.org>
Tested-by: Dan Horák <dan@danny.cz>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc+of: Remove the pSeries_reconfig.h file
Nathan Fontenot [Tue, 2 Oct 2012 16:59:39 +0000 (16:59 +0000)]
powerpc+of: Remove the pSeries_reconfig.h file

Remove the pSeries_reconfig.h header file. At this point there is only one
definition in the file, pSeries_coalesce_init(), which can be
moved to rtas.h.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc+of: Rename the drivers/of prom_* functions to of_*
Nathan Fontenot [Tue, 2 Oct 2012 16:58:46 +0000 (16:58 +0000)]
powerpc+of: Rename the drivers/of prom_* functions to of_*

Rename the prom_*_property routines of the generic OF code to of_*_property.
This brings them in line with the naming used by the rest of the OF code.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Geoff Levand <geoff@infradead.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc+of: Add of node/property notification chain for adds and removes
Nathan Fontenot [Tue, 2 Oct 2012 16:57:57 +0000 (16:57 +0000)]
powerpc+of: Add of node/property notification chain for adds and removes

This patch moves the notification chain for updates to the device tree
from the powerpc/pseries code to the base OF code. This makes this
functionality available to all architectures.

Additionally the notification chain is updated to allow notifications
for property add/remove/update. To make this work a pointer to a new
struct (of_prop_reconfig) is passed to the routines in the notification chain.
The of_prop_reconfig property contains a pointer to the node containing the
property and a pointer to the property itself. In the case of property
updates, the property pointer refers to the new property.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc+of: Move of_drconf_cell struct definition to asm/prom.h
Nathan Fontenot [Tue, 2 Oct 2012 16:56:11 +0000 (16:56 +0000)]
powerpc+of: Move of_drconf_cell struct definition to asm/prom.h

This patch moves the definition of the of_drconf_cell struct to asm/prom.h
to make it available for all powerpc/pseries code.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agopowerpc+of: Add /proc device tree updating to of node add/remove
Nathan Fontenot [Tue, 2 Oct 2012 16:55:01 +0000 (16:55 +0000)]
powerpc+of: Add /proc device tree updating to of node add/remove

When adding or removing a device tree node we should also update
the device tree in /proc/device-tree. This action is already done in the
generic OF code for adding/removing properties of a node. This patch adds
this functionality for nodes.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
11 years agoMerge git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Thu, 1 Nov 2012 15:27:02 +0000 (08:27 -0700)]
Merge git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM fix from Marcelo Tosatti.

* git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: x86: fix vcpu->mmio_fragments overflow

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Linus Torvalds [Wed, 31 Oct 2012 22:42:08 +0000 (15:42 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull scsi target fixes from Nicholas Bellinger:
 "These are the current target pending fixes headed for v3.7-rc4 code.
  This includes the following highlights:

   - Fix long-standing qla2xxx target bug where certain fc_port_t state
     transitions could cause the internal session b-tree list to become
     out-of-sync.  (Roland)
   - Fix task management double free of se_cmd descriptor in exception
     path for users of target_submit_tmr().  (nab)
   - Re-introduce simple NOP emulation of REZERO_UNIT, SEEK_6, and
     SEEK_10 SCSI-2 commands in order to support legacy initiators that
     still require them.  (Bernhard)

  Note these three patches are also CC'ed to stable.

  Also, there a couple of outstanding (external) regressions that are
  still being tracked down for tcm_fc(FCoE) and tcm_vhost fabrics for
  v3.7.0 code, so please expect another PULL as these issues identified
  -> resolved."

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target: reintroduce some obsolete SCSI-2 commands
  target: Fix double-free of se_cmd in target_complete_tmr_failure
  qla2xxx: Update target lookup session tables when a target session changes
  tcm_qla2xxx: Format VPD page 83h SCSI name string according to SPC
  qla2xxx: Add missing ->vport_slock while calling qlt_update_vp_map

11 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Wed, 31 Oct 2012 22:40:21 +0000 (15:40 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull nouveau fixes from Dave Airlie:
 "Just a nouveau set, since we have a couple of reports on lkml and
  dri-devel of regressions that this should fix I sent it along on its
  own."

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau: headless mode by default if pci class != vga display
  drm/nouveau: resurrect headless mode since rework
  drm/nv50/fb: prevent oops on chipsets without compression tags
  drm/nouveau: allow creation of zero-sized mm
  drm/nouveau/i2c: fix typo when checking nvio i2c port validity
  drm/nouveau: silence modesetting spam on pre-gf8 chipsets

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Wed, 31 Oct 2012 22:39:28 +0000 (15:39 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID updates from Jiri Kosina:
 "This contains fixes for two devices by Jiri Slaby and Xianhan Yu, new
  device IDs for MacBook Pro 10,2 from Dirk Hohndel and generic
  multitouch code fix from Alan Cox."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: Add support for the MacBook Pro 10,2 keyboard / touchpad
  HID: multitouch: fix maxcontacts problem on GeneralTouch
  HID: multitouch: put the case in the right switch statement
  HID: microsoft: fix invalid rdesc for 3k kbd

11 years agoMerge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Wed, 31 Oct 2012 22:38:32 +0000 (15:38 -0700)]
Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This contains unexpectedly many changes in a wide range due to the
  fixes for races at disconnection of USB audio devices.  In the end, we
  end up covering fairly core parts of sound subsystem.

  Other than that, just a few usual small fixes."

* tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: ice1724: Fix rate setup after resume
  ALSA: Avoid endless sleep after disconnect
  ALSA: Add a reference counter to card instance
  ALSA: usb-audio: Fix races at disconnection in mixer_quirks.c
  ALSA: usb-audio: Use rwsem for disconnect protection
  ALSA: usb-audio: Fix races at disconnection
  ALSA: PCM: Fix some races at disconnection
  ASoC: omap-dmic: Correct functional clock name
  ASoC: zoom2: Fix compile error by including correct header files
  ALSA: hda - Fix mute-LED setup for HP dv5 laptop

11 years agoKVM: x86: fix vcpu->mmio_fragments overflow
Xiao Guangrong [Wed, 24 Oct 2012 06:07:59 +0000 (14:07 +0800)]
KVM: x86: fix vcpu->mmio_fragments overflow

After commit b3356bf0dbb349 (KVM: emulator: optimize "rep ins" handling),
the pieces of io data can be collected and write them to the guest memory
or MMIO together

Unfortunately, kvm splits the mmio access into 8 bytes and store them to
vcpu->mmio_fragments. If the guest uses "rep ins" to move large data, it
will cause vcpu->mmio_fragments overflow

The bug can be exposed by isapc (-M isapc):

[23154.818733] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
[ ......]
[23154.858083] Call Trace:
[23154.859874]  [<ffffffffa04f0e17>] kvm_get_cr8+0x1d/0x28 [kvm]
[23154.861677]  [<ffffffffa04fa6d4>] kvm_arch_vcpu_ioctl_run+0xcda/0xe45 [kvm]
[23154.863604]  [<ffffffffa04f5a1a>] ? kvm_arch_vcpu_load+0x17b/0x180 [kvm]

Actually, we can use one mmio_fragment to store a large mmio access then
split it when we pass the mmio-exit-info to userspace. After that, we only
need two entries to store mmio info for the cross-mmio pages access

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
11 years agoHID: Add support for the MacBook Pro 10,2 keyboard / touchpad
Dirk Hohndel [Tue, 30 Oct 2012 18:11:48 +0000 (11:11 -0700)]
HID: Add support for the MacBook Pro 10,2 keyboard / touchpad

This enables the existing drivers for keyboard and touchpad with the new
USB IDs found on the MBP 13" Reasonable Resolution (also known as the
Retina Display).

Added entries to both keyboard and mouse ignore lists.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
11 years agoHID: multitouch: fix maxcontacts problem on GeneralTouch
Xianhan Yu [Mon, 29 Oct 2012 15:04:37 +0000 (23:04 +0800)]
HID: multitouch: fix maxcontacts problem on GeneralTouch

Fix maxcontacts problem for PWT GeneralTouch multi-touchscreen.

Our device didn't contain HID_DG_CONTACTMAX usage. This usage use to describe
touchscreen's maxcontacts for hid-multitouch.c to get maxcontacts automatic. We
fix the device that driver can get maxcontact from our device, hence it doesn't
need .maxcontact=10. Now there is just one device class can fix all our PWT
touchscreen.

Signed-off-by: Xianhan Yu <aroundight77@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
11 years agoHID: multitouch: put the case in the right switch statement
Alan Cox [Thu, 25 Oct 2012 14:35:25 +0000 (15:35 +0100)]
HID: multitouch: put the case in the right switch statement

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
11 years agoHID: microsoft: fix invalid rdesc for 3k kbd
Jiri Slaby [Fri, 19 Oct 2012 11:28:46 +0000 (13:28 +0200)]
HID: microsoft: fix invalid rdesc for 3k kbd

Microsoft Digital Media Keyboard 3000 has two interfaces, and the
second one has a report descriptor with a bug. The second collection
says:
05 01 -- global; usage page -- 01 -- Generic Desktop Controls
09 80 -- local; usage -- 80 -- System Control
a1 01 -- main; collection -- 01 -- application

85 03 -- global; report ID -- 03
19 00 -- local; Usage Minimum -- 00
29 ff -- local; Usage Maximum -- ff
15 00 -- global; Logical Minimum -- 0
26 ff 00 -- global; Logical Maximum -- ff
81 00 -- main; input

c0 -- main; End Collection

I.e. it makes us think that there are all kinds of usages of system
control. That the keyboard is a not only a keyboard, but also a
joystick, mouse, gamepad, keypad, etc. The same as for the Wireless
Desktop Receiver, this should be Physical Min/Max. So fix that
appropriately.

References: https://bugzilla.novell.com/show_bug.cgi?id=776834
Cc: <stable@vger.kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
11 years agoALSA: ice1724: Fix rate setup after resume
Takashi Iwai [Wed, 31 Oct 2012 06:41:42 +0000 (07:41 +0100)]
ALSA: ice1724: Fix rate setup after resume

The rate isn't restored properly after resume since it's only set up
in hw_params, and not in prepare callback.  For fixing it, put the
corresponding call to resume callback as well.

Reported-and-tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoReturn the right error value when dup[23]() newfd argument is too large
Al Viro [Wed, 31 Oct 2012 03:37:48 +0000 (03:37 +0000)]
Return the right error value when dup[23]() newfd argument is too large

Jack Lin reports that the error return from dup3() for the RLIMIT_NOFILE
case changed incorrectly after 3.6.

The culprit is commit f33ff9927f42 ("take rlimit check to callers of
expand_files()") which when it moved the "return -EMFILE" out to the
caller, didn't notice that the dup3() had special code to turn the
EMFILE return into EBADF.

The replace_fd() helper that got added later then inherited the bug too.

Reported-by: Jack Lin <linliangjie@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[ Noted more bugs, wrote proper changelog, fixed up typos - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'drm-nouveau-fixes' of git://people.freedesktop.org/git/nouveau/linux...
Dave Airlie [Wed, 31 Oct 2012 03:46:04 +0000 (13:46 +1000)]
Merge branch 'drm-nouveau-fixes' of git://people.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes

This covers all known nouveau regressions at the moment, along with a fix
to not steal the console on headless GPUs.

* 'drm-nouveau-fixes' of git://people.freedesktop.org/git/nouveau/linux-2.6:
  drm/nouveau: headless mode by default if pci class != vga display
  drm/nouveau: resurrect headless mode since rework
  drm/nv50/fb: prevent oops on chipsets without compression tags
  drm/nouveau: allow creation of zero-sized mm
  drm/nouveau/i2c: fix typo when checking nvio i2c port validity
  drm/nouveau: silence modesetting spam on pre-gf8 chipsets

11 years agodrm/nouveau: headless mode by default if pci class != vga display
Ben Skeggs [Wed, 31 Oct 2012 02:16:06 +0000 (12:16 +1000)]
drm/nouveau: headless mode by default if pci class != vga display

This is to prevent nouveau from taking over the console on headless boards
such as Tesla.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agoMerge tag 'md-3.7-fixes' of git://neil.brown.name/md
Linus Torvalds [Wed, 31 Oct 2012 02:48:48 +0000 (19:48 -0700)]
Merge tag 'md-3.7-fixes' of git://neil.brown.name/md

Pull md fixes from NeilBrown:
 "Some fixes for md in 3.7
   - one recently introduced crash for dm-raid10 with discard
   - one bug in new functionality that has been around for a few
     releases.
   - minor bug in md's 'faulty' personality

  and UAPI disintegration for md."

* tag 'md-3.7-fixes' of git://neil.brown.name/md:
  MD RAID10: Fix oops when creating RAID10 arrays via dm-raid.c
  md/raid1: Fix assembling of arrays containing Replacements.
  md faulty: use disk_stack_limits()
  UAPI: (Scripted) Disintegrate include/linux/raid

11 years agodrm/nouveau: resurrect headless mode since rework
Ben Skeggs [Wed, 31 Oct 2012 02:11:15 +0000 (12:11 +1000)]
drm/nouveau: resurrect headless mode since rework

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nv50/fb: prevent oops on chipsets without compression tags
Ben Skeggs [Wed, 31 Oct 2012 00:51:00 +0000 (10:51 +1000)]
drm/nv50/fb: prevent oops on chipsets without compression tags

Unconditionally create the tagram mm, even if there's zero tags.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: allow creation of zero-sized mm
Ben Skeggs [Wed, 31 Oct 2012 01:19:40 +0000 (11:19 +1000)]
drm/nouveau: allow creation of zero-sized mm

Useful for places where a given chipset may or may not have a given
resource, and we want to avoid having to spray checks for the mm's
existance around everywhere.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau/i2c: fix typo when checking nvio i2c port validity
Ben Skeggs [Tue, 30 Oct 2012 05:07:58 +0000 (15:07 +1000)]
drm/nouveau/i2c: fix typo when checking nvio i2c port validity

Reported-by: Mathieu Chouquet-Stringer <mathieu@csetco.com>
Tested-by: Mathieu Chouquet-Stringer <mathieu@csetco.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agodrm/nouveau: silence modesetting spam on pre-gf8 chipsets
Ben Skeggs [Sun, 28 Oct 2012 23:03:07 +0000 (09:03 +1000)]
drm/nouveau: silence modesetting spam on pre-gf8 chipsets

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
11 years agoMD RAID10: Fix oops when creating RAID10 arrays via dm-raid.c
Jonathan Brassow [Wed, 31 Oct 2012 00:42:30 +0000 (11:42 +1100)]
MD RAID10: Fix oops when creating RAID10 arrays via dm-raid.c

Commit 2863b9eb didn't take into account the changes to add TRIM support to
RAID10 (commit 532a2a3fb).  That is, when using dm-raid.c to create the
RAID10 arrays, there is no mddev->gendisk or mddev->queue.  The code added
to support TRIM simply assumes that mddev->queue is available without
checking.  The result is an oops any time dm-raid.c attempts to create a
RAID10 device.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agomd/raid1: Fix assembling of arrays containing Replacements.
NeilBrown [Wed, 31 Oct 2012 00:42:03 +0000 (11:42 +1100)]
md/raid1: Fix assembling of arrays containing Replacements.

setup_conf in raid1.c uses conf->raid_disks before assigning
a value.  It is used when including 'Replacement' devices.

The consequence is that assembling an array which contains a
replacement will misbehave and either not include the replacement, or
not include the device being replaced.

Though this doesn't lead directly to data corruption, it could lead to
reduced data safety.

So use mddev->raid_disks, which is initialised, instead.

Bug was introduced by commit c19d57980b38a5bb613a898937a1cf85f422fb9b
      md/raid1: recognise replacements when assembling arrays.

in 3.3, so fix is suitable for 3.3.y thru 3.6.y.

Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
11 years agoMerge tag 'gpio-fixes-v3.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 30 Oct 2012 22:56:22 +0000 (15:56 -0700)]
Merge tag 'gpio-fixes-v3.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 - Fix a potential bit wrap issue in the Timberdale driver
 - Fix up the buffer allocation size in the 74x164 driver
 - Set the value in direction_output() right in the mvebu driver
 - Return proper error codes for invalid GPIOs
 - Fix an off-mode bug for the OMAP
 - Don't initialize the mask_cach on the mvebu driver

* tag 'gpio-fixes-v3.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  GPIO: mvebu-gpio: Don't initialize the mask_cache
  gpio/omap: fix off-mode bug: clear debounce settings on free/reset
  gpiolib: Don't return -EPROBE_DEFER to sysfs, or for invalid gpios
  gpio: mvebu: correctly set the value in direction_output()
  gpio-74x164: Fix buffer allocation size
  gpio-timberdale: fix a potential wrapping issue

11 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 30 Oct 2012 22:35:16 +0000 (15:35 -0700)]
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 bugfix from Ted Ts'o:
 "This fixes the root cause of the ext4 data corruption bug which raised
  a ruckus on LWN, Phoronix, and Slashdot.

  This bug only showed up when non-standard mount options
  (journal_async_commit and/or journal_checksum) were enabled, and when
  the file system was not cleanly unmounted, but the root cause was the
  inode bitmap modifications was not being properly journaled.

  This could potentially lead to minor file system corruptions (pass 5
  complaints with the inode allocation bitmap) after an unclean shutdown
  under the wrong/unlucky workloads, but it turned into major failure if
  the journal_checksum and/or jouaral_async_commit was enabled."

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix unjournaled inode bitmap modification