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

2015-05-30 Thread Finn Thain
On Sun, 31 May 2015, Henrique de Moraes Holschuh wrote: > On Sun, 31 May 2015, Finn Thain wrote: > > 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. > > Can you describe how

Re: [PATCH] cpuidle: powernv/pseries: Decrease the snooze residency

2015-05-30 Thread Benjamin Herrenschmidt
On Sat, 2015-05-30 at 11:31 +0530, Vaidyanathan Srinivasan wrote: > In shared lpar case, spinning in guest context may potentially take > away cycles from other lpars waiting to run on the same physical cpu. > > So the policy in shared lpar case is to let PowerVM hypervisor know > immediately that

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

2015-05-30 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 --- BTW, I didn't change the SCSI ID location in NVRAM. This code says 16 whereas atari_scsi says 14. Which one i

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

2015-05-30 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 the

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

2015-05-30 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 "r

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

2015-05-30 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, unimple

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

2015-05-30 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, t

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

2015-05-30 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 --- On PPC32, the IOC_NVRAM_SYNC ioctl call always returns 0, even for those platform

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

2015-05-30 Thread Finn Thain
And thus eliminate some twisted CONFIG_GENERIC_NVRAM logic. Signed-off-by: Finn Thain --- drivers/char/Makefile|6 - drivers/char/generic_nvram.c | 176 --- 2 files changed, 1 insertion(+), 181 deletions(-) Index: linux/drivers/char/Makefile

[RFC 00/24] Re-use nvram module

2015-05-30 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 m6

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

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-05-31 11:01:09.0

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

2015-05-30 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 --- This re-enables the nvram module for Atari. --- arch/m68k/Kconfig |3 +++ arch/m68k/atari/nvr

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

2015-05-30 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 mult

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

2015-05-30 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 --- drivers/platform/x86/thinkpad_acpi.c | 20 ++-- 1 file changed, 10 insertions(+), 10 delet

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

2015-05-30 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 --- arc

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

2015-05-30 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 --- arch/m68k/atari/nvram.c |6 +++--- drivers/char/nvram.c| 27 +-- include/linux/nvram.h |8

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

2015-05-30 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. Signed-off-by: Finn Thain --- arch/m68k/Kconfig |2 ar

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

2015-05-30 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 platforms

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

2015-05-30 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 --- arch/powerpc/include/asm/nvram.h |3 --- arch/powerpc/kernel/setup_32.c | 10 +++--- drivers/char/generic_

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

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/macintosh/nvram.c | 130 -- 1 file changed, 130 deletions(-) Index: linux/drivers/macintosh/nvram.c === --- linux.orig/drivers/macintosh/nvram.c

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

2015-05-30 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 chrp_nvram_writ

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

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- 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 22/24] m68k/mac: Adopt nvram module

2015-05-30 Thread Finn Thain
Implement arch_nvram_ops and adjust calling conventions of mac_pram_* functions to match the ops struct methods. Rename via_pram_readbyte and via_pram_writebyte to avoid confusion and follow the existing nvram_*_read_byte and nvram_*_write_byte naming convention. Enable CONFIG_HAVE_ARCH_NVRAM_OPS

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

2015-05-30 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. Replace

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

2015-05-30 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 --- drivers/char/nvram.c | 194 ++-

[RFC 13/24] powerpc: Cleanup nvram includes

2015-05-30 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 --- arch/powerpc/include/asm/nvram.h

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

2015-05-30 Thread Finn Thain
Signed-off-by: Finn Thain --- drivers/char/nvram.c |1 + 1 file changed, 1 insertion(+) Index: linux/drivers/char/nvram.c === --- linux.orig/drivers/char/nvram.c 2015-05-31 11:01:11.0 +1000 +++ linux/drivers/char/nv

Re: [PATCH slof] Fix function keys sequence on USB

2015-05-30 Thread Dinar Valeev
On 05/30/2015 11:59 AM, Alexey Kardashevskiy wrote: > On 05/29/2015 11:30 PM, Dinar valeev wrote: >> From: Dinar Valeev >> >> Original issue is home and end keys are not functional in grub2. > > "home" works for in grub/ubuntu14 and grub2/fedora21. "end" does not but I am > not sure that your pa

Re: [PATCH slof] Fix function keys sequence on USB

2015-05-30 Thread Alexey Kardashevskiy
On 05/29/2015 11:30 PM, Dinar valeev wrote: From: Dinar Valeev Original issue is home and end keys are not functional in grub2. "home" works for in grub/ubuntu14 and grub2/fedora21. "end" does not but I am not sure that your patch will fix it, Later I've found other inconsistencies in f1-

Re: [PATCH] cpuidle: powernv/pseries: Decrease the snooze residency

2015-05-30 Thread Preeti U Murthy
On 05/30/2015 11:31 AM, Vaidyanathan Srinivasan wrote: > * Preeti U Murthy [2015-05-29 19:17:17]: > > [snip] > >>> + if (max_idle_state > 1) { >>> + snooze_timeout_en = true; >>> + snooze_timeout = cpuidle_state_table[1].target_residency * >>> +t