linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* rtc-ds1742.c should use resource_size_t for base address
@ 2007-09-14  5:54 David Gibson
  2007-09-14 16:09 ` Atsushi Nemoto
  2007-09-14 17:20 ` Josh Boyer
  0 siblings, 2 replies; 4+ messages in thread
From: David Gibson @ 2007-09-14  5:54 UTC (permalink / raw)
  To: Andrew Morton, Atsushi Nemoto; +Cc: linuxppc-dev, linux-kernel, rtc-linux

Currently the rtc driver, rtc-ds1742.c uses an unsigned long to store
the base mmio address of the NVRAM/RTC.  This breaks on systems like
PowerPC 440, which is a 32-bit core with 36-bit physical addresses: IO
on the system, including the RTC, is typically above the 4GB point,
and cannot fit into an unsigned long.

This patch fixes the problem by replacing the unsigned long with a
resource_size_t.  Tested on Ebony (PPC440) (with additional patches to
instantiate the ds1742 platform device appropriately).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: working-2.6/drivers/rtc/rtc-ds1742.c
===================================================================
--- working-2.6.orig/drivers/rtc/rtc-ds1742.c	2007-09-14 15:43:31.000000000 +1000
+++ working-2.6/drivers/rtc/rtc-ds1742.c	2007-09-14 15:44:09.000000000 +1000
@@ -55,7 +55,7 @@ struct rtc_plat_data {
 	void __iomem *ioaddr_rtc;
 	size_t size_nvram;
 	size_t size;
-	unsigned long baseaddr;
+	resource_size_t baseaddr;
 	unsigned long last_jiffies;
 };
 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtc-ds1742.c should use resource_size_t for base address
  2007-09-14  5:54 rtc-ds1742.c should use resource_size_t for base address David Gibson
@ 2007-09-14 16:09 ` Atsushi Nemoto
  2007-09-14 17:20 ` Josh Boyer
  1 sibling, 0 replies; 4+ messages in thread
From: Atsushi Nemoto @ 2007-09-14 16:09 UTC (permalink / raw)
  To: david; +Cc: akpm, linuxppc-dev, linux-kernel, rtc-linux

On Fri, 14 Sep 2007 15:54:27 +1000, David Gibson <david@gibson.dropbear.id.au> wrote:
> Currently the rtc driver, rtc-ds1742.c uses an unsigned long to store
> the base mmio address of the NVRAM/RTC.  This breaks on systems like
> PowerPC 440, which is a 32-bit core with 36-bit physical addresses: IO
> on the system, including the RTC, is typically above the 4GB point,
> and cannot fit into an unsigned long.
> 
> This patch fixes the problem by replacing the unsigned long with a
> resource_size_t.  Tested on Ebony (PPC440) (with additional patches to
> instantiate the ds1742 platform device appropriately).
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Thanks!

Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtc-ds1742.c should use resource_size_t for base address
  2007-09-14  5:54 rtc-ds1742.c should use resource_size_t for base address David Gibson
  2007-09-14 16:09 ` Atsushi Nemoto
@ 2007-09-14 17:20 ` Josh Boyer
  2007-09-15  1:30   ` David Gibson
  1 sibling, 1 reply; 4+ messages in thread
From: Josh Boyer @ 2007-09-14 17:20 UTC (permalink / raw)
  To: David Gibson
  Cc: Andrew Morton, linuxppc-dev, Atsushi Nemoto, linux-kernel,
	rtc-linux

On Fri, 14 Sep 2007 15:54:27 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> Currently the rtc driver, rtc-ds1742.c uses an unsigned long to store
> the base mmio address of the NVRAM/RTC.  This breaks on systems like
> PowerPC 440, which is a 32-bit core with 36-bit physical addresses: IO
> on the system, including the RTC, is typically above the 4GB point,
> and cannot fit into an unsigned long.
> 
> This patch fixes the problem by replacing the unsigned long with a
> resource_size_t.  Tested on Ebony (PPC440) (with additional patches to
> instantiate the ds1742 platform device appropriately).

Where would those additional patches be? :)

josh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtc-ds1742.c should use resource_size_t for base address
  2007-09-14 17:20 ` Josh Boyer
@ 2007-09-15  1:30   ` David Gibson
  0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2007-09-15  1:30 UTC (permalink / raw)
  To: Josh Boyer
  Cc: Andrew Morton, linuxppc-dev, Atsushi Nemoto, linux-kernel,
	rtc-linux

On Fri, Sep 14, 2007 at 12:20:37PM -0500, Josh Boyer wrote:
> On Fri, 14 Sep 2007 15:54:27 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > Currently the rtc driver, rtc-ds1742.c uses an unsigned long to store
> > the base mmio address of the NVRAM/RTC.  This breaks on systems like
> > PowerPC 440, which is a 32-bit core with 36-bit physical addresses: IO
> > on the system, including the RTC, is typically above the 4GB point,
> > and cannot fit into an unsigned long.
> > 
> > This patch fixes the problem by replacing the unsigned long with a
> > resource_size_t.  Tested on Ebony (PPC440) (with additional patches to
> > instantiate the ds1742 platform device appropriately).
> 
> Where would those additional patches be? :)

Coming, they still need polish...

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-15  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-14  5:54 rtc-ds1742.c should use resource_size_t for base address David Gibson
2007-09-14 16:09 ` Atsushi Nemoto
2007-09-14 17:20 ` Josh Boyer
2007-09-15  1:30   ` David Gibson

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