LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: PATCH: Add memreserve to DTC
From: Jon Loeliger @ 2005-07-11 21:22 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20050711045532.GC32545@localhost.localdomain>

On Sun, 2005-07-10 at 23:55, David Gibson wrote:
> On Fri, Jul 08, 2005 at 04:44:58PM -0500, Jon Loeliger wrote:
> > David and Ben,
> > 
> > This patch adds support for memreserve to the DTC's notion
> > of the "source file".  That is, you can now say this:
> >         
> >         
> >         memreserve =	<
> >         		 0000 0001  0000 0002
> >         		 0000 0003  0000 0004
> >         		>

> 
> Hrm.. nice idea, but I don't really like the syntax.  It looks like a
> property definition, which it's really not,

Well, syntax is relatively easy to change.  I picked one 
that was already present in the grammar and lex code.
I wanted to use something more braces oriented, but it
got gross looking once I decided to use the "struct data"
parts for the cell_t values.

>  and forcing the user to
> split up these 64-bit quantities into cells is kind of silly.

Hey, I didn't set that up! :-)  There wasn't an existing
clean way to state 64 bit values, and an arbitrary list of
them.  So I uh, leveraged the existing cell_t support!

>   Plus
> the fact that "memreserve" is lexed as a reserved word means it can't
> be used as a property name.

Yeah, I wasn't happy about that either.  Wasn't sure
what you wanted to do to "fix" that.  Thought it better
to get the code into your hands than try to discuss the
issues via mail.

>   And it really ought to have a ';' at the
> end, for consistency.

Sure.  Easy.

And, I actually anticipated making the "header" parts
of the grammar be more general, of which then the memory
reserve area would be just one part.  For example, suppose
you wanted to specify the "version" too:

    /header/ = {
        version  = 10;
        memreserve = < .... ....  .... .... >;
    };

Or so.


> Hrm... wonder how to do this, without making the lex and yacc stuff
> too unspeakable.
> 
> Maybe
> 
> /memreserve/ = {  00000001-00000002;
> 		  00000003-00000004;
> 	       };
> 
> I'm not that fond of the /.../ form, although the '/' is the best way
> I can think of to ensure it can't be confused with a property or node
> name.  We'lll also need some sort of lexing magic so that it actually
> recognizes the things within as numbers, not property names, too.
> Hrm... will need to think about that.

Which was sort of the problem I faced... :-)

> > There is minor fiddling with the -R flag that needs to be
> > resolved at this point.
> 
> I think -R should add the given number of extra empty entries, on top
> of the ones given in the source.

Except now you have to carry the count along in the header.
How else do you know if the _first_ or _last_ 0-size value
really ends the list?  Well, you could maybe assume ordered
parts an subtract the base offset of the memreserve section
from the following section to get its total size.  Gross, though.


> > Please feel free to adjust my coding approach or argument
> > passing or whatever as needed.  Hope this helps!
> 
> Yeah, there are some things I'd like to change (in addition to the
> input syntax itself), but I'm thinking about just applying it and
> fixing up afterwards.

That sounds good.

> Biggest thing is that rather than passing the tree itself and the
> memreserve info about as two parameters all over the place, I'd rather
> create a new structure which has both (and later can have anything
> else that might be needed).

If you'd like, I'll do this work.

jdl

^ permalink raw reply

* Re: PATCH: Add memreserve to DTC
From: David Gibson @ 2005-07-12  2:01 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <1121116950.15394.14.camel@cashmere.sps.mot.com>

On Mon, Jul 11, 2005 at 04:22:30PM -0500, Jon Loeliger wrote:
> On Sun, 2005-07-10 at 23:55, David Gibson wrote:
> > On Fri, Jul 08, 2005 at 04:44:58PM -0500, Jon Loeliger wrote:
> > > David and Ben,
> > > 
> > > This patch adds support for memreserve to the DTC's notion
> > > of the "source file".  That is, you can now say this:
> > >         
> > >         
> > >         memreserve =	<
> > >         		 0000 0001  0000 0002
> > >         		 0000 0003  0000 0004
> > >         		>
> 
> > 
> > Hrm.. nice idea, but I don't really like the syntax.  It looks like a
> > property definition, which it's really not,
> 
> Well, syntax is relatively easy to change.  I picked one 
> that was already present in the grammar and lex code.
> I wanted to use something more braces oriented, but it
> got gross looking once I decided to use the "struct data"
> parts for the cell_t values.
> 
> >  and forcing the user to
> > split up these 64-bit quantities into cells is kind of silly.
> 
> Hey, I didn't set that up! :-)  There wasn't an existing
> clean way to state 64 bit values, and an arbitrary list of
> them.  So I uh, leveraged the existing cell_t support!

Cells make sense for the actual OF-like data, becayse they're an OF
concept.  For memreserve, which is purely Linux specific, they don't/

> >   Plus
> > the fact that "memreserve" is lexed as a reserved word means it can't
> > be used as a property name.
> 
> Yeah, I wasn't happy about that either.  Wasn't sure
> what you wanted to do to "fix" that.  Thought it better
> to get the code into your hands than try to discuss the
> issues via mail.

Yeah... I have some ideas, maybe replacing some of the start
conditions with a lexical tie-in from the parser level.  I'll see what
I can come up with.

> >   And it really ought to have a ';' at the
> > end, for consistency.
> 
> Sure.  Easy.
> 
> And, I actually anticipated making the "header" parts
> of the grammar be more general, of which then the memory
> reserve area would be just one part.  For example, suppose
> you wanted to specify the "version" too:
> 
>     /header/ = {
>         version  = 10;
>         memreserve = < .... ....  .... .... >;
>     };

Perhaps, I don't think there's anything else that we really want to
set for now.  I don't think version should be set in the source file.

> Or so.

Actually, I'm having second thoughts on the form I suggested before.
I'm now leaning towards:

	/memreserve/ 00000001-00000002;
	/memreserve/ 00000003-00000004;

	/ {
		...
	};

> > Hrm... wonder how to do this, without making the lex and yacc stuff
> > too unspeakable.
> > 
> > Maybe
> > 
> > /memreserve/ = {  00000001-00000002;
> > 		  00000003-00000004;
> > 	       };
> > 
> > I'm not that fond of the /.../ form, although the '/' is the best way
> > I can think of to ensure it can't be confused with a property or node
> > name.  We'lll also need some sort of lexing magic so that it actually
> > recognizes the things within as numbers, not property names, too.
> > Hrm... will need to think about that.
> 
> Which was sort of the problem I faced... :-)
> 
> > > There is minor fiddling with the -R flag that needs to be
> > > resolved at this point.
> > 
> > I think -R should add the given number of extra empty entries, on top
> > of the ones given in the source.
> 
> Except now you have to carry the count along in the header.
> How else do you know if the _first_ or _last_ 0-size value
> really ends the list?  Well, you could maybe assume ordered
> parts an subtract the base offset of the memreserve section
> from the following section to get its total size.  Gross, though.
> 
> 
> > > Please feel free to adjust my coding approach or argument
> > > passing or whatever as needed.  Hope this helps!
> > 
> > Yeah, there are some things I'd like to change (in addition to the
> > input syntax itself), but I'm thinking about just applying it and
> > fixing up afterwards.
> 
> That sounds good.
> 
> > Biggest thing is that rather than passing the tree itself and the
> > memreserve info about as two parameters all over the place, I'd rather
> > create a new structure which has both (and later can have anything
> > else that might be needed).
> 
> If you'd like, I'll do this work.
> 
> jdl
> 
> 

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

^ permalink raw reply

* Re: OLS 2005
From: Grant Likely @ 2005-07-12  4:04 UTC (permalink / raw)
  To: Kumar Gala, greg; +Cc: David Ho, linuxppc-embedded
In-Reply-To: <18C1CAA6-F980-4F8C-8FDD-E5D676D084ED@freescale.com>

On 7/6/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> On Jul 6, 2005, at 12:49 PM, Grant Likely wrote:
> > On 4/27/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> >
> >> I wondering if we can get a PPC BoF together, ...
The schedule is now posted on the OLS website.  Thursday and Friday
evenings are set for scheduled BOFs.  Why don't we tentatively plan an
unoffical PPCembedded BOF Thursday evening?

We should try to meet each other during the day Wednesday and choose a
good time.

> > I'd like to discuss the platform bus a bit.  As was discussed a month
> > or so ago, there is no clean way of matching multiple device drivers
> > to a single device type, like with PSCs on the MPC5200.
> >
> We should try to see if we can find GregKH to discuss what changes
> would need to be made to the driver core to allow this.
>=20
How 'bout it Greg?  Can we get some of your time?

Cheers,
g.

^ permalink raw reply

* Re: PATCH: Add memreserve to DTC
From: David Gibson @ 2005-07-12  4:06 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <1121116950.15394.14.camel@cashmere.sps.mot.com>

On Mon, Jul 11, 2005 at 04:22:30PM -0500, Jon Loeliger wrote:
> On Sun, 2005-07-10 at 23:55, David Gibson wrote:
> > On Fri, Jul 08, 2005 at 04:44:58PM -0500, Jon Loeliger wrote:
[snip]
> > Biggest thing is that rather than passing the tree itself and the
> > memreserve info about as two parameters all over the place, I'd rather
> > create a new structure which has both (and later can have anything
> > else that might be needed).
> 
> If you'd like, I'll do this work.

That would be helpful.  You'll need to rediff, though, I merged a
couple of bugfixes from your patch that weren't directly related to
the memreserve stuff.

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

^ permalink raw reply

* Re: OLS 2005
From: Greg KH @ 2005-07-12  4:23 UTC (permalink / raw)
  To: Grant Likely; +Cc: David Ho, linuxppc-embedded
In-Reply-To: <528646bc050711210430374802@mail.gmail.com>

On Mon, Jul 11, 2005 at 10:04:30PM -0600, Grant Likely wrote:
> On 7/6/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> > On Jul 6, 2005, at 12:49 PM, Grant Likely wrote:
> > > On 4/27/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> > >
> > >> I wondering if we can get a PPC BoF together, ...
> The schedule is now posted on the OLS website.  Thursday and Friday
> evenings are set for scheduled BOFs.  Why don't we tentatively plan an
> unoffical PPCembedded BOF Thursday evening?
> 
> We should try to meet each other during the day Wednesday and choose a
> good time.
> 
> > > I'd like to discuss the platform bus a bit.  As was discussed a month
> > > or so ago, there is no clean way of matching multiple device drivers
> > > to a single device type, like with PSCs on the MPC5200.
> > >
> > We should try to see if we can find GregKH to discuss what changes
> > would need to be made to the driver core to allow this.
> > 
> How 'bout it Greg?  Can we get some of your time?

Sure, grab me, but I'll have just taught 6 hours of tutorials and will
probably want a beer or three :)

thanks,

greg k-h

^ permalink raw reply

* Re: OLS 2005
From: Grant Likely @ 2005-07-12  4:34 UTC (permalink / raw)
  To: Greg KH; +Cc: David Ho, linuxppc-embedded
In-Reply-To: <20050712042343.GA2363@kroah.com>

On 7/11/05, Greg KH <greg@kroah.com> wrote:
> On Mon, Jul 11, 2005 at 10:04:30PM -0600, Grant Likely wrote:
> > On 7/6/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> > > On Jul 6, 2005, at 12:49 PM, Grant Likely wrote:
> > > > On 4/27/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> > > >
> > > >> I wondering if we can get a PPC BoF together, ...
> > The schedule is now posted on the OLS website.  Thursday and Friday
> > evenings are set for scheduled BOFs.  Why don't we tentatively plan an
> > unoffical PPCembedded BOF Thursday evening?
> >
> > We should try to meet each other during the day Wednesday and choose a
> > good time.
> >
> > > > I'd like to discuss the platform bus a bit.  As was discussed a mon=
th
> > > > or so ago, there is no clean way of matching multiple device driver=
s
> > > > to a single device type, like with PSCs on the MPC5200.
> > > >
> > > We should try to see if we can find GregKH to discuss what changes
> > > would need to be made to the driver core to allow this.
> > >
> > How 'bout it Greg?  Can we get some of your time?
>=20
> Sure, grab me, but I'll have just taught 6 hours of tutorials and will
> probably want a beer or three :)

Maybe I'll just need to buy you one of those beers to keep you cooperative.

g.
>=20
> thanks,
>=20
> greg k-h
>=20


--=20
"Why do musicians compose symphonies and poets write poems? They do it
because life wouldn't have any meaning for them if they didn't.
That's why I draw cartoons. It's my life."

-- Charles Shultz

^ permalink raw reply

* MPC5200-B Deep Sleep
From: Susheel Raj @ 2005-07-12  6:45 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

  My name is Susheel, very new to this list. I am here
expecting some help from the members :-).

  I am using the MPC5200-B (version 2) processor on
the board and I would like to make it go into "Deep
Sleep Mode"(Lets say DSM). I have been reading the
User Manual for the core and it has some support for
this DSM. If there is so can you guide me how to use
it, if not can anyone give me suggestions how to start
it, I am not an expert in such stuff, i felt life
would be more easier if   i can use the suggestions of
some experienced guy :-)


Advance thanks and waiting for the response ..


		
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.  
http://auctions.yahoo.com/

^ permalink raw reply

* Re: PATCH: Add memreserve to DTC
From: Segher Boessenkool @ 2005-07-12  8:02 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20050712020126.GE3945@localhost.localdomain>

>>>  and forcing the user to
>>> split up these 64-bit quantities into cells is kind of silly.
>>
>> Hey, I didn't set that up! :-)  There wasn't an existing
>> clean way to state 64 bit values, and an arbitrary list of
>> them.  So I uh, leveraged the existing cell_t support!
>
> Cells make sense for the actual OF-like data, becayse they're an OF
> concept.  For memreserve, which is purely Linux specific, they don't/

No.  This is _not_ what is called a cell.  "Cell" is a Forth concept.
A cell can be any size.  Open Firmware puts the extra restriction on it
to be _at least_ 32 bits.

The thing you are referring to is what is called in OF

	"32-bit integer property encoding format".

It is defined to always be 32-bit, and not the cell size of the 
firmware,
so that you can use a 64-bit firmware with a 32-bit OS, and vice versa
(of course there could be different reasons why this isn't practical, 
but
that's not the point).

In OF words, this format is normally abbreviated as "int".

Btw -- beware of the fact that such an "int" does _not_ have any
alignment restrictions -- so you better read it byte by byte...


Segher

^ permalink raw reply

* help me for: Oops: kernel access of bad area, sig: 11 on rattler 8248 (ppc)
From: FLAMENT David @ 2005-07-12  8:07 UTC (permalink / raw)
  To: linuxppc-dev

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

Dear,

    Here is my problems,

    OS: kernel 2.4.26
    platform: ppc rattler 8248


When we activate MPC82xxPCI in general setup of kernel config the following massages is printed :

Rattler Board Support by Arabella
Memory BAT mapping: BAT2=32Mb, BAT3=0Mb, residual: 0Mb
Linux version 2.4.26 (root@linux1.besoft.sofrel.com) (version gcc 3.2.2 20030217 (Yellow Dog Linux 3.0 3.5Rattler setup arch
rattler_setup_arch: bcsr=effff000
MPC82xx PCI bridge initialization
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: nfsroot=/tftpboot/ppc_root rw ip=192.168.1.23:192.168.1.21::::eth0:off
Rattler init IRQ. NR_IRQS=256
PIC: fully preemptible IRQ mode
Rattler time init
Rattler calibrate decrementer. FREQ=100000000, tb_ticks_per_jiffy=250000
Calibrating delay loop... 266.24 BogoMIPS
Memory: 30256k available (1488k kernel code, 520k data, 76k init, 0k highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
Oops: kernel access of bad area, sig: 11
NIP: C01D3888 XER: 00000000 LR: C01D3880 SP: C02F1F50 REGS: c02f1ea0 TRAP: 0300 Not tainted
MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
DAR: 00000080, DSISR: 22000000
TASK = c02f0000[1] 'swapper' Last syscall: -1
last math 00000000 last altivec 00000000
GPR00: C01D3870 C02F1F50 C02F0000 F0000000 000018C1 C02F1F58 FFFFFFFF 00000000
GPR08: FFFFC4BA 1FFF0000 C01BB85B 00001057 22008022 3FDFF7AF 01FFE000 00000000
GPR16: 00000001 00000001 FFFFFFFF 007FFF00 003FF000 00000000 00000002 01BCA298
GPR24: 00000000 00000000 40000000 007FFF46 00000000 00000000 C01E0000 C01DB88C
Call backtrace:
C01D3870 C01C9474 C01D0CEC C01C66DC C0003970 C00083AC
Kernel panic: Attempted to kill init!
 
 
thanks for your suggest !
 
--------------------------------
Flament David
d.flament@sofrel.com
Lacroix Sofrel, 1 rue plessis, 35770 Vern sur seiche (France)
(+33)2.99.04.84.23
 
 

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

^ permalink raw reply

* last version of linuxppc-dev
From: FLAMENT David @ 2005-07-12  8:12 UTC (permalink / raw)
  To: linuxppc-dev

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

hello,
where it's possible to download the last version of linuxppc-dev to test this ?
thank's
--------------------------------
Flament David
d.flament@sofrel.com
Lacroix Sofrel, 1 rue plessis, 35770 Vern sur seiche (France)
(+33)2.99.04.84.23
 
 

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

^ permalink raw reply

* Re: help me for: Oops: kernel access of bad area, sig: 11 on rattler 8248 (ppc)
From: Eugene Surovegin @ 2005-07-12  9:36 UTC (permalink / raw)
  To: FLAMENT David; +Cc: linuxppc-dev
In-Reply-To: <892C3EC180087B4498C69413FCCBB7320159ADF0@sof_msg>

On Tue, Jul 12, 2005 at 10:07:52AM +0200, FLAMENT David wrote:
> Dear,
> 
>     Here is my problems,
> 
>     OS: kernel 2.4.26
>     platform: ppc rattler 8248


Publicly available Linux PPC trees don't have support for this board. 
Please, direct all your questions to the vendor you got this kernel 
form, e.g. Arabella.

We cannot help you, sorry.

Also, next time, use linuxppc-embedded for questions like this.

-- 
Eugene

^ permalink raw reply

* Re: OLS 2005
From: David Ho @ 2005-07-12 13:14 UTC (permalink / raw)
  To: Grant Likely; +Cc: Greg KH, David Ho, linuxppc-embedded
In-Reply-To: <528646bc050711213439c1174a@mail.gmail.com>

Heads up for ppl coming to Ottawa next week, it is 34 degrees Celsius
all this week, and the weather has been like that for a few weeks.=20
It's gonna be hot and sweaty...

David

On 7/12/05, Grant Likely <glikely@gmail.com> wrote:
> On 7/11/05, Greg KH <greg@kroah.com> wrote:
> > On Mon, Jul 11, 2005 at 10:04:30PM -0600, Grant Likely wrote:
> > > On 7/6/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> > > > On Jul 6, 2005, at 12:49 PM, Grant Likely wrote:
> > > > > On 4/27/05, Kumar Gala <kumar.gala@freescale.com> wrote:
> > > > >
> > > > >> I wondering if we can get a PPC BoF together, ...
> > > The schedule is now posted on the OLS website.  Thursday and Friday
> > > evenings are set for scheduled BOFs.  Why don't we tentatively plan a=
n
> > > unoffical PPCembedded BOF Thursday evening?
> > >
> > > We should try to meet each other during the day Wednesday and choose =
a
> > > good time.
> > >
> > > > > I'd like to discuss the platform bus a bit.  As was discussed a m=
onth
> > > > > or so ago, there is no clean way of matching multiple device driv=
ers
> > > > > to a single device type, like with PSCs on the MPC5200.
> > > > >
> > > > We should try to see if we can find GregKH to discuss what changes
> > > > would need to be made to the driver core to allow this.
> > > >
> > > How 'bout it Greg?  Can we get some of your time?
> >
> > Sure, grab me, but I'll have just taught 6 hours of tutorials and will
> > probably want a beer or three :)
>=20
> Maybe I'll just need to buy you one of those beers to keep you cooperativ=
e.
>=20
> g.
> >
> > thanks,
> >
> > greg k-h
> >
>=20
>=20
> --
> "Why do musicians compose symphonies and poets write poems? They do it
> because life wouldn't have any meaning for them if they didn't.
> That's why I draw cartoons. It's my life."
>=20
> -- Charles Shultz
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

^ permalink raw reply

* MPC5200 Rev. B
From: Matt_Berry @ 2005-07-12 13:25 UTC (permalink / raw)
  To: linuxppc-embedded

When you refer to BAPI, are you referring to the BestComm?


Matthew Berry
MKS Instruments, Inc.
1321 Rutherford Lane, Suite 200
Austin, Texas 78753
Office: (512) 719-8048
Main: (512) 719-8000  x8048
Cell: (512) 203-7186
Fax: (512) 719-8096

^ permalink raw reply

* Re: OLS 2005
From: Michael Richardson @ 2005-07-12 13:46 UTC (permalink / raw)
  To: Greg KH; +Cc: David Ho, linuxppc-embedded
In-Reply-To: <20050712042343.GA2363@kroah.com>


>>>>> "Greg" == Greg KH <greg@kroah.com> writes:
    Greg> Sure, grab me, but I'll have just taught 6 hours of tutorials
    Greg> and will probably want a beer or three :)

  Beer can be provided.

^ permalink raw reply

* [PATCH] ppc32: fix destroy_context() race condition
From: Guillaume Autran @ 2005-07-12 14:23 UTC (permalink / raw)
  To: akpm; +Cc: linuxppc-embedded

Fix for a race condition when a task gets preempted by another task
while executing the destroy_context(...) in a FEW_CONTEXTS environment.
mm->context == NO_CONTEXT but the context_map may indicate all contexts
are in use.
The solution to this problem is to disable kernel preemption while
destroying a MMU context.

Signed-off-by: Guillaume Autran <gautran@mrv.com>

---

diff -Nru a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
--- a/include/asm-ppc/mmu_context.h	2005-06-17 15:48:29.000000000 -0400
+++ b/include/asm-ppc/mmu_context.h	2005-07-05 08:58:46.000000000 -0400
@@ -149,6 +149,7 @@
 */
static inline void destroy_context(struct mm_struct *mm)
{
+	preempt_disable();
	if (mm->context != NO_CONTEXT) {
		clear_bit(mm->context, context_map);
		mm->context = NO_CONTEXT;
@@ -156,6 +157,7 @@
		atomic_inc(&nr_free_contexts);
#endif
	}
+	preempt_enable();
}

static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,

^ permalink raw reply

* problem of load kernel after uncompressiong kernel Image .... (linuxppc 2.4.27)
From: FLAMENT David @ 2005-07-12 14:39 UTC (permalink / raw)
  To: linuxppc-dev

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

Dear,
 
    Here is my problems,

    OS: kernel 2.4.27 linuxppc-embedded
    platform: ppc rattler 8248
 
    When I load a kernel image (uImage) with u-boot, the prompt of kernel is blocking
    
    boot args kernel parameters : 
        "console=ttyS0,38400n8 nfsroot=/tftpboot/ppc_root rw ip=192.168.1.23:192.168.1.21::::eth0:off"
 
the screenshot of loading kernel :
    TFTP from server 192.168.1.21; our IP address is 192.168.1.23
    Filename 'uImage'.
    Load address: 0x100000
    Loading: #################################################################
    #################################################################
    ############################
    done
    Bytes transferred = 803951 (c446f hex)
    ## Booting image at 00100000 ...
    Image Name: Linux-2.4.27-pre1
    Image Type: PowerPC Linux Kernel Image (gzip compressed)
    Data Size: 803887 Bytes = 785 kB
    Load Address: 00000000
    Entry Point: 00000000
    Verifying Checksum ... OK
    Uncompressing Kernel Image ... OK
 
You can see, after uncompressing kernel, there are nothing !!! 
I try to use another kernel 2.4.26 with the same nfsroot and boot parameters and I can ping my target but not with linuxppc 2.4.27.
If you have an idea about this problem !! thank's.
note : I use a rattler 8248 with a 2.4.27 linuxppc kernel
 
Help me please !!!
 
--------------------------------
Flament David
d.flament@sofrel.com
Lacroix Sofrel, 1 rue plessis, 35770 Vern sur seiche (France)
(+33)2.99.04.84.23
 
 

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

^ permalink raw reply

* Re: [PATCH] ppc32: fix destroy_context() race condition
From: Eugene Surovegin @ 2005-07-12 16:39 UTC (permalink / raw)
  To: Guillaume Autran; +Cc: akpm, linuxppc-embedded
In-Reply-To: <42D3D277.106@mrv.com>

On Tue, Jul 12, 2005 at 10:23:51AM -0400, Guillaume Autran wrote:
> Fix for a race condition when a task gets preempted by another task
> while executing the destroy_context(...) in a FEW_CONTEXTS environment.
> mm->context == NO_CONTEXT but the context_map may indicate all contexts
> are in use.
> The solution to this problem is to disable kernel preemption while
> destroying a MMU context.
> 
> Signed-off-by: Guillaume Autran <gautran@mrv.com>
> 
> ---
> 
> diff -Nru a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
> --- a/include/asm-ppc/mmu_context.h	2005-06-17 15:48:29.000000000 -0400
> +++ b/include/asm-ppc/mmu_context.h	2005-07-05 08:58:46.000000000 -0400
> @@ -149,6 +149,7 @@
> */
> static inline void destroy_context(struct mm_struct *mm)
> {
> +	preempt_disable();
> 	if (mm->context != NO_CONTEXT) {
> 		clear_bit(mm->context, context_map);
> 		mm->context = NO_CONTEXT;
> @@ -156,6 +157,7 @@
> 		atomic_inc(&nr_free_contexts);
> #endif
> 	}
> +	preempt_enable();
> }
> 
> static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
> 

Could you explain, why this patch is needed?

AFAIK, destroy_context() is only called from switch_mm(), which in 
turn is called from schedule() with preemption already disabled. If 
not, IMHO we have bigger problems, and "fixing" destroy_context() will 
only hide such problems.

-- 
Eugene

^ permalink raw reply

* Re: [PATCH] ppc32: fix destroy_context() race condition
From: Guillaume Autran @ 2005-07-12 18:29 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: akpm, linuxppc-embedded
In-Reply-To: <20050712163921.GE25918@gate.ebshome.net>

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

Eugene, destroy_context(..) can be called from other place outside of 
the scheduler and switch_mm(...). See mmdrop(...) for example.
In many of those cases, the task will run with preemption enable.

Guillaume.


Eugene Surovegin wrote:

>On Tue, Jul 12, 2005 at 10:23:51AM -0400, Guillaume Autran wrote:
>  
>
>>Fix for a race condition when a task gets preempted by another task
>>while executing the destroy_context(...) in a FEW_CONTEXTS environment.
>>mm->context == NO_CONTEXT but the context_map may indicate all contexts
>>are in use.
>>The solution to this problem is to disable kernel preemption while
>>destroying a MMU context.
>>
>>Signed-off-by: Guillaume Autran <gautran@mrv.com>
>>
>>---
>>
>>diff -Nru a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
>>--- a/include/asm-ppc/mmu_context.h	2005-06-17 15:48:29.000000000 -0400
>>+++ b/include/asm-ppc/mmu_context.h	2005-07-05 08:58:46.000000000 -0400
>>@@ -149,6 +149,7 @@
>>*/
>>static inline void destroy_context(struct mm_struct *mm)
>>{
>>+	preempt_disable();
>>	if (mm->context != NO_CONTEXT) {
>>		clear_bit(mm->context, context_map);
>>		mm->context = NO_CONTEXT;
>>@@ -156,6 +157,7 @@
>>		atomic_inc(&nr_free_contexts);
>>#endif
>>	}
>>+	preempt_enable();
>>}
>>
>>static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
>>
>>    
>>
>
>Could you explain, why this patch is needed?
>
>AFAIK, destroy_context() is only called from switch_mm(), which in 
>turn is called from schedule() with preemption already disabled. If 
>not, IMHO we have bigger problems, and "fixing" destroy_context() will 
>only hide such problems.
>
>  
>

-- 
=======================================
Guillaume Autran
Senior Software Engineer
MRV Communications, Inc.
Tel: (978) 952-4932 office
E-mail: gautran@mrv.com
======================================= 


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

^ permalink raw reply

* Re: [PATCH] ppc32: fix destroy_context() race condition
From: Eugene Surovegin @ 2005-07-12 18:45 UTC (permalink / raw)
  To: Guillaume Autran; +Cc: akpm, linuxppc-embedded
In-Reply-To: <42D40BF0.6040605@mrv.com>

On Tue, Jul 12, 2005 at 02:29:04PM -0400, Guillaume Autran wrote:
> Eugene, destroy_context(..) can be called from other place outside of 
> the scheduler and switch_mm(...). See mmdrop(...) for example.
> In many of those cases, the task will run with preemption enable.

Ahh, OK, you're right. Maybe it's worth mentioning in the patch 
description :).

-- 
Eugene

^ permalink raw reply

* Re: problem of load kernel after uncompressiong kernel Image .... (linuxppc 2.4.27)
From: Wolfgang Denk @ 2005-07-12 20:28 UTC (permalink / raw)
  To: FLAMENT David; +Cc: linuxppc-dev
In-Reply-To: <892C3EC180087B4498C69413FCCBB7320159AE59@sof_msg>

In message <892C3EC180087B4498C69413FCCBB7320159AE59@sof_msg> you wrote:
>
> You can see, after uncompressing kernel, there are nothing !!! 

And did you read the FAQ?

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
Question: How does one get fresh air into a Russian church?
Answer:   One clicks on an icon, and a window opens!

^ permalink raw reply

* Re: MPC5200 Rev. B
From: Wolfgang Denk @ 2005-07-12 20:37 UTC (permalink / raw)
  To: Matt_Berry; +Cc: linuxppc-embedded
In-Reply-To: <OF8B3EB35C.277E5E38-ON8525703C.0049B16F-8625703C.0049BF25@mksinst.com>

In message <OF8B3EB35C.277E5E38-ON8525703C.0049B16F-8625703C.0049BF25@mksinst.com> you wrote:
> When you refer to BAPI, are you referring to the BestComm?

Yes.

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
I am an atheist, thank God!

^ permalink raw reply

* [PATCH] make -j12 all fails in uImage target
From: Olaf Hering @ 2005-07-12 21:29 UTC (permalink / raw)
  To: Tom Rini, linuxppc-dev, Andrew Morton
In-Reply-To: <20050206124014.GA5880@suse.de>

 On Sun, Feb 06, Olaf Hering wrote:

> 
> this is what I got with 2.6.11rc3:
> 
> make ARCH=ppc O=../O-2.6.11-rc3-b50-SMP -j12 all
> ...
>   LD      vmlinux
>   SYSMAP  System.map
>   SYSMAP  .tmp_System.map
>   OBJCOPY arch/ppc/boot/images/vmlinux.bin
>   HOSTCC  arch/ppc/boot/utils/addnote
>   HOSTCC  arch/ppc/boot/utils/mknote
>   HOSTCC  arch/ppc/boot/utils/mkprep
>   LD      arch/ppc/boot/lib/built-in.o
>   HOSTCC  arch/ppc/boot/utils/hack-coff
>   HOSTCC  arch/ppc/boot/utils/mkbugboot
>   OBJCOPY arch/ppc/boot/images/vmlinux.bin
>   GZIP    arch/ppc/boot/images/vmlinux.gz
> /bin/sh: line 1: arch/ppc/boot/images/vmlinux.bin: No such file or directory
> make[2]: *** [arch/ppc/boot/images/vmlinux.gz] Error 1
> make[1]: *** [uImage] Error 2
> make[1]: *** Waiting for unfinished jobs....
> 
> also, one time that zImage.chrp was only 570K instead of the expected
> 1.4M, so netboot failed. But I got no build error.


make -j zImage may call if_changed twice at the same time,
the result is a corrupted vmlinux.gz
write to a temporary file for the time being until someone with
make skills fix the serialization properly.

Signed-off-by: Olaf Hering <olh@suse.de>

 arch/ppc/boot/images/Makefile |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6.13-rc2-olh/arch/ppc/boot/images/Makefile
===================================================================
--- linux-2.6.13-rc2-olh.orig/arch/ppc/boot/images/Makefile
+++ linux-2.6.13-rc2-olh/arch/ppc/boot/images/Makefile
@@ -6,12 +6,17 @@ MKIMAGE		:= $(srctree)/scripts/mkuboot.s
 
 extra-y		:= vmlinux.bin vmlinux.gz
 
+# two make processes may write to vmlinux.gz at the same time with make -j
+quiet_cmd_mygzip = GZIP    $@
+cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
+
+
 OBJCOPYFLAGS_vmlinux.bin := -O binary
 $(obj)/vmlinux.bin: vmlinux FORCE
 	$(call if_changed,objcopy)
 
 $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
-	$(call if_changed,gzip)
+	$(call if_changed,mygzip)
 
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \

^ permalink raw reply

* Re: [PATCH] make -j12 all fails in uImage target
From: Tom Rini @ 2005-07-12 21:36 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Andrew Morton, linuxppc-dev
In-Reply-To: <20050712212928.GA6717@suse.de>

On Tue, Jul 12, 2005 at 11:29:28PM +0200, Olaf Hering wrote:
>  On Sun, Feb 06, Olaf Hering wrote:
> 
> > 
> > this is what I got with 2.6.11rc3:
> > 
> > make ARCH=ppc O=../O-2.6.11-rc3-b50-SMP -j12 all
> > ...
> >   LD      vmlinux
> >   SYSMAP  System.map
> >   SYSMAP  .tmp_System.map
> >   OBJCOPY arch/ppc/boot/images/vmlinux.bin
> >   HOSTCC  arch/ppc/boot/utils/addnote
> >   HOSTCC  arch/ppc/boot/utils/mknote
> >   HOSTCC  arch/ppc/boot/utils/mkprep
> >   LD      arch/ppc/boot/lib/built-in.o
> >   HOSTCC  arch/ppc/boot/utils/hack-coff
> >   HOSTCC  arch/ppc/boot/utils/mkbugboot
> >   OBJCOPY arch/ppc/boot/images/vmlinux.bin
> >   GZIP    arch/ppc/boot/images/vmlinux.gz
> > /bin/sh: line 1: arch/ppc/boot/images/vmlinux.bin: No such file or directory
> > make[2]: *** [arch/ppc/boot/images/vmlinux.gz] Error 1
> > make[1]: *** [uImage] Error 2
> > make[1]: *** Waiting for unfinished jobs....
> > 
> > also, one time that zImage.chrp was only 570K instead of the expected
> > 1.4M, so netboot failed. But I got no build error.
> 
> 
> make -j zImage may call if_changed twice at the same time,
> the result is a corrupted vmlinux.gz
> write to a temporary file for the time being until someone with
> make skills fix the serialization properly.
> 
> Signed-off-by: Olaf Hering <olh@suse.de>

This is at least functional, so
Signed-off-by: Tom Rini <trini@kernel.crashing.org>

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply

* Re: [PATCH] ppc32: fix destroy_context() race condition
From: Benjamin Herrenschmidt @ 2005-07-13  0:09 UTC (permalink / raw)
  To: Guillaume Autran; +Cc: akpm, linuxppc-embedded
In-Reply-To: <42D3D277.106@mrv.com>

On Tue, 2005-07-12 at 10:23 -0400, Guillaume Autran wrote:
> Fix for a race condition when a task gets preempted by another task
> while executing the destroy_context(...) in a FEW_CONTEXTS environment.
> mm->context == NO_CONTEXT but the context_map may indicate all contexts
> are in use.
> The solution to this problem is to disable kernel preemption while
> destroying a MMU context.
> 
> Signed-off-by: Guillaume Autran <gautran@mrv.com>

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

> 
> ---
> 
> diff -Nru a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
> --- a/include/asm-ppc/mmu_context.h	2005-06-17 15:48:29.000000000 -0400
> +++ b/include/asm-ppc/mmu_context.h	2005-07-05 08:58:46.000000000 -0400
> @@ -149,6 +149,7 @@
>  */
> static inline void destroy_context(struct mm_struct *mm)
> {
> +	preempt_disable();
> 	if (mm->context != NO_CONTEXT) {
> 		clear_bit(mm->context, context_map);
> 		mm->context = NO_CONTEXT;
> @@ -156,6 +157,7 @@
> 		atomic_inc(&nr_free_contexts);
> #endif
> 	}
> +	preempt_enable();
> }
> 
> static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
> 
> 
> 
> 
> 

^ permalink raw reply

* help: FCC_ENET OF MPC8250
From: gqbenjamin @ 2005-07-13  2:41 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

I use a device, like SMARTBITS, to test the Ethernet rate of mpc8250. The kernel is linux-2.4.20 with CONFIG_FCC_LXT971 and CONFIG_USE_MDIO, and do 'cat "1">/proc/sys/net/ipv4/ip_forward'.

If the rate of sending IP packet been set too high, for example 100 Mbps Full Duplex and each packet is 1514 Bytes. Later, the kernel print '... Memory squeeze, dropping packet' on uart. Stop sending IP packet and do 'cat /proc/meminfo', the *MemFree* become small.

Try again, the *MemFree* become smaller, just look like some allocated memory (skbuf) do not be free.

Final, the kernel break down, because all memory have been used.

Q. How can I do to let kernel do not break down? Is it a kernel promblem?

PS: 
I use linux-2.6.5 on mpc8250 for the same test, and get the same result.
I change some code in file skbuff.c, use a memory pool that I created instead of allocating *skb* from *MemFree*, and do the same test. Final, the kernel can not transmit any IP packet, beacuse all space in the pool been used, but do not break down. 

Thanks for your reading.

e-mail: gqben@sina.com gqbenjamin@163.com gqbenjamin@21cn.com

----------------------------------------------
vgoÌåÑé×ÀÃæ¿ì¸Ð£¬ÏíÊÜ¿íÆµÀÖȤ£¡ 
http://vgo.21cn.com 
µãÕâÀïÃâ·ÑÌåÑé·¢ËÍ4G´ó¸½¼þ 
http://mail.21cn.com/huodong/0504/mail/ 
²ÊÆÁÊÖ»ú°×ËÍÀ²!¸Ï¿ìÀ´ÄÃ! 
http://qipai.g.21cn.com 
Öǻ۴óÌôÕ½¾ÍÔڵͼ۶ᱦ 
http://super.21cn.com/ 
ÌåÑéÁíÀàÔ¼»á£¬¸ÐÊܱðÑùÀËÂþ 
http://y.21cn.com/club/ 
СÁéͨ¶ÌÐÅÖÐÐÄ£¬¶ÌÐÅ÷ÈÁ¦ÎÞ¼« 
http://pas.21cn.com/ 
È«ÄÜÁÄ2005°æÉÁÁÁµÇ³¡£¡ 
http://callme.21cn.com 

^ 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