LKML Archive on
help / color / mirror / Atom feed
From: David Gibson <>
To: Andrew Morton <>
Cc: Russell King <>,,
Subject: Use resource_size_t for serial MMIO addresses
Date: Tue, 20 Feb 2007 14:17:17 +1100	[thread overview]
Message-ID: <20070220031717.GI17818@localhost.localdomain> (raw)

Andrew, please apply to -mm.  I think these should be good to merge
for 2.6.22.

At present, MMIO addresses for serial port (the ->mapbase field in
uart_port and other structures) are unsigned longs.  This causes
problems on some 32-bit platforms which have a >32-bit physical
address bus, for example the embedded PowerPC 440GP chip, which has a
36-bit physical address bus, and on-chip serial ports located at an
MMIO address above 4GB.

The second patch in this series changes mapbase to a resource_size_t
(which can be 64-bit on the problematic platforms) in struct uart_port
and struct plat_serial8250_port.  It does *not* change the type in
serial_struct, because that structure is exposed to userspace.  It is
therefore unsafe to use setserial to change the address parameters on
a port using a mapbase above 4GB.

The first patch in the series contains the damage of the setserial
problem.  It allows serial ports to be marked with a new
UPF_FIXED_PORT flag, which causes any attempts to change the port's
type (PIO/MMIO etc.), address or irq with setserial to be ignored.
While using setserial to alter the port address is useful for legacy
ISA ports, it is generally a bad idea for ports such as on-chip or
other hardwired ports where the arch code has good information (from
firmware or hardware probing) on the port's type and address.

David Gibson			| I'll have my music baroque, and my code
david AT	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!

             reply	other threads:[~2007-02-20  3:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-20  3:17 David Gibson [this message]
2007-02-20  3:19 ` [PATCH 1/2] Define FIXED_PORT flag for serial_core David Gibson
2007-02-20 13:07   ` Alan
2007-02-28 22:26   ` Russell King
2007-02-28 23:44     ` David Gibson
2007-03-01 10:30       ` Russell King
2007-03-02  1:57         ` David Gibson
2007-02-20  3:19 ` [PATCH 2/2] Use resource_size_t for serial port IO addresses David Gibson
2007-02-20 13:06   ` Alan

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:

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

  git send-email \
    --in-reply-to=20070220031717.GI17818@localhost.localdomain \ \ \ \ \ \
    --subject='Re: Use resource_size_t for serial MMIO addresses' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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