Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
Thomas Bogendoerfer wrote: - Use inline functions for dma_sync_* instead of macros - added Kconfig change to make selection for similair SGI boxes easier Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> --- drivers/net/Kconfig |2 +- drivers/net/sgiseeq.c | 64 ++--- 2 files changed, 35 insertions(+), 31 deletions(-) applied -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
On Wed, Dec 19, 2007 at 01:42:36PM +0100, Thomas Bogendoerfer wrote: > - Use inline functions for dma_sync_* instead of macros > - added Kconfig change to make selection for similair SGI boxes easier > > Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> Acked-by: Ralf Baechle <[EMAIL PROTECTED]> Ralf -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
- Use inline functions for dma_sync_* instead of macros - added Kconfig change to make selection for similair SGI boxes easier Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> --- drivers/net/Kconfig |2 +- drivers/net/sgiseeq.c | 64 ++--- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 84df799..f816798 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -1807,7 +1807,7 @@ config DE620 config SGISEEQ tristate "SGI Seeq ethernet controller support" - depends on SGI_IP22 + depends on SGI_HAS_SEEQ help Say Y here if you have an Seeq based Ethernet network card. This is used in many Silicon Graphics machines. diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index 3145ca1..c69bb8b 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c @@ -56,14 +56,6 @@ static char *sgiseeqstr = "SGI Seeq8003"; (dma_addr_t)((unsigned long)(v) -\ (unsigned long)((sp)->rx_desc))) -#define DMA_SYNC_DESC_CPU(dev, addr) \ - do { dma_cache_sync((dev)->dev.parent, (void *)addr, \ -sizeof(struct sgiseeq_rx_desc), DMA_FROM_DEVICE); } while (0) - -#define DMA_SYNC_DESC_DEV(dev, addr) \ - do { dma_cache_sync((dev)->dev.parent, (void *)addr, \ -sizeof(struct sgiseeq_rx_desc), DMA_TO_DEVICE); } while (0) - /* Copy frames shorter than rx_copybreak, otherwise pass on up in * a full sized sk_buff. Value of 100 stolen from tulip.c (!alpha). */ @@ -116,6 +108,18 @@ struct sgiseeq_private { spinlock_t tx_lock; }; +static inline void dma_sync_desc_cpu(struct net_device *dev, void *addr) +{ + dma_cache_sync(dev->dev.parent, addr, sizeof(struct sgiseeq_rx_desc), + DMA_FROM_DEVICE); +} + +static inline void dma_sync_desc_dev(struct net_device *dev, void *addr) +{ + dma_cache_sync(dev->dev.parent, addr, sizeof(struct sgiseeq_rx_desc), + DMA_TO_DEVICE); +} + static inline void hpc3_eth_reset(struct hpc3_ethregs *hregs) { hregs->reset = HPC3_ERST_CRESET | HPC3_ERST_CLRIRQ; @@ -184,7 +188,7 @@ static int seeq_init_ring(struct net_device *dev) /* Setup tx ring. */ for(i = 0; i < SEEQ_TX_BUFFERS; i++) { sp->tx_desc[i].tdma.cntinfo = TCNTINFO_INIT; - DMA_SYNC_DESC_DEV(dev, &sp->tx_desc[i]); + dma_sync_desc_dev(dev, &sp->tx_desc[i]); } /* And now the rx ring. */ @@ -203,10 +207,10 @@ static int seeq_init_ring(struct net_device *dev) sp->rx_desc[i].rdma.pbuf = dma_addr; } sp->rx_desc[i].rdma.cntinfo = RCNTINFO_INIT; - DMA_SYNC_DESC_DEV(dev, &sp->rx_desc[i]); + dma_sync_desc_dev(dev, &sp->rx_desc[i]); } sp->rx_desc[i - 1].rdma.cntinfo |= HPCDMA_EOR; - DMA_SYNC_DESC_DEV(dev, &sp->rx_desc[i - 1]); + dma_sync_desc_dev(dev, &sp->rx_desc[i - 1]); return 0; } @@ -341,7 +345,7 @@ static inline void sgiseeq_rx(struct net_device *dev, struct sgiseeq_private *sp /* Service every received packet. */ rd = &sp->rx_desc[sp->rx_new]; - DMA_SYNC_DESC_CPU(dev, rd); + dma_sync_desc_cpu(dev, rd); while (!(rd->rdma.cntinfo & HPCDMA_OWN)) { len = PKT_BUF_SZ - (rd->rdma.cntinfo & HPCDMA_BCNT) - 3; dma_unmap_single(dev->dev.parent, rd->rdma.pbuf, @@ -397,16 +401,16 @@ memory_squeeze: /* Return the entry to the ring pool. */ rd->rdma.cntinfo = RCNTINFO_INIT; sp->rx_new = NEXT_RX(sp->rx_new); - DMA_SYNC_DESC_DEV(dev, rd); + dma_sync_desc_dev(dev, rd); rd = &sp->rx_desc[sp->rx_new]; - DMA_SYNC_DESC_CPU(dev, rd); + dma_sync_desc_cpu(dev, rd); } - DMA_SYNC_DESC_CPU(dev, &sp->rx_desc[orig_end]); + dma_sync_desc_cpu(dev, &sp->rx_desc[orig_end]); sp->rx_desc[orig_end].rdma.cntinfo &= ~(HPCDMA_EOR); - DMA_SYNC_DESC_DEV(dev, &sp->rx_desc[orig_end]); - DMA_SYNC_DESC_CPU(dev, &sp->rx_desc[PREV_RX(sp->rx_new)]); + dma_sync_desc_dev(dev, &sp->rx_desc[orig_end]); + dma_sync_desc_cpu(dev, &sp->rx_desc[PREV_RX(sp->rx_new)]); sp->rx_desc[PREV_RX(sp->rx_new)].rdma.cntinfo |= HPCDMA_EOR; - DMA_SYNC_DESC_DEV(dev, &sp->rx_desc[PREV_RX(sp->rx_new)]); + dma_sync_desc_dev(dev, &sp->rx_desc[PREV_RX(sp->rx_new)]); rx_maybe_restart(sp, hregs, sregs); } @@ -433,12 +437,12 @@ static inline void kick_tx(struct net_device *dev, * is not active! */ td = &sp->tx_desc[i]; - DMA_SYNC_DESC_CPU(dev, td); + dma_sync_desc_cpu(dev, td); while ((td->tdma.cntinfo & (HPCDMA_XIU | HPCDMA_ETXD)) ==
Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
Thomas Bogendoerfer wrote: On Mon, Dec 17, 2007 at 08:18:38PM -0500, Jeff Garzik wrote: Changes to last version: - Use inline functions for dma_sync_* instead of macros (suggested by Ralf) - added Kconfig change to make selection for similair SGI boxes easier hrm, could you rediff? it doesn't seem to apply sure, against which tree ? I tried netdev-2.6 and it applies without fuzz... It needs to be the 'upstream' branch of netdev-2.6. The default netdev-2.6.git branch, master, is a 100% vanilla duplicate of Linus's git repository. (this permits a common practice of presenting logs and diffs using git's branch..branch notation) Jeff -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
On Mon, Dec 17, 2007 at 08:18:38PM -0500, Jeff Garzik wrote: > >Changes to last version: > >- Use inline functions for dma_sync_* instead of macros (suggested by Ralf) > >- added Kconfig change to make selection for similair SGI boxes easier > > hrm, could you rediff? it doesn't seem to apply sure, against which tree ? I tried netdev-2.6 and it applies without fuzz... Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea.[ RFC1925, 2.3 ] -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
Thomas Bogendoerfer wrote: SGI IP28 machines would need special treatment (enable adding addtional wait states) when accessing memory uncached. To avoid this pain I changed the driver to use only cached access to memory. Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> --- Changes to last version: - Use inline functions for dma_sync_* instead of macros (suggested by Ralf) - added Kconfig change to make selection for similair SGI boxes easier hrm, could you rediff? it doesn't seem to apply -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
On Tue, Dec 04, 2007 at 03:14:46PM -0500, Jeff Garzik wrote: >> Changes to last version: >> - Use inline functions for dma_sync_* instead of macros (suggested by Ralf) >> - added Kconfig change to make selection for similair SGI boxes easier > > Has Ralf ACK'd this updated version? Acked-by: Ralf Baechle <[EMAIL PROTECTED]> > This is for 2.6.25 (i.e. not a bug fix for 2.6.24-rc) I presume? Yes. IP28 support it scheduled to be merged for 2.6.25. Ralf -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [UPDATED PATCH] SGISEEQ: use cached memory access to make driver work on IP28
Thomas Bogendoerfer wrote: SGI IP28 machines would need special treatment (enable adding addtional wait states) when accessing memory uncached. To avoid this pain I changed the driver to use only cached access to memory. Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]> --- Changes to last version: - Use inline functions for dma_sync_* instead of macros (suggested by Ralf) - added Kconfig change to make selection for similair SGI boxes easier Has Ralf ACK'd this updated version? This is for 2.6.25 (i.e. not a bug fix for 2.6.24-rc) I presume? -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html