netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IOC3] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC.
@ 2006-06-17 17:57 Ralf Baechle
  2006-06-20  8:15 ` Ingo Oeser
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2006-06-17 17:57 UTC (permalink / raw)
  To: netdev, Jeff Garzik

IOC3's homegrown DMA mapping functions that are used to optimize things
a little on IP27 set the wrong bit.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index ae71ed5..e76e6e7 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -145,7 +145,7 @@ static inline struct sk_buff * ioc3_allo
 static inline unsigned long ioc3_map(void *ptr, unsigned long vdev)
 {
 #ifdef CONFIG_SGI_IP27
-	vdev <<= 58;   /* Shift to PCI64_ATTR_VIRTUAL */
+	vdev <<= 57;   /* Shift to PCI64_ATTR_VIRTUAL */
 
 	return vdev | (0xaUL << PCI64_ATTR_TARG_SHFT) | PCI64_ATTR_PREF |
 	       ((unsigned long)ptr & TO_PHYS_MASK);

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

* Re: [IOC3] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC.
  2006-06-17 17:57 [IOC3] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC Ralf Baechle
@ 2006-06-20  8:15 ` Ingo Oeser
  2006-06-20 10:02   ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Oeser @ 2006-06-20  8:15 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: netdev, Jeff Garzik

Hi Ralf,

Ralf Baechle :
> IOC3's homegrown DMA mapping functions that are used to optimize things
> a little on IP27 set the wrong bit.

What about using a symbol instead of magic numbers?
That way one at least sees the intention of the coder.
 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 
> diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
> index ae71ed5..e76e6e7 100644
> --- a/drivers/net/ioc3-eth.c
> +++ b/drivers/net/ioc3-eth.c
> @@ -145,7 +145,7 @@ static inline struct sk_buff * ioc3_allo
>  static inline unsigned long ioc3_map(void *ptr, unsigned long vdev)
>  {
>  #ifdef CONFIG_SGI_IP27
> -	vdev <<= 58;   /* Shift to PCI64_ATTR_VIRTUAL */
> +	vdev <<= 57;   /* Shift to PCI64_ATTR_VIRTUAL */

So please use a symbolic value here.
  

Regards

Ingo Oeser

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

* Re: [IOC3] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC.
  2006-06-20  8:15 ` Ingo Oeser
@ 2006-06-20 10:02   ` Ralf Baechle
  0 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2006-06-20 10:02 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: netdev, Jeff Garzik

On Tue, Jun 20, 2006 at 10:15:01AM +0200, Ingo Oeser wrote:
> From:	Ingo Oeser <netdev@axxeo.de>
> To:	Ralf Baechle <ralf@linux-mips.org>
> Subject: Re: [IOC3] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC.
> Date:	Tue, 20 Jun 2006 10:15:01 +0200
> Cc:	netdev@vger.kernel.org, Jeff Garzik <jeff@garzik.org>
> Content-Type: text/plain;
>   charset="iso-8859-1"
> 
> Hi Ralf,
> 
> Ralf Baechle :
> > IOC3's homegrown DMA mapping functions that are used to optimize things
> > a little on IP27 set the wrong bit.
> 
> What about using a symbol instead of magic numbers?
> That way one at least sees the intention of the coder.
>  
> > Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> > 
> > diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
> > index ae71ed5..e76e6e7 100644
> > --- a/drivers/net/ioc3-eth.c
> > +++ b/drivers/net/ioc3-eth.c
> > @@ -145,7 +145,7 @@ static inline struct sk_buff * ioc3_allo
> >  static inline unsigned long ioc3_map(void *ptr, unsigned long vdev)
> >  {
> >  #ifdef CONFIG_SGI_IP27
> > -	vdev <<= 58;   /* Shift to PCI64_ATTR_VIRTUAL */
> > +	vdev <<= 57;   /* Shift to PCI64_ATTR_VIRTUAL */
> 
> So please use a symbolic value here.

It is a hack and meant to look like one, loudly marked with #ifdef.

  Ralf

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

end of thread, other threads:[~2006-06-20 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-17 17:57 [IOC3] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC Ralf Baechle
2006-06-20  8:15 ` Ingo Oeser
2006-06-20 10:02   ` Ralf Baechle

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).