netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com
Subject: [PATCH net-next-2.6 06/10] sfc: Remove locking from implementation of efx_writeo_paged()
Date: Fri, 10 Dec 2010 17:38:47 +0000	[thread overview]
Message-ID: <1292002727.11673.20.camel@bwh-desktop> (raw)
In-Reply-To: <1292002527.11673.14.camel@bwh-desktop>

It is not necessary to serialise writes to the paged 128-bit
registers.  However, if we don't then we must always write the last
dword separately, not as part of a qword write.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/io.h |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sfc/io.h b/drivers/net/sfc/io.h
index 7f3adf2..6da4ae2 100644
--- a/drivers/net/sfc/io.h
+++ b/drivers/net/sfc/io.h
@@ -229,7 +229,20 @@ static inline void efx_readd_table(struct efx_nic *efx, efx_dword_t *value,
 static inline void _efx_writeo_page(struct efx_nic *efx, efx_oword_t *value,
 				    unsigned int reg, unsigned int page)
 {
-	efx_writeo(efx, value, EFX_PAGED_REG(page, reg));
+	reg = EFX_PAGED_REG(page, reg);
+
+	netif_vdbg(efx, hw, efx->net_dev,
+		   "writing register %x with " EFX_OWORD_FMT "\n", reg,
+		   EFX_OWORD_VAL(*value));
+
+#ifdef EFX_USE_QWORD_IO
+	_efx_writeq(efx, value->u64[0], reg + 0);
+#else
+	_efx_writed(efx, value->u32[0], reg + 0);
+	_efx_writed(efx, value->u32[1], reg + 4);
+#endif
+	_efx_writed(efx, value->u32[2], reg + 8);
+	_efx_writed(efx, value->u32[3], reg + 12);
 }
 #define efx_writeo_page(efx, value, reg, page)				\
 	_efx_writeo_page(efx, value,					\
-- 
1.7.3.2



-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  parent reply	other threads:[~2010-12-10 17:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10 17:35 pull request: sfc-next-2.6 2010-12-10 Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 01/10] sfc: Reorder struct efx_nic to separate fields by volatility Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 02/10] sfc: Use ACCESS_ONCE when copying efx_tx_queue::read_count Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 03/10] sfc: Expand/correct comments on collector behaviour and function usage Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 04/10] sfc: Remove redundant memory barriers between MMIOs Ben Hutchings
2010-12-10 17:38 ` [PATCH net-next-2.6 05/10] sfc: Add compile-time checks for correctness of paged register writes Ben Hutchings
2010-12-10 17:38 ` Ben Hutchings [this message]
2010-12-10 17:38 ` [PATCH net-next-2.6 07/10] sfc: Use TX push whenever adding descriptors to an empty queue Ben Hutchings
2010-12-10 17:39 ` [PATCH net-next-2.6 08/10] sfc: Log start and end of ethtool self-test at INFO level Ben Hutchings
2010-12-10 17:39 ` [PATCH net-next-2.6 09/10] sfc: Remove filter table IDs from filter functions Ben Hutchings
2010-12-10 17:39 ` [PATCH net-next-2.6 10/10] sfc: Generalise filter spec initialisation Ben Hutchings
2010-12-10 18:47 ` pull request: sfc-next-2.6 2010-12-10 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292002727.11673.20.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).