public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Shradha Shah <sshah@solarflare•com>
To: <netdev@vger•kernel.org>
Cc: <linux-net-drivers@solarflare•com>
Subject: [PATCH net v2 2/2] sfc: Restrict PIO to 64-bit architectures
Date: Wed, 28 May 2014 10:30:24 +0100	[thread overview]
Message-ID: <5385ACB0.3060206@solarflare.com> (raw)
In-Reply-To: <5385AAF5.7090001@solarflare.com>

From: Jon Cooper <jcooper@solarflare•com>

Enable PIO for x86_64 architecture only.
Not tested on platforms other than x86_64.

Fixes:ee45fd92c739db5b7950163d91dfe5f016af6d24

orig-hg-hash: 53dc43553d9bbe1c5a64c49e580ca571ddc470ae
Signed-off-by: Shradha Shah <sshah@solarflare•com>
---
 drivers/net/ethernet/sfc/io.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/sfc/io.h b/drivers/net/ethernet/sfc/io.h
index 4d3f119..adadcf0 100644
--- a/drivers/net/ethernet/sfc/io.h
+++ b/drivers/net/ethernet/sfc/io.h
@@ -66,10 +66,18 @@
 #define EFX_USE_QWORD_IO 1
 #endif
 
+/* PIO only works on 64-bit architectures */
+#if BITS_PER_LONG == 64
+/* not strictly necessary to restrict to x86 arch, but done for safety
+ * since unusual write combining behaviour can break PIO.
+ */
+#ifdef CONFIG_X86_64
 /* PIO is a win only if write-combining is possible */
 #ifdef ARCH_HAS_IOREMAP_WC
 #define EFX_USE_PIO 1
 #endif
+#endif
+#endif
 
 #ifdef EFX_USE_QWORD_IO
 static inline void _efx_writeq(struct efx_nic *efx, __le64 value,

  parent reply	other threads:[~2014-05-28  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28  9:23 [PATCH net v2 0/2] sfc: Restrict PIO for 64bit arch in order to avoid data corruption Shradha Shah
2014-05-28  9:28 ` [PATCH net v2 1/2] sfc: use 64-bit writes for PIO Shradha Shah
2014-05-28  9:30 ` Shradha Shah [this message]
2014-05-31  0:38 ` [PATCH net v2 0/2] sfc: Restrict PIO for 64bit arch in order to avoid data corruption David Miller
     [not found] <cover.1401268725.git.sshah@solarflare.com>
2014-05-28  9:28 ` [PATCH net v2 2/2] sfc: Restrict PIO to 64-bit architectures Shradha Shah
2014-05-28 14:45   ` Sergei Shtylyov

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=5385ACB0.3060206@solarflare.com \
    --to=sshah@solarflare$(echo .)com \
    --cc=linux-net-drivers@solarflare$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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