netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fwd: [PATCH 001/002] de2104x: force correct order when writing to rx ring
       [not found] <46e1c7760902071330u10427d33p3f49e82a2e4b1ddc@mail.gmail.com>
@ 2009-02-09  7:27 ` Risto Suominen
  0 siblings, 0 replies; only message in thread
From: Risto Suominen @ 2009-02-09  7:27 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]

---------- Forwarded message ----------
From: Risto Suominen <risto.suominen@gmail.com>
Date: 2009/2/7
Subject: [PATCH 001/002] de2104x: force correct order when writing to rx ring
To: Jeff Garzik <jgarzik@pobox.com>, lkml <linux-kernel@vger.kernel.org>


DescOwn should not be set, thus allowing the chip to use the descriptor, before
everything else is set up correctly.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18.

--- drivers/net/tulip/de2104x.c.org     2006-09-20 06:42:06.000000000 +0300
+++ drivers/net/tulip/de2104x.c 2009-02-07 15:04:04.000000000 +0200
@@ -465,13 +465,14 @@ static void de_rx (struct de_private *de
                       drop = 1;

 rx_next:
-               de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
               if (rx_tail == (DE_RX_RING_SIZE - 1))
                       de->rx_ring[rx_tail].opts2 =
                               cpu_to_le32(RingEnd | de->rx_buf_sz);
               else
                       de->rx_ring[rx_tail].opts2 = cpu_to_le32(de->rx_buf_sz);
               de->rx_ring[rx_tail].addr1 = cpu_to_le32(mapping);
+               wmb();
+               de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
               rx_tail = NEXT_RX(rx_tail);
       }

[-- Attachment #2: de2104x-rx.patch --]
[-- Type: text/x-diff, Size: 850 bytes --]

DescOwn should not be set, thus allowing the chip to use the descriptor, before
everything else is set up correctly.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18.

--- drivers/net/tulip/de2104x.c.org	2006-09-20 06:42:06.000000000 +0300
+++ drivers/net/tulip/de2104x.c	2009-02-07 15:04:04.000000000 +0200
@@ -465,13 +465,14 @@ static void de_rx (struct de_private *de
 			drop = 1;
 
 rx_next:
-		de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
 		if (rx_tail == (DE_RX_RING_SIZE - 1))
 			de->rx_ring[rx_tail].opts2 =
 				cpu_to_le32(RingEnd | de->rx_buf_sz);
 		else
 			de->rx_ring[rx_tail].opts2 = cpu_to_le32(de->rx_buf_sz);
 		de->rx_ring[rx_tail].addr1 = cpu_to_le32(mapping);
+		wmb();
+		de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
 		rx_tail = NEXT_RX(rx_tail);
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-09  7:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <46e1c7760902071330u10427d33p3f49e82a2e4b1ddc@mail.gmail.com>
2009-02-09  7:27 ` Fwd: [PATCH 001/002] de2104x: force correct order when writing to rx ring Risto Suominen

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