LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: snd-aoa status update / automatic driver loading
From: Benjamin Berg @ 2006-05-20 14:57 UTC (permalink / raw)
  To: charles-debian-nospam; +Cc: linuxppc-dev, debian-powerpc
In-Reply-To: <20060518004141.GC1552@kunpuu.plessy.org>

On Thu, 2006-18-05 at 09:41 +0900, Charles Plessy wrote:=20
> Hi all,
>=20
> just a "me too" mail:
>=20
> Le Thu, May 18, 2006 at 12:02:01AM +0200, B=C3=B8rge Holen a =C3=A9crit :
> > I can also remember half way throught a ogg/mp3 playlist when it also=20
> > scrambled the output, this has only happened ONCE.
>=20
> I experience the same on my 8,1 powermac, but more systematically. It
> takes usually more than one hour of continuous listening before it
> happens, and then it happens sort of stochastically. I am not using
> anything else than xmms, so I did not figure out if it is a xmms or a
> driver problem. Stop/Starting the listening stops the scrambling.

This is exactly the problem that I have experienced since a while now.
The problem is that some interrupts get lost. This results in a broken
address calculation and the new data is written to the wrong place.

The attached patch fixes this by checking the 'frame_count'.
What I don't really understand is, that the first time the interrupt
gets executed, the frame_count is 8 _less_ of what I would have expected
My guess is that the dma controller reads the last 32 bytes, and then
the interrupt gets fired.

diff --git a/soundbus/i2sbus/i2sbus-pcm.c b/soundbus/i2sbus/i2sbus-pcm.c
index 9eadf83..8511234 100644
--- a/soundbus/i2sbus/i2sbus-pcm.c
+++ b/soundbus/i2sbus/i2sbus-pcm.c
@@ -440,6 +440,11 @@ static int i2sbus_pcm_trigger(struct i2s
 			return -ENXIO;
 		}
=20
+		/* get the current frame_count - 32 bytes. This is just guessed,
+		   but it seems that the interrupt triggers as soon as the last 32 bytes
+		   are cached or something. */
+		pi->frame_count =3D in_le32(&i2sdev->intfregs->frame_count) - 0x20 / (pi=
->substream->runtime->sample_bits / 8);
+
 		/* wake up the chip with the next descriptor */
 		out_le32(&pi->dbdma->control, (RUN|WAKE) | ((RUN|WAKE)<<16));
 		/* off you go! */
@@ -488,13 +493,29 @@ static snd_pcm_uframes_t i2sbus_pcm_poin
 static inline void handle_interrupt(struct i2sbus_dev *i2sdev, int in)
 {
 	struct pcm_info *pi;
+	u32 fc;
+	u32 delta;
=20
 	get_pcm_info(i2sdev, in, &pi, NULL);
 	if (!pi->substream) {
 		printk(KERN_INFO "i2sbus: got %s irq while not active!\n", in?"rx":"tx")=
;
 		return;
 	}
-	pi->current_period =3D (pi->current_period+1) % (pi->periods);
+=09
+	fc =3D in_le32(&i2sdev->intfregs->frame_count);
+	/* a counter overflow does not change the calculation. */
+	delta =3D fc - pi->frame_count;
+=09
+	if (delta <=3D pi->substream->runtime->period_size) {
+		pi->current_period =3D pi->current_period + 1;
+		delta =3D 0;
+	} else while (delta >=3D pi->substream->runtime->period_size) {
+		pi->current_period =3D pi->current_period + 1;
+		delta =3D delta - pi->substream->runtime->period_size;
+	}
+=09
+	pi->frame_count =3D fc - delta;
+	pi->current_period =3D pi->current_period % pi->periods;
 	snd_pcm_period_elapsed(pi->substream);
 }
=20
diff --git a/soundbus/i2sbus/i2sbus.h b/soundbus/i2sbus/i2sbus.h
index b054e02..f5d16aa 100644
--- a/soundbus/i2sbus/i2sbus.h
+++ b/soundbus/i2sbus/i2sbus.h
@@ -41,6 +41,7 @@ struct pcm_info {
 	struct snd_pcm_substream *substream;
 	int current_period;
 	int periods;
+	u32 frame_count;
 	struct dbdma_command_mem dbdma_ring;
 	volatile struct dbdma_regs __iomem *dbdma;
 };

^ permalink raw reply related

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Andrew Morton @ 2006-05-20 20:59 UTC (permalink / raw)
  To: Mel Gorman
  Cc: davej, tony.luck, linux-mm, mel, ak, bob.picco, linux-kernel,
	linuxppc-dev
In-Reply-To: <20060508141151.26912.15976.sendpatchset@skynet>

Mel Gorman <mel@csn.ul.ie> wrote:
>
> 
> Size zones and holes in an architecture independent manner for x86_64.
> 
> 

I found a .config which triggers the cant-map-acpitables problem.


With that .config, and without this patch:

Linux version 2.6.17-rc4-mm2 (akpm@box) (gcc version 4.1.0 20060304 (Red Hat 4.6
BIOS-provided physical RAM map:                                                
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000ca605000 (usable)  
 BIOS-e820: 00000000ca605000 - 00000000ca680000 (ACPI NVS)
 BIOS-e820: 00000000ca680000 - 00000000cb5ef000 (usable)  
 BIOS-e820: 00000000cb5ef000 - 00000000cb5fc000 (reserved)
 BIOS-e820: 00000000cb5fc000 - 00000000cb6a2000 (usable)  
 BIOS-e820: 00000000cb6a2000 - 00000000cb6eb000 (ACPI NVS)
 BIOS-e820: 00000000cb6eb000 - 00000000cb6ef000 (usable)  
 BIOS-e820: 00000000cb6ef000 - 00000000cb6ff000 (ACPI data)
 BIOS-e820: 00000000cb6ff000 - 00000000cb700000 (usable)   
 BIOS-e820: 00000000cb700000 - 00000000cc000000 (reserved)
 BIOS-e820: 00000000ffe00000 - 0000000100000000 (reserved)
 BIOS-e820: 0000000100000000 - 0000000130000000 (usable)  
DMI 2.4 present.                                        
ACPI: PM-Timer IO Port: 0x408
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
Processor #0 6:15 APIC version 20                 
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
Processor #1 6:15 APIC version 20                 
ACPI: LAPIC (acpi_id[0x03] lapic_id[0x82] disabled)
ACPI: LAPIC (acpi_id[0x04] lapic_id[0x83] disabled)
ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])  
ACPI: LAPIC_NMI (acpi_id[0x02] dfl dfl lint[0x1])
ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)      


With that .config, and with this patch:

Bootdata ok (command line is ro root=LABEL=/ earlyprintk=serial,ttyS0,9600,keep netconsole=4444@192.168.2.4/eth0,5147@192.168.2.33/00:0D:56:C6:C6:CC)
Linux version 2.6.17-rc4-mm2 (akpm@box) (gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)) #33 SMP Sat May 20 12:08:03 PDT 2006
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000ca605000 (usable)
 BIOS-e820: 00000000ca605000 - 00000000ca680000 (ACPI NVS)
 BIOS-e820: 00000000ca680000 - 00000000cb5ef000 (usable)
 BIOS-e820: 00000000cb5ef000 - 00000000cb5fc000 (reserved)
 BIOS-e820: 00000000cb5fc000 - 00000000cb6a2000 (usable)
 BIOS-e820: 00000000cb6a2000 - 00000000cb6eb000 (ACPI NVS)
 BIOS-e820: 00000000cb6eb000 - 00000000cb6ef000 (usable)
 BIOS-e820: 00000000cb6ef000 - 00000000cb6ff000 (ACPI data)
 BIOS-e820: 00000000cb6ff000 - 00000000cb700000 (usable)
 BIOS-e820: 00000000cb700000 - 00000000cc000000 (reserved)
 BIOS-e820: 00000000ffe00000 - 0000000100000000 (reserved)
 BIOS-e820: 0000000100000000 - 0000000130000000 (usable)
Too many memory regions, truncating
Too many memory regions, truncating
Too many memory regions, truncating
DMI 2.4 present.
ACPI: Unable to map RSDT header
Intel MultiProcessor Specification v1.4
    Virtual Wire compatibility mode.
OEM ID:  Product ID:  APIC at: 0xFEE00000


ACPI disables itself.

Good .config: http://www.zip.com.au/~akpm/linux/patches/stuff/config-good
Bad .config: http://www.zip.com.au/~akpm/linux/patches/stuff/config-bad


The handling of MAX_ACTIVE_REGIONS is unpleasing, sorry.  In my setup it is
5.  But we _really_ only support 4 regions.  So for a start it is misnamed.
The maximum number of regions we support is actually MAX_ACTIVE_REGIONS-1.
And this is a config option too!  So the user must specify
CONFIG_MAX_ACTIVE_REGIONS as the number of active regions plus one, for the
terminating region which has end_pfn=0.  It's weird.

I would not consider this code to be adequately commented.  Please raise a
patch which comments the major functions - what they do, why they do it,
any caveats or implementations details.  A few lines each - don't overdo
it.  Details such as whether the various end_pfn's are inclusive or
exclusive are important, as is a description of the return value.

Anyway, I just don't get how this code can work.  We have an e820 map with
up to 128 entries (this machine has ten) and we're trying to scrunch that
all into the four-entry early_node_map[].

With config-good we're set up for NUMA, CONFIG_NODES_SHIFT=6.  So
MAX_ACTIVE_REGIONS is enormous.  But it's quite wrong that we're using
number-of-zones*number-of-nodes to size a data structure which has to
accommodate all the entries in the e820 map.  These things aren't related.


On my little x86 PC:

BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
 BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
 BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
 BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
 BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
255MB LOWMEM available.
found SMP MP-table at 000ff780
Range (nid 0) 0 -> 65472, max 4
On node 0 totalpages: 65472
  DMA zone: 4096 pages, LIFO batch:0
  Normal zone: 61376 pages, LIFO batch:15

So here, the architecture code only called add_active_range() the once, for
the entire memory map.  But on the x86_64 add_active_range() was called
once per e820 entry.  I'm dimly starting to realise that this is perhaps
the problem - the weird-looking definition of MAX_ACTIVE_REGIONS _expects_
the architecture to call add_active_range() with a start_pfn/end_pfn which
describes the entire range of pfns for each zone in each node.  Even if
that span includes not-present pfns.  Would that be correct?  I didn't see
a comment in there describing this design (I do go on).

If so, perhaps the bug is that the x86_64 code isn't doing that.  And that
x86 isn't doing it for some people either.

Anyway.  From the implementation I can see what the code is doing.  But I
see no description of what it is _supposed_ to be doing.  (The process of
finding differences between these two things is known as "debugging").  I
could kludge things by setting MAX_ACTIVE_REGIONS to 1000000, but enough. 
I look forward to the next version ;)

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Andi Kleen @ 2006-05-20 21:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: davej, tony.luck, linux-mm, Mel Gorman, linux-kernel, bob.picco,
	linuxppc-dev
In-Reply-To: <20060520135922.129a481d.akpm@osdl.org>


> Anyway.  From the implementation I can see what the code is doing.  But I
> see no description of what it is _supposed_ to be doing.  (The process of
> finding differences between these two things is known as "debugging").  I
> could kludge things by setting MAX_ACTIVE_REGIONS to 1000000, but enough. 
> I look forward to the next version ;)

Or we could just keep the working old code.

Can somebody remind me what this patch kit was supposed to fix or improve again? 

-Andi

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Andrew Morton @ 2006-05-20 21:40 UTC (permalink / raw)
  To: Andi Kleen
  Cc: davej, tony.luck, linux-mm, mel, linux-kernel, bob.picco,
	linuxppc-dev
In-Reply-To: <200605202327.19606.ak@suse.de>

Andi Kleen <ak@suse.de> wrote:
>
> 
> > Anyway.  From the implementation I can see what the code is doing.  But I
> > see no description of what it is _supposed_ to be doing.  (The process of
> > finding differences between these two things is known as "debugging").  I
> > could kludge things by setting MAX_ACTIVE_REGIONS to 1000000, but enough. 
> > I look forward to the next version ;)
> 
> Or we could just keep the working old code.
> 
> Can somebody remind me what this patch kit was supposed to fix or improve again? 
> 

Well, it creates arch-neutral common code, teaches various architectures
use it.  It's the sort of thing we do all the time.

These things are opportunities to eliminate crufty arch code which few
people understand and replace them with new, clean common code which lots
of people understand.  That's not a bad thing to be doing.

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Andi Kleen @ 2006-05-20 22:17 UTC (permalink / raw)
  To: Andrew Morton
  Cc: davej, tony.luck, linux-mm, mel, linux-kernel, bob.picco,
	linuxppc-dev
In-Reply-To: <20060520144043.22f993b1.akpm@osdl.org>

 
> Well, it creates arch-neutral common code, teaches various architectures
> use it.  It's the sort of thing we do all the time.
> 
> These things are opportunities to eliminate crufty arch code which few
> people understand and replace them with new, clean common code which lots
> of people understand.  That's not a bad thing to be doing.

I'm not fundamentally against that, but so far it seems to just generate lots of 
new bugs?  I'm not sure it's really worth the pain.

-Andi

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Andrew Morton @ 2006-05-20 22:54 UTC (permalink / raw)
  To: Andi Kleen
  Cc: davej, tony.luck, linux-mm, mel, linux-kernel, bob.picco,
	linuxppc-dev
In-Reply-To: <200605210017.59984.ak@suse.de>

Andi Kleen <ak@suse.de> wrote:
>
>  
> > Well, it creates arch-neutral common code, teaches various architectures
> > use it.  It's the sort of thing we do all the time.
> > 
> > These things are opportunities to eliminate crufty arch code which few
> > people understand and replace them with new, clean common code which lots
> > of people understand.  That's not a bad thing to be doing.
> 
> I'm not fundamentally against that, but so far it seems to just generate lots of 
> new bugs?  I'm not sure it's really worth the pain.
> 

It is a bit disproportionate.  But in some ways that's a commentary on the
current code.   All this numa/sparse/flat/discontig/holes-in-zones/
virt-memmap/ stuff is pretty hairy, especially in its initalisation.

I'm willing to go through the pain if it ends up with something cleaner
which more people understand a little bit.

^ permalink raw reply

* Re: snd-aoa status update / automatic driver loading
From: Benjamin Herrenschmidt @ 2006-05-20 23:56 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev list, Benjamin Berg, debian-powerpc
In-Reply-To: <1148034127.15507.178.camel@johannes>


> Alternatively we could use the register just to detect if we lost
> interrupts, i.e. calculate how many frames we have per period and then
> see if the frame count increased approximately by that much (I've seen
> +- a few frames probably due to timing, with higher samplerates we'll
> probably see a bit more error) and if it increased by much more we could
> estimate how many interrupts we lost. What do you think?

What do you mean by lost interrupts ?

DBDMA sends edge interrupts. Thus, if it emits interrupts A, then B and
C, and for any reason, your kenrel is not able to service interrupts (is
doing something with IRQs disabled) from before B happens to after C
happens, you'll indeed get called only twice (A and C) and "B" will be
sort-of lost.

First thing about that is: what the heck is causing us to have such a
latency !!! that would be useful to figure out. A way to do that would
be maybe to "detect" when C happens that we missed B (see below how to
do that) and print something along with the regs->nip & lr (or even a
backtrace). That might give us an idea of there interrupts are
re-enabled after the long latency which could perhaps lead us to the
cause of the latency.

Now for detecting lost interrupts (and for being immune to them), the
technique is not to just assume IRQ -> 1 period completed, but instead,
when an irq happens, to go read the DBDMA descriptors in memory to see
which ones have actually been completed. Their status field should be
updated as their get comleted. Thus, you keep track of the "previous"
last completed descriptor and you walk from that to recycle them.

Since we can only update the framecounter on a per-period basis, the
driver would benefit from having lots of very small periods. I don't
know if we can provide "hints" to userland about that though. Using the
i2s frame counter means we need some kind of calibration... it might
still be counting if for the reason the DBDMA "misses" something or gets
stopped....

Ben.

^ permalink raw reply

* Re: snd-aoa status update / automatic driver loading
From: Benjamin Herrenschmidt @ 2006-05-20 23:59 UTC (permalink / raw)
  To: Benjamin Berg; +Cc: linuxppc-dev, debian-powerpc, charles-debian-nospam
In-Reply-To: <1148137032.3407.12.camel@localhost>

On Sat, 2006-05-20 at 16:57 +0200, Benjamin Berg wrote:
> On Thu, 2006-18-05 at 09:41 +0900, Charles Plessy wrote: 
> > Hi all,
> > 
> > just a "me too" mail:
> > 
> > Le Thu, May 18, 2006 at 12:02:01AM +0200, Børge Holen a écrit :
> > > I can also remember half way throught a ogg/mp3 playlist when it also 
> > > scrambled the output, this has only happened ONCE.
> > 
> > I experience the same on my 8,1 powermac, but more systematically. It
> > takes usually more than one hour of continuous listening before it
> > happens, and then it happens sort of stochastically. I am not using
> > anything else than xmms, so I did not figure out if it is a xmms or a
> > driver problem. Stop/Starting the listening stops the scrambling.
> 
> This is exactly the problem that I have experienced since a while now.
> The problem is that some interrupts get lost. This results in a broken
> address calculation and the new data is written to the wrong place.

See my other mail about that. Worth tracking down. As far as the DBDMA
handling is concerned, I think walking the descriptors and harvesting
status bits is a better approach as it also allows you to get error
status if you ever get any. Now, if you can have some reliable frame
counter, that's definitely something to look into passing userland too.

> The attached patch fixes this by checking the 'frame_count'.
> What I don't really understand is, that the first time the interrupt
> gets executed, the frame_count is 8 _less_ of what I would have expected
> My guess is that the dma controller reads the last 32 bytes, and then
> the interrupt gets fired.

The DBDMA definitely has a fifo. By the time you get the IRQ, it may
have started pumping the "next" packet. 32 bytes sounds about right for
the DBDMA fifo... old DBDMAs had 16 bits iirc but I could imagine Apple
improving that.

> diff --git a/soundbus/i2sbus/i2sbus-pcm.c b/soundbus/i2sbus/i2sbus-pcm.c
> index 9eadf83..8511234 100644
> --- a/soundbus/i2sbus/i2sbus-pcm.c
> +++ b/soundbus/i2sbus/i2sbus-pcm.c
> @@ -440,6 +440,11 @@ static int i2sbus_pcm_trigger(struct i2s
>  			return -ENXIO;
>  		}
>  
> +		/* get the current frame_count - 32 bytes. This is just guessed,
> +		   but it seems that the interrupt triggers as soon as the last 32 bytes
> +		   are cached or something. */
> +		pi->frame_count = in_le32(&i2sdev->intfregs->frame_count) - 0x20 / (pi->substream->runtime->sample_bits / 8);
> +
>  		/* wake up the chip with the next descriptor */
>  		out_le32(&pi->dbdma->control, (RUN|WAKE) | ((RUN|WAKE)<<16));
>  		/* off you go! */
> @@ -488,13 +493,29 @@ static snd_pcm_uframes_t i2sbus_pcm_poin
>  static inline void handle_interrupt(struct i2sbus_dev *i2sdev, int in)
>  {
>  	struct pcm_info *pi;
> +	u32 fc;
> +	u32 delta;
>  
>  	get_pcm_info(i2sdev, in, &pi, NULL);
>  	if (!pi->substream) {
>  		printk(KERN_INFO "i2sbus: got %s irq while not active!\n", in?"rx":"tx");
>  		return;
>  	}
> -	pi->current_period = (pi->current_period+1) % (pi->periods);
> +	
> +	fc = in_le32(&i2sdev->intfregs->frame_count);
> +	/* a counter overflow does not change the calculation. */
> +	delta = fc - pi->frame_count;
> +	
> +	if (delta <= pi->substream->runtime->period_size) {
> +		pi->current_period = pi->current_period + 1;
> +		delta = 0;
> +	} else while (delta >= pi->substream->runtime->period_size) {
> +		pi->current_period = pi->current_period + 1;
> +		delta = delta - pi->substream->runtime->period_size;
> +	}
> +	
> +	pi->frame_count = fc - delta;
> +	pi->current_period = pi->current_period % pi->periods;
>  	snd_pcm_period_elapsed(pi->substream);
>  }
>  
> diff --git a/soundbus/i2sbus/i2sbus.h b/soundbus/i2sbus/i2sbus.h
> index b054e02..f5d16aa 100644
> --- a/soundbus/i2sbus/i2sbus.h
> +++ b/soundbus/i2sbus/i2sbus.h
> @@ -41,6 +41,7 @@ struct pcm_info {
>  	struct snd_pcm_substream *substream;
>  	int current_period;
>  	int periods;
> +	u32 frame_count;
>  	struct dbdma_command_mem dbdma_ring;
>  	volatile struct dbdma_regs __iomem *dbdma;
>  };
> 
> 

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Mel Gorman @ 2006-05-21 15:50 UTC (permalink / raw)
  To: Andrew Morton
  Cc: davej, tony.luck, linux-mm, ak, bob.picco, linux-kernel,
	linuxppc-dev
In-Reply-To: <20060520135922.129a481d.akpm@osdl.org>

On Sat, 20 May 2006, Andrew Morton wrote:

> Mel Gorman <mel@csn.ul.ie> wrote:
>>
>>
>> Size zones and holes in an architecture independent manner for x86_64.
>>
>>
>
> I found a .config which triggers the cant-map-acpitables problem.
>
>
> With that .config, and without this patch:
>
> Linux version 2.6.17-rc4-mm2 (akpm@box) (gcc version 4.1.0 20060304 (Red Hat 4.6
> BIOS-provided physical RAM map:
> BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
> BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
> BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
> BIOS-e820: 0000000000100000 - 00000000ca605000 (usable)
> BIOS-e820: 00000000ca605000 - 00000000ca680000 (ACPI NVS)
> BIOS-e820: 00000000ca680000 - 00000000cb5ef000 (usable)
> BIOS-e820: 00000000cb5ef000 - 00000000cb5fc000 (reserved)
> BIOS-e820: 00000000cb5fc000 - 00000000cb6a2000 (usable)
> BIOS-e820: 00000000cb6a2000 - 00000000cb6eb000 (ACPI NVS)
> BIOS-e820: 00000000cb6eb000 - 00000000cb6ef000 (usable)
> BIOS-e820: 00000000cb6ef000 - 00000000cb6ff000 (ACPI data)
> BIOS-e820: 00000000cb6ff000 - 00000000cb700000 (usable)
> BIOS-e820: 00000000cb700000 - 00000000cc000000 (reserved)
> BIOS-e820: 00000000ffe00000 - 0000000100000000 (reserved)
> BIOS-e820: 0000000100000000 - 0000000130000000 (usable)
> DMI 2.4 present.
> ACPI: PM-Timer IO Port: 0x408
> ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> Processor #0 6:15 APIC version 20
> ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
> Processor #1 6:15 APIC version 20
> ACPI: LAPIC (acpi_id[0x03] lapic_id[0x82] disabled)
> ACPI: LAPIC (acpi_id[0x04] lapic_id[0x83] disabled)
> ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])
> ACPI: LAPIC_NMI (acpi_id[0x02] dfl dfl lint[0x1])
> ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
> IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
> ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
>
>
> With that .config, and with this patch:
>
> Bootdata ok (command line is ro root=LABEL=/ earlyprintk=serial,ttyS0,9600,keep netconsole=4444@192.168.2.4/eth0,5147@192.168.2.33/00:0D:56:C6:C6:CC)
> Linux version 2.6.17-rc4-mm2 (akpm@box) (gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)) #33 SMP Sat May 20 12:08:03 PDT 2006
> BIOS-provided physical RAM map:
> BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
> BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
> BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
> BIOS-e820: 0000000000100000 - 00000000ca605000 (usable)
> BIOS-e820: 00000000ca605000 - 00000000ca680000 (ACPI NVS)
> BIOS-e820: 00000000ca680000 - 00000000cb5ef000 (usable)
> BIOS-e820: 00000000cb5ef000 - 00000000cb5fc000 (reserved)
> BIOS-e820: 00000000cb5fc000 - 00000000cb6a2000 (usable)
> BIOS-e820: 00000000cb6a2000 - 00000000cb6eb000 (ACPI NVS)
> BIOS-e820: 00000000cb6eb000 - 00000000cb6ef000 (usable)
> BIOS-e820: 00000000cb6ef000 - 00000000cb6ff000 (ACPI data)
> BIOS-e820: 00000000cb6ff000 - 00000000cb700000 (usable)
> BIOS-e820: 00000000cb700000 - 00000000cc000000 (reserved)
> BIOS-e820: 00000000ffe00000 - 0000000100000000 (reserved)
> BIOS-e820: 0000000100000000 - 0000000130000000 (usable)
> Too many memory regions, truncating
> Too many memory regions, truncating
> Too many memory regions, truncating
> DMI 2.4 present.
> ACPI: Unable to map RSDT header
> Intel MultiProcessor Specification v1.4
>    Virtual Wire compatibility mode.
> OEM ID:  Product ID:  APIC at: 0xFEE00000
>
> ACPI disables itself.
>

ok, not good but at least it's certain. I had been lulled into a false 
sense of security when Christian's machine was still not able to boot with 
the patch backed out. I still have not reproduced the problem locally, but 
I don't have an x86_64 with so many holes either.

> Good .config: http://www.zip.com.au/~akpm/linux/patches/stuff/config-good
> Bad .config: http://www.zip.com.au/~akpm/linux/patches/stuff/config-bad
>
>
> The handling of MAX_ACTIVE_REGIONS is unpleasing, sorry.  In my setup it is
> 5.  But we _really_ only support 4 regions.  So for a start it is misnamed.
> The maximum number of regions we support is actually MAX_ACTIVE_REGIONS-1.
> And this is a config option too!  So the user must specify
> CONFIG_MAX_ACTIVE_REGIONS as the number of active regions plus one, for the
> terminating region which has end_pfn=0.  It's weird.
>

That's a fair comment. I'll put more thought into the definition of 
MAX_ACTIVE_REGIONS and how it is used.

> I would not consider this code to be adequately commented.  Please raise a
> patch which comments the major functions - what they do, why they do it,
> any caveats or implementations details.  A few lines each - don't overdo
> it.  Details such as whether the various end_pfn's are inclusive or
> exclusive are important, as is a description of the return value.
>

Understood. Right now, the closest thing to an explanation is a comment in 
include/linux/mm.h but it is not very detailed.

> Anyway, I just don't get how this code can work.  We have an e820 map with
> up to 128 entries (this machine has ten) and we're trying to scrunch that
> all into the four-entry early_node_map[].
>

Missing E820MAX was a mistake. On x86_64, CONFIG_MAX_ACTIVE_REGIONS should 
have been used. I didn't expect x86_64 to have so many memory holes.

> With config-good we're set up for NUMA, CONFIG_NODES_SHIFT=6.  So
> MAX_ACTIVE_REGIONS is enormous.  But it's quite wrong that we're using
> number-of-zones*number-of-nodes to size a data structure which has to
> accommodate all the entries in the e820 map.  These things aren't related.
>

Very true.

>
> On my little x86 PC:
>
> BIOS-provided physical RAM map:
> BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
> BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
> BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
> BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
> BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
> BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
> BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
> BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
> BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
> BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
> 0MB HIGHMEM available.
> 255MB LOWMEM available.
> found SMP MP-table at 000ff780
> Range (nid 0) 0 -> 65472, max 4
> On node 0 totalpages: 65472
>  DMA zone: 4096 pages, LIFO batch:0
>  Normal zone: 61376 pages, LIFO batch:15
>
> So here, the architecture code only called add_active_range() the once, for
> the entire memory map.

Because in this case, the architecture reported that there was just one 
range of available pages with no holes.

> But on the x86_64 add_active_range() was called once per e820 entry. 
> I'm dimly starting to realise that this is perhaps the problem - the 
> weird-looking definition of MAX_ACTIVE_REGIONS _expects_ the 
> architecture to call add_active_range() with a start_pfn/end_pfn which 
> describes the entire range of pfns for each zone in each node. Even if 
> that span includes not-present pfns.  Would that be correct?

Not quite and the confusion is because of how I defined 
MAX_ACTIVE_REGIONS. The calculation for it is similar to how i386 using 
SRAT calculates MAX_CHUNKS;

#define MAX_CHUNKS_PER_NODE     4
#define MAXCHUNKS               (MAX_CHUNKS_PER_NODE * MAX_NUMNODES)

which has little bearing on any other arch.

What is meant to happen is that add_active_range() is called for every 
range of physical page frames where real memory is, regardless of what 
zone they are in. On x86_64, the ranges are discovered by walking the e820 
map in e820_register_active_ranges(). Once it is known where physical 
memory is, the holes can be figured out. If I have;

Range (nid 0) 0 -> 100
Range (nid 0) 200 -> 400

I know there is a memory hole of 100 pages. The end PFN of each zone is 
passed to free_area_init_nodes(). By walking the early_node_map[], it can 
be discovered what the size of the zone and the holes are.

> I didn't see
> a comment in there describing this design (I do go on).
>

I'll address that issue.

> If so, perhaps the bug is that the x86_64 code isn't doing that.  And that
> x86 isn't doing it for some people either.
>

I'm hoping in this case that having MAX_ACTIVE_REGIONS match E820MAX will 
fix the issue on your machine. I'm still confused why Christian's failed 
to boot with the patch backed out though.

> Anyway.  From the implementation I can see what the code is doing.  But I
> see no description of what it is _supposed_ to be doing.  (The process of
> finding differences between these two things is known as "debugging").  I
> could kludge things by setting MAX_ACTIVE_REGIONS to 1000000, but enough.
> I look forward to the next version ;)
>

I'll start working on it. Thanks a lot.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Mel Gorman @ 2006-05-21 16:20 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Andrew Morton, davej, tony.luck, linux-mm, linux-kernel,
	bob.picco, linuxppc-dev
In-Reply-To: <200605202327.19606.ak@suse.de>

On Sat, 20 May 2006, Andi Kleen wrote:

>
>> Anyway.  From the implementation I can see what the code is doing.  But I
>> see no description of what it is _supposed_ to be doing.  (The process of
>> finding differences between these two things is known as "debugging").  I
>> could kludge things by setting MAX_ACTIVE_REGIONS to 1000000, but enough.
>> I look forward to the next version ;)
>
> Or we could just keep the working old code.
>
> Can somebody remind me what this patch kit was supposed to fix or 
> improve again?
>

The current code for discovering the zone sizes and holes is sometimes 
very hairy despite there being some similaries in each arch. This patch 
kit will eliminiate some of the uglier code and have one place where zones 
and holes can be sized. To me, that is a good idea once the bugs are 
rattled out.

On a related note, parts of the current zone-based anti-fragmentation 
implementation are an architecture-specific mess because changing how 
zones are sized is tricky with the current code. With this patch kit, 
sizing zones for easily reclaimable pages is relatively straight-forward.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply

* HDLC ENET over SCC3
From: Antonio Di Bacco @ 2006-05-21 16:57 UTC (permalink / raw)
  To: linuxppc-embedded

I'm using Denk kernel 2.4.25 and eldk 3.1.1
Is is supporting HDLC over SCC3?

Bye,
Antonio.

^ permalink raw reply

* HDLC synchronous
From: Antonio Di Bacco @ 2006-05-21 17:25 UTC (permalink / raw)
  To: linuxppc-embedded

I had a look to hdlc_enet.c in 8xx_io and it seems to me that it only supports 
asynchronous HDLC (speaks about cts rts). Is this true?

Bye,
Antonio.

^ permalink raw reply

* Re: HDLC synchronous
From: Antonio Di Bacco @ 2006-05-21 18:06 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <200605211925.49946.antonio.dibacco@aruba.it>

I 've understood well,  the hdlc_enet.c driver provided in denk kernel works 
if the hdlc controller can use cts and rts but my board has only INPUT, 
OUTPUT, CLK_INPUT and CLOCK_OUPUT pins. I imagine this is a synchronous 
interface, isn't it?

Bye,
Antonio.

On Sunday 21 May 2006 19:25, Antonio Di Bacco wrote:
> I had a look to hdlc_enet.c in 8xx_io and it seems to me that it only
> supports asynchronous HDLC (speaks about cts rts). Is this true?
>
> Bye,
> Antonio.
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* TI_LOCAL_FLAGS definition wrong?
From: Guennadi Liakhovetski @ 2006-05-21 18:36 UTC (permalink / raw)
  To: Linuxppc-dev

Hi all,

Is this define in arch/ppc/kernel/asm-offsets.c (as of 2.6.17-rc3):

	DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, flags));

correct? Or should it be local_flags? Or is it already fixed in later 
versions?

Thanks
Guennadi
---
Guennadi Liakhovetski

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Andrew Morton @ 2006-05-21 19:08 UTC (permalink / raw)
  To: Mel Gorman
  Cc: davej, tony.luck, linux-mm, ak, bob.picco, linux-kernel,
	linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0605211528390.16327@skynet.skynet.ie>

Mel Gorman <mel@csn.ul.ie> wrote:
>

> > Anyway, I just don't get how this code can work.  We have an e820 map with
> > up to 128 entries (this machine has ten) and we're trying to scrunch that
> > all into the four-entry early_node_map[].
> >
> 
> Missing E820MAX was a mistake. On x86_64, CONFIG_MAX_ACTIVE_REGIONS should 
> have been used. I didn't expect x86_64 to have so many memory holes.

x86 uses 128 e820 slots too.

>
> > On my little x86 PC:
> >
> > BIOS-provided physical RAM map:
> > BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
> > BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
> > BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
> > BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
> > BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
> > BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
> > BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
> > BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
> > BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
> > BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
> > 0MB HIGHMEM available.
> > 255MB LOWMEM available.
> > found SMP MP-table at 000ff780
> > Range (nid 0) 0 -> 65472, max 4
> > On node 0 totalpages: 65472
> >  DMA zone: 4096 pages, LIFO batch:0
> >  Normal zone: 61376 pages, LIFO batch:15
> >
> > So here, the architecture code only called add_active_range() the once, for
> > the entire memory map.
>
> Because in this case, the architecture reported that there was just one 
> range of available pages with no holes.

So..  we're registering a simgle blob of pfns which includes the "reserved"
memory as well as the "ACPI data" and the "ACPI NVS" (with an apparent
off-by-one here).

How come the machine still works?  I guess the architecture went and marked
those pfns reserved.

> > If so, perhaps the bug is that the x86_64 code isn't doing that.  And that
>  > x86 isn't doing it for some people either.
>  >
> 
>  I'm hoping in this case that having MAX_ACTIVE_REGIONS match E820MAX will 
>  fix the issue on your machine.

I expect it will.

One does wonder whether it's worth all this fuss though.  It's only a
24-byte structure and it's all thrown away in free_initmem().  One _could_
just go and do

	#define MAX_ACTIVE_REGIONS 10000

and be happy.

> I'm still confused why Christian's failed 
>  to boot with the patch backed out though.

He didn't get any "Too many memory regions" messages, so it's something
different.

Maybe he hit my off-by-one on his "ACPI data"?

hm, I didn't mention this in the earlier email.   On my x86 I have

  BIOS-provided physical RAM map:
  BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
  BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
  BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
  BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
  BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
  BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
  BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
  BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
  BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)

I added some debug and saw that add_active_range() was getting a
start_pfn=0 and an end_pfn which corresponds with 0x0fffc000.  So my "ACPI
NVS" is getting chopped off.

If Christian is seeing a similar thing then his "ACPI data" will be getting
only part-registered.

I'd suggest that the next rev be liberal in its printking.  This is the
debug patch I used:

 mm/page_alloc.c |   25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff -puN mm/page_alloc.c~a mm/page_alloc.c
--- devel/mm/page_alloc.c~a	2006-05-20 13:19:58.000000000 -0700
+++ devel-akpm/mm/page_alloc.c	2006-05-20 13:20:42.000000000 -0700
@@ -2463,22 +2463,36 @@ void __init add_active_range(unsigned in
 						unsigned long end_pfn)
 {
 	unsigned int i;
-	printk(KERN_DEBUG "Range (%d) %lu -> %lu\n", nid, start_pfn, end_pfn);
+
+	printk("Range (nid %d) %lu -> %lu, max %d\n",
+			nid, start_pfn, end_pfn, MAX_ACTIVE_REGIONS - 1);
 
 	/* Merge with existing active regions if possible */
 	for (i = 0; early_node_map[i].end_pfn; i++) {
-		if (early_node_map[i].nid != nid)
+		printk("i=%d early_node_map[i].nid=%d "
+				"early_node_map[i].start_pfn=%lu "
+				"early_node_map[i].end_pfn=%lu",
+			i, early_node_map[i].nid,
+			early_node_map[i].start_pfn,
+			early_node_map[i].end_pfn);
+
+		if (early_node_map[i].nid != nid) {
+			printk(" continue 1\n");
 			continue;
+		}
 
 		/* Skip if an existing region covers this new one */
 		if (start_pfn >= early_node_map[i].start_pfn &&
-				end_pfn <= early_node_map[i].end_pfn)
+				end_pfn <= early_node_map[i].end_pfn) {
+			printk(" return 1\n");
 			return;
+		}
 
 		/* Merge forward if suitable */
 		if (start_pfn <= early_node_map[i].end_pfn &&
 				end_pfn > early_node_map[i].end_pfn) {
 			early_node_map[i].end_pfn = end_pfn;
+			printk(" return 2\n");
 			return;
 		}
 
@@ -2486,13 +2500,16 @@ void __init add_active_range(unsigned in
 		if (start_pfn < early_node_map[i].end_pfn &&
 				end_pfn >= early_node_map[i].start_pfn) {
 			early_node_map[i].start_pfn = start_pfn;
+			printk(" return 3\n");
 			return;
 		}
+		printk("\n");
 	}
 
 	/* Leave last entry NULL, we use range.end_pfn to terminate the walk */
 	if (i >= MAX_ACTIVE_REGIONS - 1) {
-		printk(KERN_ERR "Too many memory regions, truncating\n");
+		printk(KERN_ERR "More than %d memory regions, truncating\n",
+				MAX_ACTIVE_REGIONS - 1);
 		return;
 	}
 
_

^ permalink raw reply

* Re: HDLC synchronous
From: Wolfgang Denk @ 2006-05-21 19:55 UTC (permalink / raw)
  To: Antonio Di Bacco; +Cc: linuxppc-embedded
In-Reply-To: <200605211925.49946.antonio.dibacco@aruba.it>

In message <200605211925.49946.antonio.dibacco@aruba.it> you wrote:
> I had a look to hdlc_enet.c in 8xx_io and it seems to me that it only supports 
> asynchronous HDLC (speaks about cts rts). Is this true?

Our hdlc_enet.c driver is a custom driver that is designed to work in
a pretty specific environment. You can use it as a model for your own
implementation, but unless you understand exactly what it's doing you
better be careful.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
No, I'm not going to explain it. If you  can't  figure  it  out,  you
didn't want to know anyway... :-)
                   - Larry Wall in <1991Aug7.180856.2854@netlabs.com>

^ permalink raw reply

* Re: [PATCH] powerpc: Fix ide-pmac sysfs entry
From: Gabriel Paubert @ 2006-05-21 21:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Andrew Morton, Pete Popov, B.Zolnierkiewicz, linuxppc-dev, paulus,
	Alan Cox
In-Reply-To: <1147683156.21291.118.camel@localhost.localdomain>

On Mon, May 15, 2006 at 06:52:36PM +1000, Benjamin Herrenschmidt wrote:
> 
> > Actually I have one of these, and regularly use it and update 
> > the kernel to the latest git once or twice per month, but I 
> > typically have two batteries and have not swapped in the 
> > media bay under Linux for a long time.
> > 
> > If you are interested, I could test the patch when I find 
> > some time (not today: my 8 year old son went to the hospital
> > for an emergency last Thursday, he is cured now and should 
> > come out today).
> 
> Any test is welcome, glad to know your son is well !

The one liner works here, I can no more solidly hang
the machine. There is still a bunch of error messages
on drive removal though:

mediabay0: switching to 7
mediabay0: powering down
media bay 0 is empty
Unregistering mb 0 ide, index:2
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: DMA disabled
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
hde: ATAPI reset complete
hde: status error: status=0x00 { }
ide: failed opcode was: unknown
mediabay0: end of power down

On insertion there are also a few messages
but they seem normal:

mediabay0: switching to 3
mediabay0: powering up
mediabay0: enabling (kind:3)
mediabay0: waiting reset (kind:3)
mediabay0: waiting IDE reset (kind:3)
mediabay0: waiting IDE ready (kind:3)
mediabay 0, registering IDE...
Probing IDE interface ide2...
hde: LG DVD-ROM DRN-8080B, ATAPI CD/DVD-ROM drive
hde: Enabling MultiWord DMA 2
ide2 at 0xf1022000-0xf1022007,0xf1022160 on irq 20
hde: ATAPI 24X DVD-ROM drive, 512kB Cache, DMA
media-bay 0 is ide2
mediabay 0 IDE ready

	Regards,
	Gabriel

^ permalink raw reply

* Re: [PATCH] powerpc: Fix ide-pmac sysfs entry
From: Benjamin Herrenschmidt @ 2006-05-21 21:46 UTC (permalink / raw)
  To: Gabriel Paubert
  Cc: Andrew Morton, Pete Popov, B.Zolnierkiewicz, linuxppc-dev, paulus,
	Alan Cox
In-Reply-To: <20060521213056.GA25721@iram.es>

On Sun, 2006-05-21 at 23:30 +0200, Gabriel Paubert wrote:
> On Mon, May 15, 2006 at 06:52:36PM +1000, Benjamin Herrenschmidt wrote:
> > 
> > > Actually I have one of these, and regularly use it and update 
> > > the kernel to the latest git once or twice per month, but I 
> > > typically have two batteries and have not swapped in the 
> > > media bay under Linux for a long time.
> > > 
> > > If you are interested, I could test the patch when I find 
> > > some time (not today: my 8 year old son went to the hospital
> > > for an emergency last Thursday, he is cured now and should 
> > > come out today).
> > 
> > Any test is welcome, glad to know your son is well !
> 
> The one liner works here, I can no more solidly hang
> the machine. There is still a bunch of error messages
> on drive removal though:

Yes, I noticed those. Looks like the IDE driver is trying to much around
with the drive when unregistered. In our case, it's not a very good idea
as we unregister it after we detect it's been physically removed :)
Seems harmless so far though.

Ben.

> mediabay0: switching to 7
> mediabay0: powering down
> media bay 0 is empty
> Unregistering mb 0 ide, index:2
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: DMA disabled
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> hde: ATAPI reset complete
> hde: status error: status=0x00 { }
> ide: failed opcode was: unknown
> mediabay0: end of power down
> 
> On insertion there are also a few messages
> but they seem normal:
> 
> mediabay0: switching to 3
> mediabay0: powering up
> mediabay0: enabling (kind:3)
> mediabay0: waiting reset (kind:3)
> mediabay0: waiting IDE reset (kind:3)
> mediabay0: waiting IDE ready (kind:3)
> mediabay 0, registering IDE...
> Probing IDE interface ide2...
> hde: LG DVD-ROM DRN-8080B, ATAPI CD/DVD-ROM drive
> hde: Enabling MultiWord DMA 2
> ide2 at 0xf1022000-0xf1022007,0xf1022160 on irq 20
> hde: ATAPI 24X DVD-ROM drive, 512kB Cache, DMA
> media-bay 0 is ide2
> mediabay 0 IDE ready
> 
> 	Regards,
> 	Gabriel

^ permalink raw reply

* Re: [PATCH 4/6] Have x86_64 use add_active_range() and free_area_init_nodes
From: Mel Gorman @ 2006-05-21 22:23 UTC (permalink / raw)
  To: Andrew Morton
  Cc: davej, tony.luck, linux-mm, ak, bob.picco, linux-kernel,
	linuxppc-dev
In-Reply-To: <20060521120843.43babdc7.akpm@osdl.org>

On Sun, 21 May 2006, Andrew Morton wrote:

> Mel Gorman <mel@csn.ul.ie> wrote:
>>
>
>>> Anyway, I just don't get how this code can work.  We have an e820 map with
>>> up to 128 entries (this machine has ten) and we're trying to scrunch that
>>> all into the four-entry early_node_map[].
>>>
>>
>> Missing E820MAX was a mistake. On x86_64, CONFIG_MAX_ACTIVE_REGIONS should
>> have been used. I didn't expect x86_64 to have so many memory holes.
>
> x86 uses 128 e820 slots too.
>

That is true, but with x86, I am not expecting many regions. For flatmem, 
only one region will be registered. For NUMA, I would expect one 
registration per node *unless* SRAT is being used. With SRAT, MAXCHUNKS 
regions at most with is 4 * MAX_NUMNODES.

>>
>>> On my little x86 PC:
>>>
>>> BIOS-provided physical RAM map:
>>> BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
>>> BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
>>> BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
>>> BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
>>> BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
>>> BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
>>> BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
>>> BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
>>> BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
>>> BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
>>> 0MB HIGHMEM available.
>>> 255MB LOWMEM available.
>>> found SMP MP-table at 000ff780
>>> Range (nid 0) 0 -> 65472, max 4
>>> On node 0 totalpages: 65472
>>>  DMA zone: 4096 pages, LIFO batch:0
>>>  Normal zone: 61376 pages, LIFO batch:15
>>>
>>> So here, the architecture code only called add_active_range() the once, for
>>> the entire memory map.
>>
>> Because in this case, the architecture reported that there was just one
>> range of available pages with no holes.
>
> So..  we're registering a simgle blob of pfns which includes the "reserved"
> memory as well as the "ACPI data" and the "ACPI NVS" (with an apparent
> off-by-one here).
>

The off-by-one is a surprise. On this machine, it must be because the 
arch-specific code calculated highend_pfn wrong. I don't use the e820 on 
i386 because it didn't seem necessary.

> How come the machine still works?  I guess the architecture went and marked
> those pfns reserved.
>

Yes, that is what I'd expect to happen. The ranges are registered and a 
memmap allocated but the freeing of memory from bootmem is still the same 
on i386. For i386, my patchset reports the same size of zones and 
start_pfn on each node so there should be no difference in the end result 
between my code and the arch-specific initialisation.

>>> If so, perhaps the bug is that the x86_64 code isn't doing that.  And that
>> > x86 isn't doing it for some people either.
>> >
>>
>>  I'm hoping in this case that having MAX_ACTIVE_REGIONS match E820MAX will
>>  fix the issue on your machine.
>
> I expect it will.
>
> One does wonder whether it's worth all this fuss though.  It's only a
> 24-byte structure and it's all thrown away in free_initmem().  One _could_
> just go and do
>
> 	#define MAX_ACTIVE_REGIONS 10000
>
> and be happy.
>

I could, but I thought I'd be shot for trying something like that. A fixed 
value of 128 would cover the largest tables I'm aware of on all 
architectures. Should I just set that fixed value?

>> I'm still confused why Christian's failed
>>  to boot with the patch backed out though.
>
> He didn't get any "Too many memory regions" messages, so it's something
> different.
>
> Maybe he hit my off-by-one on his "ACPI data"?
>

Possibly but the off-by-one error for you was on x86 not x86_64 and I 
suspect that highend_pfn was wrong in this case. I'll be checking tomorrow 
where I can see an off-by-one error.

> hm, I didn't mention this in the earlier email.   On my x86 I have
>
>  BIOS-provided physical RAM map:
>  BIOS-e820: 0000000000000000 - 000000000009bc00 (usable)
>  BIOS-e820: 000000000009bc00 - 000000000009c000 (reserved)
>  BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
>  BIOS-e820: 0000000000100000 - 000000000ffc0000 (usable)
>  BIOS-e820: 000000000ffc0000 - 000000000fff8000 (ACPI data)
>  BIOS-e820: 000000000fff8000 - 0000000010000000 (ACPI NVS)
>  BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
>  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
>  BIOS-e820: 00000000ffb80000 - 00000000ffc00000 (reserved)
>  BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
>
> I added some debug and saw that add_active_range() was getting a
> start_pfn=0 and an end_pfn which corresponds with 0x0fffc000.  So my "ACPI
> NVS" is getting chopped off.
>

Yes. However, this just means that the memory for that the PFN range will 
not be backed by memmap. This would only be a problem if free_bootmem() is 
called on those range of pages. If that was happening, I would be 
expecting oops early or bad_page reports during the boot process.

> If Christian is seeing a similar thing then his "ACPI data" will be getting
> only part-registered.
>
> I'd suggest that the next rev be liberal in its printking.  This is the
> debug patch I used:
>

I also have an old debug patch that was very printk happy. I will dust it 
off and add it with the additional information from your patch.

> mm/page_alloc.c |   25 +++++++++++++++++++++----
> 1 file changed, 21 insertions(+), 4 deletions(-)
>
> diff -puN mm/page_alloc.c~a mm/page_alloc.c
> --- devel/mm/page_alloc.c~a	2006-05-20 13:19:58.000000000 -0700
> +++ devel-akpm/mm/page_alloc.c	2006-05-20 13:20:42.000000000 -0700
> @@ -2463,22 +2463,36 @@ void __init add_active_range(unsigned in
> 						unsigned long end_pfn)
> {
> 	unsigned int i;
> -	printk(KERN_DEBUG "Range (%d) %lu -> %lu\n", nid, start_pfn, end_pfn);
> +
> +	printk("Range (nid %d) %lu -> %lu, max %d\n",
> +			nid, start_pfn, end_pfn, MAX_ACTIVE_REGIONS - 1);
>
> 	/* Merge with existing active regions if possible */
> 	for (i = 0; early_node_map[i].end_pfn; i++) {
> -		if (early_node_map[i].nid != nid)
> +		printk("i=%d early_node_map[i].nid=%d "
> +				"early_node_map[i].start_pfn=%lu "
> +				"early_node_map[i].end_pfn=%lu",
> +			i, early_node_map[i].nid,
> +			early_node_map[i].start_pfn,
> +			early_node_map[i].end_pfn);
> +
> +		if (early_node_map[i].nid != nid) {
> +			printk(" continue 1\n");
> 			continue;
> +		}
>
> 		/* Skip if an existing region covers this new one */
> 		if (start_pfn >= early_node_map[i].start_pfn &&
> -				end_pfn <= early_node_map[i].end_pfn)
> +				end_pfn <= early_node_map[i].end_pfn) {
> +			printk(" return 1\n");
> 			return;
> +		}
>
> 		/* Merge forward if suitable */
> 		if (start_pfn <= early_node_map[i].end_pfn &&
> 				end_pfn > early_node_map[i].end_pfn) {
> 			early_node_map[i].end_pfn = end_pfn;
> +			printk(" return 2\n");
> 			return;
> 		}
>
> @@ -2486,13 +2500,16 @@ void __init add_active_range(unsigned in
> 		if (start_pfn < early_node_map[i].end_pfn &&
> 				end_pfn >= early_node_map[i].start_pfn) {
> 			early_node_map[i].start_pfn = start_pfn;
> +			printk(" return 3\n");
> 			return;
> 		}
> +		printk("\n");
> 	}
>
> 	/* Leave last entry NULL, we use range.end_pfn to terminate the walk */
> 	if (i >= MAX_ACTIVE_REGIONS - 1) {
> -		printk(KERN_ERR "Too many memory regions, truncating\n");
> +		printk(KERN_ERR "More than %d memory regions, truncating\n",
> +				MAX_ACTIVE_REGIONS - 1);
> 		return;
> 	}
>
> _
>

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply

* Re: [PATCH][resend] udbg_printf() formatting attribute
From: Michael Ellerman @ 2006-05-22  6:33 UTC (permalink / raw)
  To: Jimi Xenidis; +Cc: linuxppc-dev
In-Reply-To: <68EF7C38-A8DB-445A-BC7F-439102E19BB9@watson.ibm.com>

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

On Thu, 2006-05-18 at 12:52 -0400, Jimi Xenidis wrote:
> On May 18, 2006, at 11:56 AM, Michael Ellerman wrote:
> >
> > I'm actually hoping to get rid of udbg_printf(), but if I can't we
> > should stick this in I guess. The real problem IMHO is that debug
> > printks rot because they're rarely compiled, not sure what to do about
> > that.
> 
> Yeah, debug code always has that problem.  But I must say, whenever I  
> work with the x86 guys and I see how long they are _blind_ when they  
> boot it blows my mind.  Lets hope we don't go there.

Yeah nuts. Don't worry, when I say "get rid of udbg_printf()" I mean
"replace with printk".

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

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

^ permalink raw reply

* Re: snd-aoa status update / automatic driver loading
From: Johannes Berg @ 2006-05-22  6:42 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Benjamin Berg, debian-powerpc
In-Reply-To: <1148169389.13249.44.camel@localhost.localdomain>

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

On Sun, 2006-05-21 at 09:56 +1000, Benjamin Herrenschmidt wrote:

> What do you mean by lost interrupts ?

Well, when our interrupt handler isn't run for each expected interrupt.

> DBDMA sends edge interrupts. Thus, if it emits interrupts A, then B and
> C, and for any reason, your kenrel is not able to service interrupts (is
> doing something with IRQs disabled) from before B happens to after C
> happens, you'll indeed get called only twice (A and C) and "B" will be
> sort-of lost.

Right. But I have a hard time believing that we had such a high latency,
I expect an interrupt about every 10ms under normal alsa programming.

> First thing about that is: what the heck is causing us to have such a
> latency !!! that would be useful to figure out. A way to do that would
> be maybe to "detect" when C happens that we missed B (see below how to
> do that) and print something along with the regs->nip & lr (or even a
> backtrace). That might give us an idea of there interrupts are
> re-enabled after the long latency which could perhaps lead us to the
> cause of the latency.

Yeah ok, we might be able to figure out what's causing this, but on an
otherwise idle system I assumed actual hardware problems, but it also
never happened on my machine, only on my brother's (same as your pbook).

> Now for detecting lost interrupts (and for being immune to them), the
> technique is not to just assume IRQ -> 1 period completed, but instead,
> when an irq happens, to go read the DBDMA descriptors in memory to see
> which ones have actually been completed. Their status field should be
> updated as their get comleted. Thus, you keep track of the "previous"
> last completed descriptor and you walk from that to recycle them.

Right, that's how snd-powermac does it. It has the nasty side-effect of
polluting the cache a lot though, since dbdma commands are 16 bytes
long. Am I wrong?

> Since we can only update the framecounter on a per-period basis, 

Alsa calls this thing the 'pointer' :) The frame counter we currently
use is the frame counter register of the i2s bus controller, and I don't
see why we shouldn't do that instead of reading back all the dbdma
command status fields.

> the
> driver would benefit from having lots of very small periods. I don't
> know if we can provide "hints" to userland about that though. 

Yes, we can set the minimum period count or maximum period length. Not a
hint though, it then makes it required.

> Using the
> i2s frame counter means we need some kind of calibration... it might
> still be counting if for the reason the DBDMA "misses" something or gets
> stopped....

Since the i2s bus is not shut down it also counts when we are not
transferring data. We currently calibrate on the first interrupt. That's
fine, since having multiple periods means that we don't need to be
absolutely precise here. If we miss one, that's fine, we can make it up
the next time by saying that 2 have elapsed.

johannes

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

^ permalink raw reply

* Re: [PATCH 1/5] powerpc: Make early xmon logic immune to location of early parsing
From: Michael Ellerman @ 2006-05-22  7:03 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20060518010826.GO22868@smtp.west.cox.net>

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

On Wed, 2006-05-17 at 18:08 -0700, Tom Rini wrote:
> On Thu, May 18, 2006 at 10:03:05AM +1000, Michael Ellerman wrote:
> > On Wed, 2006-05-17 at 14:29 -0700, Tom Rini wrote:
> > > On Wed, May 17, 2006 at 06:00:41PM +1000, Michael Ellerman wrote:
> > > 
> > > > Currently early_xmon() calls directly into debugger() if xmon=early is passed.
> > > > This ties the invocation of early xmon to the location of parse_early_param(),
> > > > which might change.
> > > > 
> > > > Tested on P5 LPAR and F50.
> > > > 
> > > > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> > > 
> > > Please no, parse_early_param() is there so things like xmon or kgdb can
> > > be dropped into as soon as we're able to parse any params that might be
> > > usable early on.
> > 
> > Sure, did you read the rest of the series? I want to parse parameters
> > eariler, so early that xmon isn't ready to run when we parse them, so I
> > have to defer jumping into xmon until after xmon is initialised. The net
> > effect on when xmon runs is zero. Or did I miss your point?
> 
> My point would be that xmon should either be fixed to work that early or
> parse things a bit later as a regular param.  I know the current system
> is flawed but I really don't like the idea (especially as a comaintainer
> of kgdb) of having to do a special plug here or there for one param
> because we parse early stuff too early, but regular stuff not early
> enough (which is why Andrew Morton got me to poke at the early param
> stuff a while back and then I think Rusty did something better, or
> something along those lines, anyhow).

Ok. I don't know the history so I can't comment on that. I don't think
we can make xmon run that early, the early parsing in my patch is before
we know what machine type we're on.

But as far as xmon and kgdb is concerned it really shouldn't matter that
the parsing is happening earlier. Instead of calling directly into
xmon/kgdb from the parsing code you set a global which is tested later.
If we ever get around to consolidating the 32/64 bit early setup code we
might even be able to move all the xmon logic into xmon_init(), which
would be even cleaner.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

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

^ permalink raw reply

* Re: I2C bus issues on MPC8248
From: Laurent Pinchart @ 2006-05-22  9:06 UTC (permalink / raw)
  To: hs; +Cc: linuxppc-embedded
In-Reply-To: <1148056646.5943.20.camel@Zeus.EmbLux>

Hi Heiko,

> > I'm trying to use the MPC8248 hardware I2C bus in a 2.6.16 kernel. The
> > mailing
> > list archives mention a driver for the MPC8260
> > (http://ozlabs.org/pipermail/linuxppc-embedded/2006-May/022837.html)
> > which I modified to reflect the memory map differences between the
> > MPC8260 and the MPC8248, as mentionned in the e-mail.
> >
> > The good news is that the driver works. The bad news is that it doesn't
> > work
>
> OK.
>
> > correctly.
> >
> :-(
> :
> > The Linux I2C layer probes the I2C bus for peripherals when drivers are
> > loaded. The probing function writes a single byte with the device address
> > and check if the data is acked. I monitored the SCL and SDA lines using
> > an
>
> [...]
>
> > Using that code, no data is sent on the bus, the BD_SC_READY bit is never
> > cleared and no interrupt is generated. Once again I suspected a CPM bug
> > when writing a single byte on the bus, so I increased cbd_datlen to 2:
> >
> > tbdf[0].cbd_bufaddr = __pa(tb);
> > tbdf[0].cbd_datlen = 2;
> > tbdf[0].cbd_sc = count ? BD_SC_READY | BD_IIC_START :
> >                  BD_SC_READY | BD_IIC_START | BD_SC_INTRPT |
> >                  BD_SC_LAST | BD_SC_WRAP;
> >
> > This worked, and two bytes were written on the bus, leading me to believe
> > that the CPM was at fault.
>
> I don t know, if this is a CPM Bug, but it seems so to me ...

I've contacted Freescale's technical support about that issue. They answered 
that 0-byte buffer descriptors are not legal (even though no documentation 
states so), and that the address byte is output on the I2C bus when the next 
byte is written to the internal TX FIFO, making it impossible to send a 
single byte on the bus. Basically, that's a "feature", and they don't intend 
to fix it.

> > Has anyone noticed the same behaviour ? Is there a workaround available ?
> > I tried searching Freescale's website for CPM microcode updates but
> > haven't found anything related to the I2C controller.
>
> Yes, Holger Speck had the same problem. He solved it by doing the
> following:
>
> If the cpm_iic_write is called with count = 0. He made a read with count =
> 1
>
> I think this is safer than writing 2 Bytes to the Slave.
> Could you try this?

I've tried that with success. The I2C bus still gets stuck from time to time, 
I'll try to investigate that.

Thanks for your help.

Best regards,

Laurent Pinchart

^ permalink raw reply

* Preferred way to configure MTD physical mapping and partitioning
From: Laurent Pinchart @ 2006-05-22 10:32 UTC (permalink / raw)
  To: linuxppc-embedded

Hi everybody,

while browsing the kernel sources to find out how other boards configure MTD 
physical mapping and partitioning, I noticed that a couple of different 
approaches were possible:

- adding a board specific "driver" in drivers/mtd/maps and handle all mapping 
manually
- adding board specific MTD configuration in arch/ppc/platforms with calls to 
physmap_set_partitions() and physmap_configure()
- adding board specific MTD configuration in arch/ppc/platforms with a call to 
physmap_set_partitions(), and using the CONFIG_MTD_PHYSMAP option with 
physical mapping values provided in the kernel configuration.

Could anyone comment on the preferred approach ?

Best regards,

Laurent Pinchart

^ permalink raw reply

* CRAMFS: Error -3 while decompressing!
From: Igor Luri @ 2006-05-22  9:40 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all!

We have a mpc5200liteB evaluation board with u-boot 1.1.4 and linux 
2.4.25 from Denx.  We have grabed a cramfs  root fs on a mtd partition 
and we are able to boot linux without problems:

    setenv bootargs root=/dev/mtdblock4 rw rootfstype=cramfs
    console=ttyS0 console=ttyS0 init=/sbin/init ip=on
    ....
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    VFS: Mounted root (cramfs
    filesystem).                                                                         

    Freeing unused kernel memory: 96k
    init                                                                         
                                                                                                                                                                                                                                         

    BusyBox v1.00 (2006.03.06-10:43+0000) Built-in shell
    (ash)                                                     
    Enter 'help' for a list of built-in commands.           
    #


However, we are not able to boot linux with the same rootfs image (with 
the u-boot header) loaded from RAM.

        setenv bootargs root=/dev/rw rw console=ttyS0 console=ttyS0
        init=/sbin/init ip=on

        ## Booting image at 00500000 ...
           Image Name:   Linux-2.4.25-rthal5-TRACE
           Created:      2006-05-11   9:37:52 UTC
           Image Type:   PowerPC Linux Kernel Image (gzip compressed)
           Data Size:    1000166 Bytes = 976.7 kB
           Load Address: 00000000
           Entry Point:  00000000
           Verifying Checksum ... OK
           Uncompressing Kernel Image ... OK
        ## Loading RAMDisk Image at 01000000 ...
           Image Name:   Ramdisk Image
           Created:      2006-05-22   8:12:03 UTC
           Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
           Data Size:    1191936 Bytes =  1.1 MB
           Load Address: 00000000
           Entry Point:  00000000
           Verifying Checksum ... OK
           Loading Ramdisk to 0fe22000, end 0ff45000 ... OK
        Memory BAT mapping: BAT2=256Mb, BAT3=0Mb, residual: 0Mb
        Linux version 2.4.25-rthal5-TRACE (igor@ILURI_LINUX) (gcc
        version 3.3.6) #300 jue may 11 11:33:57 CEST 2006
        On node 0 totalpages: 65536
        zone(0): 65536 pages.
        zone(1): 0 pages.

        ....
        NET4: Unix domain sockets 1.0/SMP for Linux
        NET4.0.                                                             
        RAMDISK: cramfs filesystem found at block
        0                                                                   
         
        RAMDISK: Loading 1164 blocks [1 disk] into ram disk...
        done.                                                    
        Freeing initrd memory: 1164k
        freed                                                                            
         
        VFS: Mounted root (cramfs filesystem)
        readonly.                                                               
         
        Freeing unused kernel memory: 96k
        init                                                                        
         
        Error -3 while
        decompressing!                                                                                 
         
        c0224e84(1616147664)->c0214000(4096)                                                                          
         
        Error -3 while
        decompressing!                                                                                 
         
        c02286d8(-965246762)->cff41000(4096)                                                                          
         
        Kernel panic: No init found.  Try passing init= option to
        kernel.                                               
         <0>Rebooting in 180 seconds..                         

We have configured linux with option " Board uses U-Boot CONFIG_UBOOT " 
and CRAMFS image is built with correct endianess:

    file initrd.cramfs

    Linux Compressed ROM File System data, big endian size 1191936
    version #2 sorted_dirs CRC 0xac3c8f59, edition 0, 719 blocks, 433 files


We suspect it could be related with the SDRAM, but we are lost here.

Someone knows what we are doing wrong? Any help would be appretiated.


Thanks in advance.

^ 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