[kernel] r6682 - in dists/sid/linux-2.6/debian: patches patches/series

Martin Michlmayr tbm at costa.debian.org
Wed May 24 16:26:29 UTC 2006


Author: tbm
Date: Wed May 24 16:26:28 2006
New Revision: 6682

Added:
   dists/sid/linux-2.6/debian/patches/mips-dec-rtc.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/15-extra

Log:
Handle memory-mapped chips RTC properly.


Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Wed May 24 16:26:28 2006
@@ -12,6 +12,7 @@
   * [mips] Add a compile fix for the Maxine fb.
   * [mipsel] Add a patch that let's you enable serial console on DECstation.
   * [mipsel] Add a patch to get SCSI working on DECstation.
+  * [mipsel] Handle memory-mapped chips RTC properly.
   * [arm] Allow RiscPC machines to boot an initrd (tagged list fix).
 
  -- maximilian attems <maks at sternwelten.at>  Wed, 24 May 2006 11:29:16 +0200

Added: dists/sid/linux-2.6/debian/patches/mips-dec-rtc.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/mips-dec-rtc.patch	Wed May 24 16:26:28 2006
@@ -0,0 +1,112 @@
+# Upstream status: in linux-mips tree, submitted to Dmitry Torokhov
+
+[PATCH] char/rtc: Handle memory-mapped chips properly.
+
+From: Maciej W. Rozycki <macro at linux-mips.org>
+
+Handle memory-mapped chips properly, needed for example on DECstations.
+
+Signed-off-by: Maciej W. Rozycki <macro at linux-mips.org>
+Signed-off-by: Martin Michlmayr <tbm at cyrius.com>
+
+
+--- a/drivers/char/rtc.c	2006-03-05 20:35:03.000000000 +0100
++++ b/drivers/char/rtc.c	2006-05-24 18:10:33.000000000 +0200
+@@ -46,13 +46,12 @@
+  *      1.11a   Daniele Bellucci: Audit create_proc_read_entry in rtc_init
+  *	1.12	Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer
+  *		CONFIG_HPET_EMULATE_RTC
++ *	1.12a	Maciej W. Rozycki: Handle memory-mapped chips properly.
+  *	1.12ac	Alan Cox: Allow read access to the day of week register
+  */
+ 
+ #define RTC_VERSION		"1.12ac"
+ 
+-#define RTC_IO_EXTENT	0x8
+-
+ /*
+  *	Note that *all* calls to CMOS_READ and CMOS_WRITE are done with
+  *	interrupts disabled. Due to the index-port/data-port (0x70/0x71)
+@@ -338,7 +337,15 @@
+ 	if (rtc_has_irq == 0)
+ 		return -EIO;
+ 
+-	if (count < sizeof(unsigned))
++	/*
++	 * Historically this function used to assume that sizeof(unsigned long)
++	 * is the same in userspace and kernelspace.  This lead to problems
++	 * for configurations with multiple ABIs such a the MIPS o32 and 64
++	 * ABIs supported on the same kernel.  So now we support read of both
++	 * 4 and 8 bytes and assume that's the sizeof(unsigned long) in the
++	 * userspace ABI.
++	 */
++	if (count != sizeof(unsigned int) && count !=  sizeof(unsigned long))
+ 		return -EINVAL;
+ 
+ 	add_wait_queue(&rtc_wait, &wait);
+@@ -369,10 +376,12 @@
+ 		schedule();
+ 	} while (1);
+ 
+-	if (count < sizeof(unsigned long))
+-		retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int); 
++	if (count == sizeof(unsigned int))
++		retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int);
+ 	else
+ 		retval = put_user(data, (unsigned long __user *)buf) ?: sizeof(long);
++	if (!retval)
++		retval = count;
+  out:
+ 	current->state = TASK_RUNNING;
+ 	remove_wait_queue(&rtc_wait, &wait);
+@@ -924,6 +933,9 @@
+ 	struct sparc_isa_device *isa_dev;
+ #endif
+ #endif
++#ifndef __sparc__
++	void *r;
++#endif
+ 
+ #ifdef __sparc__
+ 	for_each_ebus(ebus) {
+@@ -969,8 +981,13 @@
+ 	}
+ no_irq:
+ #else
+-	if (!request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc")) {
+-		printk(KERN_ERR "rtc: I/O port %d is not free.\n", RTC_PORT (0));
++	if (RTC_IOMAPPED)
++		r = request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
++	else
++		r = request_mem_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");
++	if (!r) {
++		printk(KERN_ERR "rtc: I/O resource %lx is not free.\n",
++		       (long)(RTC_PORT(0)));
+ 		return -EIO;
+ 	}
+ 
+@@ -984,7 +1001,10 @@
+ 	if(request_irq(RTC_IRQ, rtc_int_handler_ptr, SA_INTERRUPT, "rtc", NULL)) {
+ 		/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
+ 		printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
+-		release_region(RTC_PORT(0), RTC_IO_EXTENT);
++		if (RTC_IOMAPPED)
++			release_region(RTC_PORT(0), RTC_IO_EXTENT);
++		else
++			release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
+ 		return -EIO;
+ 	}
+ 	hpet_rtc_timer_init();
+@@ -1084,7 +1104,10 @@
+ 	if (rtc_has_irq)
+ 		free_irq (rtc_irq, &rtc_port);
+ #else
+-	release_region (RTC_PORT (0), RTC_IO_EXTENT);
++	if (RTC_IOMAPPED)
++		release_region(RTC_PORT(0), RTC_IO_EXTENT);
++	else
++		release_mem_region(RTC_PORT(0), RTC_IO_EXTENT);
+ #ifdef RTC_IRQ
+ 	if (rtc_has_irq)
+ 		free_irq (RTC_IRQ, NULL);
+

Modified: dists/sid/linux-2.6/debian/patches/series/15-extra
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/15-extra	(original)
+++ dists/sid/linux-2.6/debian/patches/series/15-extra	Wed May 24 16:26:28 2006
@@ -2,3 +2,4 @@
 #+ m68k-via2-scsi.patch m68k
 + mips-dec-serial.patch mipsel
 + mips-dec-scsi.patch mipsel
++ mips-dec-rtc.patch mipsel



More information about the Kernel-svn-changes mailing list