LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Status of patches (ppc32 mm init clean and 85xx kernel reloc)
From: Kumar Gala @ 2008-04-08 14:06 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: ppc-dev list

Paul,

Here's my take on the current status of the patchset:

[POWERPC] bootwrapper: Allow specifying of image physical offset

reworked to look at PHDR (needs linker script update patch).  Still  
open question on how best to do that (objdump, readelf, C program,  
suggestions)

[POWERPC] Remove Kconfig option BOOT_LOAD

should be acceptable.

[POWERPC] Provide access to arch/powerpc include path on ppc64

should be acceptable (desired by others).

[POWERPC] Remove and replace uses of PPC_MEMSTART with memstart_addr

You had some questions about _stext and the PAGE_OFFSET vs  
KERNELBASE.  Not sure if you are satisfied with the answers.

[POWERPC] Introduce lowmem_end_addr to distiguish from total_lowmem

No comments.  Should be straight forward.

[POWERPC] 85xx: Cleanup TLB initialization

Only effects 85xx and I don't have issues with it :)

[POWERPC] Use lowmem_end_addr to limit lmb allocations on ppc32

No comments.  Straight forward patch.

[POWERPC] Rename __initial_memory_limit to __initial_memory_limit_addr

No comments.  Straight forward patch.

[POWERPC] Clean up some linker and symbol usage

No comments.  Straight forward patch.

[POWERPC] Move phys_addr_t definition into asm/types.h

I had an open question if the Kconfig for PHYS_64BIT should get set on  
PPC64 as well (has not effect).

I reworked the asm/types.h bits to look like:
+#if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
+typedef __u64 phys_addr_t;
+#else
+typedef __u32 phys_addr_t;
+#endif

[POWERPC] 85xx: Add support for relocatble kernel (and booting at non- 
zero

Should probably get a bit more review.

[POWERPC] Update linker script to properly set physical addresses

You felt LOAD_OFFSET should be (CONFIG_PAGE_OFFSET -  
CONFIG_PHYSICAL_START).  I disagreed.  We need to resolve.

I think we should be able to quickly resolve and get into powerpc-next  
all but the '85xx: Add support for relocatable kernel' and  
'bootwrapper: Allow specifying of image..' patches.  If we can close  
on the phys_addr_t and linker script patches that would be great.

thanks

- k

^ permalink raw reply

* Re: TSEC3/4 broken on MPC8548?
From: Kumar Gala @ 2008-04-08 14:17 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: LinuxPPC-Embedded
In-Reply-To: <47FB75BC.10400@grandegger.com>


On Apr 8, 2008, at 8:40 AM, Wolfgang Grandegger wrote:
> Hello,
>
> in the dts file for the MPC8548CDS the nodes for TSEC3/4 are commented
> out because they seem to be broken:
>
>  $ grep broken arch/powerpc/boot/dts/*
>  arch/powerpc/boot/dts/mpc8548cds.dts:/* eTSEC 3/4 are currently  
> broken
>
> Is it still true?

This was a board issue and not a chip issue.  However I'm not sure if  
the board issues have been resolved.  Hopefully Andy will know.

- k

^ permalink raw reply

* Re: [RFC][PATCH] initial port of fixmap over from x86 for ppc32
From: Kumar Gala @ 2008-04-08 14:28 UTC (permalink / raw)
  To: benh; +Cc: Scott Wood, linuxppc-dev, Paul Mackerras, hollisb
In-Reply-To: <1207612292.10388.494.camel@pasglop>


On Apr 7, 2008, at 6:51 PM, Benjamin Herrenschmidt wrote:
>
> On Mon, 2008-04-07 at 11:20 -0500, Scott Wood wrote:
>>
>> Another possible use is a BAT/TLB1 mapping for SoC registers (or
>> anything
>> else on the board which is frequently accessed), which can be reused
>> by
>> ioremap() to avoid wasting normal TLB entries, and to facilitate  
>> early
>> debugging.
>
> As far as the above is concerned, I'm not too fan of fixed virtual
> addresses. I'd rather dynamically assign it. But we can do it.

I'm in agreement with Ben here.  On Freescale parts that could mean  
using up to 16M of virtual address space while in reality we may only  
need a handful of 4k pages to cover SoC registers that we are truly  
accessing at runtime.

However I think there might be some utility to have an early ioremap  
mappings for debug.

- k

^ permalink raw reply

* Re: [PATCH 6/13] devres: implement managed iomap interface
From: Tejun Heo @ 2008-04-08 14:48 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linuxppc-dev, gregkh, linux-kernel, linux-ide, jgarzik, alan
In-Reply-To: <47FA4FD2.8060808@ru.mvista.com>

Sergei Shtylyov wrote:
>    A very late comment but nevertheless... :-)

Better late than never.

>    Those functions are going to break on 32-bit platforms with extended 
> physical address (well, that's starting with Pentiums which had 36-bit 
> PAE :-) AND devices mapped beyond 4 GB (e.g. PowerPC 44x).  You should 
> have used resource_size_t for the 'offset' parameter. As this most 
> probably means that libata is broken on such platforms, I'm going to 
> submit a patch...

Yeah, right please go ahead.  But I wonder whether any BIOS was actually 
crazy enough to map mmio region above 4G on 32bit machine.

-- 
tejun

^ permalink raw reply

* Re: Question on mpc52xx_common.c
From: Grant Likely @ 2008-04-08 14:52 UTC (permalink / raw)
  To: Matt Sealey; +Cc: linuxppc-dev, Raquel and Bill
In-Reply-To: <47FB3CD6.2090706@genesi-usa.com>

On Tue, Apr 8, 2008 at 3:37 AM, Matt Sealey <matt@genesi-usa.com> wrote:
> I'd not thank Grant.
>
>  I think the prom_init fixes are bordering on disgusting.. it would
>  make it's way into commercial code for sure, but only because nobody
>  would see what a hideous mess it is :)
>
>  The best solution by far is to release a new firmware with the
>  device tree fixed. The script method is just not tolerated by users,
>  and patching the Linux kernel to keep track with broken firmwares
>  is exactly what we hoped to AVOID with Aura in the first place.

It may be ideal, but I don't think it is realistic.  I'm now of the
firm opinion that device trees and firmware are *never* perfect.
Especially when the definition of perfect is a moving target.

There are certainly a number of things that are wrong and missing in
the Efika device tree, but in the long run it is proof that the design
of OF and the device tree is good.  The tree is unique.  Linux and
other OSes can derive the information they need.  Current Linux
drivers want data in a way slightly different from the way the Efika
offers it; some of that is Efika's fault, some of that is the driver's
fault, but OF provides the ability to massage the data and ensure the
board will boot.

As of right now; Linux support for the Efika contains only 4 distinct fixups:
1. Change device_type property of the / node from "chrp" to "efika".
Linux will run the wrong initialization code if this is "chrp"
2. change the format of the bestcomm interrupts property.  The Linux
drivers wants a list of interrupts and kind of treats the bestcomm
engine as it's own interrupt controller.  I think this was probably a
design flaw on the Linux driver, but it is what we currently have.
3. the /builtin/sound node is missing an interrupts property
4. The FEC driver wants MDIO and PHY nodes to talk to the Ethernet
Phy.  This one is big, but it is really just a single fixup.

All the other things that many not be what we *like* in the device
tree are really not serious flaws.  Mostly compatible properties are
missing any mfg prefix like 'fsl,'.  Of course, as Segher points out,
'fsl,' is better, but doesn't match recommended practice either
because UPPERCASE is supposed to be used with the prefix is the stock
ticker symbol.  See?  Device tree bindings are never perfect.  :-)
Regardless, the drivers deal with it and Linux is happy.

Cheers,
g.

>
>
>  --
>  Matt Sealey <matt@genesi-usa.com>
>  Genesi, Manager, Developer Relations
>
>  Raquel and Bill wrote:
>
> > Thanks Grant.
> >
> > R&B
> >
> >
> > On Mon, Apr 7, 2008 at 9:25 PM, Grant Likely <grant.likely@secretlab.ca
> <mailto:grant.likely@secretlab.ca>> wrote:
> >
> >    On Mon, Apr 7, 2008 at 8:14 PM, Arnd Bergmann <arnd@arndb.de
> >
> >    <mailto:arnd@arndb.de>> wrote:
> >     > On Tuesday 08 April 2008, Matt Sealey wrote:
> >     >
> >     > > Grant Likely wrote:
> >     >  > >
> >     >  > > Sure, why not?  If the firmware has already set it up
> >    correctly and no
> >     >  > > devices using it are in use, then the kernel should be okay.
> >     :-)
> >     >  > > That said, I can't imagine choosing to not put the cdm node
> >    into the
> >     >  > > device tree.
> >     >  >
> >     >  > *ahem* Efika.
> >     >
> >     >  Maybe we should just give up on making the efika boot with its
> >    regular
> >     >  device tree and instead add a boot wrapper that either fixes up the
> >     >  data provided by its firmware or just adds a proper dt blob?
> >
> >    Current kernels boot the Efika without any firmware scripts.
> >    prom_init.c is able to handle the few fixups that the kernel really
> >    wants to see.  (So life is mostly happy in Efika land now.  :-)
> >
> >    Cheers,
> >    g.
> >
> >    --
> >    Grant Likely, B.Sc., P.Eng.
> >    Secret Lab Technologies Ltd.
> >    _______________________________________________
> >    Linuxppc-dev mailing list
> >    Linuxppc-dev@ozlabs.org <mailto:Linuxppc-dev@ozlabs.org>
> >
> >    https://ozlabs.org/mailman/listinfo/linuxppc-dev
> >
> >
> >
> >
> > --
> > http://bbrv.blogspot.com/
> >
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 6/13] devres: implement managed iomap interface
From: Sergei Shtylyov @ 2008-04-08 14:55 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linuxppc-dev, gregkh, linux-kernel, linux-ide, jgarzik, alan
In-Reply-To: <47FB85CB.2070506@gmail.com>

Tejun Heo wrote:

>>    A very late comment but nevertheless... :-)

> Better late than never.

    :-)

>>    Those functions are going to break on 32-bit platforms with 
>> extended physical address (well, that's starting with Pentiums which 
>> had 36-bit PAE :-) AND devices mapped beyond 4 GB (e.g. PowerPC 44x).  
>> You should have used resource_size_t for the 'offset' parameter. As 
>> this most probably means that libata is broken on such platforms, I'm 
>> going to submit a patch...

    It's broken with drivers using MMIO, I meant to say.

> Yeah, right please go ahead.  But I wonder whether any BIOS was actually 
> crazy enough to map mmio region above 4G on 32bit machine.

    This is a *hardware* mapping on some non-x86 platforms (like PPC 44x or 
MIPS Alchemy). The arch/ppc/ and arch/mips/ kernels have special hooks called 
from ioremap() which help create an illusion that the PCI memory space on such 
platforms (not only it) is mapped below 4 GB; arch/powerpc/ kernel doesn't do 
this anymore -- hence this newly encountered issue.

WBR, Sergei

^ permalink raw reply

* Re: [PATCH 6/13] devres: implement managed iomap interface
From: Tejun Heo @ 2008-04-08 15:03 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linuxppc-dev, gregkh, linux-kernel, linux-ide, jgarzik, alan
In-Reply-To: <47FB8751.3040301@ru.mvista.com>

Sergei Shtylyov wrote:
>> Yeah, right please go ahead.  But I wonder whether any BIOS was 
>> actually crazy enough to map mmio region above 4G on 32bit machine.
> 
>    This is a *hardware* mapping on some non-x86 platforms (like PPC 44x 
> or MIPS Alchemy). The arch/ppc/ and arch/mips/ kernels have special 
> hooks called from ioremap() which help create an illusion that the PCI 
> memory space on such platforms (not only it) is mapped below 4 GB; 
> arch/powerpc/ kernel doesn't do this anymore -- hence this newly 
> encountered issue.

Ah... I see.  Thanks for the clarification.

-- 
tejun

^ permalink raw reply

* Re: [PATCH v3] powerpc: Add irqtrace support for 32-bit powerpc
From: Johannes Berg @ 2008-04-08 16:04 UTC (permalink / raw)
  To: Dale Farnsworth; +Cc: linuxppc-dev
In-Reply-To: <20080407171428.GA14900@farnsworth.org>

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]


On Mon, 2008-04-07 at 10:14 -0700, Dale Farnsworth wrote:
> Add the low level irq tracing hooks for 32-bit powerpc needed
> to enable full lockdep functionality.
> 
> Dale Farnsworth <dale@farnsworth.org>
> ---
> This version fixes the clobbering of r12 by the call to
> trace_hardirqs_off() that was pointed out by BenH.
> 
> Johannes, I'd appreciate your trying this version if/when
> you get the chance.

Thanks Dale, this version seems to work. I'll stress it a bit more
later, but so far it has survived *much* longer than both previous
versions.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [RFC][PATCH] initial port of fixmap over from x86 for ppc32
From: Scott Wood @ 2008-04-08 16:24 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Paul Mackerras, hollisb, linuxppc-dev
In-Reply-To: <8C415339-5DB0-42B3-A942-17296DE68267@kernel.crashing.org>

On Tue, Apr 08, 2008 at 09:28:12AM -0500, Kumar Gala wrote:
> On Apr 7, 2008, at 6:51 PM, Benjamin Herrenschmidt wrote:
>> As far as the above is concerned, I'm not too fan of fixed virtual
>> addresses. I'd rather dynamically assign it. But we can do it.
>
> I'm in agreement with Ben here.  On Freescale parts that could mean  
> using up to 16M of virtual address space while in reality we may only  
> need a handful of 4k pages to cover SoC registers that we are truly  
> accessing at runtime.

So make it configurable, and turn it off if you're low on address space. 

Most of the time, I'd think saving TLB0 entries would be more beneficial,
especially with heavy I/O workloads where registers get banged on a lot.

It's the early debugging that I'm really concerned with, though.  It gets
old hacking an early mapping in each time.

-Scott

^ permalink raw reply

* Re: MPC8343 - "unable to handle paging request @ 0"
From: Scott Wood @ 2008-04-08 16:43 UTC (permalink / raw)
  To: Andre Schwarz; +Cc: linuxppc-dev
In-Reply-To: <47FB3206.7080406@matrix-vision.de>

On Tue, Apr 08, 2008 at 10:51:18AM +0200, Andre Schwarz wrote:
> Call Trace:
> [c01f9ef0] [c001c190]  (unreliable)
> [c01f9f10] [c0140c84]
> [c01f9f20] [c0140ccc]
> [c01f9f40] [c014145c]
> [c01f9f60] [c0014014]
> [c01f9fa0] [c01d1a40]
> [c01f9fb0] [c01ce64c]
> [c01f9fc0] [c01c55ac]
> [c01f9ff0] [00003438]

Please turn kallsyms on, which will produce an annotated call trace.  Not
all these addresses were in the System.map fragment.

-Scott

^ permalink raw reply

* Re: MPC8343 - "unable to handle paging request @ 0"
From: Scott Wood @ 2008-04-08 16:48 UTC (permalink / raw)
  To: Andre Schwarz; +Cc: linuxppc-dev
In-Reply-To: <47FB7822.6090401@matrix-vision.de>

On Tue, Apr 08, 2008 at 03:50:26PM +0200, Andre Schwarz wrote:
> after building a debug kernel and attaching the bdi2000 it looks like  
> the crash occurs during "console_init()" ...

Does your device tree have a /chosen node after u-boot is done with it? 
find_legacy_serial_ports() can crash otherwise (we really should fix that).

> Since we're using a dtb I omit the "console=..." argument for the  
> kernel. Is this correct ?

It's OK if you have /chosen/linux,stdout-path.

> If "console=/dev/ttyS0,115200N8" argument is given the serial console  
> stops working after console_init....
>
>
> On other PowerPC system I could see something like this during boot :
>
> -> find_legacy_serial_port()
> stdout is /soc8568@e0000000/serial@4600
> legacy_serial_console = 1
> default console speed = 115340
> <- find_legacy_serial_port()
>
>
> Should I see this message also ?

Only if you enable debug messages in legacy_serial.c.

> Have I misconfigured anything ?

One thing that sticks out from the above is that you ask for ttyS0, but the
stdout you list from the other system corresponds to ttyS1.  Is this just a
difference between the two systems?

-Scott

^ permalink raw reply

* [PATCH] [v5] Add idle wait support for 44x platforms
From: Jerone Young @ 2008-04-08 16:49 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: kvm-ppc-devel

2 files changed, 77 insertions(+), 1 deletion(-)
arch/powerpc/platforms/44x/Makefile |    2 
arch/powerpc/platforms/44x/idle.c   |   76 +++++++++++++++++++++++++++++++++++


Updates: Now setting MSR_WE is now default
         Tested on hardware platforms bamboo & sequioa and appears
         things are working fine on actually hardware!

This patch adds the ability for the CPU to go into wait state while in cpu_idle loop. This helps virtulization solutions know when the guest Linux kernel is in an idle state. There are two ways to do it.

Command line
	idle=spin <-- CPU will spin
	idle=wait <-- set CPU into wait state when idle (default)


Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -1,4 +1,4 @@ obj-$(CONFIG_44x)	:= misc_44x.o
-obj-$(CONFIG_44x)	:= misc_44x.o
+obj-$(CONFIG_44x)	:= misc_44x.o idle.o
 obj-$(CONFIG_EBONY)	+= ebony.o
 obj-$(CONFIG_TAISHAN)	+= taishan.o
 obj-$(CONFIG_BAMBOO)	+= bamboo.o
diff --git a/arch/powerpc/platforms/44x/idle.c b/arch/powerpc/platforms/44x/idle.c
new file mode 100644
--- /dev/null
+++ b/arch/powerpc/platforms/44x/idle.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2008 IBM Corp. 
+ *
+ * Based on arch/powerpc/platforms/pasemi/idle.c: 
+ * Copyright (C) 2006-2007 PA Semi, Inc
+ *
+ * Added by: Jerone Young <jyoung5@us.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ */
+
+#include <linux/of.h>
+#include <linux/kernel.h>
+#include <asm/machdep.h>
+
+static int current_mode;
+
+struct sleep_mode {
+	char *name;
+	void (*entry)(void);
+};
+
+static void ppc44x_idle(void)
+{
+	unsigned long msr_save;
+
+	msr_save = mfmsr();
+	/* set wait state MSR */
+	mtmsr(msr_save|MSR_WE|MSR_EE|MSR_CE|MSR_DE);
+	isync();
+	/* return to initial state */
+	mtmsr(msr_save);
+	isync();
+}
+
+static struct sleep_mode modes[] = {
+	{ .name = "wait", .entry = &ppc44x_idle },
+	{ .name = "spin", .entry = NULL },
+};
+
+int __init ppc44x_idle_init(void)
+{
+	void *func = modes[current_mode].entry;
+	ppc_md.power_save = func;
+	return 0;
+}
+
+arch_initcall(ppc44x_idle_init);
+
+static int __init idle_param(char *p)
+{ 
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(modes); i++) {
+		if (!strcmp(modes[i].name, p)) {
+			current_mode = i;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+early_param("idle", idle_param);

^ permalink raw reply

* Re: [BUG] 2.6.25-rc2-git4 - Regression Kernel oops  while running kernbench and tbench on powerpc
From: Kamalesh Babulal @ 2008-04-08 17:45 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: kernel list, linuxppc-dev, linux-next, nacc, Andrew Morton,
	Balbir Singh
In-Reply-To: <18427.27360.30297.84859@cargo.ozlabs.ibm.com>

Paul Mackerras wrote:
> Kamalesh Babulal writes:
> 
>> The kernel oops after applying the patch. Some time it takes more than
>> one run to reproduce it, it was reproducible in the second run this
>> time.
>>
>>  Unrecoverable exception 4100 at c000000000008c8c
>> Oops: Unrecoverable exception, sig: 6 [#1]
>> SMP NR_CPUS=128 NUMA pSeries
>> Modules linked in:
>> NIP: c000000000008c8c LR: 000000000ff0135c CTR: 000000000ff012f0
>> REGS: c000000772343bb0 TRAP: 4100   Not tainted  (2.6.25-rc8-autotest)
>> MSR: 8000000000001030 <ME,IR,DR>  CR: 44044228  XER: 00000000
>> TASK = c00000077cfa0900[13437] 'cc1' THREAD: c000000772340000 CPU: 2
>> GPR00: 0000000000004000 c000000772343e30 00000000000000bb 000000000000d032 
>> GPR04: 00000000000000bb 0000000000000400 000000000000000a 0000000000000002 
>> GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 
>> GPR12: 0000000000000000 c000000000734000 0000000000000064 00000000ffe6df08 
>> GPR16: 00000000105b0000 00000000105b0000 0000000010440000 00000000105b0000 
>> GPR20: 00000000ffe6e008 00000000105b0000 00000000105b0000 000000000000000a 
>> GPR24: 000000000ffec408 0000000000000001 00000000ffe6ddca 0000000000000400 
>> GPR28: 000000000ffec408 00000000f7ff8000 000000000ffebff4 0000000000000400 
>> NIP [c000000000008c8c] restore+0x8c/0xc0
>> LR [000000000ff0135c] 0xff0135c
>> Call Trace:
>> [c000000772343e30] [c000000000008cd4] do_work+0x14/0x2c (unreliable)
>> Instruction dump:
>> 7c840078 7c810164 70604000 41820028 60000000 7c4c42e6 e88d01f0 f84d01f0 
>> 7c841050 e84d01e8 7c422214 f84d01e8 <e9a100d8> 7c7b03a6 e84101a0 7c4ff120 
>>
<snip>
> The exception happened at c...8c8c but you looked at c...8cdc with
> gdb.  What's at c...8c8c?
> 
>> please let me know if you need more information.
> 
> The .config would be useful, but don't spam everyone on cc with it,
> just send it to me privately.
> 
> Paul.

Hi Paul,

Similar call trace was seen in 2.6.24-rc3-git2 kernel while bootup, I have attached the
boot log to bugzilla (http://bugzilla.kernel.org/attachment.cgi?id=15666&action=view).
When looking for the last good one, we found that the kernel oops seems to be reproducible 
from the 2.6.24-rc8-git3 kernel onwards.

Thanks to nishanth for pointing it out, Please let me know if you need more information.

-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

^ permalink raw reply

* [PATCH] natsemi: fix for PPC 44x platforms
From: Sergei Shtylyov @ 2008-04-08 19:31 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

The driver stores the the PCI resource address into 'unsigned long' variable
before calling ioremap() on it. This warrants kernel oops when the registers
are accessed on PPC 44x platforms which (being 32-bit) have PCI memory space
mapped beyond 4 GB.

The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion of the
PCI I/O and memory resources are mapped below 4 GB, but arch/powerpc/ code got
rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
This is the same issue as the one that has been recently addressed by commits
3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with
64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix
kernel oops on PPC 44x).  The patch has only been compile tested though...

 drivers/net/natsemi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/net/natsemi.c
===================================================================
--- linux-2.6.orig/drivers/net/natsemi.c
+++ linux-2.6/drivers/net/natsemi.c
@@ -786,7 +786,8 @@ static int __devinit natsemi_probe1 (str
 	struct netdev_private *np;
 	int i, option, irq, chip_idx = ent->driver_data;
 	static int find_cnt = -1;
-	unsigned long iostart, iosize;
+	resource_size_t iostart;
+	unsigned long iosize;
 	void __iomem *ioaddr;
 	const int pcibar = 1; /* PCI base address register */
 	int prev_eedata;
@@ -946,9 +947,9 @@ static int __devinit natsemi_probe1 (str
 		goto err_create_file;
 
 	if (netif_msg_drv(np)) {
-		printk(KERN_INFO "natsemi %s: %s at %#08lx "
+		printk(KERN_INFO "natsemi %s: %s at %#08llx "
 		       "(%s), %s, IRQ %d",
-		       dev->name, natsemi_pci_info[chip_idx].name, iostart,
+		       dev->name, natsemi_pci_info[chip_idx].name, (u64)iostart,
 		       pci_name(np->pci_dev), print_mac(mac, dev->dev_addr), irq);
 		if (dev->if_port == PORT_TP)
 			printk(", port TP.\n");

^ permalink raw reply

* [PATCH] tg3: fix for PPC 44x platforms
From: Sergei Shtylyov @ 2008-04-08 19:33 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

The driver stores the the PCI resource addresses into 'unsigned long' variable
before calling ioremap() on them. This warrants kernel oops when the registers
are accesse on PPC 44x platforms which (being 32-bit) have PCI memory space
mapped beyond 4 GB.

The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion of the
PCI I/O and memory resources are mapped below 4 GB, but arch/powerpc/ code got
rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
This is the same issue as the one that has been recently addressed by commits
3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with
64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix
kernel oops on PPC 44x).  The patch has only been compile tested though...

 drivers/net/tg3.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/tg3.c
===================================================================
--- linux-2.6.orig/drivers/net/tg3.c
+++ linux-2.6/drivers/net/tg3.c
@@ -12578,7 +12578,8 @@ static int __devinit tg3_init_one(struct
 				  const struct pci_device_id *ent)
 {
 	static int tg3_version_printed = 0;
-	unsigned long tg3reg_base, tg3reg_len;
+	resource_size_t tg3reg_base;
+	unsigned long tg3reg_len;
 	struct net_device *dev;
 	struct tg3 *tp;
 	int err, pm_cap;

^ permalink raw reply

* Re: [kvm-ppc-devel] [PATCH] [v5] Add idle wait support for 44x platforms
From: Hollis Blanchard @ 2008-04-08 19:43 UTC (permalink / raw)
  To: kvm-ppc-devel; +Cc: linuxppc-dev
In-Reply-To: <df0f79b7b4ab628887c2.1207673354@thinkpadL>

On Tuesday 08 April 2008 11:49:14 Jerone Young wrote:
> 2 files changed, 77 insertions(+), 1 deletion(-)
> arch/powerpc/platforms/44x/Makefile |    2
> arch/powerpc/platforms/44x/idle.c   |   76
> +++++++++++++++++++++++++++++++++++
>
>
> Updates: Now setting MSR_WE is now default
>          Tested on hardware platforms bamboo & sequioa and appears
>          things are working fine on actually hardware!
>
> This patch adds the ability for the CPU to go into wait state while in
> cpu_idle loop. This helps virtulization solutions know when the guest Linux
> kernel is in an idle state. There are two ways to do it.
>
> Command line
> 	idle=spin <-- CPU will spin
> 	idle=wait <-- set CPU into wait state when idle (default)
>
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

Acked-by: Hollis Blanchard <hollisb@us.ibm.com>

-- 
Hollis Blanchard
IBM Linux Technology Center

^ permalink raw reply

* Re: MPC8343 - "unable to handle paging request @ 0"
From: André Schwarz @ 2008-04-08 19:59 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20080408164853.GH2552@loki.buserror.net>

[-- Attachment #1: Type: text/plain, Size: 1858 bytes --]

Scott Wood wrote:
> On Tue, Apr 08, 2008 at 03:50:26PM +0200, Andre Schwarz wrote:
>   
>> after building a debug kernel and attaching the bdi2000 it looks like  
>> the crash occurs during "console_init()" ...
>>     
>
> Does your device tree have a /chosen node after u-boot is done with it? 
> find_legacy_serial_ports() can crash otherwise (we really should fix that).
>
>   
latest u-boot does add the chosen node.
As far as I know it's for initrd setup ... don't know if it's complete.
>> Since we're using a dtb I omit the "console=..." argument for the  
>> kernel. Is this correct ?
>>     
>
> It's OK if you have /chosen/linux,stdout-path.
>
>   
that sounds promising ! Haven't seen this and will have a closer look.
>> If "console=/dev/ttyS0,115200N8" argument is given the serial console  
>> stops working after console_init....
>>
>>
>> On other PowerPC system I could see something like this during boot :
>>
>> -> find_legacy_serial_port()
>> stdout is /soc8568@e0000000/serial@4600
>> legacy_serial_console = 1
>> default console speed = 115340
>> <- find_legacy_serial_port()
>>
>>
>> Should I see this message also ?
>>     
>
> Only if you enable debug messages in legacy_serial.c.
>
>   
ok.
>> Have I misconfigured anything ?
>>     
>
> One thing that sticks out from the above is that you ask for ttyS0, but the
> stdout you list from the other system corresponds to ttyS1.  Is this just a
> difference between the two systems?
>
>   
Yes - the log from the MPC8568 is a copy&paste from another posting. 
It's not my system.
I want ttyS0.
> -Scott
>   
I appreciate your help !

Thanks,
André


MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler  - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner

[-- Attachment #2: Type: text/html, Size: 2914 bytes --]

^ permalink raw reply

* Re: Question on mpc52xx_common.c
From: Robert Schwebel @ 2008-04-08 19:45 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40804080752g595196det8f576df1884bac5d@mail.gmail.com>

On Tue, Apr 08, 2008 at 08:52:55AM -0600, Grant Likely wrote:
> It may be ideal, but I don't think it is realistic.  I'm now of the
> firm opinion that device trees and firmware are *never* perfect.
> Especially when the definition of perfect is a moving target.

Well observed; isn't this the prove of the assumption that the whole
device tree idea is not working? It is *always* inconsistent and it is
*maintenance hell* because out-of-tree ports do *always* breakt because
of string inconsistencies. We have just ported a 8260 board from 2.6.22
to 2.6.25 and it is almost 100% oftree porting. And you do not even have
a single point of a parser, because all this string parsing is
completely scattered all over the tree.

The ARM method of using just a device number is so much easier ...

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

^ permalink raw reply

* Re: Question on mpc52xx_common.c
From: Scott Wood @ 2008-04-08 20:07 UTC (permalink / raw)
  To: Robert Schwebel; +Cc: linuxppc-dev
In-Reply-To: <20080408194517.GX13814@pengutronix.de>

Robert Schwebel wrote:
> Well observed; isn't this the prove of the assumption that the whole
> device tree idea is not working? It is *always* inconsistent and it is
> *maintenance hell* because out-of-tree ports do *always* breakt because
> of string inconsistencies. We have just ported a 8260 board from 2.6.22
> to 2.6.25 and it is almost 100% oftree porting.

There's going to be more churn in the initial stages than down the road. 
  82xx had barely been added to arch/powerpc in 2.6.22, and there was 
little review of the initial device tree bindings.

> The ARM method of using just a device number is so much easier ...

Yeah, it's so much fun to have to allocate a globally unique number for 
every minor tweak of a board, and to have to maintain a mapping from 
said numbers to information that is semantically equivalent to a device 
tree but in less maintainable form in the kernel source.

-Scott

^ permalink raw reply

* Re: Question on mpc52xx_common.c
From: Timur Tabi @ 2008-04-08 20:12 UTC (permalink / raw)
  To: Robert Schwebel; +Cc: linuxppc-dev
In-Reply-To: <20080408194517.GX13814@pengutronix.de>

Robert Schwebel wrote:

> The ARM method of using just a device number is so much easier ...

And I was going to suggest that the ARM guys should use device trees, too.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [Cbe-oss-dev] [PATCH] Cell OProfile: SPU mutex lock fix
From: Carl Love @ 2008-04-08 20:21 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev, cel, cbe-oss-dev, linux-kernel
In-Reply-To: <200804040838.40179.arnd@arndb.de>


On Fri, 2008-04-04 at 08:38 +0200, Arnd Bergmann wrote: 
> On Wednesday 02 April 2008, Carl Love wrote:
> > On Wed, 2008-04-02 at 07:21 +0200, Arnd Bergmann wrote:
> > > On Tuesday 25 March 2008, Carl Love wrote:
> > > > This patch fixes a bug in the code that records the SPU data and
> > > > context switches.  The buffer_mutex lock must be held when the
> > > > kernel is adding data to the buffer between the kernel and the
> > > > OProfile daemon.  The lock is not being held in the current code
> > > > base.  This patch fixes the bug using work queues.  The data to 
> > > > be passed to the daemon is caputured by the interrupt handler.  
> > > > The workqueue function is invoked to grab the buffer_mutex lock
> > > > and add the data to the buffer.  
> > > 
> > > So what was the exact bug you're fixing with this? There was no
> > > buffer_mutex before, so why do you need it now? Can't this be a
> > > spinlock so you can get it from interrupt context instead of
> > > using a workqueue?
> > 
> > The generic OProfile code defines a mutex lock, called buffer_mutex, to
> > protect the kernel/daemon data buffer from being writen by the kernal
> > and simultaneously read by the Daemon.  When adding a PPU sample the
> > oprofile routine  oprofile_add_ext_sample(pc, regs, i, is_kernel) is
> > called from the interrupt context to request the sample be stored.  The
> > generic oprofile code takes care of passing the data to a non interrupt
> > context where the mutex lock is held and the necessary sequence of data
> > is written into the kernel/daemon data buffer.  However, OProfile does
> > not have any built in functions for handling the SPU.  Hence, we have to
> > implement the code to capture the data in the interrupt context, pass it
> > to a non interrupt context and put it into the buffer.  This was not
> > done correctly in the original implementation.  Specifically, the mutex
> > lock was not being held.  
> 
> Ok, I see.
> 
> However, I'm pretty sure that the switch notification does not get
> called from an atomic context, so you don't need a workqueue for
> bringing that into a process context. Doing the context switch
> notification directly from the scheduler sounds much better regarding
> the impact on the measurement.

Our first thought to fix the bug was to just grab the mutex lock when
adding the switch notification data to the queue.  The kernel gives us
an oops message saying something along the line of "could not call mutex
lock in interrupt context".  Hence we had to go to work queues so we
could access the lock outside of the SPU switch notification context.

Secondly, it is my understanding that if the schedule_work() call tries
to queue the same work function multiple times the subsequent requests
are dropped.  Thus we were not able to pass the context switch data as
part of the schedule work requests.  This forced us to have an array to
store the data for each SPU.   
> 
> > > Never put extern statements in the implementation, they describe the
> > > interface between two parts of the code and should be inside of a
> > > common header.
> > > 
> > > Why do you want to have your own workqueue instead of using the
> > > global one?
> > 
> > It is important that the data get context switch data get recorded as
> > quickly as possible to avoid dropping data unnecessarily.  The PC
> > counter data for each SPU is ignored until the context switch record is
> > put into the kernel/daemon buffer.  The API documentation says that
> > using a private workqueue has better performance then using the global
> > workqueue.  There is a comment in the code about this, perhaps it is not
> > clear enough.
> 
> This sounds like an unrelated bug in the implementation. The PC
> data should *not* be ignored in any case. As long as the records
> get stored in the right order, everything should be fine here.

Until the OProfile sees the context switch record, it does not know what
to do with the PC samples and just drops them.  The thought was using a
private work queue might help get the context switch records processed a
little earlier.  It probably doesn't make that much difference.  I can
just use the generic work queue.  
> 
> 
> > > This looks like you want to use a delayed_work rather than building your
> > > own out of hrtimer and work. Is there any point why you want to use
> > > an hrtimer?
> > 
> > The current implementation uses the hrtimer to schedule when to read the
> > trace buffer the next time.  This patch does not change how the
> > scheduling of the buffer reads is done.  Yes, you could change the
> > implementation to use workqueues instead.  If you feel that it is better
> > to use the workqueue then we could make that change.  Not sure that
> > making that change in this bug fix patch is appropriate.  I would need
> > to create a second patch for that change.
> 
> I would guess that the change from hrtimer to delayed_workqueue is
> smaller than the current patch changing from hrtimer to hrtimer plus
> workqueue, so I would prefer to have only one changeset.
> 
> Since the timer only causes statistical data collection anyway, delaying
> it a bit should not have any negative effect on the accuracy of the
> measurement, unlike delaying the context switch notification.

The goal is to be able to support very high sampling rates (small
periods).  The schedule_delayed_work() is based on jiffies which I
believe is 1/250 for this machine.  This only gives millisecond
resolution.  The goal is for the users to be able to specify a time
period of 60,000 cycles or less then 20 micro second sampling periods
when the real high resolution timers are available.  We can't achieve
the desired sampling rates with the schedule_dealyed_work() function.

> 
> > > > -static DEFINE_SPINLOCK(buffer_lock);
> > > > +extern struct mutex buffer_mutex;
> > > > +extern struct workqueue_struct *oprofile_spu_wq;
> > > > +extern int calls_to_record_switch;
> > > > +
> > > 
> > > Again, public interfaces need to go to a header file, and should
> > > have a name that identifies the interface. "buffer_mutex" is
> > > certainly not a suitable name for a kernel-wide global variable!
> > 
> > As stated earlier, the generic OProfile code defines the variable
> > "buffer_mutex".  Changing the name in the generic OProfile code is
> > beyond the scope of this patch.
> 
> Ok, didn't see that the name was already part of the main oprofile
> driver. However, this makes it even worse: you are accessing data
> structures that are clearly not meant to be shared with architecture
> code. The fact that it was not declared in a global header file should
> have told you that.
> 
> I think you should instead add a function to drivers/oprofile/buffer_sync.c
> that takes care of moving the data to the common buffer under the right
> mutex_lock.


Oprofile provides nice clean interfaces for recording kernel/user
switches and CPU data recording.  This is all that was needed by any
architecture until CELL came along. With CELL, we now have need to add
processor data plus SPU data to the queue.  The buffer_mutex variable
and the add_event_entry() were not visible outside of the OProfile
driver code.  The original SPU support added add_event_entry() to the
include/linux/oprofile.h file.  We can add the buffer_mutex as well
since there is now a need to access both of these.  

I have been looking to see how I could create a generic oprofile routine
which could take the data.  The routine would still have to work from an
interrupt context, so it will need to store the data and call a work
queue function.  The function would need to know how much data will be
needed, thus you would probably need to statically allocate data or use
a list and malloc the data as needed.  I don't really want to have to
malloc data from an interrupt context.  List management adds additional
overhead.  It would be possible to have an init function that you could
call at startup time telling it how much memory you need, in this case
we could allocate a buffer the size of spu_info (defined below) at
startup time.  The call could pass an array to the OProfile routine that
would put the data into the buffer and call the work function.  We still
have to allocate the storage, it does clean up the arch specific code.
Not sure if this really buys us much.  There is more copying of data
i.e. more overhead.  Not convinced the OProfile maintainers would accept
anything I have thought of so far.

Any suggestions?

> 
> > > 
> > > >  static DEFINE_SPINLOCK(cache_lock);
> > > >  static int num_spu_nodes;
> > > > +
> > > >  int spu_prof_num_nodes;
> > > >  int last_guard_val[MAX_NUMNODES * 8];
> > > > +int cnt_swtch_processed_flag[MAX_NUMNODES * 8];
> > > > +
> > > > +struct spus_profiling_code_data_s {
> > > > +	int num_spu_nodes;
> > > > +	struct work_struct spu_prof_code_wq;
> > > > +} spus_profiling_code_data;
> > > > +
> > > > +struct spu_context_switch_data_s {
> > > > +	struct spu *spu;
> > > > +	unsigned long spu_cookie;
> > > > +	unsigned long app_dcookie;
> > > > +	unsigned int offset;
> > > > +	unsigned long objectId;
> > > > +	int valid_entry;
> > > > +} spu_context_switch_data;
> > > 
> > > I don't understand what these variables are really doing, but
> > > having e.g. just one spu_context_switch_data for all the SPUs
> > > doesn't seem to make much sense. What happens when two SPUs do
> > > a context switch at the same time?
> > 
> > This is the data same data that was being put into the event buffer
> > directly from the interrupt context.  We need to store the data that is
> > only available in the interrupt context so the same data can be put into
> > the buffer by the work queue function in the non interrupt context.
> > This is the declaration of the data needed per SPU.  Below in the
> > spu_cntx_sw_data structure, we declare an array of entries so we can
> > store the switch data on a per SPU basis as you alluded to.  
> 
> The spu_context_switch_data and spus_profiling_code_data variables
> are also unused, or just write-only. They look like they were left
> over after a conversion from a typedef.

The spu_context_switch_data structure is the type of the array used in
struct spus_cntxt_sw_data_s which is the data used by the work queue.

Yes, spus_profiling_code_data seems to be unused.

> 
> > The calls_to_record_switch variable is not used, my mistake for not
> > getting it out of the patch.  The record_spu_stat_flag is used. It is
> > set in the spu_sync_start when SPU profiling is started.  The first time
> > the work function is called to record SPU context switches it sees the
> > flag is set and writes the initial record to the daemon/kernel buffer
> > stating that this is an SPU profile run not a PPU profile run.  The
> > daemon needs to know this as it effects how the postprocessing is done.
> > The initial record is only written once.  
> > 
> > The spus_context_sw_data structure has the array per SPU for all of the
> > interrupt context data that was recorded and needs to be written to the
> > kernel/daemon buffer.  
> 
> An ideal driver should not have *any* global variables at all, but store
> all data in the (reference counted) objects it is dealing with, or
> just on the stack while it's processing the data.
> 
> Storing the context switch information in a global breaks down as soon
> as there are multiple context switches taking place for a single
> SPU without the workqueue running in between, which is a very likely
> scenario if you have high-priority tasks on the SPU.

Yes, it was recognized that we could overwrite data.  The expectation is
that the workqueue function will run fairly quickly.  If the SPU context
was only loaded for a very short period of time at most a few samples
would be captured for that frame so the error would be down in the
noise.  OProfile is a statistical tool.  If we don't get enough samples
for the spu context, then the data is not statistically valid.  Losing
the context switch is not an issue.  The context must be loaded long
enough that we collect a reasonable number of samples for the output to
be meaningful.  

> 
> > > >  /* Container for caching information about an active SPU task. */
> > > >  struct cached_info {
> > > > @@ -44,6 +73,8 @@ struct cached_info {
> > > >  	struct kref cache_ref;
> > > >  };
> > > >  
> > > > +struct workqueue_struct *oprofile_spu_wq;
> > > > +
> > > >  static struct cached_info *spu_info[MAX_NUMNODES * 8];
> > > 
> > > While you're cleaning this up, I guess the cached_info should
> > > be moved into a pointer from struct spu as well, instead of
> > > having this global variable here.
> >
> > This would be a functional change and it belongs in a functional change
> > patch not in a bug fix patch.
> 
> The patch is already far bigger than a simple bug fix, but you're right
> in that this part should be separate. Upon reading through the code
> again, I noticed that the cached_info is thrown away on each context
> switch and rebuilt, which I guess makes it impossible to really profile
> the context switch code. In the initial design phase for spu oprofile, we
> decided that the information should be cached in the spu_context, which
> would not only be much cleaner but also avoid the performance problem.
> 
> Do you have any idea why this idea was dropped? Is it still work in
> progress to get that functionality right?

It was not dropped.  It was implemented.  The issue that I have is the
dcookie spu_cookie, app_dcookie, offset, objectId is not included in the
local cahced spu context data.  Previously, there was no need to save it
since it was being immediatly written to oprofile buffer (without
holding the mutex lock).  Now we need to store the data until the
workqueue function runs.  We can store it in the array as I have done or
you could put it in the spu context.  Functionally, it doesn't change
anything.  The data in the SPU context would get overwritten, just as it
does in the array, if there was an SPU context switch before the
workqueue function runs so that doesn't solve that issue.

> 
> > > I would guess that you need one work struct per SPU instead of a global
> > > one, if you want to pass the SPU pointer as an argument.
> > 
> > We only need one work struct because we have an array that contains the
> > data for each SPU that has done a context switch.  
> 
> right, but as I explained, the global array is the real problem that should
> be fixed.
> 
> 	Arnd <><

^ permalink raw reply

* Re: Question on mpc52xx_common.c
From: Grant Likely @ 2008-04-08 21:26 UTC (permalink / raw)
  To: Robert Schwebel; +Cc: linuxppc-dev
In-Reply-To: <20080408194517.GX13814@pengutronix.de>

On Tue, Apr 8, 2008 at 1:45 PM, Robert Schwebel
<r.schwebel@pengutronix.de> wrote:
> On Tue, Apr 08, 2008 at 08:52:55AM -0600, Grant Likely wrote:
>  > It may be ideal, but I don't think it is realistic.  I'm now of the
>  > firm opinion that device trees and firmware are *never* perfect.
>  > Especially when the definition of perfect is a moving target.
>
>  Well observed; isn't this the prove of the assumption that the whole
>  device tree idea is not working? It is *always* inconsistent and it is
>  *maintenance hell* because out-of-tree ports do *always* breakt because
>  of string inconsistencies. We have just ported a 8260 board from 2.6.22
>  to 2.6.25 and it is almost 100% oftree porting. And you do not even have
>  a single point of a parser, because all this string parsing is
>  completely scattered all over the tree.

I disagree and that is not my point.  My point is that perfection is
neither obtainable or necessary.  Many of the recently established
embedded guidelines are not "perfect" because they are counter to a
few of the OF recommended practices.  However, they are consistent
within themselves, they work, and once established they are not going
to change.  imperfect != bad.  I brought up a new 5200 board this week
which required zero kernel changes.  All I needed was a new dt to
describe the board.

Now, if out-of-tree ports continue to break then we've got a problem
that needs to be fixed.  Once a binding is established (which usually
takes a few kernel releases) it should be very stable and even if the
definition of ideal is changed, backwards compatibility must be
maintained.

>  The ARM method of using just a device number is so much easier ...

Only if the assumption is made that very little data needs to be
shared between the kernel and the firmware.  The moment you try to do
something more complex you either have the nightmare of bd_info or you
use a structured data format (like the device tree)

On another node, there are platforms where a device number is
unworkable.  For example, for Linux on an FPGA like the Xilinx Virtex,
there would need to be a new platform number every time the FPGA
bitstream was updated because it is effectively an entirely different
platform.

Finally, using a device number means you need to encode into the
kernel the exact layout of every platform it supports.  That adds up
to a lot of code in a real hurry; even if most of it is just
boilerplate instantiations.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: Booting a Xilinx board
From: Grant Likely @ 2008-04-08 21:32 UTC (permalink / raw)
  To: Guillaume Dargaud; +Cc: linuxppc-dev
In-Reply-To: <10fd01c89974$57a0c830$f52f9e86@LPSC0173W>

On Tue, Apr 8, 2008 at 6:30 AM, Guillaume Dargaud <dargaud@lpsc.in2p3.fr> wrote:
> I'm making progress, thanks in no small part to this list, but I still need
> coaching, if you don't mind. The current boot is currently going as such:
>
>
>  loaded at:     00400000 005A819C
>  board data at: 005A6120 005A619C
<snip>
>  [    4.897987] RPC: Registered udp transport module.
>  [    4.953147] RPC: Registered tcp transport module.
>  [    5.011138] RAMDISK: Compressed image found at block 0
>  [    5.905538] VFS: Mounted root (ext2 filesystem).
>  [    5.945703] Freeing unused kernel memormdev: /etc/mdev.conf: No such
> file
>  or directory
>  mdev: /etc/mdev.conf: No such file or directory
<snip>
>  mdev: /etc/mdev.conf: No such file or directory
>  mdev: /etc/mdev.conf: No such file or directory
>  mount: mounting configfs on /config failed: No such device
>  Initializing random number generator... done.
>  Starting network...
>  ip: RTNETLINK answers: File exists
>
>
>  And then it stops, although I still have echo when I type.
>  Now there's no /etc/mdev.conf file in my root fylesystem and I understand I
> need to create the devices.
>  I've been reading docs/mdev.txt and
> http://www.lfs-matrix.org/clfs/view/clfs-embedded/mips/bootscripts/mdev.html
> and I'm a bit confused.

Congratulations, your kernel is in good shape.  Now you're dealing
with userspace issues.  You can try bypassing most of the init process
to see if you can get a prompt.  Add init=/bin/sh to the kernel
command line.

>
>  - do the devices need to be created in the FS before building the ramdisk
> and subsequent ACE file ?

Yes, you can statically create the device files.  MAKEDEV will do this
for you.  You can even just copy them from a working Linux system (any
arch).

>  - are they created dynamically by /bin/mdev on boot based on a manually
> written /etc/mdev.conf table as the error messages seem to imply ?

That depends on your rootfs.  Where did you get your rootfs image?

>  - can they be generated automagically by a MAKEDEV script ?
>
>  In the second case, how do I know which devices and what names I'm supposed
> to define ?

Easiest way: copy from the /dev tree in a running Linux machine.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* [PATCH] ata: Fix pata SIL680 build on arch/ppc
From: Benjamin Herrenschmidt @ 2008-04-08 21:51 UTC (permalink / raw)
  To: jgarzik; +Cc: linuxppc-dev, Linux IDE

Commit 0f436eff54f90419ac1b8accfb3e6e17c4b49a4e breaks build on
arch/ppc as it doesn't implement the machine_is() macro.

This fixes it by using CONFIG_PPC_MERGE instead which represents
arch/powerpc only, while CONFIG_PPC is set for both.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 Index: linux-work/drivers/ata/pata_sil680.c
===================================================================
 drivers/ata/pata_sil680.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-work.orig/drivers/ata/pata_sil680.c	2008-04-09 07:47:23.000000000 +1000
+++ linux-work/drivers/ata/pata_sil680.c	2008-04-09 07:47:29.000000000 +1000
@@ -270,7 +270,7 @@ static u8 sil680_init_chip(struct pci_de
 		tmpbyte & 1, tmpbyte & 0x30);
 
 	*try_mmio = 0;
-#ifdef CONFIG_PPC
+#ifdef CONFIG_PPC_MERGE
 	if (machine_is(cell))
 		*try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);
 #endif

^ permalink raw reply

* Re: Question on mpc52xx_common.c
From: Segher Boessenkool @ 2008-04-08 21:51 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40804081426u2c2a530ej8ecb6ce9f8fb49a0@mail.gmail.com>

> I disagree and that is not my point.  My point is that perfection is
> neither obtainable or necessary.

It's a nice goal though.

> Many of the recently established
> embedded guidelines are not "perfect" because they are counter to a
> few of the OF recommended practices.  However, they are consistent
> within themselves, they work, and once established they are not going
> to change.

Yeah.  Which is good, even if the bindings themselves aren't
so good.

> Now, if out-of-tree ports continue to break then we've got a problem
> that needs to be fixed.  Once a binding is established (which usually
> takes a few kernel releases)

This is a big problem that is totally avoidable.

*Before* accepting any patches that use a new binding (including
patches to .dts files), that binding itself needs to be discussed.
This will be a lot less work than trying to see what's going on in
some platform/device code and/or some example device tree, and
spotting mistakes there.  It might be a little more work upfront,
and it might seem like it would increase lead time, but as usual,
it's worth it.

Let's flat out refuse any patch series that uses a non-documented
binding.

> it should be very stable and even if the
> definition of ideal is changed, backwards compatibility must be
> maintained.

Which is a good argument why getting it right the first time is
so important (as with all interfaces, nothing specific about
device trees here).

>>  The ARM method of using just a device number is so much easier ...
>
> Only if the assumption is made that very little data needs to be
> shared between the kernel and the firmware.

...which means the kernel has to know *everything* about the hardware
setup and/or what settings the firmware established; i.e., the kernel
has to 100% replace the firmware.  This can be nice for some use cases
(it's the route LinuxBIOS took originally), but it simply doesn't
scale, not in any dimension.


Segher

^ 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