* [PATCH] powerpc: More serial probing fixes
From: Benjamin Herrenschmidt @ 2005-11-28 0:25 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc64-dev, linuxppc-dev list
Serial port detection code at boot needs a few more fixes, especially
to deal with MMIO based ports. Here they are. An additional patch to
the serial core is needed for a boot-time MMIO port to not conflict
with 8250_pci.c, that patch is reviewed separately by Russell King.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-serialfix/arch/powerpc/kernel/legacy_serial.c
===================================================================
--- linux-serialfix.orig/arch/powerpc/kernel/legacy_serial.c 2005-11-28 11:18:08.000000000 +1100
+++ linux-serialfix/arch/powerpc/kernel/legacy_serial.c 2005-11-28 11:24:20.000000000 +1100
@@ -38,12 +38,15 @@ static int __init add_legacy_port(struct
int iotype, phys_addr_t base,
phys_addr_t taddr, unsigned long irq)
{
- u32 *clk, *spd, clock;
+ u32 *clk, *spd, clock = 0;
int index;
/* get clock freq. if present */
clk = (u32 *)get_property(np, "clock-frequency", NULL);
- clock = clk ? *clk : BASE_BAUD * 16;
+ if (clk)
+ clock = *clk;
+ if (clock == 0)
+ clock = BASE_BAUD * 16;
/* get default speed if present */
spd = (u32 *)get_property(np, "current-speed", NULL);
@@ -85,7 +88,7 @@ static int __init add_legacy_port(struct
if (iotype == UPIO_PORT)
legacy_serial_ports[index].iobase = base;
else
- legacy_serial_ports[index].membase = (void __iomem *)base;
+ legacy_serial_ports[index].mapbase = base;
legacy_serial_ports[index].iotype = iotype;
legacy_serial_ports[index].uartclk = clock;
legacy_serial_ports[index].irq = irq;
@@ -145,17 +148,17 @@ static int __init add_legacy_pci_port(st
{
phys_addr_t addr, base;
u32 *addrp;
- int iotype, index = -1;
+ int iotype, index = -1, lindex = 0;
-#if 0
/* We only support ports that have a clock frequency properly
* encoded in the device-tree (that is have an fcode). Anything
* else can't be used that early and will be normally probed by
- * the generic 8250_pci driver later on.
+ * the generic 8250_pci driver later on. The reason is that 8250
+ * compatible UARTs on PCI need all sort of quirks (port offsets
+ * etc...) that this code doesn't know about
*/
if (get_property(np, "clock-frequency", NULL) == NULL)
return -1;
-#endif
/* Get the PCI address. Assume BAR 0 */
addrp = of_get_pci_address(pci_dev, 0, NULL);
@@ -180,7 +183,23 @@ static int __init add_legacy_pci_port(st
if (np != pci_dev) {
u32 *reg = (u32 *)get_property(np, "reg", NULL);
if (reg && (*reg < 4))
- index = legacy_serial_count + *reg;
+ index = lindex = *reg;
+ }
+
+ /* Local index means it's the Nth port in the PCI chip. Unfortunately
+ * the offset to add here is device specific. We know about those
+ * EXAR ports and we default to the most common case. If your UART
+ * doesn't work for these settings, you'll have to add your own special
+ * cases here
+ */
+ if (device_is_compatible(np, "pci13a8,152") ||
+ device_is_compatible(np, "pci13a8,154") ||
+ device_is_compatible(np, "pci13a8,158")) {
+ addrp += 0x200 * lindex;
+ base += 0x200 * lindex;
+ } else {
+ addrp += 8 * lindex;
+ base += 8 * lindex;
}
/* Add port, irq will be dealt with later. We passed a translated
@@ -261,7 +280,6 @@ void __init find_legacy_serial_ports(voi
DBG("legacy_serial_console = %d\n", legacy_serial_console);
/* udbg is 64 bits only for now, that will change soon though ... */
-#ifdef CONFIG_PPC64
while (legacy_serial_console >= 0) {
struct legacy_serial_info *info =
&legacy_serial_infos[legacy_serial_console];
@@ -278,7 +296,6 @@ void __init find_legacy_serial_ports(voi
udbg_init_uart(addr, info->speed, info->clock);
break;
}
-#endif /* CONFIG_PPC64 */
DBG(" <- find_legacy_serial_port()\n");
}
@@ -340,6 +357,15 @@ static void __init fixup_port_pio(int in
}
}
+static void __init fixup_port_mmio(int index,
+ struct device_node *np,
+ struct plat_serial8250_port *port)
+{
+ DBG("fixup_port_mmio(%d)\n", index);
+
+ port->membase = ioremap(port->mapbase, 0x100);
+}
+
/*
* This is called as an arch initcall, hopefully before the PCI bus is
* probed and/or the 8250 driver loaded since we need to register our
@@ -374,6 +400,8 @@ static int __init serial_dev_init(void)
fixup_port_irq(i, np, port);
if (port->iotype == UPIO_PORT)
fixup_port_pio(i, np, port);
+ if (port->iotype == UPIO_MEM)
+ fixup_port_mmio(i, np, port);
}
DBG("Registering platform serial ports\n");
^ permalink raw reply
* kernel 2.6.14 on MPC8272ADS
From: Landau, Bracha @ 2005-11-27 10:22 UTC (permalink / raw)
To: linuxppc-embedded
I'm trying to move to the latest kernel release from linux 2.6.13.4 on =
the MPC8272ADS board.
2.6.13.4 works, but from 2.6.14 and up (I don't know where from 2.6.13.4 =
to 2.6.14 the problem starts) the kernel crashes on bootup with the =
message=20
"Kernel BUG in ppc_sys_init at arch/ppc/syslib/ppc_sys_init.c:131"
Anyone know how to fix this problem?
^ permalink raw reply
* Re: Is there some articles discussing how to change bare-board code to linux driver?
From: David H. Lynch Jr. @ 2005-11-27 1:53 UTC (permalink / raw)
To: zengshuai; +Cc: Linuxppc-embedded
In-Reply-To: <13329014.1132900964930.JavaMail.postfix@mx3.mail.sohu.com>
zengshuai@sogou.com wrote:
> Where can i find them?thanks.
>
http://lwn.net/Kernel/LDD3/
also Googling works.
> ------------------------------
> 我现在使用Sogou.com的2G邮箱了,你也来试试吧!
> http://mail.sogou.com/recommend/sogoumail_invite_reg1.jsp?from=sogouinvitation&s_EMAIL=zengshuai%40sogou.com&username=Linuxppc-embedded&FullName=Linuxppc-embedded&Email=Linuxppc-embedded%40ozlabs.org&verify=777667b18eda2b5dd1bbd47542afad9b
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
^ permalink raw reply
* [PATCH] Make ARCH=ppc build again with new syscall path
From: David Woodhouse @ 2005-11-26 14:44 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
This makes ARCH=ppc build in your powerpc tree again, with the new
syscall entry/exit path.
Still doesn't actually boot on my Pegasos; the last thing I see is
'MMU:exit'. But at least it builds -- I'll look at why it doesn't boot
later, so that I can see if the mv643xx_eth actually works with ARCH=ppc
(it doesn't with ARCH=powerpc; two in every three packets I receive are
offset by 4 bytes).
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index fe0e767..7964bf6 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -131,7 +131,7 @@ main(void)
DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
- DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
+ DEFINE(TI_SIGFRAME, offsetof(struct thread_info, nvgprs_frame));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index f044edb..a48b950 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -200,8 +200,6 @@ _GLOBAL(DoSyscall)
bl do_show_syscall
#endif /* SHOW_SYSCALLS */
rlwinm r10,r1,0,0,18 /* current_thread_info() */
- li r11,0
- stb r11,TI_SC_NOERR(r10)
lwz r11,TI_FLAGS(r10)
andi. r11,r11,_TIF_SYSCALL_T_OR_A
bne- syscall_dotrace
@@ -222,25 +220,21 @@ ret_from_syscall:
bl do_show_syscall_exit
#endif
mr r6,r3
- li r11,-_LAST_ERRNO
- cmplw 0,r3,r11
rlwinm r12,r1,0,0,18 /* current_thread_info() */
- blt+ 30f
- lbz r11,TI_SC_NOERR(r12)
- cmpwi r11,0
- bne 30f
- neg r3,r3
- lwz r10,_CCR(r1) /* Set SO bit in CR */
- oris r10,r10,0x1000
- stw r10,_CCR(r1)
-
/* disable interrupts so current_thread_info()->flags can't change */
-30: LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
+ LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
SYNC
MTMSRD(r10)
lwz r9,TI_FLAGS(r12)
- andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED)
+ li r8,-_LAST_ERRNO
+ andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL)
bne- syscall_exit_work
+ cmplw 0,r3,r8
+ blt+ syscall_exit_cont
+ lwz r11,_CCR(r1) /* Load CR */
+ neg r3,r3
+ oris r11,r11,0x1000 /* Set SO bit in CR */
+ stw r11,_CCR(r1)
syscall_exit_cont:
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
/* If the process has its own DBCR0 value, load it up. The single
@@ -292,46 +286,113 @@ syscall_dotrace:
b syscall_dotrace_cont
syscall_exit_work:
- stw r6,RESULT(r1) /* Save result */
+ andi. r0,r9,_TIF_RESTOREALL
+ bne- 2f
+ cmplw 0,r3,r8
+ blt+ 1f
+ andi. r0,r9,_TIF_NOERROR
+ bne- 1f
+ lwz r11,_CCR(r1) /* Load CR */
+ neg r3,r3
+ oris r11,r11,0x1000 /* Set SO bit in CR */
+ stw r11,_CCR(r1)
+
+1: stw r6,RESULT(r1) /* Save result */
stw r3,GPR3(r1) /* Update return value */
- andi. r0,r9,_TIF_SYSCALL_T_OR_A
- beq 5f
- ori r10,r10,MSR_EE
- SYNC
- MTMSRD(r10) /* re-enable interrupts */
+2: andi. r0,r9,(_TIF_PERSYSCALL_MASK)
+ beq 4f
+
+ /* Clear per-syscall TIF flags if any are set, but _leave_
+ _TIF_SAVE_NVGPRS set in r9 since we haven't dealt with that
+ yet. */
+
+ li r11,_TIF_PERSYSCALL_MASK
+ addi r12,r12,TI_FLAGS
+3: lwarx r8,0,r12
+ andc r8,r8,r11
+#ifdef CONFIG_IBM405_ERR77
+ dcbt 0,r12
+#endif
+ stwcx. r8,0,r12
+ bne- 3b
+ subi r12,r12,TI_FLAGS
+
+4: /* Anything which requires enabling interrupts? */
+ andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_SAVE_NVGPRS)
+ beq 7f
+
+ /* Save NVGPRS if they're not saved already */
lwz r4,TRAP(r1)
andi. r4,r4,1
- beq 4f
+ beq 5f
SAVE_NVGPRS(r1)
li r4,0xc00
stw r4,TRAP(r1)
-4:
+
+ /* Re-enable interrupts */
+5: ori r10,r10,MSR_EE
+ SYNC
+ MTMSRD(r10)
+
+ andi. r0,r9,_TIF_SAVE_NVGPRS
+ bne save_user_nvgprs
+
+save_user_nvgprs_cont:
+ andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
+ beq 7f
+
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_syscall_trace_leave
REST_NVGPRS(r1)
-2:
- lwz r3,GPR3(r1)
+
+6: lwz r3,GPR3(r1)
LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
SYNC
MTMSRD(r10) /* disable interrupts again */
rlwinm r12,r1,0,0,18 /* current_thread_info() */
lwz r9,TI_FLAGS(r12)
-5:
+7:
andi. r0,r9,_TIF_NEED_RESCHED
- bne 1f
+ bne 8f
lwz r5,_MSR(r1)
andi. r5,r5,MSR_PR
- beq syscall_exit_cont
+ beq ret_from_except
andi. r0,r9,_TIF_SIGPENDING
- beq syscall_exit_cont
+ beq ret_from_except
b do_user_signal
-1:
+8:
ori r10,r10,MSR_EE
SYNC
MTMSRD(r10) /* re-enable interrupts */
bl schedule
- b 2b
+ b 6b
+
+save_user_nvgprs:
+ lwz r8,TI_SIGFRAME(r12)
+
+.macro savewords start, end
+ 1: stw \start,4*(\start)(r8)
+ .section __ex_table,"a"
+ .align 2
+ .long 1b,save_user_nvgprs_fault
+ .previous
+ .if \end - \start
+ savewords "(\start+1)",\end
+ .endif
+.endm
+ savewords 14,31
+ b save_user_nvgprs_cont
+
+
+save_user_nvgprs_fault:
+ li r3,11 /* SIGSEGV */
+ lwz r4,TI_TASK(r12)
+ bl force_sigsegv
+ rlwinm r12,r1,0,0,18 /* current_thread_info() */
+ lwz r9,TI_FLAGS(r12)
+ b save_user_nvgprs_cont
+
#ifdef SHOW_SYSCALLS
do_show_syscall:
#ifdef SHOW_SYSCALLS_TASK
@@ -401,28 +462,10 @@ show_syscalls_task:
#endif /* SHOW_SYSCALLS */
/*
- * The sigsuspend and rt_sigsuspend system calls can call do_signal
- * and thus put the process into the stopped state where we might
- * want to examine its user state with ptrace. Therefore we need
- * to save all the nonvolatile registers (r13 - r31) before calling
- * the C code.
+ * The fork/clone functions need to copy the full register set into
+ * the child process. Therefore we need to save all the nonvolatile
+ * registers (r13 - r31) before calling the C code.
*/
- .globl ppc_sigsuspend
-ppc_sigsuspend:
- SAVE_NVGPRS(r1)
- lwz r0,TRAP(r1)
- rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
- stw r0,TRAP(r1) /* register set saved */
- b sys_sigsuspend
-
- .globl ppc_rt_sigsuspend
-ppc_rt_sigsuspend:
- SAVE_NVGPRS(r1)
- lwz r0,TRAP(r1)
- rlwinm r0,r0,0,0,30
- stw r0,TRAP(r1)
- b sys_rt_sigsuspend
-
.globl ppc_fork
ppc_fork:
SAVE_NVGPRS(r1)
@@ -447,14 +490,6 @@ ppc_clone:
stw r0,TRAP(r1) /* register set saved */
b sys_clone
- .globl ppc_swapcontext
-ppc_swapcontext:
- SAVE_NVGPRS(r1)
- lwz r0,TRAP(r1)
- rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
- stw r0,TRAP(r1) /* register set saved */
- b sys_swapcontext
-
/*
* Top-level page fault handling.
* This is in assembler because if do_page_fault tells us that
@@ -626,16 +661,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
.long ret_from_except
#endif
- .globl sigreturn_exit
-sigreturn_exit:
- subi r1,r3,STACK_FRAME_OVERHEAD
- rlwinm r12,r1,0,0,18 /* current_thread_info() */
- lwz r9,TI_FLAGS(r12)
- andi. r0,r9,_TIF_SYSCALL_T_OR_A
- beq+ ret_from_except_full
- bl do_syscall_trace_leave
- /* fall through */
-
.globl ret_from_except_full
ret_from_except_full:
REST_NVGPRS(r1)
@@ -658,7 +683,7 @@ user_exc_return: /* r10 contains MSR_KE
/* Check current_thread_info()->flags */
rlwinm r9,r1,0,0,18
lwz r9,TI_FLAGS(r9)
- andi. r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED)
+ andi. r0,r9,(_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_RESTOREALL)
bne do_work
restore_user:
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 5e61124..fb5658b 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -1197,7 +1197,7 @@ _GLOBAL(sys_call_table)
.long sys_ssetmask
.long sys_setreuid /* 70 */
.long sys_setregid
- .long ppc_sigsuspend
+ .long sys_sigsuspend
.long sys_sigpending
.long sys_sethostname
.long sys_setrlimit /* 75 */
@@ -1303,7 +1303,7 @@ _GLOBAL(sys_call_table)
.long sys_rt_sigpending /* 175 */
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
- .long ppc_rt_sigsuspend
+ .long sys_rt_sigsuspend
.long sys_pread64
.long sys_pwrite64 /* 180 */
.long sys_chown
@@ -1374,7 +1374,7 @@ _GLOBAL(sys_call_table)
.long sys_clock_gettime
.long sys_clock_getres
.long sys_clock_nanosleep
- .long ppc_swapcontext
+ .long sys_swapcontext
.long sys_tgkill /* 250 */
.long sys_utimes
.long sys_statfs64
--
dwmw2
^ permalink raw reply related
* CPU off power consumption
From: Giuliano Pochini @ 2005-11-26 11:38 UTC (permalink / raw)
To: LinuxPPC-dev
Out of curiosity, what's the difference between a cpu that has never been
enabled and one that has been disabled with echo 0>/sys/.../online ? It
happens that when I boot with maxcpus=0 the temperature always stays low
enoung that the fan never spins up. If I enable and then I immediately
disable the 2nd cpu, the temperature goes a few degrees up. I have a dual
G4-MDD.
--
Giuliano.
^ permalink raw reply
* Re: MPC8272ADS stability issues
From: Eugene Surovegin @ 2005-11-26 5:22 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-embedded
In-Reply-To: <438732FD.7090201@ru.mvista.com>
On Fri, Nov 25, 2005 at 06:51:25PM +0300, Vitaly Bordug wrote:
> Unfortunately, low stability occasionally follows this boards. I have the
> same symptoms, and it is relative to something wrong with memory.
Yeah, I wasn't able to do any development on my 8272ADS due to
the same stability problems. Sometimes I wonder how Freescale can even
ship hw of such "quality".
--
Eugene
^ permalink raw reply
* Re: MPC8272ADS stability issues
From: Walter L. Wimer III @ 2005-11-26 4:46 UTC (permalink / raw)
To: Alex Zeffertt; +Cc: linuxppc-embedded
In-Reply-To: <438732FD.7090201@ru.mvista.com>
Hi Alex,
We've had increasing difficulty with our MPC8272ADS board as well. It
will often hang or reboot while just sitting at the U-Boot prompt, or
while running Linux. I've pretty much given up trying to use our board.
One of these days we'll get around to shipping it back to Freescale....
In a perverse sort of way, I'm glad I'm not the only one seeing this
problem, but it's unfortunate that any of us are...
Walt
On Fri, 2005-11-25 at 18:51 +0300, Vitaly Bordug wrote:
> Alex Zeffertt wrote:
> > I am using an MPC8272ADS development board. I was wondering if
> > anybody on this list experienced hardware reliability problems with
> > this platform.
> >
> Unfortunately, low stability occasionally follows this boards. I have
> the same symptoms, and it is relative to something wrong with memory.
^ permalink raw reply
* RE: Badness in 2.6.15-rc1 on 8xx
From: Joakim Tjernlund @ 2005-11-25 21:41 UTC (permalink / raw)
To: 'Demke Torsten-atd012', linuxppc-embedded
>
> > -----Original Message-----
> > From: linuxppc-embedded-bounces@ozlabs.org
> > [mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of
> > Joakim Tjernlund
> > Sent: Freitag, 25. November 2005 14:28
> > To: linuxppc-embedded@ozlabs.org
> > Subject: Badness in 2.6.15-rc1 on 8xx
> >
> > Anyone seen this when booting 2.6.15-rc1 on 8xx?
> > Mount-cache hash table entries: 512
> > Badness in dma_alloc_init at arch/ppc/kernel/dma-mapping.c:346
> > Call trace:
> > [c00039e8] check_bug_trap+0x80/0xa8
> > [c0003c1c] program_check_exception+0x20c/0x480
> > [c00031e0] ret_from_except_full+0x0/0x4c
> > [c01b86b8] dma_alloc_init+0x40/0xcc
> > [c000225c] init+0x8c/0x288
> > [c00050ac] kernel_thread+0x44/0x60
> > NET: Registered protocol family 16
> > The kernel boots just fine into user space so it seems
> > harmless, but I suspect it will bite me later.
> >
> > Something anoying:
> > Why did the new cpm_uart driver change major and minor number
> > for the tty?
> > As it is now I can't boot my 2.4 rootfs as init think it
> > should find the console on ttyS0.
> > Would be great if major and minor could be configurable.
> Because it's a new driver...with a new name (ttyCPM0) and a new
> device number. It shared the device number and name in 2.4
> with the "standard" device driver (8250/16550), and that made
> it very difficult to use both in 2.4.
To me it makes more sense to let a major number represent a function, not a driver.
Shouldn't be that hard to make these drivers cooperate wrt. minor number.
To allow for easy customization one could instead do:
#ifndef SERIAL_CPM_MAJOR
#define SERIAL_CPM_MAJOR 204
#endif
#ifndef SERIAL_CPM_MINOR
#define SERIAL_CPM_MINOR 46
#endif
Each platform could then define major and minor as they like.
Jocke
> Maybe you should use console=ttyCPM0 in your boot parameters for 2.6.
>
> Regards,
> Torsten
> >
> > Jocke
^ permalink raw reply
* Re: [PATCH] cpm_uart: fix xchar sending
From: Marcelo Tosatti @ 2005-11-25 11:32 UTC (permalink / raw)
To: Aristeu Sergio Rozanski Filho; +Cc: linuxppc-embedded
In-Reply-To: <20051125143851.GJ7163@cathedrallabs.org>
On Fri, Nov 25, 2005 at 12:38:51PM -0200, 'Aristeu Sergio Rozanski Filho' wrote:
> Hi,
> while using SCC as uart and as serial console at same time I got this:
>
> [ 138.214258] Oops: kernel access of bad area, sig: 11 [#1]
> [ 138.218832] PREEMPT
> [ 138.221021] NIP: C0105C48 LR: C0105E60 SP: C03D5D10 REGS: c03d5c60 TRAP: 0300 Not tainted
> [ 138.229280] MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
> [ 138.234713] DAR: 00000000, DSISR: C0000000
> [ 138.238745] TASK = c0349420[693] 'sh' THREAD: c03d4000
> [ 138.243754] Last syscall: 6
> [ 138.246402] GPR00: FEFFFFFF C03D5D10 C0349420 C01FB094 00000011 00000000 C1ECFBBC C01F24B0
> [ 138.254602] GPR08: FF002820 00000000 FF0028C0 00000000 19133615 A0CBCD5E 02000300 00000000
> [ 138.262804] GPR16: 00000000 01FF9E4C 00000000 7FA9A770 00000000 00000000 1003E2A8 00000000
> [ 138.271003] GPR24: 100562F4 7F9B6EF4 C0210000 C02A5338 C01FB094 00000000 C01FB094 C1F14574
> [ 138.279376] NIP [c0105c48] cpm_uart_tx_pump+0x4c/0x22c
> [ 138.284419] LR [c0105e60] cpm_uart_start_tx+0x38/0xb0
> [ 138.289361] Call trace:
> [ 138.291762] [c0105e60] cpm_uart_start_tx+0x38/0xb0
> [ 138.296547] [c010277c] uart_send_xchar+0x88/0x118
> [ 138.301244] [c01029a0] uart_unthrottle+0x6c/0x138
> [ 138.305942] [c00ece10] check_unthrottle+0x60/0x64
> [ 138.310641] [c00ecec4] reset_buffer_flags+0xb0/0x138
> [ 138.315595] [c00ecf64] n_tty_flush_buffer+0x18/0x78
> [ 138.320465] [c00e81b0] tty_ldisc_flush+0x64/0x7c
> [ 138.325078] [c010410c] uart_close+0xf0/0x2c8
> [ 138.329348] [c00e9c48] release_dev+0x724/0x8d4
> [ 138.333790] [c00e9e18] tty_release+0x20/0x3c
> [ 138.338061] [c006e544] __fput+0x178/0x1e0
> [ 138.342076] [c006c43c] filp_close+0x54/0xac
> [ 138.346261] [c0002d90] ret_from_syscall+0x0/0x44
> [ 138.352386] note: sh[693] exited with preempt_count 2
>
> a easy way to reproduce it is log into the system using ssh and do:
> cat >/dev/ttyCPM0
> then, switch to minicom and write some stuff on it back to ssh, a control C
> produce the oops
>
> this happens because uart_close calls uart_shutdown which frees xmit.buf,
> currently used by xchar sending in cpm_uart_tx_pump(), which seems wrong.
>
> the attached patch fixes the oops and also fixes xchar sending.
Looks good to me.
^ permalink raw reply
* Re: MPC8272ADS stability issues
From: Vitaly Bordug @ 2005-11-25 15:51 UTC (permalink / raw)
To: Alex Zeffertt; +Cc: linuxppc-embedded
In-Reply-To: <20051125153126.0385ddef.ajz@cambridgebroadband.com>
Alex Zeffertt wrote:
> Hi all,
>
> I have a question that is a bit off topic here, but you seem the most
> knowledgable people to ask so please don't flame me... :)
>
> I am using an MPC8272ADS development board. I was wondering if
> anybody on this list experienced hardware reliability problems with
> this platform.
>
> I am running ELDK 3.1.1. I have seen the kernel hang several times,
> and a Oops a few times too. The reason I suspect that this is a
> hardware problem is that these seem to happen at completely random
> times, and the Oopses, in random places. It doesn't seem to make
> any difference whether I have any of my own modules loaded or not, and
> I've even seen these problems occur in the bootloader.
>
> I'm hoping for an answer along the lines of "Ah, you must have the
> 'fail randomly' dip switch set!"
>
Unfortunately, low stability occasionally follows this boards. I have the same symptoms,
and it is relative to something wrong with memory.
The mtest utility run in U-Boot will follow to crash or hang sooner or later. Hence its
either broken memory or some hidden setting (probably undocumented) that the bootloader
forgot to tweak in the time of memory controller init.
That question has been forwarded to FS, but still no response from them in this regard.
All I can suggest is to replace the board if it crashes more frequently than
debug/development could proceed.
> TIA,
>
> Alex
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
--
Sincerely,
Vitaly
^ permalink raw reply
* Re: [PATCH] MTD: Add support for the PM82x Boards.
From: Clemens Koller @ 2005-11-25 15:06 UTC (permalink / raw)
To: hs; +Cc: linuxppc-dev, tglx, dwmw2, linux-mtd
In-Reply-To: <AHEILKONAKAEJPHNMOPNKEMMCDAA.hs@denx.de>
Hello, Heiko!
> i made the changes in the code you suggested to me.
>
> Additional changes:
> - I now use the CFI interface (I tested it, and it seems OK
> to me)
Datasheets should confirm the same.
Just in case you do the PM854 support anytime soon,
the i128J3C150 Flash supports CFI, too, which makes
these things also pretty simple.
Best greets,
--
Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany
http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19
^ permalink raw reply
* MPC8272ADS stability issues
From: Alex Zeffertt @ 2005-11-25 15:31 UTC (permalink / raw)
To: linuxppc-embedded
Hi all,
I have a question that is a bit off topic here, but you seem the most
knowledgable people to ask so please don't flame me... :)
I am using an MPC8272ADS development board. I was wondering if
anybody on this list experienced hardware reliability problems with
this platform.
I am running ELDK 3.1.1. I have seen the kernel hang several times,
and a Oops a few times too. The reason I suspect that this is a
hardware problem is that these seem to happen at completely random
times, and the Oopses, in random places. It doesn't seem to make
any difference whether I have any of my own modules loaded or not, and
I've even seen these problems occur in the bootloader.
I'm hoping for an answer along the lines of "Ah, you must have the
'fail randomly' dip switch set!"
TIA,
Alex
^ permalink raw reply
* [PATCH] cpm_uart: fix xchar sending
From: Aristeu Sergio Rozanski Filho @ 2005-11-25 14:38 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]
Hi,
while using SCC as uart and as serial console at same time I got this:
[ 138.214258] Oops: kernel access of bad area, sig: 11 [#1]
[ 138.218832] PREEMPT
[ 138.221021] NIP: C0105C48 LR: C0105E60 SP: C03D5D10 REGS: c03d5c60 TRAP: 0300 Not tainted
[ 138.229280] MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
[ 138.234713] DAR: 00000000, DSISR: C0000000
[ 138.238745] TASK = c0349420[693] 'sh' THREAD: c03d4000
[ 138.243754] Last syscall: 6
[ 138.246402] GPR00: FEFFFFFF C03D5D10 C0349420 C01FB094 00000011 00000000 C1ECFBBC C01F24B0
[ 138.254602] GPR08: FF002820 00000000 FF0028C0 00000000 19133615 A0CBCD5E 02000300 00000000
[ 138.262804] GPR16: 00000000 01FF9E4C 00000000 7FA9A770 00000000 00000000 1003E2A8 00000000
[ 138.271003] GPR24: 100562F4 7F9B6EF4 C0210000 C02A5338 C01FB094 00000000 C01FB094 C1F14574
[ 138.279376] NIP [c0105c48] cpm_uart_tx_pump+0x4c/0x22c
[ 138.284419] LR [c0105e60] cpm_uart_start_tx+0x38/0xb0
[ 138.289361] Call trace:
[ 138.291762] [c0105e60] cpm_uart_start_tx+0x38/0xb0
[ 138.296547] [c010277c] uart_send_xchar+0x88/0x118
[ 138.301244] [c01029a0] uart_unthrottle+0x6c/0x138
[ 138.305942] [c00ece10] check_unthrottle+0x60/0x64
[ 138.310641] [c00ecec4] reset_buffer_flags+0xb0/0x138
[ 138.315595] [c00ecf64] n_tty_flush_buffer+0x18/0x78
[ 138.320465] [c00e81b0] tty_ldisc_flush+0x64/0x7c
[ 138.325078] [c010410c] uart_close+0xf0/0x2c8
[ 138.329348] [c00e9c48] release_dev+0x724/0x8d4
[ 138.333790] [c00e9e18] tty_release+0x20/0x3c
[ 138.338061] [c006e544] __fput+0x178/0x1e0
[ 138.342076] [c006c43c] filp_close+0x54/0xac
[ 138.346261] [c0002d90] ret_from_syscall+0x0/0x44
[ 138.352386] note: sh[693] exited with preempt_count 2
a easy way to reproduce it is log into the system using ssh and do:
cat >/dev/ttyCPM0
then, switch to minicom and write some stuff on it back to ssh, a control C
produce the oops
this happens because uart_close calls uart_shutdown which frees xmit.buf,
currently used by xchar sending in cpm_uart_tx_pump(), which seems wrong.
the attached patch fixes the oops and also fixes xchar sending.
Comments?
--
Aristeu
[-- Attachment #2: cpm_uart-fix_xchar_sending.patch --]
[-- Type: text/plain, Size: 498 bytes --]
Index: stable/drivers/serial/cpm_uart/cpm_uart_core.c
===================================================================
--- stable.orig/drivers/serial/cpm_uart/cpm_uart_core.c 2005-11-25 10:44:14.000000000 -0200
+++ stable/drivers/serial/cpm_uart/cpm_uart_core.c 2005-11-25 10:44:26.000000000 -0200
@@ -605,7 +605,7 @@
p = cpm2cpu_addr(bdp->cbd_bufaddr);
- *p++ = xmit->buf[xmit->tail];
+ *p++ = port->x_char;
bdp->cbd_datlen = 1;
bdp->cbd_sc |= BD_SC_READY;
/* Get next BD. */
^ permalink raw reply
* RE: Badness in 2.6.15-rc1 on 8xx
From: Demke Torsten-atd012 @ 2005-11-25 14:21 UTC (permalink / raw)
To: Joakim Tjernlund, linuxppc-embedded
=20
> -----Original Message-----
> From: linuxppc-embedded-bounces@ozlabs.org=20
> [mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of=20
> Joakim Tjernlund
> Sent: Freitag, 25. November 2005 14:28
> To: linuxppc-embedded@ozlabs.org
> Subject: Badness in 2.6.15-rc1 on 8xx
>=20
> Anyone seen this when booting 2.6.15-rc1 on 8xx?
> Mount-cache hash table entries: 512
> Badness in dma_alloc_init at arch/ppc/kernel/dma-mapping.c:346
> Call trace:
> [c00039e8] check_bug_trap+0x80/0xa8
> [c0003c1c] program_check_exception+0x20c/0x480
> [c00031e0] ret_from_except_full+0x0/0x4c
> [c01b86b8] dma_alloc_init+0x40/0xcc
> [c000225c] init+0x8c/0x288
> [c00050ac] kernel_thread+0x44/0x60
> NET: Registered protocol family 16
> The kernel boots just fine into user space so it seems=20
> harmless, but I suspect it will bite me later.
>=20
> Something anoying:
> Why did the new cpm_uart driver change major and minor number=20
> for the tty?
> As it is now I can't boot my 2.4 rootfs as init think it=20
> should find the console on ttyS0.
> Would be great if major and minor could be configurable.
Because it's a new driver...with a new name (ttyCPM0) and a new
device number. It shared the device number and name in 2.4=20
with the "standard" device driver (8250/16550), and that made
it very difficult to use both in 2.4.=20
Maybe you should use console=3DttyCPM0 in your boot parameters for 2.6.
Regards,
Torsten
>=20
> Jocke
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>=20
^ permalink raw reply
* Badness in 2.6.15-rc1 on 8xx
From: Joakim Tjernlund @ 2005-11-25 13:28 UTC (permalink / raw)
To: linuxppc-embedded
Anyone seen this when booting 2.6.15-rc1 on 8xx?
Mount-cache hash table entries: 512
Badness in dma_alloc_init at arch/ppc/kernel/dma-mapping.c:346
Call trace:
[c00039e8] check_bug_trap+0x80/0xa8
[c0003c1c] program_check_exception+0x20c/0x480
[c00031e0] ret_from_except_full+0x0/0x4c
[c01b86b8] dma_alloc_init+0x40/0xcc
[c000225c] init+0x8c/0x288
[c00050ac] kernel_thread+0x44/0x60
NET: Registered protocol family 16
The kernel boots just fine into user space so it seems harmless, but I
suspect it will bite me later.
Something anoying:
Why did the new cpm_uart driver change major and minor number for the
tty?
As it is now I can't boot my 2.4 rootfs as init think it should find the
console on ttyS0.
Would be great if major and minor could be configurable.
Jocke
^ permalink raw reply
* [PATCH] cpm_uart: fix xchar sending
From: Aristeu Sergio Rozanski Filho @ 2005-11-25 13:03 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]
Hi,
while using SCC as uart and as serial console at same time I got this:
[ 138.214258] Oops: kernel access of bad area, sig: 11 [#1]
[ 138.218832] PREEMPT
[ 138.221021] NIP: C0105C48 LR: C0105E60 SP: C03D5D10 REGS: c03d5c60 TRAP: 0300 Not tainted
[ 138.229280] MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
[ 138.234713] DAR: 00000000, DSISR: C0000000
[ 138.238745] TASK = c0349420[693] 'sh' THREAD: c03d4000
[ 138.243754] Last syscall: 6
[ 138.246402] GPR00: FEFFFFFF C03D5D10 C0349420 C01FB094 00000011 00000000 C1ECFBBC C01F24B0
[ 138.254602] GPR08: FF002820 00000000 FF0028C0 00000000 19133615 A0CBCD5E 02000300 00000000
[ 138.262804] GPR16: 00000000 01FF9E4C 00000000 7FA9A770 00000000 00000000 1003E2A8 00000000
[ 138.271003] GPR24: 100562F4 7F9B6EF4 C0210000 C02A5338 C01FB094 00000000 C01FB094 C1F14574
[ 138.279376] NIP [c0105c48] cpm_uart_tx_pump+0x4c/0x22c
[ 138.284419] LR [c0105e60] cpm_uart_start_tx+0x38/0xb0
[ 138.289361] Call trace:
[ 138.291762] [c0105e60] cpm_uart_start_tx+0x38/0xb0
[ 138.296547] [c010277c] uart_send_xchar+0x88/0x118
[ 138.301244] [c01029a0] uart_unthrottle+0x6c/0x138
[ 138.305942] [c00ece10] check_unthrottle+0x60/0x64
[ 138.310641] [c00ecec4] reset_buffer_flags+0xb0/0x138
[ 138.315595] [c00ecf64] n_tty_flush_buffer+0x18/0x78
[ 138.320465] [c00e81b0] tty_ldisc_flush+0x64/0x7c
[ 138.325078] [c010410c] uart_close+0xf0/0x2c8
[ 138.329348] [c00e9c48] release_dev+0x724/0x8d4
[ 138.333790] [c00e9e18] tty_release+0x20/0x3c
[ 138.338061] [c006e544] __fput+0x178/0x1e0
[ 138.342076] [c006c43c] filp_close+0x54/0xac
[ 138.346261] [c0002d90] ret_from_syscall+0x0/0x44
[ 138.352386] note: sh[693] exited with preempt_count 2
a easy way to reproduce it is log into the system using ssh and do:
cat >/dev/ttyCPM0
then, switch to minicom and write some stuff on it back to ssh, a control C
produce the oops
this happens because uart_close calls uart_shutdown which frees xmit.buf,
currently used by xchar sending in cpm_uart_tx_pump(), which seems wrong.
the attached patch fixes the oops and also fixes xchar sending.
Comments?
--
Aristeu
[-- Attachment #2: cpm_uart-fix_xchar_sending.patch --]
[-- Type: text/plain, Size: 498 bytes --]
Index: stable/drivers/serial/cpm_uart/cpm_uart_core.c
===================================================================
--- stable.orig/drivers/serial/cpm_uart/cpm_uart_core.c 2005-11-25 10:44:14.000000000 -0200
+++ stable/drivers/serial/cpm_uart/cpm_uart_core.c 2005-11-25 10:44:26.000000000 -0200
@@ -605,7 +605,7 @@
p = cpm2cpu_addr(bdp->cbd_bufaddr);
- *p++ = xmit->buf[xmit->tail];
+ *p++ = port->x_char;
bdp->cbd_datlen = 1;
bdp->cbd_sc |= BD_SC_READY;
/* Get next BD. */
^ permalink raw reply
* RE: [PATCH] ppc32: Add support for PM82x Boards
From: Paul Mackerras @ 2005-11-25 11:31 UTC (permalink / raw)
To: hs; +Cc: linuxppc-dev
In-Reply-To: <AHEILKONAKAEJPHNMOPNGELJCDAA.hs@denx.de>
Heiko Schocher writes:
> Sorry, you are right. Here comes the Patch again ...
Your mailer still seems to be stripping whitespace from the ends of
lines, which means git won't apply it. Perhaps you should gzip it and
send it to me as an attachment (or give me a URL to download it).
Paul.
^ permalink raw reply
* do_initcalls
From: Jaap de Jong @ 2005-11-25 7:41 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
In linux-2.4.25/init/main.c this function is called:
=09
static void __init do_initcalls(void)
{
initcall_t *call;
=09
call =3D &__initcall_start;
do {
(*call)();
call++
} while (call < &__initcall_end);
/* Make sure there is no pending stuff from the initcall
sequence */
flush_scheduled_tasks();
}
What is supposed to be in the section __initcall_start ..
__initcall_end?
Mine is empty and therefore causing trouble...
System.map:
//
//
c00ad880 A __initcall_end
c00ad880 A __initcall_start
//
//
The fix is obvious... But I guess I've missed something else?
Thanks in advance,
Jaap de Jong
=09
^ permalink raw reply
* Is there some articles discussing how to change bare-board code to linux driver?
From: zengshuai @ 2005-11-25 6:42 UTC (permalink / raw)
To: Linuxppc-embedded
Where can i find them?thanks.
------------------------------
我现在使用Sogou.com的2G邮箱了,你也来试试吧!
http://mail.sogou.com/recommend/sogoumail_invite_reg1.jsp?from=sogouinvitation&s_EMAIL=zengshuai%40sogou.com&username=Linuxppc-embedded&FullName=Linuxppc-embedded&Email=Linuxppc-embedded%40ozlabs.org&verify=777667b18eda2b5dd1bbd47542afad9b
^ permalink raw reply
* RE: [PATCH] ppc32: Add defconfig File for PM826 Board.
From: Heiko Schocher @ 2005-11-25 6:26 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17286.35454.210202.789136@cargo.ozlabs.ibm.com>
Hello Paul,
On Friday, November 25, 2005 4:53 AM Paul Mackerras wrote:
>> the following Patch (against 2.6 kernel.org tree, COMMIT_ID:
>> f093182d313edde9b1f86dbdaf40ba4da2dbd0e7) adds the defconfig
>> File for the PM826 Board from Microsys.
>
> Your first patch added a pm82x_defconfig; why do we need both a
> pm826_defconfig and a pm82x_defconfig?
We have 4 boards PM825/PM826/PM827/PM828 -> PM82x, but on the
PM826, we don t need CONFIG_PCI, so it have its own defconfig.
Best regards
Heiko
^ permalink raw reply
* Re: [PATCH] ppc32: Add defconfig File for PM826 Board.
From: Paul Mackerras @ 2005-11-25 3:52 UTC (permalink / raw)
To: hs; +Cc: linuxppc-dev
In-Reply-To: <AHEILKONAKAEJPHNMOPNEELBCDAA.hs@denx.de>
Heiko Schocher writes:
> the following Patch (against 2.6 kernel.org tree, COMMIT_ID:
> f093182d313edde9b1f86dbdaf40ba4da2dbd0e7) adds the defconfig
> File for the PM826 Board from Microsys.
Your first patch added a pm82x_defconfig; why do we need both a
pm826_defconfig and a pm82x_defconfig?
Paul.
^ permalink raw reply
* [PATCH] ibm_emac: fix graceful stop timeout handling
From: Eugene Surovegin @ 2005-11-24 22:48 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linuxppc-embedded
This patch fixes graceful stop timeout handling in PPC4xx EMAC driver.
Currently, when we stop TX/RX channels we just do some number of loops
without relying on actual spent time. This has finally bitten me on
one of our systems (heavy network traffic during start up, RX channel
is stopped several times to configure multicast list).
Graceful channel stop can take up to 1 frame time, so I've added
device specific timeout counter which depends on current link speed
and calls to udelay() to really wait required amount of time before
giving up.
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
---
drivers/net/ibm_emac/ibm_emac_core.c | 38 ++++++++++++++++++++++++++--------
drivers/net/ibm_emac/ibm_emac_core.h | 2 ++
2 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index eb7d694..1da8a66 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -65,7 +65,7 @@
*/
#define DRV_NAME "emac"
-#define DRV_VERSION "3.53"
+#define DRV_VERSION "3.54"
#define DRV_DESC "PPC 4xx OCP EMAC driver"
MODULE_DESCRIPTION(DRV_DESC);
@@ -158,6 +158,14 @@ static inline void emac_report_timeout_e
#define PHY_POLL_LINK_ON HZ
#define PHY_POLL_LINK_OFF (HZ / 5)
+/* Graceful stop timeouts in us.
+ * We should allow up to 1 frame time (full-duplex, ignoring collisions)
+ */
+#define STOP_TIMEOUT_10 1230
+#define STOP_TIMEOUT_100 124
+#define STOP_TIMEOUT_1000 13
+#define STOP_TIMEOUT_1000_JUMBO 73
+
/* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */
static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = {
"rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum",
@@ -222,10 +230,12 @@ static void emac_tx_disable(struct ocp_e
r = in_be32(&p->mr0);
if (r & EMAC_MR0_TXE) {
- int n = 300;
+ int n = dev->stop_timeout;
out_be32(&p->mr0, r & ~EMAC_MR0_TXE);
- while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n)
+ while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n) {
+ udelay(1);
--n;
+ }
if (unlikely(!n))
emac_report_timeout_error(dev, "TX disable timeout");
}
@@ -248,9 +258,11 @@ static void emac_rx_enable(struct ocp_en
if (!(r & EMAC_MR0_RXE)) {
if (unlikely(!(r & EMAC_MR0_RXI))) {
/* Wait if previous async disable is still in progress */
- int n = 100;
- while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n)
+ int n = dev->stop_timeout;
+ while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
+ udelay(1);
--n;
+ }
if (unlikely(!n))
emac_report_timeout_error(dev,
"RX disable timeout");
@@ -273,10 +285,12 @@ static void emac_rx_disable(struct ocp_e
r = in_be32(&p->mr0);
if (r & EMAC_MR0_RXE) {
- int n = 300;
+ int n = dev->stop_timeout;
out_be32(&p->mr0, r & ~EMAC_MR0_RXE);
- while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n)
+ while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
+ udelay(1);
--n;
+ }
if (unlikely(!n))
emac_report_timeout_error(dev, "RX disable timeout");
}
@@ -395,6 +409,7 @@ static int emac_configure(struct ocp_ene
r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST;
if (dev->phy.duplex == DUPLEX_FULL)
r |= EMAC_MR1_FDE;
+ dev->stop_timeout = STOP_TIMEOUT_10;
switch (dev->phy.speed) {
case SPEED_1000:
if (emac_phy_gpcs(dev->phy.mode)) {
@@ -409,12 +424,16 @@ static int emac_configure(struct ocp_ene
r |= EMAC_MR1_MF_1000;
r |= EMAC_MR1_RFS_16K;
gige = 1;
-
- if (dev->ndev->mtu > ETH_DATA_LEN)
+
+ if (dev->ndev->mtu > ETH_DATA_LEN) {
r |= EMAC_MR1_JPSM;
+ dev->stop_timeout = STOP_TIMEOUT_1000_JUMBO;
+ } else
+ dev->stop_timeout = STOP_TIMEOUT_1000;
break;
case SPEED_100:
r |= EMAC_MR1_MF_100;
+ dev->stop_timeout = STOP_TIMEOUT_100;
/* Fall through */
default:
r |= EMAC_MR1_RFS_4K;
@@ -2048,6 +2067,7 @@ static int __init emac_probe(struct ocp_
dev->phy.duplex = DUPLEX_FULL;
dev->phy.autoneg = AUTONEG_DISABLE;
dev->phy.pause = dev->phy.asym_pause = 0;
+ dev->stop_timeout = STOP_TIMEOUT_100;
init_timer(&dev->link_timer);
dev->link_timer.function = emac_link_timer;
dev->link_timer.data = (unsigned long)dev;
diff --git a/drivers/net/ibm_emac/ibm_emac_core.h b/drivers/net/ibm_emac/ibm_emac_core.h
index e9b44d0..911abba 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.h
+++ b/drivers/net/ibm_emac/ibm_emac_core.h
@@ -189,6 +189,8 @@ struct ocp_enet_private {
struct timer_list link_timer;
int reset_failed;
+ int stop_timeout; /* in us */
+
struct ibm_emac_error_stats estats;
struct net_device_stats nstats;
^ permalink raw reply related
* [PATCH] ppc32: fix treeboot image entrypoint
From: Eugene Surovegin @ 2005-11-24 21:38 UTC (permalink / raw)
To: Andrew Morton; +Cc: Tom Rini, linuxppc-embedded
Correctly specify treeboot based image entrypoint. Currently makefile
uses $(ENTRYPOINT) which isn't defined anywhere. Each board port sets
entrypoint-$(CONFIG_BOARD_NAME) instead.
Without this patch I cannot boot Ocotea (PPC440GX eval board) anymore.
I was getting random "OS panic" errors from OpenBIOS for a while, but
with current kernel I get them all the time (probably because image
became bigger).
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
---
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index 82df88b..f3e9c53 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -262,11 +262,11 @@ $(images)/zImage.initrd-STRIPELF: $(obj)
skip=64 bs=1k
$(images)/zImage-TREE: $(obj)/zvmlinux $(MKTREE)
- $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(ENTRYPOINT)
+ $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(entrypoint-y)
$(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE)
$(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y) \
- $(ENTRYPOINT)
+ $(entrypoint-y)
$(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT)
$(MKPREP) -pbp $(obj)/zvmlinux $(images)/zImage.$(end-y)
^ permalink raw reply related
* Re: [PATCH] Fix USB suspend/resume crasher
From: Benjamin Herrenschmidt @ 2005-11-24 21:22 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Andrew Morton, Greg KH, linux-kernel, David Brownell,
linuxppc-dev list, Alan Stern
In-Reply-To: <200511242214.16365.rjw@sisk.pl>
>
> FWIW, does the appended change look reasonable to you? (It apparently
> helps. ;-))
Yes. I was about to do a new patch after I finish my breakfast, but
yours applied on top of Greg's merged one works too.
Ben.
^ permalink raw reply
* Re: [PATCH] Fix USB suspend/resume crasher
From: Rafael J. Wysocki @ 2005-11-24 21:14 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Andrew Morton, Greg KH, linux-kernel, David Brownell,
linuxppc-dev list, Alan Stern
In-Reply-To: <1132866088.26560.455.camel@gaston>
On Thursday, 24 of November 2005 22:01, Benjamin Herrenschmidt wrote:
>
> >
> > Well, it's there (actually the problem occurs in vanilla 2.6.15-rc2-mm1 that
> > contains the patch). Do you mean it should go before the
> >
> > if (readl(&ehci->regs->configured_flag) != FLAG_CF)
> > goto restart;
> >
> > thing?
>
> Yes.
>
> > > It may be worth following it with a memory barrier actually... just in case
> > > (due to the absence of locks in that area).
> >
> > wmb()?
>
> Yup.
>
> I wrote that patch against a tree that had different things in that
> function, Greg merged it by hand but he got that little bit wrong
> unfortunately. I'll send a new patch later today.
Thanks.
FWIW, does the appended change look reasonable to you? (It apparently
helps. ;-))
Rafael
Index: linux-2.6.15-rc2-mm1/drivers/usb/host/ehci-pci.c
===================================================================
--- linux-2.6.15-rc2-mm1.orig/drivers/usb/host/ehci-pci.c 2005-11-24 21:42:34.000000000 +0100
+++ linux-2.6.15-rc2-mm1/drivers/usb/host/ehci-pci.c 2005-11-24 21:50:38.000000000 +0100
@@ -281,12 +281,13 @@
if (time_before(jiffies, ehci->next_statechange))
msleep(100);
+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+ wmb();
+
/* If CF is clear, we lost PCI Vaux power and need to restart. */
if (readl(&ehci->regs->configured_flag) != FLAG_CF)
goto restart;
- set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
-
/* If any port is suspended (or owned by the companion),
* we know we can/must resume the HC (and mustn't reset it).
* We just defer that to the root hub code.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox