linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* (no subject)
@ 2007-04-12 15:44 Milton Miller
  2007-04-13  2:23 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Milton Miller @ 2007-04-12 15:44 UTC (permalink / raw)
  To: Matt Sealey; +Cc: ppcdev, Olaf Hering, Alan Cox

Matt sealey wrote:

+               if (cb & 0x5) { /* if controller is configured for 
pci-native mode for both channels */

The above expression allows 1, 4, or 5 for the masked bits.  I'm 
guessing you
wanted to test that equal to either 5 or 0.

milton

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

* Re:
  2007-04-12 15:44 Milton Miller
@ 2007-04-13  2:23 ` Benjamin Herrenschmidt
  2007-04-13 18:45   ` Re: Segher Boessenkool
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-13  2:23 UTC (permalink / raw)
  To: Milton Miller; +Cc: Olaf Hering, Alan Cox, ppcdev

On Thu, 2007-04-12 at 10:44 -0500, Milton Miller wrote:
> Matt sealey wrote:
> 
> +               if (cb & 0x5) { /* if controller is configured for 
> pci-native mode for both channels */
> 
> The above expression allows 1, 4, or 5 for the masked bits.  I'm 
> guessing you
> wanted to test that equal to either 5 or 0.

I think the proper test is ((cb & 5) == 5) but I can't remember for
sure.. 

Ben.

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

* Re: Re:
  2007-04-13  2:23 ` Benjamin Herrenschmidt
@ 2007-04-13 18:45   ` Segher Boessenkool
  2007-04-13 18:59     ` Re: Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Segher Boessenkool @ 2007-04-13 18:45 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: ppcdev, Olaf Hering, Alan Cox, Milton Miller

>> +               if (cb & 0x5) { /* if controller is configured for
>> pci-native mode for both channels */
>>
>> The above expression allows 1, 4, or 5 for the masked bits.  I'm
>> guessing you
>> wanted to test that equal to either 5 or 0.
>
> I think the proper test is ((cb & 5) == 5) but I can't remember for
> sure..

That is correct if you know for sure the controller
actually supports native mode, and doesn't have that
support turned off by some configuration setting;
otherwise, the test should be ((cb & 0xf) == 0xf).


Segher

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

* Re:
  2007-04-13 18:45   ` Re: Segher Boessenkool
@ 2007-04-13 18:59     ` Sergei Shtylyov
  2007-04-13 19:10       ` Re: Segher Boessenkool
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2007-04-13 18:59 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Olaf Hering, Milton Miller, Alan Cox, ppcdev

Hello.

Segher Boessenkool wrote:
>>>+               if (cb & 0x5) { /* if controller is configured for
>>>pci-native mode for both channels */

>>>The above expression allows 1, 4, or 5 for the masked bits.  I'm
>>>guessing you
>>>wanted to test that equal to either 5 or 0.

>>I think the proper test is ((cb & 5) == 5) but I can't remember for
>>sure..
 
> That is correct if you know for sure the controller
> actually supports native mode, and doesn't have that
> support turned off by some configuration setting;
> otherwise, the test should be ((cb & 0xf) == 0xf).

   "I protest your honor". :-)
   Bits 1 and 3 only indicate that bits 0 and 2 are writeable.
 
MBR, Sergei

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

* Re: Re:
  2007-04-13 18:59     ` Re: Sergei Shtylyov
@ 2007-04-13 19:10       ` Segher Boessenkool
  0 siblings, 0 replies; 5+ messages in thread
From: Segher Boessenkool @ 2007-04-13 19:10 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: ppcdev, Olaf Hering, Alan Cox, Milton Miller

>>> I think the proper test is ((cb & 5) == 5) but I can't remember for
>>> sure..
>> That is correct if you know for sure the controller
>> actually supports native mode, and doesn't have that
>> support turned off by some configuration setting;
>> otherwise, the test should be ((cb & 0xf) == 0xf).
>
>   "I protest your honor". :-)
>   Bits 1 and 3 only indicate that bits 0 and 2 are writeable.

Darn you're right.  Sorry for the confusion.


Segher

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

end of thread, other threads:[~2007-04-13 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-12 15:44 Milton Miller
2007-04-13  2:23 ` Benjamin Herrenschmidt
2007-04-13 18:45   ` Re: Segher Boessenkool
2007-04-13 18:59     ` Re: Sergei Shtylyov
2007-04-13 19:10       ` Re: Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).