Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-20 Thread Segher Boessenkool
Sure, PCI busses are little-endian. But is readX()/writeX() for PCI only? Yes. For other buses, use foo_writel(), etc. Can this please be documented then? Never heard this before... You have come late to the party. WHat do you mean here? Could you please explain? This has been the

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-20 Thread Jeff Garzik
Segher Boessenkool wrote: Sure, PCI busses are little-endian. But is readX()/writeX() for PCI only? Yes. For other buses, use foo_writel(), etc. Can this please be documented then? Never heard this before... You have come late to the party. WHat do you mean here? Could you please

Re: Fw: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Linas Vepstas
On Tue, Sep 19, 2006 at 02:54:33PM +1000, Stephen Rothwell wrote: On powerpc and ppc, insl_ns and insl are identical as are outsl_ns and outsl, so remove the conditional use of insl_ns and outsl_ns. The rest of this patch might indeed be correct, but the above comment bothers me. The ns

Re: Fw: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Linas Vepstas
On Tue, Sep 19, 2006 at 08:52:18PM +0200, Matt Sealey wrote: [...] Linas Vepstas wrote: On Tue, Sep 19, 2006 at 02:54:33PM +1000, Stephen Rothwell wrote: On powerpc and ppc, insl_ns and insl are identical as are outsl_ns and outsl, so remove the conditional use of insl_ns and outsl_ns.

Re: Fw: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Benjamin Herrenschmidt
However, I presume someone added the __powerpc__ define here because they picked up a 3c509 at a garage sale, stuck it in a powerpc, found out it didn't work due to a byte-swapping bug, and then patched it as above. I'm disturbed that somehow outsl_ns() became identical to outsl() at some

Re: Fw: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Benjamin Herrenschmidt
On Tue, 2006-09-19 at 20:52 +0200, Matt Sealey wrote: Some northbridges and PCI bridges have clever byteswapping in hardware, maybe this is just an effect of that. In theory depending on the host bridge, you should pass in big endian data and have it swap or not swap, not pick that way in

Re: Fw: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Paul Mackerras
Linas Vepstas writes: The rest of this patch might indeed be correct, but the above comment bothers me. The ns versions of routines are supposed to be non-byte-swapped versions of the insl/outsl routines (which would byte-swap on big-endian archs such as powerpc.) If it were true that

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Segher Boessenkool
Nah. We have the basic rule that readl/writel are little endian. PowerPC additionally provides arch specific low level in_{be,le}32 type accessors with explicit endianness. Or you can also use cpu_to_le32/le32_to_cpu kind of macros to convert between native and explicit endianness. Sure, PCI

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Benjamin Herrenschmidt
On Wed, 2006-09-20 at 02:21 +0200, Segher Boessenkool wrote: Nah. We have the basic rule that readl/writel are little endian. PowerPC additionally provides arch specific low level in_{be,le}32 type accessors with explicit endianness. Or you can also use cpu_to_le32/le32_to_cpu kind of

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Jeff Garzik
Segher Boessenkool wrote: Sure, PCI busses are little-endian. But is readX()/writeX() for PCI only? Yes. For other buses, use foo_writel(), etc. Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Segher Boessenkool
Sure, PCI busses are little-endian. But is readX()/writeX() for PCI only? I sure hope not. It's defined for PCI and possibly ISA memory. You can use it for other things if you whish to, but other things are arch specific in any case. Huh? You're saying that only PCI and ISA are

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Segher Boessenkool
Sure, PCI busses are little-endian. But is readX()/writeX() for PCI only? Yes. For other buses, use foo_writel(), etc. Can this please be documented then? Never heard this before... Segher - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Linas Vepstas
Hi, I am alarmed and embarassed that sloppy comments on my part has turned onto a long conversation. On Wed, Sep 20, 2006 at 02:58:39AM +0200, Segher Boessenkool wrote: Sure, PCI busses are little-endian. But is readX()/writeX() for PCI only? I sure hope not. It's defined for PCI and

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Jeff Garzik
Segher Boessenkool wrote: Sure, PCI busses are little-endian. But is readX()/writeX() for PCI only? Yes. For other buses, use foo_writel(), etc. Can this please be documented then? Never heard this before... You have come late to the party. This has been the case for many, many years.

Re: [PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-19 Thread Segher Boessenkool
Well, I'm having trouble thinking of other busses that have as strong a sense of the address-data style I/O as PCI. Busses like scsi and ide are primarily command-data or data-data in style. Only the address-data style busses need readl/writel-style routines. SBUS, JBUS, VMEbus, NuBus,

[PATCH] Remove powerpc specific parts of 3c509 driver

2006-09-18 Thread Stephen Rothwell
On powerpc and ppc, insl_ns and insl are identical as are outsl_ns and outsl, so remove the conditional use of insl_ns and outsl_ns. Signed-off-by: Stephen Rothwell [EMAIL PROTECTED] --- drivers/net/3c509.c |9 - 1 files changed, 0 insertions(+), 9 deletions(-) This is in