All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SPARC/LEON: FPU-FSR only available when FPU present
@ 2011-01-26 16:37 Daniel Hellstrom
  2011-01-26 20:36 ` Sam Ravnborg
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Daniel Hellstrom @ 2011-01-26 16:37 UTC (permalink / raw)
  To: sparclinux

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
---
 arch/sparc/kernel/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index 0dc714f..7925c54 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -324,7 +324,7 @@ void __cpuinit cpu_probe(void)
 	psr = get_psr();
 	put_psr(psr | PSR_EF);
 #ifdef CONFIG_SPARC_LEON
-	fpu_vers = 7;
+	fpu_vers = get_psr() & PSR_EF ? ((get_fsr() >> 17) & 0x7) : 7;
 #else
 	fpu_vers = ((get_fsr() >> 17) & 0x7);
 #endif
-- 
1.5.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] SPARC/LEON: FPU-FSR only available when FPU present
  2011-01-26 16:37 [PATCH] SPARC/LEON: FPU-FSR only available when FPU present Daniel Hellstrom
@ 2011-01-26 20:36 ` Sam Ravnborg
  2011-01-26 21:08 ` daniel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2011-01-26 20:36 UTC (permalink / raw)
  To: sparclinux

On Wed, Jan 26, 2011 at 05:37:05PM +0100, Daniel Hellstrom wrote:
> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
> ---
>  arch/sparc/kernel/cpu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
> index 0dc714f..7925c54 100644
> --- a/arch/sparc/kernel/cpu.c
> +++ b/arch/sparc/kernel/cpu.c
> @@ -324,7 +324,7 @@ void __cpuinit cpu_probe(void)
>  	psr = get_psr();
>  	put_psr(psr | PSR_EF);
>  #ifdef CONFIG_SPARC_LEON
> -	fpu_vers = 7;
> +	fpu_vers = get_psr() & PSR_EF ? ((get_fsr() >> 17) & 0x7) : 7;
>  #else
>  	fpu_vers = ((get_fsr() >> 17) & 0x7);
>  #endif

This file is full of numbers.
But for new stuff it would be great with symbolic constants.

I also do wonder if your new version could be
used for non-leon?
PSR_EF say if the FPU is enabled or not.
If it is disabled can we then trust the FSR.ver field?

	Sam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] SPARC/LEON: FPU-FSR only available when FPU present
  2011-01-26 16:37 [PATCH] SPARC/LEON: FPU-FSR only available when FPU present Daniel Hellstrom
  2011-01-26 20:36 ` Sam Ravnborg
@ 2011-01-26 21:08 ` daniel
  2011-01-27 11:06 ` Daniel Hellstrom
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: daniel @ 2011-01-26 21:08 UTC (permalink / raw)
  To: sparclinux



On Wed, 26 Jan 2011 21:36:58  0100, Sam Ravnborg  wrote:
On Wed, Jan 26, 2011 at 05:37:05PM  0100, Daniel Hellstrom wrote:
  > > Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
  > > ---
  > >  arch/sparc/kernel/cpu.c |    2  -
  > >  1 files changed, 1 insertions( ), 1 deletions(-)
  > >
  > > diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
  > > index 0dc714f..7925c54 100644
  > > --- a/arch/sparc/kernel/cpu.c
  > >     b/arch/sparc/kernel/cpu.c
  > > @@ -324,7  324,7 @@ void __cpuinit cpu_probe(void)
  > >   psr = get_psr();
  > >   put_psr(psr | PSR_EF);
  > >  #ifdef CONFIG_SPARC_LEON
  > > - fpu_vers = 7;
  > >   fpu_vers = get_psr() & PSR_EF ? ((get_fsr() >> 17) & 0x7) : 7;
  > >  #else
  > >   fpu_vers = ((get_fsr() >> 17) & 0x7);
  > >  #endif
  >
  > This file is full of numbers. 
  > But for new stuff it would be great with symbolic constants. 
  >
  > I also do wonder if your new version could be
  > used for non-leon?
  > PSR_EF say if the FPU is enabled or not. 
  > If it is disabled can we then trust the FSR.ver field?
  >
   
   
  That got me thinking before as well. I spoke yearlier on the subject 
with Jiri Gaisler, who is the most knowlegable I met on sparcs, and he 
said that it might be needed by old sparc machines and that newer onse 
all have FPU anyway. Of course I agree with you, reading the manual led 
me to the same conclusion. It is a bit of a contradiction in the manual 
since it states that FSR.ver should return 0x7 (all pull-up high...) 
when no FPU is present. 
   
  To conclude I think we should not change this behaviour. Please 
accept this simple patch that make /proc/cpuinfo work again on LEON... 
:)
   
  Thanks,
   
  Daniel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] SPARC/LEON: FPU-FSR only available when FPU present
  2011-01-26 16:37 [PATCH] SPARC/LEON: FPU-FSR only available when FPU present Daniel Hellstrom
  2011-01-26 20:36 ` Sam Ravnborg
  2011-01-26 21:08 ` daniel
@ 2011-01-27 11:06 ` Daniel Hellstrom
  2011-01-27 17:29 ` Sam Ravnborg
  2011-01-28 23:07 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Hellstrom @ 2011-01-27 11:06 UTC (permalink / raw)
  To: sparclinux

Sam Ravnborg wrote:

>On Wed, Jan 26, 2011 at 05:37:05PM +0100, Daniel Hellstrom wrote:
>  
>
>>Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>>---
>> arch/sparc/kernel/cpu.c |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>>diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
>>index 0dc714f..7925c54 100644
>>--- a/arch/sparc/kernel/cpu.c
>>+++ b/arch/sparc/kernel/cpu.c
>>@@ -324,7 +324,7 @@ void __cpuinit cpu_probe(void)
>> 	psr = get_psr();
>> 	put_psr(psr | PSR_EF);
>> #ifdef CONFIG_SPARC_LEON
>>-	fpu_vers = 7;
>>+	fpu_vers = get_psr() & PSR_EF ? ((get_fsr() >> 17) & 0x7) : 7;
>> #else
>> 	fpu_vers = ((get_fsr() >> 17) & 0x7);
>> #endif
>>    
>>
>
>This file is full of numbers.
>But for new stuff it would be great with symbolic constants.
>  
>
Please ack this patch, and see the follow up patch doing some cleaning 
of PSR/FSR code.

>I also do wonder if your new version could be
>used for non-leon?
>PSR_EF say if the FPU is enabled or not.
>If it is disabled can we then trust the FSR.ver field?
>  
>
see discussion in other email.

Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] SPARC/LEON: FPU-FSR only available when FPU present
  2011-01-26 16:37 [PATCH] SPARC/LEON: FPU-FSR only available when FPU present Daniel Hellstrom
                   ` (2 preceding siblings ...)
  2011-01-27 11:06 ` Daniel Hellstrom
@ 2011-01-27 17:29 ` Sam Ravnborg
  2011-01-28 23:07 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2011-01-27 17:29 UTC (permalink / raw)
  To: sparclinux

On Thu, Jan 27, 2011 at 12:06:27PM +0100, Daniel Hellstrom wrote:
> Sam Ravnborg wrote:
>
>> On Wed, Jan 26, 2011 at 05:37:05PM +0100, Daniel Hellstrom wrote:
>>  
>>
>>> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>>> ---
>>> arch/sparc/kernel/cpu.c |    2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
>>> index 0dc714f..7925c54 100644
>>> --- a/arch/sparc/kernel/cpu.c
>>> +++ b/arch/sparc/kernel/cpu.c
>>> @@ -324,7 +324,7 @@ void __cpuinit cpu_probe(void)
>>> 	psr = get_psr();
>>> 	put_psr(psr | PSR_EF);
>>> #ifdef CONFIG_SPARC_LEON
>>> -	fpu_vers = 7;
>>> +	fpu_vers = get_psr() & PSR_EF ? ((get_fsr() >> 17) & 0x7) : 7;
>>> #else
>>> 	fpu_vers = ((get_fsr() >> 17) & 0x7);
>>> #endif
>>>    
>>>
>>
>> This file is full of numbers.
>> But for new stuff it would be great with symbolic constants.
>>  
>>
> Please ack this patch, and see the follow up patch doing some cleaning  
> of PSR/FSR code.
I have no problem with the patch per see. I was just
looking for a possibility to get rid of an ifdef.

Acked-by: Sam Ravnborg <sam@ravnborg.org>

Btw. my ack is not a precondition for David to merge your
patches - but it may help a little :-)

	Sam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] SPARC/LEON: FPU-FSR only available when FPU present
  2011-01-26 16:37 [PATCH] SPARC/LEON: FPU-FSR only available when FPU present Daniel Hellstrom
                   ` (3 preceding siblings ...)
  2011-01-27 17:29 ` Sam Ravnborg
@ 2011-01-28 23:07 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2011-01-28 23:07 UTC (permalink / raw)
  To: sparclinux

From: Sam Ravnborg <sam@ravnborg.org>
Date: Thu, 27 Jan 2011 18:29:16 +0100

> On Thu, Jan 27, 2011 at 12:06:27PM +0100, Daniel Hellstrom wrote:
>> Sam Ravnborg wrote:
>>
>>> On Wed, Jan 26, 2011 at 05:37:05PM +0100, Daniel Hellstrom wrote:
>>>  
>>>
>>>> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
...
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 
> Btw. my ack is not a precondition for David to merge your
> patches - but it may help a little :-)

:-)  Applied to sparc-next-2.6, thanks guys.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-28 23:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26 16:37 [PATCH] SPARC/LEON: FPU-FSR only available when FPU present Daniel Hellstrom
2011-01-26 20:36 ` Sam Ravnborg
2011-01-26 21:08 ` daniel
2011-01-27 11:06 ` Daniel Hellstrom
2011-01-27 17:29 ` Sam Ravnborg
2011-01-28 23:07 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.