[RFC v2 01/24] macintosh/nvram: Remove as unused

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain fth...@telegraphics.com.au Acked-by: Geert Uytterhoeven ge...@linux-m68k.org --- drivers/macintosh/nvram.c | 130 -- 1 file changed, 130 deletions(-) Index: linux/drivers/macintosh/nvram.c

[RFC v2 02/24] scsi/atari_scsi: Dont select CONFIG_NVRAM

2015-06-14 Thread Finn Thain
On powerpc, setting CONFIG_NVRAM=n builds a kernel with no NVRAM support. Setting CONFIG_NVRAM=m enables the /dev/nvram misc device module without enabling NVRAM support in drivers. Setting CONFIG_NVRAM=y enables the misc device (built-in) and also enables NVRAM support in drivers. m68k shares

[RFC v2 09/24] char/nvram: Implement NVRAM read/write methods

2015-06-14 Thread Finn Thain
Refactor the RTC CMOS NVRAM functions so that they can be used as arch_nvram_ops methods. Checksumming logic is moved from the misc device operations to the nvram read/write operations. This makes the misc device implementation more generic. This also preserves the locking semantics such that

[RFC v2 23/24] m68k/mac: Fix PRAM accessors

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain fth...@telegraphics.com.au --- Tested on a PowerBook 520 and Quadra 650. --- arch/m68k/mac/misc.c | 35 +-- include/uapi/linux/pmu.h |2 ++ 2 files changed, 31 insertions(+), 6 deletions(-) Index: linux/arch/m68k/mac/misc.c

[RFC v2 24/24] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2015-06-14 Thread Finn Thain
A multi-platform kernel binary needs to decide at run-time how to dispatch the arch_nvram_ops calls. Add platform-independent arch_nvram_ops, for use when multiple platform-specific NVRAM ops implementations are needed. Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs. Signed-off-by: Finn Thain

[RFC v2 06/24] char/nvram: Adopt arch_nvram_ops

2015-06-14 Thread Finn Thain
Different platforms and architectures offer different NVRAM sizes and access methods. E.g. PPC32 has byte-at-a-time read/write functions whereas PPC64 has byte-range read/write functions. Adopt the nvram_ops struct so the nvram module can call such functions as are defined by the various

[RFC v2 04/24] m68k/atari: Replace nvram_{read, write}_byte with arch_nvram_ops

2015-06-14 Thread Finn Thain
By implementing an arch_nvram_ops struct, any platform can re-use the drivers/char/nvram module without needing any arch-specific code in that module. Atari does so here. Atari has one user of nvram_check_checksum() whereas the other platforms (i.e. x86 and ARM platforms) have none at all.

[RFC v2 00/24] Re-use nvram module

2015-06-14 Thread Finn Thain
The generic NVRAM module, drivers/char/generic_nvram, implements a /dev/nvram misc device. It is used only by 32-bit PowerPC platforms and isn't generic enough to be more widely used. The RTC NVRAM module, drivers/char/nvram, also implements a /dev/nvram misc device. It is used by x86, ARM and

[RFC v2 20/24] char/generic_nvram: Remove as unused

2015-06-14 Thread Finn Thain
And thus eliminate some twisted CONFIG_GENERIC_NVRAM logic. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- drivers/char/Makefile|6 - drivers/char/generic_nvram.c | 176 --- 2 files changed, 1 insertion(+), 181 deletions(-) Index:

[RFC v2 18/24] nvram: Drop nvram_* symbol exports and prototypes

2015-06-14 Thread Finn Thain
Drivers now use the arch_nvram_ops calls so remove the function exports and prototypes. nvram_check_checksum() is unused so remove it. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- arch/m68k/atari/nvram.c |6 +++--- drivers/char/nvram.c| 27 +--

[RFC v2 08/24] char/nvram: Allow the set_checksum and initialize ioctls to be omitted

2015-06-14 Thread Finn Thain
The drivers/char/nvram module has previously only supported RTC CMOS NVRAM, for which it provides appropriate checksum ioctls. Make these ioctls optional so the module can be re-used with other kinds of NVRAM. The ops struct methods that implement the ioctls now return error codes so that a

[RFC v2 13/24] powerpc: Cleanup nvram includes

2015-06-14 Thread Finn Thain
The nvram_read_byte() and nvram_write_byte() definitions in asm/nvram.h duplicate those in linux/nvram.h. Get rid of the former to prepare for adoption of struct arch_nvram_ops (which is defined in linux/nvram.h for general use). Signed-off-by: Finn Thain fth...@telegraphics.com.au ---

[RFC v2 22/24] m68k/mac: Adopt naming and calling conventions for PRAM routines

2015-06-14 Thread Finn Thain
Adopt the existing *_read_byte and *_write_byte naming convention. Rename via_pram_readbyte and via_pram_writebyte to avoid confusion. Adjust calling conventions of mac_pram_* functions to match the arch_nvram_ops struct methods. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- Changes

[RFC v2 21/24] powerpc: Adopt nvram module for PPC64

2015-06-14 Thread Finn Thain
Adopt nvram module to reduce code duplication. The IOC_NVRAM_GET_OFFSET ioctl as implemented on PPC64 validates the offset returned by pmac_get_partition(). Add this test to the nvram module. Note that the old PPC32 generic_nvram module lacked this test. So when CONFIG_PPC32 CONFIG_PPC_PMAC,

[RFC v2 12/24] char/nvram: Add devname:nvram module alias

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain fth...@telegraphics.com.au --- drivers/char/nvram.c |1 + 1 file changed, 1 insertion(+) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-06-14 17:45:46.0

[RFC v2 19/24] powerpc: Remove CONFIG_GENERIC_NVRAM and adopt CONFIG_HAVE_ARCH_NVRAM_OPS

2015-06-14 Thread Finn Thain
Switch PPC32 kernels from the generic_nvram module to the nvram module. Also fix a theoretical bug where CHRP omits the chrp_nvram_init() call when CONFIG_NVRAM_MODULE=m. As before, when CONFIG_PPC !CONFIG_PPC_PMAC, the IOC_NVRAM_GET_OFFSET ioctl is unimplemented. For the nvram module,

[RFC v2 15/24] powerpc: Implement arch_nvram_ops.get_size() and remove old nvram_* exports

2015-06-14 Thread Finn Thain
Implement arch_nvram_ops for PPC32 and make use of it in the generic_nvram misc device module so that the nvram_* function exports can be removed. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- arch/powerpc/include/asm/nvram.h |3 --- arch/powerpc/kernel/setup_32.c | 10

[RFC v2 14/24] powerpc: Add missing ppc_md.nvram_size for CHRP and PowerMac

2015-06-14 Thread Finn Thain
Add the nvram_size() function to those PowerPC platforms that don't already have one: CHRP and PowerMac. This means that the ppc_md.nvram_size() function can be used to implement arch_nvram_ops.get_size() Since we are addressing inconsistencies here, also rename chrp_nvram_read and

[RFC v2 17/24] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-06-14 Thread Finn Thain
Make use of arch_nvram_ops in device drivers so that the nvram_* function exports can be removed. Since they are no longer global symbols, rename the PPC32 nvram_* functions appropriately. Add the missing CONFIG_NVRAM test to imsttfb to avoid a build failure. Signed-off-by: Finn Thain

[RFC v2 10/24] char/nvram: Use generic fixed_size_llseek()

2015-06-14 Thread Finn Thain
Signed-off-by: Finn Thain fth...@telegraphics.com.au --- drivers/char/nvram.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c

[RFC v2 05/24] char/nvram: Re-order functions to remove forward declarations and #ifdefs

2015-06-14 Thread Finn Thain
Also give functions more sensible names: nvram_misc_* for misc device ops, nvram_proc_* for proc file ops and nvram_module_* for init and exit functions. This makes them distict from nvram_ops members. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- drivers/char/nvram.c | 194

[RFC v2 16/24] powerpc: Implement nvram sync ioctl

2015-06-14 Thread Finn Thain
Add the powerpc-specific sync() method to struct nvram_ops and implement the corresponding ioctl in the nvram module. This allows the nvram module to replace the generic_nvram module. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- On PPC32, the IOC_NVRAM_SYNC ioctl call always returns

[RFC v2 03/24] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2015-06-14 Thread Finn Thain
Move the m68k-specific code elsewhere to make the driver generic. Change the vmode calculation from logical OR to bitwise OR, since it is obviously wrong. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- BTW, I didn't change the SCSI ID location in NVRAM. This code says 16 whereas

[RFC v2 07/24] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-06-14 Thread Finn Thain
Make use of arch_nvram_ops in the thinkpad_acpi driver so that the nvram_* function exports can be removed. This patch series was tested on a ThinkPad T43. Signed-off-by: Finn Thain fth...@telegraphics.com.au Acked-by: Henrique de Moraes Holschuh h...@hmh.eng.br Reviewed-by: Darren Hart

[RFC v2 11/24] m68k/atari: Implement arch_nvram_ops methods and enable CONFIG_HAVE_ARCH_NVRAM_OPS

2015-06-14 Thread Finn Thain
Atari RTC NVRAM has a checksum so implement the remaining arch_nvram_ops methods for the set_checksum and initialize ioctls. Enable CONFIG_HAVE_ARCH_NVRAM_OPS. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- This re-enables the nvram module for Atari. --- arch/m68k/Kconfig |

Re: [PATCH] powerpc/powernv: pnv_init_idle_states() should only run on powernv

2015-06-14 Thread Shreyas B Prabhu
On 06/12/2015 03:30 PM, Michael Ellerman wrote: Although this init call checks for device tree properties before doing anything, it should still only run on powernv machines. Signed-off-by: Michael Ellerman m...@ellerman.id.au --- arch/powerpc/platforms/powernv/idle.c | 3 +-- 1 file

Re: [PATCH] powerpc/powernv: pnv_init_idle_states() should only run on powernv

2015-06-14 Thread Michael Ellerman
On Sun, 2015-06-14 at 21:58 +0530, Shreyas B Prabhu wrote: On 06/12/2015 03:30 PM, Michael Ellerman wrote: Although this init call checks for device tree properties before doing anything, it should still only run on powernv machines. Signed-off-by: Michael Ellerman m...@ellerman.id.au

Re: [PATCH kernel] powerpc/powernv/ioda2: Add devices only from buses which belong to PE

2015-06-14 Thread Gavin Shan
On Fri, Jun 12, 2015 at 08:06:43AM -0700, Nishanth Aravamudan wrote: On 12.06.2015 [16:47:03 +1000], Gavin Shan wrote: On Fri, Jun 12, 2015 at 04:19:17PM +1000, Alexey Kardashevskiy wrote: The existing code puts all devices from a root PE to the same IOMMU group. However it is a possible

[PATCH v2] powerpc/powernv: pnv_init_idle_states() should only run on powernv

2015-06-14 Thread Michael Ellerman
Although this init call checks for device tree properties before doing anything, it should still only run on powernv machines. Reviewed-by: Shreyas B Prabhu shre...@linux.vnet.ibm.com Signed-off-by: Michael Ellerman m...@ellerman.id.au --- arch/powerpc/platforms/powernv/idle.c | 4 ++-- 1 file

[PATCH RESEND v4 1/2] perf/kvm: Port perf kvm to powerpc

2015-06-14 Thread Hemant Kumar
From: Srikar Dronamraju sri...@linux.vnet.ibm.com perf kvm can be used to analyze guest exit reasons. This support already exists in x86. Hence, porting it to powerpc. - To trace KVM events : perf kvm stat record If many guests are running, we can track for a specific guest by using --pid

[PATCH RESEND v4 2/2] perf/kvm: Support HCALL events

2015-06-14 Thread Hemant Kumar
powerpc provides hcall events that also provides insights into guest behaviour. Enhance perf kvm to record and analyze hcall events. - To trace hcall events : perf kvm stat record - To show the results : perf kvm stat report --event=hcall The result shows the number of hypervisor calls

Re: [PATCH RESEND v4 1/3] kvm/powerpc: Export kvm exit reasons

2015-06-14 Thread Paul Mackerras
On Mon, Jun 15, 2015 at 10:26:07AM +0530, Hemant Kumar wrote: To analyze the kvm exits with perf, we will need to map the exit codes with the exit reasons. Such a mapping exists today in trace_book3s.h. Currently its not exported to perf. This patch moves these kvm exit reasons and their

Re: [PATCH RESEND v4 3/3] kvm/powerpc: Export HCALL reason codes

2015-06-14 Thread Paul Mackerras
On Mon, Jun 15, 2015 at 10:26:09AM +0530, Hemant Kumar wrote: For perf to analyze the KVM events like hcalls, we need the hypervisor calls and their codes to be exported through uapi. Why? The hcall codes are defined externally to the kernel (in the PAPR document) and won't change. They're

[PATCH] powerpc: Set the correct kernel taint on machine check errors.

2015-06-14 Thread Daniel Axtens
This means the 'M' flag will work properly when the kernel prints a backtrace. Signed-off-by: Daniel Axtens d...@axtens.net --- arch/powerpc/kernel/traps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 6530f1b..37de90f

Re: powerpc/powernv: Bump opal_init initcall priority

2015-06-14 Thread Alistair Popple
On Fri, 12 Jun 2015 19:47:35 Michael Ellerman wrote: On Thu, 2015-11-06 at 09:25:29 UTC, Alistair Popple wrote: opal_init() is called via a machine_subsys_initcall(). Due to a hack in the eeh code the eeh driver is initialised with at the same initcall level. This means depending on link

[PATCH RESEND v4 1/3] kvm/powerpc: Export kvm exit reasons

2015-06-14 Thread Hemant Kumar
To analyze the kvm exits with perf, we will need to map the exit codes with the exit reasons. Such a mapping exists today in trace_book3s.h. Currently its not exported to perf. This patch moves these kvm exit reasons and their mapping from arch/powerpc/kvm/trace_book3s.h to

Re: [PATCH v5 00/24] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-06-14 Thread Baolin Wang
On 12 June 2015 at 21:16, Thomas Gleixner t...@linutronix.de wrote: On Fri, 12 Jun 2015, Baolin Wang wrote: Sigh. Again threading of the series failed. Some patches are, the whole series is not. Can you please get your tools straight? You neither managed to cc me on the security patch. -

Re: [PATCH 1/1] net: fs_enet: Disable NETIF_F_SG feature for Freescale MPC5121

2015-06-14 Thread Alexander Popov
10.06.2015 03:14, David Miller пишет: From: Alexander Popov alex.po...@linux.com Date: Wed, 10 Jun 2015 02:57:42 +0300 skb_copy_from_linear_data() which doesn't work well for non-linear sk_buff: The correct fix is to use an SKB copy routine which can handle non-linear data. Thanks, David.

[PATCH RESEND v4 3/3] kvm/powerpc: Export HCALL reason codes

2015-06-14 Thread Hemant Kumar
For perf to analyze the KVM events like hcalls, we need the hypervisor calls and their codes to be exported through uapi. This patch moves most of the pSeries hcall codes from arch/powerpc/include/asm/hvcall.h to arch/powerpc/include/uapi/asm/pseries_hcalls.h. It also moves the mapping

[PATCH RESEND v4 2/3] kvm/powerpc: Add exit reason for return code 0x0

2015-06-14 Thread Hemant Kumar
This patch adds an exit reason RETURN_TO_HOST for the return code 0x0. Note that this is not related to any interrupt vector address, but this is added just to make sure that perf doesn't complain if and when a kvm exit happens with a trap code as 0x0. Signed-off-by: Hemant Kumar