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

2015-07-25 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 v5 00/26] Re-use nvram module

2015-07-25 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 v5 05/26] char/nvram: Re-order functions to remove forward declarations and #ifdefs

2015-07-25 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 v5 10/26] char/nvram: Use generic fixed_size_llseek()

2015-07-25 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 v5 13/26] powerpc: Cleanup nvram includes

2015-07-25 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 --- Changes

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

2015-07-25 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 v5 07/26] x86/thinkpad_acpi: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-07-25 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 v5 14/26] powerpc: Add missing ppc_md.nvram_size for CHRP and PowerMac

2015-07-25 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 v5 08/26] char/nvram: Allow the set_checksum and initialize ioctls to be omitted

2015-07-25 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 v5 16/26] powerpc: Implement nvram sync ioctl

2015-07-25 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 v5 21/26] char/generic_nvram: Remove as unused

2015-07-25 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 | 175 --- 2 files changed, 1 insertion(+), 180 deletions(-) Index:

[RFC v5 20/26] powerpc: Remove CONFIG_GENERIC_NVRAM and adopt CONFIG_HAVE_ARCH_NVRAM_OPS

2015-07-25 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 v5 24/26] m68k/mac: Use macros for RTC accesses not magic numbers

2015-07-25 Thread Finn Thain
Signed-off-by: Finn Thain fth...@telegraphics.com.au --- This is intended to improve code style and not affect code behaviour. I've tested this on a Quadra 650. I don't know the meanings of the 4 undocumented write protect register bits 0x55, so I decided against defining 4 macros for those

[RFC v5 19/26] nvram: Drop nvram_* symbol exports and prototypes

2015-07-25 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 v5 22/26] powerpc: Adopt nvram module for PPC64

2015-07-25 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,

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

2015-07-25 Thread Finn Thain
On Sat, 25 Jul 2015, Michael Schmitz wrote: Hi Christian, good to know this worked - for the record (Finn), this is the kernel with Finn's patch applied. That was v5 of this patch series. I will send that out to the lists now. It has some minor changes that relate to powerpc. Thanks for

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

2015-07-25 Thread Finn Thain
On Sat, 25 Jul 2015, Michael Ellerman wrote: On Sat, 2015-07-25 at 10:35 +1000, Finn Thain wrote: Thanks for helping with this, Christian. I'll add your name in Tested-by tags on the relevant patches. These are rudimentary tests but combined with my own testing on m68k, ppc32 and

[RFC v5 02/26] char/nvram: Use bitwise OR to obtain Atari video mode data

2015-07-25 Thread Finn Thain
Signed-off-by: Finn Thain fth...@telegraphics.com.au Acked-by: Geert Uytterhoeven ge...@linux-m68k.org Tested-by: Christian T. Steigies c...@debian.org --- drivers/char/nvram.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux/drivers/char/nvram.c

[RFC v5 01/26] scsi/atari_scsi: Dont select CONFIG_NVRAM

2015-07-25 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 v5 03/26] m68k/atari: Move Atari-specific code out of drivers/char/nvram.c

2015-07-25 Thread Finn Thain
Move the m68k-specific code elsewhere to make the driver generic. Signed-off-by: Finn Thain fth...@telegraphics.com.au Tested-by: Christian T. Steigies c...@debian.org --- Changes since v3: - Move the vmode fix to a separate patch as requested by Geert. --- arch/m68k/atari/Makefile |2

[RFC v5 06/26] char/nvram: Adopt arch_nvram_ops

2015-07-25 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 v5 12/26] char/nvram: Add devname:nvram module alias

2015-07-25 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-07-25 17:45:35.0

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

2015-07-25 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 v5 11/26] m68k/atari: Implement arch_nvram_ops methods and enable CONFIG_HAVE_ARCH_NVRAM_OPS

2015-07-25 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. Changes since v3: - Use bool (and

[RFC v5 17/26] powerpc, fbdev: Use NV_CMODE and NV_VMODE only when CONFIG_PPC32 and CONFIG_PPC_PMAC and CONFIG_NVRAM

2015-07-25 Thread Finn Thain
This patch addresses inconsistencies in Mac framebuffer drivers and their use of Kconfig symbols relating to NVRAM, so PPC64 can use CONFIG_NVRAM. Macintosh framebuffer drivers use default settings for color mode and video mode that are found in NVRAM. On PCI Macs, MacOS stores display settings

[RFC v5 23/26] m68k/mac: Adopt naming and calling conventions for PRAM routines

2015-07-25 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 v5 25/26] m68k/mac: Fix PRAM accessors

2015-07-25 Thread Finn Thain
Signed-off-by: Finn Thain fth...@telegraphics.com.au --- Tested on a PowerBook 520 and Quadra 650. Changes since v2: - Make use of the RTC_* macros from the previous patch and add a few more besides. --- arch/m68k/mac/misc.c | 39 +--

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

2015-07-25 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 v5 18/26] powerpc, fbdev: Use arch_nvram_ops methods instead of nvram_read_byte() and nvram_write_byte()

2015-07-25 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. Signed-off-by: Finn Thain fth...@telegraphics.com.au --- Changed since v4: - Split off the CONFIG_PPC32,

Re: [PATCH] powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash

2015-07-25 Thread Michael Ellerman
On Fri, 2015-07-24 at 12:15 +0530, Aneesh Kumar K.V wrote: Michael Ellerman m...@ellerman.id.au writes: The powerpc kernel can be built to have either a 4K PAGE_SIZE or a 64K PAGE_SIZE. ... diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h

Re: [PATCH v3 26/46] usb: gadget: pch_ud: add ep capabilities support

2015-07-25 Thread Robert Baldyga
Hi, On 07/20/2015 05:08 PM, Krzysztof Opasiak wrote: On 07/15/2015 08:32 AM, Robert Baldyga wrote: Convert endpoint configuration to new capabilities model. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/udc/pch_udc.c | 14 -- 1 file changed, 12

[PATCH 2/3] powerpc: Create context switch helpers save_sprs() and restore_sprs()

2015-07-25 Thread Anton Blanchard
Move all our context switch SPR save and restore code into two helpers. We do a few optimisations: - Group all mfsprs and all mtsprs. In many cases an mtspr sets a scoreboarding bit that an mfspr waits on, so the current practise of mfspr A; mtspr A; mfpsr B; mtspr B is the worst scheduling we

[PATCH 3/3] powerpc: Remove redundant mflr in _switch

2015-07-25 Thread Anton Blanchard
No need to execute mflr twice. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/entry_64.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 8428280..f8779f2 100644 ---

[PATCH 1/3] powerpc: No need to disable kernel FP/VMX/VSX MSR bits on context switch

2015-07-25 Thread Anton Blanchard
There seems little point in disabling the FP/VMX/VSX MSR bits on context switch since we don't do it after calling enable_kernel_altivec() in other places. Writing the MSR is slow so lets not do it unnecessarily. A context switch microbenchmark using yield():

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

2015-07-25 Thread Michael Schmitz
Hi Finn, For the sake of completeness: further testing on ARAnyM shows no difference between original and patched kernel in the NVRAM proc and diff outputs: scsi host0: Atari native SCSI, io_port 0x0, n_io_port 0, base 0x0, irq 15, can_queue 8, cmd_per_lun 1, sg_tablesize 0, this_id 7,

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

2015-07-25 Thread Finn Thain
On Sat, 25 Jul 2015, Michael Ellerman wrote: On Sat, 2015-07-25 at 10:35 +1000, Finn Thain wrote: ... These are rudimentary tests but combined with my own testing on m68k, ppc32 and x86, coverage is quite good. Some testing on ppc64 is still lacking though. Here's some code I wrote

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

2015-07-25 Thread Finn Thain
On Sun, 26 Jul 2015, Michael Schmitz wrote: Hi Finn, For the sake of completeness: further testing on ARAnyM shows no difference between original and patched kernel in the NVRAM proc and diff outputs: scsi host0: Atari native SCSI, io_port 0x0, n_io_port 0, base 0x0, irq 15, can_queue

nouveau modeset no longer works with kernel 4.0 on Power Mac G4

2015-07-25 Thread Linux User #330250
Hello linuxppc-dev mailing list! I come right to the point. My computer is a Power Mac G4 Quicksilver (original, 2001) with the a flashed PC graphics card Nvidia 6200 AGP. It is correctly supported in Mac OS X 10.4/10.5 and it was working in Linux with the Debian kernels 3.16. I use Debian