Re: next branch update

2009-06-10 Thread Timur Tabi
On Tue, Jun 9, 2009 at 10:14 PM, Benjamin
Herrenschmidtb...@kernel.crashing.org wrote:
 Hi !

 I've updated my next branch with the following patches. We're getting
 real close to the merge window now, so if something is missing, please
 holler ASAP.

[PATCH 1/2 v9] powerpc: introduce macro spin_event_timeout()

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [Patch 2/6] Introduce PPC64 specific Hardware Breakpoint interfaces

2009-06-10 Thread K.Prasad
On Fri, Jun 05, 2009 at 03:11:58PM +1000, David Gibson wrote:
 On Wed, Jun 03, 2009 at 10:05:11PM +0530, K.Prasad wrote:

Hi David,
Sorry for the delay in response below. In the meanwhile, I
discovered an issue in detecting stray exceptions that affected
user-space handling of breakpoints. I've made some changes to correct
that behaviour which will be included in version VI of the patchset.

  Introduce PPC64 implementation for the generic hardware breakpoint 
  interfaces
  defined in kernel/hw_breakpoint.c. Enable the HAVE_HW_BREAKPOINT flag and 
  the
  Makefile.
 
 
 [snip]
  +/*
  + * Install the debug register values for just the kernel, no thread.
 
 This comment does seem to quite match the function below.
 

Thanks for pointing out. Will change it to read thus:
/*
 * Clear the DABR which contains the thread-specific breakpoint address
 */

  + */
  +void arch_uninstall_thread_hw_breakpoint()
  +{
  +   set_dabr(0);
  +}
  +
  +/*
  + * Store a breakpoint's encoded address, length, and type.
  + */
  +int arch_store_info(struct hw_breakpoint *bp, struct task_struct *tsk)
  +{
  +   /*
  +* User-space requests will always have the address field populated
  +   * Symbol names from user-space are rejected
  +   */
  +   if (tsk  bp-info.name)
  +   return -EINVAL;
  +   /*
  +* User-space requests will always have the address field populated
  +* For kernel-addresses, either the address or symbol name can be
  +* specified.
  +*/
  +   if (bp-info.name)
  +   bp-info.address = (unsigned long)
  +   kallsyms_lookup_name(bp-info.name);
 
 Archs don't have to implement this name lookup stuff, but it looks
 like most of them would - so it looks like there ought to be a helper
 function in generic code that will do the check / name lookup stuff.
 


It doesn't turn out to be very generic. The IO breakpoints in x86, the
address-range (only) breakpoints in S390 and perhaps 4xx powerpc
processors were what made me think that this should remain in
arch-specific code. In these cases, we might have to deal only with
breakpoint addresses and not names.

  +   if (bp-info.address)
  +   return 0;
 
 Hrm.. you realise there's no theoretical reason a userspace program
 couldn't put a breakpoint at address 0...?
 

I agree. I think there must be parts of code that works based on this
assumption. Will check and remove them.

  +   return -EINVAL;
  +}
  +
  +/*
  + * Validate the arch-specific HW Breakpoint register settings
  + */
  +int arch_validate_hwbkpt_settings(struct hw_breakpoint *bp,
  +   struct task_struct *tsk)
  +{
  +   int is_kernel, ret = -EINVAL;
  +
  +   if (!bp)
  +   return ret;
  +
  +   switch (bp-info.type) {
  +   case HW_BREAKPOINT_READ:
  +   case HW_BREAKPOINT_WRITE:
  +   case HW_BREAKPOINT_RW:
  +   break;
  +   default:
  +   return ret;
  +   }
  +
  +   if (bp-triggered)
  +   ret = arch_store_info(bp, tsk);
  +
  +   is_kernel = is_kernel_addr(bp-info.address);
  +   if ((tsk  is_kernel) || (!tsk  !is_kernel))
  +   return -EINVAL;
  +
  +   return ret;
  +}
  +
  +void arch_update_user_hw_breakpoint(int pos, struct task_struct *tsk)
  +{
  +   struct thread_struct *thread = (tsk-thread);
  +   struct hw_breakpoint *bp = thread-hbp[0];
  +
  +   if (bp)
  +   thread-dabr = (bp-info.address  ~HW_BREAKPOINT_ALIGN) |
  +   bp-info.type | DABR_TRANSLATION;
  +   else
  +   thread-dabr = 0;
  +}
  +
  +void arch_flush_thread_hw_breakpoint(struct task_struct *tsk)
  +{
  +   struct thread_struct *thread = (tsk-thread);
  +
  +   thread-dabr = 0;
  +}
  +
  +/*
  + * Handle debug exception notifications.
  + */
  +int __kprobes hw_breakpoint_handler(struct die_args *args)
  +{
  +   int rc = NOTIFY_STOP;
  +   struct hw_breakpoint *bp;
  +   struct pt_regs *regs = args-regs;
  +   unsigned long dar = regs-dar;
  +   int cpu, is_one_shot, stepped = 1;
  +
  +   /* Disable breakpoints during exception handling */
  +   set_dabr(0);
  +
  +   cpu = get_cpu();
  +   /* Determine whether kernel- or user-space address is the trigger */
  +   bp = (hbp_kernel_pos == HBP_NUM) ? current-thread.hbp[0] :
  +   per_cpu(this_hbp_kernel[0], cpu);
  +   /*
  +* bp can be NULL due to lazy debug register switching
  +* or due to the delay between updates of hbp_kernel_pos
  +* and this_hbp_kernel.
  +*/
  +   if (!bp)
  +   goto out;
  +
  +   if (dar == bp-info.address)
  +   per_cpu(dabr_data, cpu) = (hbp_kernel_pos == HBP_NUM) ?
  +   current-thread.dabr : kdabr;
  +   else {
  +   /*
  +* This exception is triggered not because of a memory access on
  +* the monitored variable but in the double-word address range
  +* in which it is contained. We will 

[PATCH] powerpc: Add configurable -Werror for arch/powerpc

2009-06-10 Thread Michael Ellerman
Add the option to build the code under arch/powerpc with -Werror.

The intention is to make it harder for people to inadvertantly introduce
warnings in the arch/powerpc code. It needs to be configurable so that
if a warning is introduced, people can easily work around it while it's
being fixed.

The option is a negative, ie. don't enable -Werror, so that it will be
turned on for allyes and allmodconfig builds.

The default is n, in the hope that developers will build with -Werror,
that will probably lead to some build breaks, I am prepared to be flamed.

It's not enabled for math-emu, which is a steaming pile of warnings.

Signed-off-by: Michael Ellerman mich...@ellerman.id.au
---
 arch/powerpc/Kconfig.debug  |   17 +
 arch/powerpc/kernel/Makefile|2 ++
 arch/powerpc/kvm/Makefile   |2 ++
 arch/powerpc/lib/Makefile   |2 ++
 arch/powerpc/mm/Makefile|2 ++
 arch/powerpc/oprofile/Makefile  |2 ++
 arch/powerpc/platforms/Makefile |2 ++
 arch/powerpc/sysdev/Makefile|2 ++
 arch/powerpc/xmon/Makefile  |2 ++
 9 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index d79a902..3b10051 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -2,6 +2,23 @@ menu Kernel hacking
 
 source lib/Kconfig.debug
 
+config PPC_DISABLE_WERROR
+   bool Don't build arch/powerpc code with -Werror
+   default n
+   help
+ This option tells the compiler NOT to build the code under
+ arch/powerpc with the -Werror flag (which means warnings
+ are treated as errors).
+
+ Only enable this if you are hitting a build failure in the
+ arch/powerpc code caused by a warning, and you don't feel
+ inclined to fix it.
+
+config PPC_WERROR
+   bool
+   depends on !PPC_DISABLE_WERROR
+   default y
+
 config PRINT_STACK_DEPTH
int Stack depth to print if DEBUG_KERNEL
default 64
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 65cf365..110ec6d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -4,6 +4,8 @@
 
 CFLAGS_ptrace.o+= -DUTS_MACHINE='$(UTS_MACHINE)'
 
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 ifeq ($(CONFIG_PPC64),y)
 CFLAGS_prom_init.o += -mno-minimal-toc
 endif
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 4b2df66..459c7ee 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -2,6 +2,8 @@
 # Makefile for Kernel-based Virtual Machine module
 #
 
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm
 
 common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 29b742b..3040dac 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -2,6 +2,8 @@
 # Makefile for ppc-specific library files..
 #
 
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS   += -mno-minimal-toc
 endif
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index c4bcf07..2d2192e 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -2,6 +2,8 @@
 # Makefile for the linux ppc-specific parts of the memory manager.
 #
 
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS   += -mno-minimal-toc
 endif
diff --git a/arch/powerpc/oprofile/Makefile b/arch/powerpc/oprofile/Makefile
index 2ef6b0d..73e1c2c 100644
--- a/arch/powerpc/oprofile/Makefile
+++ b/arch/powerpc/oprofile/Makefile
@@ -1,3 +1,5 @@
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS   += -mno-minimal-toc
 endif
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index f741919..a6812ee 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -1,4 +1,6 @@
 
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 obj-$(CONFIG_FSL_ULI1575)  += fsl_uli1575.o
 
 obj-$(CONFIG_PPC_PMAC) += powermac/
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 2d1c87d..d073bfd 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -1,3 +1,5 @@
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS   += -mno-minimal-toc
 endif
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
index 9cb03b7..85ab97a 100644
--- a/arch/powerpc/xmon/Makefile
+++ b/arch/powerpc/xmon/Makefile
@@ -1,5 +1,7 @@
 # Makefile for xmon
 
+subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+
 ifdef CONFIG_PPC64
 EXTRA_CFLAGS += -mno-minimal-toc
 endif
-- 
1.6.2.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org

Re: [Patch 3/6] Modify ptrace code to use Hardware Breakpoint interfaces

2009-06-10 Thread K.Prasad
On Fri, Jun 05, 2009 at 03:13:45PM +1000, David Gibson wrote:
 On Wed, Jun 03, 2009 at 10:05:24PM +0530, K.Prasad wrote:
  Modify the ptrace code to use the hardware breakpoint interfaces for 
  user-space.
  
  Signed-off-by: K.Prasad pra...@linux.vnet.ibm.com
  ---
   arch/powerpc/kernel/ptrace.c |   47 
  +++
   1 file changed, 47 insertions(+)
  
  Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c
  ===
  --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/ptrace.c
  +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c
  @@ -37,6 +37,7 @@
   #include asm/page.h
   #include asm/pgtable.h
   #include asm/system.h
  +#include asm/hw_breakpoint.h
   
   /*
* does not yet catch signals sent when the child dies.
  @@ -735,9 +736,26 @@ void user_disable_single_step(struct tas
  clear_tsk_thread_flag(task, TIF_SINGLESTEP);
   }
   
  +void ptrace_triggered(struct hw_breakpoint *bp, struct pt_regs *regs)
  +{
  +   /*
  +* Unregister the breakpoint request here since ptrace has defined a
  +* one-shot behaviour for breakpoint exceptions in PPC64.
  +* The SIGTRAP signal is generated automatically for us in do_dabr().
  +* We don't have to do anything here
  +*/
  +   unregister_user_hw_breakpoint(current, bp);
  +   kfree(bp);
 
 Couldn't you also clear the saved dabr info here, to avoid having to
 special case this in the actual breakpoint handler.
 

The saved dabr_data is created as a static variable and I didn't want to
modify its value across files.

 Also, I think you should be delivering the signal here - for gdb
 compatibility I think we'll need to match the old behaviour which has
 the TRAP delivered before executing the breakpointed instruction.
 

We could do it either way. Return a NOTIFY_DONE from
hw_breakpoint_handler() and allow the do_dabr()
code to deliver the signal, or deliver a signal here and return a
NOTIFY_STOP in the exception handler. I chose the former as it doesn't
duplicate the code.

 -- 
 David Gibson  | I'll have my music baroque, and my code
 david AT gibson.dropbear.id.au| minimalist, thank you.  NOT _the_ 
 _other_
   | _way_ _around_!
 http://www.ozlabs.org/~dgibson

Thanks,
K.Prasad

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 2.6.31] ehca: Tolerate dynamic memory operations and huge pages

2009-06-10 Thread Hannes Hering
Hi Michael,

On Wednesday 10 June 2009 02:02:36 Michael Ellerman wrote:
 For those of us who haven't read the HEA spec lately, can you give us
 some more detail on that? :)
first of all, please note that this patch is actually for the ehca infiniband
driver. The ehca driver uses an internal memory region, which is supposed to
contain all physical memory. A memory region maps a virtually contiguous
adapter address space to the physical or better absolute address space. The
limitation is that the memory region cannot map non-contiguous virtual adapter
address space. However, on ppc64 machines there is a feature to dynamically add
or remove memory to logical partitions during runtime. These operations scatter
the absolute memory so that the kernel memory has a non-contiguous layout. This
layout cannot be represented in a memory region. The purpose of this code is to
detect the memory layout so that the memory region can be made up of the
existing memory chunks. It also translates the kernel addresses to the memory
region address, which is needed for interaction with the HCA.
 How does it interact with kexec/kdump?
We never tested the ehca driver with kexec/kdump. This patch also doesn't
improve anything in this context.

 phys_to_abs() ? As below, or does it come from somewhere else?
You're right, actually that isn't needed on System p. On the other hand I
needed to choose an address type, which is the base of all mapping. The
busmap holds all addresses as absolute addresses. The absolute addresses can
then be converted in any other type (virt, phys). 

Regards

Hannes

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[Patch 0/6] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver VI

2009-06-10 Thread K.Prasad
Hi David,
Please find a new set of patches that implement the changes described 
below.

Changelog - ver VI
---
(Ver I: http://ozlabs.org/pipermail/linuxppc-dev/2009-May/071942.html) 
(Ver II: http://ozlabs.org/pipermail/linuxppc-dev/2009-May/072106.html)
(Ver III: http://ozlabs.org/pipermail/linuxppc-dev/2009-May/072387.html
(Ver IV: http://ozlabs.org/pipermail/linuxppc-dev/2009-May/072518.html
(Ver V: http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-June/072749.html)
9th June June 2009
---

Changelog - ver VI
--
The task of identifying 'genuine' breakpoint exceptions from those caused by
'out-of-range' accesses turned out to be more tricky than originally thought.
Some changes to this effect were made in version IV of this patchset, but they
were not sufficient for user-space. Basically the breakpoint address received
through ptrace is always aligned to 8-bytes since ptrace receives an encoded
'data' (consisting of address | translation_enable | bkpt_type), and the size of
the symbol is not known. However for kernel-space addresses, the symbol-size can
be determined using kallsyms_lookup_size_offset() and this is used to check if
DAR (in the exception context) is
'bkpt_address = DAR = (bkpt_address + symbol_size)', failing which we conclude
it as a stray exception.

The following changes are made to enable check:
- Addition of a symbolsize field in 'struct arch_hw_breakpoint' field.
- Store the size of the 'watched' kernel symbol into 'symbolsize' field in
  arch_store_info(0 routine.
- Verify if the above described condition is true when is_one_shot is FALSE in
  hw_breakpoint_handler().

Kindly let me know your comments on the same.

Thanks,
K.Prasad

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[Patch 3/6] Modify ptrace code to use Hardware Breakpoint interfaces

2009-06-10 Thread K.Prasad
Modify the ptrace code to use the hardware breakpoint interfaces for user-space.

Signed-off-by: K.Prasad pra...@linux.vnet.ibm.com
---
 arch/powerpc/kernel/ptrace.c |   43 +++
 1 file changed, 43 insertions(+)

Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c
===
--- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/ptrace.c
+++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c
@@ -37,6 +37,7 @@
 #include asm/page.h
 #include asm/pgtable.h
 #include asm/system.h
+#include asm/hw_breakpoint.h
 
 /*
  * does not yet catch signals sent when the child dies.
@@ -737,11 +738,24 @@ void user_disable_single_step(struct tas
 
 void ptrace_triggered(struct hw_breakpoint *bp, struct pt_regs *regs)
 {
+   /*
+* Unregister the breakpoint request here since ptrace has defined a
+* one-shot behaviour for breakpoint exceptions in PPC64.
+* The SIGTRAP signal is generated automatically for us in do_dabr().
+* We don't have to do anything here
+*/
+   unregister_user_hw_breakpoint(current, bp);
+   kfree(bp);
 }
 
 int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
   unsigned long data)
 {
+#ifdef CONFIG_PPC64
+   struct thread_struct *thread = (task-thread);
+   struct hw_breakpoint *bp;
+   int ret;
+#endif
/* For ppc64 we support one DABR and no IABR's at the moment (ppc64).
 *  For embedded processors we support one DAC and no IAC's at the
 *  moment.
@@ -771,6 +785,35 @@ int ptrace_set_debugreg(struct task_stru
if (data  !(data  DABR_TRANSLATION))
return -EIO;
 
+#ifdef CONFIG_PPC64
+   bp = thread-hbp[0];
+   if (data == 0) {
+   if (bp) {
+   unregister_user_hw_breakpoint(task, bp);
+   kfree(bp);
+   }
+   return 0;
+   }
+
+   if (bp) {
+   bp-info.type = data  HW_BREAKPOINT_RW;
+   task-thread.dabr = bp-info.address = data;
+   return modify_user_hw_breakpoint(task, bp);
+   }
+   bp = kzalloc(sizeof(struct hw_breakpoint), GFP_KERNEL);
+   if (!bp)
+   return -ENOMEM;
+
+   /* Store the type of breakpoint */
+   bp-info.type = data  HW_BREAKPOINT_RW;
+   bp-triggered = ptrace_triggered;
+   task-thread.dabr = bp-info.address = data;
+
+   ret = register_user_hw_breakpoint(task, bp);
+   if (ret)
+   return ret;
+#endif /* CONFIG_PPC64 */
+
/* Move contents to the DABR register */
task-thread.dabr = data;
 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[Patch 4/6] Modify process and processor handling code to recognise hardware debug registers

2009-06-10 Thread K.Prasad
Modify process handling code to recognise hardware debug registers during copy
and flush operations. Introduce a new TIF_DEBUG task flag to indicate a
process's use of debug register. Load the debug register values into a
new CPU during initialisation.

Signed-off-by: K.Prasad pra...@linux.vnet.ibm.com
---
 arch/powerpc/kernel/process.c |   15 +++
 arch/powerpc/kernel/smp.c |2 ++
 2 files changed, 17 insertions(+)

Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/process.c
===
--- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/process.c
+++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/process.c
@@ -50,6 +50,7 @@
 #include asm/syscalls.h
 #ifdef CONFIG_PPC64
 #include asm/firmware.h
+#include asm/hw_breakpoint.h
 #endif
 #include linux/kprobes.h
 #include linux/kdebug.h
@@ -254,8 +255,10 @@ void do_dabr(struct pt_regs *regs, unsig
11, SIGSEGV) == NOTIFY_STOP)
return;
 
+#ifndef CONFIG_PPC64
if (debugger_dabr_match(regs))
return;
+#endif
 
/* Clear the DAC and struct entries.  One shot trigger */
 #if defined(CONFIG_BOOKE)
@@ -372,8 +375,13 @@ struct task_struct *__switch_to(struct t
 
 #endif /* CONFIG_SMP */
 
+#ifdef CONFIG_PPC64
+   if (unlikely(test_tsk_thread_flag(new, TIF_DEBUG)))
+   arch_install_thread_hw_breakpoint(new);
+#else
if (unlikely(__get_cpu_var(current_dabr) != new-thread.dabr))
set_dabr(new-thread.dabr);
+#endif /* CONFIG_PPC64 */
 
 #if defined(CONFIG_BOOKE)
/* If new thread DAC (HW breakpoint) is the same then leave it */
@@ -550,6 +558,10 @@ void show_regs(struct pt_regs * regs)
 void exit_thread(void)
 {
discard_lazy_cpu_state();
+#ifdef CONFIG_PPC64
+   if (unlikely(test_tsk_thread_flag(current, TIF_DEBUG)))
+   flush_thread_hw_breakpoint(current);
+#endif /* CONFIG_PPC64 */
 }
 
 void flush_thread(void)
@@ -672,6 +684,9 @@ int copy_thread(unsigned long clone_flag
 * function.
 */
kregs-nip = *((unsigned long *)ret_from_fork);
+
+   if (unlikely(test_tsk_thread_flag(current, TIF_DEBUG)))
+   copy_thread_hw_breakpoint(current, p, clone_flags);
 #else
kregs-nip = (unsigned long)ret_from_fork;
 #endif
Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/smp.c
===
--- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/smp.c
+++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/smp.c
@@ -48,6 +48,7 @@
 #include asm/vdso_datapage.h
 #ifdef CONFIG_PPC64
 #include asm/paca.h
+#include asm/hw_breakpoint.h
 #endif
 
 #ifdef DEBUG
@@ -536,6 +537,7 @@ int __devinit start_secondary(void *unus
 
local_irq_enable();
 
+   load_debug_registers();
cpu_idle();
return 0;
 }

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[Patch 2/6] Introduce PPC64 specific Hardware Breakpoint interfaces

2009-06-10 Thread K.Prasad
Introduce PPC64 implementation for the generic hardware breakpoint interfaces
defined in kernel/hw_breakpoint.c. Enable the HAVE_HW_BREAKPOINT flag and the
Makefile.

Signed-off-by: K.Prasad pra...@linux.vnet.ibm.com
---
 arch/powerpc/Kconfig|1 
 arch/powerpc/kernel/Makefile|2 
 arch/powerpc/kernel/hw_breakpoint.c |  298 
 arch/powerpc/kernel/ptrace.c|4 
 4 files changed, 304 insertions(+), 1 deletion(-)

Index: linux-2.6-tip.hbkpt/arch/powerpc/Kconfig
===
--- linux-2.6-tip.hbkpt.orig/arch/powerpc/Kconfig
+++ linux-2.6-tip.hbkpt/arch/powerpc/Kconfig
@@ -125,6 +125,7 @@ config PPC
select USE_GENERIC_SMP_HELPERS if SMP
select HAVE_OPROFILE
select HAVE_SYSCALL_WRAPPERS if PPC64
+   select HAVE_HW_BREAKPOINT if PPC64
 
 config EARLY_PRINTK
bool
Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/Makefile
===
--- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/Makefile
+++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/Makefile
@@ -33,7 +33,7 @@ obj-$(CONFIG_PPC64)   += setup_64.o sys_p
   signal_64.o ptrace32.o \
   paca.o cpu_setup_ppc970.o \
   cpu_setup_pa6t.o \
-  firmware.o nvram_64.o
+  firmware.o nvram_64.o hw_breakpoint.o
 obj64-$(CONFIG_RELOCATABLE)+= reloc_64.o
 obj-$(CONFIG_PPC64)+= vdso64/
 obj-$(CONFIG_ALTIVEC)  += vecemu.o vector.o
Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/hw_breakpoint.c
===
--- /dev/null
+++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/hw_breakpoint.c
@@ -0,0 +1,298 @@
+/*
+ * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility,
+ * using the CPU's debug registers.
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright © 2009 IBM Corporation
+ */
+
+#include linux/notifier.h
+#include linux/kallsyms.h
+#include linux/kprobes.h
+#include linux/percpu.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/sched.h
+#include linux/init.h
+#include linux/smp.h
+
+#include asm/hw_breakpoint.h
+#include asm/processor.h
+#include asm/sstep.h
+
+/* Store the kernel-space breakpoint address value */
+static unsigned long kdabr;
+
+/*
+ * Temporarily stores address for DABR before it is written by the
+ * single-step handler routine
+ */
+static DEFINE_PER_CPU(unsigned long, dabr_data);
+
+void arch_update_kernel_hw_breakpoint(void *unused)
+{
+   struct hw_breakpoint *bp;
+
+   /* Check if there is nothing to update */
+   if (hbp_kernel_pos == HBP_NUM)
+   return;
+
+   per_cpu(this_hbp_kernel[hbp_kernel_pos], get_cpu()) = bp =
+   hbp_kernel[hbp_kernel_pos];
+   if (bp == NULL)
+   kdabr = 0;
+   else
+   kdabr = (bp-info.address  ~HW_BREAKPOINT_ALIGN) |
+   bp-info.type | DABR_TRANSLATION;
+   set_dabr(kdabr);
+   put_cpu_no_resched();
+}
+
+/*
+ * Install the thread breakpoints in their debug registers.
+ */
+void arch_install_thread_hw_breakpoint(struct task_struct *tsk)
+{
+   set_dabr(tsk-thread.dabr);
+}
+
+/*
+ * Clear the DABR which contains the thread-specific breakpoint address
+ */
+void arch_uninstall_thread_hw_breakpoint()
+{
+   set_dabr(0);
+}
+
+/*
+ * Store a breakpoint's encoded address, length, and type.
+ */
+int arch_store_info(struct hw_breakpoint *bp, struct task_struct *tsk)
+{
+   /* Symbol names from user-space are rejected */
+   if (tsk) {
+   if (bp-info.name)
+   return -EINVAL;
+   else
+   return 0;
+   }
+   /*
+* User-space requests will always have the address field populated
+* For kernel-addresses, either the address or symbol name can be
+* specified.
+*/
+   if (bp-info.name)
+   bp-info.address = (unsigned long)
+   kallsyms_lookup_name(bp-info.name);

[Patch 5/6] Modify Data storage exception code to recognise DABR match first

2009-06-10 Thread K.Prasad
Modify Data storage exception code to first lookout for a DABR match before
recognising a kprobe or xmon exception.

Signed-off-by: K.Prasad pra...@linux.vnet.ibm.com
---
 arch/powerpc/mm/fault.c |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

Index: linux-2.6-tip.hbkpt/arch/powerpc/mm/fault.c
===
--- linux-2.6-tip.hbkpt.orig/arch/powerpc/mm/fault.c
+++ linux-2.6-tip.hbkpt/arch/powerpc/mm/fault.c
@@ -136,6 +136,12 @@ int __kprobes do_page_fault(struct pt_re
error_code = 0x4820;
else
is_write = error_code  DSISR_ISSTORE;
+
+   if (error_code  DSISR_DABRMATCH) {
+   /* DABR match */
+   do_dabr(regs, address, error_code);
+   return 0;
+   }
 #else
is_write = error_code  ESR_DST;
 #endif /* CONFIG_4xx || CONFIG_BOOKE */
@@ -150,14 +156,6 @@ int __kprobes do_page_fault(struct pt_re
if (!user_mode(regs)  (address = TASK_SIZE))
return SIGSEGV;
 
-#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
-   if (error_code  DSISR_DABRMATCH) {
-   /* DABR match */
-   do_dabr(regs, address, error_code);
-   return 0;
-   }
-#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
-
if (in_atomic() || mm == NULL) {
if (!user_mode(regs))
return SIGSEGV;

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage

2009-06-10 Thread K.Prasad
Modify kexec code to disable DABR registers before a reboot. Adapt the samples
code to populate PPC64-arch specific fields.

Signed-off-by: K.Prasad pra...@linux.vnet.ibm.com
---
 arch/powerpc/kernel/machine_kexec_64.c  |3 +++
 samples/hw_breakpoint/data_breakpoint.c |4 
 2 files changed, 7 insertions(+)

Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c
===
--- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c
+++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c
@@ -24,6 +24,7 @@
 #include asm/sections.h  /* _end */
 #include asm/prom.h
 #include asm/smp.h
+#include asm/hw_breakpoint.h
 
 int default_machine_kexec_prepare(struct kimage *image)
 {
@@ -214,6 +215,7 @@ static void kexec_prepare_cpus(void)
put_cpu();
 
local_irq_disable();
+   hw_breakpoint_disable();
 }
 
 #else /* ! SMP */
@@ -233,6 +235,7 @@ static void kexec_prepare_cpus(void)
if (ppc_md.kexec_cpu_down)
ppc_md.kexec_cpu_down(0, 0);
local_irq_disable();
+   hw_breakpoint_disable();
 }
 
 #endif /* SMP */
Index: linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c
===
--- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c
+++ linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c
@@ -54,6 +54,10 @@ static int __init hw_break_module_init(v
sample_hbp.info.type = HW_BREAKPOINT_WRITE;
sample_hbp.info.len = HW_BREAKPOINT_LEN_4;
 #endif /* CONFIG_X86 */
+#ifdef CONFIG_PPC64
+   sample_hbp.info.name = ksym_name;
+   sample_hbp.info.type = HW_BREAKPOINT_WRITE;
+#endif /* CONFIG_PPC64 */
 
sample_hbp.triggered = (void *)sample_hbp_handler;
 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Delay on intialization ide subsystem(most likely)

2009-06-10 Thread Bartlomiej Zolnierkiewicz
On Tuesday 09 June 2009 01:26:27 Benjamin Herrenschmidt wrote:
 On Mon, 2009-06-08 at 22:20 +0200, Bartlomiej Zolnierkiewicz wrote:
 
   [   70.584122]  hdb:3ide-pmac lost interrupt, dma status: 8480
  
  DMA status indicates that DMA transfer is still active according to
  the controller.  This one is really a platform/hardware specific issue.
 
 I've partially missed that thread. Is the a bugzilla entry or

There is no bugzilla entry currently so please check mailing list
archives for previous discussion.

 something ? Is this a regression ?

At least not a recent one (it happens since at least 2.6.24).
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 3/5] can: af_can.c use rcu_barrier() on module unload.

2009-06-10 Thread Jeremy Kerr
David,

 We really can't expect patchwork to look for every conceivable
 malignment of the various reviewer tags.

No, but we could probably be more tolerant about capitalisation. Any 
objections about ignoring case completely? I have a patch ready to 
push...

Cheers,


Jeremy
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 00/33] My PS3-specific patches for 2.6.31

2009-06-10 Thread Geert Uytterhoeven

Hi Ben,

Here are my PS3-specific patches for 2.6.31:
  [01] ps3av: Set 16:9 aspect ratio for 720p video modes
  [02] ps3vram: Fix error path (return -EIO) for short read/write
  [03] ps3vram: Use proc_create_data() instead of proc_create()
  [04] ps3vram: Correct exchanged gotos in ps3vram_probe() error path
  [05] block: Add bio_list_peek()
  [06] ps3vram: Replace mutex by spinlock + bio_list
  [07] ps3fb: Remove useless debug checks in ps3fb_shutdown()
  [08] ps3fb: Inline functions in ps3fb_probe(), to ease cleanup in the
   error path
  [09] ps3fb: Correct handling of device opening in ps3fb_probe()
  [10] powerpc/cell: Extract duplicated IOPTE_* to asm/iommu.h
  [11] ps3fb: GPU memory mapping cleanup
  [12] ps3vram: GPU memory mapping cleanup
  [13] ps3fb/vram: Extract common GPU stuff into asm/ps3gpu.h
  [14] ps3fb: Tear down FB setup during cleanup
  [15] ps3vram: Remove no longer used ps3vram_priv.ddr_base
  [16] ps3vram: Make ps3vram_priv.reports a void *
  [17] block/ps3: remove driver_data direct access of struct device
  [18] ps3: ps3_system_bus_device - Use dev_[gs]et_drvdata() instead of
   direct access
  [19] ps3: shorten ps3_system_bus_[gs]et_driver_data to
   ps3_system_bus_[gs]et_drvdata
  [20] ps3: ps3flash - Use ps3_system_bus_[gs]et_drvdata() instead of direct
   access
  [21] ps3: ps3rom - Use ps3_system_bus_[gs]et_drvdata() instead of direct
   access
  [22] ps3: ps3fb - Use ps3_system_bus_[gs]et_drvdata() instead of direct
   access
  [23] net/ps3: gelic - Add missing annotations
  [24] usb/ps3: Add missing annotations
  [25] drivers/ps3: Add missing annotations
  [26] sound/ps3: Fix checkpatch issues
  [27] sound/ps3: Restructure driver source
  [28] sound/ps3: Correct existing and add missing annotations
  [29] ps3: Correct debug message in dma_ioc0_map_pages()
  [30] ps3: Switch ps3_os_area_[gs]et_rtc_diff to EXPORT_SYMBOL_GPL()
  [31] ps3: Replace direct file operations by callback
  [32] ps3flash: Cache the last accessed FLASH chunk
  [33] ps3flash: Always read chunks of 256 KiB, and cache them

About half of these have been submitted and reviewed before, with review
comments taken into account.

Patches 05 (in response to feedback on v1 of 06) and 18-33 are new.

Given the interactions between powerpc/ps3-specific code and the various
subsystems, I think the easiest way is to get everything in via the
powerpc tree?

Thanks!

arch/powerpc/include/asm/ps3.h|   16 
arch/powerpc/include/asm/ps3gpu.h |8 
arch/powerpc/platforms/ps3/mm.c   |6 
arch/powerpc/platforms/ps3/os-area.c  |  138 +++---
b/arch/powerpc/include/asm/iommu.h|   10 
b/arch/powerpc/include/asm/ps3.h  |3 
b/arch/powerpc/include/asm/ps3gpu.h   |   78 +++
b/arch/powerpc/platforms/cell/iommu.c |   37 -
b/arch/powerpc/platforms/ps3/mm.c |7 
b/arch/powerpc/platforms/ps3/os-area.c|5 
b/arch/powerpc/platforms/ps3/platform.h   |   10 
b/arch/powerpc/platforms/ps3/setup.c  |1 
b/arch/powerpc/platforms/ps3/system-bus.c |   16 
b/drivers/block/ps3disk.c |   23 -
b/drivers/block/ps3vram.c |2 
b/drivers/char/ps3flash.c |   13 
b/drivers/net/ps3_gelic_net.c |8 
b/drivers/net/ps3_gelic_wireless.c|7 
b/drivers/ps3/ps3-sys-manager.c   |2 
b/drivers/ps3/ps3av.c |5 
b/drivers/ps3/ps3av_cmd.c |3 
b/drivers/scsi/ps3rom.c   |   11 
b/drivers/usb/host/ehci-ps3.c |7 
b/drivers/usb/host/ohci-ps3.c |8 
b/drivers/video/ps3fb.c   |   15 
b/include/linux/bio.h |6 
b/sound/ppc/snd_ps3.c |   33 -
drivers/block/ps3disk.c   |   23 -
drivers/block/ps3vram.c   |  228 +-
drivers/char/ps3flash.c   |  353 +---
drivers/net/ps3_gelic_net.c   |   22 -
drivers/ps3/ps3av.c   |5 
drivers/usb/host/ehci-ps3.c   |4 
drivers/usb/host/ohci-ps3.c   |5 
drivers/video/ps3fb.c |  312 ++
sound/ppc/snd_ps3.c   |  635 +-
36 files changed, 1045 insertions(+), 1020 deletions(-)

With kind regards,

Geert Uytterhoeven
Software Architect
Techsoft Centre

Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   geert.uytterhoe...@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 01/33] ps3av: Set 16:9 aspect ratio for 720p video modes

2009-06-10 Thread Geert Uytterhoeven
From: sebastian.bla...@gmail.com sebastian.bla...@gmail.com

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
---
 drivers/ps3/ps3av.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index 235e87f..4e4611e 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -80,12 +80,12 @@ static const struct avset_video_mode {
{ 0, }, /* auto */
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_480I,   A_N,  720,  480},
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_480P,   A_N,  720,  480},
-   {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_60HZ,  A_N, 1280,  720},
+   {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_60HZ,  A_W, 1280,  720},
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080I_60HZ, A_W, 1920, 1080},
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080P_60HZ, A_W, 1920, 1080},
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_576I,   A_N,  720,  576},
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_576P,   A_N,  720,  576},
-   {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_50HZ,  A_N, 1280,  720},
+   {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_50HZ,  A_W, 1280,  720},
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080I_50HZ, A_W, 1920, 1080},
{YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080P_50HZ, A_W, 1920, 1080},
{  RGB8, XRGB, PS3AV_CMD_VIDEO_VID_WXGA,   A_W, 1280,  768},
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 02/33] ps3vram: Fix error path (return -EIO) for short read/write

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
 drivers/block/ps3vram.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 8eddef3..2e79d2c 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -585,6 +585,7 @@ static int ps3vram_make_request(struct request_queue *q, 
struct bio *bio)
 
if (retlen != len) {
dev_err(dev-core, Short %s\n, op);
+   error = -EIO;
goto out;
}
 
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 03/33] ps3vram: Use proc_create_data() instead of proc_create()

2009-06-10 Thread Geert Uytterhoeven
Use proc_create_data() to avoid race conditions.

Reported-by: Alexey Dobriyan adobri...@gmail.com
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
 drivers/block/ps3vram.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 2e79d2c..6e73868 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -546,12 +546,10 @@ static void __devinit ps3vram_proc_init(struct 
ps3_system_bus_device *dev)
struct ps3vram_priv *priv = dev-core.driver_data;
struct proc_dir_entry *pde;
 
-   pde = proc_create(DEVICE_NAME, 0444, NULL, ps3vram_proc_fops);
-   if (!pde) {
+   pde = proc_create_data(DEVICE_NAME, 0444, NULL, ps3vram_proc_fops,
+  priv);
+   if (!pde)
dev_warn(dev-core, failed to create /proc entry\n);
-   return;
-   }
-   pde-data = priv;
 }
 
 static int ps3vram_make_request(struct request_queue *q, struct bio *bio)
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 04/33] ps3vram: Correct exchanged gotos in ps3vram_probe() error path

2009-06-10 Thread Geert Uytterhoeven
From: Jim Paris j...@jtan.com

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
 drivers/block/ps3vram.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 6e73868..3c9ad19 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -635,7 +635,7 @@ static int __devinit ps3vram_probe(struct 
ps3_system_bus_device *dev)
if (ps3_open_hv_device(dev)) {
dev_err(dev-core, ps3_open_hv_device failed\n);
error = -EAGAIN;
-   goto out_close_gpu;
+   goto out_free_xdr_buf;
}
 
/* Request memory */
@@ -659,7 +659,7 @@ static int __devinit ps3vram_probe(struct 
ps3_system_bus_device *dev)
dev_err(dev-core, lv1_gpu_memory_allocate failed %d\n,
status);
error = -ENOMEM;
-   goto out_free_xdr_buf;
+   goto out_close_gpu;
}
 
/* Request context */
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 09/33] ps3fb: Correct handling of device opening in ps3fb_probe()

2009-06-10 Thread Geert Uytterhoeven
  - ps3_open_hv_device() returns a standard error value,
  - Add missing call to ps3_close_hv_device() in the error path.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
---
 drivers/video/ps3fb.c |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index a745018..542ffc3 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -985,7 +985,7 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
 {
struct fb_info *info;
struct ps3fb_par *par;
-   int retval = -ENOMEM;
+   int retval;
u64 ddr_lpar = 0;
u64 lpar_dma_control = 0;
u64 lpar_driver_info = 0;
@@ -1003,8 +1003,8 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
return -ENOMEM;
}
 
-   status = ps3_open_hv_device(dev);
-   if (status) {
+   retval = ps3_open_hv_device(dev);
+   if (retval) {
dev_err(dev-core, %s: ps3_open_hv_device failed\n,
__func__);
goto err;
@@ -1027,7 +1027,8 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: 
%d\n,
__func__, status);
-   goto err;
+   retval = -ENODEV;
+   goto err_close_device;
}
 #endif
 #ifdef HEAD_B
@@ -1040,7 +1041,8 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
%s: lv1_gpu_context_attribute DISPLAY_SYNC failed: 
%d\n,
__func__, status);
-   goto err;
+   retval = -ENODEV;
+   goto err_close_device;
}
 #endif
 
@@ -1057,7 +1059,7 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
if (status) {
dev_err(dev-core, %s: lv1_gpu_memory_allocate failed: %d\n,
__func__, status);
-   goto err;
+   goto err_close_device;
}
dev_dbg(dev-core, ddr:lpar:0x%llx\n, ddr_lpar);
 
@@ -1221,6 +1223,8 @@ err_gpu_context_free:
lv1_gpu_context_free(ps3fb.context_handle);
 err_gpu_memory_free:
lv1_gpu_memory_free(ps3fb.memory_handle);
+err_close_device:
+   ps3_close_hv_device(dev);
 err:
return retval;
 }
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 08/33] ps3fb: Inline functions in ps3fb_probe(), to ease cleanup in the error path

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
---
 drivers/video/ps3fb.c |  192 ++---
 1 files changed, 86 insertions(+), 106 deletions(-)

diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index ce0f873..a745018 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -956,73 +956,6 @@ static irqreturn_t ps3fb_vsync_interrupt(int irq, void 
*ptr)
 }
 
 
-static int ps3fb_vsync_settings(struct gpu_driver_info *dinfo,
-   struct device *dev)
-{
-   int error;
-
-   dev_dbg(dev, version_driver:%x\n, dinfo-version_driver);
-   dev_dbg(dev, irq outlet:%x\n, dinfo-irq.irq_outlet);
-   dev_dbg(dev,
-   version_gpu: %x memory_size: %x ch: %x core_freq: %d 
-   mem_freq:%d\n,
-   dinfo-version_gpu, dinfo-memory_size, dinfo-hardware_channel,
-   dinfo-nvcore_frequency/100, 
dinfo-memory_frequency/100);
-
-   if (dinfo-version_driver != GPU_DRIVER_INFO_VERSION) {
-   dev_err(dev, %s: version_driver err:%x\n, __func__,
-   dinfo-version_driver);
-   return -EINVAL;
-   }
-
-   error = ps3_irq_plug_setup(PS3_BINDING_CPU_ANY, dinfo-irq.irq_outlet,
-  ps3fb.irq_no);
-   if (error) {
-   dev_err(dev, %s: ps3_alloc_irq failed %d\n, __func__, error);
-   return error;
-   }
-
-   error = request_irq(ps3fb.irq_no, ps3fb_vsync_interrupt, IRQF_DISABLED,
-   DEVICE_NAME, dev);
-   if (error) {
-   dev_err(dev, %s: request_irq failed %d\n, __func__, error);
-   ps3_irq_plug_destroy(ps3fb.irq_no);
-   return error;
-   }
-
-   dinfo-irq.mask = (1  GPU_INTR_STATUS_VSYNC_1) |
- (1  GPU_INTR_STATUS_FLIP_1);
-   return 0;
-}
-
-static int ps3fb_xdr_settings(u64 xdr_lpar, struct device *dev)
-{
-   int status;
-
-   status = lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF,
-  xdr_lpar, ps3fb_videomemory.size, 0);
-   if (status) {
-   dev_err(dev, %s: lv1_gpu_context_iomap failed: %d\n,
-   __func__, status);
-   return -ENXIO;
-   }
-   dev_dbg(dev, video:%p ioif:%lx lpar:%llx size:%lx\n,
-   ps3fb_videomemory.address, GPU_IOIF, xdr_lpar,
-   ps3fb_videomemory.size);
-
-   status = lv1_gpu_context_attribute(ps3fb.context_handle,
-  L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP,
-  xdr_lpar, GPU_CMD_BUF_SIZE,
-  GPU_IOIF, 0);
-   if (status) {
-   dev_err(dev,
-   %s: lv1_gpu_context_attribute FB_SETUP failed: %d\n,
-   __func__, status);
-   return -ENXIO;
-   }
-   return 0;
-}
-
 static struct fb_ops ps3fb_ops = {
.fb_open= ps3fb_open,
.fb_release = ps3fb_release,
@@ -1048,38 +981,6 @@ static struct fb_fix_screeninfo ps3fb_fix __initdata = {
.accel =FB_ACCEL_NONE,
 };
 
-static int ps3fb_set_sync(struct device *dev)
-{
-   int status;
-
-#ifdef HEAD_A
-   status = lv1_gpu_context_attribute(0x0,
-  L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
-  0, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0);
-   if (status) {
-   dev_err(dev,
-   %s: lv1_gpu_context_attribute DISPLAY_SYNC failed: 
-   %d\n,
-   __func__, status);
-   return -1;
-   }
-#endif
-#ifdef HEAD_B
-   status = lv1_gpu_context_attribute(0x0,
-  L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
-  1, L1GPU_DISPLAY_SYNC_VSYNC, 0, 0);
-
-   if (status) {
-   dev_err(dev,
-   %s: lv1_gpu_context_attribute DISPLAY_SYNC failed: 
-   %d\n,
-   __func__, status);
-   return -1;
-   }
-#endif
-   return 0;
-}
-
 static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
 {
struct fb_info *info;
@@ -1091,6 +992,7 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
u64 lpar_reports = 0;
u64 lpar_reports_size = 0;
u64 xdr_lpar;
+   struct gpu_driver_info *dinfo;
void *fb_start;
int status;
struct task_struct *task;
@@ -1116,7 +1018,31 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
atomic_set(ps3fb.ext_flip, 0); /* for flip with vsync */
init_waitqueue_head(ps3fb.wait_vsync);
 
-   ps3fb_set_sync(dev-core);
+#ifdef HEAD_A
+   status 

[PATCH 07/33] ps3fb: Remove useless debug checks in ps3fb_shutdown()

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
---
 drivers/video/ps3fb.c |   14 ++
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index e00c1df..ce0f873 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -1247,7 +1247,6 @@ err:
 
 static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
 {
-   int status;
struct fb_info *info = dev-core.driver_data;
 
dev_dbg(dev-core,  - %s:%d\n, __func__, __LINE__);
@@ -1271,17 +1270,8 @@ static int ps3fb_shutdown(struct ps3_system_bus_device 
*dev)
info = dev-core.driver_data = NULL;
}
iounmap((u8 __force __iomem *)ps3fb.dinfo);
-
-   status = lv1_gpu_context_free(ps3fb.context_handle);
-   if (status)
-   dev_dbg(dev-core, lv1_gpu_context_free failed: %d\n,
-   status);
-
-   status = lv1_gpu_memory_free(ps3fb.memory_handle);
-   if (status)
-   dev_dbg(dev-core, lv1_gpu_memory_free failed: %d\n,
-   status);
-
+   lv1_gpu_context_free(ps3fb.context_handle);
+   lv1_gpu_memory_free(ps3fb.memory_handle);
ps3_close_hv_device(dev);
dev_dbg(dev-core,  - %s:%d\n, __func__, __LINE__);
 
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 11/33] ps3fb: GPU memory mapping cleanup

2009-06-10 Thread Geert Uytterhoeven
  - Make the IOMMU flags used for mapping main memory into the GPU's I/O space
explicit, instead of relying on the default in the hypervisor,
  - Add missing calls to lv1_gpu_context_iomap(..., CBE_IOPTE_M) to unmap the
memory during cleanup.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
---
v2: Add CBE_ prefix

 drivers/video/ps3fb.c |   15 ---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 542ffc3..a61c1d8 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -32,6 +32,7 @@
 #include linux/init.h
 
 #include asm/abs_addr.h
+#include asm/iommu.h
 #include asm/lv1call.h
 #include asm/ps3av.h
 #include asm/ps3fb.h
@@ -1122,7 +1123,9 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
xdr_lpar = ps3_mm_phys_to_lpar(__pa(ps3fb_videomemory.address));
 
status = lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF,
-  xdr_lpar, ps3fb_videomemory.size, 0);
+  xdr_lpar, ps3fb_videomemory.size,
+  CBE_IOPTE_PP_W | CBE_IOPTE_PP_R |
+  CBE_IOPTE_M);
if (status) {
dev_err(dev-core, %s: lv1_gpu_context_iomap failed: %d\n,
__func__, status);
@@ -1143,12 +1146,12 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
%s: lv1_gpu_context_attribute FB_SETUP failed: %d\n,
__func__, status);
retval = -ENXIO;
-   goto err_free_irq;
+   goto err_context_unmap;
}
 
info = framebuffer_alloc(sizeof(struct ps3fb_par), dev-core);
if (!info)
-   goto err_free_irq;
+   goto err_context_unmap;
 
par = info-par;
par-mode_id = ~ps3fb_mode; /* != ps3fb_mode, to trigger change */
@@ -1213,6 +1216,9 @@ err_fb_dealloc:
fb_dealloc_cmap(info-cmap);
 err_framebuffer_release:
framebuffer_release(info);
+err_context_unmap:
+   lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar,
+ ps3fb_videomemory.size, CBE_IOPTE_M);
 err_free_irq:
free_irq(ps3fb.irq_no, dev-core);
 err_destroy_plug:
@@ -1232,6 +1238,7 @@ err:
 static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
 {
struct fb_info *info = dev-core.driver_data;
+   u64 xdr_lpar = ps3_mm_phys_to_lpar(__pa(ps3fb_videomemory.address));
 
dev_dbg(dev-core,  - %s:%d\n, __func__, __LINE__);
 
@@ -1254,6 +1261,8 @@ static int ps3fb_shutdown(struct ps3_system_bus_device 
*dev)
info = dev-core.driver_data = NULL;
}
iounmap((u8 __force __iomem *)ps3fb.dinfo);
+   lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar,
+ ps3fb_videomemory.size, CBE_IOPTE_M);
lv1_gpu_context_free(ps3fb.context_handle);
lv1_gpu_memory_free(ps3fb.memory_handle);
ps3_close_hv_device(dev);
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 15/33] ps3vram: Remove no longer used ps3vram_priv.ddr_base

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
 drivers/block/ps3vram.c |   14 +-
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 7d1c742..5f408c6 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -73,7 +73,6 @@ struct ps3vram_priv {
u64 context_handle;
u32 *ctrl;
u32 *reports;
-   u8 __iomem *ddr_base;
u8 *xdr_buf;
 
u32 *fifo_base;
@@ -702,19 +701,11 @@ static int __devinit ps3vram_probe(struct 
ps3_system_bus_device *dev)
goto out_free_context;
}
 
-   priv-ddr_base = ioremap_flags(ddr_lpar, ddr_size, _PAGE_NO_CACHE);
-
-   if (!priv-ddr_base) {
-   dev_err(dev-core, ioremap DDR failed\n);
-   error = -ENOMEM;
-   goto out_unmap_context;
-   }
-
priv-ctrl = ioremap(ctrl_lpar, 64 * 1024);
if (!priv-ctrl) {
dev_err(dev-core, ioremap CTRL failed\n);
error = -ENOMEM;
-   goto out_unmap_vram;
+   goto out_unmap_context;
}
 
priv-reports = ioremap(reports_lpar, reports_size);
@@ -791,8 +782,6 @@ out_unmap_reports:
iounmap(priv-reports);
 out_unmap_ctrl:
iounmap(priv-ctrl);
-out_unmap_vram:
-   iounmap(priv-ddr_base);
 out_unmap_context:
lv1_gpu_context_iomap(priv-context_handle, XDR_IOIF, xdr_lpar,
  XDR_BUF_SIZE, CBE_IOPTE_M);
@@ -822,7 +811,6 @@ static int ps3vram_remove(struct ps3_system_bus_device *dev)
ps3vram_cache_cleanup(dev);
iounmap(priv-reports);
iounmap(priv-ctrl);
-   iounmap(priv-ddr_base);
lv1_gpu_context_iomap(priv-context_handle, XDR_IOIF,
  ps3_mm_phys_to_lpar(__pa(priv-xdr_buf)),
  XDR_BUF_SIZE, CBE_IOPTE_M);
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 06/33] ps3vram: Replace mutex by spinlock + bio_list

2009-06-10 Thread Geert Uytterhoeven
Remove the mutex serializing access to the cache.
Instead, queue up new requests on a bio_list if the driver is busy.

This improves sequential write performance by ca. 2%.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
v2: Use bio_list instead of homebrew single-linked list

 drivers/block/ps3vram.c |   51 +-
 1 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 3c9ad19..48c92ae 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -81,8 +81,8 @@ struct ps3vram_priv {
 
struct ps3vram_cache cache;
 
-   /* Used to serialize cache/DMA operations */
-   struct mutex lock;
+   spinlock_t lock;/* protecting list of bios */
+   struct bio_list list;
 };
 
 
@@ -449,8 +449,6 @@ static int ps3vram_read(struct ps3_system_bus_device *dev, 
loff_t from,
offset = (unsigned int) (from  (priv-cache.page_size - 1));
avail  = priv-cache.page_size - offset;
 
-   mutex_lock(priv-lock);
-
entry = ps3vram_cache_match(dev, from);
cached = CACHE_OFFSET + entry * priv-cache.page_size + offset;
 
@@ -462,8 +460,6 @@ static int ps3vram_read(struct ps3_system_bus_device *dev, 
loff_t from,
avail = count;
memcpy(buf, priv-xdr_buf + cached, avail);
 
-   mutex_unlock(priv-lock);
-
buf += avail;
count -= avail;
from += avail;
@@ -494,8 +490,6 @@ static int ps3vram_write(struct ps3_system_bus_device *dev, 
loff_t to,
offset = (unsigned int) (to  (priv-cache.page_size - 1));
avail  = priv-cache.page_size - offset;
 
-   mutex_lock(priv-lock);
-
entry = ps3vram_cache_match(dev, to);
cached = CACHE_OFFSET + entry * priv-cache.page_size + offset;
 
@@ -509,8 +503,6 @@ static int ps3vram_write(struct ps3_system_bus_device *dev, 
loff_t to,
 
priv-cache.tags[entry].flags |= CACHE_PAGE_DIRTY;
 
-   mutex_unlock(priv-lock);
-
buf += avail;
count -= avail;
to += avail;
@@ -552,17 +544,17 @@ static void __devinit ps3vram_proc_init(struct 
ps3_system_bus_device *dev)
dev_warn(dev-core, failed to create /proc entry\n);
 }
 
-static int ps3vram_make_request(struct request_queue *q, struct bio *bio)
+static struct bio *ps3vram_do_bio(struct ps3_system_bus_device *dev,
+ struct bio *bio)
 {
-   struct ps3_system_bus_device *dev = q-queuedata;
+   struct ps3vram_priv *priv = dev-core.driver_data;
int write = bio_data_dir(bio) == WRITE;
const char *op = write ? write : read;
loff_t offset = bio-bi_sector  9;
int error = 0;
struct bio_vec *bvec;
unsigned int i;
-
-   dev_dbg(dev-core, %s\n, __func__);
+   struct bio *next;
 
bio_for_each_segment(bvec, bio, i) {
/* PS3 is ppc64, so we don't handle highmem */
@@ -593,7 +585,35 @@ static int ps3vram_make_request(struct request_queue *q, 
struct bio *bio)
dev_dbg(dev-core, %s completed\n, op);
 
 out:
+   spin_lock_irq(priv-lock);
+   bio_list_pop(priv-list);
+   next = bio_list_peek(priv-list);
+   spin_unlock_irq(priv-lock);
+
bio_endio(bio, error);
+   return next;
+}
+
+static int ps3vram_make_request(struct request_queue *q, struct bio *bio)
+{
+   struct ps3_system_bus_device *dev = q-queuedata;
+   struct ps3vram_priv *priv = dev-core.driver_data;
+   int busy;
+
+   dev_dbg(dev-core, %s\n, __func__);
+
+   spin_lock_irq(priv-lock);
+   busy = !bio_list_empty(priv-list);
+   bio_list_add(priv-list, bio);
+   spin_unlock_irq(priv-lock);
+
+   if (busy)
+   return 0;
+
+   do {
+   bio = ps3vram_do_bio(dev, bio);
+   } while (bio);
+
return 0;
 }
 
@@ -613,7 +633,8 @@ static int __devinit ps3vram_probe(struct 
ps3_system_bus_device *dev)
goto fail;
}
 
-   mutex_init(priv-lock);
+   spin_lock_init(priv-lock);
+   bio_list_init(priv-list);
dev-core.driver_data = priv;
 
priv = dev-core.driver_data;
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 12/33] ps3vram: GPU memory mapping cleanup

2009-06-10 Thread Geert Uytterhoeven
  - Make the IOMMU flags used for mapping main memory into the GPU's I/O space
explicit, instead of relying on the default in the hypervisor,
  - Add missing calls to lv1_gpu_context_iomap(..., CBE_IOPTE_M) to unmap the
memory during cleanup.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
v2: Add CBE_ prefix

 drivers/block/ps3vram.c |   19 ++-
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 48c92ae..4418d59 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -14,6 +14,7 @@
 #include linux/seq_file.h
 
 #include asm/firmware.h
+#include asm/iommu.h
 #include asm/lv1call.h
 #include asm/ps3.h
 
@@ -623,8 +624,8 @@ static int __devinit ps3vram_probe(struct 
ps3_system_bus_device *dev)
int error, status;
struct request_queue *queue;
struct gendisk *gendisk;
-   u64 ddr_lpar, ctrl_lpar, info_lpar, reports_lpar, ddr_size,
-   reports_size;
+   u64 ddr_size, ddr_lpar, ctrl_lpar, info_lpar, reports_lpar,
+   reports_size, xdr_lpar;
char *rest;
 
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
@@ -696,9 +697,11 @@ static int __devinit ps3vram_probe(struct 
ps3_system_bus_device *dev)
}
 
/* Map XDR buffer to RSX */
+   xdr_lpar = ps3_mm_phys_to_lpar(__pa(priv-xdr_buf));
status = lv1_gpu_context_iomap(priv-context_handle, XDR_IOIF,
-  ps3_mm_phys_to_lpar(__pa(priv-xdr_buf)),
-  XDR_BUF_SIZE, 0);
+  xdr_lpar, XDR_BUF_SIZE,
+  CBE_IOPTE_PP_W | CBE_IOPTE_PP_R |
+  CBE_IOPTE_M);
if (status) {
dev_err(dev-core, lv1_gpu_context_iomap failed %d\n,
status);
@@ -711,7 +714,7 @@ static int __devinit ps3vram_probe(struct 
ps3_system_bus_device *dev)
if (!priv-ddr_base) {
dev_err(dev-core, ioremap DDR failed\n);
error = -ENOMEM;
-   goto out_free_context;
+   goto out_unmap_context;
}
 
priv-ctrl = ioremap(ctrl_lpar, 64 * 1024);
@@ -797,6 +800,9 @@ out_unmap_ctrl:
iounmap(priv-ctrl);
 out_unmap_vram:
iounmap(priv-ddr_base);
+out_unmap_context:
+   lv1_gpu_context_iomap(priv-context_handle, XDR_IOIF, xdr_lpar,
+ XDR_BUF_SIZE, CBE_IOPTE_M);
 out_free_context:
lv1_gpu_context_free(priv-context_handle);
 out_free_memory:
@@ -824,6 +830,9 @@ static int ps3vram_remove(struct ps3_system_bus_device *dev)
iounmap(priv-reports);
iounmap(priv-ctrl);
iounmap(priv-ddr_base);
+   lv1_gpu_context_iomap(priv-context_handle, XDR_IOIF,
+ ps3_mm_phys_to_lpar(__pa(priv-xdr_buf)),
+ XDR_BUF_SIZE, CBE_IOPTE_M);
lv1_gpu_context_free(priv-context_handle);
lv1_gpu_memory_free(priv-memory_handle);
ps3_close_hv_device(dev);
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 10/33] powerpc/cell: Extract duplicated IOPTE_* to asm/iommu.h

2009-06-10 Thread Geert Uytterhoeven
Both arch/powerpc/platforms/cell/iommu.c and arch/powerpc/platforms/ps3/mm.c
contain the same Cell IOMMU page table entry definitions. Extract them and move
them to asm/iommu.h, while adding a CBE_ prefix.
This also allows them to be used by drivers.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
---
v2: Add CBE_ prefix

 arch/powerpc/include/asm/iommu.h|   10 
 arch/powerpc/platforms/cell/iommu.c |   37 --
 arch/powerpc/platforms/ps3/mm.c |7 -
 arch/powerpc/platforms/ps3/platform.h   |   10 
 arch/powerpc/platforms/ps3/system-bus.c |   15 +++-
 5 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index 7464c0d..7ead7c1 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -35,6 +35,16 @@
 #define IOMMU_PAGE_MASK   (~((1  IOMMU_PAGE_SHIFT) - 1))
 #define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE)
 
+/* Cell page table entries */
+#define CBE_IOPTE_PP_W 0x8000ul /* protection: write */
+#define CBE_IOPTE_PP_R 0x4000ul /* protection: read */
+#define CBE_IOPTE_M0x2000ul /* coherency required */
+#define CBE_IOPTE_SO_R 0x1000ul /* ordering: writes */
+#define CBE_IOPTE_SO_RW0x1800ul /* ordering: r  w 
*/
+#define CBE_IOPTE_RPN_Mask 0x07fff000ul /* RPN */
+#define CBE_IOPTE_H0x0800ul /* cache hint */
+#define CBE_IOPTE_IOID_Mask0x07fful /* ioid */
+
 /* Boot time flags */
 extern int iommu_is_off;
 extern int iommu_force_on;
diff --git a/arch/powerpc/platforms/cell/iommu.c 
b/arch/powerpc/platforms/cell/iommu.c
index bed4690..5b34fc2 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -100,16 +100,6 @@
 #define IOSTE_PS_1M0x0005ul /*   - 1MB  */
 #define IOSTE_PS_16M   0x0007ul /*   - 16MB */
 
-/* Page table entries */
-#define IOPTE_PP_W 0x8000ul /* protection: write */
-#define IOPTE_PP_R 0x4000ul /* protection: read */
-#define IOPTE_M0x2000ul /* coherency 
required */
-#define IOPTE_SO_R 0x1000ul /* ordering: writes */
-#define IOPTE_SO_RW 0x1800ul /* ordering: r  w */
-#define IOPTE_RPN_Mask 0x07fff000ul /* RPN */
-#define IOPTE_H0x0800ul /* cache hint */
-#define IOPTE_IOID_Mask0x07fful /* ioid */
-
 
 /* IOMMU sizing */
 #define IO_SEGMENT_SHIFT   28
@@ -193,19 +183,21 @@ static int tce_build_cell(struct iommu_table *tbl, long 
index, long npages,
 */
const unsigned long prot = 0xc48;
base_pte =
-   ((prot  (52 + 4 * direction))  (IOPTE_PP_W | IOPTE_PP_R))
-   | IOPTE_M | IOPTE_SO_RW | (window-ioid  IOPTE_IOID_Mask);
+   ((prot  (52 + 4 * direction)) 
+(CBE_IOPTE_PP_W | CBE_IOPTE_PP_R)) |
+   CBE_IOPTE_M | CBE_IOPTE_SO_RW |
+   (window-ioid  CBE_IOPTE_IOID_Mask);
 #else
-   base_pte = IOPTE_PP_W | IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW |
-   (window-ioid  IOPTE_IOID_Mask);
+   base_pte = CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_M |
+   CBE_IOPTE_SO_RW | (window-ioid  CBE_IOPTE_IOID_Mask);
 #endif
if (unlikely(dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs)))
-   base_pte = ~IOPTE_SO_RW;
+   base_pte = ~CBE_IOPTE_SO_RW;
 
io_pte = (unsigned long *)tbl-it_base + (index - tbl-it_offset);
 
for (i = 0; i  npages; i++, uaddr += IOMMU_PAGE_SIZE)
-   io_pte[i] = base_pte | (__pa(uaddr)  IOPTE_RPN_Mask);
+   io_pte[i] = base_pte | (__pa(uaddr)  CBE_IOPTE_RPN_Mask);
 
mb();
 
@@ -231,8 +223,9 @@ static void tce_free_cell(struct iommu_table *tbl, long 
index, long npages)
 #else
/* spider bridge does PCI reads after freeing - insert a mapping
 * to a scratch page instead of an invalid entry */
-   pte = IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW | __pa(window-iommu-pad_page)
-   | (window-ioid  IOPTE_IOID_Mask);
+   pte = CBE_IOPTE_PP_R | CBE_IOPTE_M | CBE_IOPTE_SO_RW |
+   __pa(window-iommu-pad_page) |
+   (window-ioid  CBE_IOPTE_IOID_Mask);
 #endif
 
io_pte = (unsigned long *)tbl-it_base + (index - tbl-it_offset);
@@ -1001,7 +994,7 @@ static void insert_16M_pte(unsigned long addr, unsigned 
long *ptab,
pr_debug(iommu: addr %lx ptab %p segment %lx offset %lx\n,
  addr, ptab, segment, offset);
 
-   ptab[offset] = base_pte | (__pa(addr)  IOPTE_RPN_Mask);
+   ptab[offset] = base_pte | (__pa(addr)  CBE_IOPTE_RPN_Mask);
 }
 
 static void 

[PATCH 16/33] ps3vram: Make ps3vram_priv.reports a void *

2009-06-10 Thread Geert Uytterhoeven
So we can kill a cast.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
 drivers/block/ps3vram.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 5f408c6..fbbdd5c 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -72,7 +72,7 @@ struct ps3vram_priv {
u64 memory_handle;
u64 context_handle;
u32 *ctrl;
-   u32 *reports;
+   void *reports;
u8 *xdr_buf;
 
u32 *fifo_base;
@@ -102,9 +102,9 @@ static char *size = 256M;
 module_param(size, charp, 0);
 MODULE_PARM_DESC(size, memory size);
 
-static u32 *ps3vram_get_notifier(u32 *reports, int notifier)
+static u32 *ps3vram_get_notifier(void *reports, int notifier)
 {
-   return (void *)reports + DMA_NOTIFIER_OFFSET_BASE +
+   return reports + DMA_NOTIFIER_OFFSET_BASE +
   DMA_NOTIFIER_SIZE * notifier;
 }
 
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 18/33] ps3: ps3_system_bus_device - Use dev_[gs]et_drvdata() instead of direct access

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Geoff Levand geoffrey.lev...@am.sony.com
---
 arch/powerpc/include/asm/ps3.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index b9e4987..dcd302f 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -421,12 +421,12 @@ static inline struct ps3_system_bus_driver *
 static inline void ps3_system_bus_set_driver_data(
struct ps3_system_bus_device *dev, void *data)
 {
-   dev-core.driver_data = data;
+   dev_set_drvdata(dev-core, data);
 }
 static inline void *ps3_system_bus_get_driver_data(
struct ps3_system_bus_device *dev)
 {
-   return dev-core.driver_data;
+   return dev_get_drvdata(dev-core);
 }
 
 /* These two need global scope for get_dma_ops(). */
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 14/33] ps3fb: Tear down FB setup during cleanup

2009-06-10 Thread Geert Uytterhoeven
During cleanup, use L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE to tear down the setup
done by L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP.

This allows unloading and reloading of ps3fb while the sound driver keeps the
GPU open.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
---
 arch/powerpc/include/asm/ps3gpu.h |8 
 drivers/video/ps3fb.c |5 -
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/ps3gpu.h 
b/arch/powerpc/include/asm/ps3gpu.h
index 1037efa..b2b8959 100644
--- a/arch/powerpc/include/asm/ps3gpu.h
+++ b/arch/powerpc/include/asm/ps3gpu.h
@@ -31,6 +31,7 @@
 #define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP   0x600
 #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT0x601
 #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC   0x602
+#define L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE   0x603
 
 #define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION  (1ULL  32)
 
@@ -75,4 +76,11 @@ static inline int lv1_gpu_fb_blit(u64 context_handle, u64 
ddr_offset,
 pitch);
 }
 
+static inline int lv1_gpu_fb_close(u64 context_handle)
+{
+   return lv1_gpu_context_attribute(context_handle,
+L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE, 0,
+0, 0, 0);
+}
+
 #endif /* _ASM_POWERPC_PS3GPU_H */
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 13c876c..1baa1c9 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -1123,7 +1123,7 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
 
info = framebuffer_alloc(sizeof(struct ps3fb_par), dev-core);
if (!info)
-   goto err_context_unmap;
+   goto err_context_fb_close;
 
par = info-par;
par-mode_id = ~ps3fb_mode; /* != ps3fb_mode, to trigger change */
@@ -1188,6 +1188,8 @@ err_fb_dealloc:
fb_dealloc_cmap(info-cmap);
 err_framebuffer_release:
framebuffer_release(info);
+err_context_fb_close:
+   lv1_gpu_fb_close(ps3fb.context_handle);
 err_context_unmap:
lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar,
  ps3fb_videomemory.size, CBE_IOPTE_M);
@@ -1233,6 +1235,7 @@ static int ps3fb_shutdown(struct ps3_system_bus_device 
*dev)
info = dev-core.driver_data = NULL;
}
iounmap((u8 __force __iomem *)ps3fb.dinfo);
+   lv1_gpu_fb_close(ps3fb.context_handle);
lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar,
  ps3fb_videomemory.size, CBE_IOPTE_M);
lv1_gpu_context_free(ps3fb.context_handle);
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 17/33] block/ps3: remove driver_data direct access of struct device

2009-06-10 Thread Geert Uytterhoeven
From: Roel Kluin roel.kl...@gmail.com

In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.

[Geert: Use ps3_system_bus_[gs]et_driver_data() for ps3_system_bus_device]

Signed-off-by: Roel Kluin roel.kl...@gmail.com
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
 drivers/block/ps3disk.c |   23 +
 drivers/block/ps3vram.c |   50 ++
 2 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index bccc42b..d5781a8 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -120,7 +120,8 @@ static void ps3disk_scatter_gather(struct 
ps3_storage_device *dev,
 static int ps3disk_submit_request_sg(struct ps3_storage_device *dev,
 struct request *req)
 {
-   struct ps3disk_private *priv = dev-sbd.core.driver_data;
+   struct ps3disk_private *priv =
+   ps3_system_bus_get_driver_data(dev-sbd);
int write = rq_data_dir(req), res;
const char *op = write ? write : read;
u64 start_sector, sectors;
@@ -169,7 +170,8 @@ static int ps3disk_submit_request_sg(struct 
ps3_storage_device *dev,
 static int ps3disk_submit_flush_request(struct ps3_storage_device *dev,
struct request *req)
 {
-   struct ps3disk_private *priv = dev-sbd.core.driver_data;
+   struct ps3disk_private *priv =
+   ps3_system_bus_get_driver_data(dev-sbd);
u64 res;
 
dev_dbg(dev-sbd.core, %s:%u: flush request\n, __func__, __LINE__);
@@ -214,7 +216,8 @@ static void ps3disk_do_request(struct ps3_storage_device 
*dev,
 static void ps3disk_request(struct request_queue *q)
 {
struct ps3_storage_device *dev = q-queuedata;
-   struct ps3disk_private *priv = dev-sbd.core.driver_data;
+   struct ps3disk_private *priv =
+   ps3_system_bus_get_driver_data(dev-sbd);
 
if (priv-req) {
dev_dbg(dev-sbd.core, %s:%u busy\n, __func__, __LINE__);
@@ -247,7 +250,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data)
return IRQ_HANDLED;
}
 
-   priv = dev-sbd.core.driver_data;
+   priv = ps3_system_bus_get_driver_data(dev-sbd);
req = priv-req;
if (!req) {
dev_dbg(dev-sbd.core,
@@ -368,7 +371,8 @@ static void ata_id_c_string(const u16 *id, unsigned char 
*s, unsigned int ofs,
 
 static int ps3disk_identify(struct ps3_storage_device *dev)
 {
-   struct ps3disk_private *priv = dev-sbd.core.driver_data;
+   struct ps3disk_private *priv =
+   ps3_system_bus_get_driver_data(dev-sbd);
struct lv1_ata_cmnd_block ata_cmnd;
u16 *id = dev-bounce_buf;
u64 res;
@@ -449,7 +453,7 @@ static int __devinit ps3disk_probe(struct 
ps3_system_bus_device *_dev)
goto fail;
}
 
-   dev-sbd.core.driver_data = priv;
+   ps3_system_bus_set_driver_data(_dev, priv);
spin_lock_init(priv-lock);
 
dev-bounce_size = BOUNCE_SIZE;
@@ -527,7 +531,7 @@ fail_free_bounce:
kfree(dev-bounce_buf);
 fail_free_priv:
kfree(priv);
-   dev-sbd.core.driver_data = NULL;
+   ps3_system_bus_set_driver_data(_dev, NULL);
 fail:
mutex_lock(ps3disk_mask_mutex);
__clear_bit(devidx, ps3disk_mask);
@@ -538,7 +542,8 @@ fail:
 static int ps3disk_remove(struct ps3_system_bus_device *_dev)
 {
struct ps3_storage_device *dev = to_ps3_storage_device(_dev-core);
-   struct ps3disk_private *priv = dev-sbd.core.driver_data;
+   struct ps3disk_private *priv =
+   ps3_system_bus_get_driver_data(dev-sbd);
 
mutex_lock(ps3disk_mask_mutex);
__clear_bit(MINOR(disk_devt(priv-gendisk)) / PS3DISK_MINORS,
@@ -552,7 +557,7 @@ static int ps3disk_remove(struct ps3_system_bus_device 
*_dev)
ps3stor_teardown(dev);
kfree(dev-bounce_buf);
kfree(priv);
-   dev-sbd.core.driver_data = NULL;
+   ps3_system_bus_set_driver_data(_dev, NULL);
return 0;
 }
 
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index fbbdd5c..fcecc7f 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -110,7 +110,7 @@ static u32 *ps3vram_get_notifier(void *reports, int 
notifier)
 
 static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev)
 {
-   struct ps3vram_priv *priv = dev-core.driver_data;
+   struct ps3vram_priv *priv = ps3_system_bus_get_driver_data(dev);
u32 *notify = ps3vram_get_notifier(priv-reports, NOTIFIER);
int i;
 
@@ -121,7 +121,7 @@ static void 

[PATCH 05/33] block: Add bio_list_peek()

2009-06-10 Thread Geert Uytterhoeven
Introduce bio_list_peek(), to obtain a pointer to the first bio on the bio_list
without actually removing it from the list. This is needed when you want to
serialize based on the list being empty or not.

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Jens Axboe ax...@kernel.dk
---
 include/linux/bio.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/bio.h b/include/linux/bio.h
index 7b214fd..618bb7d 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -590,6 +590,11 @@ static inline void bio_list_merge_head(struct bio_list *bl,
bl-head = bl2-head;
 }
 
+static inline struct bio *bio_list_peek(struct bio_list *bl)
+{
+   return bl-head;
+}
+
 static inline struct bio *bio_list_pop(struct bio_list *bl)
 {
struct bio *bio = bl-head;
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 22/33] ps3: ps3fb - Use ps3_system_bus_[gs]et_drvdata() instead of direct access

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
---
 drivers/video/ps3fb.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 1baa1c9..c0af638 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -1166,7 +1166,7 @@ static int __devinit ps3fb_probe(struct 
ps3_system_bus_device *dev)
if (retval  0)
goto err_fb_dealloc;
 
-   dev-core.driver_data = info;
+   ps3_system_bus_set_drvdata(dev, info);
 
dev_info(info-device, %s %s, using %u KiB of video memory\n,
 dev_driver_string(info-dev), dev_name(info-dev),
@@ -1211,7 +1211,7 @@ err:
 
 static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
 {
-   struct fb_info *info = dev-core.driver_data;
+   struct fb_info *info = ps3_system_bus_get_drvdata(dev);
u64 xdr_lpar = ps3_mm_phys_to_lpar(__pa(ps3fb_videomemory.address));
 
dev_dbg(dev-core,  - %s:%d\n, __func__, __LINE__);
@@ -1232,7 +1232,7 @@ static int ps3fb_shutdown(struct ps3_system_bus_device 
*dev)
unregister_framebuffer(info);
fb_dealloc_cmap(info-cmap);
framebuffer_release(info);
-   info = dev-core.driver_data = NULL;
+   ps3_system_bus_set_drvdata(dev, NULL);
}
iounmap((u8 __force __iomem *)ps3fb.dinfo);
lv1_gpu_fb_close(ps3fb.context_handle);
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 13/33] ps3fb/vram: Extract common GPU stuff into asm/ps3gpu.h

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-fbdev-de...@lists.sourceforge.net
Cc: Jim Paris j...@jtan.com
Cc: Jens Axboe ax...@kernel.dk
---
 arch/powerpc/include/asm/ps3.h |3 -
 arch/powerpc/include/asm/ps3gpu.h  |   78 
 arch/powerpc/platforms/ps3/setup.c |1 +
 drivers/block/ps3vram.c|   21 +++--
 drivers/ps3/ps3av_cmd.c|3 +-
 drivers/video/ps3fb.c  |   72 ++---
 6 files changed, 110 insertions(+), 68 deletions(-)
 create mode 100644 arch/powerpc/include/asm/ps3gpu.h

diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index cdb6fd8..b9e4987 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -520,7 +520,4 @@ void ps3_sync_irq(int node);
 u32 ps3_get_hw_thread_id(int cpu);
 u64 ps3_get_spe_id(void *arg);
 
-/* mutex synchronizing GPU accesses and video mode changes */
-extern struct mutex ps3_gpu_mutex;
-
 #endif
diff --git a/arch/powerpc/include/asm/ps3gpu.h 
b/arch/powerpc/include/asm/ps3gpu.h
new file mode 100644
index 000..1037efa
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3gpu.h
@@ -0,0 +1,78 @@
+/*
+ *  PS3 GPU declarations.
+ *
+ *  Copyright 2009 Sony Corporation
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.
+ *  If not, see http://www.gnu.org/licenses/.
+ */
+
+#ifndef _ASM_POWERPC_PS3GPU_H
+#define _ASM_POWERPC_PS3GPU_H
+
+#include linux/mutex.h
+
+#include asm/lv1call.h
+
+
+#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC   0x101
+#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP   0x102
+
+#define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP   0x600
+#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT0x601
+#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC   0x602
+
+#define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION  (1ULL  32)
+
+#define L1GPU_DISPLAY_SYNC_HSYNC   1
+#define L1GPU_DISPLAY_SYNC_VSYNC   2
+
+
+/* mutex synchronizing GPU accesses and video mode changes */
+extern struct mutex ps3_gpu_mutex;
+
+
+static inline int lv1_gpu_display_sync(u64 context_handle, u64 head,
+  u64 ddr_offset)
+{
+   return lv1_gpu_context_attribute(context_handle,
+L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
+head, ddr_offset, 0, 0);
+}
+
+static inline int lv1_gpu_display_flip(u64 context_handle, u64 head,
+  u64 ddr_offset)
+{
+   return lv1_gpu_context_attribute(context_handle,
+L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP,
+head, ddr_offset, 0, 0);
+}
+
+static inline int lv1_gpu_fb_setup(u64 context_handle, u64 xdr_lpar,
+  u64 xdr_size, u64 ioif_offset)
+{
+   return lv1_gpu_context_attribute(context_handle,
+L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP,
+xdr_lpar, xdr_size, ioif_offset, 0);
+}
+
+static inline int lv1_gpu_fb_blit(u64 context_handle, u64 ddr_offset,
+ u64 ioif_offset, u64 sync_width, u64 pitch)
+{
+   return lv1_gpu_context_attribute(context_handle,
+L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT,
+ddr_offset, ioif_offset, sync_width,
+pitch);
+}
+
+#endif /* _ASM_POWERPC_PS3GPU_H */
diff --git a/arch/powerpc/platforms/ps3/setup.c 
b/arch/powerpc/platforms/ps3/setup.c
index 1a7b5ae..149bea2 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -32,6 +32,7 @@
 #include asm/udbg.h
 #include asm/prom.h
 #include asm/lv1call.h
+#include asm/ps3gpu.h
 
 #include platform.h
 
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 4418d59..7d1c742 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -17,6 +17,7 @@
 #include asm/iommu.h
 #include asm/lv1call.h
 #include asm/ps3.h
+#include asm/ps3gpu.h
 
 
 #define DEVICE_NAMEps3vram
@@ -46,8 +47,6 @@
 #define NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN   0x030c
 #define NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY  0x0104
 
-#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601
-
 #define CACHE_PAGE_PRESENT 1
 #define CACHE_PAGE_DIRTY   2
 
@@ -184,13 +183,10 @@ static void 

[PATCH 25/33] drivers/ps3: Add missing annotations

2009-06-10 Thread Geert Uytterhoeven
probe functions should be __devinit
initialization functions should be __init

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Geoff Levand geoffrey.lev...@am.sony.com
---
 drivers/ps3/ps3-sys-manager.c |2 +-
 drivers/ps3/ps3av.c   |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ps3/ps3-sys-manager.c b/drivers/ps3/ps3-sys-manager.c
index f17513d..88cb740 100644
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -706,7 +706,7 @@ static void ps3_sys_manager_work(struct 
ps3_system_bus_device *dev)
ps3_vuart_read_async(dev, PS3_SM_RX_MSG_LEN_MIN);
 }
 
-static int ps3_sys_manager_probe(struct ps3_system_bus_device *dev)
+static int __devinit ps3_sys_manager_probe(struct ps3_system_bus_device *dev)
 {
int result;
struct ps3_sys_manager_ops ops;
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index 4e4611e..e82d8c9 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -937,7 +937,7 @@ int ps3av_audio_mute(int mute)
 
 EXPORT_SYMBOL_GPL(ps3av_audio_mute);
 
-static int ps3av_probe(struct ps3_system_bus_device *dev)
+static int __devinit ps3av_probe(struct ps3_system_bus_device *dev)
 {
int res;
int id;
@@ -1048,7 +1048,7 @@ static struct ps3_vuart_port_driver ps3av_driver = {
.shutdown = ps3av_shutdown,
 };
 
-static int ps3av_module_init(void)
+static int __init ps3av_module_init(void)
 {
int error;
 
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 21/33] ps3: ps3rom - Use ps3_system_bus_[gs]et_drvdata() instead of direct access

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: linux-s...@vger.kernel.org
Cc: James E.J. Bottomley james.bottom...@hansenpartnership.com
---
 drivers/scsi/ps3rom.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index ca0dd33..db90caf 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -299,7 +299,7 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data)
return IRQ_HANDLED;
}
 
-   host = dev-sbd.core.driver_data;
+   host = ps3_system_bus_get_drvdata(dev-sbd);
priv = shost_priv(host);
cmd = priv-curr_cmd;
 
@@ -387,7 +387,7 @@ static int __devinit ps3rom_probe(struct 
ps3_system_bus_device *_dev)
}
 
priv = shost_priv(host);
-   dev-sbd.core.driver_data = host;
+   ps3_system_bus_set_drvdata(dev-sbd, host);
priv-dev = dev;
 
/* One device/LUN per SCSI bus */
@@ -407,7 +407,7 @@ static int __devinit ps3rom_probe(struct 
ps3_system_bus_device *_dev)
 
 fail_host_put:
scsi_host_put(host);
-   dev-sbd.core.driver_data = NULL;
+   ps3_system_bus_set_drvdata(dev-sbd, NULL);
 fail_teardown:
ps3stor_teardown(dev);
 fail_free_bounce:
@@ -418,12 +418,12 @@ fail_free_bounce:
 static int ps3rom_remove(struct ps3_system_bus_device *_dev)
 {
struct ps3_storage_device *dev = to_ps3_storage_device(_dev-core);
-   struct Scsi_Host *host = dev-sbd.core.driver_data;
+   struct Scsi_Host *host = ps3_system_bus_get_drvdata(dev-sbd);
 
scsi_remove_host(host);
ps3stor_teardown(dev);
scsi_host_put(host);
-   dev-sbd.core.driver_data = NULL;
+   ps3_system_bus_set_drvdata(dev-sbd, NULL);
kfree(dev-bounce_buf);
return 0;
 }
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 20/33] ps3: ps3flash - Use ps3_system_bus_[gs]et_drvdata() instead of direct access

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
---
 drivers/char/ps3flash.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
index afbe456..184e6ed 100644
--- a/drivers/char/ps3flash.c
+++ b/drivers/char/ps3flash.c
@@ -108,7 +108,7 @@ static ssize_t ps3flash_read(struct file *file, char __user 
*buf, size_t count,
 loff_t *pos)
 {
struct ps3_storage_device *dev = ps3flash_dev;
-   struct ps3flash_private *priv = dev-sbd.core.driver_data;
+   struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
u64 size, start_sector, end_sector, offset;
ssize_t sectors_read;
size_t remaining, n;
@@ -173,7 +173,7 @@ static ssize_t ps3flash_write(struct file *file, const char 
__user *buf,
  size_t count, loff_t *pos)
 {
struct ps3_storage_device *dev = ps3flash_dev;
-   struct ps3flash_private *priv = dev-sbd.core.driver_data;
+   struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
u64 size, chunk_sectors, start_write_sector, end_write_sector,
end_read_sector, start_read_sector, head, tail, offset;
ssize_t res;
@@ -366,7 +366,7 @@ static int __devinit ps3flash_probe(struct 
ps3_system_bus_device *_dev)
goto fail;
}
 
-   dev-sbd.core.driver_data = priv;
+   ps3_system_bus_set_drvdata(dev-sbd, priv);
mutex_init(priv-mutex);
 
dev-bounce_size = ps3flash_bounce_buffer.size;
@@ -392,7 +392,7 @@ fail_teardown:
ps3stor_teardown(dev);
 fail_free_priv:
kfree(priv);
-   dev-sbd.core.driver_data = NULL;
+   ps3_system_bus_set_drvdata(dev-sbd, NULL);
 fail:
ps3flash_dev = NULL;
return error;
@@ -404,8 +404,8 @@ static int ps3flash_remove(struct ps3_system_bus_device 
*_dev)
 
misc_deregister(ps3flash_misc);
ps3stor_teardown(dev);
-   kfree(dev-sbd.core.driver_data);
-   dev-sbd.core.driver_data = NULL;
+   kfree(ps3_system_bus_get_drvdata(dev-sbd));
+   ps3_system_bus_set_drvdata(dev-sbd, NULL);
ps3flash_dev = NULL;
return 0;
 }
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 24/33] usb/ps3: Add missing annotations

2009-06-10 Thread Geert Uytterhoeven
probe functions should be __devinit
initialization functions should be __init

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Geoff Levand geoffrey.lev...@am.sony.com
---
 drivers/usb/host/ehci-ps3.c |4 ++--
 drivers/usb/host/ohci-ps3.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index bb870b8..3e8844e 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -76,7 +76,7 @@ static const struct hc_driver ps3_ehci_hc_driver = {
.port_handed_over   = ehci_port_handed_over,
 };
 
-static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
+static int __devinit ps3_ehci_probe(struct ps3_system_bus_device *dev)
 {
int result;
struct usb_hcd *hcd;
@@ -224,7 +224,7 @@ static int ps3_ehci_remove(struct ps3_system_bus_device 
*dev)
return 0;
 }
 
-static int ps3_ehci_driver_register(struct ps3_system_bus_driver *drv)
+static int __init ps3_ehci_driver_register(struct ps3_system_bus_driver *drv)
 {
return firmware_has_feature(FW_FEATURE_PS3_LV1)
? ps3_system_bus_driver_register(drv)
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
index 1d56259..7009504 100644
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -75,7 +75,7 @@ static const struct hc_driver ps3_ohci_hc_driver = {
 #endif
 };
 
-static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
+static int __devinit ps3_ohci_probe(struct ps3_system_bus_device *dev)
 {
int result;
struct usb_hcd *hcd;
@@ -224,7 +224,7 @@ static int ps3_ohci_remove(struct ps3_system_bus_device 
*dev)
return 0;
 }
 
-static int ps3_ohci_driver_register(struct ps3_system_bus_driver *drv)
+static int __init ps3_ohci_driver_register(struct ps3_system_bus_driver *drv)
 {
return firmware_has_feature(FW_FEATURE_PS3_LV1)
? ps3_system_bus_driver_register(drv)
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 29/33] ps3: Correct debug message in dma_ioc0_map_pages()

2009-06-10 Thread Geert Uytterhoeven
It reports the failure of a call to lv1_put_iopte(), not
lv1_map_device_dma_region().

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Geoff Levand geoffrey.lev...@am.sony.com
---
 arch/powerpc/platforms/ps3/mm.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 017b614..846eb8b 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -606,9 +606,8 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, 
unsigned long phys_addr,
   r-ioid,
   iopte_flag);
if (result) {
-   printk(KERN_WARNING %s:%d: lv1_map_device_dma_region 
-   failed: %s\n, __func__, __LINE__,
-   ps3_result(result));
+   pr_warning(%s:%d: lv1_put_iopte failed: %s\n,
+  __func__, __LINE__, ps3_result(result));
goto fail_map;
}
DBG(%s: pg=%d bus=%#lx, lpar=%#lx, ioid=%#x\n, __func__,
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 23/33] net/ps3: gelic - Add missing annotations

2009-06-10 Thread Geert Uytterhoeven
probe functions should be __devinit

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Geoff Levand geoffrey.lev...@am.sony.com
---
 drivers/net/ps3_gelic_net.c  |   22 --
 drivers/net/ps3_gelic_wireless.c |6 +++---
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 2b38f39..d1a5fb4 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -214,9 +214,10 @@ static void gelic_card_free_chain(struct gelic_card *card,
  *
  * returns 0 on success, 0 on failure
  */
-static int gelic_card_init_chain(struct gelic_card *card,
-struct gelic_descr_chain *chain,
-struct gelic_descr *start_descr, int no)
+static int __devinit gelic_card_init_chain(struct gelic_card *card,
+  struct gelic_descr_chain *chain,
+  struct gelic_descr *start_descr,
+  int no)
 {
int i;
struct gelic_descr *descr;
@@ -407,7 +408,7 @@ rewind:
  *
  * returns 0 on success,  0 on failure
  */
-static int gelic_card_alloc_rx_skbs(struct gelic_card *card)
+static int __devinit gelic_card_alloc_rx_skbs(struct gelic_card *card)
 {
struct gelic_descr_chain *chain;
int ret;
@@ -1422,8 +1423,8 @@ static const struct net_device_ops gelic_netdevice_ops = {
  *
  * fills out function pointers in the net_device structure
  */
-static void gelic_ether_setup_netdev_ops(struct net_device *netdev,
-struct napi_struct *napi)
+static void __devinit gelic_ether_setup_netdev_ops(struct net_device *netdev,
+  struct napi_struct *napi)
 {
netdev-watchdog_timeo = GELIC_NET_WATCHDOG_TIMEOUT;
/* NAPI */
@@ -1443,7 +1444,8 @@ static void gelic_ether_setup_netdev_ops(struct 
net_device *netdev,
  * gelic_ether_setup_netdev initializes the net_device structure
  * and register it.
  **/
-int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
+int __devinit gelic_net_setup_netdev(struct net_device *netdev,
+struct gelic_card *card)
 {
int status;
u64 v1, v2;
@@ -1491,7 +1493,7 @@ int gelic_net_setup_netdev(struct net_device *netdev, 
struct gelic_card *card)
  * the card and net_device structures are linked to each other
  */
 #define GELIC_ALIGN (32)
-static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
+static struct gelic_card * __devinit gelic_alloc_card_net(struct net_device 
**netdev)
 {
struct gelic_card *card;
struct gelic_port *port;
@@ -1542,7 +1544,7 @@ static struct gelic_card *gelic_alloc_card_net(struct 
net_device **netdev)
return card;
 }
 
-static void gelic_card_get_vlan_info(struct gelic_card *card)
+static void __devinit gelic_card_get_vlan_info(struct gelic_card *card)
 {
u64 v1, v2;
int status;
@@ -1616,7 +1618,7 @@ static void gelic_card_get_vlan_info(struct gelic_card 
*card)
 /**
  * ps3_gelic_driver_probe - add a device to the control of this driver
  */
-static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
+static int __devinit ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 {
struct gelic_card *card;
struct net_device *netdev;
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index 4f3ada6..b6b3ca9 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -2442,7 +2442,7 @@ static const struct iw_handler_def 
gelic_wl_wext_handler_def = {
 #endif
 };
 
-static struct net_device *gelic_wl_alloc(struct gelic_card *card)
+static struct net_device * __devinit gelic_wl_alloc(struct gelic_card *card)
 {
struct net_device *netdev;
struct gelic_port *port;
@@ -2722,7 +2722,7 @@ static struct ethtool_ops gelic_wl_ethtool_ops = {
.set_rx_csum= gelic_net_set_rx_csum,
 };
 
-static void gelic_wl_setup_netdev_ops(struct net_device *netdev)
+static void __devinit gelic_wl_setup_netdev_ops(struct net_device *netdev)
 {
struct gelic_wl_info *wl;
wl = port_wl(netdev_priv(netdev));
@@ -2738,7 +2738,7 @@ static void gelic_wl_setup_netdev_ops(struct net_device 
*netdev)
 /*
  * driver probe/remove
  */
-int gelic_wl_driver_probe(struct gelic_card *card)
+int __devinit gelic_wl_driver_probe(struct gelic_card *card)
 {
int ret;
struct net_device *netdev;
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 26/33] sound/ps3: Fix checkpatch issues

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: alsa-de...@alsa-project.org
Cc: Takashi Iwai ti...@suse.de
---
 sound/ppc/snd_ps3.c |   32 +++-
 1 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
index f361c26..d660b0f 100644
--- a/sound/ppc/snd_ps3.c
+++ b/sound/ppc/snd_ps3.c
@@ -165,8 +165,7 @@ static const struct snd_pcm_hardware snd_ps3_pcm_hw = {
.fifo_size = PS3_AUDIO_FIFO_SIZE
 };
 
-static struct snd_pcm_ops snd_ps3_pcm_spdif_ops =
-{
+static struct snd_pcm_ops snd_ps3_pcm_spdif_ops = {
.open = snd_ps3_pcm_open,
.close = snd_ps3_pcm_close,
.prepare = snd_ps3_pcm_prepare,
@@ -183,7 +182,7 @@ static int snd_ps3_verify_dma_stop(struct snd_ps3_card_info 
*card,
int dma_ch, done, retries, stop_forced = 0;
uint32_t status;
 
-   for (dma_ch = 0; dma_ch  8; dma_ch ++) {
+   for (dma_ch = 0; dma_ch  8; dma_ch++) {
retries = count;
do {
status = read_reg(PS3_AUDIO_KICK(dma_ch)) 
@@ -259,9 +258,7 @@ static void snd_ps3_kick_dma(struct snd_ps3_card_info *card)
 /*
  * convert virtual addr to ioif bus addr.
  */
-static dma_addr_t v_to_bus(struct snd_ps3_card_info *card,
-  void * paddr,
-  int ch)
+static dma_addr_t v_to_bus(struct snd_ps3_card_info *card, void *paddr, int ch)
 {
return card-dma_start_bus_addr[ch] +
(paddr - card-dma_start_vaddr[ch]);
@@ -321,7 +318,7 @@ static int snd_ps3_program_dma(struct snd_ps3_card_info 
*card,
spin_lock_irqsave(card-dma_lock, irqsave);
for (ch = 0; ch  2; ch++) {
start_vaddr = card-dma_next_transfer_vaddr[0];
-   for (stage = 0; stage  fill_stages; stage ++) {
+   for (stage = 0; stage  fill_stages; stage++) {
dma_ch = stage * 2 + ch;
if (silent)
dma_addr = card-null_buffer_start_dma_addr;
@@ -619,7 +616,7 @@ static int snd_ps3_change_avsetting(struct 
snd_ps3_card_info *card)
  PS3_AUDIO_AO_3WMCTRL_ASOEN(2) |
  PS3_AUDIO_AO_3WMCTRL_ASOEN(3)),
0);
-   wmb();  /* ensure the hardware sees the change */
+   wmb();  /* ensure the hardware sees the change */
/* wait for actually stopped */
retries = 1000;
while ((read_reg(PS3_AUDIO_AO_3WMCTRL) 
@@ -798,20 +795,20 @@ static struct snd_kcontrol_new spdif_ctls[] = {
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
-   .name = SNDRV_CTL_NAME_IEC958(,PLAYBACK,CON_MASK),
+   .name = SNDRV_CTL_NAME_IEC958(, PLAYBACK, CON_MASK),
.info = snd_ps3_spdif_mask_info,
.get = snd_ps3_spdif_cmask_get,
},
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
-   .name = SNDRV_CTL_NAME_IEC958(,PLAYBACK,PRO_MASK),
+   .name = SNDRV_CTL_NAME_IEC958(, PLAYBACK, PRO_MASK),
.info = snd_ps3_spdif_mask_info,
.get = snd_ps3_spdif_pmask_get,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
-   .name = SNDRV_CTL_NAME_IEC958(,PLAYBACK,DEFAULT),
+   .name = SNDRV_CTL_NAME_IEC958(, PLAYBACK, DEFAULT),
.info = snd_ps3_spdif_mask_info,
.get = snd_ps3_spdif_default_get,
.put = snd_ps3_spdif_default_put,
@@ -1020,11 +1017,12 @@ static int __init snd_ps3_driver_probe(struct 
ps3_system_bus_device *dev)
 * its size should be lager than PS3_AUDIO_FIFO_STAGE_SIZE * 2
 * PAGE_SIZE is enogh
 */
-   if (!(the_card.null_buffer_start_vaddr =
- dma_alloc_coherent(the_card.ps3_dev-core,
-PAGE_SIZE,
-the_card.null_buffer_start_dma_addr,
-GFP_KERNEL))) {
+   the_card.null_buffer_start_vaddr =
+   dma_alloc_coherent(the_card.ps3_dev-core,
+  PAGE_SIZE,
+  the_card.null_buffer_start_dma_addr,
+  GFP_KERNEL);
+   if (!the_card.null_buffer_start_vaddr) {
pr_info(%s: nullbuffer alloc failed\n, __func__);
goto clean_preallocate;
}
@@ -1148,7 +1146,7 @@ static irqreturn_t snd_ps3_interrupt(int irq, void 
*dev_id)
SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL :
SND_PS3_DMA_FILLTYPE_SILENT_RUNNING);
snd_ps3_kick_dma(card);
-   card-silent --;
+   card-silent--;
} else {

[PATCH 33/33] ps3flash: Always read chunks of 256 KiB, and cache them

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
---
It slows down small reads, but do we care?

 drivers/char/ps3flash.c |   47 +--
 1 files changed, 17 insertions(+), 30 deletions(-)

diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
index d884d31..f424d39 100644
--- a/drivers/char/ps3flash.c
+++ b/drivers/char/ps3flash.c
@@ -41,10 +41,11 @@ struct ps3flash_private {
 static struct ps3_storage_device *ps3flash_dev;
 
 static int ps3flash_read_write_sectors(struct ps3_storage_device *dev,
-  u64 lpar, u64 start_sector, u64 sectors,
-  int write)
+  u64 start_sector, int write)
 {
-   u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors,
+   struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
+   u64 res = ps3stor_read_write_sectors(dev, dev-bounce_lpar,
+start_sector, priv-chunk_sectors,
 write);
if (res) {
dev_err(dev-sbd.core, %s:%u: %s failed 0x%llx\n, __func__,
@@ -62,8 +63,7 @@ static int ps3flash_writeback(struct ps3_storage_device *dev)
if (!priv-dirty || priv-tag  0)
return 0;
 
-   res = ps3flash_read_write_sectors(dev, dev-bounce_lpar, priv-tag,
- priv-chunk_sectors, 1);
+   res = ps3flash_read_write_sectors(dev, priv-tag, 1);
if (res)
return res;
 
@@ -71,17 +71,12 @@ static int ps3flash_writeback(struct ps3_storage_device 
*dev)
return 0;
 }
 
-static int ps3flash_fetch(struct ps3_storage_device *dev, u64 start_sector,
- u64 sectors)
+static int ps3flash_fetch(struct ps3_storage_device *dev, u64 start_sector)
 {
struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
-   unsigned int tag, offset;
-   u64 lpar;
int res;
 
-   offset = start_sector % priv-chunk_sectors;
-   tag = start_sector - offset;
-   if (tag == priv-tag)
+   if (start_sector == priv-tag)
return 0;
 
res = ps3flash_writeback(dev);
@@ -90,15 +85,11 @@ static int ps3flash_fetch(struct ps3_storage_device *dev, 
u64 start_sector,
 
priv-tag = -1;
 
-   lpar = dev-bounce_lpar + offset * dev-blk_size;
-   res = ps3flash_read_write_sectors(dev, lpar, start_sector, sectors, 0);
+   res = ps3flash_read_write_sectors(dev, start_sector, 0);
if (res)
return res;
 
-   /* We don't bother caching reads smaller than the chunk size */
-   if (sectors == priv-chunk_sectors)
-   priv-tag = tag;
-
+   priv-tag = start_sector;
return 0;
 }
 
@@ -134,7 +125,7 @@ static ssize_t ps3flash_read(char __user *userbuf, void 
*kernelbuf,
 {
struct ps3_storage_device *dev = ps3flash_dev;
struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
-   u64 size, start_sector, end_sector, offset, sectors;
+   u64 size, sector, offset;
int res;
size_t remaining, n;
const void *src;
@@ -154,24 +145,20 @@ static ssize_t ps3flash_read(char __user *userbuf, void 
*kernelbuf,
count = size - *pos;
}
 
-   start_sector = *pos / dev-blk_size;
+   sector = *pos / dev-bounce_size * priv-chunk_sectors;
offset = *pos % dev-bounce_size;
-   end_sector = DIV_ROUND_UP(*pos + count, dev-blk_size);
 
remaining = count;
do {
-   sectors = min(end_sector - start_sector,
- priv-chunk_sectors -
- start_sector % priv-chunk_sectors);
+   n = min_t(u64, remaining, dev-bounce_size - offset);
+   src = dev-bounce_buf + offset;
 
mutex_lock(priv-mutex);
 
-   res = ps3flash_fetch(dev, start_sector, sectors);
+   res = ps3flash_fetch(dev, sector);
if (res)
goto fail;
 
-   n = min_t(u64, remaining, dev-bounce_size - offset);
-   src = dev-bounce_buf + offset;
dev_dbg(dev-sbd.core,
%s:%u: copy %lu bytes from 0x%p to U0x%p/K0x%p\n,
__func__, __LINE__, n, src, userbuf, kernelbuf);
@@ -191,7 +178,7 @@ static ssize_t ps3flash_read(char __user *userbuf, void 
*kernelbuf,
 
*pos += n;
remaining -= n;
-   start_sector += sectors;
+   sector += priv-chunk_sectors;
offset = 0;
} while (remaining  0);
 
@@ -233,17 +220,17 @@ static ssize_t ps3flash_write(const char __user *userbuf,
remaining = count;
do {
n = min_t(u64, remaining, dev-bounce_size - offset);
+   dst = dev-bounce_buf + offset;
 
  

[PATCH 28/33] sound/ps3: Correct existing and add missing annotations

2009-06-10 Thread Geert Uytterhoeven
probe functions should be __devinit

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: alsa-de...@alsa-project.org
Cc: Takashi Iwai ti...@suse.de
---
 sound/ppc/snd_ps3.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
index cd9109a..53c81a5 100644
--- a/sound/ppc/snd_ps3.c
+++ b/sound/ppc/snd_ps3.c
@@ -785,7 +785,7 @@ static struct snd_pcm_ops snd_ps3_pcm_spdif_ops = {
 };
 
 
-static int snd_ps3_map_mmio(void)
+static int __devinit snd_ps3_map_mmio(void)
 {
the_card.mapped_mmio_vaddr =
ioremap(the_card.ps3_dev-m_region-bus_addr,
@@ -807,7 +807,7 @@ static void snd_ps3_unmap_mmio(void)
the_card.mapped_mmio_vaddr = NULL;
 }
 
-static int snd_ps3_allocate_irq(void)
+static int __devinit snd_ps3_allocate_irq(void)
 {
int ret;
u64 lpar_addr, lpar_size;
@@ -865,7 +865,7 @@ static void snd_ps3_free_irq(void)
ps3_irq_plug_destroy(the_card.irq_no);
 }
 
-static void snd_ps3_audio_set_base_addr(uint64_t ioaddr_start)
+static void __devinit snd_ps3_audio_set_base_addr(uint64_t ioaddr_start)
 {
uint64_t val;
int ret;
@@ -881,7 +881,7 @@ static void snd_ps3_audio_set_base_addr(uint64_t 
ioaddr_start)
ret);
 }
 
-static void snd_ps3_audio_fixup(struct snd_ps3_card_info *card)
+static void __devinit snd_ps3_audio_fixup(struct snd_ps3_card_info *card)
 {
/*
 * avsetting driver seems to never change the followings
@@ -905,7 +905,7 @@ static void snd_ps3_audio_fixup(struct snd_ps3_card_info 
*card)
   PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT);
 }
 
-static int snd_ps3_init_avsetting(struct snd_ps3_card_info *card)
+static int __devinit snd_ps3_init_avsetting(struct snd_ps3_card_info *card)
 {
int ret;
pr_debug(%s: start\n, __func__);
@@ -927,7 +927,7 @@ static int snd_ps3_init_avsetting(struct snd_ps3_card_info 
*card)
return ret;
 }
 
-static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
+static int __devinit snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
 {
int i, ret;
u64 lpar_addr, lpar_size;
-- 
1.6.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 27/33] sound/ps3: Restructure driver source

2009-06-10 Thread Geert Uytterhoeven
Sort includes, and reorder code so we can kill the forward declarations

No functional changes

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: alsa-de...@alsa-project.org
Cc: Takashi Iwai ti...@suse.de
---
 sound/ppc/snd_ps3.c |  621 ---
 1 files changed, 288 insertions(+), 333 deletions(-)

diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
index d660b0f..cd9109a 100644
--- a/sound/ppc/snd_ps3.c
+++ b/sound/ppc/snd_ps3.c
@@ -18,80 +18,30 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include linux/dma-mapping.h
+#include linux/dmapool.h
 #include linux/init.h
-#include linux/slab.h
-#include linux/io.h
 #include linux/interrupt.h
+#include linux/io.h
+#include linux/slab.h
+
+#include sound/asound.h
+#include sound/control.h
 #include sound/core.h
 #include sound/initval.h
-#include sound/pcm.h
-#include sound/asound.h
 #include sound/memalloc.h
+#include sound/pcm.h
 #include sound/pcm_params.h
-#include sound/control.h
-#include linux/dmapool.h
-#include linux/dma-mapping.h
-#include asm/firmware.h
+
 #include asm/dma.h
+#include asm/firmware.h
 #include asm/lv1call.h
 #include asm/ps3.h
 #include asm/ps3av.h
 
-#include snd_ps3_reg.h
 #include snd_ps3.h
+#include snd_ps3_reg.h
 
-MODULE_LICENSE(GPL v2);
-MODULE_DESCRIPTION(PS3 sound driver);
-MODULE_AUTHOR(Sony Computer Entertainment Inc.);
-
-/* module  entries */
-static int __init snd_ps3_init(void);
-static void __exit snd_ps3_exit(void);
-
-/* ALSA snd driver ops */
-static int snd_ps3_pcm_open(struct snd_pcm_substream *substream);
-static int snd_ps3_pcm_close(struct snd_pcm_substream *substream);
-static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream);
-static int snd_ps3_pcm_trigger(struct snd_pcm_substream *substream,
-int cmd);
-static snd_pcm_uframes_t snd_ps3_pcm_pointer(struct snd_pcm_substream
-*substream);
-static int snd_ps3_pcm_hw_params(struct snd_pcm_substream *substream,
-struct snd_pcm_hw_params *hw_params);
-static int snd_ps3_pcm_hw_free(struct snd_pcm_substream *substream);
-
-
-/* ps3_system_bus_driver entries */
-static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev);
-static int snd_ps3_driver_remove(struct ps3_system_bus_device *dev);
-
-/* address setup */
-static int snd_ps3_map_mmio(void);
-static void snd_ps3_unmap_mmio(void);
-static int snd_ps3_allocate_irq(void);
-static void snd_ps3_free_irq(void);
-static void snd_ps3_audio_set_base_addr(uint64_t ioaddr_start);
-
-/* interrupt handler */
-static irqreturn_t snd_ps3_interrupt(int irq, void *dev_id);
-
-
-/* set sampling rate/format */
-static int snd_ps3_set_avsetting(struct snd_pcm_substream *substream);
-/* take effect parameter change */
-static int snd_ps3_change_avsetting(struct snd_ps3_card_info *card);
-/* initialize avsetting and take it effect */
-static int snd_ps3_init_avsetting(struct snd_ps3_card_info *card);
-/* setup dma */
-static int snd_ps3_program_dma(struct snd_ps3_card_info *card,
-  enum snd_ps3_dma_filltype filltype);
-static void snd_ps3_wait_for_dma_stop(struct snd_ps3_card_info *card);
-
-static dma_addr_t v_to_bus(struct snd_ps3_card_info *, void  *vaddr, int ch);
-
-
-module_init(snd_ps3_init);
-module_exit(snd_ps3_exit);
 
 /*
  * global
@@ -165,17 +115,6 @@ static const struct snd_pcm_hardware snd_ps3_pcm_hw = {
.fifo_size = PS3_AUDIO_FIFO_SIZE
 };
 
-static struct snd_pcm_ops snd_ps3_pcm_spdif_ops = {
-   .open = snd_ps3_pcm_open,
-   .close = snd_ps3_pcm_close,
-   .prepare = snd_ps3_pcm_prepare,
-   .ioctl = snd_pcm_lib_ioctl,
-   .trigger = snd_ps3_pcm_trigger,
-   .pointer = snd_ps3_pcm_pointer,
-   .hw_params = snd_ps3_pcm_hw_params,
-   .hw_free = snd_ps3_pcm_hw_free
-};
-
 static int snd_ps3_verify_dma_stop(struct snd_ps3_card_info *card,
   int count, int force_stop)
 {
@@ -369,6 +308,71 @@ static int snd_ps3_program_dma(struct snd_ps3_card_info 
*card,
 }
 
 /*
+ * Interrupt handler
+ */
+static irqreturn_t snd_ps3_interrupt(int irq, void *dev_id)
+{
+
+   uint32_t port_intr;
+   int underflow_occured = 0;
+   struct snd_ps3_card_info *card = dev_id;
+
+   if (!card-running) {
+   update_reg(PS3_AUDIO_AX_IS, 0);
+   update_reg(PS3_AUDIO_INTR_0, 0);
+   return IRQ_HANDLED;
+   }
+
+   port_intr = read_reg(PS3_AUDIO_AX_IS);
+   /*
+*serial buffer empty detected (every 4 times),
+*program next dma and kick it
+*/
+   if (port_intr  PS3_AUDIO_AX_IE_ASOBEIE(0)) {
+   write_reg(PS3_AUDIO_AX_IS, PS3_AUDIO_AX_IE_ASOBEIE(0));
+   if (port_intr  PS3_AUDIO_AX_IE_ASOBUIE(0)) {
+   write_reg(PS3_AUDIO_AX_IS, port_intr);
+   

[PATCH 32/33] ps3flash: Cache the last accessed FLASH chunk

2009-06-10 Thread Geert Uytterhoeven
Add support for caching, to reduce FLASH wear when writing using small
blocksizes. As we also don't care anymore about heads and tails in case of
partial writes, this greatly simplifies the code for handling writes.

Note: We don't bother caching reads smaller than the FLASH chunk size
(256 KiB).

Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
---
 drivers/char/ps3flash.c |  209 +++
 1 files changed, 104 insertions(+), 105 deletions(-)

diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
index f7f21f4..d884d31 100644
--- a/drivers/char/ps3flash.c
+++ b/drivers/char/ps3flash.c
@@ -33,13 +33,16 @@
 
 struct ps3flash_private {
struct mutex mutex; /* Bounce buffer mutex */
+   u64 chunk_sectors;
+   int tag;/* Start sector of buffer, -1 if invalid */
+   bool dirty;
 };
 
 static struct ps3_storage_device *ps3flash_dev;
 
-static ssize_t ps3flash_read_write_sectors(struct ps3_storage_device *dev,
-  u64 lpar, u64 start_sector,
-  u64 sectors, int write)
+static int ps3flash_read_write_sectors(struct ps3_storage_device *dev,
+  u64 lpar, u64 start_sector, u64 sectors,
+  int write)
 {
u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors,
 write);
@@ -48,33 +51,55 @@ static ssize_t ps3flash_read_write_sectors(struct 
ps3_storage_device *dev,
__LINE__, write ? write : read, res);
return -EIO;
}
-   return sectors;
+   return 0;
 }
 
-static ssize_t ps3flash_read_sectors(struct ps3_storage_device *dev,
-u64 start_sector, u64 sectors,
-unsigned int sector_offset)
+static int ps3flash_writeback(struct ps3_storage_device *dev)
 {
-   u64 max_sectors, lpar;
+   struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
+   int res;
 
-   max_sectors = dev-bounce_size / dev-blk_size;
-   if (sectors  max_sectors) {
-   dev_dbg(dev-sbd.core, %s:%u Limiting sectors to %llu\n,
-   __func__, __LINE__, max_sectors);
-   sectors = max_sectors;
-   }
+   if (!priv-dirty || priv-tag  0)
+   return 0;
+
+   res = ps3flash_read_write_sectors(dev, dev-bounce_lpar, priv-tag,
+ priv-chunk_sectors, 1);
+   if (res)
+   return res;
 
-   lpar = dev-bounce_lpar + sector_offset * dev-blk_size;
-   return ps3flash_read_write_sectors(dev, lpar, start_sector, sectors,
-  0);
+   priv-dirty = false;
+   return 0;
 }
 
-static ssize_t ps3flash_write_chunk(struct ps3_storage_device *dev,
-   u64 start_sector)
+static int ps3flash_fetch(struct ps3_storage_device *dev, u64 start_sector,
+ u64 sectors)
 {
-   u64 sectors = dev-bounce_size / dev-blk_size;
-   return ps3flash_read_write_sectors(dev, dev-bounce_lpar, start_sector,
- sectors, 1);
+   struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
+   unsigned int tag, offset;
+   u64 lpar;
+   int res;
+
+   offset = start_sector % priv-chunk_sectors;
+   tag = start_sector - offset;
+   if (tag == priv-tag)
+   return 0;
+
+   res = ps3flash_writeback(dev);
+   if (res)
+   return res;
+
+   priv-tag = -1;
+
+   lpar = dev-bounce_lpar + offset * dev-blk_size;
+   res = ps3flash_read_write_sectors(dev, lpar, start_sector, sectors, 0);
+   if (res)
+   return res;
+
+   /* We don't bother caching reads smaller than the chunk size */
+   if (sectors == priv-chunk_sectors)
+   priv-tag = tag;
+
+   return 0;
 }
 
 static loff_t ps3flash_llseek(struct file *file, loff_t offset, int origin)
@@ -109,8 +134,8 @@ static ssize_t ps3flash_read(char __user *userbuf, void 
*kernelbuf,
 {
struct ps3_storage_device *dev = ps3flash_dev;
struct ps3flash_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
-   u64 size, start_sector, end_sector, offset;
-   ssize_t sectors_read;
+   u64 size, start_sector, end_sector, offset, sectors;
+   int res;
size_t remaining, n;
const void *src;
 
@@ -130,30 +155,29 @@ static ssize_t ps3flash_read(char __user *userbuf, void 
*kernelbuf,
}
 
start_sector = *pos / dev-blk_size;
-   offset = *pos % dev-blk_size;
+   offset = *pos % dev-bounce_size;
end_sector = DIV_ROUND_UP(*pos + count, dev-blk_size);
 
remaining = count;
do {
+   sectors = min(end_sector - start_sector,
+   

[PATCH 19/33] ps3: shorten ps3_system_bus_[gs]et_driver_data to ps3_system_bus_[gs]et_drvdata

2009-06-10 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
Cc: Geoff Levand geoffrey.lev...@am.sony.com
Cc: Jim Paris j...@jtan.com
---
 arch/powerpc/include/asm/ps3.h |4 +-
 drivers/block/ps3disk.c|   23 +++---
 drivers/block/ps3vram.c|   48 
 drivers/net/ps3_gelic_net.c|8 +++---
 drivers/usb/host/ehci-ps3.c|7 ++---
 drivers/usb/host/ohci-ps3.c|7 ++---
 6 files changed, 45 insertions(+), 52 deletions(-)

diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index dcd302f..7660694 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -418,12 +418,12 @@ static inline struct ps3_system_bus_driver *
  * @data: Data to set
  */
 
-static inline void ps3_system_bus_set_driver_data(
+static inline void ps3_system_bus_set_drvdata(
struct ps3_system_bus_device *dev, void *data)
 {
dev_set_drvdata(dev-core, data);
 }
-static inline void *ps3_system_bus_get_driver_data(
+static inline void *ps3_system_bus_get_drvdata(
struct ps3_system_bus_device *dev)
 {
return dev_get_drvdata(dev-core);
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index d5781a8..bca99da 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -120,8 +120,7 @@ static void ps3disk_scatter_gather(struct 
ps3_storage_device *dev,
 static int ps3disk_submit_request_sg(struct ps3_storage_device *dev,
 struct request *req)
 {
-   struct ps3disk_private *priv =
-   ps3_system_bus_get_driver_data(dev-sbd);
+   struct ps3disk_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
int write = rq_data_dir(req), res;
const char *op = write ? write : read;
u64 start_sector, sectors;
@@ -170,8 +169,7 @@ static int ps3disk_submit_request_sg(struct 
ps3_storage_device *dev,
 static int ps3disk_submit_flush_request(struct ps3_storage_device *dev,
struct request *req)
 {
-   struct ps3disk_private *priv =
-   ps3_system_bus_get_driver_data(dev-sbd);
+   struct ps3disk_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
u64 res;
 
dev_dbg(dev-sbd.core, %s:%u: flush request\n, __func__, __LINE__);
@@ -216,8 +214,7 @@ static void ps3disk_do_request(struct ps3_storage_device 
*dev,
 static void ps3disk_request(struct request_queue *q)
 {
struct ps3_storage_device *dev = q-queuedata;
-   struct ps3disk_private *priv =
-   ps3_system_bus_get_driver_data(dev-sbd);
+   struct ps3disk_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
 
if (priv-req) {
dev_dbg(dev-sbd.core, %s:%u busy\n, __func__, __LINE__);
@@ -250,7 +247,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data)
return IRQ_HANDLED;
}
 
-   priv = ps3_system_bus_get_driver_data(dev-sbd);
+   priv = ps3_system_bus_get_drvdata(dev-sbd);
req = priv-req;
if (!req) {
dev_dbg(dev-sbd.core,
@@ -371,8 +368,7 @@ static void ata_id_c_string(const u16 *id, unsigned char 
*s, unsigned int ofs,
 
 static int ps3disk_identify(struct ps3_storage_device *dev)
 {
-   struct ps3disk_private *priv =
-   ps3_system_bus_get_driver_data(dev-sbd);
+   struct ps3disk_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
struct lv1_ata_cmnd_block ata_cmnd;
u16 *id = dev-bounce_buf;
u64 res;
@@ -453,7 +449,7 @@ static int __devinit ps3disk_probe(struct 
ps3_system_bus_device *_dev)
goto fail;
}
 
-   ps3_system_bus_set_driver_data(_dev, priv);
+   ps3_system_bus_set_drvdata(_dev, priv);
spin_lock_init(priv-lock);
 
dev-bounce_size = BOUNCE_SIZE;
@@ -531,7 +527,7 @@ fail_free_bounce:
kfree(dev-bounce_buf);
 fail_free_priv:
kfree(priv);
-   ps3_system_bus_set_driver_data(_dev, NULL);
+   ps3_system_bus_set_drvdata(_dev, NULL);
 fail:
mutex_lock(ps3disk_mask_mutex);
__clear_bit(devidx, ps3disk_mask);
@@ -542,8 +538,7 @@ fail:
 static int ps3disk_remove(struct ps3_system_bus_device *_dev)
 {
struct ps3_storage_device *dev = to_ps3_storage_device(_dev-core);
-   struct ps3disk_private *priv =
-   ps3_system_bus_get_driver_data(dev-sbd);
+   struct ps3disk_private *priv = ps3_system_bus_get_drvdata(dev-sbd);
 
mutex_lock(ps3disk_mask_mutex);
__clear_bit(MINOR(disk_devt(priv-gendisk)) / PS3DISK_MINORS,
@@ -557,7 +552,7 @@ static int ps3disk_remove(struct ps3_system_bus_device 
*_dev)
ps3stor_teardown(dev);
kfree(dev-bounce_buf);
kfree(priv);
-   ps3_system_bus_set_driver_data(_dev, NULL);
+   ps3_system_bus_set_drvdata(_dev, NULL);
return 0;
 }
 
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index fcecc7f..095f97e 100644
--- 

Re: [PATCH 26/33] sound/ps3: Fix checkpatch issues

2009-06-10 Thread Takashi Iwai
At Wed, 10 Jun 2009 16:39:01 +0200,
Geert Uytterhoeven wrote:
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
 Cc: alsa-de...@alsa-project.org
 Cc: Takashi Iwai ti...@suse.de

Thanks, applied these three patches (26,27,28) to sound git tree.


Takashi

 ---
  sound/ppc/snd_ps3.c |   32 +++-
  1 files changed, 15 insertions(+), 17 deletions(-)
 
 diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
 index f361c26..d660b0f 100644
 --- a/sound/ppc/snd_ps3.c
 +++ b/sound/ppc/snd_ps3.c
 @@ -165,8 +165,7 @@ static const struct snd_pcm_hardware snd_ps3_pcm_hw = {
   .fifo_size = PS3_AUDIO_FIFO_SIZE
  };
  
 -static struct snd_pcm_ops snd_ps3_pcm_spdif_ops =
 -{
 +static struct snd_pcm_ops snd_ps3_pcm_spdif_ops = {
   .open = snd_ps3_pcm_open,
   .close = snd_ps3_pcm_close,
   .prepare = snd_ps3_pcm_prepare,
 @@ -183,7 +182,7 @@ static int snd_ps3_verify_dma_stop(struct 
 snd_ps3_card_info *card,
   int dma_ch, done, retries, stop_forced = 0;
   uint32_t status;
  
 - for (dma_ch = 0; dma_ch  8; dma_ch ++) {
 + for (dma_ch = 0; dma_ch  8; dma_ch++) {
   retries = count;
   do {
   status = read_reg(PS3_AUDIO_KICK(dma_ch)) 
 @@ -259,9 +258,7 @@ static void snd_ps3_kick_dma(struct snd_ps3_card_info 
 *card)
  /*
   * convert virtual addr to ioif bus addr.
   */
 -static dma_addr_t v_to_bus(struct snd_ps3_card_info *card,
 -void * paddr,
 -int ch)
 +static dma_addr_t v_to_bus(struct snd_ps3_card_info *card, void *paddr, int 
 ch)
  {
   return card-dma_start_bus_addr[ch] +
   (paddr - card-dma_start_vaddr[ch]);
 @@ -321,7 +318,7 @@ static int snd_ps3_program_dma(struct snd_ps3_card_info 
 *card,
   spin_lock_irqsave(card-dma_lock, irqsave);
   for (ch = 0; ch  2; ch++) {
   start_vaddr = card-dma_next_transfer_vaddr[0];
 - for (stage = 0; stage  fill_stages; stage ++) {
 + for (stage = 0; stage  fill_stages; stage++) {
   dma_ch = stage * 2 + ch;
   if (silent)
   dma_addr = card-null_buffer_start_dma_addr;
 @@ -619,7 +616,7 @@ static int snd_ps3_change_avsetting(struct 
 snd_ps3_card_info *card)
 PS3_AUDIO_AO_3WMCTRL_ASOEN(2) |
 PS3_AUDIO_AO_3WMCTRL_ASOEN(3)),
   0);
 - wmb();  /* ensure the hardware sees the change */
 + wmb();  /* ensure the hardware sees the change */
   /* wait for actually stopped */
   retries = 1000;
   while ((read_reg(PS3_AUDIO_AO_3WMCTRL) 
 @@ -798,20 +795,20 @@ static struct snd_kcontrol_new spdif_ctls[] = {
   {
   .access = SNDRV_CTL_ELEM_ACCESS_READ,
   .iface = SNDRV_CTL_ELEM_IFACE_PCM,
 - .name = SNDRV_CTL_NAME_IEC958(,PLAYBACK,CON_MASK),
 + .name = SNDRV_CTL_NAME_IEC958(, PLAYBACK, CON_MASK),
   .info = snd_ps3_spdif_mask_info,
   .get = snd_ps3_spdif_cmask_get,
   },
   {
   .access = SNDRV_CTL_ELEM_ACCESS_READ,
   .iface = SNDRV_CTL_ELEM_IFACE_PCM,
 - .name = SNDRV_CTL_NAME_IEC958(,PLAYBACK,PRO_MASK),
 + .name = SNDRV_CTL_NAME_IEC958(, PLAYBACK, PRO_MASK),
   .info = snd_ps3_spdif_mask_info,
   .get = snd_ps3_spdif_pmask_get,
   },
   {
   .iface = SNDRV_CTL_ELEM_IFACE_PCM,
 - .name = SNDRV_CTL_NAME_IEC958(,PLAYBACK,DEFAULT),
 + .name = SNDRV_CTL_NAME_IEC958(, PLAYBACK, DEFAULT),
   .info = snd_ps3_spdif_mask_info,
   .get = snd_ps3_spdif_default_get,
   .put = snd_ps3_spdif_default_put,
 @@ -1020,11 +1017,12 @@ static int __init snd_ps3_driver_probe(struct 
 ps3_system_bus_device *dev)
* its size should be lager than PS3_AUDIO_FIFO_STAGE_SIZE * 2
* PAGE_SIZE is enogh
*/
 - if (!(the_card.null_buffer_start_vaddr =
 -   dma_alloc_coherent(the_card.ps3_dev-core,
 -  PAGE_SIZE,
 -  the_card.null_buffer_start_dma_addr,
 -  GFP_KERNEL))) {
 + the_card.null_buffer_start_vaddr =
 + dma_alloc_coherent(the_card.ps3_dev-core,
 +PAGE_SIZE,
 +the_card.null_buffer_start_dma_addr,
 +GFP_KERNEL);
 + if (!the_card.null_buffer_start_vaddr) {
   pr_info(%s: nullbuffer alloc failed\n, __func__);
   goto clean_preallocate;
   }
 @@ -1148,7 +1146,7 @@ static irqreturn_t snd_ps3_interrupt(int irq, void 
 *dev_id)
   SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL :
   SND_PS3_DMA_FILLTYPE_SILENT_RUNNING);
   snd_ps3_kick_dma(card);
 - 

Re: [PATCH 18/33] ps3: ps3_system_bus_device - Use dev_[gs]et_drvdata() instead of direct access

2009-06-10 Thread Geoff Levand
On 06/10/2009 07:38 AM, Geert Uytterhoeven wrote:
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
 Cc: Geoff Levand geoffrey.lev...@am.sony.com
 ---
  arch/powerpc/include/asm/ps3.h |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

Acked-by: Geoff Levand geoffrey.lev...@am.sony.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 25/33] drivers/ps3: Add missing annotations

2009-06-10 Thread Geoff Levand
On 06/10/2009 07:39 AM, Geert Uytterhoeven wrote:
 probe functions should be __devinit
 initialization functions should be __init
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
 Cc: Geoff Levand geoffrey.lev...@am.sony.com
 ---
  drivers/ps3/ps3-sys-manager.c |2 +-
  drivers/ps3/ps3av.c   |4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)

Acked-by: Geoff Levand geoffrey.lev...@am.sony.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 23/33] net/ps3: gelic - Add missing annotations

2009-06-10 Thread Geoff Levand
On 06/10/2009 07:38 AM, Geert Uytterhoeven wrote:
 probe functions should be __devinit
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
 Cc: Geoff Levand geoffrey.lev...@am.sony.com
 ---
  drivers/net/ps3_gelic_net.c  |   22 --
  drivers/net/ps3_gelic_wireless.c |6 +++---
  2 files changed, 15 insertions(+), 13 deletions(-)

Acked-by: Geoff Levand geoffrey.lev...@am.sony.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 24/33] usb/ps3: Add missing annotations

2009-06-10 Thread Geoff Levand
On 06/10/2009 07:38 AM, Geert Uytterhoeven wrote:
 probe functions should be __devinit
 initialization functions should be __init
 
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
 Cc: Geoff Levand geoffrey.lev...@am.sony.com
 ---
  drivers/usb/host/ehci-ps3.c |4 ++--
  drivers/usb/host/ohci-ps3.c |4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)

Acked-by: Geoff Levand geoffrey.lev...@am.sony.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 3/5] can: af_can.c use rcu_barrier() on module unload.

2009-06-10 Thread David Miller
From: Jeremy Kerr j...@ozlabs.org
Date: Wed, 10 Jun 2009 22:41:47 +1000

 David,
 
 We really can't expect patchwork to look for every conceivable
 malignment of the various reviewer tags.
 
 No, but we could probably be more tolerant about capitalisation. Any 
 objections about ignoring case completely? I have a patch ready to 
 push...

Sure, sounds fine to me.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 19/33] ps3: shorten ps3_system_bus_[gs]et_driver_data to ps3_system_bus_[gs]et_drvdata

2009-06-10 Thread Geoff Levand
On 06/10/2009 07:38 AM, Geert Uytterhoeven wrote:
 Signed-off-by: Geert Uytterhoeven geert.uytterhoe...@sonycom.com
 Cc: Geoff Levand geoffrey.lev...@am.sony.com
 Cc: Jim Paris j...@jtan.com
 ---
  arch/powerpc/include/asm/ps3.h |4 +-
  drivers/block/ps3disk.c|   23 +++---
  drivers/block/ps3vram.c|   48 
 
  drivers/net/ps3_gelic_net.c|8 +++---
  drivers/usb/host/ehci-ps3.c|7 ++---
  drivers/usb/host/ohci-ps3.c|7 ++---
  6 files changed, 45 insertions(+), 52 deletions(-)

Acked-by: Geoff Levand geoffrey.lev...@am.sony.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


MPC5200B: Can't receive/handle external Interrupts

2009-06-10 Thread Schaller Stephan
Hello,
 
I am using a Freescale MPC5200B running Linux 2.6.27.10. Hardware is declared 
using a flat device tree loaded by uBoot.
 
My Problem is that external Interrupts (I use IRQ3) get not received.
I can use bit 18 of the Main Interrupt Emulation All Register (MBAR+0x540) to 
trigger IRQ3 manually which calls up my ISR.
However, if I trigger IRQ using Bit 7 of the IRQ Interrupt Emulation All 
Register (MBAR+0x548), My ISR does not get called. The MPC5200 User Manual says 
(on p. 7-24): This register is redundant with IICTL Main Interrupt Emulation 
All Register for IRQ1-3 but is the only source to emulate IRQ0.. I understand 
this that there should not be a difference between emulating an external 
interrupt using one of these registers or the other. But there is. I tried 
pulling down the IRQ3-Pin as mentioned in the manual, but this does not make a 
difference.
I checked the Main Interrupt Status All Register (MBAR+0x52C), bit 18 and the 
bit only gets set when i use the Main Interrupt Emulation All Register to 
emulate. Also, after setting the appropriate bit in Main Interrupt Emulation 
All Register, it also is set in IRQ Interrupt Emulation All Register. But it 
does not work vice versa. This is not what I think redundant means...

I Made sure that IRQ3 is enabled and unmasked (MBAR+0x510, Bit 23 = 1, Bit 19 = 
1). Forwarding it to SMI instead of INT does not make a difference. If I change 
IRQ3 to active high (using MBAR+0x510), my ISR gets called instantly, no matter 
wether the IRQ3-Pin is connected to high or low.
The Bit representing IRQ3 in Main Interrupt Status All Register does not change 
when i connect the Pin to high or low.

So, basically two Problems:
- ISR seems only to get called by a Main Interrupt, not by a IRQ Interrupt. 
How do I make the connection between these?
- The IRQ3 input Pin level is not shown in the status register and is not 
regognized by the CPU.

I have noticed several people here using external IRQs, so someone might 
hopefully know what I forgot to do. I'm running out of ideas on this one.

Here is some additional information:


I declare my test driver in the FTD as follows:

irqt...@00 {
compatible = irqtest;
interrupts =  1 3 3 ;
interrupt-parent = mpc5200_pic;


and the PIC:

mpc5200_pic: interrupt-control...@500 {
// 5200 interrupts are encoded into two levels;
interrupt-controller;
#interrupt-cells = 3;
device_type = interrupt-controller;
compatible = fsl,mpc5200b-pic,fsl,mpc5200-pic;
reg = 0x500 0x80;
};

(Of course, the PIC driver is loaded)

My driver requests the IRQ as follows:

   irq = irq_of_parse_and_map(op-node, 0);
   request_irq(irq, irqtest_isr, IRQF_SAMPLE_RANDOM, irqtest, NULL);


this is my output while loading the module (seems to be OK):

initializing irqtest module...
irqtest_of_probe called, mapping irq...
irqtest: mapped irq 67, calling request_irq...
request_irq returned 0



Thank you in advance,
Stephan Schaller
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH -next] powerpc/fsl-booke: Enable L1 cache on e500v1/e500v2/e500mc CPUs

2009-06-10 Thread Nate Case
Some boot loaders may not enable L1 instruction/data cache.  Check if
data and instruction caches are enabled, and enable them if needed.

Signed-off-by: Nate Case nc...@xes-inc.com
---
 arch/powerpc/include/asm/reg_booke.h  |2 +
 arch/powerpc/kernel/cpu_setup_fsl_booke.S |   49 +++--
 2 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/reg_booke.h 
b/arch/powerpc/include/asm/reg_booke.h
index 601ddbc..6bcf364 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -389,12 +389,14 @@
 #define ICCR_CACHE 1   /* Cacheable */
 
 /* Bit definitions for L1CSR0. */
+#define L1CSR0_CPE 0x0001  /* Data Cache Parity Enable */
 #define L1CSR0_CLFC0x0100  /* Cache Lock Bits Flash Clear */
 #define L1CSR0_DCFI0x0002  /* Data Cache Flash Invalidate */
 #define L1CSR0_CFI 0x0002  /* Cache Flash Invalidate */
 #define L1CSR0_DCE 0x0001  /* Data Cache Enable */
 
 /* Bit definitions for L1CSR1. */
+#define L1CSR1_CPE 0x0001  /* Instruction Cache Parity Enable */
 #define L1CSR1_ICLFR   0x0100  /* Instr Cache Lock Bits Flash Reset */
 #define L1CSR1_ICFI0x0002  /* Instr Cache Flash Invalidate */
 #define L1CSR1_ICE 0x0001  /* Instr Cache Enable */
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S 
b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
index eb4b9ad..0adb50a 100644
--- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
+++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
@@ -17,6 +17,40 @@
 #include asm/cputable.h
 #include asm/ppc_asm.h
 
+_GLOBAL(__e500_icache_setup)
+   mfspr   r0, SPRN_L1CSR1
+   andi.   r3, r0, L1CSR1_ICE
+   bnelr   /* Already enabled */
+   orisr0, r0, l1csr1_...@h
+   ori r0, r0, (L1CSR1_ICFI | L1CSR1_ICLFR |  L1CSR1_ICE)
+   mtspr   SPRN_L1CSR1, r0 /* Enable I-Cache */
+   isync
+   blr
+
+_GLOBAL(__e500_dcache_setup)
+   mfspr   r0, SPRN_L1CSR0
+   andi.   r3, r0, L1CSR0_DCE
+   bnelr   /* Already enabled */
+   msync
+   isync
+   li  r0, 0
+   mtspr   SPRN_L1CSR0, r0 /* Disable */
+   msync
+   isync
+   li  r0, (L1CSR0_DCFI | L1CSR0_CLFC)
+   mtspr   SPRN_L1CSR0, r0 /* Invalidate */
+   isync
+1: mfspr   r0, SPRN_L1CSR0
+   andi.   r3, r0, L1CSR0_CLFC
+   bne+1b  /* Wait for lock bits reset */
+   orisr0, r0, l1csr0_...@h
+   ori r0, r0, L1CSR0_DCE
+   msync
+   isync
+   mtspr   SPRN_L1CSR0, r0 /* Enable */
+   isync
+   blr
+
 _GLOBAL(__setup_cpu_e200)
/* enable dedicated debug exception handling resources (Debug APU) */
mfspr   r3,SPRN_HID0
@@ -25,7 +59,16 @@ _GLOBAL(__setup_cpu_e200)
b   __setup_e200_ivors
 _GLOBAL(__setup_cpu_e500v1)
 _GLOBAL(__setup_cpu_e500v2)
-   b   __setup_e500_ivors
+   mflrr4
+   bl  __e500_icache_setup
+   bl  __e500_dcache_setup
+   bl  __setup_e500_ivors
+   mtlrr4
+   blr
 _GLOBAL(__setup_cpu_e500mc)
-   b   __setup_e500mc_ivors
-
+   mflrr4
+   bl  __e500_icache_setup
+   bl  __e500_dcache_setup
+   bl  __setup_e500mc_ivors
+   mtlrr4
+   blr
-- 
1.6.0.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Delay on intialization ide subsystem(most likely)

2009-06-10 Thread Andrey Gusev
On Mon, 8 Jun 2009 22:20:41 +0200
Bartlomiej Zolnierkiewicz bzoln...@gmail.com wrote:

 On Saturday 30 May 2009 12:46:43 Andrey Gusev wrote:
  On Wed, 20 May 2009 17:56:14 +0200
  Bartlomiej Zolnierkiewicz bzoln...@gmail.com wrote:
  
   On Friday 15 May 2009 22:40:07 Andrey Gusev wrote:
On Wed, 13 May 2009 20:46:33 +0200
Bartlomiej Zolnierkiewicz bzoln...@gmail.com wrote:

 On Wednesday 13 May 2009 19:11:23 Andrey Gusev wrote:
  On Wed, 13 May 2009 15:28:26 +0200
  Bartlomiej Zolnierkiewicz bzoln...@gmail.com wrote:
  
   On Tuesday 12 May 2009 21:50:24 Andrey Gusev wrote:
On Mon, 27 Apr 2009 23:21:48 +0200
Bartlomiej Zolnierkiewicz bzoln...@gmail.com wrote:

 On Monday 27 April 2009 22:36:45 Andrey Gusev wrote:
  On Sat, 25 Apr 2009 16:48:38 +0200
  Bartlomiej Zolnierkiewicz bzoln...@gmail.com
  wrote:
 
 Indeed.  The delay problem is a more generic kernel/hardware issue.
Ok, I can rather stable reproduce it on 2.6.29-rc6. I want to narrow it,
disabling almost all options in kernel configuration. Could some options
from 'kernel hacking' help me?
 
 Thanks for testing.  Unfortunately none of fixes helped.. :/
 
  [   70.287747] sysfs: cannot create duplicate filename
  '/class/ide_port/ide1' [   70.287841] [ cut
  here ] [   70.287879] Badness at fs/sysfs/dir.c:487
 
 This is caused by small mistake in one of fixes, follow-up fixup:
 
 diff -u b/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
 --- b/drivers/ide/ide-probe.c
 +++ b/drivers/ide/ide-probe.c
 @@ -708,6 +708,8 @@
   goto out;
   } else if (rc == -EBUSY)
   printk(KERN_ERR %s: not ready before the probe\n,
 hwif-name);
 + else
 + rc = -ENODEV;
  
   /*
* Second drive should only exist if first drive was found,

I try this small fix, traces in disappeared, but lost interrupts on the place:)
Some interesting thing from dmesg:

[0.435806] irq: irq 251 on host 
/p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 251
[0.435824] irq: irq 252 on host 
/p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 252
[0.435840] irq: irq 253 on host 
/p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 253
[0.435856] irq: irq 254 on host 
/p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 254
[0.435867] CPU0: L2CR is 8008
[0.435880] CPU0: L3CR is 8f0b
[478142827.057095] CPU1: L2CR was 8
[478142827.057133] CPU1: L2CR set to 8008
[478142827.057139] CPU1: L3CR was 0
[478142827.057300] CPU1: L3CR set to 8f0b
[0.437529] Processor 1 found.
[0.437588] clockevent: decrementer mult[886] shift[16] cpu[1]

This is don't look good.

 
 
  [   70.584122]  hdb:3ide-pmac lost interrupt, dma status: 8480
 
 DMA status indicates that DMA transfer is still active according to
 the controller.  This one is really a platform/hardware specific
 issue.
 

Notes for Ben, I checked only 2.6.26, but may be somebody checked 2.6.24
or this is interpolation.

Thanks,
Andrey 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/33] My PS3-specific patches for 2.6.31

2009-06-10 Thread Benjamin Herrenschmidt
On Wed, 2009-06-10 at 16:38 +0200, Geert Uytterhoeven wrote:
   Hi Ben,
 
 Here are my PS3-specific patches for 2.6.31:

G.

It's -WAY TOO LATE-

I though I made it clear that patches should be ready in -next -before-
the merge window, in fact, by rc7 or rc8, we should have a good idea of
what's going in either via my 'next' branch or pending stuff in
patchwork.

I'll go through your pile and may still merge it this time around, but
you should be more proactive at feeding me with that stuff before it's
merge time.

Cheers,
Ben.

   [01] ps3av: Set 16:9 aspect ratio for 720p video modes
   [02] ps3vram: Fix error path (return -EIO) for short read/write
   [03] ps3vram: Use proc_create_data() instead of proc_create()
   [04] ps3vram: Correct exchanged gotos in ps3vram_probe() error path
   [05] block: Add bio_list_peek()
   [06] ps3vram: Replace mutex by spinlock + bio_list
   [07] ps3fb: Remove useless debug checks in ps3fb_shutdown()
   [08] ps3fb: Inline functions in ps3fb_probe(), to ease cleanup in the
error path
   [09] ps3fb: Correct handling of device opening in ps3fb_probe()
   [10] powerpc/cell: Extract duplicated IOPTE_* to asm/iommu.h
   [11] ps3fb: GPU memory mapping cleanup
   [12] ps3vram: GPU memory mapping cleanup
   [13] ps3fb/vram: Extract common GPU stuff into asm/ps3gpu.h
   [14] ps3fb: Tear down FB setup during cleanup
   [15] ps3vram: Remove no longer used ps3vram_priv.ddr_base
   [16] ps3vram: Make ps3vram_priv.reports a void *
   [17] block/ps3: remove driver_data direct access of struct device
   [18] ps3: ps3_system_bus_device - Use dev_[gs]et_drvdata() instead of
direct access
   [19] ps3: shorten ps3_system_bus_[gs]et_driver_data to
ps3_system_bus_[gs]et_drvdata
   [20] ps3: ps3flash - Use ps3_system_bus_[gs]et_drvdata() instead of direct
access
   [21] ps3: ps3rom - Use ps3_system_bus_[gs]et_drvdata() instead of direct
access
   [22] ps3: ps3fb - Use ps3_system_bus_[gs]et_drvdata() instead of direct
access
   [23] net/ps3: gelic - Add missing annotations
   [24] usb/ps3: Add missing annotations
   [25] drivers/ps3: Add missing annotations
   [26] sound/ps3: Fix checkpatch issues
   [27] sound/ps3: Restructure driver source
   [28] sound/ps3: Correct existing and add missing annotations
   [29] ps3: Correct debug message in dma_ioc0_map_pages()
   [30] ps3: Switch ps3_os_area_[gs]et_rtc_diff to EXPORT_SYMBOL_GPL()
   [31] ps3: Replace direct file operations by callback
   [32] ps3flash: Cache the last accessed FLASH chunk
   [33] ps3flash: Always read chunks of 256 KiB, and cache them
 
 About half of these have been submitted and reviewed before, with review
 comments taken into account.
 
 Patches 05 (in response to feedback on v1 of 06) and 18-33 are new.
 
 Given the interactions between powerpc/ps3-specific code and the various
 subsystems, I think the easiest way is to get everything in via the
 powerpc tree?
 
 Thanks!
 
 arch/powerpc/include/asm/ps3.h|   16 
 arch/powerpc/include/asm/ps3gpu.h |8 
 arch/powerpc/platforms/ps3/mm.c   |6 
 arch/powerpc/platforms/ps3/os-area.c  |  138 +++---
 b/arch/powerpc/include/asm/iommu.h|   10 
 b/arch/powerpc/include/asm/ps3.h  |3 
 b/arch/powerpc/include/asm/ps3gpu.h   |   78 +++
 b/arch/powerpc/platforms/cell/iommu.c |   37 -
 b/arch/powerpc/platforms/ps3/mm.c |7 
 b/arch/powerpc/platforms/ps3/os-area.c|5 
 b/arch/powerpc/platforms/ps3/platform.h   |   10 
 b/arch/powerpc/platforms/ps3/setup.c  |1 
 b/arch/powerpc/platforms/ps3/system-bus.c |   16 
 b/drivers/block/ps3disk.c |   23 -
 b/drivers/block/ps3vram.c |2 
 b/drivers/char/ps3flash.c |   13 
 b/drivers/net/ps3_gelic_net.c |8 
 b/drivers/net/ps3_gelic_wireless.c|7 
 b/drivers/ps3/ps3-sys-manager.c   |2 
 b/drivers/ps3/ps3av.c |5 
 b/drivers/ps3/ps3av_cmd.c |3 
 b/drivers/scsi/ps3rom.c   |   11 
 b/drivers/usb/host/ehci-ps3.c |7 
 b/drivers/usb/host/ohci-ps3.c |8 
 b/drivers/video/ps3fb.c   |   15 
 b/include/linux/bio.h |6 
 b/sound/ppc/snd_ps3.c |   33 -
 drivers/block/ps3disk.c   |   23 -
 drivers/block/ps3vram.c   |  228 +-
 drivers/char/ps3flash.c   |  353 +---
 drivers/net/ps3_gelic_net.c   |   22 -
 drivers/ps3/ps3av.c   |5 
 drivers/usb/host/ehci-ps3.c   |4 
 drivers/usb/host/ohci-ps3.c   |5 
 drivers/video/ps3fb.c |  312 ++
 sound/ppc/snd_ps3.c   |  635 
 +-
 36 files changed, 1045 insertions(+), 1020 deletions(-)
 
 With kind regards,
 
 Geert Uytterhoeven
 

Re: Delay on intialization ide subsystem(most likely)

2009-06-10 Thread Benjamin Herrenschmidt
On Thu, 2009-06-11 at 00:38 +0400, Andrey Gusev wrote:

 I try this small fix, traces in disappeared, but lost interrupts on the 
 place:)
 Some interesting thing from dmesg:
 
 [0.435806] irq: irq 251 on host 
 /p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 251
 [0.435824] irq: irq 252 on host 
 /p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 252
 [0.435840] irq: irq 253 on host 
 /p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 253
 [0.435856] irq: irq 254 on host 
 /p...@f200/mac...@17/interrupt-control...@4 mapped to virtual irq 254
 [0.435867] CPU0: L2CR is 8008
 [0.435880] CPU0: L3CR is 8f0b
 [478142827.057095] CPU1: L2CR was 8
 [478142827.057133] CPU1: L2CR set to 8008
 [478142827.057139] CPU1: L3CR was 0
 [478142827.057300] CPU1: L3CR set to 8f0b
 [0.437529] Processor 1 found.
 [0.437588] clockevent: decrementer mult[886] shift[16] cpu[1]
 
 This is don't look good.

What doesn't look good ? It's copying the L2CR and L3CR values over from
CPU 0 to CPU 1 when bringing the later up, I don't see anything wrong.

Cheers,
Ben.

  
  
   [   70.584122]  hdb:3ide-pmac lost interrupt, dma status: 8480
  
  DMA status indicates that DMA transfer is still active according to
  the controller.  This one is really a platform/hardware specific
  issue.
  
 
 Notes for Ben, I checked only 2.6.26, but may be somebody checked 2.6.24
 or this is interpolation.
 
 Thanks,
 Andrey 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: next branch update

2009-06-10 Thread Sean MacLennan
What ever happened to this patch?

diff --git b/arch/powerpc/platforms/44x/warp.c
a/arch/powerpc/platforms/44x/warp.c index c511880..7f3c1c7 100644
--- b/arch/powerpc/platforms/44x/warp.c
+++ a/arch/powerpc/platforms/44x/warp.c
@@ -43,7 +43,13 @@ static int __init warp_probe(void)
 {
unsigned long root = of_get_flat_dt_root();
 
-   return of_flat_dt_is_compatible(root, pika,warp);
+   if (!of_flat_dt_is_compatible(root, pika,warp))
+   return 0;
+
+   /* For __dma_alloc_coherent */
+   ISA_DMA_THRESHOLD = ~0L;
+
+   return 1;
 }
 
I don't see it in patchworks and I don't see it in Ben's or Josh's tree.

Cheers,
   Sean
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Delay on intialization ide subsystem(most likely)

2009-06-10 Thread Andrey Gusev
On Thu, 11 Jun 2009 07:46:17 +1000
Benjamin Herrenschmidt b...@kernel.crashing.org wrote:

 On Thu, 2009-06-11 at 00:38 +0400, Andrey Gusev wrote:
 
  I try this small fix, traces in disappeared, but lost interrupts on
  the place:) Some interesting thing from dmesg:
  
  [0.435806] irq: irq 251 on
  host /p...@f200/mac...@17/interrupt-control...@4 mapped to
  virtual irq 251 [0.435824] irq: irq 252 on
  host /p...@f200/mac...@17/interrupt-control...@4 mapped to
  virtual irq 252 [0.435840] irq: irq 253 on
  host /p...@f200/mac...@17/interrupt-control...@4 mapped to
  virtual irq 253 [0.435856] irq: irq 254 on
  host /p...@f200/mac...@17/interrupt-control...@4 mapped to
  virtual irq 254 [0.435867] CPU0: L2CR is 8008
  [0.435880] CPU0: L3CR is 8f0b [478142827.057095] CPU1: L2CR
  was 8 [478142827.057133] CPU1: L2CR set to 8008
  [478142827.057139] CPU1: L3CR was 0 [478142827.057300] CPU1: L3CR
  set to 8f0b [0.437529] Processor 1 found. [0.437588]
  clockevent: decrementer mult[886] shift[16] cpu[1]
  
  This is don't look good.
 
 What doesn't look good ? It's copying the L2CR and L3CR values over
 from CPU 0 to CPU 1 when bringing the later up, I don't see anything
 wrong.
 
 Cheers,
 Ben.

I wrote about time, why it have such values on second CPU? Sorry, if this 
message is silly.

I found configuration, where there isn't delay, but I need more time for
testing.

 
   
   
[   70.584122]  hdb:3ide-pmac lost interrupt, dma status: 8480
   
   DMA status indicates that DMA transfer is still active according
   to the controller.  This one is really a platform/hardware
   specific issue.
   
  
  Notes for Ben, I checked only 2.6.26, but may be somebody checked
  2.6.24 or this is interpolation.
  
  Thanks,
  Andrey 
 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/33] My PS3-specific patches for 2.6.31

2009-06-10 Thread Benjamin Herrenschmidt
On Wed, 2009-06-10 at 17:00 -0500, Nate Case wrote:
 Hmm, I guess this sorta answers my question to Kumar about my recent
 -next submissions being eligible for 2.6.31.  Sorry for not paying
 closer attention -- I just assumed we weren't even close to the cutoff
 time.  I didn't even see Kumar's next branch until April 30th
 (around -rc6..rc7 time I think).
 
Your patches may still make it, we'll see. Kumar was away for a week
just before the merge window and I started this round's next branch a
bit late, so we can be flexible, it depends how many patches are
involved, how invasive or risky they are etc...

In your case, I'll let Kumar judge.

However, in Geert case, it's a pile of 33 patches sent after the break
point, which is a bit too much over the top :-)

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH -next] powerpc/85xx: Add support for X-ES MPC85xx boards

2009-06-10 Thread Kumar Gala


On Jun 10, 2009, at 4:46 PM, Nate Case wrote:


Hi Kumar,

Thanks for the feedback.  Response below:


+
+   root = of_find_node_by_path(/);
+   if (root == NULL)
+   return;
+
+   model = of_get_property(root, model, NULL);
+   if (strncasecmp(model, xes,, strlen(xes,)) != 0)
+   return;


What is this check for?


Historical accident.  A while back we somehow ended up with a case of
probe() succeeding when it shouldn't have, and this was the  
workaround.

I'll remove it since it's useless now.


+
+   printk(KERN_INFO X-ES MPC85xx-based single-board computer: %s\n,
+  model + strlen(xes,));


Why not print the name from machine_id.name


Because machine_id-name will give us X-ES MPC8572 from the machine
description rather than the actual board name (e.g., xpedite5370).

In our situation, we have several boards that share largely the same
hardware design.  I decided to just put 1 machine definition per
processor rather than having a machine definition for every board  
(which

would get pretty crazy for our case).  For example, we have at least 6
MPC8572-based boards with more on the way, but all of their changes  
can

be described in the device tree (e.g., changes in number of ethernet
ports or PCI express controllers), so there's no need for a machine
definition for all of them.


+machine_device_initcall(xes_mpc8572, xes_mpc85xx_publish_devices);
+machine_device_initcall(xes_mpc8548, xes_mpc85xx_publish_devices);


Do you not need this for xes_mpc8540?


Yes, thanks.  I'll fix this and the other things you mentioned and
re-submit.  Will this be able to make it into your next tree destined
for 2.6.31?


If it get submitted pretty soon I'd be willing to take it for .31.   
Also can you split the patch into 3 pieces (defconfig, .dts, and  
actual platform code)


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Delay on intialization ide subsystem(most likely)

2009-06-10 Thread Benjamin Herrenschmidt
On Thu, 2009-06-11 at 01:57 +0400, Andrey Gusev wrote:

 
 I wrote about time, why it have such values on second CPU? Sorry, if this 
 message is silly.

Oh that's just because it hasn't synchronized the timebases yet when
it prints those messages.

Cheers,
Ben.

 I found configuration, where there isn't delay, but I need more time for
 testing.
 
  


 [   70.584122]  hdb:3ide-pmac lost interrupt, dma status: 8480

DMA status indicates that DMA transfer is still active according
to the controller.  This one is really a platform/hardware
specific issue.

   
   Notes for Ben, I checked only 2.6.26, but may be somebody checked
   2.6.24 or this is interpolation.
   
   Thanks,
   Andrey 
  

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: next branch update

2009-06-10 Thread Benjamin Herrenschmidt
On Wed, 2009-06-10 at 17:56 -0400, Sean MacLennan wrote:
 What ever happened to this patch?

Dunno... It should have been in patchwork. I remember the patch
in fact and I intended to merge it... Can you re-submit with appropriate
cset comment, signed-off-by etc... ?

(Mistakes -do- happen, which is why we can be flexible with the rules,
btw, but heh, 33 new patches the day the merge window opens is a bit
over the top).

Cheers,
Ben.

 diff --git b/arch/powerpc/platforms/44x/warp.c
 a/arch/powerpc/platforms/44x/warp.c index c511880..7f3c1c7 100644
 --- b/arch/powerpc/platforms/44x/warp.c
 +++ a/arch/powerpc/platforms/44x/warp.c
 @@ -43,7 +43,13 @@ static int __init warp_probe(void)
  {
   unsigned long root = of_get_flat_dt_root();
  
 - return of_flat_dt_is_compatible(root, pika,warp);
 + if (!of_flat_dt_is_compatible(root, pika,warp))
 + return 0;
 +
 + /* For __dma_alloc_coherent */
 + ISA_DMA_THRESHOLD = ~0L;
 +
 + return 1;
  }
  
 I don't see it in patchworks and I don't see it in Ben's or Josh's tree.
 
 Cheers,
Sean

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Re:[BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o]

2009-06-10 Thread Stephen Rothwell
Hi Subrata,

On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak subr...@linux.vnet.ibm.com 
wrote:

   /* Find the TBI PHY.  If it's not there, we don't support SGMII */
 - ph = of_get_property(np, tbi-handle, NULL);
 + ph = (phandle *)of_get_property(np, tbi-handle, NULL);

You don't need this cast because of_get_property() returns void *.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgptwCCllXQeJ.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: next branch update

2009-06-10 Thread Benjamin Herrenschmidt
On Wed, 2009-06-10 at 21:09 -0400, Sean MacLennan wrote:
 I was expecting an rc9 and another week. Probably others where caught
 off guard. Patch below.
 
Note that this simple patch qualifies as a bug fix in my book and thus
is less constrainted. I would happily have merged it in -rc4 :-)

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 00/33] My PS3-specific patches for 2.6.31

2009-06-10 Thread Michael Ellerman
On Thu, 2009-06-11 at 10:48 +1000, Benjamin Herrenschmidt wrote:
 On Wed, 2009-06-10 at 15:53 -0600, Gary Thomas wrote:
 
  Trying to understand the process (in preparation for any patches
  I may want to push upstream) - how can this be too late for 2.6.31?
  2.6.30 just came out today...
 
 I'm taking the liberty to reply to the list here because I think
 more people need to understand that problem :-)
 
 Because the process is such that new features can only be merged
 during the 2 weeks merge window, which started ... yesterday.
 
 Also, it's frowned upon to have lots of new stuff close to the end of
 the merge window.
 
 The idea is that stuff to go into 2.6.31 should have essentially been
 ready to merge -before- the merge window opens, ie, before 2.6.30 is
 released, for us maintainers to be ready to push things out when the
 merge window open and spend that time sorting out collisions 
 conflicts, -not- reviewing new features that have been sent way too
 late.

The way I think of it is that the merge window is the time for
maintainers to merge with Linus.

So if you're sending patches to a maintainer you need to have sent all
your patches to them _before_ then. So the merge window for you is the
weeks prior to the merge window.


cheers


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 -next] powerpc/85xx: Add support for X-ES MPC85xx boards

2009-06-10 Thread David Gibson
On Wed, Jun 10, 2009 at 05:30:39PM -0500, Nate Case wrote:
 Add support for X-ES single-board computers based on the Freescale
 MPC85xx processors.  Changes include:

[snip]
 diff --git a/arch/powerpc/boot/dts/xcalibur1501.dts 
 b/arch/powerpc/boot/dts/xcalibur1501.dts
 new file mode 100644
 index 000..497af7a
 --- /dev/null
 +++ b/arch/powerpc/boot/dts/xcalibur1501.dts
 @@ -0,0 +1,759 @@
 +/*
 + * Copyright (C) 2008 Extreme Engineering Solutions, Inc.
 + * Based on MPC8572DS device tree from Freescale Semiconductor, Inc.
 + *
 + * XCalibur1501 6U CompactPCI single-board computer based on MPC8572E
 + *
 + * This is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + */
 +
 +/dts-v1/;
 +/ {
 + model = xes,xcalibur1501;
 + compatible = xes,xcalibur1501, xes,MPC8572;
 + #address-cells = 2;
 + #size-cells = 2;
 + form-factor = 6U cPCI;
 + boot-bank = 0x0;  /* 0: Primary flash, 1: Secondary flash */

These last two aren't standard properties, so should probably be
xes,form-factor and xes,boot-bank.

[snip]
 + pmcslots {

What does this structure model?  Without any reg properties it's kind
of hard to see what you could do with it.

 + #address-cells = 1;
 + #size-cells = 0;
 +
 + pmcs...@0 {

Since you have an unit address, you must also have a reg property to
match, so reg = 0 in this case.

 + cell-index = 0;

Don't use cell-index here, it's redundant with the reg value that you
should have.

 + /*
 +  * boolean properties (true if defined):
 +  * monarch;
 +  * module-present;
 +  */
 + };
 +
 + pmcs...@1 {
 + cell-index = 1;
 + /*
 +  * boolean properties (true if defined):
 +  * monarch;
 +  * module-present;
 +  */
 + };
 + };
 +
 + xmcslots {
 + #address-cells = 1;
 + #size-cells = 0;
 +
 + xmcs...@0 {
 + cell-index = 0;

Same comments here.

 + /*
 +  * boolean properties (true if defined):
 +  * module-present;
 +  */
 + };
 +
 + xmcs...@1 {
 + cell-index = 1;
 + /*
 +  * boolean properties (true if defined):
 +  * module-present;
 +  */
 + };
 + };
 +
 + cpci {
 + /*
 +  * boolean properties (true if defined):
 +  * system-controller;
 +  */
 + system-controller;
 + };
 +
 + cpus {
 + #address-cells = 1;
 + #size-cells = 0;
 +
 + PowerPC,8...@0 {
 + device_type = cpu;
 + reg = 0x0;
 + d-cache-line-size = 32;   // 32 bytes
 + i-cache-line-size = 32;   // 32 bytes
 + d-cache-size = 0x8000;// L1, 32K
 + i-cache-size = 0x8000;// L1, 32K
 + timebase-frequency = 0;
 + bus-frequency = 0;
 + clock-frequency = 0;
 + next-level-cache = L2;
 + };
 +
 + PowerPC,8...@1 {
 + device_type = cpu;
 + reg = 0x1;
 + d-cache-line-size = 32;   // 32 bytes
 + i-cache-line-size = 32;   // 32 bytes
 + d-cache-size = 0x8000;// L1, 32K
 + i-cache-size = 0x8000;// L1, 32K
 + timebase-frequency = 0;
 + bus-frequency = 0;
 + clock-frequency = 0;
 + next-level-cache = L2;
 + };
 + };
 +
 + memory {
 + device_type = memory;

I assume this node's reg property is supposed to be filled in by the
bootloader.  Best to have an explanatory comment, and/or a template
reg property here.

[snip]
 + soc8...@ef00 {
 + #address-cells = 1;
 + #size-cells = 1;
 + device_type = soc;
 + compatible = simple-bus;

This compatible value needs a more specific entry for the specific SoC
type.

[snip]
 + /* eTSEC 1 front panel 0 */
 + enet0: ether...@24000 {
 + #address-cells = 1;
 + #size-cells = 1;
 + cell-index = 0;
 + device_type = network;
 + model = eTSEC;
 +   

Re: [PATCH 00/33] My PS3-specific patches for 2.6.31

2009-06-10 Thread Benjamin Herrenschmidt
On Thu, 2009-06-11 at 11:32 +1000, Michael Ellerman wrote:
 The way I think of it is that the merge window is the time for
 maintainers to merge with Linus.
 
 So if you're sending patches to a maintainer you need to have sent all
 your patches to them _before_ then. So the merge window for you is the
 weeks prior to the merge window.

Right. But a patch generally needs time to be reviewed, spun several
times, etc... so just the week before the merge window is probably too
late :-)

A good rule is that people should start sending things to the list for
review about one kernel release in advance :-)

Now, -rc4 should generally be the wakeup call. It's when I start
frowning even on bug fixes, and putting together a next branch, at least
normally. I can be flexible but people need to try to play nicely too.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 4/4] MPC85xx: Add UCC6 and UCC8 nodes in SGMII mode for MPC8569MDS

2009-06-10 Thread Kumar Gala


On Jun 3, 2009, at 5:51 AM, David Miller wrote:


From: Haiying Wang haiying.w...@freescale.com
Date: Tue,  2 Jun 2009 10:04:16 -0400


Signed-off-by: Haiying Wang haiying.w...@freescale.com


I couldn't apply this to net-next-2.6 because this DTS
file being patched doesn't exist there.

Perhaps the powerpc-next tree can suck it in...


I'll pick this one up and send it via the powerpc tree.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


linux-next: powerpc tree build warning

2009-06-10 Thread Stephen Rothwell
Hi Ben,

Today's linux-next build (powerpc ppc64_defconfig) produced this warning:

arch/powerpc/platforms/Kconfig.cputype:60:warning: defaults for choice values 
not supported

We appear to have CONFIG_PPC_BOOK3S int two places which is confusing
Kconfig.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgpLPVuhjnP1r.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2] Add MSI interrupts to DTS of MPC8315E-RDB

2009-06-10 Thread Kumar Gala


On Jun 6, 2009, at 11:15 AM, leon.woestenb...@gmail.com wrote:


The PCIe MSI interrupts are missing from the device tree source, and
thus were not enabled. This patch adds them.

v2 of the patch fixes inconsistent white space, reported by David  
Gibson.


Tested to work on MPC8315E-RDB with custom FPGA PCIe device.

Signed-off-by: Leon Woestenberg l...@sidebranch.com
Tested-by: Leon Woestenberg l...@sidebranch.com


applied to next.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc/86xx: Add I2C device mappings in DTS for SBC610

2009-06-10 Thread Kumar Gala


On May 19, 2009, at 4:40 AM, Martyn Welch wrote:

Mappings for temperature sensors (adt7461 and lm92) are missing from  
the

SBC610's DTS file.

Signed-off-by: Martyn Welch martyn.we...@gefanuc.com
---

arch/powerpc/boot/dts/gef_sbc610.dts |   10 ++
1 files changed, 10 insertions(+), 0 deletions(-)



applied to next.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc/83xx: Update sdhci nodes per new bindings

2009-06-10 Thread Kumar Gala


On Jun 10, 2009, at 10:19 AM, Anton Vorontsov wrote:


As of commit 404614728f857d0ac63d29c3a29d0cf392a15598 (Update FSL
esdhc binding), we use fsl,esdhc compatible entry as a base
match. U-Boot will use the same compatible to fixup esdhc nodes.

This patch updates 83xx dts files so that they conform to the new
bindings.

Signed-off-by: Anton Vorontsov avoront...@ru.mvista.com
---
arch/powerpc/boot/dts/mpc8377_mds.dts |2 +-
arch/powerpc/boot/dts/mpc8377_rdb.dts |2 +-
arch/powerpc/boot/dts/mpc8378_mds.dts |2 +-
arch/powerpc/boot/dts/mpc8378_rdb.dts |2 +-
arch/powerpc/boot/dts/mpc8379_mds.dts |2 +-
arch/powerpc/boot/dts/mpc8379_rdb.dts |2 +-
6 files changed, 6 insertions(+), 6 deletions(-)



applied to next.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 4/4] MPC85xx: Add UCC6 and UCC8 nodes in SGMII mode for MPC8569MDS

2009-06-10 Thread Kumar Gala


On Jun 2, 2009, at 9:04 AM, Haiying Wang wrote:


Signed-off-by: Haiying Wang haiying.w...@freescale.com
---
arch/powerpc/boot/dts/mpc8569mds.dts |   63 + 
+

1 files changed, 63 insertions(+), 0 deletions(-)



applied to next.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] [PowerPC] MPC8272ADS: fix device tree for 8 MB flash size

2009-06-10 Thread Kumar Gala


On May 12, 2009, at 2:06 PM, Wolfgang Denk wrote:


The current device tree for the MPC8272ADS assumes a mapping of 32 MB
of NOR flash at 0xFE00., while there are actually only 8 MB on
the boards, mapped at 0xFF80.. When booting an uImage with such a
device tree, the kernel crashes because 0xFE00. is not mapped.

Also introduce aliases for serial[01] and ethernet[01].

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Scott Wood scottw...@freescale.com
cc: Kumar Gala ga...@kernel.crashing.org
---
I am not really sure what the typical flash size on MPC8272ADS boards
is. The board I used for testing is marked as Prototype, so it may
not be the release configuration. On the other hand, the manual also
says 8 MB, Vitaly Borduk confirms 8 MB on his board, too, and Scott
Wood eventually tested only with cuImage which fixes up the localbus
mappings, thus eventually concealing the issue.

I'm posting this as reference in case the 8 MB should turn out to be
correct. -- wd

arch/powerpc/boot/dts/mpc8272ads.dts |   19 +--
1 files changed, 13 insertions(+), 6 deletions(-)



applied to next.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Re:[BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o]

2009-06-10 Thread Subrata Modak
On Thu, 2009-06-11 at 11:05 +1000, Stephen Rothwell wrote:
 Hi Subrata,
 
 On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak subr...@linux.vnet.ibm.com 
 wrote:
 
  /* Find the TBI PHY.  If it's not there, we don't support SGMII */
  -   ph = of_get_property(np, tbi-handle, NULL);
  +   ph = (phandle *)of_get_property(np, tbi-handle, NULL);
 
 You don't need this cast because of_get_property() returns void *.

Stephen,

True. But without this gcc complains:

CC [M]  drivers/net/ucc_geth.o
drivers/net/ucc_geth.c: In function ‘ucc_geth_probe’:
drivers/net/ucc_geth.c:3824: warning: assignment discards qualifiers
from pointer target type

Else gcc just builds fine:

CC [M]  drivers/net/ucc_geth.o

This is an just an extra caution to fix both the build and warning
regression(s).

Regards--
Subrata

 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 00/33] My PS3-specific patches for 2.6.31

2009-06-10 Thread Michael Ellerman
On Thu, 2009-06-11 at 11:35 +1000, Benjamin Herrenschmidt wrote:
 On Thu, 2009-06-11 at 11:32 +1000, Michael Ellerman wrote:
  The way I think of it is that the merge window is the time for
  maintainers to merge with Linus.
  
  So if you're sending patches to a maintainer you need to have sent all
  your patches to them _before_ then. So the merge window for you is the
  weeks prior to the merge window.
 
 Right. But a patch generally needs time to be reviewed, spun several
 times, etc... so just the week before the merge window is probably too
 late :-)

Sure. I mean that's when you should be sending polished code that's
ready to merge. In the same way that the maintainers are sending
polished ready to merge code to Linus during the merge window.

But absolutely, most patches need to be reviewed at least once before
they're ready, which is probably a week at best.


But really people should just be sending patches ASAP, even if they're
not 100% finished, so they get as much exposure as early as possible.

Sitting on patches waiting for the right time to send them is the
wrong approach IMHO.

cheers


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] Re:[BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o]

2009-06-10 Thread Michael Ellerman
On Thu, 2009-06-11 at 07:26 +0530, Subrata Modak wrote:
 On Thu, 2009-06-11 at 11:05 +1000, Stephen Rothwell wrote:
  Hi Subrata,
  
  On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak 
  subr...@linux.vnet.ibm.com wrote:
  
 /* Find the TBI PHY.  If it's not there, we don't support SGMII */
   - ph = of_get_property(np, tbi-handle, NULL);
   + ph = (phandle *)of_get_property(np, tbi-handle, NULL);
  
  You don't need this cast because of_get_property() returns void *.
 
 Stephen,
 
 True. But without this gcc complains:
 
 CC [M]  drivers/net/ucc_geth.o
 drivers/net/ucc_geth.c: In function ‘ucc_geth_probe’:
 drivers/net/ucc_geth.c:3824: warning: assignment discards qualifiers from 
 pointer target type
   ^^^

And what does that warning actually mean?

Your cast actually introduces a bug.

cheers


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH][Resend][BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o]

2009-06-10 Thread Subrata Modak
Hi Michael,

On Thu, 2009-06-11 at 12:03 +1000, Michael Ellerman wrote:
On Thu, 2009-06-11 at 07:26 +0530, Subrata Modak wrote:
  On Thu, 2009-06-11 at 11:05 +1000, Stephen Rothwell wrote:
   Hi Subrata,
   
   On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak 
   subr...@linux.vnet.ibm.com wrote:
   
/* Find the TBI PHY.  If it's not there, we don't support SGMII 
*/
-   ph = of_get_property(np, tbi-handle, NULL);
+   ph = (phandle *)of_get_property(np, tbi-handle, NULL);
   
   You don't need this cast because of_get_property() returns void *.
  
  Stephen,
  
  True. But without this gcc complains:
  
  CC [M]  drivers/net/ucc_geth.o
  drivers/net/ucc_geth.c: In function ‘ucc_geth_probe’:
  drivers/net/ucc_geth.c:3824: warning: assignment discards qualifiers from 
  pointer target type
^^^
 
 And what does that warning actually mean?
 
 Your cast actually introduces a bug.


Ok fine. Here is a revised patch.

Subject: [PATCH][Resend][BUILD FAILURE 04/04] Next June 04:PPC64 randconfig 
[drivers/net/ucc_geth.o]
Reference(s):
http://lkml.org/lkml/2009/6/4/241,
http://lkml.org/lkml/2009/6/10/338,

Fix the following build error:

drivers/net/ucc_geth.c: In function bucc_geth_probeb:
drivers/net/ucc_geth.c:3822: error: 'ph' undeclared (first use in this function)
drivers/net/ucc_geth.c:3822: error: (Each undeclared identifier is reported 
only once
drivers/net/ucc_geth.c:3822: error: for each function it appears in.)
drivers/net/ucc_geth.c:3832: error: 'mdio' undeclared (first use in this 
function)
make[2]: *** [drivers/net/ucc_geth.o] Error 1

Signed-off-by: Subrata Modak subr...@linux.vnet.ibm.com
---

--- linux-2.6.30-rc8/drivers/net/ucc_geth.c.orig2009-06-10 
11:58:39.0 -0500
+++ linux-2.6.30-rc8/drivers/net/ucc_geth.c 2009-06-10 20:53:25.0 
-0500
@@ -3595,6 +3595,8 @@ static const struct net_device_ops ucc_g
 
 static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id 
*match)
 {
+   struct device_node *mdio;
+   phandle *ph;
struct device *device = ofdev-dev;
struct device_node *np = ofdev-node;
struct net_device *dev = NULL;

---
Regards--
Subrata

 cheers
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] Re:[BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o]

2009-06-10 Thread Tony Breeds
On Thu, Jun 11, 2009 at 07:26:04AM +0530, Subrata Modak wrote:
 On Thu, 2009-06-11 at 11:05 +1000, Stephen Rothwell wrote:
  Hi Subrata,
  
  On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak 
  subr...@linux.vnet.ibm.com wrote:
  
 /* Find the TBI PHY.  If it's not there, we don't support SGMII */
   - ph = of_get_property(np, tbi-handle, NULL);
   + ph = (phandle *)of_get_property(np, tbi-handle, NULL);
  
  You don't need this cast because of_get_property() returns void *.
 
 Stephen,
 
 True. But without this gcc complains:
 
 CC [M]  drivers/net/ucc_geth.o
 drivers/net/ucc_geth.c: In function ‘ucc_geth_probe’:
 drivers/net/ucc_geth.c:3824: warning: assignment discards qualifiers
 from pointer target type
 
 Else gcc just builds fine:
 
 CC [M]  drivers/net/ucc_geth.o
 
 This is an just an extra caution to fix both the build and warning
 regression(s).

ph needs to be const.

I think the following untested (and hence un-signed-off-by) patch is closer,
however I also think that the whole SGMII setup code could use the various OF
helper functions better :)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index e2f2e91..796253d 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3603,6 +3603,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const 
struct of_device_id *ma
struct resource res;
struct device_node *phy;
int err, ucc_num, max_speed = 0;
+   const phandle *ph;
const u32 *fixed_link;
const unsigned int *prop;
const char *sprop;
@@ -3821,7 +3822,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const 
struct of_device_id *ma
/* Find the TBI PHY.  If it's not there, we don't support SGMII */
ph = of_get_property(np, tbi-handle, NULL);
if (ph) {
-   struct device_node *tbi = of_find_node_by_phandle(*ph);
+   struct device_node *tbi = of_find_node_by_phandle(*ph), *mdio;
struct of_device *ofdev;
struct mii_bus *bus;
const unsigned int *id;

Yours Tony
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc/85xx: add nor flash partitions for mpc8569mds

2009-06-10 Thread Kumar Gala


On May 26, 2009, at 9:05 PM, Kevin Hao wrote:


Add 4 partitions in nor flash. Also fix nor flash
bank width bug.


Can you explain this.. I'm trying to understand why you set the bank- 
width to 1


- k




Signed-off-by: Kevin Hao kexin@windriver.com
---
arch/powerpc/boot/dts/mpc8569mds.dts |   24 +++-
1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/ 
boot/dts/mpc8569mds.dts

index 39c2927..1f98990 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -70,8 +70,30 @@
#size-cells = 1;
compatible = cfi-flash;
reg = 0x0 0x0 0x0200;
-   bank-width = 2;
+   bank-width = 1;
device-width = 1;
+   partit...@0 {
+   label = ramdisk;
+   reg = 0x 0x01c0;
+   };
+   partit...@1c0 {
+   label = kernel;
+   reg = 0x01c0 0x002e;
+   };
+   parti...@1ee {
+   label = dtb;
+   reg = 0x01ee 0x0002;
+   };
+   partit...@1f0 {
+   label = firmware;
+   reg = 0x01f0 0x0008;
+   read-only;
+   };
+   partit...@1f8 {
+   label = u-boot;
+   reg = 0x01f8 0x0008;
+   read-only;
+   };
};

b...@1,0 {
--
1.6.0.4.771.gef3b3


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Re:[BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o]

2009-06-10 Thread Nathan Lynch
Subrata Modak subr...@linux.vnet.ibm.com writes:

 On Thu, 2009-06-11 at 11:05 +1000, Stephen Rothwell wrote:
 Hi Subrata,
 
 On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak 
 subr...@linux.vnet.ibm.com wrote:
 
 /* Find the TBI PHY.  If it's not there, we don't support SGMII */
  -  ph = of_get_property(np, tbi-handle, NULL);
  +  ph = (phandle *)of_get_property(np, tbi-handle, NULL);
 
 You don't need this cast because of_get_property() returns void *.

 Stephen,

 True. But without this gcc complains:

 CC [M]  drivers/net/ucc_geth.o
 drivers/net/ucc_geth.c: In function ‘ucc_geth_probe’:
 drivers/net/ucc_geth.c:3824: warning: assignment discards qualifiers
 from pointer target type

ph should be declared const phandle *.  Look at other uses of
of_get_property.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2] 83xx: add support for the kmeter1 board.

2009-06-10 Thread Kumar Gala


On Apr 28, 2009, at 11:48 PM, Heiko Schocher wrote:


The following series implements basic board support for
the kmeter1 board from keymile, based on a MPC8360.

This series provides the following functionality:

- The board can boot with a serial console on UART1
- Ethernet:
   UCC1 in RGMII mode
   UCC2 in RGMII mode
   UCC4 in RMII mode
   UCC5 in RMII mode
   UCC6 in RMII mode
   UCC7 in RMII mode
   UCC8 in RMII mode

   following patch is necessary for working UCC in RMII mode:

   http://ozlabs.org/pipermail/linuxppc-dev/2009-April/070909.html

- Flash accessed via MTD layer

 On this hardware there is an Intel P30 flash, following patch
 series is necessary for working with this hardware:

 http://ozlabs.org/pipermail/linuxppc-dev/2009-April/070716.html

- I2C using I2C Bus 1 from the MPC8360 cpu

Signed-off-by: Heiko Schocher h...@denx.de
---
changes since v1:
- added comments from Kumar Gala and Scott Wood
- get rid of using get_immrbase() in board specific code

$ ./scripts/checkpatch.pl 0001--Patch-v2-83xx-add-support-for-the- 
kmeter1-board.patch

total: 0 errors, 0 warnings, 1626 lines checked

0001--Patch-v2-83xx-add-support-for-the-kmeter1-board.patch has no  
obvious style problems and is ready for submission.


arch/powerpc/boot/dts/kmeter1.dts   |  513 +++
arch/powerpc/configs/83xx/kmeter1_defconfig |  908 ++ 
+

arch/powerpc/platforms/83xx/Kconfig |7 +
arch/powerpc/platforms/83xx/Makefile|1 +
arch/powerpc/platforms/83xx/kmeter1.c   |  188 ++
5 files changed, 1617 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/boot/dts/kmeter1.dts
create mode 100644 arch/powerpc/configs/83xx/kmeter1_defconfig
create mode 100644 arch/powerpc/platforms/83xx/kmeter1.c

diff --git a/arch/powerpc/boot/dts/kmeter1.dts b/arch/powerpc/boot/ 
dts/kmeter1.dts

new file mode 100644
index 000..63c27da
--- /dev/null
+++ b/arch/powerpc/boot/dts/kmeter1.dts
@@ -0,0 +1,513 @@
+/*
+ * Keymile KMETER1 Device Tree Source
+ *
+ * 2008 DENX Software Engineering GmbH
+ *
+ * This program is free software; you can redistribute  it and/or  
modify it
+ * under  the terms of  the GNU General  Public License as  
published by the
+ * Free Software Foundation;  either version 2 of the  License, or  
(at your

+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+   model = KMETER1;
+   compatible = keymile,KMETER1;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = enet_piggy2;
+   ethernet1 = enet_estar1;
+   ethernet2 = enet_estar2;
+   ethernet3 = enet_eth1;
+   ethernet4 = enet_eth2;
+   ethernet5 = enet_eth3;
+   ethernet6 = enet_eth4;
+   serial0 = serial0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   PowerPC,8...@0 {
+   device_type = cpu;
+   reg = 0x0;
+   d-cache-line-size = 32; // 32 bytes
+   i-cache-line-size = 32; // 32 bytes
+   d-cache-size = 32768;   // L1, 32K
+   i-cache-size = 32768;   // L1, 32K
+   timebase-frequency = 0; /* Filled in by U-Boot */
+   bus-frequency = 0;  /* Filled in by U-Boot */
+   clock-frequency = 0;/* Filled in by U-Boot */
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0 0;  /* Filled in by U-Boot */
+   };
+
+   soc8...@e000 {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = soc;
+   compatible = simple-bus;



this should be:

compatible = fsl,mpc8360-immr, simple-bus;



+   ranges = 0x0 0xe000 0x0020;
+   reg = 0xe000 0x0200;
+   bus-frequency = 0;  /* Filled in by U-Boot */
+




+   ipic: p...@700 {
+   #address-cells = 0;
+   #interrupt-cells = 2;
+   compatible = fsl,pq2pro-pic, fsl,ipic;
+   interrupt-controller;
+   reg = 0x700 0x100;
+   device_type = ipic;


drop the device_type.



+   };
+




+   q...@10 {
+   #address-cells = 1;
+   #size-cells = 1;
+   device_type = qe;
+   compatible = fsl,qe;
+   ranges = 0x0 0x10 0x10;
+   reg = 0x10 0x480;
+   clock-frequency = 0;/* Filled in by U-Boot */
+   brg-frequency = 0;  /* Filled in by U-Boot */
+   bus-frequency = 0;  /* Filled in by U-Boot */
+
+




Re: [PATCH] powerpc: minimizing the configuration of linkstation_defconfig

2009-06-10 Thread Kumar Gala


On May 16, 2009, at 11:04 AM, Rogério Brito wrote:


Hi, Kumar, Guennadi, and Co.


This patch addresses the following issues:

01. makes CFQ the default scheduler, to be in line with the rest of
the kernel.

02. since linkstations are meant to store files, enable large blk
devices.

03. disable CONFIG_MIGRATION in in such low memory devices.

04. disable CONFIG_BLK_DEV_RAM.

05. disable CONFIG_SCSI_LOWLEVEL, as no device under that tree is
used.

06. idem for CONFIG_NETDEV_1.

07. idem for CONFIG_WIRELESS.

08. idem for CONFIG_HWMON.

09. idem for CONFIG_CRYPTO_HW.

10. disable CONFIG_VIDEO_OUTPUT_CONTROL.

11. keep consistency and disable extended attributes in CIFS, ext3,
and NFS.

12. enable CONFIG_PRINTK_TIME.

Signed-off-by: Rogério Brito rbr...@ime.usp.br

---

This is the patch for tidying the defconfig. I'm still having issues
with the MTD devices, it seems. :-( I will investigate this now.

I can send a similar patch to storcenter.


Did you ever resolve the MTD issue?

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] fsldma: use PCI Read Multiple command

2009-06-10 Thread Kumar Gala


On Apr 27, 2009, at 3:49 PM, Dan Williams wrote:

On Mon, Apr 27, 2009 at 1:47 PM, Timur Tabi ti...@freescale.com  
wrote:

Adding Kumar to the CC: list, since he might pick up the patch.



Acked-by: Dan Williams dan.j.willi...@intel.com

I agree with taking this through Kumar's tree.


I'm going through patches for .31.. Should I still pick this up?   
Going forward should I pick up fsldma patches?


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc/boot: cuboot: Fix up ethernet3 MAC address on MPC85xx

2009-06-10 Thread Kumar Gala


On Jun 8, 2009, at 5:17 PM, Nate Case wrote:


MPC85xx platforms do support 4 ethernet ports, so make sure the boot
wrapper fixes up all of them in the fdt.

Signed-off-by: Nate Case nc...@xes-inc.com
---
arch/powerpc/boot/cuboot-85xx.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/cuboot-85xx.c b/arch/powerpc/boot/ 
cuboot-85xx.c

index 6776a1a..277ba4a 100644
--- a/arch/powerpc/boot/cuboot-85xx.c
+++ b/arch/powerpc/boot/cuboot-85xx.c
@@ -15,6 +15,7 @@
#include cuboot.h

#define TARGET_85xx
+#define TARGET_HAS_ETH3


This is problematic in that we'd be changing the memory layout of the  
bd_t and not ALL 85xx's have HAS_ETH3 set.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: linux-next: powerpc tree build warning

2009-06-10 Thread Benjamin Herrenschmidt
On Thu, 2009-06-11 at 11:39 +1000, Stephen Rothwell wrote:
 Hi Ben,
 
 Today's linux-next build (powerpc ppc64_defconfig) produced this warning:
 
 arch/powerpc/platforms/Kconfig.cputype:60:warning: defaults for choice values 
 not supported
 
 We appear to have CONFIG_PPC_BOOK3S int two places which is confusing
 Kconfig.

Yes, I see that. One place depends on PPC32 and the other one PPC64, but
it still seems to be somewhat confused. In any case, it seems to still
do the right thing, so not a big hurry here, but I'll do a patch that
does it differently.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: ipr boot failure caused by MSI (2.6.30-rc1+)

2009-06-10 Thread Wayne Boyer


Brian King wrote:
 James Bottomley wrote:
 On Thu, 2009-05-21 at 14:51 -0500, James Bottomley wrote:
 I saw the quirk fix for this go by:

 http://ozlabs.org/pipermail/linuxppc-dev/2009-May/072436.html

 Is there an easy way to trigger an interrupt on this device?  Preferably
 in ipr_probe_ioa() so we can at least print out if the interrupts are
 misrouted and fall back from MSI to normal using the PCI infrastructure?
 
 I just talked with one of the adapter firmware developers and it sounds like
 this might be possible. I'll work with Wayne on coding something up to try.
 
 -Brian
 

I've put together some code to trigger the test MSI and either fall back to
LSI if it isn't detected, or continue on using MSI.  In the routine that
does the setup and test I have this call to request_irq:

rc = request_irq(pdev-irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);

Note that the flags value is '0'.  The question came up as to whether or
not this value should really be IRQF_SHARED.  Given that this is for an MSI
interrupt and MSI interrupts are not shared by definition, IRQF_SHARED did
not seem correct.

What should the flags value be in this case?


-- 
Wayne Boyer
IBM - Beaverton, Oregon
LTC S/W Development - eServerIO
(503) 578-5236, T/L 775-5236
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] mpc83xx/usb.c: fix usb mux setup for mpc834x

2009-06-10 Thread Kumar Gala


On Jun 9, 2009, at 6:43 AM, Peter Korsgaard wrote:


usb0 and usb1 mux settings in the sicrl register were swapped (twice!)
in mpc834x_usb_cfg(), leading to various strange issues with fsl-ehci
and full speed devices.

The USB port config on mpc834x is done using 2 muxes: Port 0 is always
used for MPH port 0, and port 1 can either be used for MPH port 1 or  
DR
(unless DR uses TMDI phy or OTG, then it uses both ports) - See 8349  
RM

figure 1-4..

mpc8349_usb_cfg() had this inverted for the DR, and it also had the  
bit

positions of the usb0 / usb1 mux settings swapped. It would basically
work if you specified port1 instead of port0 for the MPH controller  
(and

happened to use ULPI phys), which is what all the 834x dts have done,
even though that configuration is physically invalid.

Instead fix mpc8349_usb_cfg() and adjust the dts files to match  
reality.


Signed-off-by: Peter Korsgaard jac...@sunsite.dk
---
arch/powerpc/boot/dts/asp834x-redboot.dts |2 +-
arch/powerpc/boot/dts/mpc8349emitx.dts|2 +-
arch/powerpc/boot/dts/mpc834x_mds.dts |2 +-
arch/powerpc/boot/dts/sbc8349.dts |2 +-
arch/powerpc/platforms/83xx/mpc83xx.h |4 ++--
arch/powerpc/platforms/83xx/usb.c |   10 +-
6 files changed, 11 insertions(+), 11 deletions(-)


applied.. Please remind me to send this linux-stable for .30 and .29

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH][Resend 2][BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o]

2009-06-10 Thread Subrata Modak
Hi Nathan,

On Wed, 2009-06-10 at 21:28 -0500, Nathan Lynch wrote:
Subrata Modak subr...@linux.vnet.ibm.com writes:
 
  On Thu, 2009-06-11 at 11:05 +1000, Stephen Rothwell wrote:
  Hi Subrata,
  
  On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak 
  subr...@linux.vnet.ibm.com wrote:
  
/* Find the TBI PHY.  If it's not there, we don't support SGMII 
   */
   -ph = of_get_property(np, tbi-handle, NULL);
   +ph = (phandle *)of_get_property(np, tbi-handle, NULL);
  
  You don't need this cast because of_get_property() returns void *.
 
  Stephen,
 
  True. But without this gcc complains:
 
  CC [M]  drivers/net/ucc_geth.o
  drivers/net/ucc_geth.c: In function ‘ucc_geth_probe’:
  drivers/net/ucc_geth.c:3824: warning: assignment discards qualifiers
  from pointer target type
 
 ph should be declared const phandle *.  Look at other uses of
 of_get_property.


Ok fine. Here is a revised patch again.

Subject: [PATCH][Resend 2][BUILD FAILURE 04/04] Next June 04:PPC64 randconfig 
[drivers/net/ucc_geth.o]
Reference(s):
http://lkml.org/lkml/2009/6/4/241,
http://lkml.org/lkml/2009/6/10/338,

Fix the following build error:

drivers/net/ucc_geth.c: In function bucc_geth_probeb:
drivers/net/ucc_geth.c:3822: error: 'ph' undeclared (first use in this function)
drivers/net/ucc_geth.c:3822: error: (Each undeclared identifier is reported 
only once
drivers/net/ucc_geth.c:3822: error: for each function it appears in.)
drivers/net/ucc_geth.c:3832: error: 'mdio' undeclared (first use in this 
function)
make[2]: *** [drivers/net/ucc_geth.o] Error 1

Signed-off-by: Subrata Modak subr...@linux.vnet.ibm.com
---

--- linux-2.6.30-rc8/drivers/net/ucc_geth.c.orig2009-06-10 
11:58:39.0 -0500
+++ linux-2.6.30-rc8/drivers/net/ucc_geth.c 2009-06-10 22:28:13.0 
-0500
@@ -3595,6 +3595,8 @@ static const struct net_device_ops ucc_g
 
 static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id 
*match)
 {
+   struct device_node *mdio;
+   const phandle *ph;
struct device *device = ofdev-dev;
struct device_node *np = ofdev-node;
struct net_device *dev = NULL;

---
Regards--
Subrata

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH -next] powerpc/fsl-booke: Enable L1 cache on e500v1/e500v2/e500mc CPUs

2009-06-10 Thread Kumar Gala


On Jun 10, 2009, at 3:37 PM, Nate Case wrote:


Some boot loaders may not enable L1 instruction/data cache.  Check if
data and instruction caches are enabled, and enable them if needed.

Signed-off-by: Nate Case nc...@xes-inc.com
---
arch/powerpc/include/asm/reg_booke.h  |2 +
arch/powerpc/kernel/cpu_setup_fsl_booke.S |   49  
+++--

2 files changed, 48 insertions(+), 3 deletions(-)


applied to next

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc/boot: cuboot: Fix up ethernet3 MAC address on MPC85xx

2009-06-10 Thread Nathaniel Case
On Wed, 10 Jun 2009 21:54:01 -0500, Kumar Gala ga...@kernel.crashing.org
wrote:
 #define TARGET_85xx
 +#define TARGET_HAS_ETH3
 
 This is problematic in that we'd be changing the memory layout of the  
 bd_t and not ALL 85xx's have HAS_ETH3 set.

It shouldn't be problematic.  The bi_enet3addr field is at the end of the
structure on MPC85xx.  The only fields after it in ppcboot.h are
4xx-specific
fields.  I believe the MAC addresses were placed at the end of the struct
for
this very reason.

-- 
Nate Case nc...@xes-inc.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] serial: Fix bug of ucc_uart

2009-06-10 Thread Kumar Gala


On Jun 8, 2009, at 9:24 AM, Dave Liu wrote:


Current ucc_uart driver doesn't work at UART mode,
The TxBD[READY] is not cleared by H/W (RISC engine)
when user send characters to Tx buffer of QE UART.
so, these characters stay on the QE forever, never
go to UART line.

The patch is fixing th bug.

Signed-off-by: Dave Liu dave...@freescale.com
---
drivers/serial/ucc_uart.c |   19 ++-
1 files changed, 14 insertions(+), 5 deletions(-)


applied to next.

(Cleaned up the commit message a bit)

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc/boot: cuboot: Fix up ethernet3 MAC address on MPC85xx

2009-06-10 Thread Kumar Gala


On Jun 10, 2009, at 10:40 PM, Nathaniel Case wrote:

On Wed, 10 Jun 2009 21:54:01 -0500, Kumar Gala ga...@kernel.crashing.org 


wrote:

#define TARGET_85xx
+#define TARGET_HAS_ETH3


This is problematic in that we'd be changing the memory layout of the
bd_t and not ALL 85xx's have HAS_ETH3 set.


It shouldn't be problematic.  The bi_enet3addr field is at the end  
of the

structure on MPC85xx.  The only fields after it in ppcboot.h are
4xx-specific
fields.  I believe the MAC addresses were placed at the end of the  
struct

for
this very reason.


ahh, good point... I'll add this detail to the commit message when I  
commit this.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc/boot: cuboot: Fix up ethernet3 MAC address on MPC85xx

2009-06-10 Thread Kumar Gala


On Jun 8, 2009, at 5:17 PM, Nate Case wrote:


MPC85xx platforms do support 4 ethernet ports, so make sure the boot
wrapper fixes up all of them in the fdt.

Signed-off-by: Nate Case nc...@xes-inc.com
---
arch/powerpc/boot/cuboot-85xx.c |2 ++
1 files changed, 2 insertions(+), 0 deletions(-)


applied (updated commit message) to next

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH][BUILD FAILURE 03/04] Next June 04:PPC64 randconfig [drivers/net/lance.o]

2009-06-10 Thread Subrata Modak
Hi Benjamin/Paul,

On Thu, 2009-06-04 at 19:02 +0530, Subrata Modak wrote:
CC  drivers/net/lance.o
 drivers/net/lance.c: In function 'lance_probe1':
 drivers/net/lance.c:575: error: implicit declaration of function 
 'isa_virt_to_bus'
 drivers/net/lance.c: In function 'lance_rx':
 drivers/net/lance.c:1197: error: implicit declaration of function 
 'isa_bus_to_virt'
 make[2]: *** [drivers/net/lance.o] Error 1
 make[1]: *** [drivers/net] Error 2
 make: *** [drivers] Error 2

Reference: http://lkml.org/lkml/2009/6/4/240,
To fix the following build error:

drivers/net/lance.c: In function 'lance_probe1':
drivers/net/lance.c:575: error: implicit declaration of function 
'isa_virt_to_bus'
drivers/net/lance.c: In function 'lance_rx':
drivers/net/lance.c:1197: error: implicit declaration of function 
'isa_bus_to_virt'
make[2]: *** [drivers/net/lance.o] Error 1
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

I would like to propose the following patch. The prototypes for the functions:
'isa_virt_to_bus'  'isa_virt_to_bus' are existing for some archs like the
mips, x86, parisc, arm  alpha, but, is missing for powerpc. Is it safe to
introduce the following soultion for powerpc ? It fixes the build problem
i reported earlier.

Signed-off-by: Subrata Modak subr...@linux.vnet.ibm.com
---

--- linux-2.6.30-rc8/arch/powerpc/include/asm/io.h.orig 2009-06-10 
21:56:49.0 -0500
+++ linux-2.6.30-rc8/arch/powerpc/include/asm/io.h  2009-06-10 
22:21:35.0 -0500
@@ -680,6 +680,9 @@ extern void __iounmap_at(void *ea, unsig
 #define mmio_outsw(addr, src, count)   writesw(addr, src, count)
 #define mmio_outsl(addr, src, count)   writesl(addr, src, count)
 
+#define isa_virt_to_busvirt_to_phys
+#define isa_bus_to_virtphys_to_virt
+
 /**
  * virt_to_phys-   map virtual addresses to physical
  * @address: address to remap

---
Regards--
Subrata

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] sata_fsl: Add power mgmt support

2009-06-10 Thread Kumar Gala
From: Dave Liu dave...@freescale.com

Signed-off-by: Dave Liu dave...@freescale.com
Signed-off-by: Liu Yu yu@freescale.com
Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 drivers/ata/sata_fsl.c |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 36b8629..94eaa43 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1378,6 +1378,37 @@ static int sata_fsl_remove(struct of_device *ofdev)
return 0;
 }
 
+#ifdef CONFIG_PM
+static int sata_fsl_suspend(struct of_device *op, pm_message_t state)
+{
+   struct ata_host *host = dev_get_drvdata(op-dev);
+   return ata_host_suspend(host, state);
+}
+
+static int sata_fsl_resume(struct of_device *op)
+{
+   struct ata_host *host = dev_get_drvdata(op-dev);
+   struct sata_fsl_host_priv *host_priv = host-private_data;
+   int ret;
+   void __iomem *hcr_base = host_priv-hcr_base;
+   struct ata_port *ap = host-ports[0];
+   struct sata_fsl_port_priv *pp = ap-private_data;
+
+   ret = sata_fsl_init_controller(host);
+   if (ret) {
+   dev_printk(KERN_ERR, op-dev,
+   Error initialize hardware\n);
+   return ret;
+   }
+
+   /* Recovery the CHBA register in host controller cmd register set */
+   iowrite32(pp-cmdslot_paddr  0x, hcr_base + CHBA);
+
+   ata_host_resume(host);
+   return 0;
+}
+#endif
+
 static struct of_device_id fsl_sata_match[] = {
{
.compatible = fsl,pq-sata,
@@ -1392,6 +1423,10 @@ static struct of_platform_driver fsl_sata_driver = {
.match_table= fsl_sata_match,
.probe  = sata_fsl_probe,
.remove = sata_fsl_remove,
+#ifdef CONFIG_PM
+   .suspend= sata_fsl_suspend,
+   .resume = sata_fsl_resume,
+#endif
 };
 
 static int __init sata_fsl_init(void)
-- 
1.6.0.6

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] powerpc/fsl_lbc: Increase the number of possible lbc banks

2009-06-10 Thread mware
Currently the fsl,*lbc devices support 8 banks (ie OR and BR registers).
This is adequate for most pq2 and pq3 processors, but not the MPC8280 which
has 12 banks.

Signed-Off-By: Mark Ware mw...@elphinstone.net
---
 arch/powerpc/include/asm/fsl_lbc.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/fsl_lbc.h 
b/arch/powerpc/include/asm/fsl_lbc.h
index 63a4f77..1b5a210 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -95,8 +95,8 @@ struct fsl_lbc_bank {
 };

 struct fsl_lbc_regs {
-   struct fsl_lbc_bank bank[8];
-   u8 res0[0x28];
+   struct fsl_lbc_bank bank[12];
+   u8 res0[0x8];
__be32 mar; /** UPM Address Register */
u8 res1[0x4];
__be32 mamr;/** UPMA Mode Register */
--
1.5.6.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/6] rapidio: add common mapping APIs for RapidIO memory access

2009-06-10 Thread Kumar Gala


On May 12, 2009, at 3:35 AM, Li Yang wrote:


Add the mapping functions used to support direct IO memory access of
rapidIO.

Signed-off-by: Zhang Wei z...@zh-kernel.org
Signed-off-by: Li Yang le...@freescale.com


Use inbnd/outbnd instead of inb/outb which make one think of byte  
level io accessors.


As I look at this I don't think this is the correct API.  I think we  
should be using the DMA mapping API to hide these details.  The  
concept of mapping like this seems to be more a function of FSL's  
Address translation/mapping unit (ATMU) than anything specific to the  
RIO bus standard.



---
drivers/rapidio/rio.c   |   95 ++ 
+

include/linux/rio.h |   25 
include/linux/rio_drv.h |   24 +---
3 files changed, 138 insertions(+), 6 deletions(-)


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: MPC85xx erratum I2C1 - I2C controller is unable to generate clocks when SDA is low coming out of reset

2009-06-10 Thread Kumar Gala


On May 26, 2009, at 3:22 AM, Fredrik Arnerup wrote:


We've had some trouble with I2C not working after a soft reboot,
which we think is due to the the erratum I2C1 which is present in
at least the mpc8540 and the mpc8560. Since there is no good  
workaround,
the only choice seems to be to avoid resetting the CPU while the I2C  
bus is

busy.

The problem seems to be that the i2c-mpc driver leaves I2C in a busy  
state

when
it receives a signal (e.g. upon shutdown).
The code below is not meant as a patch, just me thinking aloud.
Thoughts?

/Fredrik Arnerup
fredrik.arne...@edgeware.tv

Index: drivers/i2c/busses/i2c-mpc.c
===
--- drivers/i2c/busses/i2c-mpc.c(revision 6933)
+++ drivers/i2c/busses/i2c-mpc.c(working copy)
@@ -262,12 +262,14 @@
   /* Allow bus up to 1s to become not busy */
   while (readb(i2c-base + MPC_I2C_SR)  CSR_MBB) {
   if (signal_pending(current)) {
-   pr_debug(I2C: Interrupted\n);
-   writeccr(i2c, 0);
+   printk(KERN_WARNING I2C: Interrupted\n);
+   if (readb(i2c-base + MPC_I2C_SR) ==
+   (CSR_MCF | CSR_MBB | CSR_RXAK))
+   mpc_i2c_fixup(i2c);
   return -EINTR;
   }
   if (time_after(jiffies, orig_jiffies + HZ)) {
-   pr_debug(I2C: timeout\n);
+   printk(KERN_WARNING I2C: mpc_xfer() timeout 
\n);

   if (readb(i2c-base + MPC_I2C_SR) ==
   (CSR_MCF | CSR_MBB | CSR_RXAK))
   mpc_i2c_fixup(i2c);



I don't think we should have the printk's.  Its possible that we hit  
the interrupted condition while using the i2c from user space.


- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


  1   2   >