Răsfoiți Sursa

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

Andi Kleen 18 ani în urmă
părinte
comite
a3550a9c54
79 a modificat fișierele cu 877 adăugiri și 370 ștergeri
  1. 304 159
      Documentation/rtc.txt
  2. 6 0
      MAINTAINERS
  3. 2 0
      arch/arm/Kconfig
  4. 4 4
      arch/arm/mach-ebsa110/io.c
  5. 3 0
      arch/arm/mm/consistent.c
  6. 21 1
      arch/mips/mm/c-sb1.c
  7. 0 42
      arch/powerpc/kernel/time.c
  8. 19 0
      arch/powerpc/platforms/83xx/mpc832x_mds.c
  9. 0 4
      arch/powerpc/platforms/83xx/mpc834x_itx.c
  10. 2 0
      arch/um/include/os.h
  11. 5 5
      arch/um/os-Linux/Makefile
  12. 149 0
      arch/um/os-Linux/execvp.c
  13. 10 4
      arch/um/os-Linux/helper.c
  14. 1 3
      drivers/acpi/processor_perflib.c
  15. 3 1
      drivers/base/core.c
  16. 1 1
      drivers/char/agp/generic.c
  17. 25 8
      drivers/char/agp/intel-agp.c
  18. 2 3
      drivers/char/tlclk.c
  19. 1 0
      drivers/cpufreq/Kconfig
  20. 1 1
      drivers/i2c/busses/i2c-ixp4xx.c
  21. 0 7
      drivers/ide/pci/sgiioc4.c
  22. 1 1
      drivers/media/dvb/dvb-core/dvb_frontend.c
  23. 4 0
      drivers/media/dvb/frontends/tda10086.c
  24. 9 0
      drivers/media/dvb/ttpci/budget.c
  25. 1 2
      drivers/media/video/et61x251/et61x251_core.c
  26. 3 1
      drivers/media/video/saa6588.c
  27. 7 2
      drivers/media/video/saa7115.c
  28. 1 2
      drivers/media/video/sn9c102/sn9c102_core.c
  29. 1 1
      drivers/net/hamradio/6pack.c
  30. 3 1
      drivers/net/tg3.c
  31. 2 0
      drivers/pcmcia/ds.c
  32. 12 4
      drivers/rtc/interface.c
  33. 2 1
      drivers/rtc/rtc-at91.c
  34. 19 6
      drivers/rtc/rtc-dev.c
  35. 2 1
      drivers/rtc/rtc-ds1553.c
  36. 3 3
      drivers/rtc/rtc-rs5c372.c
  37. 2 0
      drivers/rtc/rtc-test.c
  38. 4 6
      drivers/usb/input/ati_remote.c
  39. 1 0
      fs/debugfs/inode.c
  40. 38 14
      fs/fuse/dir.c
  41. 2 1
      fs/proc/base.c
  42. 2 1
      fs/reiserfs/file.c
  43. 2 0
      fs/xfs/xfs_bmap.c
  44. 1 1
      fs/xfs/xfs_inode.c
  45. 11 5
      include/asm-arm/arch-ebsa110/io.h
  46. 4 0
      include/asm-arm/dma-mapping.h
  47. 2 4
      include/asm-mips/mach-au1x00/au1xxx_ide.h
  48. 4 2
      include/asm-parisc/semaphore.h
  49. 0 4
      include/asm-powerpc/time.h
  50. 1 1
      include/linux/igmp.h
  51. 3 1
      include/linux/kernel.h
  52. 3 1
      include/linux/nsproxy.h
  53. 14 0
      include/linux/spinlock.h
  54. 2 0
      include/linux/spinlock_api_smp.h
  55. 10 5
      include/net/sock.h
  56. 2 3
      kernel/fork.c
  57. 2 2
      kernel/irq/handle.c
  58. 1 5
      kernel/irq/spurious.c
  59. 21 0
      kernel/spinlock.c
  60. 3 3
      mm/page_alloc.c
  61. 19 0
      net/bluetooth/hci_event.c
  62. 7 4
      net/bluetooth/hci_sock.c
  63. 3 1
      net/bluetooth/hci_sysfs.c
  64. 7 4
      net/bluetooth/l2cap.c
  65. 1 1
      net/bluetooth/rfcomm/tty.c
  66. 1 1
      net/dccp/ipv6.c
  67. 2 0
      net/dccp/probe.c
  68. 2 2
      net/ipv4/netfilter/ip_conntrack_helper_h323.c
  69. 2 0
      net/ipv4/tcp_probe.c
  70. 14 5
      net/ipv4/udp.c
  71. 18 1
      net/ipv6/ip6_tunnel.c
  72. 8 7
      net/ipv6/route.c
  73. 3 4
      net/ipv6/udp.c
  74. 2 1
      net/irda/irlmp.c
  75. 13 1
      net/xfrm/xfrm_user.c
  76. 2 1
      scripts/gen_initramfs_list.sh
  77. 7 9
      scripts/kconfig/lxdialog/util.c
  78. 1 0
      scripts/kconfig/qconf.cc
  79. 1 1
      usr/Makefile

+ 304 - 159
Documentation/rtc.txt

@@ -1,12 +1,49 @@
 
 
-	Real Time Clock Driver for Linux
-	================================
+	Real Time Clock (RTC) Drivers for Linux
+	=======================================
+
+When Linux developers talk about a "Real Time Clock", they usually mean
+something that tracks wall clock time and is battery backed so that it
+works even with system power off.  Such clocks will normally not track
+the local time zone or daylight savings time -- unless they dual boot
+with MS-Windows -- but will instead be set to Coordinated Universal Time
+(UTC, formerly "Greenwich Mean Time").
+
+The newest non-PC hardware tends to just count seconds, like the time(2)
+system call reports, but RTCs also very commonly represent time using
+the Gregorian calendar and 24 hour time, as reported by gmtime(3).
+
+Linux has two largely-compatible userspace RTC API families you may
+need to know about:
+
+    *	/dev/rtc ... is the RTC provided by PC compatible systems,
+	so it's not very portable to non-x86 systems.
+
+    *	/dev/rtc0, /dev/rtc1 ... are part of a framework that's
+	supported by a wide variety of RTC chips on all systems.
+
+Programmers need to understand that the PC/AT functionality is not
+always available, and some systems can do much more.  That is, the
+RTCs use the same API to make requests in both RTC frameworks (using
+different filenames of course), but the hardware may not offer the
+same functionality.  For example, not every RTC is hooked up to an
+IRQ, so they can't all issue alarms; and where standard PC RTCs can
+only issue an alarm up to 24 hours in the future, other hardware may
+be able to schedule one any time in the upcoming century.
+
+
+	Old PC/AT-Compatible driver:  /dev/rtc
+	--------------------------------------
 
 
 All PCs (even Alpha machines) have a Real Time Clock built into them.
 All PCs (even Alpha machines) have a Real Time Clock built into them.
 Usually they are built into the chipset of the computer, but some may
 Usually they are built into the chipset of the computer, but some may
 actually have a Motorola MC146818 (or clone) on the board. This is the
 actually have a Motorola MC146818 (or clone) on the board. This is the
 clock that keeps the date and time while your computer is turned off.
 clock that keeps the date and time while your computer is turned off.
 
 
+ACPI has standardized that MC146818 functionality, and extended it in
+a few ways (enabling longer alarm periods, and wake-from-hibernate).
+That functionality is NOT exposed in the old driver.
+
 However it can also be used to generate signals from a slow 2Hz to a
 However it can also be used to generate signals from a slow 2Hz to a
 relatively fast 8192Hz, in increments of powers of two. These signals
 relatively fast 8192Hz, in increments of powers of two. These signals
 are reported by interrupt number 8. (Oh! So *that* is what IRQ 8 is
 are reported by interrupt number 8. (Oh! So *that* is what IRQ 8 is
@@ -63,223 +100,331 @@ Rather than write 50 pages describing the ioctl() and so on, it is
 perhaps more useful to include a small test program that demonstrates
 perhaps more useful to include a small test program that demonstrates
 how to use them, and demonstrates the features of the driver. This is
 how to use them, and demonstrates the features of the driver. This is
 probably a lot more useful to people interested in writing applications
 probably a lot more useful to people interested in writing applications
-that will be using this driver.
+that will be using this driver.  See the code at the end of this document.
+
+(The original /dev/rtc driver was written by Paul Gortmaker.)
+
+
+	New portable "RTC Class" drivers:  /dev/rtcN
+	--------------------------------------------
+
+Because Linux supports many non-ACPI and non-PC platforms, some of which
+have more than one RTC style clock, it needed a more portable solution
+than expecting a single battery-backed MC146818 clone on every system.
+Accordingly, a new "RTC Class" framework has been defined.  It offers
+three different userspace interfaces:
+
+    *	/dev/rtcN ... much the same as the older /dev/rtc interface
+
+    *	/sys/class/rtc/rtcN ... sysfs attributes support readonly
+	access to some RTC attributes.
+
+    *	/proc/driver/rtc ... the first RTC (rtc0) may expose itself
+	using a procfs interface.  More information is (currently) shown
+	here than through sysfs.
+
+The RTC Class framework supports a wide variety of RTCs, ranging from those
+integrated into embeddable system-on-chip (SOC) processors to discrete chips
+using I2C, SPI, or some other bus to communicate with the host CPU.  There's
+even support for PC-style RTCs ... including the features exposed on newer PCs
+through ACPI.
+
+The new framework also removes the "one RTC per system" restriction.  For
+example, maybe the low-power battery-backed RTC is a discrete I2C chip, but
+a high functionality RTC is integrated into the SOC.  That system might read
+the system clock from the discrete RTC, but use the integrated one for all
+other tasks, because of its greater functionality.
+
+The ioctl() calls supported by /dev/rtc are also supported by the RTC class
+framework.  However, because the chips and systems are not standardized,
+some PC/AT functionality might not be provided.  And in the same way, some
+newer features -- including those enabled by ACPI -- are exposed by the
+RTC class framework, but can't be supported by the older driver.
+
+    *	RTC_RD_TIME, RTC_SET_TIME ... every RTC supports at least reading
+	time, returning the result as a Gregorian calendar date and 24 hour
+	wall clock time.  To be most useful, this time may also be updated.
+
+    *	RTC_AIE_ON, RTC_AIE_OFF, RTC_ALM_SET, RTC_ALM_READ ... when the RTC
+	is connected to an IRQ line, it can often issue an alarm IRQ up to
+	24 hours in the future.
+
+    *	RTC_WKALM_SET, RTC_WKALM_READ ... RTCs that can issue alarms beyond
+	the next 24 hours use a slightly more powerful API, which supports
+	setting the longer alarm time and enabling its IRQ using a single
+	request (using the same model as EFI firmware).
+
+    *	RTC_UIE_ON, RTC_UIE_OFF ... if the RTC offers IRQs, it probably
+	also offers update IRQs whenever the "seconds" counter changes.
+	If needed, the RTC framework can emulate this mechanism.
+
+    *	RTC_PIE_ON, RTC_PIE_OFF, RTC_IRQP_SET, RTC_IRQP_READ ... another
+	feature often accessible with an IRQ line is a periodic IRQ, issued
+	at settable frequencies (usually 2^N Hz).
+
+In many cases, the RTC alarm can be a system wake event, used to force
+Linux out of a low power sleep state (or hibernation) back to a fully
+operational state.  For example, a system could enter a deep power saving
+state until it's time to execute some scheduled tasks.
 
 
-						Paul Gortmaker
 
 
 -------------------- 8< ---------------- 8< -----------------------------
 -------------------- 8< ---------------- 8< -----------------------------
 
 
 /*
 /*
- *	Real Time Clock Driver Test/Example Program
+ *      Real Time Clock Driver Test/Example Program
  *
  *
- *	Compile with:
- *		gcc -s -Wall -Wstrict-prototypes rtctest.c -o rtctest
+ *      Compile with:
+ *		     gcc -s -Wall -Wstrict-prototypes rtctest.c -o rtctest
  *
  *
- *	Copyright (C) 1996, Paul Gortmaker.
+ *      Copyright (C) 1996, Paul Gortmaker.
  *
  *
- *	Released under the GNU General Public License, version 2,
- *	included herein by reference.
+ *      Released under the GNU General Public License, version 2,
+ *      included herein by reference.
  *
  *
  */
  */
 
 
 #include <stdio.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <linux/rtc.h>
 #include <linux/rtc.h>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <errno.h>
 
 
-int main(void) {
-
-int i, fd, retval, irqcount = 0;
-unsigned long tmp, data;
-struct rtc_time rtc_tm;
 
 
-fd = open ("/dev/rtc", O_RDONLY);
+/*
+ * This expects the new RTC class driver framework, working with
+ * clocks that will often not be clones of what the PC-AT had.
+ * Use the command line to specify another RTC if you need one.
+ */
+static const char default_rtc[] = "/dev/rtc0";
+
+
+int main(int argc, char **argv)
+{
+	int i, fd, retval, irqcount = 0;
+	unsigned long tmp, data;
+	struct rtc_time rtc_tm;
+	const char *rtc = default_rtc;
+
+	switch (argc) {
+	case 2:
+		rtc = argv[1];
+		/* FALLTHROUGH */
+	case 1:
+		break;
+	default:
+		fprintf(stderr, "usage:  rtctest [rtcdev]\n");
+		return 1;
+	}
 
 
-if (fd ==  -1) {
-	perror("/dev/rtc");
-	exit(errno);
-}
+	fd = open(rtc, O_RDONLY);
 
 
-fprintf(stderr, "\n\t\t\tRTC Driver Test Example.\n\n");
+	if (fd ==  -1) {
+		perror(rtc);
+		exit(errno);
+	}
 
 
-/* Turn on update interrupts (one per second) */
-retval = ioctl(fd, RTC_UIE_ON, 0);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
+	fprintf(stderr, "\n\t\t\tRTC Driver Test Example.\n\n");
 
 
-fprintf(stderr, "Counting 5 update (1/sec) interrupts from reading /dev/rtc:");
-fflush(stderr);
-for (i=1; i<6; i++) {
-	/* This read will block */
-	retval = read(fd, &data, sizeof(unsigned long));
+	/* Turn on update interrupts (one per second) */
+	retval = ioctl(fd, RTC_UIE_ON, 0);
 	if (retval == -1) {
 	if (retval == -1) {
-		perror("read");
+		if (errno == ENOTTY) {
+			fprintf(stderr,
+				"\n...Update IRQs not supported.\n");
+			goto test_READ;
+		}
+		perror("ioctl");
 		exit(errno);
 		exit(errno);
 	}
 	}
-	fprintf(stderr, " %d",i);
+
+	fprintf(stderr, "Counting 5 update (1/sec) interrupts from reading %s:",
+			rtc);
 	fflush(stderr);
 	fflush(stderr);
-	irqcount++;
-}
+	for (i=1; i<6; i++) {
+		/* This read will block */
+		retval = read(fd, &data, sizeof(unsigned long));
+		if (retval == -1) {
+		        perror("read");
+		        exit(errno);
+		}
+		fprintf(stderr, " %d",i);
+		fflush(stderr);
+		irqcount++;
+	}
 
 
-fprintf(stderr, "\nAgain, from using select(2) on /dev/rtc:");
-fflush(stderr);
-for (i=1; i<6; i++) {
-	struct timeval tv = {5, 0};	/* 5 second timeout on select */
-	fd_set readfds;
+	fprintf(stderr, "\nAgain, from using select(2) on /dev/rtc:");
+	fflush(stderr);
+	for (i=1; i<6; i++) {
+		struct timeval tv = {5, 0};     /* 5 second timeout on select */
+		fd_set readfds;
+
+		FD_ZERO(&readfds);
+		FD_SET(fd, &readfds);
+		/* The select will wait until an RTC interrupt happens. */
+		retval = select(fd+1, &readfds, NULL, NULL, &tv);
+		if (retval == -1) {
+		        perror("select");
+		        exit(errno);
+		}
+		/* This read won't block unlike the select-less case above. */
+		retval = read(fd, &data, sizeof(unsigned long));
+		if (retval == -1) {
+		        perror("read");
+		        exit(errno);
+		}
+		fprintf(stderr, " %d",i);
+		fflush(stderr);
+		irqcount++;
+	}
 
 
-	FD_ZERO(&readfds);
-	FD_SET(fd, &readfds);
-	/* The select will wait until an RTC interrupt happens. */
-	retval = select(fd+1, &readfds, NULL, NULL, &tv);
+	/* Turn off update interrupts */
+	retval = ioctl(fd, RTC_UIE_OFF, 0);
 	if (retval == -1) {
 	if (retval == -1) {
-		perror("select");
+		perror("ioctl");
 		exit(errno);
 		exit(errno);
 	}
 	}
-	/* This read won't block unlike the select-less case above. */
-	retval = read(fd, &data, sizeof(unsigned long));
+
+test_READ:
+	/* Read the RTC time/date */
+	retval = ioctl(fd, RTC_RD_TIME, &rtc_tm);
 	if (retval == -1) {
 	if (retval == -1) {
-		perror("read");
+		perror("ioctl");
 		exit(errno);
 		exit(errno);
 	}
 	}
-	fprintf(stderr, " %d",i);
-	fflush(stderr);
-	irqcount++;
-}
-
-/* Turn off update interrupts */
-retval = ioctl(fd, RTC_UIE_OFF, 0);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
-
-/* Read the RTC time/date */
-retval = ioctl(fd, RTC_RD_TIME, &rtc_tm);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
-
-fprintf(stderr, "\n\nCurrent RTC date/time is %d-%d-%d, %02d:%02d:%02d.\n",
-	rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year + 1900,
-	rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
-
-/* Set the alarm to 5 sec in the future, and check for rollover */
-rtc_tm.tm_sec += 5;
-if (rtc_tm.tm_sec >= 60) {
-	rtc_tm.tm_sec %= 60;
-	rtc_tm.tm_min++;
-}
-if  (rtc_tm.tm_min == 60) {
-	rtc_tm.tm_min = 0;
-	rtc_tm.tm_hour++;
-}
-if  (rtc_tm.tm_hour == 24)
-	rtc_tm.tm_hour = 0;
-
-retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
-
-/* Read the current alarm settings */
-retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
-
-fprintf(stderr, "Alarm time now set to %02d:%02d:%02d.\n",
-	rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
 
 
-/* Enable alarm interrupts */
-retval = ioctl(fd, RTC_AIE_ON, 0);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
+	fprintf(stderr, "\n\nCurrent RTC date/time is %d-%d-%d, %02d:%02d:%02d.\n",
+		rtc_tm.tm_mday, rtc_tm.tm_mon + 1, rtc_tm.tm_year + 1900,
+		rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
 
 
-fprintf(stderr, "Waiting 5 seconds for alarm...");
-fflush(stderr);
-/* This blocks until the alarm ring causes an interrupt */
-retval = read(fd, &data, sizeof(unsigned long));
-if (retval == -1) {
-	perror("read");
-	exit(errno);
-}
-irqcount++;
-fprintf(stderr, " okay. Alarm rang.\n");
-
-/* Disable alarm interrupts */
-retval = ioctl(fd, RTC_AIE_OFF, 0);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
+	/* Set the alarm to 5 sec in the future, and check for rollover */
+	rtc_tm.tm_sec += 5;
+	if (rtc_tm.tm_sec >= 60) {
+		rtc_tm.tm_sec %= 60;
+		rtc_tm.tm_min++;
+	}
+	if  (rtc_tm.tm_min == 60) {
+		rtc_tm.tm_min = 0;
+		rtc_tm.tm_hour++;
+	}
+	if  (rtc_tm.tm_hour == 24)
+		rtc_tm.tm_hour = 0;
 
 
-/* Read periodic IRQ rate */
-retval = ioctl(fd, RTC_IRQP_READ, &tmp);
-if (retval == -1) {
-	perror("ioctl");
-	exit(errno);
-}
-fprintf(stderr, "\nPeriodic IRQ rate was %ldHz.\n", tmp);
+	retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
+	if (retval == -1) {
+		if (errno == ENOTTY) {
+			fprintf(stderr,
+				"\n...Alarm IRQs not supported.\n");
+			goto test_PIE;
+		}
+		perror("ioctl");
+		exit(errno);
+	}
 
 
-fprintf(stderr, "Counting 20 interrupts at:");
-fflush(stderr);
+	/* Read the current alarm settings */
+	retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
+	if (retval == -1) {
+		perror("ioctl");
+		exit(errno);
+	}
 
 
-/* The frequencies 128Hz, 256Hz, ... 8192Hz are only allowed for root. */
-for (tmp=2; tmp<=64; tmp*=2) {
+	fprintf(stderr, "Alarm time now set to %02d:%02d:%02d.\n",
+		rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
 
 
-	retval = ioctl(fd, RTC_IRQP_SET, tmp);
+	/* Enable alarm interrupts */
+	retval = ioctl(fd, RTC_AIE_ON, 0);
 	if (retval == -1) {
 	if (retval == -1) {
 		perror("ioctl");
 		perror("ioctl");
 		exit(errno);
 		exit(errno);
 	}
 	}
 
 
-	fprintf(stderr, "\n%ldHz:\t", tmp);
+	fprintf(stderr, "Waiting 5 seconds for alarm...");
 	fflush(stderr);
 	fflush(stderr);
+	/* This blocks until the alarm ring causes an interrupt */
+	retval = read(fd, &data, sizeof(unsigned long));
+	if (retval == -1) {
+		perror("read");
+		exit(errno);
+	}
+	irqcount++;
+	fprintf(stderr, " okay. Alarm rang.\n");
 
 
-	/* Enable periodic interrupts */
-	retval = ioctl(fd, RTC_PIE_ON, 0);
+	/* Disable alarm interrupts */
+	retval = ioctl(fd, RTC_AIE_OFF, 0);
 	if (retval == -1) {
 	if (retval == -1) {
 		perror("ioctl");
 		perror("ioctl");
 		exit(errno);
 		exit(errno);
 	}
 	}
 
 
-	for (i=1; i<21; i++) {
-		/* This blocks */
-		retval = read(fd, &data, sizeof(unsigned long));
+test_PIE:
+	/* Read periodic IRQ rate */
+	retval = ioctl(fd, RTC_IRQP_READ, &tmp);
+	if (retval == -1) {
+		/* not all RTCs support periodic IRQs */
+		if (errno == ENOTTY) {
+			fprintf(stderr, "\nNo periodic IRQ support\n");
+			return 0;
+		}
+		perror("ioctl");
+		exit(errno);
+	}
+	fprintf(stderr, "\nPeriodic IRQ rate is %ldHz.\n", tmp);
+
+	fprintf(stderr, "Counting 20 interrupts at:");
+	fflush(stderr);
+
+	/* The frequencies 128Hz, 256Hz, ... 8192Hz are only allowed for root. */
+	for (tmp=2; tmp<=64; tmp*=2) {
+
+		retval = ioctl(fd, RTC_IRQP_SET, tmp);
 		if (retval == -1) {
 		if (retval == -1) {
-			perror("read");
-			exit(errno);
+			/* not all RTCs can change their periodic IRQ rate */
+			if (errno == ENOTTY) {
+				fprintf(stderr,
+					"\n...Periodic IRQ rate is fixed\n");
+				goto done;
+			}
+		        perror("ioctl");
+		        exit(errno);
 		}
 		}
-		fprintf(stderr, " %d",i);
+
+		fprintf(stderr, "\n%ldHz:\t", tmp);
 		fflush(stderr);
 		fflush(stderr);
-		irqcount++;
-	}
 
 
-	/* Disable periodic interrupts */
-	retval = ioctl(fd, RTC_PIE_OFF, 0);
-	if (retval == -1) {
-		perror("ioctl");
-		exit(errno);
+		/* Enable periodic interrupts */
+		retval = ioctl(fd, RTC_PIE_ON, 0);
+		if (retval == -1) {
+		        perror("ioctl");
+		        exit(errno);
+		}
+
+		for (i=1; i<21; i++) {
+		        /* This blocks */
+		        retval = read(fd, &data, sizeof(unsigned long));
+		        if (retval == -1) {
+				       perror("read");
+				       exit(errno);
+		        }
+		        fprintf(stderr, " %d",i);
+		        fflush(stderr);
+		        irqcount++;
+		}
+
+		/* Disable periodic interrupts */
+		retval = ioctl(fd, RTC_PIE_OFF, 0);
+		if (retval == -1) {
+		        perror("ioctl");
+		        exit(errno);
+		}
 	}
 	}
-}
 
 
-fprintf(stderr, "\n\n\t\t\t *** Test complete ***\n");
-fprintf(stderr, "\nTyping \"cat /proc/interrupts\" will show %d more events on IRQ 8.\n\n",
-								 irqcount);
+done:
+	fprintf(stderr, "\n\n\t\t\t *** Test complete ***\n");
 
 
-close(fd);
-return 0;
+	close(fd);
 
 
-} /* end main */
+	return 0;
+}

+ 6 - 0
MAINTAINERS

@@ -353,6 +353,12 @@ P:	Richard Purdie
 M:	rpurdie@rpsys.net
 M:	rpurdie@rpsys.net
 S:	Maintained
 S:	Maintained
 
 
+ARM/HP JORNADA 7XX MACHINE SUPPORT
+P:      Kristoffer Ericson
+M:      kristoffer_e1@hotmail.com
+W:      www.jlime.com
+S:      Maintained
+
 ARM/TOSA MACHINE SUPPORT
 ARM/TOSA MACHINE SUPPORT
 P:	Dirk Opfer
 P:	Dirk Opfer
 M:	dirk@opfer-online.de
 M:	dirk@opfer-online.de

+ 2 - 0
arch/arm/Kconfig

@@ -879,6 +879,8 @@ endif
 
 
 source "drivers/scsi/Kconfig"
 source "drivers/scsi/Kconfig"
 
 
+source "drivers/ata/Kconfig"
+
 source "drivers/md/Kconfig"
 source "drivers/md/Kconfig"
 
 
 source "drivers/message/fusion/Kconfig"
 source "drivers/message/fusion/Kconfig"

+ 4 - 4
arch/arm/mach-ebsa110/io.c

@@ -28,7 +28,7 @@
 #include <asm/io.h>
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/page.h>
 
 
-static void __iomem *__isamem_convert_addr(void __iomem *addr)
+static void __iomem *__isamem_convert_addr(const volatile void __iomem *addr)
 {
 {
 	u32 ret, a = (u32 __force) addr;
 	u32 ret, a = (u32 __force) addr;
 
 
@@ -63,7 +63,7 @@ static void __iomem *__isamem_convert_addr(void __iomem *addr)
 /*
 /*
  * read[bwl] and write[bwl]
  * read[bwl] and write[bwl]
  */
  */
-u8 __readb(void __iomem *addr)
+u8 __readb(const volatile void __iomem *addr)
 {
 {
 	void __iomem *a = __isamem_convert_addr(addr);
 	void __iomem *a = __isamem_convert_addr(addr);
 	u32 ret;
 	u32 ret;
@@ -75,7 +75,7 @@ u8 __readb(void __iomem *addr)
 	return ret;
 	return ret;
 }
 }
 
 
-u16 __readw(void __iomem *addr)
+u16 __readw(const volatile void __iomem *addr)
 {
 {
 	void __iomem *a = __isamem_convert_addr(addr);
 	void __iomem *a = __isamem_convert_addr(addr);
 
 
@@ -85,7 +85,7 @@ u16 __readw(void __iomem *addr)
 	return __raw_readw(a);
 	return __raw_readw(a);
 }
 }
 
 
-u32 __readl(void __iomem *addr)
+u32 __readl(const volatile void __iomem *addr)
 {
 {
 	void __iomem *a = __isamem_convert_addr(addr);
 	void __iomem *a = __isamem_convert_addr(addr);
 	u32 ret;
 	u32 ret;

+ 3 - 0
arch/arm/mm/consistent.c

@@ -476,6 +476,9 @@ core_initcall(consistent_init);
 
 
 /*
 /*
  * Make an area consistent for devices.
  * Make an area consistent for devices.
+ * Note: Drivers should NOT use this function directly, as it will break
+ * platforms with CONFIG_DMABOUNCE.
+ * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
  */
  */
 void consistent_sync(void *vaddr, size_t size, int direction)
 void consistent_sync(void *vaddr, size_t size, int direction)
 {
 {

+ 21 - 1
arch/mips/mm/c-sb1.c

@@ -19,6 +19,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
  */
 #include <linux/init.h>
 #include <linux/init.h>
+#include <linux/hardirq.h>
 
 
 #include <asm/asm.h>
 #include <asm/asm.h>
 #include <asm/bootinfo.h>
 #include <asm/bootinfo.h>
@@ -242,6 +243,25 @@ void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsign
 	__attribute__((alias("local_sb1_flush_cache_page")));
 	__attribute__((alias("local_sb1_flush_cache_page")));
 #endif
 #endif
 
 
+#ifdef CONFIG_SMP
+static void sb1_flush_cache_data_page_ipi(void *info)
+{
+	unsigned long start = (unsigned long)info;
+
+	__sb1_writeback_inv_dcache_range(start, start + PAGE_SIZE);
+}
+
+static void sb1_flush_cache_data_page(unsigned long addr)
+{
+	if (in_atomic())
+		__sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
+	else
+		on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1);
+}
+#else
+void sb1_flush_cache_data_page(unsigned long)
+	__attribute__((alias("local_sb1_flush_cache_data_page")));
+#endif
 
 
 /*
 /*
  * Invalidate all caches on this CPU
  * Invalidate all caches on this CPU
@@ -481,7 +501,7 @@ void sb1_cache_init(void)
 
 
 	flush_cache_sigtramp = sb1_flush_cache_sigtramp;
 	flush_cache_sigtramp = sb1_flush_cache_sigtramp;
 	local_flush_data_cache_page = (void *) sb1_nop;
 	local_flush_data_cache_page = (void *) sb1_nop;
-	flush_data_cache_page = (void *) sb1_nop;
+	flush_data_cache_page = sb1_flush_cache_data_page;
 
 
 	/* Full flush */
 	/* Full flush */
 	__flush_cache_all = sb1___flush_cache_all;
 	__flush_cache_all = sb1___flush_cache_all;

+ 0 - 42
arch/powerpc/kernel/time.c

@@ -1014,48 +1014,6 @@ void __init time_init(void)
 	set_dec(tb_ticks_per_jiffy);
 	set_dec(tb_ticks_per_jiffy);
 }
 }
 
 
-#ifdef CONFIG_RTC_CLASS
-static int set_rtc_class_time(struct rtc_time *tm)
-{
-	int err;
-	struct class_device *class_dev =
-		rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
-
-	if (class_dev == NULL)
-		return -ENODEV;
-
-	err = rtc_set_time(class_dev, tm);
-
-	rtc_class_close(class_dev);
-
-	return 0;
-}
-
-static void get_rtc_class_time(struct rtc_time *tm)
-{
-	int err;
-	struct class_device *class_dev =
-		rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
-
-	if (class_dev == NULL)
-		return;
-
-	err = rtc_read_time(class_dev, tm);
-
-	rtc_class_close(class_dev);
-
-	return;
-}
-
-int __init rtc_class_hookup(void)
-{
-	ppc_md.get_rtc_time = get_rtc_class_time;
-	ppc_md.set_rtc_time = set_rtc_class_time;
-
-	return 0;
-}
-#endif /* CONFIG_RTC_CLASS */
-
 
 
 #define FEBRUARY	2
 #define FEBRUARY	2
 #define	STARTOFTIME	1970
 #define	STARTOFTIME	1970

+ 19 - 0
arch/powerpc/platforms/83xx/mpc832x_mds.c

@@ -24,6 +24,7 @@
 #include <linux/root_dev.h>
 #include <linux/root_dev.h>
 #include <linux/initrd.h>
 #include <linux/initrd.h>
 
 
+#include <asm/of_device.h>
 #include <asm/system.h>
 #include <asm/system.h>
 #include <asm/atomic.h>
 #include <asm/atomic.h>
 #include <asm/time.h>
 #include <asm/time.h>
@@ -136,6 +137,24 @@ static void __init mpc832x_sys_setup_arch(void)
 #endif
 #endif
 }
 }
 
 
+static int __init mpc832x_declare_of_platform_devices(void)
+{
+	struct device_node *np;
+
+	for (np = NULL; (np = of_find_compatible_node(np, "network",
+					"ucc_geth")) != NULL;) {
+		int ucc_num;
+		char bus_id[BUS_ID_SIZE];
+
+		ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1;
+		snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num);
+		of_platform_device_create(np, bus_id, NULL);
+	}
+
+	return 0;
+}
+device_initcall(mpc832x_declare_of_platform_devices);
+
 void __init mpc832x_sys_init_IRQ(void)
 void __init mpc832x_sys_init_IRQ(void)
 {
 {
 
 

+ 0 - 4
arch/powerpc/platforms/83xx/mpc834x_itx.c

@@ -108,10 +108,6 @@ static int __init mpc834x_itx_probe(void)
 	return 1;
 	return 1;
 }
 }
 
 
-#ifdef CONFIG_RTC_CLASS
-late_initcall(rtc_class_hookup);
-#endif
-
 define_machine(mpc834x_itx) {
 define_machine(mpc834x_itx) {
 	.name			= "MPC834x ITX",
 	.name			= "MPC834x ITX",
 	.probe			= mpc834x_itx_probe,
 	.probe			= mpc834x_itx_probe,

+ 2 - 0
arch/um/include/os.h

@@ -233,6 +233,8 @@ extern unsigned long __do_user_copy(void *to, const void *from, int n,
 				    void (*op)(void *to, const void *from,
 				    void (*op)(void *to, const void *from,
 					       int n), int *faulted_out);
 					       int n), int *faulted_out);
 
 
+/* execvp.c */
+extern int execvp_noalloc(char *buf, const char *file, char *const argv[]);
 /* helper.c */
 /* helper.c */
 extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
 extern int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
 		      unsigned long *stack_out);
 		      unsigned long *stack_out);

+ 5 - 5
arch/um/os-Linux/Makefile

@@ -3,8 +3,8 @@
 # Licensed under the GPL
 # Licensed under the GPL
 #
 #
 
 
-obj-y = aio.o elf_aux.o file.o helper.o irq.o main.o mem.o process.o sigio.o \
-	signal.o start_up.o time.o trap.o tty.o uaccess.o umid.o tls.o \
+obj-y = aio.o elf_aux.o execvp.o file.o helper.o irq.o main.o mem.o process.o \
+	sigio.o signal.o start_up.o time.o trap.o tty.o uaccess.o umid.o tls.o \
 	user_syms.o util.o drivers/ sys-$(SUBARCH)/
 	user_syms.o util.o drivers/ sys-$(SUBARCH)/
 
 
 obj-$(CONFIG_MODE_SKAS) += skas/
 obj-$(CONFIG_MODE_SKAS) += skas/
@@ -15,9 +15,9 @@ user-objs-$(CONFIG_MODE_TT) += tt.o
 obj-$(CONFIG_TTY_LOG) += tty_log.o
 obj-$(CONFIG_TTY_LOG) += tty_log.o
 user-objs-$(CONFIG_TTY_LOG) += tty_log.o
 user-objs-$(CONFIG_TTY_LOG) += tty_log.o
 
 
-USER_OBJS := $(user-objs-y) aio.o elf_aux.o file.o helper.o irq.o main.o mem.o \
-	process.o sigio.o signal.o start_up.o time.o trap.o tty.o tls.o \
-	uaccess.o umid.o util.o
+USER_OBJS := $(user-objs-y) aio.o elf_aux.o execvp.o file.o helper.o irq.o \
+	main.o mem.o process.o sigio.o signal.o start_up.o time.o trap.o tty.o \
+	tls.o uaccess.o umid.o util.o
 
 
 CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
 CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
 
 

+ 149 - 0
arch/um/os-Linux/execvp.c

@@ -0,0 +1,149 @@
+/* Copyright (C) 2006 by Paolo Giarrusso - modified from glibc' execvp.c.
+   Original copyright notice follows:
+
+   Copyright (C) 1991,92,1995-99,2002,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+#include <unistd.h>
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+
+#ifndef TEST
+#include "um_malloc.h"
+#else
+#include <stdio.h>
+#define um_kmalloc malloc
+#endif
+#include "os.h"
+
+/* Execute FILE, searching in the `PATH' environment variable if it contains
+   no slashes, with arguments ARGV and environment from `environ'.  */
+int execvp_noalloc(char *buf, const char *file, char *const argv[])
+{
+	if (*file == '\0') {
+		return -ENOENT;
+	}
+
+	if (strchr (file, '/') != NULL) {
+		/* Don't search when it contains a slash.  */
+		execv(file, argv);
+	} else {
+		int got_eacces;
+		size_t len, pathlen;
+		char *name, *p;
+		char *path = getenv("PATH");
+		if (path == NULL)
+			path = ":/bin:/usr/bin";
+
+		len = strlen(file) + 1;
+		pathlen = strlen(path);
+		/* Copy the file name at the top.  */
+		name = memcpy(buf + pathlen + 1, file, len);
+		/* And add the slash.  */
+		*--name = '/';
+
+		got_eacces = 0;
+		p = path;
+		do {
+			char *startp;
+
+			path = p;
+			//Let's avoid this GNU extension.
+			//p = strchrnul (path, ':');
+			p = strchr(path, ':');
+			if (!p)
+				p = strchr(path, '\0');
+
+			if (p == path)
+				/* Two adjacent colons, or a colon at the beginning or the end
+				   of `PATH' means to search the current directory.  */
+				startp = name + 1;
+			else
+				startp = memcpy(name - (p - path), path, p - path);
+
+			/* Try to execute this name.  If it works, execv will not return.  */
+			execv(startp, argv);
+
+			/*
+			if (errno == ENOEXEC) {
+			}
+			*/
+
+			switch (errno) {
+				case EACCES:
+					/* Record the we got a `Permission denied' error.  If we end
+					   up finding no executable we can use, we want to diagnose
+					   that we did find one but were denied access.  */
+					got_eacces = 1;
+				case ENOENT:
+				case ESTALE:
+				case ENOTDIR:
+					/* Those errors indicate the file is missing or not executable
+					   by us, in which case we want to just try the next path
+					   directory.  */
+				case ENODEV:
+				case ETIMEDOUT:
+					/* Some strange filesystems like AFS return even
+					   stranger error numbers.  They cannot reasonably mean
+					   anything else so ignore those, too.  */
+				case ENOEXEC:
+					/* We won't go searching for the shell
+					 * if it is not executable - the Linux
+					 * kernel already handles this enough,
+					 * for us. */
+					break;
+
+				default:
+					/* Some other error means we found an executable file, but
+					   something went wrong executing it; return the error to our
+					   caller.  */
+					return -errno;
+			}
+		} while (*p++ != '\0');
+
+		/* We tried every element and none of them worked.  */
+		if (got_eacces)
+			/* At least one failure was due to permissions, so report that
+			   error.  */
+			return -EACCES;
+	}
+
+	/* Return the error from the last attempt (probably ENOENT).  */
+	return -errno;
+}
+#ifdef TEST
+int main(int argc, char**argv)
+{
+	char buf[PATH_MAX];
+	int ret;
+	argc--;
+	if (!argc) {
+		fprintf(stderr, "Not enough arguments\n");
+		return 1;
+	}
+	argv++;
+	if (ret = execvp_noalloc(buf, argv[0], argv)) {
+		errno = -ret;
+		perror("execvp_noalloc");
+	}
+	return 0;
+}
+#endif

+ 10 - 4
arch/um/os-Linux/helper.c

@@ -8,18 +8,21 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <errno.h>
 #include <errno.h>
 #include <sched.h>
 #include <sched.h>
+#include <limits.h>
 #include <sys/signal.h>
 #include <sys/signal.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 #include "user.h"
 #include "user.h"
 #include "kern_util.h"
 #include "kern_util.h"
 #include "user_util.h"
 #include "user_util.h"
 #include "os.h"
 #include "os.h"
+#include "um_malloc.h"
 
 
 struct helper_data {
 struct helper_data {
 	void (*pre_exec)(void*);
 	void (*pre_exec)(void*);
 	void *pre_data;
 	void *pre_data;
 	char **argv;
 	char **argv;
 	int fd;
 	int fd;
+	char *buf;
 };
 };
 
 
 /* Debugging aid, changed only from gdb */
 /* Debugging aid, changed only from gdb */
@@ -41,9 +44,8 @@ static int helper_child(void *arg)
 	}
 	}
 	if (data->pre_exec != NULL)
 	if (data->pre_exec != NULL)
 		(*data->pre_exec)(data->pre_data);
 		(*data->pre_exec)(data->pre_data);
-	execvp(argv[0], argv);
-	errval = -errno;
-	printk("helper_child - execve of '%s' failed - errno = %d\n", argv[0], errno);
+	errval = execvp_noalloc(data->buf, argv[0], argv);
+	printk("helper_child - execvp of '%s' failed - errno = %d\n", argv[0], -errval);
 	os_write_file(data->fd, &errval, sizeof(errval));
 	os_write_file(data->fd, &errval, sizeof(errval));
 	kill(os_getpid(), SIGKILL);
 	kill(os_getpid(), SIGKILL);
 	return 0;
 	return 0;
@@ -84,11 +86,13 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
 	data.pre_data = pre_data;
 	data.pre_data = pre_data;
 	data.argv = argv;
 	data.argv = argv;
 	data.fd = fds[1];
 	data.fd = fds[1];
+	data.buf = __cant_sleep() ? um_kmalloc_atomic(PATH_MAX) :
+					um_kmalloc(PATH_MAX);
 	pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data);
 	pid = clone(helper_child, (void *) sp, CLONE_VM | SIGCHLD, &data);
 	if (pid < 0) {
 	if (pid < 0) {
 		ret = -errno;
 		ret = -errno;
 		printk("run_helper : clone failed, errno = %d\n", errno);
 		printk("run_helper : clone failed, errno = %d\n", errno);
-		goto out_close;
+		goto out_free2;
 	}
 	}
 
 
 	close(fds[1]);
 	close(fds[1]);
@@ -109,6 +113,8 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
 		CATCH_EINTR(waitpid(pid, NULL, 0));
 		CATCH_EINTR(waitpid(pid, NULL, 0));
 	}
 	}
 
 
+out_free2:
+	kfree(data.buf);
 out_close:
 out_close:
 	if (fds[1] != -1)
 	if (fds[1] != -1)
 		close(fds[1]);
 		close(fds[1]);

+ 1 - 3
drivers/acpi/processor_perflib.c

@@ -83,10 +83,8 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
 		goto out;
 		goto out;
 
 
 	ppc = (unsigned int)pr->performance_platform_limit;
 	ppc = (unsigned int)pr->performance_platform_limit;
-	if (!ppc)
-		goto out;
 
 
-	if (ppc > pr->performance->state_count)
+	if (ppc >= pr->performance->state_count)
 		goto out;
 		goto out;
 
 
 	cpufreq_verify_within_limits(policy, 0,
 	cpufreq_verify_within_limits(policy, 0,

+ 3 - 1
drivers/base/core.c

@@ -591,8 +591,10 @@ void device_del(struct device * dev)
 
 
 	if (parent)
 	if (parent)
 		klist_del(&dev->knode_parent);
 		klist_del(&dev->knode_parent);
-	if (dev->devt_attr)
+	if (dev->devt_attr) {
 		device_remove_file(dev, dev->devt_attr);
 		device_remove_file(dev, dev->devt_attr);
+		kfree(dev->devt_attr);
+	}
 	if (dev->class) {
 	if (dev->class) {
 		sysfs_remove_link(&dev->kobj, "subsystem");
 		sysfs_remove_link(&dev->kobj, "subsystem");
 		sysfs_remove_link(&dev->class->subsys.kset.kobj, dev->bus_id);
 		sysfs_remove_link(&dev->class->subsys.kset.kobj, dev->bus_id);

+ 1 - 1
drivers/char/agp/generic.c

@@ -1054,7 +1054,7 @@ void *agp_generic_alloc_page(struct agp_bridge_data *bridge)
 {
 {
 	struct page * page;
 	struct page * page;
 
 
-	page = alloc_page(GFP_KERNEL);
+	page = alloc_page(GFP_KERNEL | GFP_DMA32);
 	if (page == NULL)
 	if (page == NULL)
 		return NULL;
 		return NULL;
 
 

+ 25 - 8
drivers/char/agp/intel-agp.c

@@ -169,7 +169,7 @@ static void *i8xx_alloc_pages(void)
 {
 {
 	struct page * page;
 	struct page * page;
 
 
-	page = alloc_pages(GFP_KERNEL, 2);
+	page = alloc_pages(GFP_KERNEL | GFP_DMA32, 2);
 	if (page == NULL)
 	if (page == NULL)
 		return NULL;
 		return NULL;
 
 
@@ -387,11 +387,7 @@ static void intel_i830_init_gtt_entries(void)
 	/* We obtain the size of the GTT, which is also stored (for some
 	/* We obtain the size of the GTT, which is also stored (for some
 	 * reason) at the top of stolen memory. Then we add 4KB to that
 	 * reason) at the top of stolen memory. Then we add 4KB to that
 	 * for the video BIOS popup, which is also stored in there. */
 	 * for the video BIOS popup, which is also stored in there. */
-
-	if (IS_I965)
-		size = 512 + 4;
-	else
-		size = agp_bridge->driver->fetch_size() + 4;
+	size = agp_bridge->driver->fetch_size() + 4;
 
 
 	if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82830_HB ||
 	if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82830_HB ||
 	    agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) {
 	    agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) {
@@ -805,6 +801,26 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
 
 
 	return 0;
 	return 0;
 }
 }
+
+/*
+ * The i965 supports 36-bit physical addresses, but to keep
+ * the format of the GTT the same, the bits that don't fit
+ * in a 32-bit word are shifted down to bits 4..7.
+ *
+ * Gcc is smart enough to notice that "(addr >> 28) & 0xf0"
+ * is always zero on 32-bit architectures, so no need to make
+ * this conditional.
+ */
+static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge,
+	unsigned long addr, int type)
+{
+	/* Shift high bits down */
+	addr |= (addr >> 28) & 0xf0;
+
+	/* Type checking must be done elsewhere */
+	return addr | bridge->driver->masks[type].mask;
+}
+
 static int intel_i965_fetch_size(void)
 static int intel_i965_fetch_size(void)
 {
 {
        struct aper_size_info_fixed *values;
        struct aper_size_info_fixed *values;
@@ -832,7 +848,8 @@ static int intel_i965_fetch_size(void)
 
 
        agp_bridge->previous_size = agp_bridge->current_size = (void *)(values + offset);
        agp_bridge->previous_size = agp_bridge->current_size = (void *)(values + offset);
 
 
-       return values[offset].size;
+	/* The i965 GTT is always sized as if it had a 512kB aperture size */
+	return 512;
 }
 }
 
 
 /* The intel i965 automatically initializes the agp aperture during POST.
 /* The intel i965 automatically initializes the agp aperture during POST.
@@ -1584,7 +1601,7 @@ static struct agp_bridge_driver intel_i965_driver = {
        .fetch_size             = intel_i965_fetch_size,
        .fetch_size             = intel_i965_fetch_size,
        .cleanup                = intel_i915_cleanup,
        .cleanup                = intel_i915_cleanup,
        .tlb_flush              = intel_i810_tlbflush,
        .tlb_flush              = intel_i810_tlbflush,
-       .mask_memory            = intel_i810_mask_memory,
+       .mask_memory            = intel_i965_mask_memory,
        .masks                  = intel_i810_masks,
        .masks                  = intel_i810_masks,
        .agp_enable             = intel_i810_agp_enable,
        .agp_enable             = intel_i810_agp_enable,
        .cache_flush            = global_cache_flush,
        .cache_flush            = global_cache_flush,

+ 2 - 3
drivers/char/tlclk.c

@@ -792,15 +792,14 @@ static int __init tlclk_init(void)
 	ret = misc_register(&tlclk_miscdev);
 	ret = misc_register(&tlclk_miscdev);
 	if (ret < 0) {
 	if (ret < 0) {
 		printk(KERN_ERR "tlclk: misc_register returns %d.\n", ret);
 		printk(KERN_ERR "tlclk: misc_register returns %d.\n", ret);
-		ret = -EBUSY;
 		goto out3;
 		goto out3;
 	}
 	}
 
 
 	tlclk_device = platform_device_register_simple("telco_clock",
 	tlclk_device = platform_device_register_simple("telco_clock",
 				-1, NULL, 0);
 				-1, NULL, 0);
-	if (!tlclk_device) {
+	if (IS_ERR(tlclk_device)) {
 		printk(KERN_ERR "tlclk: platform_device_register failed.\n");
 		printk(KERN_ERR "tlclk: platform_device_register failed.\n");
-		ret = -EBUSY;
+		ret = PTR_ERR(tlclk_device);
 		goto out4;
 		goto out4;
 	}
 	}
 
 

+ 1 - 0
drivers/cpufreq/Kconfig

@@ -107,6 +107,7 @@ config CPU_FREQ_GOV_USERSPACE
 
 
 config CPU_FREQ_GOV_ONDEMAND
 config CPU_FREQ_GOV_ONDEMAND
 	tristate "'ondemand' cpufreq policy governor"
 	tristate "'ondemand' cpufreq policy governor"
+	select CPU_FREQ_TABLE
 	help
 	help
 	  'ondemand' - This driver adds a dynamic cpufreq policy governor.
 	  'ondemand' - This driver adds a dynamic cpufreq policy governor.
 	  The governor does a periodic polling and 
 	  The governor does a periodic polling and 

+ 1 - 1
drivers/i2c/busses/i2c-ixp4xx.c

@@ -138,7 +138,7 @@ static int ixp4xx_i2c_probe(struct platform_device *plat_dev)
 	gpio_line_set(gpio->sda_pin, 0);
 	gpio_line_set(gpio->sda_pin, 0);
 
 
 	err = i2c_bit_add_bus(&drv_data->adapter);
 	err = i2c_bit_add_bus(&drv_data->adapter);
-	if (err != 0)
+	if (err) {
 		printk(KERN_ERR "ERROR: Could not install %s\n", plat_dev->dev.bus_id);
 		printk(KERN_ERR "ERROR: Could not install %s\n", plat_dev->dev.bus_id);
 
 
 		kfree(drv_data);
 		kfree(drv_data);

+ 0 - 7
drivers/ide/pci/sgiioc4.c

@@ -768,14 +768,7 @@ ioc4_ide_init(void)
 	return ioc4_register_submodule(&ioc4_ide_submodule);
 	return ioc4_register_submodule(&ioc4_ide_submodule);
 }
 }
 
 
-static void __devexit
-ioc4_ide_exit(void)
-{
-	ioc4_unregister_submodule(&ioc4_ide_submodule);
-}
-
 late_initcall(ioc4_ide_init); /* Call only after IDE init is done */
 late_initcall(ioc4_ide_init); /* Call only after IDE init is done */
-module_exit(ioc4_ide_exit);
 
 
 MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon");
 MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon");
 MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card");
 MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card");

+ 1 - 1
drivers/media/dvb/dvb-core/dvb_frontend.c

@@ -348,7 +348,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
 
 
 static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
 {
 {
-	fe_status_t s;
+	fe_status_t s = 0;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
 
 	/* if we've got no parameters, just keep idling */
 	/* if we've got no parameters, just keep idling */

+ 4 - 0
drivers/media/dvb/frontends/tda10086.c

@@ -441,6 +441,10 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
 
 
 	dprintk ("%s\n", __FUNCTION__);
 	dprintk ("%s\n", __FUNCTION__);
 
 
+	// check for invalid symbol rate
+	if (fe_params->u.qpsk.symbol_rate < 500000)
+		return -EINVAL;
+
 	// calculate the updated frequency (note: we convert from Hz->kHz)
 	// calculate the updated frequency (note: we convert from Hz->kHz)
 	tmp64 = tda10086_read_byte(state, 0x52);
 	tmp64 = tda10086_read_byte(state, 0x52);
 	tmp64 |= (tda10086_read_byte(state, 0x51) << 8);
 	tmp64 |= (tda10086_read_byte(state, 0x51) << 8);

+ 9 - 0
drivers/media/dvb/ttpci/budget.c

@@ -46,6 +46,10 @@
 #include "lnbp21.h"
 #include "lnbp21.h"
 #include "bsru6.h"
 #include "bsru6.h"
 
 
+static int diseqc_method;
+module_param(diseqc_method, int, 0444);
+MODULE_PARM_DESC(diseqc_method, "Select DiSEqC method for subsystem id 13c2:1003, 0: default, 1: more reliable (for newer revisions only)");
+
 static void Set22K (struct budget *budget, int state)
 static void Set22K (struct budget *budget, int state)
 {
 {
 	struct saa7146_dev *dev=budget->dev;
 	struct saa7146_dev *dev=budget->dev;
@@ -382,6 +386,11 @@ static void frontend_init(struct budget *budget)
 		if (budget->dvb_frontend) {
 		if (budget->dvb_frontend) {
 			budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
 			budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
 			budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
 			budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
+			if (budget->dev->pci->subsystem_device == 0x1003 && diseqc_method == 0) {
+				budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
+				budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst;
+				budget->dvb_frontend->ops.set_tone = budget_set_tone;
+			}
 			break;
 			break;
 		}
 		}
 		break;
 		break;

+ 1 - 2
drivers/media/video/et61x251/et61x251_core.c

@@ -1182,8 +1182,6 @@ static void et61x251_release_resources(struct et61x251_device* cam)
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_unregister_device(cam->v4ldev);
 	video_unregister_device(cam->v4ldev);
 
 
-	usb_put_dev(cam->usbdev);
-
 	mutex_unlock(&et61x251_sysfs_lock);
 	mutex_unlock(&et61x251_sysfs_lock);
 
 
 	kfree(cam->control_buffer);
 	kfree(cam->control_buffer);
@@ -1275,6 +1273,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
 
 
 	if (cam->state & DEV_DISCONNECTED) {
 	if (cam->state & DEV_DISCONNECTED) {
 		et61x251_release_resources(cam);
 		et61x251_release_resources(cam);
+		usb_put_dev(cam->usbdev);
 		mutex_unlock(&cam->dev_mutex);
 		mutex_unlock(&cam->dev_mutex);
 		kfree(cam);
 		kfree(cam);
 		return 0;
 		return 0;

+ 3 - 1
drivers/media/video/saa6588.c

@@ -212,8 +212,10 @@ static void read_from_buf(struct saa6588 *s, struct rds_command *a)
 	if (rd_blocks > s->block_count)
 	if (rd_blocks > s->block_count)
 		rd_blocks = s->block_count;
 		rd_blocks = s->block_count;
 
 
-	if (!rd_blocks)
+	if (!rd_blocks) {
+		spin_unlock_irqrestore(&s->lock, flags);
 		return;
 		return;
+	}
 
 
 	for (i = 0; i < rd_blocks; i++) {
 	for (i = 0; i < rd_blocks; i++) {
 		if (block_to_user_buf(s, buf_ptr)) {
 		if (block_to_user_buf(s, buf_ptr)) {

+ 7 - 2
drivers/media/video/saa7115.c

@@ -1464,8 +1464,6 @@ static int saa711x_attach(struct i2c_adapter *adapter, int address, int kind)
 	client->driver = &i2c_driver_saa711x;
 	client->driver = &i2c_driver_saa711x;
 	snprintf(client->name, sizeof(client->name) - 1, "saa7115");
 	snprintf(client->name, sizeof(client->name) - 1, "saa7115");
 
 
-	v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1);
-
 	for (i=0;i<0x0f;i++) {
 	for (i=0;i<0x0f;i++) {
 		saa711x_write(client, 0, i);
 		saa711x_write(client, 0, i);
 		name[i] = (saa711x_read(client, 0) &0x0f) +'0';
 		name[i] = (saa711x_read(client, 0) &0x0f) +'0';
@@ -1477,6 +1475,13 @@ static int saa711x_attach(struct i2c_adapter *adapter, int address, int kind)
 	saa711x_write(client, 0, 5);
 	saa711x_write(client, 0, 5);
 	chip_id = saa711x_read(client, 0) & 0x0f;
 	chip_id = saa711x_read(client, 0) & 0x0f;
 
 
+	/* Check whether this chip is part of the saa711x series */
+	if (memcmp(name, "1f711", 5)) {
+		v4l_dbg(1, debug, client, "chip found @ 0x%x (ID %s) does not match a known saa711x chip.\n",
+			address << 1, name);
+		return 0;
+	}
+
 	snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id);
 	snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id);
 	v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, address << 1, adapter->name);
 	v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, address << 1, adapter->name);
 
 

+ 1 - 2
drivers/media/video/sn9c102/sn9c102_core.c

@@ -1462,8 +1462,6 @@ static void sn9c102_release_resources(struct sn9c102_device* cam)
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_unregister_device(cam->v4ldev);
 	video_unregister_device(cam->v4ldev);
 
 
-	usb_put_dev(cam->usbdev);
-
 	mutex_unlock(&sn9c102_sysfs_lock);
 	mutex_unlock(&sn9c102_sysfs_lock);
 
 
 	kfree(cam->control_buffer);
 	kfree(cam->control_buffer);
@@ -1555,6 +1553,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
 
 
 	if (cam->state & DEV_DISCONNECTED) {
 	if (cam->state & DEV_DISCONNECTED) {
 		sn9c102_release_resources(cam);
 		sn9c102_release_resources(cam);
+		usb_put_dev(cam->usbdev);
 		mutex_unlock(&cam->dev_mutex);
 		mutex_unlock(&cam->dev_mutex);
 		kfree(cam);
 		kfree(cam);
 		return 0;
 		return 0;

+ 1 - 1
drivers/net/hamradio/6pack.c

@@ -914,7 +914,7 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd)
 					printk(KERN_DEBUG "6pack: protocol violation\n");
 					printk(KERN_DEBUG "6pack: protocol violation\n");
 				else
 				else
 					sp->status = 0;
 					sp->status = 0;
-				cmd &= !SIXP_RX_DCD_MASK;
+				cmd &= ~SIXP_RX_DCD_MASK;
 		}
 		}
 		sp->status = cmd & SIXP_PRIO_DATA_MASK;
 		sp->status = cmd & SIXP_PRIO_DATA_MASK;
 	} else { /* output watchdog char if idle */
 	} else { /* output watchdog char if idle */

+ 3 - 1
drivers/net/tg3.c

@@ -6979,8 +6979,10 @@ static int tg3_open(struct net_device *dev)
 	tg3_full_lock(tp, 0);
 	tg3_full_lock(tp, 0);
 
 
 	err = tg3_set_power_state(tp, PCI_D0);
 	err = tg3_set_power_state(tp, PCI_D0);
-	if (err)
+	if (err) {
+		tg3_full_unlock(tp);
 		return err;
 		return err;
+	}
 
 
 	tg3_disable_ints(tp);
 	tg3_disable_ints(tp);
 	tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
 	tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;

+ 2 - 0
drivers/pcmcia/ds.c

@@ -1272,7 +1272,9 @@ static void pcmcia_bus_remove_socket(struct class_device *class_dev,
 	pccard_register_pcmcia(socket, NULL);
 	pccard_register_pcmcia(socket, NULL);
 
 
 	/* unregister any unbound devices */
 	/* unregister any unbound devices */
+	mutex_lock(&socket->skt_mutex);
 	pcmcia_card_remove(socket, NULL);
 	pcmcia_card_remove(socket, NULL);
+	mutex_unlock(&socket->skt_mutex);
 
 
 	pcmcia_put_socket(socket);
 	pcmcia_put_socket(socket);
 
 

+ 12 - 4
drivers/rtc/interface.c

@@ -145,6 +145,13 @@ int rtc_set_alarm(struct class_device *class_dev, struct rtc_wkalrm *alarm)
 }
 }
 EXPORT_SYMBOL_GPL(rtc_set_alarm);
 EXPORT_SYMBOL_GPL(rtc_set_alarm);
 
 
+/**
+ * rtc_update_irq - report RTC periodic, alarm, and/or update irqs
+ * @class_dev: the rtc's class device
+ * @num: how many irqs are being reported (usually one)
+ * @events: mask of RTC_IRQF with one or more of RTC_PF, RTC_AF, RTC_UF
+ * Context: in_interrupt(), irqs blocked
+ */
 void rtc_update_irq(struct class_device *class_dev,
 void rtc_update_irq(struct class_device *class_dev,
 		unsigned long num, unsigned long events)
 		unsigned long num, unsigned long events)
 {
 {
@@ -201,12 +208,12 @@ int rtc_irq_register(struct class_device *class_dev, struct rtc_task *task)
 	if (task == NULL || task->func == NULL)
 	if (task == NULL || task->func == NULL)
 		return -EINVAL;
 		return -EINVAL;
 
 
-	spin_lock(&rtc->irq_task_lock);
+	spin_lock_irq(&rtc->irq_task_lock);
 	if (rtc->irq_task == NULL) {
 	if (rtc->irq_task == NULL) {
 		rtc->irq_task = task;
 		rtc->irq_task = task;
 		retval = 0;
 		retval = 0;
 	}
 	}
-	spin_unlock(&rtc->irq_task_lock);
+	spin_unlock_irq(&rtc->irq_task_lock);
 
 
 	return retval;
 	return retval;
 }
 }
@@ -216,10 +223,10 @@ void rtc_irq_unregister(struct class_device *class_dev, struct rtc_task *task)
 {
 {
 	struct rtc_device *rtc = to_rtc_device(class_dev);
 	struct rtc_device *rtc = to_rtc_device(class_dev);
 
 
-	spin_lock(&rtc->irq_task_lock);
+	spin_lock_irq(&rtc->irq_task_lock);
 	if (rtc->irq_task == task)
 	if (rtc->irq_task == task)
 		rtc->irq_task = NULL;
 		rtc->irq_task = NULL;
-	spin_unlock(&rtc->irq_task_lock);
+	spin_unlock_irq(&rtc->irq_task_lock);
 }
 }
 EXPORT_SYMBOL_GPL(rtc_irq_unregister);
 EXPORT_SYMBOL_GPL(rtc_irq_unregister);
 
 
@@ -265,3 +272,4 @@ int rtc_irq_set_freq(struct class_device *class_dev, struct rtc_task *task, int
 	}
 	}
 	return err;
 	return err;
 }
 }
+EXPORT_SYMBOL_GPL(rtc_irq_set_freq);

+ 2 - 1
drivers/rtc/rtc-at91.c

@@ -292,7 +292,8 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
 					AT91_RTC_CALEV);
 					AT91_RTC_CALEV);
 
 
 	ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
 	ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
-				IRQF_SHARED, "at91_rtc", pdev);
+				IRQF_DISABLED | IRQF_SHARED,
+				"at91_rtc", pdev);
 	if (ret) {
 	if (ret) {
 		printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n",
 		printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n",
 				AT91_ID_SYS);
 				AT91_ID_SYS);

+ 19 - 6
drivers/rtc/rtc-dev.c

@@ -61,7 +61,9 @@ static void rtc_uie_task(void *data)
 	int err;
 	int err;
 
 
 	err = rtc_read_time(&rtc->class_dev, &tm);
 	err = rtc_read_time(&rtc->class_dev, &tm);
-	spin_lock_irq(&rtc->irq_lock);
+
+	local_irq_disable();
+	spin_lock(&rtc->irq_lock);
 	if (rtc->stop_uie_polling || err) {
 	if (rtc->stop_uie_polling || err) {
 		rtc->uie_task_active = 0;
 		rtc->uie_task_active = 0;
 	} else if (rtc->oldsecs != tm.tm_sec) {
 	} else if (rtc->oldsecs != tm.tm_sec) {
@@ -74,11 +76,11 @@ static void rtc_uie_task(void *data)
 	} else if (schedule_work(&rtc->uie_task) == 0) {
 	} else if (schedule_work(&rtc->uie_task) == 0) {
 		rtc->uie_task_active = 0;
 		rtc->uie_task_active = 0;
 	}
 	}
-	spin_unlock_irq(&rtc->irq_lock);
+	spin_unlock(&rtc->irq_lock);
 	if (num)
 	if (num)
 		rtc_update_irq(&rtc->class_dev, num, RTC_UF | RTC_IRQF);
 		rtc_update_irq(&rtc->class_dev, num, RTC_UF | RTC_IRQF);
+	local_irq_enable();
 }
 }
-
 static void rtc_uie_timer(unsigned long data)
 static void rtc_uie_timer(unsigned long data)
 {
 {
 	struct rtc_device *rtc = (struct rtc_device *)data;
 	struct rtc_device *rtc = (struct rtc_device *)data;
@@ -214,7 +216,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
 	struct rtc_wkalrm alarm;
 	struct rtc_wkalrm alarm;
 	void __user *uarg = (void __user *) arg;
 	void __user *uarg = (void __user *) arg;
 
 
-	/* check that the calles has appropriate permissions
+	/* check that the calling task has appropriate permissions
 	 * for certain ioctls. doing this check here is useful
 	 * for certain ioctls. doing this check here is useful
 	 * to avoid duplicate code in each driver.
 	 * to avoid duplicate code in each driver.
 	 */
 	 */
@@ -238,10 +240,10 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
 
 
 	/* avoid conflicting IRQ users */
 	/* avoid conflicting IRQ users */
 	if (cmd == RTC_PIE_ON || cmd == RTC_PIE_OFF || cmd == RTC_IRQP_SET) {
 	if (cmd == RTC_PIE_ON || cmd == RTC_PIE_OFF || cmd == RTC_IRQP_SET) {
-		spin_lock(&rtc->irq_task_lock);
+		spin_lock_irq(&rtc->irq_task_lock);
 		if (rtc->irq_task)
 		if (rtc->irq_task)
 			err = -EBUSY;
 			err = -EBUSY;
-		spin_unlock(&rtc->irq_task_lock);
+		spin_unlock_irq(&rtc->irq_task_lock);
 
 
 		if (err < 0)
 		if (err < 0)
 			return err;
 			return err;
@@ -299,6 +301,17 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
 
 
 		err = rtc_set_time(class_dev, &tm);
 		err = rtc_set_time(class_dev, &tm);
 		break;
 		break;
+
+	case RTC_IRQP_READ:
+		if (ops->irq_set_freq)
+			err = put_user(rtc->irq_freq, (unsigned long *) arg);
+		break;
+
+	case RTC_IRQP_SET:
+		if (ops->irq_set_freq)
+			err = rtc_irq_set_freq(class_dev, rtc->irq_task, arg);
+		break;
+
 #if 0
 #if 0
 	case RTC_EPOCH_SET:
 	case RTC_EPOCH_SET:
 #ifndef rtc_epoch
 #ifndef rtc_epoch

+ 2 - 1
drivers/rtc/rtc-ds1553.c

@@ -340,7 +340,8 @@ static int __init ds1553_rtc_probe(struct platform_device *pdev)
 
 
 	if (pdata->irq >= 0) {
 	if (pdata->irq >= 0) {
 		writeb(0, ioaddr + RTC_INTERRUPTS);
 		writeb(0, ioaddr + RTC_INTERRUPTS);
-		if (request_irq(pdata->irq, ds1553_rtc_interrupt, IRQF_SHARED,
+		if (request_irq(pdata->irq, ds1553_rtc_interrupt,
+				IRQF_DISABLED | IRQF_SHARED,
 				pdev->name, pdev) < 0) {
 				pdev->name, pdev) < 0) {
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = -1;
 			pdata->irq = -1;

+ 3 - 3
drivers/rtc/rtc-rs5c372.c

@@ -126,13 +126,13 @@ static int rs5c372_get_trim(struct i2c_client *client, int *osc, int *trim)
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
-	dev_dbg(&client->dev, "%s: raw trim=%x\n", __FUNCTION__, *trim);
-
 	if (osc)
 	if (osc)
 		*osc = (buf & RS5C372_TRIM_XSL) ? 32000 : 32768;
 		*osc = (buf & RS5C372_TRIM_XSL) ? 32000 : 32768;
 
 
-	if (trim)
+	if (trim) {
 		*trim = buf & RS5C372_TRIM_MASK;
 		*trim = buf & RS5C372_TRIM_MASK;
+		dev_dbg(&client->dev, "%s: raw trim=%x\n", __FUNCTION__, *trim);
+	}
 
 
 	return 0;
 	return 0;
 }
 }

+ 2 - 0
drivers/rtc/rtc-test.c

@@ -99,6 +99,7 @@ static ssize_t test_irq_store(struct device *dev,
 	struct rtc_device *rtc = platform_get_drvdata(plat_dev);
 	struct rtc_device *rtc = platform_get_drvdata(plat_dev);
 
 
 	retval = count;
 	retval = count;
+	local_irq_disable();
 	if (strncmp(buf, "tick", 4) == 0)
 	if (strncmp(buf, "tick", 4) == 0)
 		rtc_update_irq(&rtc->class_dev, 1, RTC_PF | RTC_IRQF);
 		rtc_update_irq(&rtc->class_dev, 1, RTC_PF | RTC_IRQF);
 	else if (strncmp(buf, "alarm", 5) == 0)
 	else if (strncmp(buf, "alarm", 5) == 0)
@@ -107,6 +108,7 @@ static ssize_t test_irq_store(struct device *dev,
 		rtc_update_irq(&rtc->class_dev, 1, RTC_UF | RTC_IRQF);
 		rtc_update_irq(&rtc->class_dev, 1, RTC_UF | RTC_IRQF);
 	else
 	else
 		retval = -EINVAL;
 		retval = -EINVAL;
+	local_irq_enable();
 
 
 	return retval;
 	return retval;
 }
 }

+ 4 - 6
drivers/usb/input/ati_remote.c

@@ -636,13 +636,11 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote)
 	if (ati_remote->out_urb)
 	if (ati_remote->out_urb)
 		usb_free_urb(ati_remote->out_urb);
 		usb_free_urb(ati_remote->out_urb);
 
 
-	if (ati_remote->inbuf)
-		usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
-				ati_remote->inbuf, ati_remote->inbuf_dma);
+	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+		ati_remote->inbuf, ati_remote->inbuf_dma);
 
 
-	if (ati_remote->outbuf)
-		usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
-				ati_remote->inbuf, ati_remote->outbuf_dma);
+	usb_buffer_free(ati_remote->udev, DATA_BUFSIZE,
+		ati_remote->outbuf, ati_remote->outbuf_dma);
 }
 }
 
 
 static void ati_remote_input_init(struct ati_remote *ati_remote)
 static void ati_remote_input_init(struct ati_remote *ati_remote)

+ 1 - 0
fs/debugfs/inode.c

@@ -21,6 +21,7 @@
 #include <linux/mount.h>
 #include <linux/mount.h>
 #include <linux/pagemap.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
 #include <linux/init.h>
+#include <linux/kobject.h>
 #include <linux/namei.h>
 #include <linux/namei.h>
 #include <linux/debugfs.h>
 #include <linux/debugfs.h>
 
 

+ 38 - 14
fs/fuse/dir.c

@@ -138,6 +138,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
 		struct fuse_entry_out outarg;
 		struct fuse_entry_out outarg;
 		struct fuse_conn *fc;
 		struct fuse_conn *fc;
 		struct fuse_req *req;
 		struct fuse_req *req;
+		struct fuse_req *forget_req;
 		struct dentry *parent;
 		struct dentry *parent;
 
 
 		/* Doesn't hurt to "reset" the validity timeout */
 		/* Doesn't hurt to "reset" the validity timeout */
@@ -152,25 +153,33 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
 		if (IS_ERR(req))
 		if (IS_ERR(req))
 			return 0;
 			return 0;
 
 
+		forget_req = fuse_get_req(fc);
+		if (IS_ERR(forget_req)) {
+			fuse_put_request(fc, req);
+			return 0;
+		}
+
 		parent = dget_parent(entry);
 		parent = dget_parent(entry);
 		fuse_lookup_init(req, parent->d_inode, entry, &outarg);
 		fuse_lookup_init(req, parent->d_inode, entry, &outarg);
 		request_send(fc, req);
 		request_send(fc, req);
 		dput(parent);
 		dput(parent);
 		err = req->out.h.error;
 		err = req->out.h.error;
+		fuse_put_request(fc, req);
 		/* Zero nodeid is same as -ENOENT */
 		/* Zero nodeid is same as -ENOENT */
 		if (!err && !outarg.nodeid)
 		if (!err && !outarg.nodeid)
 			err = -ENOENT;
 			err = -ENOENT;
 		if (!err) {
 		if (!err) {
 			struct fuse_inode *fi = get_fuse_inode(inode);
 			struct fuse_inode *fi = get_fuse_inode(inode);
 			if (outarg.nodeid != get_node_id(inode)) {
 			if (outarg.nodeid != get_node_id(inode)) {
-				fuse_send_forget(fc, req, outarg.nodeid, 1);
+				fuse_send_forget(fc, forget_req,
+						 outarg.nodeid, 1);
 				return 0;
 				return 0;
 			}
 			}
 			spin_lock(&fc->lock);
 			spin_lock(&fc->lock);
 			fi->nlookup ++;
 			fi->nlookup ++;
 			spin_unlock(&fc->lock);
 			spin_unlock(&fc->lock);
 		}
 		}
-		fuse_put_request(fc, req);
+		fuse_put_request(fc, forget_req);
 		if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT)
 		if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT)
 			return 0;
 			return 0;
 
 
@@ -221,6 +230,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
 	struct inode *inode = NULL;
 	struct inode *inode = NULL;
 	struct fuse_conn *fc = get_fuse_conn(dir);
 	struct fuse_conn *fc = get_fuse_conn(dir);
 	struct fuse_req *req;
 	struct fuse_req *req;
+	struct fuse_req *forget_req;
 
 
 	if (entry->d_name.len > FUSE_NAME_MAX)
 	if (entry->d_name.len > FUSE_NAME_MAX)
 		return ERR_PTR(-ENAMETOOLONG);
 		return ERR_PTR(-ENAMETOOLONG);
@@ -229,9 +239,16 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
 	if (IS_ERR(req))
 	if (IS_ERR(req))
 		return ERR_PTR(PTR_ERR(req));
 		return ERR_PTR(PTR_ERR(req));
 
 
+	forget_req = fuse_get_req(fc);
+	if (IS_ERR(forget_req)) {
+		fuse_put_request(fc, req);
+		return ERR_PTR(PTR_ERR(forget_req));
+	}
+
 	fuse_lookup_init(req, dir, entry, &outarg);
 	fuse_lookup_init(req, dir, entry, &outarg);
 	request_send(fc, req);
 	request_send(fc, req);
 	err = req->out.h.error;
 	err = req->out.h.error;
+	fuse_put_request(fc, req);
 	/* Zero nodeid is same as -ENOENT, but with valid timeout */
 	/* Zero nodeid is same as -ENOENT, but with valid timeout */
 	if (!err && outarg.nodeid &&
 	if (!err && outarg.nodeid &&
 	    (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode)))
 	    (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode)))
@@ -240,11 +257,11 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
 		inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
 		inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
 				  &outarg.attr);
 				  &outarg.attr);
 		if (!inode) {
 		if (!inode) {
-			fuse_send_forget(fc, req, outarg.nodeid, 1);
+			fuse_send_forget(fc, forget_req, outarg.nodeid, 1);
 			return ERR_PTR(-ENOMEM);
 			return ERR_PTR(-ENOMEM);
 		}
 		}
 	}
 	}
-	fuse_put_request(fc, req);
+	fuse_put_request(fc, forget_req);
 	if (err && err != -ENOENT)
 	if (err && err != -ENOENT)
 		return ERR_PTR(err);
 		return ERR_PTR(err);
 
 
@@ -388,6 +405,13 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
 	struct fuse_entry_out outarg;
 	struct fuse_entry_out outarg;
 	struct inode *inode;
 	struct inode *inode;
 	int err;
 	int err;
+	struct fuse_req *forget_req;
+
+	forget_req = fuse_get_req(fc);
+	if (IS_ERR(forget_req)) {
+		fuse_put_request(fc, req);
+		return PTR_ERR(forget_req);
+	}
 
 
 	req->in.h.nodeid = get_node_id(dir);
 	req->in.h.nodeid = get_node_id(dir);
 	req->out.numargs = 1;
 	req->out.numargs = 1;
@@ -395,24 +419,24 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
 	req->out.args[0].value = &outarg;
 	req->out.args[0].value = &outarg;
 	request_send(fc, req);
 	request_send(fc, req);
 	err = req->out.h.error;
 	err = req->out.h.error;
-	if (err) {
-		fuse_put_request(fc, req);
-		return err;
-	}
+	fuse_put_request(fc, req);
+	if (err)
+		goto out_put_forget_req;
+
 	err = -EIO;
 	err = -EIO;
 	if (invalid_nodeid(outarg.nodeid))
 	if (invalid_nodeid(outarg.nodeid))
-		goto out_put_request;
+		goto out_put_forget_req;
 
 
 	if ((outarg.attr.mode ^ mode) & S_IFMT)
 	if ((outarg.attr.mode ^ mode) & S_IFMT)
-		goto out_put_request;
+		goto out_put_forget_req;
 
 
 	inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
 	inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
 			  &outarg.attr);
 			  &outarg.attr);
 	if (!inode) {
 	if (!inode) {
-		fuse_send_forget(fc, req, outarg.nodeid, 1);
+		fuse_send_forget(fc, forget_req, outarg.nodeid, 1);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
-	fuse_put_request(fc, req);
+	fuse_put_request(fc, forget_req);
 
 
 	if (S_ISDIR(inode->i_mode)) {
 	if (S_ISDIR(inode->i_mode)) {
 		struct dentry *alias;
 		struct dentry *alias;
@@ -434,8 +458,8 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
 	fuse_invalidate_attr(dir);
 	fuse_invalidate_attr(dir);
 	return 0;
 	return 0;
 
 
- out_put_request:
-	fuse_put_request(fc, req);
+ out_put_forget_req:
+	fuse_put_request(fc, forget_req);
 	return err;
 	return err;
 }
 }
 
 

+ 2 - 1
fs/proc/base.c

@@ -442,7 +442,8 @@ static int mountstats_open(struct inode *inode, struct file *file)
 
 
 		if (task) {
 		if (task) {
 			task_lock(task);
 			task_lock(task);
-			namespace = task->nsproxy->namespace;
+			if (task->nsproxy)
+				namespace = task->nsproxy->namespace;
 			if (namespace)
 			if (namespace)
 				get_namespace(namespace);
 				get_namespace(namespace);
 			task_unlock(task);
 			task_unlock(task);

+ 2 - 1
fs/reiserfs/file.c

@@ -74,7 +74,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
 			igrab(inode);
 			igrab(inode);
 			reiserfs_warning(inode->i_sb,
 			reiserfs_warning(inode->i_sb,
 					 "pinning inode %lu because the "
 					 "pinning inode %lu because the "
-					 "preallocation can't be freed");
+					 "preallocation can't be freed",
+					 inode->i_ino);
 			goto out;
 			goto out;
 		}
 		}
 	}
 	}

+ 2 - 0
fs/xfs/xfs_bmap.c

@@ -1171,6 +1171,8 @@ xfs_bmap_add_extent_delay_real(
 		xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK);
 		xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK);
 		xfs_bmbt_set_blockcount(ep, temp);
 		xfs_bmbt_set_blockcount(ep, temp);
 		r[0] = *new;
 		r[0] = *new;
+		r[1].br_state = PREV.br_state;
+		r[1].br_startblock = 0;
 		r[1].br_startoff = new_endoff;
 		r[1].br_startoff = new_endoff;
 		temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
 		temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
 		r[1].br_blockcount = temp2;
 		r[1].br_blockcount = temp2;

+ 1 - 1
fs/xfs/xfs_inode.c

@@ -2258,7 +2258,7 @@ xfs_ifree_cluster(
 				AIL_LOCK(mp,s);
 				AIL_LOCK(mp,s);
 				iip->ili_flush_lsn = iip->ili_item.li_lsn;
 				iip->ili_flush_lsn = iip->ili_item.li_lsn;
 				AIL_UNLOCK(mp, s);
 				AIL_UNLOCK(mp, s);
-				xfs_iflags_set(ip, XFS_ISTALE);
+				xfs_iflags_set(iip->ili_inode, XFS_ISTALE);
 				pre_flushed++;
 				pre_flushed++;
 			}
 			}
 			lip = lip->li_bio_list;
 			lip = lip->li_bio_list;

+ 11 - 5
include/asm-arm/arch-ebsa110/io.h

@@ -27,9 +27,9 @@ void __outw(u16 val, unsigned int port);
 u32 __inl(unsigned int port);
 u32 __inl(unsigned int port);
 void __outl(u32 val, unsigned int port);
 void __outl(u32 val, unsigned int port);
 
 
-u8  __readb(void __iomem *addr);
-u16 __readw(void __iomem *addr);
-u32 __readl(void __iomem *addr);
+u8  __readb(const volatile void __iomem *addr);
+u16 __readw(const volatile void __iomem *addr);
+u32 __readl(const volatile void __iomem *addr);
 
 
 void __writeb(u8  val, void __iomem *addr);
 void __writeb(u8  val, void __iomem *addr);
 void __writew(u16 val, void __iomem *addr);
 void __writew(u16 val, void __iomem *addr);
@@ -64,8 +64,14 @@ void __writel(u32 val, void __iomem *addr);
 #define writew(v,b)		__writew(v,b)
 #define writew(v,b)		__writew(v,b)
 #define writel(v,b)		__writel(v,b)
 #define writel(v,b)		__writel(v,b)
 
 
-#define __arch_ioremap(cookie,sz,c)	((void __iomem *)(cookie))
-#define __arch_iounmap(cookie)		do { } while (0)
+static inline void __iomem *__arch_ioremap(unsigned long cookie, size_t size,
+					   unsigned int flags)
+{
+	return (void __iomem *)cookie;
+}
+
+#define __arch_ioremap		__arch_ioremap
+#define __arch_iounmap(cookie)	do { } while (0)
 
 
 extern void insb(unsigned int port, void *buf, int sz);
 extern void insb(unsigned int port, void *buf, int sz);
 extern void insw(unsigned int port, void *buf, int sz);
 extern void insw(unsigned int port, void *buf, int sz);

+ 4 - 0
include/asm-arm/dma-mapping.h

@@ -12,6 +12,10 @@
  * uncached, unwrite-buffered mapped memory space for use with DMA
  * uncached, unwrite-buffered mapped memory space for use with DMA
  * devices.  This is the "generic" version.  The PCI specific version
  * devices.  This is the "generic" version.  The PCI specific version
  * is in pci.h
  * is in pci.h
+ *
+ * Note: Drivers should NOT use this function directly, as it will break
+ * platforms with CONFIG_DMABOUNCE.
+ * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
  */
  */
 extern void consistent_sync(void *kaddr, size_t size, int rw);
 extern void consistent_sync(void *kaddr, size_t size, int rw);
 
 

+ 2 - 4
include/asm-mips/mach-au1x00/au1xxx_ide.h

@@ -170,10 +170,8 @@ int __init auide_probe(void);
         static int auide_dma_host_on(ide_drive_t *drive);
         static int auide_dma_host_on(ide_drive_t *drive);
         static int auide_dma_lostirq(ide_drive_t *drive);
         static int auide_dma_lostirq(ide_drive_t *drive);
         static int auide_dma_on(ide_drive_t *drive);
         static int auide_dma_on(ide_drive_t *drive);
-        static void auide_ddma_tx_callback(int irq, void *param,
-                                           struct pt_regs *regs);
-        static void auide_ddma_rx_callback(int irq, void *param,
-                                           struct pt_regs *regs);
+        static void auide_ddma_tx_callback(int irq, void *param);
+        static void auide_ddma_rx_callback(int irq, void *param);
         static int auide_dma_off_quietly(ide_drive_t *drive);
         static int auide_dma_off_quietly(ide_drive_t *drive);
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
 
 

+ 4 - 2
include/asm-parisc/semaphore.h

@@ -115,7 +115,8 @@ extern __inline__ int down_interruptible(struct semaphore * sem)
  */
  */
 extern __inline__ int down_trylock(struct semaphore * sem)
 extern __inline__ int down_trylock(struct semaphore * sem)
 {
 {
-	int flags, count;
+	unsigned long flags;
+	int count;
 
 
 	spin_lock_irqsave(&sem->sentry, flags);
 	spin_lock_irqsave(&sem->sentry, flags);
 	count = sem->count - 1;
 	count = sem->count - 1;
@@ -131,7 +132,8 @@ extern __inline__ int down_trylock(struct semaphore * sem)
  */
  */
 extern __inline__ void up(struct semaphore * sem)
 extern __inline__ void up(struct semaphore * sem)
 {
 {
-	int flags;
+	unsigned long flags;
+
 	spin_lock_irqsave(&sem->sentry, flags);
 	spin_lock_irqsave(&sem->sentry, flags);
 	if (sem->count < 0) {
 	if (sem->count < 0) {
 		__up(sem);
 		__up(sem);

+ 0 - 4
include/asm-powerpc/time.h

@@ -39,10 +39,6 @@ extern void generic_calibrate_decr(void);
 extern void wakeup_decrementer(void);
 extern void wakeup_decrementer(void);
 extern void snapshot_timebase(void);
 extern void snapshot_timebase(void);
 
 
-#ifdef CONFIG_RTC_CLASS
-extern int __init rtc_class_hookup(void);
-#endif
-
 /* Some sane defaults: 125 MHz timebase, 1GHz processor */
 /* Some sane defaults: 125 MHz timebase, 1GHz processor */
 extern unsigned long ppc_proc_freq;
 extern unsigned long ppc_proc_freq;
 #define DEFAULT_PROC_FREQ	(DEFAULT_TB_FREQ * 8)
 #define DEFAULT_PROC_FREQ	(DEFAULT_TB_FREQ * 8)

+ 1 - 1
include/linux/igmp.h

@@ -191,7 +191,7 @@ struct ip_mc_list
 #define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
 #define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
 #define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
 #define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
 	((value) < (thresh) ? (value) : \
 	((value) < (thresh) ? (value) : \
-        ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \
+        ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \
          (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
          (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
 
 
 #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
 #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)

+ 3 - 1
include/linux/kernel.h

@@ -30,8 +30,10 @@ extern const char linux_banner[];
 
 
 #define STACK_MAGIC	0xdeadbeef
 #define STACK_MAGIC	0xdeadbeef
 
 
+#define ALIGN(x,a)		__ALIGN_MASK(x,(typeof(x))(a)-1)
+#define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
+
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
 #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
 #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
 #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))

+ 3 - 1
include/linux/nsproxy.h

@@ -45,8 +45,10 @@ static inline void exit_task_namespaces(struct task_struct *p)
 {
 {
 	struct nsproxy *ns = p->nsproxy;
 	struct nsproxy *ns = p->nsproxy;
 	if (ns) {
 	if (ns) {
-		put_nsproxy(ns);
+		task_lock(p);
 		p->nsproxy = NULL;
 		p->nsproxy = NULL;
+		task_unlock(p);
+		put_nsproxy(ns);
 	}
 	}
 }
 }
 #endif
 #endif

+ 14 - 0
include/linux/spinlock.h

@@ -183,13 +183,27 @@ do {								\
 #define read_lock(lock)			_read_lock(lock)
 #define read_lock(lock)			_read_lock(lock)
 
 
 #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
 #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+
 #define spin_lock_irqsave(lock, flags)	flags = _spin_lock_irqsave(lock)
 #define spin_lock_irqsave(lock, flags)	flags = _spin_lock_irqsave(lock)
 #define read_lock_irqsave(lock, flags)	flags = _read_lock_irqsave(lock)
 #define read_lock_irqsave(lock, flags)	flags = _read_lock_irqsave(lock)
 #define write_lock_irqsave(lock, flags)	flags = _write_lock_irqsave(lock)
 #define write_lock_irqsave(lock, flags)	flags = _write_lock_irqsave(lock)
+
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+#define spin_lock_irqsave_nested(lock, flags, subclass) \
+	flags = _spin_lock_irqsave_nested(lock, subclass)
+#else
+#define spin_lock_irqsave_nested(lock, flags, subclass) \
+	flags = _spin_lock_irqsave(lock)
+#endif
+
 #else
 #else
+
 #define spin_lock_irqsave(lock, flags)	_spin_lock_irqsave(lock, flags)
 #define spin_lock_irqsave(lock, flags)	_spin_lock_irqsave(lock, flags)
 #define read_lock_irqsave(lock, flags)	_read_lock_irqsave(lock, flags)
 #define read_lock_irqsave(lock, flags)	_read_lock_irqsave(lock, flags)
 #define write_lock_irqsave(lock, flags)	_write_lock_irqsave(lock, flags)
 #define write_lock_irqsave(lock, flags)	_write_lock_irqsave(lock, flags)
+#define spin_lock_irqsave_nested(lock, flags, subclass)	\
+	spin_lock_irqsave(lock, flags)
+
 #endif
 #endif
 
 
 #define spin_lock_irq(lock)		_spin_lock_irq(lock)
 #define spin_lock_irq(lock)		_spin_lock_irq(lock)

+ 2 - 0
include/linux/spinlock_api_smp.h

@@ -32,6 +32,8 @@ void __lockfunc _read_lock_irq(rwlock_t *lock)		__acquires(lock);
 void __lockfunc _write_lock_irq(rwlock_t *lock)		__acquires(lock);
 void __lockfunc _write_lock_irq(rwlock_t *lock)		__acquires(lock);
 unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
 unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
 							__acquires(lock);
 							__acquires(lock);
+unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
+							__acquires(lock);
 unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
 unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
 							__acquires(lock);
 							__acquires(lock);
 unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
 unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)

+ 10 - 5
include/net/sock.h

@@ -883,18 +883,23 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
 }
 }
 
 
 /**
 /**
- *	sk_filter_release: Release a socket filter
- *	@rcu: rcu_head that contains the sk_filter info to remove
- *
- *	Remove a filter from a socket and release its resources.
+ * 	sk_filter_rcu_free: Free a socket filter
+ *	@rcu: rcu_head that contains the sk_filter to free
  */
  */
- 
 static inline void sk_filter_rcu_free(struct rcu_head *rcu)
 static inline void sk_filter_rcu_free(struct rcu_head *rcu)
 {
 {
 	struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
 	struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
 	kfree(fp);
 	kfree(fp);
 }
 }
 
 
+/**
+ *	sk_filter_release: Release a socket filter
+ *	@sk: socket
+ *	@fp: filter to remove
+ *
+ *	Remove a filter from a socket and release its resources.
+ */
+
 static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp)
 static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp)
 {
 {
 	unsigned int size = sk_filter_len(fp);
 	unsigned int size = sk_filter_len(fp);

+ 2 - 3
kernel/fork.c

@@ -1315,9 +1315,8 @@ struct task_struct * __devinit fork_idle(int cpu)
 	struct pt_regs regs;
 	struct pt_regs regs;
 
 
 	task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL, 0);
 	task = copy_process(CLONE_VM, 0, idle_regs(&regs), 0, NULL, NULL, 0);
-	if (!task)
-		return ERR_PTR(-ENOMEM);
-	init_idle(task, cpu);
+	if (!IS_ERR(task))
+		init_idle(task, cpu);
 
 
 	return task;
 	return task;
 }
 }

+ 2 - 2
kernel/irq/handle.c

@@ -231,10 +231,10 @@ fastcall unsigned int __do_IRQ(unsigned int irq)
 		spin_unlock(&desc->lock);
 		spin_unlock(&desc->lock);
 
 
 		action_ret = handle_IRQ_event(irq, action);
 		action_ret = handle_IRQ_event(irq, action);
-
-		spin_lock(&desc->lock);
 		if (!noirqdebug)
 		if (!noirqdebug)
 			note_interrupt(irq, desc, action_ret);
 			note_interrupt(irq, desc, action_ret);
+
+		spin_lock(&desc->lock);
 		if (likely(!(desc->status & IRQ_PENDING)))
 		if (likely(!(desc->status & IRQ_PENDING)))
 			break;
 			break;
 		desc->status &= ~IRQ_PENDING;
 		desc->status &= ~IRQ_PENDING;

+ 1 - 5
kernel/irq/spurious.c

@@ -147,11 +147,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
 	if (unlikely(irqfixup)) {
 	if (unlikely(irqfixup)) {
 		/* Don't punish working computers */
 		/* Don't punish working computers */
 		if ((irqfixup == 2 && irq == 0) || action_ret == IRQ_NONE) {
 		if ((irqfixup == 2 && irq == 0) || action_ret == IRQ_NONE) {
-			int ok;
-
-			spin_unlock(&desc->lock);
-			ok = misrouted_irq(irq);
-			spin_lock(&desc->lock);
+			int ok = misrouted_irq(irq);
 			if (action_ret == IRQ_NONE)
 			if (action_ret == IRQ_NONE)
 				desc->irqs_unhandled -= ok;
 				desc->irqs_unhandled -= ok;
 		}
 		}

+ 21 - 0
kernel/spinlock.c

@@ -293,6 +293,27 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
 }
 }
 
 
 EXPORT_SYMBOL(_spin_lock_nested);
 EXPORT_SYMBOL(_spin_lock_nested);
+unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	preempt_disable();
+	spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
+	/*
+	 * On lockdep we dont want the hand-coded irq-enable of
+	 * _raw_spin_lock_flags() code, because lockdep assumes
+	 * that interrupts are not re-enabled during lock-acquire:
+	 */
+#ifdef CONFIG_PROVE_SPIN_LOCKING
+	_raw_spin_lock(lock);
+#else
+	_raw_spin_lock_flags(lock, &flags);
+#endif
+	return flags;
+}
+
+EXPORT_SYMBOL(_spin_lock_irqsave_nested);
 
 
 #endif
 #endif
 
 

+ 3 - 3
mm/page_alloc.c

@@ -2612,6 +2612,9 @@ unsigned long __init find_min_pfn_for_node(unsigned long nid)
 {
 {
 	int i;
 	int i;
 
 
+	/* Regions in the early_node_map can be in any order */
+	sort_node_map();
+
 	/* Assuming a sorted map, the first range found has the starting pfn */
 	/* Assuming a sorted map, the first range found has the starting pfn */
 	for_each_active_range_index_in_nid(i, nid)
 	for_each_active_range_index_in_nid(i, nid)
 		return early_node_map[i].start_pfn;
 		return early_node_map[i].start_pfn;
@@ -2680,9 +2683,6 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
 			max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]);
 			max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]);
 	}
 	}
 
 
-	/* Regions in the early_node_map can be in any order */
-	sort_node_map();
-
 	/* Print out the zone ranges */
 	/* Print out the zone ranges */
 	printk("Zone PFN ranges:\n");
 	printk("Zone PFN ranges:\n");
 	for (i = 0; i < MAX_NR_ZONES; i++)
 	for (i = 0; i < MAX_NR_ZONES; i++)

+ 19 - 0
net/bluetooth/hci_event.c

@@ -57,6 +57,7 @@
 static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
 static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
 {
 {
 	__u8 status;
 	__u8 status;
+	struct hci_conn *pend;
 
 
 	BT_DBG("%s ocf 0x%x", hdev->name, ocf);
 	BT_DBG("%s ocf 0x%x", hdev->name, ocf);
 
 
@@ -71,6 +72,15 @@ static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
 			clear_bit(HCI_INQUIRY, &hdev->flags);
 			clear_bit(HCI_INQUIRY, &hdev->flags);
 			hci_req_complete(hdev, status);
 			hci_req_complete(hdev, status);
 		}
 		}
+
+		hci_dev_lock(hdev);
+
+		pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
+		if (pend)
+			hci_acl_connect(pend);
+
+		hci_dev_unlock(hdev);
+
 		break;
 		break;
 
 
 	default:
 	default:
@@ -565,11 +575,20 @@ static void hci_cs_info_param(struct hci_dev *hdev, __u16 ocf, __u8 status)
 static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
 {
 	__u8 status = *((__u8 *) skb->data);
 	__u8 status = *((__u8 *) skb->data);
+	struct hci_conn *pend;
 
 
 	BT_DBG("%s status %d", hdev->name, status);
 	BT_DBG("%s status %d", hdev->name, status);
 
 
 	clear_bit(HCI_INQUIRY, &hdev->flags);
 	clear_bit(HCI_INQUIRY, &hdev->flags);
 	hci_req_complete(hdev, status);
 	hci_req_complete(hdev, status);
+
+	hci_dev_lock(hdev);
+
+	pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
+	if (pend)
+		hci_acl_connect(pend);
+
+	hci_dev_unlock(hdev);
 }
 }
 
 
 /* Inquiry Result */
 /* Inquiry Result */

+ 7 - 4
net/bluetooth/hci_sock.c

@@ -120,10 +120,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
 			if (!hci_test_bit(evt, &flt->event_mask))
 			if (!hci_test_bit(evt, &flt->event_mask))
 				continue;
 				continue;
 
 
-			if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE && 
-					flt->opcode != *(__u16 *)(skb->data + 3)) ||
-					(evt == HCI_EV_CMD_STATUS && 
-					flt->opcode != *(__u16 *)(skb->data + 4))))
+			if (flt->opcode &&
+			    ((evt == HCI_EV_CMD_COMPLETE &&
+			      flt->opcode !=
+			      get_unaligned((__u16 *)(skb->data + 3))) ||
+			     (evt == HCI_EV_CMD_STATUS &&
+			      flt->opcode !=
+			      get_unaligned((__u16 *)(skb->data + 4)))))
 				continue;
 				continue;
 		}
 		}
 
 

+ 3 - 1
net/bluetooth/hci_sysfs.c

@@ -259,7 +259,9 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
 
 
 	BT_DBG("conn %p", conn);
 	BT_DBG("conn %p", conn);
 
 
-	conn->dev.parent  = &hdev->dev;
+	conn->dev.bus = &bt_bus;
+	conn->dev.parent = &hdev->dev;
+
 	conn->dev.release = bt_release;
 	conn->dev.release = bt_release;
 
 
 	snprintf(conn->dev.bus_id, BUS_ID_SIZE,
 	snprintf(conn->dev.bus_id, BUS_ID_SIZE,

+ 7 - 4
net/bluetooth/l2cap.c

@@ -1353,12 +1353,12 @@ static inline int l2cap_conf_output(struct sock *sk, void **ptr)
 
 
 	/* Configure output options and let the other side know
 	/* Configure output options and let the other side know
 	 * which ones we don't like. */
 	 * which ones we don't like. */
-	if (pi->conf_mtu < pi->omtu) {
-		l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
+	if (pi->conf_mtu < pi->omtu)
 		result = L2CAP_CONF_UNACCEPT;
 		result = L2CAP_CONF_UNACCEPT;
-	} else {
+	else
 		pi->omtu = pi->conf_mtu;
 		pi->omtu = pi->conf_mtu;
-	}
+
+	l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
 
 
 	BT_DBG("sk %p result %d", sk, result);
 	BT_DBG("sk %p result %d", sk, result);
 	return result;
 	return result;
@@ -1533,6 +1533,9 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
 	if (!(sk = l2cap_get_chan_by_scid(&conn->chan_list, dcid)))
 	if (!(sk = l2cap_get_chan_by_scid(&conn->chan_list, dcid)))
 		return -ENOENT;
 		return -ENOENT;
 
 
+	if (sk->sk_state == BT_DISCONN)
+		goto unlock;
+
 	l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req));
 	l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req));
 
 
 	if (flags & 0x0001) {
 	if (flags & 0x0001) {

+ 1 - 1
net/bluetooth/rfcomm/tty.c

@@ -765,7 +765,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old)
 
 
 	BT_DBG("tty %p termios %p", tty, old);
 	BT_DBG("tty %p termios %p", tty, old);
 
 
-	if (!dev)
+	if (!dev || !dev->dlc || !dev->dlc->session)
 		return;
 		return;
 
 
 	/* Handle turning off CRTSCTS */
 	/* Handle turning off CRTSCTS */

+ 1 - 1
net/dccp/ipv6.c

@@ -277,7 +277,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	__u64 seq;
 	__u64 seq;
 
 
 	sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport,
 	sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport,
-			  &hdr->saddr, dh->dccph_sport, skb->dev->ifindex);
+			  &hdr->saddr, dh->dccph_sport, inet6_iif(skb));
 
 
 	if (sk == NULL) {
 	if (sk == NULL) {
 		ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
 		ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);

+ 2 - 0
net/dccp/probe.c

@@ -160,6 +160,8 @@ static __init int dccpprobe_init(void)
 	init_waitqueue_head(&dccpw.wait);
 	init_waitqueue_head(&dccpw.wait);
 	spin_lock_init(&dccpw.lock);
 	spin_lock_init(&dccpw.lock);
 	dccpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &dccpw.lock);
 	dccpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &dccpw.lock);
+	if (IS_ERR(dccpw.fifo))
+		return PTR_ERR(dccpw.fifo);
 
 
 	if (!proc_net_fops_create(procname, S_IRUSR, &dccpprobe_fops))
 	if (!proc_net_fops_create(procname, S_IRUSR, &dccpprobe_fops))
 		goto err0;
 		goto err0;

+ 2 - 2
net/ipv4/netfilter/ip_conntrack_helper_h323.c

@@ -1417,7 +1417,7 @@ static int process_rcf(struct sk_buff **pskb, struct ip_conntrack *ct,
 		DEBUGP
 		DEBUGP
 		    ("ip_ct_ras: set RAS connection timeout to %u seconds\n",
 		    ("ip_ct_ras: set RAS connection timeout to %u seconds\n",
 		     info->timeout);
 		     info->timeout);
-		ip_ct_refresh_acct(ct, ctinfo, NULL, info->timeout * HZ);
+		ip_ct_refresh(ct, *pskb, info->timeout * HZ);
 
 
 		/* Set expect timeout */
 		/* Set expect timeout */
 		read_lock_bh(&ip_conntrack_lock);
 		read_lock_bh(&ip_conntrack_lock);
@@ -1465,7 +1465,7 @@ static int process_urq(struct sk_buff **pskb, struct ip_conntrack *ct,
 	info->sig_port[!dir] = 0;
 	info->sig_port[!dir] = 0;
 
 
 	/* Give it 30 seconds for UCF or URJ */
 	/* Give it 30 seconds for UCF or URJ */
-	ip_ct_refresh_acct(ct, ctinfo, NULL, 30 * HZ);
+	ip_ct_refresh(ct, *pskb, 30 * HZ);
 
 
 	return 0;
 	return 0;
 }
 }

+ 2 - 0
net/ipv4/tcp_probe.c

@@ -156,6 +156,8 @@ static __init int tcpprobe_init(void)
 	init_waitqueue_head(&tcpw.wait);
 	init_waitqueue_head(&tcpw.wait);
 	spin_lock_init(&tcpw.lock);
 	spin_lock_init(&tcpw.lock);
 	tcpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &tcpw.lock);
 	tcpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &tcpw.lock);
+	if (IS_ERR(tcpw.fifo))
+		return PTR_ERR(tcpw.fifo);
 
 
 	if (!proc_net_fops_create(procname, S_IRUSR, &tcpprobe_fops))
 	if (!proc_net_fops_create(procname, S_IRUSR, &tcpprobe_fops))
 		goto err0;
 		goto err0;

+ 14 - 5
net/ipv4/udp.c

@@ -928,23 +928,32 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
 	return 1; 
 	return 1; 
 #else
 #else
 	struct udp_sock *up = udp_sk(sk);
 	struct udp_sock *up = udp_sk(sk);
-  	struct udphdr *uh = skb->h.uh;
+  	struct udphdr *uh;
 	struct iphdr *iph;
 	struct iphdr *iph;
 	int iphlen, len;
 	int iphlen, len;
   
   
-	__u8 *udpdata = (__u8 *)uh + sizeof(struct udphdr);
-	__be32 *udpdata32 = (__be32 *)udpdata;
+	__u8 *udpdata;
+	__be32 *udpdata32;
 	__u16 encap_type = up->encap_type;
 	__u16 encap_type = up->encap_type;
 
 
 	/* if we're overly short, let UDP handle it */
 	/* if we're overly short, let UDP handle it */
-	if (udpdata > skb->tail)
+	len = skb->len - sizeof(struct udphdr);
+	if (len <= 0)
 		return 1;
 		return 1;
 
 
 	/* if this is not encapsulated socket, then just return now */
 	/* if this is not encapsulated socket, then just return now */
 	if (!encap_type)
 	if (!encap_type)
 		return 1;
 		return 1;
 
 
-	len = skb->tail - udpdata;
+	/* If this is a paged skb, make sure we pull up
+	 * whatever data we need to look at. */
+	if (!pskb_may_pull(skb, sizeof(struct udphdr) + min(len, 8)))
+		return 1;
+
+	/* Now we can get the pointers */
+	uh = skb->h.uh;
+	udpdata = (__u8 *)uh + sizeof(struct udphdr);
+	udpdata32 = (__be32 *)udpdata;
 
 
 	switch (encap_type) {
 	switch (encap_type) {
 	default:
 	default:

+ 18 - 1
net/ipv6/ip6_tunnel.c

@@ -542,6 +542,7 @@ ip6ip6_rcv(struct sk_buff *skb)
 		skb->dev = t->dev;
 		skb->dev = t->dev;
 		dst_release(skb->dst);
 		dst_release(skb->dst);
 		skb->dst = NULL;
 		skb->dst = NULL;
+		nf_reset(skb);
 		if (t->parms.flags & IP6_TNL_F_RCV_DSCP_COPY)
 		if (t->parms.flags & IP6_TNL_F_RCV_DSCP_COPY)
 			ipv6_copy_dscp(ipv6h, skb->nh.ipv6h);
 			ipv6_copy_dscp(ipv6h, skb->nh.ipv6h);
 		ip6ip6_ecn_decapsulate(ipv6h, skb);
 		ip6ip6_ecn_decapsulate(ipv6h, skb);
@@ -1149,6 +1150,20 @@ fail:
 	return err;
 	return err;
 }
 }
 
 
+static void __exit ip6ip6_destroy_tunnels(void)
+{
+	int h;
+	struct ip6_tnl *t;
+
+	for (h = 0; h < HASH_SIZE; h++) {
+		while ((t = tnls_r_l[h]) != NULL)
+			unregister_netdevice(t->dev);
+	}
+
+	t = tnls_wc[0];
+	unregister_netdevice(t->dev);
+}
+
 /**
 /**
  * ip6_tunnel_cleanup - free resources and unregister protocol
  * ip6_tunnel_cleanup - free resources and unregister protocol
  **/
  **/
@@ -1158,7 +1173,9 @@ static void __exit ip6_tunnel_cleanup(void)
 	if (xfrm6_tunnel_deregister(&ip6ip6_handler))
 	if (xfrm6_tunnel_deregister(&ip6ip6_handler))
 		printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
 		printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
 
 
-	unregister_netdev(ip6ip6_fb_tnl_dev);
+	rtnl_lock();
+	ip6ip6_destroy_tunnels();
+	rtnl_unlock();
 }
 }
 
 
 module_init(ip6_tunnel_init);
 module_init(ip6_tunnel_init);

+ 8 - 7
net/ipv6/route.c

@@ -330,6 +330,8 @@ static int inline rt6_check_neigh(struct rt6_info *rt)
 		read_lock_bh(&neigh->lock);
 		read_lock_bh(&neigh->lock);
 		if (neigh->nud_state & NUD_VALID)
 		if (neigh->nud_state & NUD_VALID)
 			m = 2;
 			m = 2;
+		else if (!(neigh->nud_state & NUD_FAILED))
+			m = 1;
 		read_unlock_bh(&neigh->lock);
 		read_unlock_bh(&neigh->lock);
 	}
 	}
 	return m;
 	return m;
@@ -347,9 +349,7 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
 	m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
 	m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
 #endif
 #endif
 	n = rt6_check_neigh(rt);
 	n = rt6_check_neigh(rt);
-	if (n > 1)
-		m |= 16;
-	else if (!n && strict & RT6_LOOKUP_F_REACHABLE)
+	if (!n && (strict & RT6_LOOKUP_F_REACHABLE))
 		return -1;
 		return -1;
 	return m;
 	return m;
 }
 }
@@ -380,10 +380,11 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif,
 			continue;
 			continue;
 
 
 		if (m > mpri) {
 		if (m > mpri) {
-			rt6_probe(match);
+			if (strict & RT6_LOOKUP_F_REACHABLE)
+				rt6_probe(match);
 			match = rt;
 			match = rt;
 			mpri = m;
 			mpri = m;
-		} else {
+		} else if (strict & RT6_LOOKUP_F_REACHABLE) {
 			rt6_probe(rt);
 			rt6_probe(rt);
 		}
 		}
 	}
 	}
@@ -636,7 +637,7 @@ static struct rt6_info *ip6_pol_route_input(struct fib6_table *table,
 	int strict = 0;
 	int strict = 0;
 	int attempts = 3;
 	int attempts = 3;
 	int err;
 	int err;
-	int reachable = RT6_LOOKUP_F_REACHABLE;
+	int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
 
 
 	strict |= flags & RT6_LOOKUP_F_IFACE;
 	strict |= flags & RT6_LOOKUP_F_IFACE;
 
 
@@ -733,7 +734,7 @@ static struct rt6_info *ip6_pol_route_output(struct fib6_table *table,
 	int strict = 0;
 	int strict = 0;
 	int attempts = 3;
 	int attempts = 3;
 	int err;
 	int err;
-	int reachable = RT6_LOOKUP_F_REACHABLE;
+	int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
 
 
 	strict |= flags & RT6_LOOKUP_F_IFACE;
 	strict |= flags & RT6_LOOKUP_F_IFACE;
 
 

+ 3 - 4
net/ipv6/udp.c

@@ -242,14 +242,13 @@ static void udpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 {
 {
 	struct ipv6_pinfo *np;
 	struct ipv6_pinfo *np;
 	struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data;
 	struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data;
-	struct net_device *dev = skb->dev;
 	struct in6_addr *saddr = &hdr->saddr;
 	struct in6_addr *saddr = &hdr->saddr;
 	struct in6_addr *daddr = &hdr->daddr;
 	struct in6_addr *daddr = &hdr->daddr;
 	struct udphdr *uh = (struct udphdr*)(skb->data+offset);
 	struct udphdr *uh = (struct udphdr*)(skb->data+offset);
 	struct sock *sk;
 	struct sock *sk;
 	int err;
 	int err;
 
 
-	sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, dev->ifindex);
+	sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, inet6_iif(skb));
    
    
 	if (sk == NULL)
 	if (sk == NULL)
 		return;
 		return;
@@ -348,7 +347,7 @@ static void udpv6_mcast_deliver(struct udphdr *uh,
 
 
 	read_lock(&udp_hash_lock);
 	read_lock(&udp_hash_lock);
 	sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]);
 	sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]);
-	dif = skb->dev->ifindex;
+	dif = inet6_iif(skb);
 	sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
 	sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
 	if (!sk) {
 	if (!sk) {
 		kfree_skb(skb);
 		kfree_skb(skb);
@@ -429,7 +428,7 @@ static int udpv6_rcv(struct sk_buff **pskb)
 	 * check socket cache ... must talk to Alan about his plans
 	 * check socket cache ... must talk to Alan about his plans
 	 * for sock caches... i'll skip this for now.
 	 * for sock caches... i'll skip this for now.
 	 */
 	 */
-	sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, dev->ifindex);
+	sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, inet6_iif(skb));
 
 
 	if (sk == NULL) {
 	if (sk == NULL) {
 		if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
 		if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))

+ 2 - 1
net/irda/irlmp.c

@@ -1678,7 +1678,8 @@ static int irlmp_slsap_inuse(__u8 slsap_sel)
 	 *  every IrLAP connection and check every LSAP associated with each
 	 *  every IrLAP connection and check every LSAP associated with each
 	 *  the connection.
 	 *  the connection.
 	 */
 	 */
-	spin_lock_irqsave(&irlmp->links->hb_spinlock, flags);
+	spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags,
+			SINGLE_DEPTH_NESTING);
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	while (lap != NULL) {
 	while (lap != NULL) {
 		IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;);
 		IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;);

+ 13 - 1
net/xfrm/xfrm_user.c

@@ -495,6 +495,7 @@ static struct xfrm_state *xfrm_user_state_lookup(struct xfrm_usersa_id *p,
 			goto out;
 			goto out;
 		}
 		}
 
 
+		err = -ESRCH;
 		x = xfrm_state_lookup_byaddr(&p->daddr, saddr, p->proto,
 		x = xfrm_state_lookup_byaddr(&p->daddr, saddr, p->proto,
 					     p->family);
 					     p->family);
 	}
 	}
@@ -1927,6 +1928,9 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
 	len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
 	len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
 	len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire));
 	len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire));
 	len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
 	len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
+#ifdef CONFIG_XFRM_SUB_POLICY
+	len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
+#endif
 	skb = alloc_skb(len, GFP_ATOMIC);
 	skb = alloc_skb(len, GFP_ATOMIC);
 	if (skb == NULL)
 	if (skb == NULL)
 		return -ENOMEM;
 		return -ENOMEM;
@@ -2034,6 +2038,9 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve
 	len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
 	len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
 	len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire));
 	len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire));
 	len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
 	len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
+#ifdef CONFIG_XFRM_SUB_POLICY
+	len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
+#endif
 	skb = alloc_skb(len, GFP_ATOMIC);
 	skb = alloc_skb(len, GFP_ATOMIC);
 	if (skb == NULL)
 	if (skb == NULL)
 		return -ENOMEM;
 		return -ENOMEM;
@@ -2060,6 +2067,9 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *
 		len += RTA_SPACE(headlen);
 		len += RTA_SPACE(headlen);
 		headlen = sizeof(*id);
 		headlen = sizeof(*id);
 	}
 	}
+#ifdef CONFIG_XFRM_SUB_POLICY
+	len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
+#endif
 	len += NLMSG_SPACE(headlen);
 	len += NLMSG_SPACE(headlen);
 
 
 	skb = alloc_skb(len, GFP_ATOMIC);
 	skb = alloc_skb(len, GFP_ATOMIC);
@@ -2106,10 +2116,12 @@ static int xfrm_notify_policy_flush(struct km_event *c)
 	struct nlmsghdr *nlh;
 	struct nlmsghdr *nlh;
 	struct sk_buff *skb;
 	struct sk_buff *skb;
 	unsigned char *b;
 	unsigned char *b;
+	int len = 0;
 #ifdef CONFIG_XFRM_SUB_POLICY
 #ifdef CONFIG_XFRM_SUB_POLICY
 	struct xfrm_userpolicy_type upt;
 	struct xfrm_userpolicy_type upt;
+	len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
 #endif
 #endif
-	int len = NLMSG_LENGTH(0);
+	len += NLMSG_LENGTH(0);
 
 
 	skb = alloc_skb(len, GFP_ATOMIC);
 	skb = alloc_skb(len, GFP_ATOMIC);
 	if (skb == NULL)
 	if (skb == NULL)

+ 2 - 1
scripts/gen_initramfs_list.sh

@@ -158,7 +158,7 @@ unknown_option() {
 }
 }
 
 
 list_header() {
 list_header() {
-	echo "deps_initramfs := \\"
+	:
 }
 }
 
 
 header() {
 header() {
@@ -227,6 +227,7 @@ arg="$1"
 case "$arg" in
 case "$arg" in
 	"-l")	# files included in initramfs - used by kbuild
 	"-l")	# files included in initramfs - used by kbuild
 		dep_list="list_"
 		dep_list="list_"
+		echo "deps_initramfs := \\"
 		shift
 		shift
 		;;
 		;;
 	"-o")	# generate gzipped cpio image named $1
 	"-o")	# generate gzipped cpio image named $1

+ 7 - 9
scripts/kconfig/lxdialog/util.c

@@ -221,16 +221,14 @@ static void init_dialog_colors(void)
  */
  */
 static void color_setup(const char *theme)
 static void color_setup(const char *theme)
 {
 {
-	if (set_theme(theme)) {
-		if (has_colors()) {	/* Terminal supports color? */
-			start_color();
-			init_dialog_colors();
-		}
-	}
-	else
-	{
+	int use_color;
+
+	use_color = set_theme(theme);
+	if (use_color && has_colors()) {
+		start_color();
+		init_dialog_colors();
+	} else
 		set_mono_theme();
 		set_mono_theme();
-	}
 }
 }
 
 
 /*
 /*

+ 1 - 0
scripts/kconfig/qconf.cc

@@ -1259,6 +1259,7 @@ void ConfigSearchWindow::search(void)
  * Construct the complete config widget
  * Construct the complete config widget
  */
  */
 ConfigMainWindow::ConfigMainWindow(void)
 ConfigMainWindow::ConfigMainWindow(void)
+	: searchWindow(0)
 {
 {
 	QMenuBar* menu;
 	QMenuBar* menu;
 	bool ok;
 	bool ok;

+ 1 - 1
usr/Makefile

@@ -20,7 +20,7 @@ $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
 hostprogs-y := gen_init_cpio
 hostprogs-y := gen_init_cpio
 initramfs   := $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs_list.sh
 initramfs   := $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs_list.sh
 ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
 ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
-                    $(CONFIG_INITRAMFS_SOURCE),-d)
+			$(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
 ramfs-args  := \
 ramfs-args  := \
         $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
         $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
         $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
         $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))