Skip to contentSkip to conversation

IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC.

IOC3 Ralf Baechle 2 participants 3 messages Jun 17, 2006 – Jun 20, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

drivers/net/ioc3-eth.c +1 -1
index ae71ed5..e76e6e7 100644
@@ -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);
#1 lore raw

Hi Ralf,

Ralf Baechle :

Quoted 2 lines

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.

drivers/net/ioc3-eth.c static inline struct sk_buff * ioc3_allo · line 148

Quoted 12 lines
drivers/net/ioc3-eth.c +1 -1
index ae71ed5..e76e6e7 100644
@@ -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

#2 lore raw
Quoted 19 lines · Ingo Oeser

From: Ingo Oeser <[email protected]>
To: Ralf Baechle <[email protected]>
Subject: Re: [IOC3] IP27: Really set PCI64_ATTR_VIRTUAL, not PCI64_ATTR_PREC.
Date: Tue, 20 Jun 2006 10:15:01 +0200
Cc: [email protected], Jeff Garzik <[email protected]>
Content-Type: text/plain;
charset="iso-8859-1"

Hi Ralf,

Ralf Baechle :

Quoted 2 lines

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.

Quoted 2 lines
Quoted 12 lines

drivers/net/ioc3-eth.c static inline struct sk_buff * ioc3_allo · line 148

Quoted 10 lines
drivers/net/ioc3-eth.c +1 -1
index ae71ed5..e76e6e7 100644
@@ -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