From: Simon Kagstrom <simon.kagstrom@netinsight.net>
To: x86@kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: mingo@redhat.com, tglx@linutronix.de, alan@linux.intel.com,
akpm@linux-foundation.org, hpa@zytor.com
Subject: [PATCH 1/2]: serial8250: Use native_io_delay on the x86
Date: Wed, 17 Mar 2010 13:30:50 +0100 [thread overview]
Message-ID: <20100317133050.54851ff8@marrow.netinsight.se> (raw)
In-Reply-To: <20100317132849.7d49939b@marrow.netinsight.se>
Port 0x80 is not safe to use on all x86 boards (see
arch/x86/kernel/io_delay.c), so use native_io_delay instead.
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
---
drivers/serial/8250.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index c3db16b..b3007a4 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -38,6 +38,7 @@
#include <linux/serial_8250.h>
#include <linux/nmi.h>
#include <linux/mutex.h>
+#include <linux/io.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -1109,11 +1110,8 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
* Do a simple existence test first; if we fail this,
* there's no point trying anything else.
*
- * 0x80 is used as a nonsense port to prevent against
- * false positives due to ISA bus float. The
- * assumption is that 0x80 is a non-existent port;
- * which should be safe since include/asm/io.h also
- * makes this assumption.
+ * The IO delay is used to prevent against false positives
+ * due to ISA bus float.
*
* Note: this is safe as long as MCR bit 4 is clear
* and the device is in "PC" mode.
@@ -1121,7 +1119,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
scratch = serial_inp(up, UART_IER);
serial_outp(up, UART_IER, 0);
#ifdef __i386__
- outb(0xff, 0x080);
+ native_io_delay();
#endif
/*
* Mask out IER[7:4] bits for test as some UARTs (e.g. TL
@@ -1130,7 +1128,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
scratch2 = serial_inp(up, UART_IER) & 0x0f;
serial_outp(up, UART_IER, 0x0F);
#ifdef __i386__
- outb(0, 0x080);
+ native_io_delay();
#endif
scratch3 = serial_inp(up, UART_IER) & 0x0f;
serial_outp(up, UART_IER, scratch);
--
1.6.0.4
next prev parent reply other threads:[~2010-03-17 12:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-17 12:28 [PATCH 0/2]: x86: Honor IO_DELAY IO port settings Simon Kagstrom
2010-03-17 12:30 ` Simon Kagstrom [this message]
2010-03-17 13:01 ` [PATCH 1/2]: serial8250: Use native_io_delay on the x86 Alan Cox
2010-03-17 14:09 ` Simon Kagstrom
2010-03-17 18:25 ` H. Peter Anvin
2010-03-17 18:36 ` Alan Cox
2010-03-17 18:43 ` H. Peter Anvin
2010-03-17 12:30 ` [PATCH 2/2]: x86 real mode: Set delay port according to kernel config Simon Kagstrom
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=20100317133050.54851ff8@marrow.netinsight.se \
--to=simon.kagstrom@netinsight.net \
--cc=akpm@linux-foundation.org \
--cc=alan@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@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).