LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Jon Loeliger @ 2007-06-02 16:04 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <e2020ffad171013c07f8809e1e1aef97@kernel.crashing.org>

So, like, the other day Segher Boessenkool mumbled:
> 
> That, and I often get tired of seeing the same mistakes
> over and over again.  When I see a proposed tree that's
> just too awful I don't really know where to start.

That is a good point.

I think there are several factors at work here.  First and
foremost, I am not an expert in this area; it is new to me.
I am not afraid to say that I really need the guidance of
an expert here.  Second, perhaps there is lingering legacy
crap in some of the early DTS files that should be systematically
cleaned up.  Many of them were written during a time when we
were really first learning about the whole Device Tree.  While
they may have been there on some, say, Apple boards, it's all
new for the FSL embedded parts.  Cloned mistakes then likely
contributed to the problems and should be fixed.  Finally,
perhaps our documentation on how some of the important fields
should work or be derived is lacking and could be improved.
Suggestions or patches down this line would likely be welcomed.

> I also find the DTS source format a bit hard to read,
> but maybe that's just me.

I, at least, am open to suggestions that might improve it.

Thanks,
jdl

^ permalink raw reply

* Re: [RFC/PATCH 4/4] powerpc: Make syscall restart code more common
From: Benjamin Herrenschmidt @ 2007-06-02 11:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linuxppc-dev, Paul Mackerras, Anton Blanchard, ulrich.weigand
In-Reply-To: <20070602101239.GA21478@lst.de>


> Here's an updated version to create a signal.[ch] instead.  It will be
> used by the signal consolidation patches I'll post now.

Excellent, thanks !

Cheers,
Ben.

^ permalink raw reply

* [PATCH 2/3] consolidate restore_sigmask
From: Christoph Hellwig @ 2007-06-02 10:25 UTC (permalink / raw)
  To: linuxppc-dev

restore_sigmask is exactly the same on 32 and 64bit, so move it to
common code. Also move _BLOCKABLE to signal.h to avoid defining it
multiple times.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/arch/powerpc/kernel/signal.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal.c	2007-06-01 22:33:06.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal.c	2007-06-01 22:34:37.000000000 +0200
@@ -10,6 +10,21 @@
 #include <linux/ptrace.h>
 #include <linux/signal.h>
 
+#include "signal.h"
+
+
+/*
+ * Restore the user process's signal mask
+ */
+void restore_sigmask(sigset_t *set)
+{
+	sigdelsetmask(set, ~_BLOCKABLE);
+	spin_lock_irq(&current->sighand->siglock);
+	current->blocked = *set;
+	recalc_sigpending();
+	spin_unlock_irq(&current->sighand->siglock);
+}
+
 void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
 		int has_handler)
 {
Index: linux-2.6/arch/powerpc/kernel/signal.h
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal.h	2007-06-01 22:33:06.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal.h	2007-06-01 22:34:14.000000000 +0200
@@ -1,3 +1,6 @@
 
+#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
+
+void restore_sigmask(sigset_t *set);
 void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
 		int has_handler);
Index: linux-2.6/arch/powerpc/kernel/signal_32.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_32.c	2007-06-01 22:33:06.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_32.c	2007-06-01 22:34:11.000000000 +0200
@@ -55,8 +55,6 @@
 
 #undef DEBUG_SIG
 
-#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
-
 #ifdef CONFIG_PPC64
 #define do_signal	do_signal32
 #define sys_sigsuspend	compat_sys_sigsuspend
@@ -697,23 +695,6 @@ int compat_sys_sigaltstack(u32 __new, u3
 }
 #endif /* CONFIG_PPC64 */
 
-
-/*
- * Restore the user process's signal mask
- */
-#ifdef CONFIG_PPC64
-extern void restore_sigmask(sigset_t *set);
-#else /* CONFIG_PPC64 */
-static void restore_sigmask(sigset_t *set)
-{
-	sigdelsetmask(set, ~_BLOCKABLE);
-	spin_lock_irq(&current->sighand->siglock);
-	current->blocked = *set;
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-}
-#endif
-
 /*
  * Set up a signal frame for a "real-time" signal handler
  * (one which gets siginfo).
Index: linux-2.6/arch/powerpc/kernel/signal_64.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_64.c	2007-06-01 22:33:06.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_64.c	2007-06-01 22:34:18.000000000 +0200
@@ -38,8 +38,6 @@
 
 #define DEBUG_SIG 0
 
-#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
-
 #define GP_REGS_SIZE	min(sizeof(elf_gregset_t), sizeof(struct pt_regs))
 #define FP_REGS_SIZE	sizeof(elf_fpregset_t)
 
@@ -243,19 +241,6 @@ static long setup_trampoline(unsigned in
 }
 
 /*
- * Restore the user process's signal mask (also used by signal32.c)
- */
-void restore_sigmask(sigset_t *set)
-{
-	sigdelsetmask(set, ~_BLOCKABLE);
-	spin_lock_irq(&current->sighand->siglock);
-	current->blocked = *set;
-	recalc_sigpending();
-	spin_unlock_irq(&current->sighand->siglock);
-}
-
-
-/*
  * Handle {get,set,swap}_context operations
  */
 int sys_swapcontext(struct ucontext __user *old_ctx,

^ permalink raw reply

* [PATCH 1/3] consolidate sys_sigaltstack
From: Christoph Hellwig @ 2007-06-02 10:25 UTC (permalink / raw)
  To: linuxppc-dev

[note: this patchset is ontop of ben's ptrace patches, with the last one
 replaced by the version I posted]

sys_sigaltstack is the same on 32bit and 64 and we can consolidate it
to signal.c.  The only difference is that the 32bit code uses ints
for the unused register paramaters and 64bit unsigned long.  I've
changed it to unsigned long because it's the same width on 32bit.

(I also wonder who came up with this awkward calling convention.. :))


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/arch/powerpc/kernel/signal_32.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_32.c	2007-06-02 11:14:48.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_32.c	2007-06-02 11:14:58.000000000 +0200
@@ -253,14 +253,6 @@ long sys_sigsuspend(old_sigset_t mask)
  	return -ERESTARTNOHAND;
 }
 
-#ifdef CONFIG_PPC32
-long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, int r5,
-		int r6, int r7, int r8, struct pt_regs *regs)
-{
-	return do_sigaltstack(uss, uoss, regs->gpr[1]);
-}
-#endif
-
 long sys_sigaction(int sig, struct old_sigaction __user *act,
 		struct old_sigaction __user *oact)
 {
Index: linux-2.6/arch/powerpc/kernel/signal_64.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_64.c	2007-06-02 11:14:48.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_64.c	2007-06-02 11:14:58.000000000 +0200
@@ -66,14 +66,6 @@ struct rt_sigframe {
 	char abigap[288];
 } __attribute__ ((aligned (16)));
 
-long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, unsigned long r5,
-		     unsigned long r6, unsigned long r7, unsigned long r8,
-		     struct pt_regs *regs)
-{
-	return do_sigaltstack(uss, uoss, regs->gpr[1]);
-}
-
-
 /*
  * Set up the sigcontext for the signal frame.
  */
Index: linux-2.6/include/asm-powerpc/syscalls.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/syscalls.h	2007-06-02 11:06:36.000000000 +0200
+++ linux-2.6/include/asm-powerpc/syscalls.h	2007-06-02 11:14:58.000000000 +0200
@@ -43,16 +43,9 @@ asmlinkage long ppc_newuname(struct new_
 
 asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset,
 		size_t sigsetsize);
-
-#ifndef __powerpc64__
-asmlinkage long sys_sigaltstack(const stack_t __user *uss,
-		stack_t __user *uoss, int r5, int r6, int r7, int r8,
-		struct pt_regs *regs);
-#else /* __powerpc64__ */
 asmlinkage long sys_sigaltstack(const stack_t __user *uss,
 		stack_t __user *uoss, unsigned long r5, unsigned long r6,
 		unsigned long r7, unsigned long r8, struct pt_regs *regs);
-#endif /* __powerpc64__ */
 
 #endif /* __KERNEL__ */
 #endif /* __ASM_POWERPC_SYSCALLS_H */
Index: linux-2.6/arch/powerpc/kernel/signal.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal.c	2007-06-02 11:14:48.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal.c	2007-06-02 11:15:09.000000000 +0200
@@ -60,3 +60,10 @@ void check_syscall_restart(struct pt_reg
 		regs->ccr |= 0x10000000;
 	}
 }
+
+long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
+		unsigned long r5, unsigned long r6, unsigned long r7,
+		unsigned long r8, struct pt_regs *regs)
+{
+	return do_sigaltstack(uss, uoss, regs->gpr[1]);
+}

^ permalink raw reply

* [PATCH 3/3] consolidate do_signal
From: Christoph Hellwig @ 2007-06-02 10:21 UTC (permalink / raw)
  To: linuxppc-dev

do_signal has exactly the same behaviour on 32bit and 64bit and 32bit
compat on 64bit for handling 32bit signals.  Consolidate all these
into one common function in signal.c.  The oly odd left over is
the try_to_free in the 32bit version that no other architecture has
in mainline (only in i386 for some odd SuSE release).  We should
probably get rid of it in a separate patch.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/arch/powerpc/kernel/signal.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal.c	2007-06-02 11:15:15.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal.c	2007-06-02 11:16:02.000000000 +0200
@@ -7,12 +7,26 @@
  * this archive for more details.
  */
 
+#include <linux/freezer.h>
 #include <linux/ptrace.h>
 #include <linux/signal.h>
 
 #include "signal.h"
 
 
+#ifdef CONFIG_PPC64
+static inline int is_32bit_task(void)
+{
+	return test_thread_flag(TIF_32BIT);
+}
+#else
+static inline int is_32bit_task(void)
+{
+	return 1;
+}
+#endif
+
+
 /*
  * Restore the user process's signal mask
  */
@@ -25,7 +39,7 @@ void restore_sigmask(sigset_t *set)
 	spin_unlock_irq(&current->sighand->siglock);
 }
 
-void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
+static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
 		int has_handler)
 {
 	unsigned long ret = regs->gpr[3];
@@ -76,6 +90,95 @@ void check_syscall_restart(struct pt_reg
 	}
 }
 
+int do_signal(sigset_t *oldset, struct pt_regs *regs)
+{
+	siginfo_t info;
+	int signr;
+	struct k_sigaction ka;
+	int ret;
+	int is32 = is_32bit_task();
+
+#ifdef CONFIG_PPC32
+	if (try_to_freeze()) {
+		signr = 0;
+		if (!signal_pending(current))
+			goto no_signal;
+	}
+#endif
+
+	if (test_thread_flag(TIF_RESTORE_SIGMASK))
+		oldset = &current->saved_sigmask;
+	else if (!oldset)
+		oldset = &current->blocked;
+
+	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
+
+#ifdef CONFIG_PPC32
+no_signal:
+#endif
+	/* Is there any syscall restart business here ? */
+	check_syscall_restart(regs, &ka, signr > 0);
+
+	if (signr <= 0) {
+		/* No signal to deliver -- put the saved sigmask back */
+		if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
+			clear_thread_flag(TIF_RESTORE_SIGMASK);
+			sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
+		}
+		return 0;               /* no signals delivered */
+	}
+
+#ifdef CONFIG_PPC64
+        /*
+	 * Reenable the DABR before delivering the signal to
+	 * user space. The DABR will have been cleared if it
+	 * triggered inside the kernel.
+	 */
+	if (current->thread.dabr)
+		set_dabr(current->thread.dabr);
+#endif
+
+	if (is32) {
+		unsigned int newsp;
+
+		if ((ka.sa.sa_flags & SA_ONSTACK) &&
+		    current->sas_ss_size && !on_sig_stack(regs->gpr[1]))
+			newsp = current->sas_ss_sp + current->sas_ss_size;
+		else
+			newsp = regs->gpr[1];
+
+        	if (ka.sa.sa_flags & SA_SIGINFO)
+			ret = handle_rt_signal32(signr, &ka, &info, oldset,
+					regs, newsp);
+		else
+			ret = handle_signal32(signr, &ka, &info, oldset,
+					regs, newsp);
+#ifdef CONFIG_PPC64
+	} else {
+		ret = handle_rt_signal64(signr, &ka, &info, oldset, regs);
+#endif
+	}
+
+	if (ret) {
+		spin_lock_irq(&current->sighand->siglock);
+		sigorsets(&current->blocked, &current->blocked,
+			  &ka.sa.sa_mask);
+		if (!(ka.sa.sa_flags & SA_NODEFER))
+			sigaddset(&current->blocked, signr);
+		recalc_sigpending();
+		spin_unlock_irq(&current->sighand->siglock);
+
+		/*
+		 * A signal was successfully delivered; the saved sigmask is in
+		 * its frame, and we can clear the TIF_RESTORE_SIGMASK flag.
+		 */
+		if (test_thread_flag(TIF_RESTORE_SIGMASK))
+			clear_thread_flag(TIF_RESTORE_SIGMASK);
+	}
+
+	return ret;
+}
+
 long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
 		unsigned long r5, unsigned long r6, unsigned long r7,
 		unsigned long r8, struct pt_regs *regs)
Index: linux-2.6/arch/powerpc/kernel/signal.h
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal.h	2007-06-02 11:15:15.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal.h	2007-06-02 11:15:19.000000000 +0200
@@ -2,5 +2,11 @@
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
 void restore_sigmask(sigset_t *set);
-void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
-		int has_handler);
+int handle_signal32(unsigned long sig, struct k_sigaction *ka,
+		siginfo_t *info, sigset_t *oldset, struct pt_regs *regs,
+		unsigned long newsp);
+int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
+		siginfo_t *info, sigset_t *oldset,
+		struct pt_regs *regs, unsigned long newsp);
+int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
+		sigset_t *set, struct pt_regs *regs);
Index: linux-2.6/arch/powerpc/kernel/signal_32.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_32.c	2007-06-02 11:15:15.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_32.c	2007-06-02 11:15:19.000000000 +0200
@@ -56,7 +56,6 @@
 #undef DEBUG_SIG
 
 #ifdef CONFIG_PPC64
-#define do_signal	do_signal32
 #define sys_sigsuspend	compat_sys_sigsuspend
 #define sys_rt_sigsuspend	compat_sys_rt_sigsuspend
 #define sys_rt_sigreturn	compat_sys_rt_sigreturn
@@ -231,8 +230,6 @@ static inline int restore_general_regs(s
 
 #endif /* CONFIG_PPC64 */
 
-int do_signal(sigset_t *oldset, struct pt_regs *regs);
-
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
@@ -699,7 +696,7 @@ int compat_sys_sigaltstack(u32 __new, u3
  * Set up a signal frame for a "real-time" signal handler
  * (one which gets siginfo).
  */
-static int handle_rt_signal(unsigned long sig, struct k_sigaction *ka,
+int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
 		siginfo_t *info, sigset_t *oldset,
 		struct pt_regs *regs, unsigned long newsp)
 {
@@ -990,7 +987,7 @@ int sys_debug_setcontext(struct ucontext
 /*
  * OK, we're invoking a handler
  */
-static int handle_signal(unsigned long sig, struct k_sigaction *ka,
+int handle_signal32(unsigned long sig, struct k_sigaction *ka,
 		siginfo_t *info, sigset_t *oldset, struct pt_regs *regs,
 		unsigned long newsp)
 {
@@ -1101,84 +1098,3 @@ badframe:
 	force_sig(SIGSEGV, current);
 	return 0;
 }
-
-/*
- * Note that 'init' is a special process: it doesn't get signals it doesn't
- * want to handle. Thus you cannot kill init even with a SIGKILL even by
- * mistake.
- */
-int do_signal(sigset_t *oldset, struct pt_regs *regs)
-{
-	siginfo_t info;
-	struct k_sigaction ka;
-	unsigned int newsp;
-	int signr, ret;
-
-#ifdef CONFIG_PPC32
-	if (try_to_freeze()) {
-		signr = 0;
-		if (!signal_pending(current))
-			goto no_signal;
-	}
-#endif
-
-	if (test_thread_flag(TIF_RESTORE_SIGMASK))
-		oldset = &current->saved_sigmask;
-	else if (!oldset)
-		oldset = &current->blocked;
-
-	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
-#ifdef CONFIG_PPC32
-no_signal:
-#endif
-	/* Is there any syscall restart business here ? */
-	check_syscall_restart(regs, &ka, signr > 0);
-
-	if (signr == 0) {
-		/* No signal to deliver -- put the saved sigmask back */
-		if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
-			clear_thread_flag(TIF_RESTORE_SIGMASK);
-			sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
-		}
-		return 0;		/* no signals delivered */
-	}
-
-	if ((ka.sa.sa_flags & SA_ONSTACK) && current->sas_ss_size
-	    && !on_sig_stack(regs->gpr[1]))
-		newsp = current->sas_ss_sp + current->sas_ss_size;
-	else
-		newsp = regs->gpr[1];
-	newsp &= ~0xfUL;
-
-#ifdef CONFIG_PPC64
-	/*
-	 * Reenable the DABR before delivering the signal to
-	 * user space. The DABR will have been cleared if it
-	 * triggered inside the kernel.
-	 */
-	if (current->thread.dabr)
-		set_dabr(current->thread.dabr);
-#endif
-
-	/* Whee!  Actually deliver the signal.  */
-	if (ka.sa.sa_flags & SA_SIGINFO)
-		ret = handle_rt_signal(signr, &ka, &info, oldset, regs, newsp);
-	else
-		ret = handle_signal(signr, &ka, &info, oldset, regs, newsp);
-
-	if (ret) {
-		spin_lock_irq(&current->sighand->siglock);
-		sigorsets(&current->blocked, &current->blocked,
-			  &ka.sa.sa_mask);
-		if (!(ka.sa.sa_flags & SA_NODEFER))
-			sigaddset(&current->blocked, signr);
-		recalc_sigpending();
-		spin_unlock_irq(&current->sighand->siglock);
-		/* A signal was successfully delivered; the saved sigmask is in
-		   its frame, and we can clear the TIF_RESTORE_SIGMASK flag */
-		if (test_thread_flag(TIF_RESTORE_SIGMASK))
-			clear_thread_flag(TIF_RESTORE_SIGMASK);
-	}
-
-	return ret;
-}
Index: linux-2.6/arch/powerpc/kernel/signal_64.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_64.c	2007-06-02 11:15:15.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_64.c	2007-06-02 11:15:19.000000000 +0200
@@ -334,7 +334,7 @@ badframe:
 	return 0;
 }
 
-static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
+int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
 		sigset_t *set, struct pt_regs *regs)
 {
 	/* Handler is *really* a pointer to the function descriptor for
@@ -417,87 +417,3 @@ badframe:
 	force_sigsegv(signr, current);
 	return 0;
 }
-
-
-/*
- * OK, we're invoking a handler
- */
-static int handle_signal(unsigned long sig, struct k_sigaction *ka,
-			 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
-{
-	int ret;
-
-	/* Set up Signal Frame */
-	ret = setup_rt_frame(sig, ka, info, oldset, regs);
-
-	if (ret) {
-		spin_lock_irq(&current->sighand->siglock);
-		sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
-		if (!(ka->sa.sa_flags & SA_NODEFER))
-			sigaddset(&current->blocked,sig);
-		recalc_sigpending();
-		spin_unlock_irq(&current->sighand->siglock);
-	}
-
-	return ret;
-}
-
-/*
- * Note that 'init' is a special process: it doesn't get signals it doesn't
- * want to handle. Thus you cannot kill init even with a SIGKILL even by
- * mistake.
- */
-int do_signal(sigset_t *oldset, struct pt_regs *regs)
-{
-	siginfo_t info;
-	int signr;
-	struct k_sigaction ka;
-
-	/*
-	 * If the current thread is 32 bit - invoke the
-	 * 32 bit signal handling code
-	 */
-	if (test_thread_flag(TIF_32BIT))
-		return do_signal32(oldset, regs);
-
-	if (test_thread_flag(TIF_RESTORE_SIGMASK))
-		oldset = &current->saved_sigmask;
-	else if (!oldset)
-		oldset = &current->blocked;
-
-	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
-
-	/* Is there any syscall restart business here ? */
-	check_syscall_restart(regs, &ka, signr > 0);
-
-	if (signr > 0) {
-		int ret;
-
-		/*
-		 * Reenable the DABR before delivering the signal to
-		 * user space. The DABR will have been cleared if it
-		 * triggered inside the kernel.
-		 */
-		if (current->thread.dabr)
-			set_dabr(current->thread.dabr);
-
-		/* Whee!  Actually deliver the signal.  */
-		ret = handle_signal(signr, &ka, &info, oldset, regs);
-
-		/* If a signal was successfully delivered, the saved sigmask is in
-		   its frame, and we can clear the TIF_RESTORE_SIGMASK flag */
-		if (ret && test_thread_flag(TIF_RESTORE_SIGMASK))
-			clear_thread_flag(TIF_RESTORE_SIGMASK);
-
-		return ret;
-	}
-
-	/* No signal to deliver -- put the saved sigmask back */
-	if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
-		clear_thread_flag(TIF_RESTORE_SIGMASK);
-		sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
-	}
-
-	return 0;
-}
-EXPORT_SYMBOL(do_signal);

^ permalink raw reply

* Re: [RFC/PATCH 4/4] powerpc: Make syscall restart code more common
From: Christoph Hellwig @ 2007-06-02 10:12 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev, Paul Mackerras, Anton Blanchard, ulrich.weigand
In-Reply-To: <20070530080527.6AA6CDDFD0@ozlabs.org>

On Wed, May 30, 2007 at 06:05:16PM +1000, Benjamin Herrenschmidt wrote:
> This patch moves the code in signal_32.c and signal_64.c for handling
> syscall restart into a common signal-common.h file and converge around
> a single implementation that is based on the 32 bits one, using trap, ccr
> and r3 rather than the special "result" field for deciding what to do.
> 
> The "result" field is now pretty much deprecated. We still set it for
> the sake of whatever might rely on it in userland but we no longer use
> it's content.
> 
> This, along with a previous patch that enables ptracers to write to
> "trap" and "orig_r3" should allow gdb to properly handle syscall
> restarting.
> 
> There is only one common function for now and it's small enough so
> having it inline is fine. However, there is probably room for more
> merging of _32.c and _64.c in which case we'll probably want to
> have a common .c file and avoid inlines.

Here's an updated version to create a signal.[ch] instead.  It will be
used by the signal consolidation patches I'll post now.

Index: linux-2.6/arch/powerpc/kernel/signal_32.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_32.c	2007-05-31 19:29:19.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_32.c	2007-06-01 22:25:51.000000000 +0200
@@ -51,6 +51,8 @@
 #include <asm/pgtable.h>
 #endif
 
+#include "signal.h"
+
 #undef DEBUG_SIG
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
@@ -1156,30 +1158,8 @@ int do_signal(sigset_t *oldset, struct p
 #ifdef CONFIG_PPC32
 no_signal:
 #endif
-	if (TRAP(regs) == 0x0C00		/* System Call! */
-	    && regs->ccr & 0x10000000		/* error signalled */
-	    && ((ret = regs->gpr[3]) == ERESTARTSYS
-		|| ret == ERESTARTNOHAND || ret == ERESTARTNOINTR
-		|| ret == ERESTART_RESTARTBLOCK)) {
-
-		if (signr > 0
-		    && (ret == ERESTARTNOHAND || ret == ERESTART_RESTARTBLOCK
-			|| (ret == ERESTARTSYS
-			    && !(ka.sa.sa_flags & SA_RESTART)))) {
-			/* make the system call return an EINTR error */
-			regs->result = -EINTR;
-			regs->gpr[3] = EINTR;
-			/* note that the cr0.SO bit is already set */
-		} else {
-			regs->nip -= 4;	/* Back up & retry system call */
-			regs->result = 0;
-			regs->trap = 0;
-			if (ret == ERESTART_RESTARTBLOCK)
-				regs->gpr[0] = __NR_restart_syscall;
-			else
-				regs->gpr[3] = regs->orig_gpr3;
-		}
-	}
+	/* Is there any syscall restart business here ? */
+	check_syscall_restart(regs, &ka, signr > 0);
 
 	if (signr == 0) {
 		/* No signal to deliver -- put the saved sigmask back */
Index: linux-2.6/arch/powerpc/kernel/signal_64.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/signal_64.c	2007-05-31 19:29:20.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/signal_64.c	2007-06-01 22:25:57.000000000 +0200
@@ -34,6 +34,8 @@
 #include <asm/syscalls.h>
 #include <asm/vdso.h>
 
+#include "signal.h"
+
 #define DEBUG_SIG 0
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
@@ -463,41 +465,6 @@ static int handle_signal(unsigned long s
 	return ret;
 }
 
-static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
-{
-	switch ((int)regs->result) {
-	case -ERESTART_RESTARTBLOCK:
-	case -ERESTARTNOHAND:
-		/* ERESTARTNOHAND means that the syscall should only be
-		 * restarted if there was no handler for the signal, and since
-		 * we only get here if there is a handler, we dont restart.
-		 */
-		regs->result = -EINTR;
-		regs->gpr[3] = EINTR;
-		regs->ccr |= 0x10000000;
-		break;
-	case -ERESTARTSYS:
-		/* ERESTARTSYS means to restart the syscall if there is no
-		 * handler or the handler was registered with SA_RESTART
-		 */
-		if (!(ka->sa.sa_flags & SA_RESTART)) {
-			regs->result = -EINTR;
-			regs->gpr[3] = EINTR;
-			regs->ccr |= 0x10000000;
-			break;
-		}
-		/* fallthrough */
-	case -ERESTARTNOINTR:
-		/* ERESTARTNOINTR means that the syscall should be
-		 * called again after the signal handler returns.
-		 */
-		regs->gpr[3] = regs->orig_gpr3;
-		regs->nip -= 4;
-		regs->result = 0;
-		break;
-	}
-}
-
 /*
  * Note that 'init' is a special process: it doesn't get signals it doesn't
  * want to handle. Thus you cannot kill init even with a SIGKILL even by
@@ -522,13 +489,13 @@ int do_signal(sigset_t *oldset, struct p
 		oldset = &current->blocked;
 
 	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
+
+	/* Is there any syscall restart business here ? */
+	check_syscall_restart(regs, &ka, signr > 0);
+
 	if (signr > 0) {
 		int ret;
 
-		/* Whee!  Actually deliver the signal.  */
-		if (TRAP(regs) == 0x0C00)
-			syscall_restart(regs, &ka);
-
 		/*
 		 * Reenable the DABR before delivering the signal to
 		 * user space. The DABR will have been cleared if it
@@ -537,6 +504,7 @@ int do_signal(sigset_t *oldset, struct p
 		if (current->thread.dabr)
 			set_dabr(current->thread.dabr);
 
+		/* Whee!  Actually deliver the signal.  */
 		ret = handle_signal(signr, &ka, &info, oldset, regs);
 
 		/* If a signal was successfully delivered, the saved sigmask is in
@@ -547,19 +515,6 @@ int do_signal(sigset_t *oldset, struct p
 		return ret;
 	}
 
-	if (TRAP(regs) == 0x0C00) {	/* System Call! */
-		if ((int)regs->result == -ERESTARTNOHAND ||
-		    (int)regs->result == -ERESTARTSYS ||
-		    (int)regs->result == -ERESTARTNOINTR) {
-			regs->gpr[3] = regs->orig_gpr3;
-			regs->nip -= 4; /* Back up & retry system call */
-			regs->result = 0;
-		} else if ((int)regs->result == -ERESTART_RESTARTBLOCK) {
-			regs->gpr[0] = __NR_restart_syscall;
-			regs->nip -= 4;
-			regs->result = 0;
-		}
-	}
 	/* No signal to deliver -- put the saved sigmask back */
 	if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
 		clear_thread_flag(TIF_RESTORE_SIGMASK);
Index: linux-2.6/arch/powerpc/kernel/Makefile
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/Makefile	2007-06-01 22:26:00.000000000 +0200
+++ linux-2.6/arch/powerpc/kernel/Makefile	2007-06-01 22:26:11.000000000 +0200
@@ -12,7 +12,8 @@ endif
 
 obj-y				:= semaphore.o cputable.o ptrace.o syscalls.o \
 				   irq.o align.o signal_32.o pmc.o vdso.o \
-				   init_task.o process.o systbl.o idle.o
+				   init_task.o process.o systbl.o idle.o \
+				   signal.o
 obj-y				+= vdso32/
 obj-$(CONFIG_PPC64)		+= setup_64.o binfmt_elf32.o sys_ppc32.o \
 				   signal_64.o ptrace32.o \
Index: linux-2.6/arch/powerpc/kernel/signal.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6/arch/powerpc/kernel/signal.c	2007-06-01 22:28:16.000000000 +0200
@@ -0,0 +1,62 @@
+/*
+ *    Copyright (c) 2007 Benjamin Herrenschmidt, IBM Coproration
+ *    Extracted from signal_32.c and signal_64.c
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License.  See the file README.legal in the main directory of
+ * this archive for more details.
+ */
+
+#include <linux/ptrace.h>
+#include <linux/signal.h>
+
+void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
+		int has_handler)
+{
+	unsigned long ret = regs->gpr[3];
+	int restart = 1;
+
+	/* syscall ? */
+	if (TRAP(regs) != 0x0C00)
+		return;
+
+	/* error signalled ? */
+	if (!(regs->ccr & 0x10000000))
+		return;
+
+	switch (ret) {
+	case ERESTART_RESTARTBLOCK:
+	case ERESTARTNOHAND:
+		/* ERESTARTNOHAND means that the syscall should only be
+		 * restarted if there was no handler for the signal, and since
+		 * we only get here if there is a handler, we dont restart.
+		 */
+		restart = !has_handler;
+		break;
+	case ERESTARTSYS:
+		/* ERESTARTSYS means to restart the syscall if there is no
+		 * handler or the handler was registered with SA_RESTART
+		 */
+		restart = !has_handler || (ka->sa.sa_flags & SA_RESTART) != 0;
+		break;
+	case ERESTARTNOINTR:
+		/* ERESTARTNOINTR means that the syscall should be
+		 * called again after the signal handler returns.
+		 */
+		break;
+	default:
+		return;
+	}
+	if (restart) {
+		if (ret == ERESTART_RESTARTBLOCK)
+			regs->gpr[0] = __NR_restart_syscall;
+		else
+			regs->gpr[3] = regs->orig_gpr3;
+		regs->nip -= 4;
+		regs->result = 0;
+	} else {
+		regs->result = -EINTR;
+		regs->gpr[3] = EINTR;
+		regs->ccr |= 0x10000000;
+	}
+}
Index: linux-2.6/arch/powerpc/kernel/signal.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6/arch/powerpc/kernel/signal.h	2007-06-01 22:25:26.000000000 +0200
@@ -0,0 +1,3 @@
+
+void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
+		int has_handler);

^ permalink raw reply

* [PATCH] ppc: Fix compile breakage for IBM/AMCC 4xx arch/ppc platforms
From: Stefan Roese @ 2007-06-02  9:30 UTC (permalink / raw)
  To: linuxppc-dev

The IBM/AMCC 405 platforms don't compile anymore in the current
kernel version. This small patch fixes the small compile breakage.

Signed-off-by: Stefan Roese <sr@denx.de>

---
commit 90ea0ac115801170097f0628a2851fc78006de3c
tree d59c13cdfcd3aa4a241a1c5b598d76fa3f18b540
parent f285e3d329ce68cc355fadf4ab2c8f34d7f264cb
author Stefan Roese <sr@denx.de> Sat, 02 Jun 2007 11:26:15 +0200
committer Stefan Roese <sr@denx.de> Sat, 02 Jun 2007 11:26:15 +0200

 arch/ppc/syslib/ibm_ocp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/ppc/syslib/ibm_ocp.c b/arch/ppc/syslib/ibm_ocp.c
index 3f6e55c..2ee1766 100644
--- a/arch/ppc/syslib/ibm_ocp.c
+++ b/arch/ppc/syslib/ibm_ocp.c
@@ -1,4 +1,5 @@
 #include <linux/module.h>
+#include <asm/ibm4xx.h>
 #include <asm/ocp.h>
 
 struct ocp_sys_info_data ocp_sys_info = {

^ permalink raw reply related

* [PATCH] don't allow PMAC_APM_EMU for 64-bit
From: Johannes Berg @ 2007-06-02  9:13 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list, David Woodhouse

In b302887854d6f0c6f9fc3f1080535e7c1bd53134 I switched the apm emulation
code to use the generic code but accidentally dropped the PPC32
dependency from the configuration symbol. This adds it back.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
Of course, selecting it on 64 bit doesn't make sense (no portables with
64-bit and PMU) and doesn't build either.

--- linux-2.6.orig/drivers/macintosh/Kconfig	2007-06-02 11:11:17.465515541 +0200
+++ linux-2.6/drivers/macintosh/Kconfig	2007-06-02 11:11:24.305515541 +0200
@@ -114,7 +114,7 @@ config PMAC_SMU
 config PMAC_APM_EMU
 	tristate "APM emulation"
 	select APM_EMULATION
-	depends on ADB_PMU && PM
+	depends on ADB_PMU && PM && PPC32
 
 config PMAC_MEDIABAY
 	bool "Support PowerBook hotswap media bay"

^ permalink raw reply

* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Segher Boessenkool @ 2007-06-02  9:01 UTC (permalink / raw)
  To: Gabriel Paubert; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20070602085359.GA10333@iram.es>

>>>>> +						i8259: i8259@4d0 {
>>>>
>>>> Needs "reg".  And 4d0 isn't the primary address
>>>> I think?
>>>
>>> Yes, this is a standard i8259 with additional registers at 0x20 and
>>> 0xa0.  I'll fix the address and add the registers.
>>
>> That sounds good, thanks!
>
> I'd beg to differ. There are three registers area:
>
> - 0x20 which is the master interrupt controller
>   (since the original 1981 IBM-PC)
> - 0xa0 which is the slave interrupt controller, connected to
>   IRQ2 of the master (introduced with the XT or the AT, I don't
>   remember)
> - 0x4d0 which was added later to allow per interrupt line setting
>   of edge or level triggering (instead of per controller).
>
> By far the most important registers are the ones at 0x20 since
> you access them at every interrupt. The registers at 0x4d0
> are typically set by firmware and never touched later, there
> is not a single access to them in sysdev/i8259.c.

Yes, I think we all agree -- it should be interrupt-controller@20,
with 20, a0, 4d0 in the "reg" property.

I'm not sure what "compatible" should be for this node, someone
else can dig that up :-)


Segher

^ permalink raw reply

* Re: Kernel and rootfs in ONE image?
From: David H. Lynch Jr. @ 2007-06-02  8:54 UTC (permalink / raw)
  To: Frank Prepelica; +Cc: linuxppc-embedded
In-Reply-To: <29DC34A6B43468409F5A371CFE34E8491B5A4A@ex01.ads.ubidyne.de>

    If you are using 2.6 and you use initramfs, then typically you will
get a single image that contains both the kernel,
    and the initial ramdisk. When you load and execute that image
everything will get sorted out "automagically".

   




Frank Prepelica wrote:
> Hi all,
>
>  
>
> in normal case you have got a kernel image and a rootfs image. Place
>
> that images into flash memory, set correct bootargs and it should work.
>
>  
>
> But, is it possible to generate one image which includes the linux
> kernel 
>
> and a rootfs, place that single image into flash memory and it should
> also work?
>
>  
>
> Thanks in advance!
>
>  
>
> Beste regrads
>
> Frank
>
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* Re: [PATCH 3/5] Float the pci bus number on MPC8641HPCN board.
From: Benjamin Herrenschmidt @ 2007-06-02  8:55 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Zhang Wei-r63237, Paul Mackerras, linuxppc-dev
In-Reply-To: <b972e02fc13915c5eb888621c771abb9@kernel.crashing.org>


On Sat, 2007-06-02 at 10:36 +0200, Segher Boessenkool wrote:
> In the meantime, you could have a kernel config option
> selecting between "good new" and "bad old" ppc32 PCI
> stack.  At the very least it will make it easier for both
> kernel and X people to test their stuff.  Also it will
> allow users to switch to the bad old but working stack
> if things don't go too smoothly during the transition.

Could be a boot or platform option.. basically enabling unconditional
outputing of domains ... plus a few other things like removing iobase
syscall etc..

Ben.

^ permalink raw reply

* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Gabriel Paubert @ 2007-06-02  8:53 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <4fb92a9dfccf515bdc1522d08f10f823@kernel.crashing.org>

On Sat, Jun 02, 2007 at 10:22:59AM +0200, Segher Boessenkool wrote:
> >> "reg" included in "ranges"?  Something is wrong here.
> >
> > I think it's correct for soc nodes.
> 
> It is not.  "ranges" is the address space translation
> between the parent and child busses; "reg" is the stuff
> that's on the bridge device itself.
> 
> > At least, it appears that all of
> > the dts files with soc nodes do similar things (including this one even
> > without this patch).
> 
> Yes, but that doesn't make it right.
> 
> >>> +				pci_bridge@0 {
> >>
> >>> +					#size-cells = <2>;
> >>> +					#address-cells = <3>;
> >>> +					ranges = <02000000 0 80000000
> >>> +						  02000000 0 80000000
> >>> +						  0 20000000
> >>> +						  01000000 0 00000000
> >>> +						  01000000 0 00000000
> >>> +						  0 00100000>;
> >>> +
> >>> +					isa@1e {
> >>> +						#size-cells = <1>;
> >>> +						#address-cells = <2>;
> >>>
> >>> +						ranges = <1 0 01000000 0 0
> >>> +							  00001000>;
> >>
> >> You map the same range (4kB legacy I/O @ 0) for both
> >> bridges here.
> >
> > There is a one-to-one mapping between the I/O spaces of "isa" and
> > "pci_bridge", so wouldn't it be reasonable that a similar range be 
> > used?
> 
> Oh wait, the ISA bridge is a child of the PCI bridge here.
> It is obviously fine then.
> 
> >>> +						i8042@60 {
> >>> +							reg = <1 60 1 1 64 1>;
> >>
> >> And this address space is included in both of those.
> >
> > Again, shouldn't the child's address space be in its parent's range?
> 
> Yes of course, I'm simply losing track of the nesting
> here.  Sigh.
> 
> >>> +						i8259: i8259@4d0 {
> >>
> >> Needs "reg".  And 4d0 isn't the primary address
> >> I think?
> >
> > Yes, this is a standard i8259 with additional registers at 0x20 and
> > 0xa0.  I'll fix the address and add the registers.
> 
> That sounds good, thanks!
> 

I'd beg to differ. There are three registers area:

- 0x20 which is the master interrupt controller
  (since the original 1981 IBM-PC)
- 0xa0 which is the slave interrupt controller, connected to
  IRQ2 of the master (introduced with the XT or the AT, I don't
  remember)
- 0x4d0 which was added later to allow per interrupt line setting
  of edge or level triggering (instead of per controller).

By far the most important registers are the ones at 0x20 since
you access them at every interrupt. The registers at 0x4d0
are typically set by firmware and never touched later, there
is not a single access to them in sysdev/i8259.c.

I have vague memories of a node named i8259@20 one a board 
who had OF in 1997 (a Motorola MVME but they switched to 
PPCBUG just after :-().

	Gabriel


> 
> Segher
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH] powerpc: Create "rom" (MTD) device prpmc2800
From: Segher Boessenkool @ 2007-06-02  8:53 UTC (permalink / raw)
  To: Milton Miller; +Cc: ppcdev
In-Reply-To: <7fc919fce0761f861be3069a853d3169@bga.com>

> I think "direct-mapped" as compatible is a bit too broad or vague.
>
> The compatible is supposed to be useable to find and match a driver
> without regard to the name of the node.  Perhaps direct-mapped-rom?
> (as opossed to a direct-mapped-ram, sram, or some width flash bank).

"actual-name-of-the-chip", "cfi-command-set-#", "cfi" seems
like a good start.

> Actually, looking back at your device tree {1], your list several
> properties for flash, including bank-width and partition names.
> Perhaps first compatible should be direct-mapped-partitioned-flash,
> direct-mapped-partitioned-rom, direct-mapped-rom  (to me a
> direct-mapped-rom driver would expose one section of address space
> read-only). I'm assuming that your driver for this "direct-mapped"
> device will look at these properties from the of device node and
> call the mtd layer somewhat directly with their contents.

People here tried to create a generic "flash" device binding.
It didn't work out (part of the problem is its scope was way
too big; another problem is it was too Linux-mtd specific).

Now since the probing is done in platform-specific code here,
you don't *need* an "official" binding -- just get your
"compatible" prop right so you can correctly probe the device
node, and then maybe add some node-specific properties if you
need them.


Segher

^ permalink raw reply

* Re: [PATCH] powerpc: Create "rom" (MTD) device prpmc2800
From: Segher Boessenkool @ 2007-06-02  8:46 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20070601232022.GA21237@mag.az.mvista.com>

> +static int __init prpmc2800_register_mtd(void)
> +{
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, "rom", "direct-mapped");
> +	of_platform_device_create(np, np->name, NULL);
> +}

Needs error checking -- what if the node doesn't exist.


Segher

^ permalink raw reply

* Re: 2.6.22-rc3-mm1
From: Segher Boessenkool @ 2007-06-02  8:40 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Nick Piggin, linux-kernel, linuxppc-dev, Mariusz Kozlowski,
	paulus, Arnd Bergmann
In-Reply-To: <20070601140211.81e5c301.akpm@linux-foundation.org>

> Yeah, allmodconfig tends to fall over in a heap on a lot of the
> less-lavishly-maintained architectures.

To be fair, almost all of the powerpc allmodconfig build
problems are caused by x86-only drivers (and most of those
I doubt still work on x86, even).


Segher

^ permalink raw reply

* Re: [PATCH 3/5] Float the pci bus number on MPC8641HPCN board.
From: Segher Boessenkool @ 2007-06-02  8:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Zhang Wei-r63237, Paul Mackerras, linuxppc-dev
In-Reply-To: <1180737682.19517.455.camel@localhost.localdomain>

>> The real fix is in the kernel to make it
>> very clear that domains and proper, per-domain bus numbering (not
>> global bus numbering) and suchlike is the standard like it is on SPARC
>> and PPC64 and IA64.
>
> Well... if the real fix means suddenly nobody can use X ...  I'm sorry
> but I won't inflict that one the remaining lots of 32 bits PowerMac 
> (and
> Pegasos) users. Not until there is a fixed X available. Once Ian's work
> on pci-rework X.org branch is finally merged with the trunk then life
> will be better for everybody.

In the meantime, you could have a kernel config option
selecting between "good new" and "bad old" ppc32 PCI
stack.  At the very least it will make it easier for both
kernel and X people to test their stuff.  Also it will
allow users to switch to the bad old but working stack
if things don't go too smoothly during the transition.


Segher

^ permalink raw reply

* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Segher Boessenkool @ 2007-06-02  8:28 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev@ozlabs.org, Jon Loeliger
In-Reply-To: <1180743742.19517.485.camel@localhost.localdomain>

>> And none of this could have been said earlier when
>> Wade first posted the patch?
>
> That's unfair... the traffic on the list is such that he may well have
> missed it. I can't review everything myself neither, though I try to
> spot things here or there.

That, and I often get tired of seeing the same mistakes
over and over again.  When I see a proposed tree that's
just too awful I don't really know where to start.

I also find the DTS source format a bit hard to read,
but maybe that's just me.


Segher

^ permalink raw reply

* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Segher Boessenkool @ 2007-06-02  8:25 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <E1HuGfE-0007zw-EH@jdl.com>

> And none of this could have been said earlier when
> Wade first posted the patch?

Could have, sure.  I don't have time to comment on
everything though, some stuff falls through the
cracks.  If you want to change this situation, I'm
sure you can come up with something.


Segher

^ permalink raw reply

* Re: BestComm ATA task on MPC52xx
From: Marian Balakowicz @ 2007-06-02  8:23 UTC (permalink / raw)
  To: Matt Sealey; +Cc: linuxppc-dev
In-Reply-To: <4661082C.70607@genesi-usa.com>

Matt Sealey wrote:
> Which chip revision are you using?

Here's the configuration:

CPU:   MPC5200B v2.2, Core v1.4 at 350 MHz
       Bus 100 MHz, IPB 100 MHz, PCI 25 MHz

The board uses not quite typical 100 MHz bus clock, for which I don't
have a optimized ATA DMA timing parameters yet, instead, temporarily I
use too wasteful 132MHz settings.

Marian

^ permalink raw reply

* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Segher Boessenkool @ 2007-06-02  8:22 UTC (permalink / raw)
  To: Wade Farnsworth; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <1180734314.5674.49.camel@rhino>

>> "reg" included in "ranges"?  Something is wrong here.
>
> I think it's correct for soc nodes.

It is not.  "ranges" is the address space translation
between the parent and child busses; "reg" is the stuff
that's on the bridge device itself.

> At least, it appears that all of
> the dts files with soc nodes do similar things (including this one even
> without this patch).

Yes, but that doesn't make it right.

>>> +				pci_bridge@0 {
>>
>>> +					#size-cells = <2>;
>>> +					#address-cells = <3>;
>>> +					ranges = <02000000 0 80000000
>>> +						  02000000 0 80000000
>>> +						  0 20000000
>>> +						  01000000 0 00000000
>>> +						  01000000 0 00000000
>>> +						  0 00100000>;
>>> +
>>> +					isa@1e {
>>> +						#size-cells = <1>;
>>> +						#address-cells = <2>;
>>>
>>> +						ranges = <1 0 01000000 0 0
>>> +							  00001000>;
>>
>> You map the same range (4kB legacy I/O @ 0) for both
>> bridges here.
>
> There is a one-to-one mapping between the I/O spaces of "isa" and
> "pci_bridge", so wouldn't it be reasonable that a similar range be 
> used?

Oh wait, the ISA bridge is a child of the PCI bridge here.
It is obviously fine then.

>>> +						i8042@60 {
>>> +							reg = <1 60 1 1 64 1>;
>>
>> And this address space is included in both of those.
>
> Again, shouldn't the child's address space be in its parent's range?

Yes of course, I'm simply losing track of the nesting
here.  Sigh.

>>> +						i8259: i8259@4d0 {
>>
>> Needs "reg".  And 4d0 isn't the primary address
>> I think?
>
> Yes, this is a standard i8259 with additional registers at 0x20 and
> 0xa0.  I'll fix the address and add the registers.

That sounds good, thanks!


Segher

^ permalink raw reply

* Re: [PATCH] powerpc: Create "rom" (MTD) device prpmc2800
From: Benjamin Herrenschmidt @ 2007-06-02  7:39 UTC (permalink / raw)
  To: Milton Miller; +Cc: ppcdev
In-Reply-To: <7fc919fce0761f861be3069a853d3169@bga.com>

On Fri, 2007-06-01 at 23:30 -0500, Milton Miller wrote:
> 
> Actually, looking back at your device tree {1], your list several
> properties for flash, including bank-width and partition names.
> Perhaps first compatible should be direct-mapped-partitioned-flash,
> direct-mapped-partitioned-rom, direct-mapped-rom  (to me a
> direct-mapped-rom driver would expose one section of address space
> read-only). I'm assuming that your driver for this "direct-mapped"
> device will look at these properties from the of device node and
> call the mtd layer somewhat directly with their contents. 

If it's a flash, compatible should be the chip type, and maybe as a
second entry, what type of flash protocol (amd, intel, cfi, ...) it's
compatible.

Ben.

^ permalink raw reply

* Re: BestComm ATA task on MPC52xx
From: Matt Sealey @ 2007-06-02  6:03 UTC (permalink / raw)
  To: Marian Balakowicz; +Cc: linuxppc-dev
In-Reply-To: <4660A611.9020909@semihalf.com>

Which chip revision are you using?

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

Marian Balakowicz wrote:
> Hi,
> 
> I am working on bringing up a DMA support for ATA controller on MPC52xx
> and I am facing problems for which I am not pretty sure what the actual
> root cause is.
> 
> There was a John Rigby's patch last year, which was based on arch/ppc
> and drivers/ide (mpc52xx_ide.c). I use arch/powerpc and adopted to
> libata version of mpc52xx_ide.c which is now merged to vanilla and is
> called pata_mpc52xx.c. On top of this I have John Rigby's modifications
> converted from ide to libata. Problems appear with the first DMA
> transfer attempt, which happens during a driver probe when partition
> table is read. There shall be a interrupt signaling a transfer end and
> the handler (not present in John Rigby's code) should do the transfer
> closing. But the interrupt is not received and after the cmd timeouts it
> looks like ATA controller registers, BestComm registers, buffer
> descriptors and BestComm ATA task variables are unchanged. So, it seems
> that for some reason ATA BestComm task did not run/do it's job.
> 
> Did anyone had any success with ATA DMA on 52xx? Or maybe hear about
> newer version of the ATA BestComm task, or some useful ways of debugging
> BestComm stuff? I am planning to post my working code but need a day or
> two to clean it up a little.
> 
> Thanks,
> Marian
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH] powerpc: Create "rom" (MTD) device prpmc2800
From: Milton Miller @ 2007-06-02  4:30 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: ppcdev

On Sat Jun 2 09:20:22 EST 2007,  Mark A. Greer wrote:

> Find the "rom" device for the prpmc2800 and create a device for it.
> The device will be picked up by the code in 
> drivers/mtd/maps/physmap_of.c
> and will setup MTD on that FLASH device.
...
>  /*
> + * Register a platform device for MTD.
> + */
> +static int __init prpmc2800_register_mtd(void)
> +{
> +       struct device_node *np;
> +
> +       np = of_find_compatible_node(NULL, "rom", "direct-mapped");
> +       of_platform_device_create(np, np->name, NULL);
> +}
> +arch_initcall(prpmc2800_register_mtd);
>

I think "direct-mapped" as compatible is a bit too broad or vague.

The compatible is supposed to be useable to find and match a driver
without regard to the name of the node.  Perhaps direct-mapped-rom?
(as opossed to a direct-mapped-ram, sram, or some width flash bank).

Actually, looking back at your device tree {1], your list several
properties for flash, including bank-width and partition names.
Perhaps first compatible should be direct-mapped-partitioned-flash,
direct-mapped-partitioned-rom, direct-mapped-rom  (to me a
direct-mapped-rom driver would expose one section of address space
read-only). I'm assuming that your driver for this "direct-mapped"
device will look at these properties from the of device node and
call the mtd layer somewhat directly with their contents.

[1] http://ozlabs.org/pipermail/linuxppc-dev/2007-May/035858.html

milton

PS: I know you've posted this a few times.  I'm just behind in
my reading and  replying :-).

^ permalink raw reply

* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Benjamin Herrenschmidt @ 2007-06-02  0:22 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <E1HuGfE-0007zw-EH@jdl.com>

On Fri, 2007-06-01 at 18:36 -0500, Jon Loeliger wrote:
> 
> And none of this could have been said earlier when
> Wade first posted the patch? 

That's unfair... the traffic on the list is such that he may well have
missed it. I can't review everything myself neither, though I try to
spot things here or there.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 2/8] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
From: Jon Loeliger @ 2007-06-01 23:36 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <dfc15991e31bfc09389461dc443acd7c@kernel.crashing.org>

So, like, the other day Segher Boessenkool mumbled:
> 
> "reg" included in "ranges"?  Something is wrong here.
> 
> You map the same range (4kB legacy I/O @ 0) for both
> bridges here.
> 
> And this address space is included in both of those.
> 
> These need a "reg" property.
> 
> Inclusive again.

> Needs "reg".  And 4d0 isn't the primary address
> I think?

And none of this could have been said earlier when
Wade first posted the patch?

jdl

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox