From c22cea221f8de78ab36ce0f183b73c99031cc7dc Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 22 Oct 2010 12:24:02 -0400 Subject: [PATCH 01/47] start following git head again --- Makefile | 4 +- config-arm | 5 + config-debug | 2 +- config-generic | 6 + config-nodebug | 2 +- config-s390x | 2 + config-x86-generic | 5 + config-x86_64-generic | 4 + kernel.spec | 15 +-- linux-2.6-i386-nx-emulation.patch | 2 +- linux-2.6-rcu-sched-warning.patch | 215 ------------------------------ linux-2.6-utrace.patch | 4 +- 12 files changed, 36 insertions(+), 230 deletions(-) delete mode 100644 linux-2.6-rcu-sched-warning.patch diff --git a/Makefile b/Makefile index bb2c37b39..2bba607ef 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ debug: @perl -pi -e 's/# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set/CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y/' config-nodebug @perl -pi -e 's/# CONFIG_DMADEVICES_DEBUG is not set/CONFIG_DMADEVICES_DEBUG=y/' config-nodebug @perl -pi -e 's/# CONFIG_DMADEVICES_VDEBUG is not set/CONFIG_DMADEVICES_VDEBUG=y/' config-nodebug - @perl -pi -e 's/# CONFIG_CEPH_FS_PRETTYDEBUG is not set/CONFIG_CEPH_FS_PRETTYDEBUG=y/' config-nodebug + @perl -pi -e 's/# CONFIG_CEPH_LIB_PRETTYDEBUG is not set/CONFIG_CEPH_LIB_PRETTYDEBUG=y/' config-nodebug @perl -pi -e 's/# CONFIG_QUOTA_DEBUG is not set/CONFIG_QUOTA_DEBUG=y/' config-nodebug @perl -pi -e 's/# CONFIG_KGDB_KDB is not set/CONFIG_KGDB_KDB=y/' config-nodebug @perl -pi -e 's/# CONFIG_KDB_KEYBOARD is not set/CONFIG_KDB_KEYBOARD=y/' config-nodebug @@ -154,7 +154,7 @@ release: @perl -pi -e 's/CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y/# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set/' config-nodebug @perl -pi -e 's/CONFIG_DMADEVICES_DEBUG=y/# CONFIG_DMADEVICES_DEBUG is not set/' config-nodebug @perl -pi -e 's/CONFIG_DMADEVICES_VDEBUG=y/# CONFIG_DMADEVICES_VDEBUG is not set/' config-nodebug - @perl -pi -e 's/CONFIG_CEPH_FS_PRETTYDEBUG=y/# CONFIG_CEPH_FS_PRETTYDEBUG is not set/' config-nodebug + @perl -pi -e 's/CONFIG_CEPH_LIB_PRETTYDEBUG=y/# CONFIG_CEPH_LIB_PRETTYDEBUG is not set/' config-nodebug @perl -pi -e 's/CONFIG_QUOTA_DEBUG=y/# CONFIG_QUOTA_DEBUG is not set/' config-nodebug @perl -pi -e 's/CONFIG_CPU_NOTIFIER_ERROR_INJECT=m/# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set/' config-nodebug #@perl -pi -e 's/CONFIG_KGDB_KDB=y/# CONFIG_KGDB_KDB is not set/' config-nodebug diff --git a/config-arm b/config-arm index 8d7e46a49..b10eaf469 100644 --- a/config-arm +++ b/config-arm @@ -122,3 +122,8 @@ CONFIG_AUTO_ZRELADDR=y # CONFIG_DEPRECATED_PARAM_STRUCT is not set # CONFIG_ARM_SP805_WATCHDOG is not set + +CONFIG_PM_OPP=y + +CONFIG_SECCOMP=y +CONFIG_STRICT_DEVMEM=y diff --git a/config-debug b/config-debug index 441445364..4e580e255 100644 --- a/config-debug +++ b/config-debug @@ -84,7 +84,7 @@ CONFIG_DMADEVICES_VDEBUG=y CONFIG_PM_ADVANCED_DEBUG=y -CONFIG_CEPH_FS_PRETTYDEBUG=y +CONFIG_CEPH_LIB_PRETTYDEBUG=y CONFIG_QUOTA_DEBUG=y # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set diff --git a/config-generic b/config-generic index f834847ff..b97545100 100644 --- a/config-generic +++ b/config-generic @@ -3348,6 +3348,8 @@ CONFIG_EXOFS_FS=m CONFIG_NILFS2_FS=m CONFIG_LOGFS=m CONFIG_CEPH_FS=m +CONFIG_BLK_DEV_RBD=m +CONFIG_CEPH_LIB=m CONFIG_FSCACHE=m CONFIG_FSCACHE_STATS=y @@ -4334,3 +4336,7 @@ CONFIG_IR_STREAMZAP=m # CONFIG_MFD_STMPE is not set # CONFIG_MFD_MAX8998 is not set # CONFIG_MFD_TPS6586X is not set + +CONFIG_SPARSE_RCU_POINTER=y + +# CONFIG_PM_OPP is not set diff --git a/config-nodebug b/config-nodebug index d2288c5e6..c70de44a8 100644 --- a/config-nodebug +++ b/config-nodebug @@ -84,7 +84,7 @@ CONFIG_DMADEVICES_VDEBUG=y CONFIG_PM_ADVANCED_DEBUG=y -CONFIG_CEPH_FS_PRETTYDEBUG=y +CONFIG_CEPH_LIB_PRETTYDEBUG=y CONFIG_QUOTA_DEBUG=y # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set diff --git a/config-s390x b/config-s390x index d9294023d..729131a4f 100644 --- a/config-s390x +++ b/config-s390x @@ -228,3 +228,5 @@ CONFIG_SMSGIUCV_EVENT=m CONFIG_VMCP=y CONFIG_ZFCP_DIF=y + +CONFIG_SCHED_BOOK=y diff --git a/config-x86-generic b/config-x86-generic index ba3993563..616fae957 100644 --- a/config-x86-generic +++ b/config-x86-generic @@ -507,3 +507,8 @@ CONFIG_XEN_PLATFORM_PCI=m CONFIG_IDEAPAD_ACPI=m CONFIG_INTEL_IPS=m +CONFIG_OLPC_XO1=m + +CONFIG_EDAC_MCE_INJ=m +CONFIG_IRQ_TIME_ACCOUNTING=y +CONFIG_X86_RESERVE_LOW=64 diff --git a/config-x86_64-generic b/config-x86_64-generic index 713c7ef17..069aaf56d 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -419,3 +419,7 @@ CONFIG_XEN_PLATFORM_PCI=m # CONFIG_ACPI_QUICKSTART is not set CONFIG_IDEAPAD_ACPI=m CONFIG_INTEL_IPS=m + +CONFIG_EDAC_MCE_INJ=m +CONFIG_IRQ_TIME_ACCOUNTING=y +CONFIG_X86_RESERVE_LOW=64 diff --git a/kernel.spec b/kernel.spec index 3cfabdc10..758ae5248 100644 --- a/kernel.spec +++ b/kernel.spec @@ -6,7 +6,7 @@ Summary: The Linux kernel # For a stable, released kernel, released_kernel should be 1. For rawhide # and/or a kernel built from an rc or git snapshot, released_kernel should # be 0. -%global released_kernel 1 +%global released_kernel 0 # Save original buildid for later if it's defined %if 0%{?buildid:1} @@ -82,9 +82,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 8 +%define rcrev 0 # The git snapshot level -%define gitrev 5 +%define gitrev 2 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -680,8 +680,6 @@ Patch2912: linux-2.6-v4l-dvb-ir-core-update.patch #Patch2916: lirc-staging-2.6.36-fixes.patch Patch2917: hdpvr-ir-enable.patch -Patch3000: linux-2.6-rcu-sched-warning.patch - # fs fixes # NFSv4 @@ -1298,9 +1296,6 @@ ApplyOptionalPatch linux-2.6-v4l-dvb-experimental.patch # enable IR receiver on Hauppauge HD PVR (v4l-dvb merge pending) ApplyPatch hdpvr-ir-enable.patch -# silence another rcu_reference warning -ApplyPatch linux-2.6-rcu-sched-warning.patch - # Patches headed upstream ApplyPatch disable-i8042-check-on-apple-mac.patch @@ -1952,6 +1947,10 @@ fi # || || %changelog +* Fri Oct 22 2010 Kyle McMartin 2.6.37-0.1.rc0.git2 +- Switch to tracking git snapshots of what will become 2.6.37. +- Fix context rejects in utrace and a few other patches. + * Wed Oct 20 2010 Chuck Ebbert 2.6.36-1 - Linux 2.6.36 diff --git a/linux-2.6-i386-nx-emulation.patch b/linux-2.6-i386-nx-emulation.patch index e36bb5ecc..582ce627d 100644 --- a/linux-2.6-i386-nx-emulation.patch +++ b/linux-2.6-i386-nx-emulation.patch @@ -394,8 +394,8 @@ --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -6,6 +6,7 @@ - #include #include + #include +#include #include diff --git a/linux-2.6-rcu-sched-warning.patch b/linux-2.6-rcu-sched-warning.patch deleted file mode 100644 index ab3ff006b..000000000 --- a/linux-2.6-rcu-sched-warning.patch +++ /dev/null @@ -1,215 +0,0 @@ -From davej Thu Sep 16 11:55:58 2010 -Return-Path: linux-kernel-owner@vger.kernel.org -X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gelk -X-Spam-Level: -X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, - T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 -Received: from mail.corp.redhat.com [10.5.5.52] - by gelk with IMAP (fetchmail-6.3.17) - for (single-drop); Thu, 16 Sep 2010 11:55:58 -0400 (EDT) -Received: from zmta02.collab.prod.int.phx2.redhat.com (LHLO - zmta02.collab.prod.int.phx2.redhat.com) (10.5.5.32) by - mail04.corp.redhat.com with LMTP; Thu, 16 Sep 2010 11:51:27 -0400 (EDT) -Received: from localhost (localhost.localdomain [127.0.0.1]) - by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 4889C9FC56; - Thu, 16 Sep 2010 11:51:27 -0400 (EDT) -Received: from zmta02.collab.prod.int.phx2.redhat.com ([127.0.0.1]) - by localhost (zmta02.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) - with ESMTP id 94mQrmwfCpY4; Thu, 16 Sep 2010 11:51:27 -0400 (EDT) -Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) - by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 0DBDB9FC4B; - Thu, 16 Sep 2010 11:51:27 -0400 (EDT) -Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.9]) - by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8GFpQnO003857; - Thu, 16 Sep 2010 11:51:26 -0400 -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8GFFCFE031066; - Thu, 16 Sep 2010 11:51:17 -0400 -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1755493Ab0IPPvH (ORCPT + 41 others); - Thu, 16 Sep 2010 11:51:07 -0400 -Received: from casper.infradead.org ([85.118.1.10]:41834 "EHLO - casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org - with ESMTP id S1754921Ab0IPPvC convert rfc822-to-8bit (ORCPT - ); - Thu, 16 Sep 2010 11:51:02 -0400 -Received: from f199130.upc-f.chello.nl ([80.56.199.130] helo=laptop) - by casper.infradead.org with esmtpsa (Exim 4.72 #1 (Red Hat Linux)) - id 1OwGjI-0003VE-Ux; Thu, 16 Sep 2010 15:50:33 +0000 -Received: by laptop (Postfix, from userid 1000) - id 6DCDB100AEB1D; Thu, 16 Sep 2010 17:50:32 +0200 (CEST) -Subject: Re: 2.6.35-stable/ppc64/p7: suspicious rcu_dereference_check() - usage detected during 2.6.35-stable boot -From: Peter Zijlstra -To: paulmck@linux.vnet.ibm.com -Cc: Subrata Modak , - linux-kernel , - Li Zefan , Linuxppc-dev , - sachinp , - DIVYA PRAKASH , - "Valdis.Kletnieks" -In-Reply-To: <20100809161200.GC3026@linux.vnet.ibm.com> -References: <1280739132.15317.9.camel@subratamodak.linux.ibm.com> - <20100809161200.GC3026@linux.vnet.ibm.com> -Content-Type: text/plain; charset="UTF-8" -Content-Transfer-Encoding: 8BIT -Date: Thu, 16 Sep 2010 17:50:31 +0200 -Message-ID: <1284652231.2275.569.camel@laptop> -Mime-Version: 1.0 -Sender: linux-kernel-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: linux-kernel@vger.kernel.org -X-RedHat-Spam-Score: -2.31 (RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD) -X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 -X-Scanned-By: MIMEDefang 2.67 on 10.5.110.9 -Status: RO -Content-Length: 6752 -Lines: 145 - -On Mon, 2010-08-09 at 09:12 -0700, Paul E. McKenney wrote: - -> > [ 0.051203] CPU0: AMD QEMU Virtual CPU version 0.12.4 stepping 03 -> > [ 0.052999] lockdep: fixing up alternatives. -> > [ 0.054105] -> > [ 0.054106] =================================================== -> > [ 0.054999] [ INFO: suspicious rcu_dereference_check() usage. ] -> > [ 0.054999] --------------------------------------------------- -> > [ 0.054999] kernel/sched.c:616 invoked rcu_dereference_check() without protection! -> > [ 0.054999] -> > [ 0.054999] other info that might help us debug this: -> > [ 0.054999] -> > [ 0.054999] -> > [ 0.054999] rcu_scheduler_active = 1, debug_locks = 1 -> > [ 0.054999] 3 locks held by swapper/1: -> > [ 0.054999] #0: (cpu_add_remove_lock){+.+.+.}, at: [] cpu_up+0x42/0x6a -> > [ 0.054999] #1: (cpu_hotplug.lock){+.+.+.}, at: [] cpu_hotplug_begin+0x2a/0x51 -> > [ 0.054999] #2: (&rq->lock){-.-...}, at: [] init_idle+0x2f/0x113 -> > [ 0.054999] -> > [ 0.054999] stack backtrace: -> > [ 0.054999] Pid: 1, comm: swapper Not tainted 2.6.35 #1 -> > [ 0.054999] Call Trace: -> > [ 0.054999] [] lockdep_rcu_dereference+0x9b/0xa3 -> > [ 0.054999] [] task_group+0x7b/0x8a -> > [ 0.054999] [] set_task_rq+0x13/0x40 -> > [ 0.054999] [] init_idle+0xd2/0x113 -> > [ 0.054999] [] fork_idle+0xb8/0xc7 -> > [ 0.054999] [] ? mark_held_locks+0x4d/0x6b -> > [ 0.054999] [] do_fork_idle+0x17/0x2b -> > [ 0.054999] [] native_cpu_up+0x1c1/0x724 -> > [ 0.054999] [] ? do_fork_idle+0x0/0x2b -> > [ 0.054999] [] _cpu_up+0xac/0x127 -> > [ 0.054999] [] cpu_up+0x55/0x6a -> > [ 0.054999] [] kernel_init+0xe1/0x1ff -> > [ 0.054999] [] kernel_thread_helper+0x4/0x10 -> > [ 0.054999] [] ? restore_args+0x0/0x30 -> > [ 0.054999] [] ? kernel_init+0x0/0x1ff -> > [ 0.054999] [] ? kernel_thread_helper+0x0/0x10 -> > [ 0.056074] Booting Node 0, Processors #1lockdep: fixing up alternatives. -> > [ 0.130045] #2lockdep: fixing up alternatives. -> > [ 0.203089] #3 Ok. -> > [ 0.275286] Brought up 4 CPUs -> > [ 0.276005] Total of 4 processors activated (16017.17 BogoMIPS). -> -> This does look like a new one, thank you for reporting it! -> -> Here is my analysis, which should at least provide some humor value to -> those who understand the code better than I do. ;-) -> -> So the corresponding rcu_dereference_check() is in -> task_subsys_state_check(), and is fetching the cpu_cgroup_subsys_id -> element of the newly created task's task->cgroups->subsys[] array. -> The "git grep" command finds only three uses of cpu_cgroup_subsys_id, -> but no definition. -> -> Now, fork_idle() invokes copy_process(), which invokes cgroup_fork(), -> which sets the child process's ->cgroups pointer to that of the parent, -> also invoking get_css_set(), which increments the corresponding reference -> count, doing both operations under task_lock() protection (->alloc_lock). -> Because fork_idle() does not specify any of CLONE_NEWNS, CLONE_NEWUTS, -> CLONE_NEWIPC, CLONE_NEWPID, or CLONE_NEWNET, copy_namespaces() should -> not create a new namespace, and so there should be no ns_cgroup_clone(). -> We should thus retain the parent's ->cgroups pointer. And copy_process() -> installs the new task in the various lists, so that the task is externally -> accessible upon return. -> -> After a non-error return from copy_process(), fork_init() invokes -> init_idle_pid(), which does not appear to affect the task's cgroup -> state. Next fork_init() invokes init_idle(), which in turn invokes -> __set_task_cpu(), which invokes set_task_rq(), which calls task_group() -> several times, which calls task_subsys_state_check(), which calls the -> rcu_dereference_check() that complained above. -> -> However, the result returns by rcu_dereference_check() is stored into -> the task structure: -> -> p->se.cfs_rq = task_group(p)->cfs_rq[cpu]; -> p->se.parent = task_group(p)->se[cpu]; -> -> This means that the corresponding structure must have been tied down with -> a reference count or some such. If such a reference has been taken, then -> this complaint is a false positive, and could be suppressed by putting -> rcu_read_lock() and rcu_read_unlock() around the call to init_idle() -> from fork_idle(). However, although, reference to the enclosing ->cgroups -> struct css_set is held, it is not clear to me that this reference applies -> to the structures pointed to by the ->subsys[] array, especially given -> that the cgroup_subsys_state structures referenced by this array have -> their own reference count, which does not appear to me to be acquired -> by this code path. -> -> Or are the cgroup_subsys_state structures referenced by idle tasks -> never freed or some such? - -I would hope so!, the idle tasks should be part of the root cgroup, -which is not removable. - -The problem is that while we do in-fact hold rq->lock, the newly spawned -idle thread's cpu is not yet set to the correct cpu so the lockdep check -in task_group(): - - lockdep_is_held(&task_rq(p)->lock) - -will fail. - -But of a chicken and egg problem. Setting the cpu needs to have the cpu -set ;-) - -Ingo, why do we have rq->lock there at all? The CPU isn't up and running -yet, nothing should be touching it. - -Signed-off-by: Peter Zijlstra ---- - kernel/sched.c | 12 ++++++++++++ - 1 files changed, 12 insertions(+), 0 deletions(-) - -diff --git a/kernel/sched.c b/kernel/sched.c -index bd8b487..6241049 100644 ---- a/kernel/sched.c -+++ b/kernel/sched.c -@@ -5332,7 +5332,19 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu) - idle->se.exec_start = sched_clock(); - - cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu)); -+ /* -+ * We're having a chicken and egg problem, even though we are -+ * holding rq->lock, the cpu isn't yet set to this cpu so the -+ * lockdep check in task_group() will fail. -+ * -+ * Similar case to sched_fork(). / Alternatively we could -+ * use task_rq_lock() here and obtain the other rq->lock. -+ * -+ * Silence PROVE_RCU -+ */ -+ rcu_read_lock(); - __set_task_cpu(idle, cpu); -+ rcu_read_unlock(); - - rq->curr = rq->idle = idle; - #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) - --- -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Please read the FAQ at http://www.tux.org/lkml/ - diff --git a/linux-2.6-utrace.patch b/linux-2.6-utrace.patch index a12357e68..d9f81cdf7 100644 --- a/linux-2.6-utrace.patch +++ b/linux-2.6-utrace.patch @@ -1636,9 +1636,9 @@ index 2de5b1c..a283086 100644 + kernel interface exported to kernel modules, to track events in + user threads, extract and change user thread state. + - menu "RCU Subsystem" + source "kernel/irq/Kconfig" - choice + menu "RCU Subsystem" diff --git a/kernel/Makefile b/kernel/Makefile index 0b72d1a..6004913 100644 --- a/kernel/Makefile From 3daa57b3d93c5d0a795e3446850c83483df37f2e Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 26 Oct 2010 13:05:04 -0400 Subject: [PATCH 02/47] Linux 2.6.36-git8 --- .gitignore | 1 + Makefile | 2 + btusb-macbookpro-6-2.patch | 41 - btusb-macbookpro-7-1.patch | 42 - config-debug | 1 + config-generic | 43 +- config-nodebug | 1 + config-powerpc-generic | 2 + config-x86-generic | 10 + config-x86_64-generic | 9 + kernel.spec | 39 +- linux-2.6-qcserial-autosuspend.patch | 23 - linux-2.6-utrace.patch | 2 +- sources | 1 + ...m-01-add-fuzz-parameters-to-features.patch | 69 - wacom-02-parse-the-bamboo-device-family.patch | 122 -- ...t-device-quirks-into-single-function.patch | 107 -- ...upport-for-the-bamboo-touch-trackpad.patch | 172 --- ...rk-for-low-resolution-bamboo-devices.patch | 69 - ...-request-tablet-data-for-bamboo-pens.patch | 55 - ...bamboo-touch-irq-to-its-own-function.patch | 52 - wacom-08-add-support-for-bamboo-pen.patch | 130 -- ...mboo-touchpad-when-pen-is-being-used.patch | 31 - xhci_hcd-suspend-resume.patch | 1289 ----------------- 24 files changed, 72 insertions(+), 2241 deletions(-) delete mode 100644 btusb-macbookpro-6-2.patch delete mode 100644 btusb-macbookpro-7-1.patch delete mode 100644 linux-2.6-qcserial-autosuspend.patch delete mode 100644 wacom-01-add-fuzz-parameters-to-features.patch delete mode 100644 wacom-02-parse-the-bamboo-device-family.patch delete mode 100644 wacom-03-collect-device-quirks-into-single-function.patch delete mode 100644 wacom-04-add-support-for-the-bamboo-touch-trackpad.patch delete mode 100644 wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch delete mode 100644 wacom-06-request-tablet-data-for-bamboo-pens.patch delete mode 100644 wacom-07-move-bamboo-touch-irq-to-its-own-function.patch delete mode 100644 wacom-08-add-support-for-bamboo-pen.patch delete mode 100644 wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch delete mode 100644 xhci_hcd-suspend-resume.patch diff --git a/.gitignore b/.gitignore index c2fd41347..a955be81a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ patch-*.bz2 clog *.rpm kernel-2.6.*/ +/patch-2.6.36-git8.bz2 diff --git a/Makefile b/Makefile index 2bba607ef..8e3e84130 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ debug: @perl -pi -e 's/# CONFIG_DEBUG_CFQ_IOSCHED is not set/CONFIG_DEBUG_CFQ_IOSCHED=y/' config-nodebug @perl -pi -e 's/# CONFIG_DRBD_FAULT_INJECTION is not set/CONFIG_DRBD_FAULT_INJECTION=y/' config-nodebug @perl -pi -e 's/# CONFIG_ATH_DEBUG is not set/CONFIG_ATH_DEBUG=y/' config-nodebug + @perl -pi -e 's/# CONFIG_CARL9170_DEBUGFS is not set/CONFIG_CARL9170_DEBUGFS=y/' config-nodebug @perl -pi -e 's/# CONFIG_IWLWIFI_DEVICE_TRACING is not set/CONFIG_IWLWIFI_DEVICE_TRACING=y/' config-nodebug @perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_WORK is not set/CONFIG_DEBUG_OBJECTS_WORK=y/' config-nodebug @perl -pi -e 's/# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set/CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y/' config-nodebug @@ -149,6 +150,7 @@ release: @perl -pi -e 's/CONFIG_DEBUG_CFQ_IOSCHED=y/# CONFIG_DEBUG_CFQ_IOSCHED is not set/' config-nodebug @perl -pi -e 's/CONFIG_DRBD_FAULT_INJECTION=y/# CONFIG_DRBD_FAULT_INJECTION is not set/' config-nodebug @perl -pi -e 's/CONFIG_ATH_DEBUG=y/# CONFIG_ATH_DEBUG is not set/' config-nodebug + @perl -pi -e 's/CONFIG_CARL9170_DEBUGFS=y/# CONFIG_CARL9170_DEBUGFS is not set/' config-nodebug @perl -pi -e 's/CONFIG_IWLWIFI_DEVICE_TRACING=y/# CONFIG_IWLWIFI_DEVICE_TRACING is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_OBJECTS_WORK=y/# CONFIG_DEBUG_OBJECTS_WORK is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y/# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set/' config-nodebug diff --git a/btusb-macbookpro-6-2.patch b/btusb-macbookpro-6-2.patch deleted file mode 100644 index d65a30960..000000000 --- a/btusb-macbookpro-6-2.patch +++ /dev/null @@ -1,41 +0,0 @@ -From kernel-bounces@lists.fedoraproject.org Fri Sep 17 17:09:15 2010 -From: Will Woods -To: Marcel Holtmann -Subject: [PATCH 2/2] bluetooth: add support for controller in MacBookPro6,2 -Date: Fri, 17 Sep 2010 17:09:21 -0400 - -Once again the device class is ff(vend.) instead of e0(wlcon). - -output from 'usb-devices': -T: Bus=01 Lev=03 Prnt=03 Port=02 Cnt=03 Dev#= 8 Spd=12 MxCh= 0 -D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 -P: Vendor=05ac ProdID=8218 Rev=00.22 -S: Manufacturer=Apple Inc. -S: Product=Bluetooth USB Host Controller -C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA -I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none) -I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) -I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) -I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none) - -Signed-off-by: Will Woods ---- - drivers/bluetooth/btusb.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index eac44e4..320e798 100644 ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -65,6 +65,9 @@ static struct usb_device_id btusb_table[] = { - /* Apple iMac11,1 */ - { USB_DEVICE(0x05ac, 0x8215) }, - -+ /* Apple MacBookPro6,2 */ -+ { USB_DEVICE(0x05ac, 0x8218) }, -+ - /* AVM BlueFRITZ! USB v2.0 */ - { USB_DEVICE(0x057c, 0x3800) }, - --- -1.7.2.3 diff --git a/btusb-macbookpro-7-1.patch b/btusb-macbookpro-7-1.patch deleted file mode 100644 index 3e07dd583..000000000 --- a/btusb-macbookpro-7-1.patch +++ /dev/null @@ -1,42 +0,0 @@ -From kernel-bounces@lists.fedoraproject.org Fri Sep 17 17:09:18 2010 -From: Will Woods -To: Marcel Holtmann -Subject: [PATCH 1/2] bluetooth: add support for controller in MacBookPro7,1 -Date: Fri, 17 Sep 2010 17:09:20 -0400 - -As with iMac11,1 the device class is ff(vend.) instead of e0(wlcon). - -output from 'usb-devices': -T: Bus=04 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0 -D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 -P: Vendor=05ac ProdID=8213 Rev=01.86 -S: Manufacturer=Apple Inc. -S: Product=Bluetooth USB Host Controller -S: SerialNumber=58B0359C28ED -C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA -I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb -I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) -I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none) - -Signed-off-by: Will Woods ---- - drivers/bluetooth/btusb.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index d22ce3c..eac44e4 100644 ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -59,6 +59,9 @@ static struct usb_device_id btusb_table[] = { - /* Generic Bluetooth USB device */ - { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, - -+ /* Apple MacBookPro7,1 */ -+ { USB_DEVICE(0x05ac, 0x8213) }, -+ - /* Apple iMac11,1 */ - { USB_DEVICE(0x05ac, 0x8215) }, - --- -1.7.2.3 diff --git a/config-debug b/config-debug index 4e580e255..1675f5c0c 100644 --- a/config-debug +++ b/config-debug @@ -74,6 +74,7 @@ CONFIG_DEBUG_CFQ_IOSCHED=y CONFIG_DRBD_FAULT_INJECTION=y CONFIG_ATH_DEBUG=y +CONFIG_CARL9170_DEBUGFS=y CONFIG_IWLWIFI_DEVICE_TRACING=y CONFIG_DEBUG_OBJECTS_WORK=y diff --git a/config-generic b/config-generic index b97545100..3c3e26060 100644 --- a/config-generic +++ b/config-generic @@ -154,6 +154,7 @@ CONFIG_INFINIBAND_AMSO1100=m # CONFIG_INFINIBAND_AMSO1100_DEBUG is not set CONFIG_INFINIBAND_CXGB3=m CONFIG_INFINIBAND_CXGB4=m +CONFIG_SCSI_CXGB4_ISCSI=m # CONFIG_INFINIBAND_CXGB3_DEBUG is not set CONFIG_MLX4_INFINIBAND=m CONFIG_INFINIBAND_NES=m @@ -365,6 +366,7 @@ CONFIG_BLK_DEV_DELKIN=m CONFIG_LBDAF=y CONFIG_BLK_DEV_BSG=y CONFIG_BLK_DEV_INTEGRITY=y +CONFIG_BLK_DEV_THROTTLING=y # @@ -759,6 +761,7 @@ CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_NF_SECURITY=m # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m +CONFIG_NET_IPGRE_DEMUX=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y @@ -797,6 +800,7 @@ CONFIG_IP_VS_SH=m CONFIG_IP_VS_SED=m CONFIG_IP_VS_NQ=m CONFIG_IP_VS_FTP=m +CONFIG_IP_VS_PE_SIP=m CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y @@ -1100,6 +1104,7 @@ CONFIG_NET_ACT_NAT=m CONFIG_NET_ACT_PEDIT=m CONFIG_NET_ACT_POLICE=m CONFIG_NET_ACT_SIMP=m +CONFIG_NET_ACT_CSUM=m CONFIG_DCB=y @@ -1150,6 +1155,7 @@ CONFIG_ATM_FORE200E_TX_RETRY=16 CONFIG_ATM_FORE200E_DEBUG=0 CONFIG_ATM_HE=m +CONFIG_PPTP=m CONFIG_PPPOATM=m CONFIG_PPPOL2TP=m CONFIG_ATM_NICSTAR=m @@ -1195,6 +1201,7 @@ CONFIG_FIXED_PHY=y CONFIG_MDIO_BITBANG=m CONFIG_NATIONAL_PHY=m CONFIG_ICPLUS_PHY=m +CONFIG_BCM63XX_PHY=m CONFIG_LSI_ET1011C_PHY=m CONFIG_LXT_PHY=m CONFIG_MARVELL_PHY=m @@ -1212,6 +1219,12 @@ CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=m CONFIG_TYPHOON=m CONFIG_DNET=m +CONFIG_STMMAC_ETH=m +# CONFIG_STMMAC_DA is not set +# CONFIG_STMMAC_DUAL_MAC is not set +# CONFIG_STMMAC_TIMER is not set + +# CONFIG_PCH_GBE is not set # # Tulip family network device support @@ -1329,6 +1342,7 @@ CONFIG_MLX4_EN=m # CONFIG_MLX4_DEBUG is not set CONFIG_QLCNIC=m CONFIG_QLGE=m +CONFIG_BNA=m CONFIG_SFC=m CONFIG_SFC_MTD=y CONFIG_BE2NET=m @@ -1408,6 +1422,9 @@ CONFIG_ATH9K=m CONFIG_ATH9K_DEBUGFS=y CONFIG_ATH9K_HTC=m # CONFIG_ATH9K_HTC_DEBUGFS is not set +CONFIG_ATH9K_RATE_CONTROL=y +CONFIG_CARL9170=m +CONFIG_CARL9170_LEDS=y CONFIG_AT76C50X_USB=m CONFIG_AIRO=m CONFIG_AIRO_CS=m @@ -1462,6 +1479,7 @@ CONFIG_IWL4965=y CONFIG_IWL5000=y CONFIG_IWL3945=m CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y +# CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE is not set CONFIG_IWM=m # CONFIG_IWM_DEBUG is not set # CONFIG_IWM_TRACING is not set @@ -1800,6 +1818,7 @@ CONFIG_INPUT_TABLET=y CONFIG_TABLET_USB_ACECAD=m CONFIG_TABLET_USB_AIPTEK=m CONFIG_TABLET_USB_GTCO=m +CONFIG_TABLET_USB_HANWANG=m CONFIG_TABLET_USB_KBTAB=m CONFIG_TABLET_USB_WACOM=m @@ -1823,6 +1842,7 @@ CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y CONFIG_SERIO_RAW=m CONFIG_SERIO_ALTERA_PS2=m +# CONFIG_SERIO_PS2MULT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set @@ -1916,6 +1936,7 @@ CONFIG_TOUCHSCREEN_USB_E2I=y CONFIG_TOUCHSCREEN_USB_COMPOSITE=m # CONFIG_TOUCHSCREEN_WM97XX is not set CONFIG_TOUCHSCREEN_W90X900=m +# CONFIG_TOUCHSCREEN_BU21013 is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=m @@ -2159,13 +2180,16 @@ CONFIG_SENSORS_ADT7411=m CONFIG_SENSORS_ASC7621=m CONFIG_SENSORS_EMC1403=m CONFIG_SENSORS_TMP102=m +CONFIG_SENSORS_LTC4261=m # CONFIG_SENSORS_BH1780 is not set # CONFIG_SENSORS_JC42 is not set # CONFIG_SENSORS_SMM665 is not set # CONFIG_SENSORS_EMC2103 is not set +# CONFIG_SENSORS_GPIO_FAN is not set # CONFIG_HMC6352 is not set # CONFIG_BMP085 is not set +# CONFIG_PCH_PHUB is not set CONFIG_W1=m CONFIG_W1_CON=y @@ -2747,6 +2771,7 @@ CONFIG_SND_DYNAMIC_MINORS=y # Generic devices # CONFIG_SND_DUMMY=m +CONFIG_SND_ALOOP=m CONFIG_SND_VIRMIDI=m CONFIG_SND_MTPAV=m CONFIG_SND_MTS64=m @@ -2765,6 +2790,8 @@ CONFIG_SND_AD1889=m # CONFIG_SND_WAVEFRONT is not set # CONFIG_SND_MSND_PINNACLE is not set # CONFIG_SND_MSND_CLASSIC is not set +# CONFIG_SND_AZT1605 is not set +# CONFIG_SND_AZT2316 is not set # # PCI devices @@ -2819,6 +2846,7 @@ CONFIG_SND_HDA_CODEC_CMEDIA=y CONFIG_SND_HDA_CODEC_INTELHDMI=y CONFIG_SND_HDA_CODEC_SI3054=y CONFIG_SND_HDA_CODEC_NVHDMI=y +CONFIG_SND_HDA_CODEC_HDMI=y CONFIG_SND_HDA_GENERIC=y CONFIG_SND_HDA_POWER_SAVE=y CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 @@ -2936,6 +2964,8 @@ CONFIG_USB_STORAGE_ONETOUCH=y CONFIG_USB_STORAGE_ALAUDA=y CONFIG_USB_STORAGE_KARMA=y # CONFIG_USB_LIBUSUAL is not set +CONFIG_USB_UAS=m + # # USB Human Interface Devices (HID) @@ -2949,6 +2979,7 @@ CONFIG_HID=m CONFIG_HIDRAW=y CONFIG_HID_PID=y CONFIG_LOGITECH_FF=y +CONFIG_LOGIWII_FF=y CONFIG_LOGIRUMBLEPAD2_FF=y CONFIG_PANTHERLORD_FF=y CONFIG_THRUSTMASTER_FF=y @@ -2990,7 +3021,9 @@ CONFIG_HID_ZEROPLUS=m CONFIG_HID_ZYDACRON=m CONFIG_HID_ACRUX_FF=m CONFIG_HID_ELECOM=m - +CONFIG_HID_UCLOGIC=m +CONFIG_HID_WALTOP=m +CONFIG_HID_ROCCAT_PYRA=m # # USB Imaging devices @@ -3091,6 +3124,7 @@ CONFIG_USB_NET_RNDIS_HOST=m CONFIG_USB_NET_CDC_SUBSET=m CONFIG_USB_NET_CDC_EEM=m CONFIG_USB_NET_ZAURUS=m +CONFIG_USB_NET_CX82310_ETH=m CONFIG_USB_NET_INT51X1=m CONFIG_USB_CDC_PHONET=m CONFIG_USB_IPHETH=m @@ -3183,6 +3217,7 @@ CONFIG_USB_SERIAL_QCAUX=m CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m CONFIG_USB_SERIAL_DEBUG=m CONFIG_USB_SERIAL_SSU100=m +CONFIG_USB_SERIAL_SAMBA=m CONFIG_USB_EZUSB=y CONFIG_USB_EMI62=m @@ -3216,6 +3251,7 @@ CONFIG_USB_FILE_STORAGE=m # CONFIG_USB_OXU210HP_HCD is not set CONFIG_USB_IOWARRIOR=m CONFIG_USB_ISIGHTFW=m +CONFIG_USB_YUREX=m CONFIG_USB_VST=m CONFIG_USB_LCD=m CONFIG_USB_LD=m @@ -3445,6 +3481,7 @@ CONFIG_NFSD_V3_ACL=y CONFIG_NFSD_V4=y CONFIG_NFS_FSCACHE=y # CONFIG_NFS_USE_LEGACY_DNS is not set +# CONFIG_NFS_USE_NEW_IDMAPPER is not set CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m @@ -3747,6 +3784,7 @@ CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y CONFIG_BLK_CGROUP=y # CONFIG_DEBUG_BLK_CGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set # CONFIG_SYSFS_DEPRECATED_V2 is not set CONFIG_RELAY=y @@ -4065,8 +4103,6 @@ CONFIG_RESOURCE_COUNTERS=y #FIXME: x86 generic? CONFIG_LEDS_CLEVO_MAIL=m CONFIG_I8K=m -CONFIG_EDAC_I3000=m -CONFIG_EDAC_X38=m CONFIG_INPUT_APANEL=m # CONFIG_INTEL_MENLOW is not set @@ -4117,6 +4153,7 @@ CONFIG_NET_SCH_MULTIQ=m CONFIG_NET_ACT_SKBEDIT=m CONFIG_PHONET=m +# CONFIG_PHONET_PIPECTRLR is not set CONFIG_ICS932S401=m # CONFIG_C2PORT is not set diff --git a/config-nodebug b/config-nodebug index c70de44a8..4e5e220f9 100644 --- a/config-nodebug +++ b/config-nodebug @@ -74,6 +74,7 @@ CONFIG_DEBUG_CFQ_IOSCHED=y CONFIG_DRBD_FAULT_INJECTION=y CONFIG_ATH_DEBUG=y +CONFIG_CARL9170_DEBUGFS=y CONFIG_IWLWIFI_DEVICE_TRACING=y CONFIG_DEBUG_OBJECTS_WORK=y diff --git a/config-powerpc-generic b/config-powerpc-generic index 0effe3d0d..1b05f4a90 100644 --- a/config-powerpc-generic +++ b/config-powerpc-generic @@ -334,3 +334,5 @@ CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m # CONFIG_GPIO_SCH is not set # CONFIG_PPC_MPC512x is not set + +CONFIG_KVM_GUEST=y diff --git a/config-x86-generic b/config-x86-generic index 616fae957..8f19cd311 100644 --- a/config-x86-generic +++ b/config-x86-generic @@ -284,6 +284,9 @@ CONFIG_EDAC_R82600=m CONFIG_EDAC_AMD8131=m CONFIG_EDAC_AMD8111=m CONFIG_EDAC_I7CORE=m +CONFIG_EDAC_I3000=m +CONFIG_EDAC_I7300=m +CONFIG_EDAC_X38=m CONFIG_SCHED_MC=y @@ -309,6 +312,7 @@ CONFIG_EEEPC_LAPTOP=m CONFIG_EEEPC_WMI=m CONFIG_FUJITSU_LAPTOP=m # CONFIG_FUJITSU_LAPTOP_DEBUG is not set +CONFIG_IDEAPAD_LAPTOP=m CONFIG_MSI_LAPTOP=m CONFIG_SONY_LAPTOP=m CONFIG_DELL_LAPTOP=m @@ -352,6 +356,7 @@ CONFIG_PARAVIRT=y # CONFIG_PARAVIRT_SPINLOCKS is not set CONFIG_KVM_CLOCK=y CONFIG_KVM_GUEST=y +CONFIG_KVM_MMU_AUDIT=y # default $x would be nice... CONFIG_LGUEST_GUEST=y CONFIG_VMI=y @@ -506,9 +511,14 @@ CONFIG_XEN_PLATFORM_PCI=m # CONFIG_ACPI_QUICKSTART is not set CONFIG_IDEAPAD_ACPI=m CONFIG_INTEL_IPS=m +# CONFIG_IBM_RTL is not set CONFIG_OLPC_XO1=m +CONFIG_XO1_RFKILL=m CONFIG_EDAC_MCE_INJ=m CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_X86_RESERVE_LOW=64 + +CONFIG_PCH_GBE=m +CONFIG_PCH_PHUB=m diff --git a/config-x86_64-generic b/config-x86_64-generic index 069aaf56d..caad92abf 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -204,6 +204,9 @@ CONFIG_EDAC_AMD64=m # CONFIG_EDAC_AMD64_ERROR_INJECTION is not set CONFIG_EDAC_DECODE_MCE=m CONFIG_EDAC_I7CORE=m +CONFIG_EDAC_I3000=m +CONFIG_EDAC_I7300=m +CONFIG_EDAC_X38=m CONFIG_SCHED_MC=y @@ -284,6 +287,7 @@ CONFIG_PARAVIRT=y # CONFIG_PARAVIRT_SPINLOCKS is not set CONFIG_KVM_CLOCK=y CONFIG_KVM_GUEST=y +CONFIG_KVM_MMU_AUDIT=y CONFIG_XEN=y CONFIG_XEN_MAX_DOMAIN_MEMORY=32 @@ -419,7 +423,12 @@ CONFIG_XEN_PLATFORM_PCI=m # CONFIG_ACPI_QUICKSTART is not set CONFIG_IDEAPAD_ACPI=m CONFIG_INTEL_IPS=m +CONFIG_IDEAPAD_LAPTOP=m +# CONFIG_IBM_RTL is not set CONFIG_EDAC_MCE_INJ=m CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_X86_RESERVE_LOW=64 + +CONFIG_PCH_GBE=m +CONFIG_PCH_PHUB=m diff --git a/kernel.spec b/kernel.spec index 758ae5248..e8a00a281 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 0 # The git snapshot level -%define gitrev 2 +%define gitrev 8 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -696,36 +696,19 @@ Patch12018: neuter_intel_microcode_load.patch Patch12030: tpm-fix-stall-on-boot.patch -# Wacom Bamboo -Patch12100: wacom-01-add-fuzz-parameters-to-features.patch -Patch12105: wacom-02-parse-the-bamboo-device-family.patch -Patch12110: wacom-03-collect-device-quirks-into-single-function.patch -Patch12115: wacom-04-add-support-for-the-bamboo-touch-trackpad.patch -Patch12120: wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch -Patch12125: wacom-06-request-tablet-data-for-bamboo-pens.patch -Patch12130: wacom-07-move-bamboo-touch-irq-to-its-own-function.patch -Patch12135: wacom-08-add-support-for-bamboo-pen.patch -Patch12140: wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch - # Runtime power management Patch12200: linux-2.6-bluetooth-autosuspend.patch Patch12201: linux-2.6-uvc-autosuspend.patch -Patch12202: linux-2.6-qcserial-autosuspend.patch Patch12203: linux-2.6-usb-pci-autosuspend.patch Patch12204: linux-2.6-enable-more-pci-autosuspend.patch Patch12205: runtime_pm_fixups.patch Patch12225: pci-crs-fixes.patch -Patch12300: btusb-macbookpro-7-1.patch -Patch12301: btusb-macbookpro-6-2.patch - Patch12302: pnpacpi-cope-with-invalid-device-ids.patch Patch12303: dmar-disable-when-ricoh-multifunction.patch -Patch12305: xhci_hcd-suspend-resume.patch - %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1306,21 +1289,9 @@ ApplyPatch neuter_intel_microcode_load.patch # try to fix stalls during boot (#530393) ApplyPatch tpm-fix-stall-on-boot.patch -# Wacom Bamboo -ApplyPatch wacom-01-add-fuzz-parameters-to-features.patch -ApplyPatch wacom-02-parse-the-bamboo-device-family.patch -ApplyPatch wacom-03-collect-device-quirks-into-single-function.patch -ApplyPatch wacom-04-add-support-for-the-bamboo-touch-trackpad.patch -ApplyPatch wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch -ApplyPatch wacom-06-request-tablet-data-for-bamboo-pens.patch -ApplyPatch wacom-07-move-bamboo-touch-irq-to-its-own-function.patch -ApplyPatch wacom-08-add-support-for-bamboo-pen.patch -ApplyPatch wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch - # Runtime PM ApplyPatch linux-2.6-bluetooth-autosuspend.patch ApplyPatch linux-2.6-uvc-autosuspend.patch -ApplyPatch linux-2.6-qcserial-autosuspend.patch ApplyPatch linux-2.6-usb-pci-autosuspend.patch ApplyPatch linux-2.6-enable-more-pci-autosuspend.patch ApplyPatch runtime_pm_fixups.patch @@ -1329,17 +1300,12 @@ ApplyPatch runtime_pm_fixups.patch # ( from linux-pci list ) ApplyPatch pci-crs-fixes.patch -ApplyPatch btusb-macbookpro-7-1.patch -ApplyPatch btusb-macbookpro-6-2.patch - # rhbz#641468 ApplyPatch pnpacpi-cope-with-invalid-device-ids.patch # rhbz#605888 ApplyPatch dmar-disable-when-ricoh-multifunction.patch -ApplyPatch xhci_hcd-suspend-resume.patch - # END OF PATCH APPLICATIONS %endif @@ -1947,6 +1913,9 @@ fi # || || %changelog +* Tue Oct 26 2010 Kyle McMartin 2.6.37-0.1.rc0.git8 +- Linux 2.6.36-git8 + * Fri Oct 22 2010 Kyle McMartin 2.6.37-0.1.rc0.git2 - Switch to tracking git snapshots of what will become 2.6.37. - Fix context rejects in utrace and a few other patches. diff --git a/linux-2.6-qcserial-autosuspend.patch b/linux-2.6-qcserial-autosuspend.patch deleted file mode 100644 index 524898813..000000000 --- a/linux-2.6-qcserial-autosuspend.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit 0fe584342da141957c8642191b508ad39e9b19e6 -Author: Matthew Garrett -Date: Thu Sep 16 13:39:31 2010 -0400 - - usbserial: Enable USB autosuspend by default on qcserial - - Seems to work fine in my testing. - - Signed-off-by: Matthew Garrett - -diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c -index cde67ca..2846ad8 100644 ---- a/drivers/usb/serial/qcserial.c -+++ b/drivers/usb/serial/qcserial.c -@@ -118,6 +118,8 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) - - spin_lock_init(&data->susp_lock); - -+ usb_enable_autosuspend(serial->dev); -+ - switch (nintf) { - case 1: - /* QDL mode */ diff --git a/linux-2.6-utrace.patch b/linux-2.6-utrace.patch index d9f81cdf7..c50b83ea8 100644 --- a/linux-2.6-utrace.patch +++ b/linux-2.6-utrace.patch @@ -44,7 +44,7 @@ index 34929f2..884c36b 100644 +++ b/Documentation/DocBook/Makefile @@ -14,7 +14,7 @@ DOCBOOKS := z8530book.xml mcabook.xml de genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ - mac80211.xml debugobjects.xml sh.xml regulator.xml \ + 80211.xml debugobjects.xml sh.xml regulator.xml \ alsa-driver-api.xml writing-an-alsa-driver.xml \ - tracepoint.xml media.xml drm.xml + tracepoint.xml utrace.xml media.xml drm.xml diff --git a/sources b/sources index a51803471..de3496585 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 +1ae3ad96ed31fb8d40384add909bf994 patch-2.6.36-git8.bz2 diff --git a/wacom-01-add-fuzz-parameters-to-features.patch b/wacom-01-add-fuzz-parameters-to-features.patch deleted file mode 100644 index 4162726d3..000000000 --- a/wacom-01-add-fuzz-parameters-to-features.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Henrik Rydberg -Date: Sun, 5 Sep 2010 19:25:11 +0000 (-0700) -Subject: Input: wacom - add fuzz parameters to features -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=fed87e655a2c20468d628b37424af58287803afe - -Input: wacom - add fuzz parameters to features - -The signal-to-noise ratio varies between devices, but currently all -devices are treated the same way. Add fuzz parameters to the feature -struct, allowing for tailored treatment of devices. - -Signed-off-by: Henrik Rydberg -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c -index 42ba369..e510e4f 100644 ---- a/drivers/input/tablet/wacom_sys.c -+++ b/drivers/input/tablet/wacom_sys.c -@@ -333,8 +333,12 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf, - struct usb_host_interface *interface = intf->cur_altsetting; - struct hid_descriptor *hid_desc; - -- /* default device to penabled */ -+ /* default features */ - features->device_type = BTN_TOOL_PEN; -+ features->x_fuzz = 4; -+ features->y_fuzz = 4; -+ features->pressure_fuzz = 0; -+ features->distance_fuzz = 0; - - /* only Tablet PCs need to retrieve the info */ - if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) -diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c -index 6e29bad..6d7e164 100644 ---- a/drivers/input/tablet/wacom_wac.c -+++ b/drivers/input/tablet/wacom_wac.c -@@ -951,9 +951,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, - - __set_bit(BTN_TOUCH, input_dev->keybit); - -- input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0); -- input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0); -- input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0); -+ input_set_abs_params(input_dev, ABS_X, 0, features->x_max, -+ features->x_fuzz, 0); -+ input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, -+ features->y_fuzz, 0); -+ input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, -+ features->pressure_fuzz, 0); - - __set_bit(ABS_MISC, input_dev->absbit); - -diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h -index 99e1a54..d769e9a 100644 ---- a/drivers/input/tablet/wacom_wac.h -+++ b/drivers/input/tablet/wacom_wac.h -@@ -73,6 +73,10 @@ struct wacom_features { - int y_phy; - unsigned char unit; - unsigned char unitExpo; -+ int x_fuzz; -+ int y_fuzz; -+ int pressure_fuzz; -+ int distance_fuzz; - }; - - struct wacom_shared { diff --git a/wacom-02-parse-the-bamboo-device-family.patch b/wacom-02-parse-the-bamboo-device-family.patch deleted file mode 100644 index f24d04d01..000000000 --- a/wacom-02-parse-the-bamboo-device-family.patch +++ /dev/null @@ -1,122 +0,0 @@ -From: Ping Cheng -Date: Sun, 5 Sep 2010 19:25:40 +0000 (-0700) -Subject: Input: wacom - parse the Bamboo device family -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=4a88081e739a41d6d70bace7e0a027f9054ab540 - -Input: wacom - parse the Bamboo device family - -The Bamboo devices have multiple interfaces which need to be setup -separately. Use the HID parsing mechanism to achieve that. - -Signed-off-by: Ping Cheng -Signed-off-by: Henrik Rydberg -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c -index e510e4f..98cba08 100644 ---- a/drivers/input/tablet/wacom_sys.c -+++ b/drivers/input/tablet/wacom_sys.c -@@ -195,17 +195,30 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi - features->pktlen = WACOM_PKGLEN_TPC2FG; - features->device_type = BTN_TOOL_TRIPLETAP; - } -- features->x_max = -- get_unaligned_le16(&report[i + 3]); -- features->x_phy = -- get_unaligned_le16(&report[i + 6]); -- features->unit = report[i + 9]; -- features->unitExpo = report[i + 11]; -- i += 12; -+ if (features->type == BAMBOO_PT) { -+ /* need to reset back */ -+ features->pktlen = WACOM_PKGLEN_BBTOUCH; -+ features->device_type = BTN_TOOL_TRIPLETAP; -+ features->x_phy = -+ get_unaligned_le16(&report[i + 5]); -+ features->x_max = -+ get_unaligned_le16(&report[i + 8]); -+ i += 15; -+ } else { -+ features->x_max = -+ get_unaligned_le16(&report[i + 3]); -+ features->x_phy = -+ get_unaligned_le16(&report[i + 6]); -+ features->unit = report[i + 9]; -+ features->unitExpo = report[i + 11]; -+ i += 12; -+ } - } else if (pen) { - /* penabled only accepts exact bytes of data */ - if (features->type == TABLETPC2FG) - features->pktlen = WACOM_PKGLEN_GRAPHIRE; -+ if (features->type == BAMBOO_PT) -+ features->pktlen = WACOM_PKGLEN_BBFUN; - features->device_type = BTN_TOOL_PEN; - features->x_max = - get_unaligned_le16(&report[i + 3]); -@@ -234,6 +247,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi - features->y_phy = - get_unaligned_le16(&report[i + 6]); - i += 7; -+ } else if (features->type == BAMBOO_PT) { -+ /* need to reset back */ -+ features->pktlen = WACOM_PKGLEN_BBTOUCH; -+ features->device_type = BTN_TOOL_TRIPLETAP; -+ features->y_phy = -+ get_unaligned_le16(&report[i + 3]); -+ features->y_max = -+ get_unaligned_le16(&report[i + 6]); -+ i += 12; - } else { - features->y_max = - features->x_max; -@@ -245,6 +267,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi - /* penabled only accepts exact bytes of data */ - if (features->type == TABLETPC2FG) - features->pktlen = WACOM_PKGLEN_GRAPHIRE; -+ if (features->type == BAMBOO_PT) -+ features->pktlen = WACOM_PKGLEN_BBFUN; - features->device_type = BTN_TOOL_PEN; - features->y_max = - get_unaligned_le16(&report[i + 3]); -@@ -341,7 +365,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf, - features->distance_fuzz = 0; - - /* only Tablet PCs need to retrieve the info */ -- if ((features->type != TABLETPC) && (features->type != TABLETPC2FG)) -+ if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) && -+ (features->type != BAMBOO_PT)) - goto out; - - if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) { -@@ -499,7 +524,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i - - strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); - -- if (features->type == TABLETPC || features->type == TABLETPC2FG) { -+ if (features->type == TABLETPC || features->type == TABLETPC2FG || -+ features->type == BAMBOO_PT) { - /* Append the device type to the name */ - strlcat(wacom_wac->name, - features->device_type == BTN_TOOL_PEN ? -diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h -index d769e9a..fb30895 100644 ---- a/drivers/input/tablet/wacom_wac.h -+++ b/drivers/input/tablet/wacom_wac.h -@@ -21,6 +21,7 @@ - #define WACOM_PKGLEN_INTUOS 10 - #define WACOM_PKGLEN_TPC1FG 5 - #define WACOM_PKGLEN_TPC2FG 14 -+#define WACOM_PKGLEN_BBTOUCH 20 - - /* device IDs */ - #define STYLUS_DEVICE_ID 0x02 -@@ -44,6 +45,7 @@ enum { - PTU, - PL, - DTU, -+ BAMBOO_PT, - INTUOS, - INTUOS3S, - INTUOS3, diff --git a/wacom-03-collect-device-quirks-into-single-function.patch b/wacom-03-collect-device-quirks-into-single-function.patch deleted file mode 100644 index 7bf768770..000000000 --- a/wacom-03-collect-device-quirks-into-single-function.patch +++ /dev/null @@ -1,107 +0,0 @@ -From: Henrik Rydberg -Date: Sun, 5 Sep 2010 19:26:16 +0000 (-0700) -Subject: Input: wacom - collect device quirks into single function -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=bc73dd39e78dd6e5b34cd938b7f037a8bc041bdd - -Input: wacom - collect device quirks into single function - -Collect device-specific code into a single function, and use quirks to -flag specific behavior instead. - -Signed-off-by: Henrik Rydberg -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h -index 284dfaa..de5adb1 100644 ---- a/drivers/input/tablet/wacom.h -+++ b/drivers/input/tablet/wacom.h -@@ -118,6 +118,7 @@ struct wacom { - extern const struct usb_device_id wacom_ids[]; - - void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len); -+void wacom_setup_device_quirks(struct wacom_features *features); - void wacom_setup_input_capabilities(struct input_dev *input_dev, - struct wacom_wac *wacom_wac); - #endif -diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c -index 98cba08..fc6fd53 100644 ---- a/drivers/input/tablet/wacom_sys.c -+++ b/drivers/input/tablet/wacom_sys.c -@@ -381,12 +381,6 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf, - if (error) - goto out; - -- /* touch device found but size is not defined. use default */ -- if (features->device_type == BTN_TOOL_DOUBLETAP && !features->x_max) { -- features->x_max = 1023; -- features->y_max = 1023; -- } -- - out: - return error; - } -@@ -522,10 +516,11 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i - if (error) - goto fail2; - -+ wacom_setup_device_quirks(features); -+ - strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); - -- if (features->type == TABLETPC || features->type == TABLETPC2FG || -- features->type == BAMBOO_PT) { -+ if (features->quirks & WACOM_QUIRK_MULTI_INPUT) { - /* Append the device type to the name */ - strlcat(wacom_wac->name, - features->device_type == BTN_TOOL_PEN ? -diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c -index 6d7e164..44b4a59 100644 ---- a/drivers/input/tablet/wacom_wac.c -+++ b/drivers/input/tablet/wacom_wac.c -@@ -941,6 +941,22 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac) - input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0); - } - -+ -+void wacom_setup_device_quirks(struct wacom_features *features) -+{ -+ -+ /* touch device found but size is not defined. use default */ -+ if (features->device_type == BTN_TOOL_DOUBLETAP && !features->x_max) { -+ features->x_max = 1023; -+ features->y_max = 1023; -+ } -+ -+ /* these device have multiple inputs */ -+ if (features->type == TABLETPC || features->type == TABLETPC2FG || -+ features->type == BAMBOO_PT) -+ features->quirks |= WACOM_QUIRK_MULTI_INPUT; -+} -+ - void wacom_setup_input_capabilities(struct input_dev *input_dev, - struct wacom_wac *wacom_wac) - { -diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h -index fb30895..6a1ff10 100644 ---- a/drivers/input/tablet/wacom_wac.h -+++ b/drivers/input/tablet/wacom_wac.h -@@ -38,6 +38,9 @@ - #define WACOM_REPORT_TPC1FG 6 - #define WACOM_REPORT_TPC2FG 13 - -+/* device quirks */ -+#define WACOM_QUIRK_MULTI_INPUT 0x0001 -+ - enum { - PENPARTNER = 0, - GRAPHIRE, -@@ -79,6 +82,7 @@ struct wacom_features { - int y_fuzz; - int pressure_fuzz; - int distance_fuzz; -+ unsigned quirks; - }; - - struct wacom_shared { diff --git a/wacom-04-add-support-for-the-bamboo-touch-trackpad.patch b/wacom-04-add-support-for-the-bamboo-touch-trackpad.patch deleted file mode 100644 index f104b2ce3..000000000 --- a/wacom-04-add-support-for-the-bamboo-touch-trackpad.patch +++ /dev/null @@ -1,172 +0,0 @@ -From: Henrik Rydberg -Date: Sun, 5 Sep 2010 19:53:16 +0000 (-0700) -Subject: Input: wacom - add support for the Bamboo Touch trackpad -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=cb734c03680eaaad64a20a666300eafd1ac260b2 - -Input: wacom - add support for the Bamboo Touch trackpad - -Add support for the Bamboo Touch trackpad, and make it work with -both the Synaptics X Driver and the Multitouch X Driver. The device -uses MT slots internally, so the choice of protocol is a given. - -Signed-off-by: Henrik Rydberg -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c -index 44b4a59..4e9b1dd 100644 ---- a/drivers/input/tablet/wacom_wac.c -+++ b/drivers/input/tablet/wacom_wac.c -@@ -855,6 +855,53 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) - return retval; - } - -+static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) -+{ -+ struct input_dev *input = wacom->input; -+ unsigned char *data = wacom->data; -+ int sp = 0, sx = 0, sy = 0, count = 0; -+ int i; -+ -+ if (len != WACOM_PKGLEN_BBTOUCH) -+ return 0; -+ -+ for (i = 0; i < 2; i++) { -+ int p = data[9 * i + 2]; -+ input_mt_slot(input, i); -+ if (p) { -+ int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; -+ int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; -+ input_report_abs(input, ABS_MT_PRESSURE, p); -+ input_report_abs(input, ABS_MT_POSITION_X, x); -+ input_report_abs(input, ABS_MT_POSITION_Y, y); -+ if (wacom->id[i] < 0) -+ wacom->id[i] = wacom->trk_id++ & MAX_TRACKING_ID; -+ if (!count++) -+ sp = p, sx = x, sy = y; -+ } else { -+ wacom->id[i] = -1; -+ } -+ input_report_abs(input, ABS_MT_TRACKING_ID, wacom->id[i]); -+ } -+ -+ input_report_key(input, BTN_TOUCH, count > 0); -+ input_report_key(input, BTN_TOOL_FINGER, count == 1); -+ input_report_key(input, BTN_TOOL_DOUBLETAP, count == 2); -+ -+ input_report_abs(input, ABS_PRESSURE, sp); -+ input_report_abs(input, ABS_X, sx); -+ input_report_abs(input, ABS_Y, sy); -+ -+ input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); -+ input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0); -+ input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); -+ input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0); -+ -+ input_sync(input); -+ -+ return 0; -+} -+ - void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) - { - bool sync; -@@ -900,6 +947,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) - sync = wacom_tpc_irq(wacom_wac, len); - break; - -+ case BAMBOO_PT: -+ sync = wacom_bpt_irq(wacom_wac, len); -+ break; -+ - default: - sync = false; - break; -@@ -955,6 +1006,13 @@ void wacom_setup_device_quirks(struct wacom_features *features) - if (features->type == TABLETPC || features->type == TABLETPC2FG || - features->type == BAMBOO_PT) - features->quirks |= WACOM_QUIRK_MULTI_INPUT; -+ -+ /* quirks for bamboo touch */ -+ if (features->type == BAMBOO_PT && -+ features->device_type == BTN_TOOL_TRIPLETAP) { -+ features->pressure_max = 256; -+ features->pressure_fuzz = 16; -+ } - } - - void wacom_setup_input_capabilities(struct input_dev *input_dev, -@@ -1095,6 +1153,33 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, - case PENPARTNER: - __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); - break; -+ -+ case BAMBOO_PT: -+ __clear_bit(ABS_MISC, input_dev->absbit); -+ -+ if (features->device_type == BTN_TOOL_TRIPLETAP) { -+ __set_bit(BTN_LEFT, input_dev->keybit); -+ __set_bit(BTN_FORWARD, input_dev->keybit); -+ __set_bit(BTN_BACK, input_dev->keybit); -+ __set_bit(BTN_RIGHT, input_dev->keybit); -+ -+ __set_bit(BTN_TOOL_FINGER, input_dev->keybit); -+ __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); -+ -+ input_mt_create_slots(input_dev, 2); -+ input_set_abs_params(input_dev, ABS_MT_POSITION_X, -+ 0, features->x_max, -+ features->x_fuzz, 0); -+ input_set_abs_params(input_dev, ABS_MT_POSITION_Y, -+ 0, features->y_max, -+ features->y_fuzz, 0); -+ input_set_abs_params(input_dev, ABS_MT_PRESSURE, -+ 0, features->pressure_max, -+ features->pressure_fuzz, 0); -+ input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0, -+ MAX_TRACKING_ID, 0, 0); -+ } -+ break; - } - } - -@@ -1232,6 +1317,8 @@ static const struct wacom_features wacom_features_0xE3 = - { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }; - static const struct wacom_features wacom_features_0x47 = - { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; -+static struct wacom_features wacom_features_0xD0 = -+ { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; - - #define USB_DEVICE_WACOM(prod) \ - USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ -@@ -1296,6 +1383,7 @@ const struct usb_device_id wacom_ids[] = { - { USB_DEVICE_WACOM(0xC6) }, - { USB_DEVICE_WACOM(0xC7) }, - { USB_DEVICE_WACOM(0xCE) }, -+ { USB_DEVICE_WACOM(0xD0) }, - { USB_DEVICE_WACOM(0xF0) }, - { USB_DEVICE_WACOM(0xCC) }, - { USB_DEVICE_WACOM(0x90) }, -diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h -index 6a1ff10..a23d6a5 100644 ---- a/drivers/input/tablet/wacom_wac.h -+++ b/drivers/input/tablet/wacom_wac.h -@@ -41,6 +41,9 @@ - /* device quirks */ - #define WACOM_QUIRK_MULTI_INPUT 0x0001 - -+/* largest reported tracking id */ -+#define MAX_TRACKING_ID 0xfff -+ - enum { - PENPARTNER = 0, - GRAPHIRE, -@@ -96,6 +99,7 @@ struct wacom_wac { - int id[3]; - __u32 serial[2]; - int last_finger; -+ int trk_id; - struct wacom_features features; - struct wacom_shared *shared; - struct input_dev *input; diff --git a/wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch b/wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch deleted file mode 100644 index 1809ec03e..000000000 --- a/wacom-05-add-a-quirk-for-low-resolution-bamboo-devices.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Henrik Rydberg -Date: Sun, 5 Sep 2010 19:57:13 +0000 (-0700) -Subject: Input: wacom - add a quirk for low resolution Bamboo devices -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=f4ccbef2886968ed409939531f6dd0474d53a12a - -Input: wacom - add a quirk for low resolution Bamboo devices - -The Bamboo Touch reports a sub-screen resolution of 480x320. The -signal-to-noise ratio is only about 100, so filtering is needed in -order to reduce the jitter to a usable level. However, the low -resolution leads to round-off errors in the EWMA filter, resulting in -extremely jerky pointer motion. This patch explicitly sets a higher -resolution for those devices, and tells this to the completion handler -via a low-resolution quirk. - -Signed-off-by: Henrik Rydberg -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c -index 4e9b1dd..2f4411a 100644 ---- a/drivers/input/tablet/wacom_wac.c -+++ b/drivers/input/tablet/wacom_wac.c -@@ -857,6 +857,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) - - static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) - { -+ struct wacom_features *features = &wacom->features; - struct input_dev *input = wacom->input; - unsigned char *data = wacom->data; - int sp = 0, sx = 0, sy = 0, count = 0; -@@ -871,6 +872,10 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) - if (p) { - int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; - int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; -+ if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { -+ x <<= 5; -+ y <<= 5; -+ } - input_report_abs(input, ABS_MT_PRESSURE, p); - input_report_abs(input, ABS_MT_POSITION_X, x); - input_report_abs(input, ABS_MT_POSITION_Y, y); -@@ -1010,8 +1015,13 @@ void wacom_setup_device_quirks(struct wacom_features *features) - /* quirks for bamboo touch */ - if (features->type == BAMBOO_PT && - features->device_type == BTN_TOOL_TRIPLETAP) { -+ features->x_max <<= 5; -+ features->y_max <<= 5; -+ features->x_fuzz <<= 5; -+ features->y_fuzz <<= 5; - features->pressure_max = 256; - features->pressure_fuzz = 16; -+ features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; - } - } - -diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h -index a23d6a5..00ca015 100644 ---- a/drivers/input/tablet/wacom_wac.h -+++ b/drivers/input/tablet/wacom_wac.h -@@ -40,6 +40,7 @@ - - /* device quirks */ - #define WACOM_QUIRK_MULTI_INPUT 0x0001 -+#define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002 - - /* largest reported tracking id */ - #define MAX_TRACKING_ID 0xfff diff --git a/wacom-06-request-tablet-data-for-bamboo-pens.patch b/wacom-06-request-tablet-data-for-bamboo-pens.patch deleted file mode 100644 index 8b31d4eab..000000000 --- a/wacom-06-request-tablet-data-for-bamboo-pens.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Chris Bagwell -Date: Sun, 12 Sep 2010 07:08:40 +0000 (-0700) -Subject: Input: wacom - request tablet data for Bamboo Pens -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=3dc9f40de4dddf9147b80cf15be633189a2b70f4 - -Input: wacom - request tablet data for Bamboo Pens - -Bamboo P&T need to use second form of usb_set_report() to -ask to report tablet data. - -With previous addition of Bamboo Touch, BTN_TOOL_TRIPLETAP is now used -for both TABLETPC2FG and BAMBOO_PT types. So reduced check to -match type=TABLETPC2FG. - -This change shows redundant check for !TABLETPC2FG in else statement. - -Signed-off-by: Chris Bagwell -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c -index fc6fd53..1e3af29 100644 ---- a/drivers/input/tablet/wacom_sys.c -+++ b/drivers/input/tablet/wacom_sys.c -@@ -319,8 +319,9 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat - if (!rep_data) - return error; - -- /* ask to report tablet data if it is 2FGT or not a Tablet PC */ -- if (features->device_type == BTN_TOOL_TRIPLETAP) { -+ /* ask to report tablet data if it is 2FGT Tablet PC or -+ * not a Tablet PC */ -+ if (features->type == TABLETPC2FG) { - do { - rep_data[0] = 3; - rep_data[1] = 4; -@@ -332,7 +333,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat - WAC_HID_FEATURE_REPORT, report_id, - rep_data, 3); - } while ((error < 0 || rep_data[1] != 4) && limit++ < 5); -- } else if (features->type != TABLETPC && features->type != TABLETPC2FG) { -+ } else if (features->type != TABLETPC) { - do { - rep_data[0] = 2; - rep_data[1] = 2; -@@ -364,7 +365,7 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf, - features->pressure_fuzz = 0; - features->distance_fuzz = 0; - -- /* only Tablet PCs need to retrieve the info */ -+ /* only Tablet PCs and Bamboo P&T need to retrieve the info */ - if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) && - (features->type != BAMBOO_PT)) - goto out; diff --git a/wacom-07-move-bamboo-touch-irq-to-its-own-function.patch b/wacom-07-move-bamboo-touch-irq-to-its-own-function.patch deleted file mode 100644 index 7495ac390..000000000 --- a/wacom-07-move-bamboo-touch-irq-to-its-own-function.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Chris Bagwell -Date: Sun, 12 Sep 2010 07:09:27 +0000 (-0700) -Subject: Input: wacom - move Bamboo Touch irq to its own function -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=e1d38e49ad97eec5024342e1244279b645e36688 - -Input: wacom - move Bamboo Touch irq to its own function - -This is in preparation of pen support in same irq handler. - -Signed-off-by: Chris Bagwell -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c -index 2f4411a..2f7ed9a 100644 ---- a/drivers/input/tablet/wacom_wac.c -+++ b/drivers/input/tablet/wacom_wac.c -@@ -855,7 +855,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) - return retval; - } - --static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) -+static int wacom_bpt_touch(struct wacom_wac *wacom) - { - struct wacom_features *features = &wacom->features; - struct input_dev *input = wacom->input; -@@ -863,9 +863,6 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) - int sp = 0, sx = 0, sy = 0, count = 0; - int i; - -- if (len != WACOM_PKGLEN_BBTOUCH) -- return 0; -- - for (i = 0; i < 2; i++) { - int p = data[9 * i + 2]; - input_mt_slot(input, i); -@@ -907,6 +904,14 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) - return 0; - } - -+static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) -+{ -+ if (len == WACOM_PKGLEN_BBTOUCH) -+ return wacom_bpt_touch(wacom); -+ -+ return 0; -+} -+ - void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) - { - bool sync; diff --git a/wacom-08-add-support-for-bamboo-pen.patch b/wacom-08-add-support-for-bamboo-pen.patch deleted file mode 100644 index 319bf6c53..000000000 --- a/wacom-08-add-support-for-bamboo-pen.patch +++ /dev/null @@ -1,130 +0,0 @@ -From: Chris Bagwell -Date: Sun, 12 Sep 2010 07:11:35 +0000 (-0700) -Subject: Input: wacom - add support for Bamboo Pen -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=2aaacb153689dbe9064e4db7e9d00de0edfc1fa0 - -Input: wacom - add support for Bamboo Pen - -This adds support for Pen on Bamboo Pen and Bamboo Pen&Touch devices. -Touchpad is handled by previous Bamboo Touch logic. - -Signed-off-by: Chris Bagwell -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c -index 2f7ed9a..536156b 100644 ---- a/drivers/input/tablet/wacom_wac.c -+++ b/drivers/input/tablet/wacom_wac.c -@@ -904,10 +904,75 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) - return 0; - } - -+static int wacom_bpt_pen(struct wacom_wac *wacom) -+{ -+ struct input_dev *input = wacom->input; -+ unsigned char *data = wacom->data; -+ int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0; -+ -+ /* -+ * Similar to Graphire protocol, data[1] & 0x20 is proximity and -+ * data[1] & 0x18 is tool ID. 0x30 is safety check to ignore -+ * 2 unused tool ID's. -+ */ -+ prox = (data[1] & 0x30) == 0x30; -+ -+ /* -+ * All reports shared between PEN and RUBBER tool must be -+ * forced to a known starting value (zero) when transitioning to -+ * out-of-prox. -+ * -+ * If not reset then, to userspace, it will look like lost events -+ * if new tool comes in-prox with same values as previous tool sent. -+ * -+ * Hardware does report zero in most out-of-prox cases but not all. -+ */ -+ if (prox) { -+ if (!wacom->shared->stylus_in_proximity) { -+ if (data[1] & 0x08) { -+ wacom->tool[0] = BTN_TOOL_RUBBER; -+ wacom->id[0] = ERASER_DEVICE_ID; -+ } else { -+ wacom->tool[0] = BTN_TOOL_PEN; -+ wacom->id[0] = STYLUS_DEVICE_ID; -+ } -+ wacom->shared->stylus_in_proximity = true; -+ } -+ x = le16_to_cpup((__le16 *)&data[2]); -+ y = le16_to_cpup((__le16 *)&data[4]); -+ p = le16_to_cpup((__le16 *)&data[6]); -+ d = data[8]; -+ pen = data[1] & 0x01; -+ btn1 = data[1] & 0x02; -+ btn2 = data[1] & 0x04; -+ } -+ -+ input_report_key(input, BTN_TOUCH, pen); -+ input_report_key(input, BTN_STYLUS, btn1); -+ input_report_key(input, BTN_STYLUS2, btn2); -+ -+ input_report_abs(input, ABS_X, x); -+ input_report_abs(input, ABS_Y, y); -+ input_report_abs(input, ABS_PRESSURE, p); -+ input_report_abs(input, ABS_DISTANCE, d); -+ -+ if (!prox) { -+ wacom->id[0] = 0; -+ wacom->shared->stylus_in_proximity = false; -+ } -+ -+ input_report_key(input, wacom->tool[0], prox); /* PEN or RUBBER */ -+ input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */ -+ -+ return 1; -+} -+ - static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) - { - if (len == WACOM_PKGLEN_BBTOUCH) - return wacom_bpt_touch(wacom); -+ else if (len == WACOM_PKGLEN_BBFUN) -+ return wacom_bpt_pen(wacom); - - return 0; - } -@@ -1193,6 +1258,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, - features->pressure_fuzz, 0); - input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0, - MAX_TRACKING_ID, 0, 0); -+ } else if (features->device_type == BTN_TOOL_PEN) { -+ __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); -+ __set_bit(BTN_TOOL_PEN, input_dev->keybit); -+ __set_bit(BTN_STYLUS, input_dev->keybit); -+ __set_bit(BTN_STYLUS2, input_dev->keybit); - } - break; - } -@@ -1334,6 +1404,12 @@ static const struct wacom_features wacom_features_0x47 = - { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; - static struct wacom_features wacom_features_0xD0 = - { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; -+static struct wacom_features wacom_features_0xD1 = -+ { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; -+static struct wacom_features wacom_features_0xD2 = -+ { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; -+static struct wacom_features wacom_features_0xD3 = -+ { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; - - #define USB_DEVICE_WACOM(prod) \ - USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ -@@ -1399,6 +1475,9 @@ const struct usb_device_id wacom_ids[] = { - { USB_DEVICE_WACOM(0xC7) }, - { USB_DEVICE_WACOM(0xCE) }, - { USB_DEVICE_WACOM(0xD0) }, -+ { USB_DEVICE_WACOM(0xD1) }, -+ { USB_DEVICE_WACOM(0xD2) }, -+ { USB_DEVICE_WACOM(0xD3) }, - { USB_DEVICE_WACOM(0xF0) }, - { USB_DEVICE_WACOM(0xCC) }, - { USB_DEVICE_WACOM(0x90) }, diff --git a/wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch b/wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch deleted file mode 100644 index e14954031..000000000 --- a/wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Chris Bagwell -Date: Sun, 12 Sep 2010 07:12:28 +0000 (-0700) -Subject: Input: wacom - disable Bamboo touchpad when pen is being used -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdtor%2Finput.git;a=commitdiff_plain;h=33d5f713a19b0f5cb93e0594f7206d2730cf39da - -Input: wacom - disable Bamboo touchpad when pen is being used - -Signed-off-by: Chris Bagwell -Acked-by: Ping Cheng -Signed-off-by: Dmitry Torokhov ---- - -diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c -index 536156b..e1b65ba 100644 ---- a/drivers/input/tablet/wacom_wac.c -+++ b/drivers/input/tablet/wacom_wac.c -@@ -866,7 +866,13 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) - for (i = 0; i < 2; i++) { - int p = data[9 * i + 2]; - input_mt_slot(input, i); -- if (p) { -+ /* -+ * Touch events need to be disabled while stylus is -+ * in proximity because user's hand is resting on touchpad -+ * and sending unwanted events. User expects tablet buttons -+ * to continue working though. -+ */ -+ if (p && !wacom->shared->stylus_in_proximity) { - int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; - int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; - if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { diff --git a/xhci_hcd-suspend-resume.patch b/xhci_hcd-suspend-resume.patch deleted file mode 100644 index ffbaeb421..000000000 --- a/xhci_hcd-suspend-resume.patch +++ /dev/null @@ -1,1289 +0,0 @@ -commit 5e5563661948c57f72cc16b3a0cc5dc205ed4900 -Author: Andiry Xu -Date: Thu Oct 14 07:23:06 2010 -0700 - - USB: xHCI: PCI power management implementation - - This patch implements the PCI suspend/resume. - - Please refer to xHCI spec for doing the suspend/resume operation. - - For S3, CSS/SRS in USBCMD is used to save/restore the internal state. - However, an error maybe occurs while restoring the internal state. - In this case, it means that HC internal state is wrong and HC will be - re-initialized. - - Signed-off-by: Libin Yang - Signed-off-by: Dong Nguyen - Signed-off-by: Andiry Xu - Signed-off-by: Sarah Sharp - Signed-off-by: Greg Kroah-Hartman - -commit 96520f33d383c9a3ba1ca571cac5fa75325728f5 -Author: Andiry Xu -Date: Thu Oct 14 07:23:03 2010 -0700 - - USB: xHCI: bus power management implementation - - This patch implements xHCI bus suspend/resume function hook. - - In the patch it goes through all the ports and suspend/resume - the ports if needed. - - If any port is in remote wakeup, abort bus suspend as what ehci/ohci do. - - Signed-off-by: Libin Yang - Signed-off-by: Crane Cai - Signed-off-by: Andiry Xu - Signed-off-by: Sarah Sharp - Signed-off-by: Greg Kroah-Hartman - -commit 7b29198e193ab6f5e8bfcd48c59340b8c7689f5c -Author: Andiry Xu -Date: Thu Oct 14 07:23:00 2010 -0700 - - USB: xHCI: port remote wakeup implementation - - This commit implements port remote wakeup. - - When a port is in U3 state and resume signaling is detected from a device, - the port transitions to the Resume state, and the xHC generates a Port Status - Change Event. - - For USB3 port, software write a '0' to the PLS field to complete the resume - signaling. For USB2 port, the resume should be signaling for at least 20ms, - irq handler set a timer for port remote wakeup, and then finishes process in - hub_control GetPortStatus. - - Some codes are borrowed from EHCI code. - - Signed-off-by: Andiry Xu - Signed-off-by: Sarah Sharp - Signed-off-by: Greg Kroah-Hartman - -commit 9ada0dec259dfe796a757ff2c9b63a05e6408e5f -Author: Andiry Xu -Date: Thu Oct 14 07:22:57 2010 -0700 - - USB: xHCI: port power management implementation - - Add software trigger USB device suspend resume function hook. - Do port suspend & resume in terms of xHCI spec. - - Port Suspend: - Stop all endpoints via Stop Endpoint Command with Suspend (SP) flag set. - Place individual ports into suspend mode by writing '3' for Port Link State - (PLS) field into PORTSC register. This can only be done when the port is in - Enabled state. When writing, the Port Link State Write Strobe (LWS) bit shall - be set to '1'. - Allocate an xhci_command and stash it in xhci_virt_device to wait completion for - the last Stop Endpoint Command. Use the Suspend bit in TRB to indicate the Stop - Endpoint Command is for port suspend. Based on Sarah's suggestion. - - Port Resume: - Write '0' in PLS field, device will transition to running state. - Ring an endpoints' doorbell to restart it. - - Ref: USB device remote wake need another patch to implement. For details of - how USB subsystem do power management, please see: - Documentation/usb/power-management.txt - - Signed-off-by: Crane Cai - Signed-off-by: Libin Yang - Signed-off-by: Andiry Xu - Signed-off-by: Sarah Sharp - Signed-off-by: Greg Kroah-Hartman - - drivers/usb/host/xhci-hub.c | 424 +++++++++++++++++++++++++++++++++++++++++- - drivers/usb/host/xhci-mem.c | 4 + - drivers/usb/host/xhci-pci.c | 36 ++++- - drivers/usb/host/xhci-ring.c | 101 +++++++++- - drivers/usb/host/xhci.c | 212 +++++++++++++++++++++- - drivers/usb/host/xhci.h | 46 +++++- - 6 files changed, 805 insertions(+), 18 deletions(-) - -diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c -index a1a7a97..7f2f63c 100644 ---- a/drivers/usb/host/xhci-hub.c -+++ b/drivers/usb/host/xhci-hub.c -@@ -24,6 +24,10 @@ - - #include "xhci.h" - -+#define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E) -+#define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ -+ PORT_RC | PORT_PLC | PORT_PE) -+ - static void xhci_hub_descriptor(struct xhci_hcd *xhci, - struct usb_hub_descriptor *desc) - { -@@ -123,12 +127,105 @@ static unsigned int xhci_port_speed(unsigned int port_status) - * writing a 0 clears the bit and writing a 1 sets the bit (RWS). - * For all other types (RW1S, RW1CS, RW, and RZ), writing a '0' has no effect. - */ --static u32 xhci_port_state_to_neutral(u32 state) -+u32 xhci_port_state_to_neutral(u32 state) - { - /* Save read-only status and port state */ - return (state & XHCI_PORT_RO) | (state & XHCI_PORT_RWS); - } - -+/* -+ * find slot id based on port number. -+ */ -+int xhci_find_slot_id_by_port(struct xhci_hcd *xhci, u16 port) -+{ -+ int slot_id; -+ int i; -+ -+ slot_id = 0; -+ for (i = 0; i < MAX_HC_SLOTS; i++) { -+ if (!xhci->devs[i]) -+ continue; -+ if (xhci->devs[i]->port == port) { -+ slot_id = i; -+ break; -+ } -+ } -+ -+ return slot_id; -+} -+ -+/* -+ * Stop device -+ * It issues stop endpoint command for EP 0 to 30. And wait the last command -+ * to complete. -+ * suspend will set to 1, if suspend bit need to set in command. -+ */ -+static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend) -+{ -+ struct xhci_virt_device *virt_dev; -+ struct xhci_command *cmd; -+ unsigned long flags; -+ int timeleft; -+ int ret; -+ int i; -+ -+ ret = 0; -+ virt_dev = xhci->devs[slot_id]; -+ cmd = xhci_alloc_command(xhci, false, true, GFP_NOIO); -+ if (!cmd) { -+ xhci_dbg(xhci, "Couldn't allocate command structure.\n"); -+ return -ENOMEM; -+ } -+ -+ spin_lock_irqsave(&xhci->lock, flags); -+ for (i = LAST_EP_INDEX; i > 0; i--) { -+ if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue) -+ xhci_queue_stop_endpoint(xhci, slot_id, i, suspend); -+ } -+ cmd->command_trb = xhci->cmd_ring->enqueue; -+ list_add_tail(&cmd->cmd_list, &virt_dev->cmd_list); -+ xhci_queue_stop_endpoint(xhci, slot_id, 0, suspend); -+ xhci_ring_cmd_db(xhci); -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ -+ /* Wait for last stop endpoint command to finish */ -+ timeleft = wait_for_completion_interruptible_timeout( -+ cmd->completion, -+ USB_CTRL_SET_TIMEOUT); -+ if (timeleft <= 0) { -+ xhci_warn(xhci, "%s while waiting for stop endpoint command\n", -+ timeleft == 0 ? "Timeout" : "Signal"); -+ spin_lock_irqsave(&xhci->lock, flags); -+ /* The timeout might have raced with the event ring handler, so -+ * only delete from the list if the item isn't poisoned. -+ */ -+ if (cmd->cmd_list.next != LIST_POISON1) -+ list_del(&cmd->cmd_list); -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ ret = -ETIME; -+ goto command_cleanup; -+ } -+ -+command_cleanup: -+ xhci_free_command(xhci, cmd); -+ return ret; -+} -+ -+/* -+ * Ring device, it rings the all doorbells unconditionally. -+ */ -+void xhci_ring_device(struct xhci_hcd *xhci, int slot_id) -+{ -+ int i; -+ -+ for (i = 0; i < LAST_EP_INDEX + 1; i++) -+ if (xhci->devs[slot_id]->eps[i].ring && -+ xhci->devs[slot_id]->eps[i].ring->dequeue) -+ xhci_ring_ep_doorbell(xhci, slot_id, i, 0); -+ -+ return; -+} -+ - static void xhci_disable_port(struct xhci_hcd *xhci, u16 wIndex, - u32 __iomem *addr, u32 port_status) - { -@@ -162,6 +259,10 @@ static void xhci_clear_port_change_bit(struct xhci_hcd *xhci, u16 wValue, - status = PORT_PEC; - port_change_bit = "enable/disable"; - break; -+ case USB_PORT_FEAT_C_SUSPEND: -+ status = PORT_PLC; -+ port_change_bit = "suspend/resume"; -+ break; - default: - /* Should never happen */ - return; -@@ -179,9 +280,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, - struct xhci_hcd *xhci = hcd_to_xhci(hcd); - int ports; - unsigned long flags; -- u32 temp, status; -+ u32 temp, temp1, status; - int retval = 0; - u32 __iomem *addr; -+ int slot_id; - - ports = HCS_MAX_PORTS(xhci->hcs_params1); - -@@ -211,9 +313,49 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, - if ((temp & PORT_OCC)) - status |= USB_PORT_STAT_C_OVERCURRENT << 16; - /* -- * FIXME ignoring suspend, reset, and USB 2.1/3.0 specific -+ * FIXME ignoring reset and USB 2.1/3.0 specific - * changes - */ -+ if ((temp & PORT_PLS_MASK) == XDEV_U3 -+ && (temp & PORT_POWER)) -+ status |= 1 << USB_PORT_FEAT_SUSPEND; -+ if ((temp & PORT_PLS_MASK) == XDEV_RESUME) { -+ if ((temp & PORT_RESET) || !(temp & PORT_PE)) -+ goto error; -+ if (!DEV_SUPERSPEED(temp) && time_after_eq(jiffies, -+ xhci->resume_done[wIndex])) { -+ xhci_dbg(xhci, "Resume USB2 port %d\n", -+ wIndex + 1); -+ xhci->resume_done[wIndex] = 0; -+ temp1 = xhci_port_state_to_neutral(temp); -+ temp1 &= ~PORT_PLS_MASK; -+ temp1 |= PORT_LINK_STROBE | XDEV_U0; -+ xhci_writel(xhci, temp1, addr); -+ -+ xhci_dbg(xhci, "set port %d resume\n", -+ wIndex + 1); -+ slot_id = xhci_find_slot_id_by_port(xhci, -+ wIndex + 1); -+ if (!slot_id) { -+ xhci_dbg(xhci, "slot_id is zero\n"); -+ goto error; -+ } -+ xhci_ring_device(xhci, slot_id); -+ xhci->port_c_suspend[wIndex >> 5] |= -+ 1 << (wIndex & 31); -+ xhci->suspended_ports[wIndex >> 5] &= -+ ~(1 << (wIndex & 31)); -+ } -+ } -+ if ((temp & PORT_PLS_MASK) == XDEV_U0 -+ && (temp & PORT_POWER) -+ && (xhci->suspended_ports[wIndex >> 5] & -+ (1 << (wIndex & 31)))) { -+ xhci->suspended_ports[wIndex >> 5] &= -+ ~(1 << (wIndex & 31)); -+ xhci->port_c_suspend[wIndex >> 5] |= -+ 1 << (wIndex & 31); -+ } - if (temp & PORT_CONNECT) { - status |= USB_PORT_STAT_CONNECTION; - status |= xhci_port_speed(temp); -@@ -226,6 +368,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, - status |= USB_PORT_STAT_RESET; - if (temp & PORT_POWER) - status |= USB_PORT_STAT_POWER; -+ if (xhci->port_c_suspend[wIndex >> 5] & (1 << (wIndex & 31))) -+ status |= 1 << USB_PORT_FEAT_C_SUSPEND; - xhci_dbg(xhci, "Get port status returned 0x%x\n", status); - put_unaligned(cpu_to_le32(status), (__le32 *) buf); - break; -@@ -238,6 +382,42 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, - temp = xhci_readl(xhci, addr); - temp = xhci_port_state_to_neutral(temp); - switch (wValue) { -+ case USB_PORT_FEAT_SUSPEND: -+ temp = xhci_readl(xhci, addr); -+ /* In spec software should not attempt to suspend -+ * a port unless the port reports that it is in the -+ * enabled (PED = ‘1’,PLS < ‘3’) state. -+ */ -+ if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) -+ || (temp & PORT_PLS_MASK) >= XDEV_U3) { -+ xhci_warn(xhci, "USB core suspending device " -+ "not in U0/U1/U2.\n"); -+ goto error; -+ } -+ -+ slot_id = xhci_find_slot_id_by_port(xhci, wIndex + 1); -+ if (!slot_id) { -+ xhci_warn(xhci, "slot_id is zero\n"); -+ goto error; -+ } -+ /* unlock to execute stop endpoint commands */ -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ xhci_stop_device(xhci, slot_id, 1); -+ spin_lock_irqsave(&xhci->lock, flags); -+ -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_U3; -+ xhci_writel(xhci, temp, addr); -+ -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ msleep(10); /* wait device to enter */ -+ spin_lock_irqsave(&xhci->lock, flags); -+ -+ temp = xhci_readl(xhci, addr); -+ xhci->suspended_ports[wIndex >> 5] |= -+ 1 << (wIndex & (31)); -+ break; - case USB_PORT_FEAT_POWER: - /* - * Turn on ports, even if there isn't per-port switching. -@@ -271,6 +451,52 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, - temp = xhci_readl(xhci, addr); - temp = xhci_port_state_to_neutral(temp); - switch (wValue) { -+ case USB_PORT_FEAT_SUSPEND: -+ temp = xhci_readl(xhci, addr); -+ xhci_dbg(xhci, "clear USB_PORT_FEAT_SUSPEND\n"); -+ xhci_dbg(xhci, "PORTSC %04x\n", temp); -+ if (temp & PORT_RESET) -+ goto error; -+ if (temp & XDEV_U3) { -+ if ((temp & PORT_PE) == 0) -+ goto error; -+ if (DEV_SUPERSPEED(temp)) { -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_U0; -+ xhci_writel(xhci, temp, addr); -+ xhci_readl(xhci, addr); -+ } else { -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_RESUME; -+ xhci_writel(xhci, temp, addr); -+ -+ spin_unlock_irqrestore(&xhci->lock, -+ flags); -+ msleep(20); -+ spin_lock_irqsave(&xhci->lock, flags); -+ -+ temp = xhci_readl(xhci, addr); -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_U0; -+ xhci_writel(xhci, temp, addr); -+ } -+ xhci->port_c_suspend[wIndex >> 5] |= -+ 1 << (wIndex & 31); -+ } -+ -+ slot_id = xhci_find_slot_id_by_port(xhci, wIndex + 1); -+ if (!slot_id) { -+ xhci_dbg(xhci, "slot_id is zero\n"); -+ goto error; -+ } -+ xhci_ring_device(xhci, slot_id); -+ break; -+ case USB_PORT_FEAT_C_SUSPEND: -+ xhci->port_c_suspend[wIndex >> 5] &= -+ ~(1 << (wIndex & 31)); - case USB_PORT_FEAT_C_RESET: - case USB_PORT_FEAT_C_CONNECTION: - case USB_PORT_FEAT_C_OVER_CURRENT: -@@ -306,6 +532,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) - { - unsigned long flags; - u32 temp, status; -+ u32 mask; - int i, retval; - struct xhci_hcd *xhci = hcd_to_xhci(hcd); - int ports; -@@ -318,13 +545,18 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) - memset(buf, 0, retval); - status = 0; - -+ mask = PORT_CSC | PORT_PEC | PORT_OCC; -+ - spin_lock_irqsave(&xhci->lock, flags); - /* For each port, did anything change? If so, set that bit in buf. */ - for (i = 0; i < ports; i++) { - addr = &xhci->op_regs->port_status_base + - NUM_PORT_REGS*i; - temp = xhci_readl(xhci, addr); -- if (temp & (PORT_CSC | PORT_PEC | PORT_OCC)) { -+ if ((temp & mask) != 0 || -+ (xhci->port_c_suspend[i >> 5] & 1 << (i & 31)) || -+ (xhci->resume_done[i] && time_after_eq( -+ jiffies, xhci->resume_done[i]))) { - buf[(i + 1) / 8] |= 1 << (i + 1) % 8; - status = 1; - } -@@ -332,3 +564,187 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) - spin_unlock_irqrestore(&xhci->lock, flags); - return status ? retval : 0; - } -+ -+#ifdef CONFIG_PM -+ -+int xhci_bus_suspend(struct usb_hcd *hcd) -+{ -+ struct xhci_hcd *xhci = hcd_to_xhci(hcd); -+ int port; -+ unsigned long flags; -+ -+ xhci_dbg(xhci, "suspend root hub\n"); -+ -+ spin_lock_irqsave(&xhci->lock, flags); -+ -+ if (hcd->self.root_hub->do_remote_wakeup) { -+ port = HCS_MAX_PORTS(xhci->hcs_params1); -+ while (port--) { -+ if (xhci->resume_done[port] != 0) { -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ xhci_dbg(xhci, "suspend failed because " -+ "port %d is resuming\n", -+ port + 1); -+ return -EBUSY; -+ } -+ } -+ } -+ -+ port = HCS_MAX_PORTS(xhci->hcs_params1); -+ xhci->bus_suspended = 0; -+ while (port--) { -+ /* suspend the port if the port is not suspended */ -+ u32 __iomem *addr; -+ u32 t1, t2; -+ int slot_id; -+ -+ addr = &xhci->op_regs->port_status_base + -+ NUM_PORT_REGS * (port & 0xff); -+ t1 = xhci_readl(xhci, addr); -+ t2 = xhci_port_state_to_neutral(t1); -+ -+ if ((t1 & PORT_PE) && !(t1 & PORT_PLS_MASK)) { -+ xhci_dbg(xhci, "port %d not suspended\n", port); -+ slot_id = xhci_find_slot_id_by_port(xhci, port + 1); -+ if (slot_id) { -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ xhci_stop_device(xhci, slot_id, 1); -+ spin_lock_irqsave(&xhci->lock, flags); -+ } -+ t2 &= ~PORT_PLS_MASK; -+ t2 |= PORT_LINK_STROBE | XDEV_U3; -+ set_bit(port, &xhci->bus_suspended); -+ } -+ if (hcd->self.root_hub->do_remote_wakeup) { -+ if (t1 & PORT_CONNECT) { -+ t2 |= PORT_WKOC_E | PORT_WKDISC_E; -+ t2 &= ~PORT_WKCONN_E; -+ } else { -+ t2 |= PORT_WKOC_E | PORT_WKCONN_E; -+ t2 &= ~PORT_WKDISC_E; -+ } -+ } else -+ t2 &= ~PORT_WAKE_BITS; -+ -+ t1 = xhci_port_state_to_neutral(t1); -+ if (t1 != t2) -+ xhci_writel(xhci, t2, addr); -+ -+ if (DEV_HIGHSPEED(t1)) { -+ /* enable remote wake up for USB 2.0 */ -+ u32 __iomem *addr; -+ u32 tmp; -+ -+ addr = &xhci->op_regs->port_power_base + -+ NUM_PORT_REGS * (port & 0xff); -+ tmp = xhci_readl(xhci, addr); -+ tmp |= PORT_RWE; -+ xhci_writel(xhci, tmp, addr); -+ } -+ } -+ hcd->state = HC_STATE_SUSPENDED; -+ xhci->next_statechange = jiffies + msecs_to_jiffies(10); -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ return 0; -+} -+ -+int xhci_bus_resume(struct usb_hcd *hcd) -+{ -+ struct xhci_hcd *xhci = hcd_to_xhci(hcd); -+ int port; -+ u32 temp; -+ unsigned long flags; -+ -+ xhci_dbg(xhci, "resume root hub\n"); -+ -+ if (time_before(jiffies, xhci->next_statechange)) -+ msleep(5); -+ -+ spin_lock_irqsave(&xhci->lock, flags); -+ if (!HCD_HW_ACCESSIBLE(hcd)) { -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ return -ESHUTDOWN; -+ } -+ -+ /* delay the irqs */ -+ temp = xhci_readl(xhci, &xhci->op_regs->command); -+ temp &= ~CMD_EIE; -+ xhci_writel(xhci, temp, &xhci->op_regs->command); -+ -+ port = HCS_MAX_PORTS(xhci->hcs_params1); -+ while (port--) { -+ /* Check whether need resume ports. If needed -+ resume port and disable remote wakeup */ -+ u32 __iomem *addr; -+ u32 temp; -+ int slot_id; -+ -+ addr = &xhci->op_regs->port_status_base + -+ NUM_PORT_REGS * (port & 0xff); -+ temp = xhci_readl(xhci, addr); -+ if (DEV_SUPERSPEED(temp)) -+ temp &= ~(PORT_RWC_BITS | PORT_CEC | PORT_WAKE_BITS); -+ else -+ temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS); -+ if (test_bit(port, &xhci->bus_suspended) && -+ (temp & PORT_PLS_MASK)) { -+ if (DEV_SUPERSPEED(temp)) { -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_U0; -+ xhci_writel(xhci, temp, addr); -+ } else { -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_RESUME; -+ xhci_writel(xhci, temp, addr); -+ -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ msleep(20); -+ spin_lock_irqsave(&xhci->lock, flags); -+ -+ temp = xhci_readl(xhci, addr); -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_U0; -+ xhci_writel(xhci, temp, addr); -+ } -+ slot_id = xhci_find_slot_id_by_port(xhci, port + 1); -+ if (slot_id) -+ xhci_ring_device(xhci, slot_id); -+ } else -+ xhci_writel(xhci, temp, addr); -+ -+ if (DEV_HIGHSPEED(temp)) { -+ /* disable remote wake up for USB 2.0 */ -+ u32 __iomem *addr; -+ u32 tmp; -+ -+ addr = &xhci->op_regs->port_power_base + -+ NUM_PORT_REGS * (port & 0xff); -+ tmp = xhci_readl(xhci, addr); -+ tmp &= ~PORT_RWE; -+ xhci_writel(xhci, tmp, addr); -+ } -+ } -+ -+ (void) xhci_readl(xhci, &xhci->op_regs->command); -+ -+ xhci->next_statechange = jiffies + msecs_to_jiffies(5); -+ hcd->state = HC_STATE_RUNNING; -+ /* re-enable irqs */ -+ temp = xhci_readl(xhci, &xhci->op_regs->command); -+ temp |= CMD_EIE; -+ xhci_writel(xhci, temp, &xhci->op_regs->command); -+ temp = xhci_readl(xhci, &xhci->op_regs->command); -+ -+ spin_unlock_irqrestore(&xhci->lock, flags); -+ return 0; -+} -+ -+#else -+ -+#define xhci_bus_suspend NULL -+#define xhci_bus_resume NULL -+ -+#endif -diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c -index 4e51343..cef8d81 100644 ---- a/drivers/usb/host/xhci-mem.c -+++ b/drivers/usb/host/xhci-mem.c -@@ -866,6 +866,7 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud - top_dev = top_dev->parent) - /* Found device below root hub */; - slot_ctx->dev_info2 |= (u32) ROOT_HUB_PORT(top_dev->portnum); -+ dev->port = top_dev->portnum; - xhci_dbg(xhci, "Set root hub portnum to %d\n", top_dev->portnum); - - /* Is this a LS/FS device under a HS hub? */ -@@ -1443,6 +1444,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) - scratchpad_free(xhci); - xhci->page_size = 0; - xhci->page_shift = 0; -+ xhci->bus_suspended = 0; - } - - static int xhci_test_trb_in_td(struct xhci_hcd *xhci, -@@ -1801,6 +1803,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) - init_completion(&xhci->addr_dev); - for (i = 0; i < MAX_HC_SLOTS; ++i) - xhci->devs[i] = NULL; -+ for (i = 0; i < MAX_HC_PORTS; ++i) -+ xhci->resume_done[i] = 0; - - if (scratchpad_alloc(xhci, flags)) - goto fail; -diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c -index f7efe02..e3a5924 100644 ---- a/drivers/usb/host/xhci-pci.c -+++ b/drivers/usb/host/xhci-pci.c -@@ -116,6 +116,30 @@ static int xhci_pci_setup(struct usb_hcd *hcd) - return xhci_pci_reinit(xhci, pdev); - } - -+#ifdef CONFIG_PM -+static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) -+{ -+ struct xhci_hcd *xhci = hcd_to_xhci(hcd); -+ int retval = 0; -+ -+ if (hcd->state != HC_STATE_SUSPENDED) -+ return -EINVAL; -+ -+ retval = xhci_suspend(xhci); -+ -+ return retval; -+} -+ -+static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated) -+{ -+ struct xhci_hcd *xhci = hcd_to_xhci(hcd); -+ int retval = 0; -+ -+ retval = xhci_resume(xhci, hibernated); -+ return retval; -+} -+#endif /* CONFIG_PM */ -+ - static const struct hc_driver xhci_pci_hc_driver = { - .description = hcd_name, - .product_desc = "xHCI Host Controller", -@@ -132,7 +156,10 @@ static const struct hc_driver xhci_pci_hc_driver = { - */ - .reset = xhci_pci_setup, - .start = xhci_run, -- /* suspend and resume implemented later */ -+#ifdef CONFIG_PM -+ .pci_suspend = xhci_pci_suspend, -+ .pci_resume = xhci_pci_resume, -+#endif - .stop = xhci_stop, - .shutdown = xhci_shutdown, - -@@ -162,6 +189,8 @@ static const struct hc_driver xhci_pci_hc_driver = { - /* Root hub support */ - .hub_control = xhci_hub_control, - .hub_status_data = xhci_hub_status_data, -+ .bus_suspend = xhci_bus_suspend, -+ .bus_resume = xhci_bus_resume, - }; - - /*-------------------------------------------------------------------------*/ -@@ -186,6 +215,11 @@ static struct pci_driver xhci_pci_driver = { - /* suspend and resume implemented later */ - - .shutdown = usb_hcd_pci_shutdown, -+#ifdef CONFIG_PM_SLEEP -+ .driver = { -+ .pm = &usb_hcd_pci_pm_ops -+ }, -+#endif - }; - - int xhci_register_pci(void) -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 48e60d1..9f3115e 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -68,6 +68,10 @@ - #include - #include "xhci.h" - -+static int handle_cmd_in_cmd_wait_list(struct xhci_hcd *xhci, -+ struct xhci_virt_device *virt_dev, -+ struct xhci_event_cmd *event); -+ - /* - * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA - * address of the TRB. -@@ -313,7 +317,7 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci) - xhci_readl(xhci, &xhci->dba->doorbell[0]); - } - --static void ring_ep_doorbell(struct xhci_hcd *xhci, -+void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, - unsigned int slot_id, - unsigned int ep_index, - unsigned int stream_id) -@@ -353,7 +357,7 @@ static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci, - /* A ring has pending URBs if its TD list is not empty */ - if (!(ep->ep_state & EP_HAS_STREAMS)) { - if (!(list_empty(&ep->ring->td_list))) -- ring_ep_doorbell(xhci, slot_id, ep_index, 0); -+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index, 0); - return; - } - -@@ -361,7 +365,8 @@ static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci, - stream_id++) { - struct xhci_stream_info *stream_info = ep->stream_info; - if (!list_empty(&stream_info->stream_rings[stream_id]->td_list)) -- ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); -+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index, -+ stream_id); - } - } - -@@ -626,10 +631,11 @@ static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci, - * bit cleared) so that the HW will skip over them. - */ - static void handle_stopped_endpoint(struct xhci_hcd *xhci, -- union xhci_trb *trb) -+ union xhci_trb *trb, struct xhci_event_cmd *event) - { - unsigned int slot_id; - unsigned int ep_index; -+ struct xhci_virt_device *virt_dev; - struct xhci_ring *ep_ring; - struct xhci_virt_ep *ep; - struct list_head *entry; -@@ -638,6 +644,21 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci, - - struct xhci_dequeue_state deq_state; - -+ if (unlikely(TRB_TO_SUSPEND_PORT( -+ xhci->cmd_ring->dequeue->generic.field[3]))) { -+ slot_id = TRB_TO_SLOT_ID( -+ xhci->cmd_ring->dequeue->generic.field[3]); -+ virt_dev = xhci->devs[slot_id]; -+ if (virt_dev) -+ handle_cmd_in_cmd_wait_list(xhci, virt_dev, -+ event); -+ else -+ xhci_warn(xhci, "Stop endpoint command " -+ "completion for disabled slot %u\n", -+ slot_id); -+ return; -+ } -+ - memset(&deq_state, 0, sizeof(deq_state)); - slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]); - ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]); -@@ -1091,7 +1112,7 @@ bandwidth_change: - complete(&xhci->addr_dev); - break; - case TRB_TYPE(TRB_STOP_RING): -- handle_stopped_endpoint(xhci, xhci->cmd_ring->dequeue); -+ handle_stopped_endpoint(xhci, xhci->cmd_ring->dequeue, event); - break; - case TRB_TYPE(TRB_SET_DEQ): - handle_set_deq_completion(xhci, event, xhci->cmd_ring->dequeue); -@@ -1144,17 +1165,72 @@ static void handle_vendor_event(struct xhci_hcd *xhci, - static void handle_port_status(struct xhci_hcd *xhci, - union xhci_trb *event) - { -+ struct usb_hcd *hcd = xhci_to_hcd(xhci); - u32 port_id; -+ u32 temp, temp1; -+ u32 __iomem *addr; -+ int ports; -+ int slot_id; - - /* Port status change events always have a successful completion code */ - if (GET_COMP_CODE(event->generic.field[2]) != COMP_SUCCESS) { - xhci_warn(xhci, "WARN: xHC returned failed port status event\n"); - xhci->error_bitmask |= 1 << 8; - } -- /* FIXME: core doesn't care about all port link state changes yet */ - port_id = GET_PORT_ID(event->generic.field[0]); - xhci_dbg(xhci, "Port Status Change Event for port %d\n", port_id); - -+ ports = HCS_MAX_PORTS(xhci->hcs_params1); -+ if ((port_id <= 0) || (port_id > ports)) { -+ xhci_warn(xhci, "Invalid port id %d\n", port_id); -+ goto cleanup; -+ } -+ -+ addr = &xhci->op_regs->port_status_base + NUM_PORT_REGS * (port_id - 1); -+ temp = xhci_readl(xhci, addr); -+ if ((temp & PORT_CONNECT) && (hcd->state == HC_STATE_SUSPENDED)) { -+ xhci_dbg(xhci, "resume root hub\n"); -+ usb_hcd_resume_root_hub(hcd); -+ } -+ -+ if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) { -+ xhci_dbg(xhci, "port resume event for port %d\n", port_id); -+ -+ temp1 = xhci_readl(xhci, &xhci->op_regs->command); -+ if (!(temp1 & CMD_RUN)) { -+ xhci_warn(xhci, "xHC is not running.\n"); -+ goto cleanup; -+ } -+ -+ if (DEV_SUPERSPEED(temp)) { -+ xhci_dbg(xhci, "resume SS port %d\n", port_id); -+ temp = xhci_port_state_to_neutral(temp); -+ temp &= ~PORT_PLS_MASK; -+ temp |= PORT_LINK_STROBE | XDEV_U0; -+ xhci_writel(xhci, temp, addr); -+ slot_id = xhci_find_slot_id_by_port(xhci, port_id); -+ if (!slot_id) { -+ xhci_dbg(xhci, "slot_id is zero\n"); -+ goto cleanup; -+ } -+ xhci_ring_device(xhci, slot_id); -+ xhci_dbg(xhci, "resume SS port %d finished\n", port_id); -+ /* Clear PORT_PLC */ -+ temp = xhci_readl(xhci, addr); -+ temp = xhci_port_state_to_neutral(temp); -+ temp |= PORT_PLC; -+ xhci_writel(xhci, temp, addr); -+ } else { -+ xhci_dbg(xhci, "resume HS port %d\n", port_id); -+ xhci->resume_done[port_id - 1] = jiffies + -+ msecs_to_jiffies(20); -+ mod_timer(&hcd->rh_timer, -+ xhci->resume_done[port_id - 1]); -+ /* Do the rest in GetPortStatus */ -+ } -+ } -+ -+cleanup: - /* Update event ring dequeue pointer before dropping the lock */ - inc_deq(xhci, xhci->event_ring, true); - -@@ -2347,7 +2423,7 @@ static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id, - */ - wmb(); - start_trb->field[3] |= start_cycle; -- ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); -+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id); - } - - /* -@@ -2931,7 +3007,7 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, - wmb(); - start_trb->field[3] |= start_cycle; - -- ring_ep_doorbell(xhci, slot_id, ep_index, urb->stream_id); -+ xhci_ring_ep_doorbell(xhci, slot_id, ep_index, urb->stream_id); - return 0; - } - -@@ -3108,15 +3184,20 @@ int xhci_queue_evaluate_context(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, - false); - } - -+/* -+ * Suspend is set to indicate "Stop Endpoint Command" is being issued to stop -+ * activity on an endpoint that is about to be suspended. -+ */ - int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id, -- unsigned int ep_index) -+ unsigned int ep_index, int suspend) - { - u32 trb_slot_id = SLOT_ID_FOR_TRB(slot_id); - u32 trb_ep_index = EP_ID_FOR_TRB(ep_index); - u32 type = TRB_TYPE(TRB_STOP_RING); -+ u32 trb_suspend = SUSPEND_PORT_FOR_TRB(suspend); - - return queue_command(xhci, 0, 0, 0, -- trb_slot_id | trb_ep_index | type, false); -+ trb_slot_id | trb_ep_index | type | trb_suspend, false); - } - - /* Set Transfer Ring Dequeue Pointer command. -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index d5c550e..34f1b3b 100644 ---- a/drivers/usb/host/xhci.c -+++ b/drivers/usb/host/xhci.c -@@ -551,6 +551,216 @@ void xhci_shutdown(struct usb_hcd *hcd) - xhci_readl(xhci, &xhci->op_regs->status)); - } - -+static void xhci_save_registers(struct xhci_hcd *xhci) -+{ -+ xhci->s3.command = xhci_readl(xhci, &xhci->op_regs->command); -+ xhci->s3.dev_nt = xhci_readl(xhci, &xhci->op_regs->dev_notification); -+ xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr); -+ xhci->s3.config_reg = xhci_readl(xhci, &xhci->op_regs->config_reg); -+ xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending); -+ xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control); -+ xhci->s3.erst_size = xhci_readl(xhci, &xhci->ir_set->erst_size); -+ xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base); -+ xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); -+} -+ -+static void xhci_restore_registers(struct xhci_hcd *xhci) -+{ -+ xhci_writel(xhci, xhci->s3.command, &xhci->op_regs->command); -+ xhci_writel(xhci, xhci->s3.dev_nt, &xhci->op_regs->dev_notification); -+ xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr); -+ xhci_writel(xhci, xhci->s3.config_reg, &xhci->op_regs->config_reg); -+ xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending); -+ xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control); -+ xhci_writel(xhci, xhci->s3.erst_size, &xhci->ir_set->erst_size); -+ xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base); -+} -+ -+/* -+ * Stop HC (not bus-specific) -+ * -+ * This is called when the machine transition into S3/S4 mode. -+ * -+ */ -+int xhci_suspend(struct xhci_hcd *xhci) -+{ -+ int rc = 0; -+ struct usb_hcd *hcd = xhci_to_hcd(xhci); -+ u32 command; -+ -+ spin_lock_irq(&xhci->lock); -+ clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); -+ /* step 1: stop endpoint */ -+ /* skipped assuming that port suspend has done */ -+ -+ /* step 2: clear Run/Stop bit */ -+ command = xhci_readl(xhci, &xhci->op_regs->command); -+ command &= ~CMD_RUN; -+ xhci_writel(xhci, command, &xhci->op_regs->command); -+ if (handshake(xhci, &xhci->op_regs->status, -+ STS_HALT, STS_HALT, 100*100)) { -+ xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n"); -+ spin_unlock_irq(&xhci->lock); -+ return -ETIMEDOUT; -+ } -+ -+ /* step 3: save registers */ -+ xhci_save_registers(xhci); -+ -+ /* step 4: set CSS flag */ -+ command = xhci_readl(xhci, &xhci->op_regs->command); -+ command |= CMD_CSS; -+ xhci_writel(xhci, command, &xhci->op_regs->command); -+ if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10*100)) { -+ xhci_warn(xhci, "WARN: xHC CMD_CSS timeout\n"); -+ spin_unlock_irq(&xhci->lock); -+ return -ETIMEDOUT; -+ } -+ /* step 5: remove core well power */ -+ xhci_cleanup_msix(xhci); -+ spin_unlock_irq(&xhci->lock); -+ -+ return rc; -+} -+ -+/* -+ * start xHC (not bus-specific) -+ * -+ * This is called when the machine transition from S3/S4 mode. -+ * -+ */ -+int xhci_resume(struct xhci_hcd *xhci, bool hibernated) -+{ -+ u32 command, temp = 0; -+ struct usb_hcd *hcd = xhci_to_hcd(xhci); -+ struct pci_dev *pdev = to_pci_dev(hcd->self.controller); -+ u64 val_64; -+ int old_state, retval; -+ -+ old_state = hcd->state; -+ if (time_before(jiffies, xhci->next_statechange)) -+ msleep(100); -+ -+ spin_lock_irq(&xhci->lock); -+ -+ if (!hibernated) { -+ /* step 1: restore register */ -+ xhci_restore_registers(xhci); -+ /* step 2: initialize command ring buffer */ -+ val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); -+ val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) | -+ (xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, -+ xhci->cmd_ring->dequeue) & -+ (u64) ~CMD_RING_RSVD_BITS) | -+ xhci->cmd_ring->cycle_state; -+ xhci_dbg(xhci, "// Setting command ring address to 0x%llx\n", -+ (long unsigned long) val_64); -+ xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring); -+ /* step 3: restore state and start state*/ -+ /* step 3: set CRS flag */ -+ command = xhci_readl(xhci, &xhci->op_regs->command); -+ command |= CMD_CRS; -+ xhci_writel(xhci, command, &xhci->op_regs->command); -+ if (handshake(xhci, &xhci->op_regs->status, -+ STS_RESTORE, 0, 10*100)) { -+ xhci_dbg(xhci, "WARN: xHC CMD_CSS timeout\n"); -+ spin_unlock_irq(&xhci->lock); -+ return -ETIMEDOUT; -+ } -+ temp = xhci_readl(xhci, &xhci->op_regs->status); -+ } -+ -+ /* If restore operation fails, re-initialize the HC during resume */ -+ if ((temp & STS_SRE) || hibernated) { -+ usb_root_hub_lost_power(hcd->self.root_hub); -+ -+ xhci_dbg(xhci, "Stop HCD\n"); -+ xhci_halt(xhci); -+ xhci_reset(xhci); -+ if (hibernated) -+ xhci_cleanup_msix(xhci); -+ spin_unlock_irq(&xhci->lock); -+ -+#ifdef CONFIG_USB_XHCI_HCD_DEBUGGING -+ /* Tell the event ring poll function not to reschedule */ -+ xhci->zombie = 1; -+ del_timer_sync(&xhci->event_ring_timer); -+#endif -+ -+ xhci_dbg(xhci, "// Disabling event ring interrupts\n"); -+ temp = xhci_readl(xhci, &xhci->op_regs->status); -+ xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status); -+ temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); -+ xhci_writel(xhci, ER_IRQ_DISABLE(temp), -+ &xhci->ir_set->irq_pending); -+ xhci_print_ir_set(xhci, xhci->ir_set, 0); -+ -+ xhci_dbg(xhci, "cleaning up memory\n"); -+ xhci_mem_cleanup(xhci); -+ xhci_dbg(xhci, "xhci_stop completed - status = %x\n", -+ xhci_readl(xhci, &xhci->op_regs->status)); -+ -+ xhci_dbg(xhci, "Initialize the HCD\n"); -+ retval = xhci_init(hcd); -+ if (retval) -+ return retval; -+ -+ xhci_dbg(xhci, "Start the HCD\n"); -+ retval = xhci_run(hcd); -+ if (!retval) -+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); -+ hcd->state = HC_STATE_SUSPENDED; -+ return retval; -+ } -+ -+ /* Re-setup MSI-X */ -+ if (hcd->irq) -+ free_irq(hcd->irq, hcd); -+ hcd->irq = -1; -+ -+ retval = xhci_setup_msix(xhci); -+ if (retval) -+ /* fall back to msi*/ -+ retval = xhci_setup_msi(xhci); -+ -+ if (retval) { -+ /* fall back to legacy interrupt*/ -+ retval = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, -+ hcd->irq_descr, hcd); -+ if (retval) { -+ xhci_err(xhci, "request interrupt %d failed\n", -+ pdev->irq); -+ return retval; -+ } -+ hcd->irq = pdev->irq; -+ } -+ -+ /* step 4: set Run/Stop bit */ -+ command = xhci_readl(xhci, &xhci->op_regs->command); -+ command |= CMD_RUN; -+ xhci_writel(xhci, command, &xhci->op_regs->command); -+ handshake(xhci, &xhci->op_regs->status, STS_HALT, -+ 0, 250 * 1000); -+ -+ /* step 5: walk topology and initialize portsc, -+ * portpmsc and portli -+ */ -+ /* this is done in bus_resume */ -+ -+ /* step 6: restart each of the previously -+ * Running endpoints by ringing their doorbells -+ */ -+ -+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); -+ if (!hibernated) -+ hcd->state = old_state; -+ else -+ hcd->state = HC_STATE_SUSPENDED; -+ -+ spin_unlock_irq(&xhci->lock); -+ return 0; -+} -+ - /*-------------------------------------------------------------------------*/ - - /** -@@ -956,7 +1166,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) - ep->stop_cmd_timer.expires = jiffies + - XHCI_STOP_EP_CMD_TIMEOUT * HZ; - add_timer(&ep->stop_cmd_timer); -- xhci_queue_stop_endpoint(xhci, urb->dev->slot_id, ep_index); -+ xhci_queue_stop_endpoint(xhci, urb->dev->slot_id, ep_index, 0); - xhci_ring_cmd_db(xhci); - } - done: -diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 34a60d9..b6d8033 100644 ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -191,7 +191,7 @@ struct xhci_op_regs { - /* bits 4:6 are reserved (and should be preserved on writes). */ - /* light reset (port status stays unchanged) - reset completed when this is 0 */ - #define CMD_LRESET (1 << 7) --/* FIXME: ignoring host controller save/restore state for now. */ -+/* host controller save/restore state. */ - #define CMD_CSS (1 << 8) - #define CMD_CRS (1 << 9) - /* Enable Wrap Event - '1' means xHC generates an event when MFINDEX wraps. */ -@@ -269,6 +269,10 @@ struct xhci_op_regs { - * A read gives the current link PM state of the port, - * a write with Link State Write Strobe set sets the link state. - */ -+#define PORT_PLS_MASK (0xf << 5) -+#define XDEV_U0 (0x0 << 5) -+#define XDEV_U3 (0x3 << 5) -+#define XDEV_RESUME (0xf << 5) - /* true: port has power (see HCC_PPC) */ - #define PORT_POWER (1 << 9) - /* bits 10:13 indicate device speed: -@@ -353,6 +357,8 @@ struct xhci_op_regs { - #define PORT_U2_TIMEOUT(p) (((p) & 0xff) << 8) - /* Bits 24:31 for port testing */ - -+/* USB2 Protocol PORTSPMSC */ -+#define PORT_RWE (1 << 0x3) - - /** - * struct xhci_intr_reg - Interrupt Register Set -@@ -510,6 +516,7 @@ struct xhci_slot_ctx { - #define MAX_EXIT (0xffff) - /* Root hub port number that is needed to access the USB device */ - #define ROOT_HUB_PORT(p) (((p) & 0xff) << 16) -+#define DEVINFO_TO_ROOT_HUB_PORT(p) (((p) >> 16) & 0xff) - /* Maximum number of ports under a hub device */ - #define XHCI_MAX_PORTS(p) (((p) & 0xff) << 24) - -@@ -751,6 +758,7 @@ struct xhci_virt_device { - /* Status of the last command issued for this device */ - u32 cmd_status; - struct list_head cmd_list; -+ u8 port; - }; - - -@@ -881,6 +889,10 @@ struct xhci_event_cmd { - #define TRB_TO_EP_INDEX(p) ((((p) & (0x1f << 16)) >> 16) - 1) - #define EP_ID_FOR_TRB(p) ((((p) + 1) & 0x1f) << 16) - -+#define SUSPEND_PORT_FOR_TRB(p) (((p) & 1) << 23) -+#define TRB_TO_SUSPEND_PORT(p) (((p) & (1 << 23)) >> 23) -+#define LAST_EP_INDEX 30 -+ - /* Set TR Dequeue Pointer command TRB fields */ - #define TRB_TO_STREAM_ID(p) ((((p) & (0xffff << 16)) >> 16)) - #define STREAM_ID_FOR_TRB(p) ((((p)) & 0xffff) << 16) -@@ -1115,6 +1127,17 @@ struct urb_priv { - #define XHCI_STOP_EP_CMD_TIMEOUT 5 - /* XXX: Make these module parameters */ - -+struct s3_save { -+ u32 command; -+ u32 dev_nt; -+ u64 dcbaa_ptr; -+ u32 config_reg; -+ u32 irq_pending; -+ u32 irq_control; -+ u32 erst_size; -+ u64 erst_base; -+ u64 erst_dequeue; -+}; - - /* There is one ehci_hci structure per controller */ - struct xhci_hcd { -@@ -1178,6 +1201,12 @@ struct xhci_hcd { - #endif - /* Host controller watchdog timer structures */ - unsigned int xhc_state; -+ -+ unsigned long bus_suspended; -+ unsigned long next_statechange; -+ -+ u32 command; -+ struct s3_save s3; - /* Host controller is dying - not responding to commands. "I'm not dead yet!" - * - * xHC interrupts have been disabled and a watchdog timer will (or has already) -@@ -1199,6 +1228,10 @@ struct xhci_hcd { - #define XHCI_LINK_TRB_QUIRK (1 << 0) - #define XHCI_RESET_EP_QUIRK (1 << 1) - #define XHCI_NEC_HOST (1 << 2) -+ u32 port_c_suspend[8]; /* port suspend change*/ -+ u32 suspended_ports[8]; /* which ports are -+ suspended */ -+ unsigned long resume_done[MAX_HC_PORTS]; - }; - - /* For testing purposes */ -@@ -1369,6 +1402,8 @@ int xhci_init(struct usb_hcd *hcd); - int xhci_run(struct usb_hcd *hcd); - void xhci_stop(struct usb_hcd *hcd); - void xhci_shutdown(struct usb_hcd *hcd); -+int xhci_suspend(struct xhci_hcd *xhci); -+int xhci_resume(struct xhci_hcd *xhci, bool hibernated); - int xhci_get_frame(struct usb_hcd *hcd); - irqreturn_t xhci_irq(struct usb_hcd *hcd); - irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd); -@@ -1406,7 +1441,7 @@ int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, - int xhci_queue_vendor_command(struct xhci_hcd *xhci, - u32 field1, u32 field2, u32 field3, u32 field4); - int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id, -- unsigned int ep_index); -+ unsigned int ep_index, int suspend); - int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, - int slot_id, unsigned int ep_index); - int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, -@@ -1436,11 +1471,18 @@ void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci, - unsigned int slot_id, unsigned int ep_index, - struct xhci_dequeue_state *deq_state); - void xhci_stop_endpoint_command_watchdog(unsigned long arg); -+void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, unsigned int slot_id, -+ unsigned int ep_index, unsigned int stream_id); - - /* xHCI roothub code */ - int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, - char *buf, u16 wLength); - int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); -+int xhci_bus_suspend(struct usb_hcd *hcd); -+int xhci_bus_resume(struct usb_hcd *hcd); -+u32 xhci_port_state_to_neutral(u32 state); -+int xhci_find_slot_id_by_port(struct xhci_hcd *xhci, u16 port); -+void xhci_ring_device(struct xhci_hcd *xhci, int slot_id); - - /* xHCI contexts */ - struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); From 7b2f649ec2da6640878c15298f5d3f8451dd8125 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 2 Nov 2010 13:06:42 -0400 Subject: [PATCH 03/47] Linux 2.6.37-rc1 --- .gitignore | 2 +- Makefile | 4 + acpi-ec-add-delay-before-write.patch | 5 +- ...ery-information-on-notification-0x81.patch | 39 +- config-arm | 2 + config-debug | 3 + config-generic | 50 +- config-nodebug | 3 + config-s390x | 1 + config-sparc64-generic | 2 + config-x86-generic | 6 +- config-x86_64-generic | 5 + drm-intel-big-hammer.patch | 21 +- drm-intel-make-lvds-work.patch | 22 +- hdpvr-ir-enable.patch | 4 +- kernel.spec | 24 +- linux-2.6-32bit-mmap-exec-randomization.patch | 2 +- linux-2.6-enable-more-pci-autosuspend.patch | 276 +++----- linux-2.6-uvc-autosuspend.patch | 22 - pci-crs-fixes.patch | 593 ------------------ pnpacpi-cope-with-invalid-device-ids.patch | 85 --- runtime_pm_fixups.patch | 2 +- sources | 2 +- 23 files changed, 209 insertions(+), 966 deletions(-) delete mode 100644 linux-2.6-uvc-autosuspend.patch delete mode 100644 pci-crs-fixes.patch delete mode 100644 pnpacpi-cope-with-invalid-device-ids.patch diff --git a/.gitignore b/.gitignore index a955be81a..d89af37a9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ patch-*.bz2 clog *.rpm kernel-2.6.*/ -/patch-2.6.36-git8.bz2 +/patch-2.6.37-rc1.bz2 diff --git a/Makefile b/Makefile index 8e3e84130..c6142c153 100644 --- a/Makefile +++ b/Makefile @@ -91,6 +91,8 @@ debug: @perl -pi -e 's/# CONFIG_DEBUG_PER_CPU_MAPS is not set/CONFIG_DEBUG_PER_CPU_MAPS=y/' config-nodebug @perl -pi -e 's/CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y/# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set/' config-nodebug #@perl -pi -e 's/# CONFIG_PCI_DEFAULT_USE_CRS is not set/CONFIG_PCI_DEFAULT_USE_CRS=y/' config-nodebug + @perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set/CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y/' config-nodebug + @perl -pi -e 's/# CONFIG_TEST_LIST_SORT is not set/CONFIG_TEST_LIST_SORT=y/' config-nodebug @# just in case we're going from extremedebug -> debug @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug @@ -164,6 +166,8 @@ release: @perl -pi -e 's/CONFIG_DEBUG_PER_CPU_MAPS=y/# CONFIG_DEBUG_PER_CPU_MAPS is not set/' config-nodebug @perl -pi -e 's/# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set/CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y/' config-nodebug #@perl -pi -e 's/CONFIG_PCI_DEFAULT_USE_CRS=y/# CONFIG_PCI_DEFAULT_USE_CRS is not set/' config-nodebug + @perl -pi -e 's/CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y/# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set/' config-nodebug + @perl -pi -e 's/CONFIG_TEST_LIST_SORT=y/# CONFIG_TEST_LIST_SORT is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-debug @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug diff --git a/acpi-ec-add-delay-before-write.patch b/acpi-ec-add-delay-before-write.patch index af49cccbd..f1cb50817 100644 --- a/acpi-ec-add-delay-before-write.patch +++ b/acpi-ec-add-delay-before-write.patch @@ -23,7 +23,7 @@ index 27e0b92..09fbb69 100644 pr_debug(PREFIX "controller reset, restart transaction\n"); spin_lock_irqsave(&ec->curr_lock, flags); start_transaction(ec); -@@ -271,15 +272,25 @@ static int ec_check_ibf0(struct acpi_ec *ec) +@@ -271,15 +272,24 @@ static int ec_check_ibf0(struct acpi_ec *ec) return (status & ACPI_EC_FLAG_IBF) == 0; } @@ -38,8 +38,7 @@ index 27e0b92..09fbb69 100644 + static int ec_wait_ibf0(struct acpi_ec *ec) { -+ - unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY); + unsigned long delay = jiffies + msecs_to_jiffies(ec_delay); /* interrupt wait manually if GPE mode is not active */ while (time_before(jiffies, delay)) if (wait_event_timeout(ec->wait, ec_check_ibf0(ec), diff --git a/acpi-update-battery-information-on-notification-0x81.patch b/acpi-update-battery-information-on-notification-0x81.patch index 5fe34b9c0..3704b054d 100644 --- a/acpi-update-battery-information-on-notification-0x81.patch +++ b/acpi-update-battery-information-on-notification-0x81.patch @@ -12,14 +12,14 @@ and recreate the battery in order to populate the fields correctly. Signed-off-by: Matthew Garrett --- - drivers/acpi/battery.c | 22 +++++++++++++++++----- - 1 files changed, 17 insertions(+), 5 deletions(-) + drivers/acpi/battery.c | 20 +++++++++++++++----- + 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c -index dc58402..69638c4 100644 +index 95649d3..2a774a8 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c -@@ -562,9 +562,10 @@ static void acpi_battery_quirks(struct acpi_battery *battery) +@@ -605,9 +605,10 @@ static void acpi_battery_quirks2(struct acpi_battery *battery) } } @@ -31,24 +31,22 @@ index dc58402..69638c4 100644 result = acpi_battery_get_status(battery); if (result) return result; -@@ -587,6 +588,16 @@ static int acpi_battery_update(struct acpi_battery *battery) - if (!battery->bat.dev) +@@ -628,6 +629,14 @@ static int acpi_battery_update(struct acpi_battery *battery) sysfs_add_battery(battery); - #endif + result = acpi_battery_get_state(battery); + acpi_battery_quirks2(battery); + if (get_info) { + acpi_battery_get_info(battery); -+#ifdef CONFIG_ACPI_SYSFS_POWER + if (old_power_unit != battery->power_unit) { + /* The battery has changed its reporting units */ + sysfs_remove_battery(battery); + sysfs_add_battery(battery); + } -+#endif + } - return acpi_battery_get_state(battery); + return result; } -@@ -762,7 +773,7 @@ static print_func acpi_print_funcs[ACPI_BATTERY_NUMFILES] = { +@@ -803,7 +812,7 @@ static print_func acpi_print_funcs[ACPI_BATTERY_NUMFILES] = { static int acpi_battery_read(int fid, struct seq_file *seq) { struct acpi_battery *battery = seq->private; @@ -57,17 +55,17 @@ index dc58402..69638c4 100644 return acpi_print_funcs[fid](seq, result); } -@@ -877,7 +888,8 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event) - #ifdef CONFIG_ACPI_SYSFS_POWER +@@ -914,7 +923,8 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event) + if (!battery) + return; old = battery->bat.dev; - #endif - acpi_battery_update(battery); + acpi_battery_update(battery, (event == ACPI_BATTERY_NOTIFY_INFO ? true + : false)); acpi_bus_generate_proc_event(device, event, acpi_battery_present(battery)); acpi_bus_generate_netlink_event(device->pnp.device_class, -@@ -908,7 +920,7 @@ static int acpi_battery_add(struct acpi_device *device) +@@ -943,7 +953,7 @@ static int acpi_battery_add(struct acpi_device *device) if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle, "_BIX", &handle))) set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); @@ -76,7 +74,7 @@ index dc58402..69638c4 100644 #ifdef CONFIG_ACPI_PROCFS_POWER result = acpi_battery_add_fs(device); #endif -@@ -951,7 +963,7 @@ static int acpi_battery_resume(struct acpi_device *device) +@@ -984,7 +994,7 @@ static int acpi_battery_resume(struct acpi_device *device) return -EINVAL; battery = acpi_driver_data(device); battery->update_time = 0; @@ -85,12 +83,3 @@ index dc58402..69638c4 100644 return 0; } --- -1.7.2.1 - --- -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Please read the FAQ at http://www.tux.org/lkml/ - diff --git a/config-arm b/config-arm index b10eaf469..22335ef40 100644 --- a/config-arm +++ b/config-arm @@ -127,3 +127,5 @@ CONFIG_PM_OPP=y CONFIG_SECCOMP=y CONFIG_STRICT_DEVMEM=y + +# CONFIG_AMBA_PL08X is not set diff --git a/config-debug b/config-debug index 1675f5c0c..5366a8461 100644 --- a/config-debug +++ b/config-debug @@ -94,3 +94,6 @@ CONFIG_PCI_DEFAULT_USE_CRS=y CONFIG_KGDB_KDB=y CONFIG_KDB_KEYBOARD=y + +CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y +CONFIG_TEST_LIST_SORT=y diff --git a/config-generic b/config-generic index 3c3e26060..a4ff8cfeb 100644 --- a/config-generic +++ b/config-generic @@ -119,12 +119,13 @@ CONFIG_PCMCIA_IOCTL=y CONFIG_PCCARD=y CONFIG_MMC=m -CONFIG_MMC_BLOCK_BOUNCE=y CONFIG_SDIO_UART=m # CONFIG_MMC_TEST is not set # CONFIG_MMC_DEBUG is not set # CONFIG_MMC_UNSAFE_RESUME is not set CONFIG_MMC_BLOCK=m +CONFIG_MMC_BLOCK_MINORS=8 +CONFIG_MMC_BLOCK_BOUNCE=y CONFIG_MMC_SDHCI=m CONFIG_MMC_SDHCI_PCI=m CONFIG_MMC_SDRICOH_CS=m @@ -134,6 +135,7 @@ CONFIG_MMC_VIA_SDMMC=m CONFIG_MMC_SDHCI_PLTFM=m CONFIG_MMC_CB710=m CONFIG_MMC_RICOH_MMC=y +CONFIG_MMC_USHC=m CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set @@ -1580,6 +1582,8 @@ CONFIG_CAN_EMS_USB=m CONFIG_CAN_ESD_USB2=m CONFIG_CAN_KVASER_PCI=m CONFIG_CAN_PLX_PCI=m +CONFIG_CAN_TSCAN1=m +CONFIG_PCH_CAN=m CONFIG_NETROM=m CONFIG_ROSE=m CONFIG_MKISS=m @@ -2062,6 +2066,7 @@ CONFIG_I2C_ALGOPCA=m # CONFIG_I2C_I801 is not set # CONFIG_I2C_ISCH is not set # CONFIG_I2C_NFORCE2_S4985 is not set +# CONFIG_I2C_INTEL_MID is not set CONFIG_EEPROM_AT24=m CONFIG_EEPROM_LEGACY=m @@ -2156,6 +2161,11 @@ CONFIG_SENSORS_SMSC47M192=m CONFIG_SENSORS_SMSC47B397=m CONFIG_SENSORS_THMC50=m CONFIG_SENSORS_TMP401=m +CONFIG_APDS9802ALS=m +CONFIG_ISL29020=m +CONFIG_ISL29003=m +CONFIG_SENSORS_BH1770=m +CONFIG_SENSORS_APDS990X=m CONFIG_SENSORS_TSL2550=m CONFIG_SENSORS_VIA686A=m CONFIG_SENSORS_VIA_CPUTEMP=m @@ -2186,6 +2196,8 @@ CONFIG_SENSORS_LTC4261=m # CONFIG_SENSORS_SMM665 is not set # CONFIG_SENSORS_EMC2103 is not set # CONFIG_SENSORS_GPIO_FAN is not set +CONFIG_SENSORS_W83795=m +# CONFIG_SENSORS_W83795_FANCTRL is not set # CONFIG_HMC6352 is not set # CONFIG_BMP085 is not set @@ -2328,6 +2340,7 @@ CONFIG_AGP_VIA=y CONFIG_AGP_EFFICEON=y CONFIG_VGA_ARB=y CONFIG_VGA_ARB_MAX_GPUS=16 +CONFIG_STUB_POULSBO=m CONFIG_DRM=m CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m @@ -2386,7 +2399,8 @@ CONFIG_VIDEO_AU0828=m CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BT848_DVB=y CONFIG_VIDEO_BWQCAM=m -# CONFIG_VIDEO_CAFE_CCIC is not set +CONFIG_VIDEO_SR030PC30=m +CONFIG_VIDEO_CAFE_CCIC=m # CONFIG_VIDEO_CPIA is not set CONFIG_VIDEO_CPIA2=m CONFIG_VIDEO_CQCAM=m @@ -2418,6 +2432,7 @@ CONFIG_VIDEO_SAA6588=m CONFIG_VIDEO_SAA7134=m CONFIG_VIDEO_SAA7134_ALSA=m CONFIG_VIDEO_SAA7134_DVB=m +CONFIG_VIDEO_SAA7134_RC=y CONFIG_VIDEO_STRADIS=m CONFIG_VIDEO_USBVISION=m CONFIG_VIDEO_W9966=m @@ -2460,6 +2475,7 @@ CONFIG_MEDIA_TUNER_MXL5005S=m CONFIG_MEDIA_TUNER_MXL5007T=m CONFIG_MEDIA_TUNER_MC44S803=m CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m # # Digital Video Broadcasting Devices @@ -2499,6 +2515,8 @@ CONFIG_DVB_SP8870=m CONFIG_DVB_SP887X=m CONFIG_DVB_CX22700=m CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_IX2505V=m CONFIG_DVB_L64781=m CONFIG_DVB_NXT6000=m CONFIG_DVB_MT352=m @@ -2603,6 +2621,7 @@ CONFIG_DVB_USB_UMT_010=m CONFIG_DVB_USB_VP702X=m CONFIG_DVB_USB_VP7045=m CONFIG_DVB_USB_AZ6027=m +CONFIG_DVB_USB_LME2510=m CONFIG_DVB_PT1=m @@ -2624,9 +2643,11 @@ CONFIG_IR_RC5_DECODER=m CONFIG_IR_RC6_DECODER=m CONFIG_IR_JVC_DECODER=m CONFIG_IR_SONY_DECODER=m +CONFIG_IR_RC5_SZ_DECODER=m CONFIG_IR_LIRC_CODEC=m CONFIG_IR_IMON=m CONFIG_IR_MCEUSB=m +CONFIG_IR_NUVOTON=m CONFIG_V4L_MEM2MEM_DRIVERS=y # CONFIG_VIDEO_MEM2MEM_TESTDEV is not set @@ -3078,6 +3099,8 @@ CONFIG_USB_GSPCA_PAC7302=m CONFIG_USB_GSPCA_STV0680=m CONFIG_USB_GL860=m CONFIG_USB_GSPCA_JEILINJ=m +CONFIG_USB_GSPCA_KONICA=m +CONFIG_USB_GSPCA_XIRLINK_CIT=m CONFIG_USB_GSPCA_SPCA1528=m CONFIG_USB_GSPCA_SQ930X=m @@ -3093,6 +3116,7 @@ CONFIG_USB_SE401=m CONFIG_USB_ZR364XX=m CONFIG_SOC_CAMERA=m CONFIG_SOC_CAMERA_MT9M001=m +CONFIG_SOC_CAMERA_MT9M001=m CONFIG_SOC_CAMERA_MT9V022=m CONFIG_SOC_CAMERA_PLATFORM=m CONFIG_SOC_CAMERA_MT9M111=m @@ -3102,6 +3126,8 @@ CONFIG_SOC_CAMERA_OV772X=m CONFIG_SOC_CAMERA_MT9T112=m CONFIG_SOC_CAMERA_RJ54N1=m CONFIG_SOC_CAMERA_OV9640=m +CONFIG_SOC_CAMERA_OV6650=m +CONFIG_SOC_CAMERA_IMX074=m # # USB Network adaptors @@ -3306,6 +3332,7 @@ CONFIG_RTC_DRV_DS3232=m CONFIG_RTC_DRV_ISL12022=m CONFIG_MFD_SUPPORT=y +CONFIG_MFD_VX855=m CONFIG_MFD_SM501=m CONFIG_MFD_SM501_GPIO=y # CONFIG_MFD_TC6393XB is not set @@ -3326,6 +3353,7 @@ CONFIG_MFD_WM8400=m # CONFIG_ABX500_CORE is not set # CONFIG_MFD_RDC321X is not set # CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_WM831X_I2C is not set # # File systems @@ -3462,6 +3490,7 @@ CONFIG_UFS_FS=m # CONFIG_UFS_DEBUG is not set CONFIG_9P_FS=m CONFIG_9P_FSCACHE=y +CONFIG_9P_FS_POSIX_ACL=y CONFIG_FUSE_FS=m CONFIG_OMFS_FS=m CONFIG_CUSE=m @@ -3482,6 +3511,7 @@ CONFIG_NFSD_V4=y CONFIG_NFS_FSCACHE=y # CONFIG_NFS_USE_LEGACY_DNS is not set # CONFIG_NFS_USE_NEW_IDMAPPER is not set +# CONFIG_NFSD_DEPRECATED is not set CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m @@ -4043,6 +4073,8 @@ CONFIG_APM_POWER=m CONFIG_WM831X_POWER=m # CONFIG_BATTERY_DS2760 is not set # CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_BQ20Z75 is not set +# CONFIG_CHARGER_ISP1704 is not set CONFIG_BATTERY_PMU=m CONFIG_BATTERY_BQ27x00=m CONFIG_BATTERY_MAX17040=m @@ -4107,7 +4139,6 @@ CONFIG_INPUT_APANEL=m # CONFIG_INTEL_MENLOW is not set CONFIG_ENCLOSURE_SERVICES=m -CONFIG_ISL29003=m CONFIG_IPWIRELESS=m CONFIG_RTC_DRV_DS1511=m @@ -4236,6 +4267,13 @@ CONFIG_USB_ATMEL=m # CONFIG_EASYCAP is not set # CONFIG_SOLO6X10 is not set # CONFIG_ACPI_QUICKSTART is not set +# CONFIG_BRCM80211 is not set +# CONFIG_R8712U is not set +# CONFIG_ATH6K_LEGACY is not set +# CONFIG_USB_ENESTORAGE is not set +# CONFIG_BCM_WIMAX is not set +# CONFIG_FT1000 is not set +# CONFIG_SPEAKUP is not set # # Android @@ -4357,7 +4395,9 @@ CONFIG_GPIO_SYSFS=y # CONFIG_GPIO_SCH is not set # CONFIG_GPIO_LANGWELL is not set # CONFIG_GPIO_RDC321X is not set - +# CONFIG_GPIO_BASIC_MMIO is not set +# CONFIG_GPIO_VX855 is not set +# CONFIG_GPIO_PCH is not set CONFIG_KSYM_TRACER=y CONFIG_PROFILE_KSYM_TRACER=y @@ -4377,3 +4417,5 @@ CONFIG_IR_STREAMZAP=m CONFIG_SPARSE_RCU_POINTER=y # CONFIG_PM_OPP is not set + +CONFIG_BKL=y diff --git a/config-nodebug b/config-nodebug index 4e5e220f9..ab9c209af 100644 --- a/config-nodebug +++ b/config-nodebug @@ -94,3 +94,6 @@ CONFIG_PCI_DEFAULT_USE_CRS=y CONFIG_KGDB_KDB=y CONFIG_KDB_KEYBOARD=y + +CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y +CONFIG_TEST_LIST_SORT=y diff --git a/config-s390x b/config-s390x index 729131a4f..148ee5506 100644 --- a/config-s390x +++ b/config-s390x @@ -229,4 +229,5 @@ CONFIG_VMCP=y CONFIG_ZFCP_DIF=y +CONFIG_SCHED_MC=y CONFIG_SCHED_BOOK=y diff --git a/config-sparc64-generic b/config-sparc64-generic index 1d21fa781..61612cb71 100644 --- a/config-sparc64-generic +++ b/config-sparc64-generic @@ -201,3 +201,5 @@ CONFIG_GRETH=m CONFIG_FB_XVR1000=y CONFIG_CRYPTO_DEV_NIAGARA2=y + +CONFIG_JUMP_LABEL=y diff --git a/config-x86-generic b/config-x86-generic index 8f19cd311..68bd39b2d 100644 --- a/config-x86-generic +++ b/config-x86-generic @@ -370,6 +370,7 @@ CONFIG_XEN_FBDEV_FRONTEND=y CONFIG_XEN_KBDDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=m CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_XEN_PCIDEV_FRONTEND=m CONFIG_XENFS=m CONFIG_XEN_COMPAT_XENFS=y @@ -475,7 +476,7 @@ CONFIG_SBC_FITPC2_WATCHDOG=m CONFIG_EDAC_I3200=m CONFIG_EDAC_DECODE_MCE=m -CONFIG_GPIO_LANGWELL=y +# CONFIG_GPIO_LANGWELL is not set # CONFIG_INTEL_TXT is not set @@ -515,6 +516,7 @@ CONFIG_INTEL_IPS=m CONFIG_OLPC_XO1=m CONFIG_XO1_RFKILL=m +CONFIG_VIDEO_VIA_CAMERA=m CONFIG_EDAC_MCE_INJ=m CONFIG_IRQ_TIME_ACCOUNTING=y @@ -522,3 +524,5 @@ CONFIG_X86_RESERVE_LOW=64 CONFIG_PCH_GBE=m CONFIG_PCH_PHUB=m + +CONFIG_JUMP_LABEL=y diff --git a/config-x86_64-generic b/config-x86_64-generic index caad92abf..a521b72b6 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -299,6 +299,7 @@ CONFIG_XEN_FBDEV_FRONTEND=y CONFIG_XEN_KBDDEV_FRONTEND=y CONFIG_XEN_BLKDEV_FRONTEND=m CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_XEN_PCIDEV_FRONTEND=m CONFIG_XENFS=m CONFIG_XEN_COMPAT_XENFS=y CONFIG_XEN_DEV_EVTCHN=m @@ -432,3 +433,7 @@ CONFIG_X86_RESERVE_LOW=64 CONFIG_PCH_GBE=m CONFIG_PCH_PHUB=m + +CONFIG_VIDEO_VIA_CAMERA=m + +CONFIG_JUMP_LABEL=y diff --git a/drm-intel-big-hammer.patch b/drm-intel-big-hammer.patch index 63dc016b1..97bb2e8cd 100644 --- a/drm-intel-big-hammer.patch +++ b/drm-intel-big-hammer.patch @@ -1,16 +1,21 @@ +omgwtfbbqchainsaw? +--- + drivers/gpu/drm/i915/i915_gem.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c -index 37427e4..08af9db 100644 +index 8eb8453..36fa9d7 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c -@@ -2553,6 +2553,11 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, - - mutex_lock(&dev->struct_mutex); +@@ -3692,6 +3692,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, + if (ret) + goto pre_mutex_err; + /* We don't get the flushing right for these chipsets, use the -+ * big hamer for now to avoid random crashiness. */ ++ * big hammer for now to avoid random crashiness. */ + if (IS_I85X(dev) || IS_I865G(dev)) + wbinvd(); + - i915_verify_inactive(dev, __FILE__, __LINE__); - - if (dev_priv->mm.wedged) { + if (dev_priv->mm.suspended) { + mutex_unlock(&dev->struct_mutex); + ret = -EBUSY; diff --git a/drm-intel-make-lvds-work.patch b/drm-intel-make-lvds-work.patch index 5ca0152da..209deb295 100644 --- a/drm-intel-make-lvds-work.patch +++ b/drm-intel-make-lvds-work.patch @@ -1,19 +1,23 @@ -diff -up linux-2.6.33.noarch/drivers/gpu/drm/i915/intel_display.c.orig linux-2.6.33.noarch/drivers/gpu/drm/i915/intel_display.c ---- linux-2.6.33.noarch/drivers/gpu/drm/i915/intel_display.c.orig 2010-03-31 16:59:39.901995671 -0400 -+++ linux-2.6.33.noarch/drivers/gpu/drm/i915/intel_display.c 2010-03-31 17:01:05.416996744 -0400 -@@ -3757,7 +3757,6 @@ struct drm_crtc *intel_get_load_detect_p - void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, int dpms_mode) + drivers/gpu/drm/i915/intel_display.c | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c +index 990f065..171a797 100644 +--- a/drivers/gpu/drm/i915/intel_display.c ++++ b/drivers/gpu/drm/i915/intel_display.c +@@ -4568,7 +4568,6 @@ void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, + struct drm_connector *connector, int dpms_mode) { - struct drm_encoder *encoder = &intel_encoder->enc; + struct drm_encoder *encoder = &intel_encoder->base; - struct drm_device *dev = encoder->dev; struct drm_crtc *crtc = encoder->crtc; struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; -@@ -3767,7 +3766,6 @@ void intel_release_load_detect_pipe(stru - intel_encoder->base.encoder = NULL; +@@ -4578,7 +4577,6 @@ void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, + connector->encoder = NULL; intel_encoder->load_detect_temp = false; crtc->enabled = drm_helper_crtc_in_use(crtc); - drm_helper_disable_unused_functions(dev); } - /* Switch crtc and output back off if necessary */ + /* Switch crtc and encoder back off if necessary */ diff --git a/hdpvr-ir-enable.patch b/hdpvr-ir-enable.patch index 787c8f84c..f377d6b4a 100644 --- a/hdpvr-ir-enable.patch +++ b/hdpvr-ir-enable.patch @@ -110,7 +110,7 @@ index 463b81b..60cdc06 100644 msgs[i].len); } -@@ -115,31 +120,59 @@ static struct i2c_algorithm hdpvr_algo = { +@@ -115,30 +120,58 @@ static struct i2c_algorithm hdpvr_algo = { .functionality = hdpvr_functionality, }; @@ -119,7 +119,6 @@ index 463b81b..60cdc06 100644 + .owner = THIS_MODULE, + .id = I2C_HW_B_HDPVR, + .algo = &hdpvr_algo, -+ .class = I2C_CLASS_TV_ANALOG, +}; + +static struct i2c_board_info hdpvr_i2c_board_info = { @@ -160,7 +159,6 @@ index 463b81b..60cdc06 100644 - strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C", - sizeof(i2c_adap->name)); - i2c_adap->algo = &hdpvr_algo; -- i2c_adap->class = I2C_CLASS_TV_ANALOG; - i2c_adap->owner = THIS_MODULE; - i2c_adap->dev.parent = &dev->udev->dev; + memcpy(&dev->i2c_adapter, &hdpvr_i2c_adapter_template, diff --git a/kernel.spec b/kernel.spec index e8a00a281..f8c30f610 100644 --- a/kernel.spec +++ b/kernel.spec @@ -82,9 +82,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 0 +%define rcrev 1 # The git snapshot level -%define gitrev 8 +%define gitrev 0 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -698,15 +698,10 @@ Patch12030: tpm-fix-stall-on-boot.patch # Runtime power management Patch12200: linux-2.6-bluetooth-autosuspend.patch -Patch12201: linux-2.6-uvc-autosuspend.patch Patch12203: linux-2.6-usb-pci-autosuspend.patch Patch12204: linux-2.6-enable-more-pci-autosuspend.patch Patch12205: runtime_pm_fixups.patch -Patch12225: pci-crs-fixes.patch - -Patch12302: pnpacpi-cope-with-invalid-device-ids.patch - Patch12303: dmar-disable-when-ricoh-multifunction.patch %endif @@ -1127,7 +1122,7 @@ ApplyPatch linux-2.6-hotfixes.patch # Roland's utrace ptrace replacement. ApplyPatch linux-2.6-tracehook.patch ApplyPatch linux-2.6-utrace.patch -ApplyPatch linux-2.6-utrace-ptrace.patch +#ApplyPatch linux-2.6-utrace-ptrace.patch # Architecture patches # x86(-64) @@ -1193,7 +1188,7 @@ ApplyPatch linux-2.6-defaults-pci_use_crs.patch # enable ASPM by default on hardware we expect to work ApplyPatch linux-2.6-defaults-aspm.patch -ApplyPatch ima-allow-it-to-be-completely-disabled-and-default-off.patch +#ApplyPatch ima-allow-it-to-be-completely-disabled-and-default-off.patch # # SCSI Bits. @@ -1291,18 +1286,10 @@ ApplyPatch tpm-fix-stall-on-boot.patch # Runtime PM ApplyPatch linux-2.6-bluetooth-autosuspend.patch -ApplyPatch linux-2.6-uvc-autosuspend.patch ApplyPatch linux-2.6-usb-pci-autosuspend.patch ApplyPatch linux-2.6-enable-more-pci-autosuspend.patch ApplyPatch runtime_pm_fixups.patch -# PCI patches to fix problems with _CRS -# ( from linux-pci list ) -ApplyPatch pci-crs-fixes.patch - -# rhbz#641468 -ApplyPatch pnpacpi-cope-with-invalid-device-ids.patch - # rhbz#605888 ApplyPatch dmar-disable-when-ricoh-multifunction.patch @@ -1913,6 +1900,9 @@ fi # || || %changelog +* Tue Nov 02 2010 Kyle McMartin 2.6.37-0.1.rc1.git0 +- Linux 2.6.37-rc1 + * Tue Oct 26 2010 Kyle McMartin 2.6.37-0.1.rc0.git8 - Linux 2.6.36-git8 diff --git a/linux-2.6-32bit-mmap-exec-randomization.patch b/linux-2.6-32bit-mmap-exec-randomization.patch index fe91e0abf..d42638c27 100644 --- a/linux-2.6-32bit-mmap-exec-randomization.patch +++ b/linux-2.6-32bit-mmap-exec-randomization.patch @@ -14,9 +14,9 @@ --- b/mm/mmap.c +++ b/mm/mmap.c @@ -28,6 +28,7 @@ - #include #include #include + #include +#include #include diff --git a/linux-2.6-enable-more-pci-autosuspend.patch b/linux-2.6-enable-more-pci-autosuspend.patch index b1f92b134..666ded640 100644 --- a/linux-2.6-enable-more-pci-autosuspend.patch +++ b/linux-2.6-enable-more-pci-autosuspend.patch @@ -1,7 +1,20 @@ -diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/aclocal.h.mjg linux-2.6.35.x86_64/drivers/acpi/acpica/aclocal.h ---- linux-2.6.35.x86_64/drivers/acpi/acpica/aclocal.h.mjg 2010-10-04 13:52:05.086789354 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/acpica/aclocal.h 2010-10-04 13:52:50.948801001 -0400 -@@ -406,16 +406,15 @@ struct acpi_predefined_data { + drivers/acpi/acpica/aclocal.h | 7 +-- + drivers/acpi/acpica/evgpe.c | 75 +++++++++++++++----------------- + drivers/acpi/acpica/evgpeinit.c | 11 +---- + drivers/acpi/acpica/evgpeutil.c | 5 +- + drivers/acpi/acpica/evxface.c | 23 +++++----- + drivers/acpi/ec.c | 2 +- + drivers/acpi/pci_bind.c | 86 ++++++++++++++++++++++++++++++++++++++ + drivers/acpi/sleep.c | 2 +- + drivers/char/ipmi/ipmi_si_intf.c | 2 +- + include/acpi/acpixf.h | 3 +- + 10 files changed, 143 insertions(+), 73 deletions(-) + +diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h +index 2ceb0c0..3663362 100644 +--- a/drivers/acpi/acpica/aclocal.h ++++ b/drivers/acpi/acpica/aclocal.h +@@ -406,17 +406,16 @@ struct acpi_predefined_data { * ****************************************************************************/ @@ -13,6 +26,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/aclocal.h.mjg linux-2.6.35.x86_ void *context; /* Context to be passed to handler */ - struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ u8 orig_flags; /* Original misc info about this GPE */ + u8 orig_enabled; /* Set if the GPE was originally enabled */ }; -union acpi_gpe_dispatch_info { @@ -20,7 +34,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/aclocal.h.mjg linux-2.6.35.x86_ struct acpi_namespace_node *method_node; /* Method node for this GPE level */ struct acpi_handler_info *handler; }; -@@ -425,7 +424,7 @@ union acpi_gpe_dispatch_info { +@@ -426,7 +425,7 @@ union acpi_gpe_dispatch_info { * NOTE: Important to keep this struct as small as possible. */ struct acpi_gpe_event_info { @@ -29,10 +43,11 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/aclocal.h.mjg linux-2.6.35.x86_ struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ u8 flags; /* Misc info about this GPE */ u8 gpe_number; /* This GPE */ -diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c.mjg linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c ---- linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c.mjg 2010-10-04 13:52:05.088789399 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c 2010-10-04 13:52:50.950801045 -0400 -@@ -474,9 +474,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_as +diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c +index f226eac..c4b1c4c 100644 +--- a/drivers/acpi/acpica/evgpe.c ++++ b/drivers/acpi/acpica/evgpe.c +@@ -474,9 +474,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) * Must check for control method type dispatch one more time to avoid a * race with ev_gpe_install_handler */ @@ -43,7 +58,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c.mjg linux-2.6.35.x86_64 /* Allocate the evaluation information block */ info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info)); -@@ -575,41 +573,15 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve +@@ -575,41 +573,15 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) } /* @@ -93,7 +108,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c.mjg linux-2.6.35.x86_64 /* * Disable the GPE, so it doesn't keep firing before the method has a * chance to run (it runs asynchronously with interrupts enabled). -@@ -634,10 +606,34 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve +@@ -634,10 +606,34 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) "Unable to queue handler for GPE[0x%2X] - event disabled", gpe_number)); } @@ -111,7 +126,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c.mjg linux-2.6.35.x86_64 + dispatch. + handler-> + context); -+ + + /* It is now safe to clear level-triggered events. */ + + if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == @@ -125,12 +140,12 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c.mjg linux-2.6.35.x86_64 + } + } + } - ++ + if (!(gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK)) { /* * No handler or method to run! * 03/2010: This case should no longer be possible. We will not allow -@@ -658,7 +654,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve +@@ -658,7 +654,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) gpe_number)); return_UINT32(ACPI_INTERRUPT_NOT_HANDLED); } @@ -138,10 +153,11 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpe.c.mjg linux-2.6.35.x86_64 } return_UINT32(ACPI_INTERRUPT_HANDLED); -diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeinit.c.mjg linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeinit.c ---- linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeinit.c.mjg 2010-10-04 13:52:05.089789421 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeinit.c 2010-10-04 13:52:50.951801067 -0400 -@@ -392,16 +392,7 @@ acpi_ev_match_gpe_method(acpi_handle obj +diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c +index 2c7def9..9915b52 100644 +--- a/drivers/acpi/acpica/evgpeinit.c ++++ b/drivers/acpi/acpica/evgpeinit.c +@@ -386,16 +386,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, return_ACPI_STATUS(AE_OK); } @@ -159,10 +175,11 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeinit.c.mjg linux-2.6.35.x8 /* * If there is already a method, ignore this method. But check * for a type mismatch (if both the _Lxx AND _Exx exist) -diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeutil.c.mjg linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeutil.c ---- linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeutil.c.mjg 2010-10-04 13:52:05.090789443 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeutil.c 2010-10-04 13:52:50.952801089 -0400 -@@ -323,12 +323,11 @@ acpi_ev_delete_gpe_handlers(struct acpi_ +diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c +index 19a0e51..434ad1b 100644 +--- a/drivers/acpi/acpica/evgpeutil.c ++++ b/drivers/acpi/acpica/evgpeutil.c +@@ -323,12 +323,11 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, ACPI_GPE_REGISTER_WIDTH) + j]; @@ -177,10 +194,11 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evgpeutil.c.mjg linux-2.6.35.x8 } } } -diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c ---- linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg 2010-10-04 13:52:05.092789487 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c 2010-10-04 13:52:50.954801133 -0400 -@@ -662,6 +662,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_ha +diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c +index 36af222..b097136 100644 +--- a/drivers/acpi/acpica/evxface.c ++++ b/drivers/acpi/acpica/evxface.c +@@ -662,6 +662,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler) * edge- or level-triggered interrupt. * Address - Address of the handler * Context - Value passed to the handler on each GPE @@ -189,7 +207,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_ * * RETURN: Status * -@@ -671,7 +673,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_ha +@@ -671,7 +673,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler) acpi_status acpi_install_gpe_handler(acpi_handle gpe_device, u32 gpe_number, @@ -199,7 +217,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_ { struct acpi_gpe_event_info *gpe_event_info; struct acpi_handler_info *handler; -@@ -711,8 +714,7 @@ acpi_install_gpe_handler(acpi_handle gpe +@@ -711,8 +714,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, /* Make sure that there isn't a handler there already */ @@ -209,7 +227,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_ status = AE_ALREADY_EXISTS; goto free_and_exit; } -@@ -721,7 +723,6 @@ acpi_install_gpe_handler(acpi_handle gpe +@@ -721,7 +723,6 @@ acpi_install_gpe_handler(acpi_handle gpe_device, handler->address = address; handler->context = context; @@ -217,15 +235,16 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_ handler->orig_flags = gpe_event_info->flags & (ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); -@@ -733,17 +734,17 @@ acpi_install_gpe_handler(acpi_handle gpe +@@ -732,7 +733,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device, */ if ((handler->orig_flags & ACPI_GPE_DISPATCH_METHOD) -- && !(gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) -+ && !(gpe_event_info->flags & ACPI_GPE_CAN_WAKE) && !keep_method) +- && gpe_event_info->runtime_count) { ++ && gpe_event_info->runtime_count && !keep_method) { + handler->orig_enabled = 1; (void)acpi_raw_disable_gpe(gpe_event_info); - - /* Install the handler */ + } +@@ -741,10 +742,10 @@ acpi_install_gpe_handler(acpi_handle gpe_device, gpe_event_info->dispatch.handler = handler; @@ -239,7 +258,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_ gpe_event_info->flags |= (u8) (type | ACPI_GPE_DISPATCH_HANDLER); acpi_os_release_lock(acpi_gbl_gpe_lock, flags); -@@ -812,8 +813,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_ +@@ -813,8 +814,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, /* Make sure that a handler is indeed installed */ @@ -249,7 +268,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_ status = AE_NOT_EXIST; goto unlock_and_exit; } -@@ -829,9 +829,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_ +@@ -830,9 +830,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, handler = gpe_event_info->dispatch.handler; @@ -260,10 +279,11 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/acpica/evxface.c.mjg linux-2.6.35.x86_ gpe_event_info->flags &= ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); gpe_event_info->flags |= handler->orig_flags; -diff -up linux-2.6.35.x86_64/drivers/acpi/ec.c.mjg linux-2.6.35.x86_64/drivers/acpi/ec.c ---- linux-2.6.35.x86_64/drivers/acpi/ec.c.mjg 2010-10-04 13:52:05.094789531 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/ec.c 2010-10-04 13:52:50.955801156 -0400 -@@ -746,7 +746,7 @@ static int ec_install_handlers(struct ac +diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c +index 372ff80..9a39f82 100644 +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -740,7 +740,7 @@ static int ec_install_handlers(struct acpi_ec *ec) return 0; status = acpi_install_gpe_handler(NULL, ec->gpe, ACPI_GPE_EDGE_TRIGGERED, @@ -272,9 +292,10 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/ec.c.mjg linux-2.6.35.x86_64/drivers/a if (ACPI_FAILURE(status)) return -ENODEV; -diff -up linux-2.6.35.x86_64/drivers/acpi/pci_bind.c.mjg linux-2.6.35.x86_64/drivers/acpi/pci_bind.c ---- linux-2.6.35.x86_64/drivers/acpi/pci_bind.c.mjg 2010-10-04 13:52:05.102789707 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/pci_bind.c 2010-10-04 13:52:50.962801311 -0400 +diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c +index 2ef0409..8b3cc6a 100644 +--- a/drivers/acpi/pci_bind.c ++++ b/drivers/acpi/pci_bind.c @@ -28,6 +28,7 @@ #include #include @@ -327,7 +348,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/pci_bind.c.mjg linux-2.6.35.x86_64/dri static int acpi_pci_unbind(struct acpi_device *device) { struct pci_dev *dev; -@@ -43,6 +81,30 @@ static int acpi_pci_unbind(struct acpi_d +@@ -43,6 +81,30 @@ static int acpi_pci_unbind(struct acpi_device *device) if (!dev) goto out; @@ -358,7 +379,7 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/pci_bind.c.mjg linux-2.6.35.x86_64/dri device_set_run_wake(&dev->dev, false); pci_acpi_remove_pm_notifier(device); -@@ -71,6 +133,30 @@ static int acpi_pci_bind(struct acpi_dev +@@ -71,6 +133,30 @@ static int acpi_pci_bind(struct acpi_device *device) return 0; pci_acpi_add_pm_notifier(device, dev); @@ -389,25 +410,24 @@ diff -up linux-2.6.35.x86_64/drivers/acpi/pci_bind.c.mjg linux-2.6.35.x86_64/dri if (device->wakeup.flags.run_wake) device_set_run_wake(&dev->dev, true); -diff -up linux-2.6.35.x86_64/drivers/acpi/sleep.c.mjg linux-2.6.35.x86_64/drivers/acpi/sleep.c ---- linux-2.6.35.x86_64/drivers/acpi/sleep.c.mjg 2010-10-04 13:52:05.103789729 -0400 -+++ linux-2.6.35.x86_64/drivers/acpi/sleep.c 2010-10-04 13:52:50.963801333 -0400 -@@ -631,9 +631,9 @@ int acpi_pm_device_sleep_state(struct de - acpi_method[3] = 'W'; - status = acpi_evaluate_integer(handle, acpi_method, NULL, - &d_max); -- if (ACPI_FAILURE(status)) { -+ if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { - d_max = d_min; +diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c +index 721d93b..b0ddef6 100644 +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -643,7 +643,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p) + if (acpi_target_sleep_state != ACPI_STATE_S0 || + status != AE_NOT_FOUND) + d_max = d_min; - } else if (d_max < d_min) { + } else if (ACPI_SUCCESS(status) && d_max < d_min) { /* Warn the user of the broken DSDT */ printk(KERN_WARNING "ACPI: Wrong value from %s\n", acpi_method); -diff -up linux-2.6.35.x86_64/drivers/char/ipmi/ipmi_si_intf.c.mjg linux-2.6.35.x86_64/drivers/char/ipmi/ipmi_si_intf.c ---- linux-2.6.35.x86_64/drivers/char/ipmi/ipmi_si_intf.c.mjg 2010-10-04 13:52:05.097789597 -0400 -+++ linux-2.6.35.x86_64/drivers/char/ipmi/ipmi_si_intf.c 2010-10-04 13:52:50.958801223 -0400 -@@ -1959,7 +1959,7 @@ static int acpi_gpe_irq_setup(struct smi +diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c +index 035da9e..62a48b2 100644 +--- a/drivers/char/ipmi/ipmi_si_intf.c ++++ b/drivers/char/ipmi/ipmi_si_intf.c +@@ -1970,7 +1970,7 @@ static int acpi_gpe_irq_setup(struct smi_info *info) info->irq, ACPI_GPE_LEVEL_TRIGGERED, &ipmi_acpi_gpe, @@ -416,126 +436,11 @@ diff -up linux-2.6.35.x86_64/drivers/char/ipmi/ipmi_si_intf.c.mjg linux-2.6.35.x if (status != AE_OK) { dev_warn(info->dev, "%s unable to claim ACPI GPE %d," " running polled\n", DEVICE_NAME, info->irq); -diff -up linux-2.6.35.x86_64/drivers/pci/pci.c.mjg linux-2.6.35.x86_64/drivers/pci/pci.c ---- linux-2.6.35.x86_64/drivers/pci/pci.c.mjg 2010-10-04 13:52:05.105789773 -0400 -+++ linux-2.6.35.x86_64/drivers/pci/pci.c 2010-10-04 13:52:50.965801377 -0400 -@@ -38,6 +38,19 @@ EXPORT_SYMBOL(pci_pci_problems); - - unsigned int pci_pm_d3_delay; - -+static void pci_pme_list_scan(struct work_struct *work); -+ -+static LIST_HEAD(pci_pme_list); -+static DEFINE_MUTEX(pci_pme_list_mutex); -+static DECLARE_DELAYED_WORK(pci_pme_work, pci_pme_list_scan); -+ -+struct pci_pme_device { -+ struct list_head list; -+ struct pci_dev *dev; -+}; -+ -+#define PME_TIMEOUT 1000 /* How long between PME checks */ -+ - static void pci_dev_d3_sleep(struct pci_dev *dev) - { - unsigned int delay = dev->d3_delay; -@@ -1331,6 +1344,32 @@ bool pci_pme_capable(struct pci_dev *dev - return !!(dev->pme_support & (1 << state)); - } - -+static void pci_pme_list_scan(struct work_struct *work) -+{ -+ struct pci_pme_device *pme_dev; -+ -+ mutex_lock(&pci_pme_list_mutex); -+ if (!list_empty(&pci_pme_list)) { -+ list_for_each_entry(pme_dev, &pci_pme_list, list) -+ pci_pme_wakeup(pme_dev->dev, NULL); -+ schedule_delayed_work(&pci_pme_work, msecs_to_jiffies(PME_TIMEOUT)); -+ } -+ mutex_unlock(&pci_pme_list_mutex); -+} -+ -+/** -+ * pci_external_pme - is a device an external PCI PME source? -+ * @dev: PCI device to check -+ * -+ */ -+ -+static bool pci_external_pme(struct pci_dev *dev) -+{ -+ if (pci_is_pcie(dev) || dev->bus->number == 0) -+ return false; -+ return true; -+} -+ - /** - * pci_pme_active - enable or disable PCI device's PME# function - * @dev: PCI device to handle. -@@ -1354,6 +1393,44 @@ void pci_pme_active(struct pci_dev *dev, - - pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, pmcsr); - -+ /* PCI (as opposed to PCIe) PME requires that the device have -+ its PME# line hooked up correctly. Not all hardware vendors -+ do this, so the PME never gets delivered and the device -+ remains asleep. The easiest way around this is to -+ periodically walk the list of suspended devices and check -+ whether any have their PME flag set. The assumption is that -+ we'll wake up often enough anyway that this won't be a huge -+ hit, and the power savings from the devices will still be a -+ win. */ -+ -+ if (pci_external_pme(dev)) { -+ struct pci_pme_device *pme_dev; -+ if (enable) { -+ pme_dev = kmalloc(sizeof(struct pci_pme_device), -+ GFP_KERNEL); -+ if (!pme_dev) -+ goto out; -+ pme_dev->dev = dev; -+ mutex_lock(&pci_pme_list_mutex); -+ list_add(&pme_dev->list, &pci_pme_list); -+ if (list_is_singular(&pci_pme_list)) -+ schedule_delayed_work(&pci_pme_work, -+ msecs_to_jiffies(PME_TIMEOUT)); -+ mutex_unlock(&pci_pme_list_mutex); -+ } else { -+ mutex_lock(&pci_pme_list_mutex); -+ list_for_each_entry(pme_dev, &pci_pme_list, list) { -+ if (pme_dev->dev == dev) { -+ list_del(&pme_dev->list); -+ kfree(pme_dev); -+ break; -+ } -+ } -+ mutex_unlock(&pci_pme_list_mutex); -+ } -+ } -+ -+out: - dev_printk(KERN_DEBUG, &dev->dev, "PME# %s\n", - enable ? "enabled" : "disabled"); - } -diff -up linux-2.6.35.x86_64/drivers/pci/pci.h.mjg linux-2.6.35.x86_64/drivers/pci/pci.h ---- linux-2.6.35.x86_64/drivers/pci/pci.h.mjg 2010-10-04 13:52:05.100789663 -0400 -+++ linux-2.6.35.x86_64/drivers/pci/pci.h 2010-10-04 13:52:50.960801267 -0400 -@@ -63,11 +63,8 @@ struct pci_platform_pm_ops { - extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); - extern void pci_update_current_state(struct pci_dev *dev, pci_power_t state); - extern void pci_disable_enabled_device(struct pci_dev *dev); --extern bool pci_check_pme_status(struct pci_dev *dev); - extern int pci_finish_runtime_suspend(struct pci_dev *dev); --extern void pci_wakeup_event(struct pci_dev *dev); - extern int __pci_pme_wakeup(struct pci_dev *dev, void *ign); --extern void pci_pme_wakeup_bus(struct pci_bus *bus); - extern void pci_pm_init(struct pci_dev *dev); - extern void platform_pci_wakeup_init(struct pci_dev *dev); - extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); -diff -up linux-2.6.35.x86_64/include/acpi/acpixf.h.mjg linux-2.6.35.x86_64/include/acpi/acpixf.h ---- linux-2.6.35.x86_64/include/acpi/acpixf.h.mjg 2010-10-04 13:52:05.099789641 -0400 -+++ linux-2.6.35.x86_64/include/acpi/acpixf.h 2010-10-04 13:52:50.959801245 -0400 -@@ -253,7 +253,8 @@ acpi_remove_address_space_handler(acpi_h +diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h +index 53b7cfd..740eb7e 100644 +--- a/include/acpi/acpixf.h ++++ b/include/acpi/acpixf.h +@@ -258,7 +258,8 @@ acpi_remove_address_space_handler(acpi_handle device, acpi_status acpi_install_gpe_handler(acpi_handle gpe_device, u32 gpe_number, @@ -545,16 +450,3 @@ diff -up linux-2.6.35.x86_64/include/acpi/acpixf.h.mjg linux-2.6.35.x86_64/inclu acpi_status acpi_remove_gpe_handler(acpi_handle gpe_device, -diff -up linux-2.6.35.x86_64/include/linux/pci.h.mjg linux-2.6.35.x86_64/include/linux/pci.h ---- linux-2.6.35.x86_64/include/linux/pci.h.mjg 2010-10-04 13:52:05.101789685 -0400 -+++ linux-2.6.35.x86_64/include/linux/pci.h 2010-10-04 13:52:50.962801311 -0400 -@@ -819,6 +819,9 @@ pci_power_t pci_target_state(struct pci_ - int pci_prepare_to_sleep(struct pci_dev *dev); - int pci_back_from_sleep(struct pci_dev *dev); - bool pci_dev_run_wake(struct pci_dev *dev); -+bool pci_check_pme_status(struct pci_dev *dev); -+void pci_wakeup_event(struct pci_dev *dev); -+void pci_pme_wakeup_bus(struct pci_bus *bus); - - static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, - bool enable) diff --git a/linux-2.6-uvc-autosuspend.patch b/linux-2.6-uvc-autosuspend.patch deleted file mode 100644 index 6c965c62f..000000000 --- a/linux-2.6-uvc-autosuspend.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit 4a3757e0ae269f710292dd75013532c5a57ccb00 -Author: Matthew Garrett -Date: Thu Sep 16 13:38:38 2010 -0400 - - uvc: Enable USB autosuspend by default on uvcvideo - - We've been doing this for a while in Fedora without any complaints. - - Signed-off-by: Matthew Garrett - -diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c -index 8bdd940..28ed5b4 100644 ---- a/drivers/media/video/uvc/uvc_driver.c -+++ b/drivers/media/video/uvc/uvc_driver.c -@@ -1814,6 +1814,7 @@ static int uvc_probe(struct usb_interface *intf, - } - - uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n"); -+ usb_enable_autosuspend(udev); - return 0; - - error: diff --git a/pci-crs-fixes.patch b/pci-crs-fixes.patch deleted file mode 100644 index b4fd01502..000000000 --- a/pci-crs-fixes.patch +++ /dev/null @@ -1,593 +0,0 @@ - This revision is to address two problems found by Horst H. von Brand while - testing the v2 patches in Fedora: - https://bugzilla.redhat.com/show_bug.cgi?id=637647 - On his machine, we don't use _CRS by default, and the BIOS left some bridge - windows disabled. - - Problem 1: When we assigned space for the windows, we started at the top - and allocated [mem 0xffffffffffe00000-0xffffffffffffffff], which is - obviously useless because the CPU doesn't support physical addresses that - large. - - Problem 2: Subsequent allocations failed because I made an error in - find_resource(). We look for available space from [child->end + 1 to - root->end], and if the last child ends exactly at 0xffffffffffffffff, we - wrap around and start from zero. - - I made the top-down allocation conditional: an arch can select it at - boot-time, and there's a kernel command line option to change it for - debugging. - - -When we move PCI devices, we currently allocate space bottom-up, i.e., we look -at PCI bus resources in the order we found them, we look at gaps between child -resources bottom-up, and we align the new space at the bottom of an available -region. - -On x86, we move PCI devices more than we used to because we now pay attention -to the PCI host bridge windows from ACPI. For example, when we find a device -that's outside all the known host bridge windows, we try to move it into a -window, and we look for space starting at the bottom. - -Windows does similar device moves, but it looks for space top-down rather than -bottom-up. Since most machines are better-tested with Windows than Linux, this -difference means that Linux is more likely to trip over BIOS bugs in the PCI -host bridge window descriptions than Windows is. - -We've had several reports of Dell machines where the BIOS leaves the AHCI -controller outside the host bridge windows (BIOS bug #1), *and* the lowest -host bridge window includes an area that doesn't actually reach PCI (BIOS -bug #2). The result is that Windows (which moves AHCI to the top of a window) -works fine, while Linux (which moves AHCI to the bottom, buggy, area) doesn't -work. - -These patches change Linux to allocate space more like Windows does: - - 1) The x86 pcibios_align_resource() will choose space from the - end of an available area, not the beginning. - - 2) In the generic allocate_resource() path, we'll look for space - between existing children from the top, not from the bottom. - - 3) When pci_bus_alloc_resource() looks for available space, it - will start from the highest window, not the first one we found. - -This series fixes a 2.6.34 regression that prevents many Dell Precision -workstations from booting: - - https://bugzilla.kernel.org/show_bug.cgi?id=16228 - -Changes from v3 to v4: - - Use round_down() rather than adding ALIGN_DOWN(). - - Replace ARCH_HAS_TOP_DOWN_ALLOC #define with a boot-time architecture - choice and add a "resource_alloc_from_bottom" command line option to - revert to the old behavior (NOTE: this only affects allocate_resource(), - not pcibios_align_resource() or pci_bus_alloc_resource()). - - Fixed find_resource_from_top() again; it still didn't handle a child - that ended at the parent's end correctly. - -Changes from v2 to v3: - - Updated iomem_resource.end to reflect the end of usable physical address - space. Otherwise, we might allocate right up to 0xffffffff_ffffffff, - which isn't usable. - - Make allocate_resource() change conditional on ARCH_HAS_TOP_DOWN_ALLOC. - Without arch-specific changes like the above, it's too dangerous to - make this change for everybody at once. - - Fix 64-bit wraparound in find_resource(). If the last child happened - to end at ~0, we computed the highest available space as [child->end + 1, - root->end], which makes us think the available space started at 0, - which makes us return space that may already be allocated. - -Changes from v1 to v2: - - Moved check for allocating before the available area from - pcibios_align_resource() to find_resource(). Better to do it - after the alignment callback is done, and make it generic. - - Fixed pcibios_align_resource() alignment. If we start from the - end of the available area, we must align *downward*, not upward. - - Fixed pcibios_align_resource() ISA alias avoidance. Again, since - the starting point is the end of the area, we must align downward - when we avoid aliased areas. ---- - -Bjorn Helgaas (6): - resources: ensure alignment callback doesn't allocate below available start - resources: support allocating space within a region from the top down - PCI: allocate bus resources from the top down - x86/PCI: allocate space from the end of a region, not the beginning - x86: update iomem_resource end based on CPU physical address capabilities - x86: allocate space within a region top-down - - - Documentation/kernel-parameters.txt | 5 ++ - arch/x86/kernel/setup.c | 2 + - arch/x86/pci/i386.c | 17 ++++-- - drivers/pci/bus.c | 53 +++++++++++++++++-- - include/linux/ioport.h | 1 - kernel/resource.c | 99 ++++++++++++++++++++++++++++++++++- - 6 files changed, 163 insertions(+), 14 deletions(-) --- -To unsubscribe from this list: send the line "unsubscribe linux-pci" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -The alignment callback returns a proposed location, which may have been -adjusted to avoid ISA aliases or for other architecture-specific reasons. -We already had a check ("tmp.start < tmp.end") to make sure the callback -doesn't return a location above the available area. - -This patch adds a check to make sure the callback doesn't return something -*below* the available area, as may happen if the callback tries to allocate -top-down. - -Signed-off-by: Bjorn Helgaas ---- - - kernel/resource.c | 10 ++++++++-- - 1 files changed, 8 insertions(+), 2 deletions(-) - - -diff --git a/kernel/resource.c b/kernel/resource.c -index 7b36976..ace2269 100644 ---- a/kernel/resource.c -+++ b/kernel/resource.c -@@ -371,6 +371,7 @@ static int find_resource(struct resource *root, struct resource *new, - { - struct resource *this = root->child; - struct resource tmp = *new; -+ resource_size_t start; - - tmp.start = root->start; - /* -@@ -391,8 +392,13 @@ static int find_resource(struct resource *root, struct resource *new, - if (tmp.end > max) - tmp.end = max; - tmp.start = ALIGN(tmp.start, align); -- if (alignf) -- tmp.start = alignf(alignf_data, &tmp, size, align); -+ if (alignf) { -+ start = alignf(alignf_data, &tmp, size, align); -+ if (tmp.start <= start && start <= tmp.end) -+ tmp.start = start; -+ else -+ tmp.start = tmp.end; -+ } - if (tmp.start < tmp.end && tmp.end - tmp.start >= size - 1) { - new->start = tmp.start; - new->end = tmp.start + size - 1; - --- -To unsubscribe from this list: send the line "unsubscribe linux-pci" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Allocate space from the top of a region first, then work downward, -if an architecture desires this. - -When we allocate space from a resource, we look for gaps between children -of the resource. Previously, we always looked at gaps from the bottom up. -For example, given this: - - [mem 0xbff00000-0xf7ffffff] PCI Bus 0000:00 - [mem 0xbff00000-0xbfffffff] gap -- available - [mem 0xc0000000-0xdfffffff] PCI Bus 0000:02 - [mem 0xe0000000-0xf7ffffff] gap -- available - -we attempted to allocate from the [mem 0xbff00000-0xbfffffff] gap first, -then the [mem 0xe0000000-0xf7ffffff] gap. - -With this patch an architecture can choose to allocate from the top gap -[mem 0xe0000000-0xf7ffffff] first. - -We can't do this across the board because iomem_resource.end is initialized -to 0xffffffff_ffffffff on 64-bit architectures, and most machines can't -address the entire 64-bit physical address space. Therefore, we only -allocate top-down if the arch requests it by clearing -"resource_alloc_from_bottom". - -Signed-off-by: Bjorn Helgaas ---- - - Documentation/kernel-parameters.txt | 5 ++ - include/linux/ioport.h | 1 - kernel/resource.c | 89 +++++++++++++++++++++++++++++++++++ - 3 files changed, 94 insertions(+), 1 deletions(-) - - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 8dd7248..fe50cbd 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -2156,6 +2156,11 @@ and is between 256 and 4096 characters. It is defined in the file - reset_devices [KNL] Force drivers to reset the underlying device - during initialization. - -+ resource_alloc_from_bottom -+ Allocate new resources from the beginning of available -+ space, not the end. If you need to use this, please -+ report a bug. -+ - resume= [SWSUSP] - Specify the partition device for software suspend - -diff --git a/include/linux/ioport.h b/include/linux/ioport.h -index b227902..d377ea8 100644 ---- a/include/linux/ioport.h -+++ b/include/linux/ioport.h -@@ -112,6 +112,7 @@ struct resource_list { - /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ - extern struct resource ioport_resource; - extern struct resource iomem_resource; -+extern int resource_alloc_from_bottom; - - extern struct resource *request_resource_conflict(struct resource *root, struct resource *new); - extern int request_resource(struct resource *root, struct resource *new); -diff --git a/kernel/resource.c b/kernel/resource.c -index ace2269..8d337a9 100644 ---- a/kernel/resource.c -+++ b/kernel/resource.c -@@ -40,6 +40,23 @@ EXPORT_SYMBOL(iomem_resource); - - static DEFINE_RWLOCK(resource_lock); - -+/* -+ * By default, we allocate free space bottom-up. The architecture can request -+ * top-down by clearing this flag. The user can override the architecture's -+ * choice with the "resource_alloc_from_bottom" kernel boot option, but that -+ * should only be a debugging tool. -+ */ -+int resource_alloc_from_bottom = 1; -+ -+static __init int setup_alloc_from_bottom(char *s) -+{ -+ printk(KERN_INFO -+ "resource: allocating from bottom-up; please report a bug\n"); -+ resource_alloc_from_bottom = 1; -+ return 0; -+} -+early_param("resource_alloc_from_bottom", setup_alloc_from_bottom); -+ - static void *r_next(struct seq_file *m, void *v, loff_t *pos) - { - struct resource *p = v; -@@ -358,7 +375,74 @@ int __weak page_is_ram(unsigned long pfn) - } - - /* -+ * Find the resource before "child" in the sibling list of "root" children. -+ */ -+static struct resource *find_sibling_prev(struct resource *root, struct resource *child) -+{ -+ struct resource *this; -+ -+ for (this = root->child; this; this = this->sibling) -+ if (this->sibling == child) -+ return this; -+ -+ return NULL; -+} -+ -+/* -+ * Find empty slot in the resource tree given range and alignment. -+ * This version allocates from the end of the root resource first. -+ */ -+static int find_resource_from_top(struct resource *root, struct resource *new, -+ resource_size_t size, resource_size_t min, -+ resource_size_t max, resource_size_t align, -+ resource_size_t (*alignf)(void *, -+ const struct resource *, -+ resource_size_t, -+ resource_size_t), -+ void *alignf_data) -+{ -+ struct resource *this; -+ struct resource tmp = *new; -+ resource_size_t start; -+ -+ tmp.start = root->end; -+ tmp.end = root->end; -+ -+ this = find_sibling_prev(root, NULL); -+ for (;;) { -+ if (this) { -+ if (this->end < root->end) -+ tmp.start = this->end + 1; -+ } else -+ tmp.start = root->start; -+ if (tmp.start < min) -+ tmp.start = min; -+ if (tmp.end > max) -+ tmp.end = max; -+ tmp.start = ALIGN(tmp.start, align); -+ if (alignf) { -+ start = alignf(alignf_data, &tmp, size, align); -+ if (tmp.start <= start && start <= tmp.end) -+ tmp.start = start; -+ else -+ tmp.start = tmp.end; -+ } -+ if (tmp.start < tmp.end && tmp.end - tmp.start >= size - 1) { -+ new->start = tmp.start; -+ new->end = tmp.start + size - 1; -+ return 0; -+ } -+ if (!this || this->start == root->start) -+ break; -+ tmp.end = this->start - 1; -+ this = find_sibling_prev(root, this); -+ } -+ return -EBUSY; -+} -+ -+/* - * Find empty slot in the resource tree given range and alignment. -+ * This version allocates from the beginning of the root resource first. - */ - static int find_resource(struct resource *root, struct resource *new, - resource_size_t size, resource_size_t min, -@@ -435,7 +519,10 @@ int allocate_resource(struct resource *root, struct resource *new, - int err; - - write_lock(&resource_lock); -- err = find_resource(root, new, size, min, max, align, alignf, alignf_data); -+ if (resource_alloc_from_bottom) -+ err = find_resource(root, new, size, min, max, align, alignf, alignf_data); -+ else -+ err = find_resource_from_top(root, new, size, min, max, align, alignf, alignf_data); - if (err >= 0 && __request_resource(root, new)) - err = -EBUSY; - write_unlock(&resource_lock); - --- -To unsubscribe from this list: send the line "unsubscribe linux-pci" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Allocate space from the highest-address PCI bus resource first, then work -downward. - -Previously, we looked for space in PCI host bridge windows in the order -we discovered the windows. For example, given the following windows -(discovered via an ACPI _CRS method): - - pci_root PNP0A03:00: host bridge window [mem 0x000a0000-0x000bffff] - pci_root PNP0A03:00: host bridge window [mem 0x000c0000-0x000effff] - pci_root PNP0A03:00: host bridge window [mem 0x000f0000-0x000fffff] - pci_root PNP0A03:00: host bridge window [mem 0xbff00000-0xf7ffffff] - pci_root PNP0A03:00: host bridge window [mem 0xff980000-0xff980fff] - pci_root PNP0A03:00: host bridge window [mem 0xff97c000-0xff97ffff] - pci_root PNP0A03:00: host bridge window [mem 0xfed20000-0xfed9ffff] - -we attempted to allocate from [mem 0x000a0000-0x000bffff] first, then -[mem 0x000c0000-0x000effff], and so on. - -With this patch, we allocate from [mem 0xff980000-0xff980fff] first, then -[mem 0xff97c000-0xff97ffff], [mem 0xfed20000-0xfed9ffff], etc. - -Allocating top-down follows Windows practice, so we're less likely to -trip over BIOS defects in the _CRS description. - -On the machine above (a Dell T3500), the [mem 0xbff00000-0xbfffffff] region -doesn't actually work and is likely a BIOS defect. The symptom is that we -move the AHCI controller to 0xbff00000, which leads to "Boot has failed, -sleeping forever," a BUG in ahci_stop_engine(), or some other boot failure. - -Reference: https://bugzilla.kernel.org/show_bug.cgi?id=16228#c43 -Reference: https://bugzilla.redhat.com/show_bug.cgi?id=620313 -Reference: https://bugzilla.redhat.com/show_bug.cgi?id=629933 -Reported-by: Brian Bloniarz -Reported-and-tested-by: Stefan Becker -Reported-by: Denys Vlasenko -Signed-off-by: Bjorn Helgaas ---- - - drivers/pci/bus.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- - 1 files changed, 48 insertions(+), 5 deletions(-) - - -diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c -index 7f0af0e..172bf26 100644 ---- a/drivers/pci/bus.c -+++ b/drivers/pci/bus.c -@@ -64,6 +64,49 @@ void pci_bus_remove_resources(struct pci_bus *bus) - } - } - -+/* -+ * Find the highest-address bus resource below the cursor "res". If the -+ * cursor is NULL, return the highest resource. -+ */ -+static struct resource *pci_bus_find_resource_prev(struct pci_bus *bus, -+ unsigned int type, -+ struct resource *res) -+{ -+ struct resource *r, *prev = NULL; -+ int i; -+ -+ pci_bus_for_each_resource(bus, r, i) { -+ if (!r) -+ continue; -+ -+ if ((r->flags & IORESOURCE_TYPE_BITS) != type) -+ continue; -+ -+ /* If this resource is at or past the cursor, skip it */ -+ if (res) { -+ if (r == res) -+ continue; -+ if (r->end > res->end) -+ continue; -+ if (r->end == res->end && r->start > res->start) -+ continue; -+ } -+ -+ if (!prev) -+ prev = r; -+ -+ /* -+ * A small resource is higher than a large one that ends at -+ * the same address. -+ */ -+ if (r->end > prev->end || -+ (r->end == prev->end && r->start > prev->start)) -+ prev = r; -+ } -+ -+ return prev; -+} -+ - /** - * pci_bus_alloc_resource - allocate a resource from a parent bus - * @bus: PCI bus -@@ -89,9 +132,10 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, - resource_size_t), - void *alignf_data) - { -- int i, ret = -ENOMEM; -+ int ret = -ENOMEM; - struct resource *r; - resource_size_t max = -1; -+ unsigned int type = res->flags & IORESOURCE_TYPE_BITS; - - type_mask |= IORESOURCE_IO | IORESOURCE_MEM; - -@@ -99,10 +143,9 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, - if (!(res->flags & IORESOURCE_MEM_64)) - max = PCIBIOS_MAX_MEM_32; - -- pci_bus_for_each_resource(bus, r, i) { -- if (!r) -- continue; -- -+ /* Look for space at highest addresses first */ -+ r = pci_bus_find_resource_prev(bus, type, NULL); -+ for ( ; r; r = pci_bus_find_resource_prev(bus, type, r)) { - /* type_mask must match */ - if ((res->flags ^ r->flags) & type_mask) - continue; - --- -To unsubscribe from this list: send the line "unsubscribe linux-pci" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Allocate from the end of a region, not the beginning. - -For example, if we need to allocate 0x800 bytes for a device on bus -0000:00 given these resources: - - [mem 0xbff00000-0xdfffffff] PCI Bus 0000:00 - [mem 0xc0000000-0xdfffffff] PCI Bus 0000:02 - -the available space at [mem 0xbff00000-0xbfffffff] is passed to the -alignment callback (pcibios_align_resource()). Prior to this patch, we -would put the new 0x800 byte resource at the beginning of that available -space, i.e., at [mem 0xbff00000-0xbff007ff]. - -With this patch, we put it at the end, at [mem 0xbffff800-0xbfffffff]. - -Reference: https://bugzilla.kernel.org/show_bug.cgi?id=16228#c41 -Signed-off-by: Bjorn Helgaas ---- - - arch/x86/pci/i386.c | 17 +++++++++++------ - 1 files changed, 11 insertions(+), 6 deletions(-) - - -diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c -index 5525309..826140a 100644 ---- a/arch/x86/pci/i386.c -+++ b/arch/x86/pci/i386.c -@@ -65,16 +65,21 @@ pcibios_align_resource(void *data, const struct resource *res, - resource_size_t size, resource_size_t align) - { - struct pci_dev *dev = data; -- resource_size_t start = res->start; -+ resource_size_t start = round_down(res->end - size + 1, align); - - if (res->flags & IORESOURCE_IO) { -- if (skip_isa_ioresource_align(dev)) -- return start; -- if (start & 0x300) -- start = (start + 0x3ff) & ~0x3ff; -+ -+ /* -+ * If we're avoiding ISA aliases, the largest contiguous I/O -+ * port space is 256 bytes. Clearing bits 9 and 10 preserves -+ * all 256-byte and smaller alignments, so the result will -+ * still be correctly aligned. -+ */ -+ if (!skip_isa_ioresource_align(dev)) -+ start &= ~0x300; - } else if (res->flags & IORESOURCE_MEM) { - if (start < BIOS_END) -- start = BIOS_END; -+ start = res->end; /* fail; no space */ - } - return start; - } - --- -To unsubscribe from this list: send the line "unsubscribe linux-pci" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -The iomem_resource map reflects the available physical address space. -We statically initialize the end to -1, i.e., 0xffffffff_ffffffff, but -of course we can only use as much as the CPU can address. - -This patch updates the end based on the CPU capabilities, so we don't -mistakenly allocate space that isn't usable, as we're likely to do when -allocating from the top-down. - -Signed-off-by: Bjorn Helgaas ---- - - arch/x86/kernel/setup.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - - -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index c3a4fbb..922b5a1 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -788,6 +788,7 @@ void __init setup_arch(char **cmdline_p) - - x86_init.oem.arch_setup(); - -+ iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1; - setup_memory_map(); - parse_setup_data(); - /* update the e820_saved too */ - --- -To unsubscribe from this list: send the line "unsubscribe linux-pci" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Request that allocate_resource() use available space from high addresses -first, rather than the default of using low addresses first. - -The most common place this makes a difference is when we move or assign -new PCI device resources. Low addresses are generally scarce, so it's -better to use high addresses when possible. This follows Windows practice -for PCI allocation. - -Reference: https://bugzilla.kernel.org/show_bug.cgi?id=16228#c42 -Signed-off-by: Bjorn Helgaas ---- - - arch/x86/kernel/setup.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - - -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 922b5a1..0fe76df 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -788,6 +788,7 @@ void __init setup_arch(char **cmdline_p) - - x86_init.oem.arch_setup(); - -+ resource_alloc_from_bottom = 0; - iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1; - setup_memory_map(); - parse_setup_data(); - --- -To unsubscribe from this list: send the line "unsubscribe linux-pci" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html \ No newline at end of file diff --git a/pnpacpi-cope-with-invalid-device-ids.patch b/pnpacpi-cope-with-invalid-device-ids.patch deleted file mode 100644 index 70b2ab968..000000000 --- a/pnpacpi-cope-with-invalid-device-ids.patch +++ /dev/null @@ -1,85 +0,0 @@ -commit 420a0f66378c84b00b0e603e4d38210102dbe367 -Author: Dmitry Torokhov -Date: Sat Sep 18 10:11:09 2010 -0700 - - PNPACPI: cope with invalid device IDs - - If primary ID (HID) is invalid try locating first valid ID on compatible - ID list before giving up. - - This helps, for example, to recognize i8042 AUX port on Sony Vaio VPCZ1 - which uses SNYSYN0003 as HID. Without the patch users are forced to - boot with i8042.nopnp to make use of their touchpads. - - Tested-by: Jan-Hendrik Zab - Signed-off-by: Dmitry Torokhov - Signed-off-by: Len Brown - -diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c -index dc4e32e..0d943ee 100644 ---- a/drivers/pnp/pnpacpi/core.c -+++ b/drivers/pnp/pnpacpi/core.c -@@ -28,7 +28,7 @@ - #include "../base.h" - #include "pnpacpi.h" - --static int num = 0; -+static int num; - - /* We need only to blacklist devices that have already an acpi driver that - * can't use pnp layer. We don't need to blacklist device that are directly -@@ -180,11 +180,24 @@ struct pnp_protocol pnpacpi_protocol = { - }; - EXPORT_SYMBOL(pnpacpi_protocol); - -+static char *pnpacpi_get_id(struct acpi_device *device) -+{ -+ struct acpi_hardware_id *id; -+ -+ list_for_each_entry(id, &device->pnp.ids, list) { -+ if (ispnpidacpi(id->id)) -+ return id->id; -+ } -+ -+ return NULL; -+} -+ - static int __init pnpacpi_add_device(struct acpi_device *device) - { - acpi_handle temp = NULL; - acpi_status status; - struct pnp_dev *dev; -+ char *pnpid; - struct acpi_hardware_id *id; - - /* -@@ -192,11 +205,17 @@ static int __init pnpacpi_add_device(struct acpi_device *device) - * driver should not be loaded. - */ - status = acpi_get_handle(device->handle, "_CRS", &temp); -- if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) || -- is_exclusive_device(device) || (!device->status.present)) -+ if (ACPI_FAILURE(status)) -+ return 0; -+ -+ pnpid = pnpacpi_get_id(device); -+ if (!pnpid) -+ return 0; -+ -+ if (is_exclusive_device(device) || !device->status.present) - return 0; - -- dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device)); -+ dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid); - if (!dev) - return -ENOMEM; - -@@ -227,7 +246,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) - pnpacpi_parse_resource_option_data(dev); - - list_for_each_entry(id, &device->pnp.ids, list) { -- if (!strcmp(id->id, acpi_device_hid(device))) -+ if (!strcmp(id->id, pnpid)) - continue; - if (!ispnpidacpi(id->id)) - continue; diff --git a/runtime_pm_fixups.patch b/runtime_pm_fixups.patch index 6315dc176..789115810 100644 --- a/runtime_pm_fixups.patch +++ b/runtime_pm_fixups.patch @@ -110,5 +110,5 @@ index 4de84ce..284f43c 100644 -int acpi_disable_wakeup_device_power(struct acpi_device *dev); +int acpi_disable_wakeup_device_power(struct acpi_device *dev, int state); - #ifdef CONFIG_PM_SLEEP + #ifdef CONFIG_PM_OPS int acpi_pm_device_sleep_state(struct device *, int *); diff --git a/sources b/sources index de3496585..a666d4de8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 -1ae3ad96ed31fb8d40384add909bf994 patch-2.6.36-git8.bz2 +7364d9629734c34d09ec9ebd351d40b9 patch-2.6.37-rc1.bz2 From 1aea2328b45aa547a36a8db2b75032727c1672a7 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 8 Nov 2010 10:38:33 -0500 Subject: [PATCH 04/47] Cherry-pick utrace-ptrace fixes from mayoung. Thanks! --- config-generic | 1 - kernel.spec | 5 ++++- linux-2.6-utrace-ptrace.patch | 35 +++++++++++++++++++---------------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/config-generic b/config-generic index a4ff8cfeb..9a0b10bc7 100644 --- a/config-generic +++ b/config-generic @@ -3116,7 +3116,6 @@ CONFIG_USB_SE401=m CONFIG_USB_ZR364XX=m CONFIG_SOC_CAMERA=m CONFIG_SOC_CAMERA_MT9M001=m -CONFIG_SOC_CAMERA_MT9M001=m CONFIG_SOC_CAMERA_MT9V022=m CONFIG_SOC_CAMERA_PLATFORM=m CONFIG_SOC_CAMERA_MT9M111=m diff --git a/kernel.spec b/kernel.spec index f8c30f610..772f21ad1 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1122,7 +1122,7 @@ ApplyPatch linux-2.6-hotfixes.patch # Roland's utrace ptrace replacement. ApplyPatch linux-2.6-tracehook.patch ApplyPatch linux-2.6-utrace.patch -#ApplyPatch linux-2.6-utrace-ptrace.patch +ApplyPatch linux-2.6-utrace-ptrace.patch # Architecture patches # x86(-64) @@ -1900,6 +1900,9 @@ fi # || || %changelog +* Mon Nov 08 2010 Kyle McMartin +- Cherry-pick utrace-ptrace fixes from mayoung. Thanks! + * Tue Nov 02 2010 Kyle McMartin 2.6.37-0.1.rc1.git0 - Linux 2.6.37-rc1 diff --git a/linux-2.6-utrace-ptrace.patch b/linux-2.6-utrace-ptrace.patch index a609fb628..caeae6760 100644 --- a/linux-2.6-utrace-ptrace.patch +++ b/linux-2.6-utrace-ptrace.patch @@ -29,9 +29,9 @@ index a85fb41..235c1b0 100644 - +extern void ptrace_notify_stop(struct task_struct *tracee); - extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); + extern long arch_ptrace(struct task_struct *child, long request, + unsigned long addr, unsigned long data); extern int ptrace_traceme(void); - extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); diff --git a/kernel/Makefile b/kernel/Makefile index 6004913..b09c9a5 100644 --- a/kernel/Makefile @@ -673,7 +673,7 @@ index ...a90078d 100644 + * under ptrace. + */ + retval = -ERESTARTNOINTR; -+ if (mutex_lock_interruptible(&task->cred_guard_mutex)) ++ if (mutex_lock_interruptible(&task->signal->cred_guard_mutex)) + goto out; + + task_lock(task); @@ -703,7 +703,7 @@ index ...a90078d 100644 +unlock_tasklist: + write_unlock_irq(&tasklist_lock); +unlock_creds: -+ mutex_unlock(&task->cred_guard_mutex); ++ mutex_unlock(&task->signal->cred_guard_mutex); +out: + return retval; +} @@ -1014,7 +1014,7 @@ index ...a90078d 100644 + struct iovec *kiov); + +int ptrace_request(struct task_struct *child, long request, -+ long addr, long data) ++ unsigned long addr, unsigned long data) +{ + struct utrace_engine *engine = ptrace_lookup_engine(child); + siginfo_t siginfo; @@ -1412,7 +1412,7 @@ index 23bde94..daed9e8 100644 +#define arch_ptrace_attach(child) do { } while (0) +#endif + -+SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data) ++SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, unsigned long, data) +{ + struct task_struct *child; + long ret; @@ -1453,7 +1453,7 @@ index 23bde94..daed9e8 100644 + return ret; +} + -+int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data) ++int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, unsigned long data) +{ + unsigned long tmp; + int copied; @@ -1464,7 +1464,7 @@ index 23bde94..daed9e8 100644 + return put_user(tmp, (unsigned long __user *)data); +} + -+int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data) ++int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, unsigned long data) +{ + int copied; + @@ -1595,7 +1595,7 @@ index 23bde94..daed9e8 100644 unlock_tasklist: - write_unlock_irq(&tasklist_lock); -unlock_creds: -- mutex_unlock(&task->cred_guard_mutex); +- mutex_unlock(&task->signal->cred_guard_mutex); -out: - return retval; -} @@ -1656,7 +1656,7 @@ index 23bde94..daed9e8 100644 - * If it should reap itself, return true. + write_unlock_irq(&tasklist_lock); +unlock_creds: -+ mutex_unlock(&task->cred_guard_mutex); ++ mutex_unlock(&task->signal->cred_guard_mutex); +out: + return retval; +} @@ -1765,7 +1765,7 @@ index 23bde94..daed9e8 100644 - return copied; -} - - static int ptrace_setoptions(struct task_struct *child, long data) + static int ptrace_setoptions(struct task_struct *child, unsigned long data) { child->ptrace &= ~PT_TRACE_MASK; @@ -530,47 +677,6 @@ static int ptrace_resume(struct task_str @@ -1814,9 +1814,9 @@ index 23bde94..daed9e8 100644 -#endif - int ptrace_request(struct task_struct *child, long request, - long addr, long data) + unsigned long addr, unsigned long data) { -@@ -686,88 +792,7 @@ int ptrace_request(struct task_struct *c +@@ -686,91 +792,7 @@ int ptrace_request(struct task_struct *c return ret; } @@ -1839,7 +1839,8 @@ index 23bde94..daed9e8 100644 -#define arch_ptrace_attach(child) do { } while (0) -#endif - --SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data) +-SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, +- unsigned long, data) -{ - struct task_struct *child; - long ret; @@ -1880,7 +1881,8 @@ index 23bde94..daed9e8 100644 - return ret; -} - --int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data) +-int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, +- unsigned long data) -{ - unsigned long tmp; - int copied; @@ -1891,7 +1893,8 @@ index 23bde94..daed9e8 100644 - return put_user(tmp, (unsigned long __user *)data); -} - --int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data) +-int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, +- unsigned long data) -{ - int copied; - From 3996540995fcf546303547e8ad88c5b2096dce02 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 8 Nov 2010 10:54:55 -0500 Subject: [PATCH 05/47] Linux 2.6.37-rc1-git5 --- .gitignore | 1 + kernel.spec | 5 ++++- sources | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d89af37a9..1f74bd3c9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc1.bz2 +/patch-2.6.37-rc1-git5.bz2 diff --git a/kernel.spec b/kernel.spec index 772f21ad1..e8450fda7 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 1 # The git snapshot level -%define gitrev 0 +%define gitrev 5 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1900,6 +1900,9 @@ fi # || || %changelog +* Mon Nov 08 2010 Kyle McMartin 2.6.37-0.1.rc1.git5 +- Linux 2.6.37-rc1-git5 + * Mon Nov 08 2010 Kyle McMartin - Cherry-pick utrace-ptrace fixes from mayoung. Thanks! diff --git a/sources b/sources index a666d4de8..67b4be7ef 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 7364d9629734c34d09ec9ebd351d40b9 patch-2.6.37-rc1.bz2 +d378228e109a29a513e2ceba02eebf70 patch-2.6.37-rc1-git5.bz2 From 166b79a5e07606e677a785ab1473979b09bcd95a Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:43:53 -0400 Subject: [PATCH 06/47] rpmlint fluff. kernel.src:386: W: macro-in-comment %nobuildarches kernel.src:432: W: macro-in-comment %post kernel.src:1002: W: macro-in-comment %{vanillaversion} kernel.src:1003: W: macro-in-comment %{kversion} kernel.src:1005: W: macro-in-comment %{kversion} kernel.src:1883: W: macro-in-comment %{image_install_path} (Packagers should avoid using macros in comments, but this is a minor error. The easy fix here is to %% comment out any macros in comments, to prevent unexpected and random behavior.) --- kernel.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel.spec b/kernel.spec index e8450fda7..24a53f3de 100644 --- a/kernel.spec +++ b/kernel.spec @@ -383,7 +383,7 @@ Summary: The Linux kernel %endif # To temporarily exclude an architecture from being built, add it to -# %nobuildarches. Do _NOT_ use the ExclusiveArch: line, because if we +# %%nobuildarches. Do _NOT_ use the ExclusiveArch: line, because if we # don't build kernel-headers then the new build system will no longer let # us use the previous build of that package -- it'll just be completely AWOL. # Which is a BadThing(tm). @@ -429,7 +429,7 @@ Summary: The Linux kernel %define kernel_headers_conflicts libdrm-devel < 2.4.0-0.15 # -# Packages that need to be installed before the kernel is, because the %post +# Packages that need to be installed before the kernel is, because the %%post # scripts use them. # %define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1, grubby >= 7.0.10-1 @@ -975,10 +975,10 @@ ApplyOptionalPatch() %endif %endif -# %{vanillaversion} : the full version name, e.g. 2.6.35-rc6-git3 -# %{kversion} : the base version, e.g. 2.6.34 +# %%{vanillaversion} : the full version name, e.g. 2.6.35-rc6-git3 +# %%{kversion} : the base version, e.g. 2.6.34 -# Use kernel-%{kversion}%{?dist} as the top-level directory name +# Use kernel-%%{kversion}%%{?dist} as the top-level directory name # so we can prep different trees within a single git directory. # Build a list of the other top-level kernel tree directories. @@ -1828,7 +1828,7 @@ fi %{_mandir}/man[1-8]/* %endif -# This is %{image_install_path} on an arch where that includes ELF files, +# This is %%{image_install_path} on an arch where that includes ELF files, # or empty otherwise. %define elf_image_install_path %{?kernel_image_elf:%{image_install_path}} From efc71adf486cf0feedb91983401710ef9fbddc06 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:46:03 -0400 Subject: [PATCH 07/47] These haven't been shipped in sometime, we can just remove it. This also has the effect of silencing the rpmlint warning about an unversioned obsolete. --- kernel.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel.spec b/kernel.spec index 24a53f3de..6d5b40b12 100644 --- a/kernel.spec +++ b/kernel.spec @@ -481,9 +481,9 @@ ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ia64 sparc sparc64 s390 s390x ExclusiveOS: Linux %kernel_reqprovconf -%ifarch x86_64 sparc64 -Obsoletes: kernel-smp -%endif + + + # From d555d677e1d6aa9b75faf596123508325703c734 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:47:32 -0400 Subject: [PATCH 08/47] Fix another rpmlint obsoletes warning kernel.src:757: W: unversioned-explicit-obsoletes glibc-kernheaders kernel-headers.x86_64: W: self-obsoletion glibc-kernheaders obsoletes glibc-kernheaders = 3.0-46 --- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 6d5b40b12..f1be7761a 100644 --- a/kernel.spec +++ b/kernel.spec @@ -730,7 +730,7 @@ options that can be passed to Linux kernel modules at load time. %package headers Summary: Header files for the Linux kernel for use by glibc Group: Development/System -Obsoletes: glibc-kernheaders +Obsoletes: glibc-kernheaders < 3.0-46 Provides: glibc-kernheaders = 3.0-46 %description headers Kernel-headers includes the C header files that specify the interface From b89c80f6e2ff7f1423e676b3cd3604cbe3e54f85 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:49:21 -0400 Subject: [PATCH 09/47] stop using the obsolete forms of grep shortcuts. --- kernel.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel.spec b/kernel.spec index f1be7761a..fcabf99f5 100644 --- a/kernel.spec +++ b/kernel.spec @@ -917,7 +917,7 @@ ApplyPatch() exit 1 fi %if !%{using_upstream_branch} - if ! egrep "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME%%%%%{?variant}}.spec ; then + if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME%%%%%{?variant}}.spec ; then if [ "${patch:0:10}" != "patch-2.6." ] ; then echo "ERROR: Patch $patch not listed as a source patch in specfile" exit 1 @@ -1324,7 +1324,7 @@ for i in *.config do mv $i .config Arch=`head -1 .config | cut -b 3-` - make ARCH=$Arch listnewconfig | egrep '^CONFIG_' >.newoptions || true + make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true %if %{listnewconfig_fail} if [ -s .newoptions ]; then cat .newoptions @@ -1521,7 +1521,7 @@ BuildKernel() { # Generate a list of modules for block and networking. - fgrep /drivers/ modnames | xargs --no-run-if-empty nm -upA | + grep -F /drivers/ modnames | xargs --no-run-if-empty nm -upA | sed -n 's,^.*/\([^/]*\.ko\): *U \(.*\)$,\1 \2,p' > drivers.undef collect_modules_list() @@ -1547,7 +1547,7 @@ BuildKernel() { /sbin/modinfo -l $i >> modinfo done < modnames - egrep -v \ + grep -E -v \ 'GPL( v2)?$|Dual BSD/GPL$|Dual MPL/GPL$|GPL and additional rights$' \ modinfo && exit 1 From 048093aa05fb17bf9d38e71d145305c905507979 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:50:26 -0400 Subject: [PATCH 10/47] more rpmlint.. kernel.src:2188: W: macro-in-%changelog %released_kernel kernel.src:2232: W: macro-in-%changelog %verify kernel.src:2411: W: macro-in-%changelog %{expand (Packagers should avoid using macros in changelog items, but this is a minor error. The easy fix here is to %% comment out any macros in changelog entries, to prevent unexpected and random behavior.) --- kernel.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel.spec b/kernel.spec index fcabf99f5..f9ab05173 100644 --- a/kernel.spec +++ b/kernel.spec @@ -2149,7 +2149,7 @@ fi numbers. * Wed Aug 04 2010 Kyle McMartin -- Disable %released_kernel. +- Disable %%released_kernel. - This is properly 2.6.36-0.git1, unlike the last commit. Had to make a mistake sometime, I'm glad it was early. @@ -2193,7 +2193,7 @@ fi - Linux 2.6.35-rc5-git7 * Wed Jul 21 2010 Dave Jones -- Remove the %verify (no mtime) on kernel-devel's files. +- Remove the %%verify (no mtime) on kernel-devel's files. If they got modified, they should fail rpm verify. * Wed Jul 21 2010 Dave Jones @@ -2372,7 +2372,7 @@ fi having trouble finding anyone who actually uses it. * Tue Jun 15 2010 Kyle McMartin 2.6.34-38 -- Fix build by nuking superfluous "%{expand" which was missing a +- Fix build by nuking superfluous "%%{expand" which was missing a trailing '}'. You may now reward me with an array of alcoholic beverages, I so richly deserve for spending roughly a full day staring at the diff of the spec. From 561b24abd9c339d9eb22746bd4a8d850846859ff Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:51:00 -0400 Subject: [PATCH 11/47] whitespace cleanup --- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index f9ab05173..740dba8b3 100644 --- a/kernel.spec +++ b/kernel.spec @@ -144,7 +144,7 @@ Summary: The Linux kernel %define with_dbgonly %{?_with_dbgonly: 1} %{?!_with_dbgonly: 0} # should we do C=1 builds with sparse -%define with_sparse %{?_with_sparse: 1} %{?!_with_sparse: 0} +%define with_sparse %{?_with_sparse: 1} %{?!_with_sparse: 0} # Set debugbuildsenabled to 1 for production (build separate debug kernels) # and 0 for rawhide (all kernels are debug kernels). From 246f94f0963a6a57eaf0fed394a2aec03c3cdd37 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:56:20 -0400 Subject: [PATCH 12/47] remove .gitignores from the source tree, so they don't end up getting packaged. --- kernel.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel.spec b/kernel.spec index 740dba8b3..6e906f8f4 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1342,6 +1342,9 @@ done # get rid of unwanted files resulting from patch fuzz find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null +# remove unnecessary SCM files +find . -name .gitignore -exec rm -f {} \; >/dev/null + cd .. ### From b0335bcfdfd3de7d59052aeac8f703fab1bb4e47 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 13:59:09 -0400 Subject: [PATCH 13/47] remove build cruft that shouldn't be packaged in kernel-devel --- kernel.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel.spec b/kernel.spec index 6e906f8f4..d2ee10bef 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1684,6 +1684,8 @@ find $RPM_BUILD_ROOT/usr/include \ \( -name .install -o -name .check -o \ -name ..install.cmd -o -name ..check.cmd \) | xargs rm -f +find $RPM_BUILD_ROOT/usr/src/kernels -name .*.cmd -exec rm -f {} \; + # glibc provides scsi headers for itself, for now rm -rf $RPM_BUILD_ROOT/usr/include/scsi rm -f $RPM_BUILD_ROOT/usr/include/asm*/atomic.h From 4019ed3efeace53375327ac38e645154b24675f4 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 26 Oct 2010 14:12:21 -0400 Subject: [PATCH 14/47] remove some temporary stuff I did to keep the line numbers the same during the rpmlint review --- kernel.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kernel.spec b/kernel.spec index d2ee10bef..4986462a3 100644 --- a/kernel.spec +++ b/kernel.spec @@ -482,10 +482,6 @@ ExclusiveOS: Linux %kernel_reqprovconf - - - - # # List the packages used during the kernel build # From f8eb8d89fbf3224d7764b36cf72f8f4c89ce006f Mon Sep 17 00:00:00 2001 From: Michael Young Date: Sat, 30 Oct 2010 23:02:42 +0100 Subject: [PATCH 15/47] Quote wildcard argument in "find" command --- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 4986462a3..5f2e001ed 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1680,7 +1680,7 @@ find $RPM_BUILD_ROOT/usr/include \ \( -name .install -o -name .check -o \ -name ..install.cmd -o -name ..check.cmd \) | xargs rm -f -find $RPM_BUILD_ROOT/usr/src/kernels -name .*.cmd -exec rm -f {} \; +find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -exec rm -f {} \; # glibc provides scsi headers for itself, for now rm -rf $RPM_BUILD_ROOT/usr/include/scsi From 8383538959a3705b40f1f533e1da3145dbbb7a7f Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 9 Nov 2010 09:01:34 -0500 Subject: [PATCH 16/47] Linux 2.6.37-rc1-git7 --- .gitignore | 2 +- kernel.spec | 5 ++++- linux-2.6-crash-driver.patch | 24 ++++++++++-------------- sources | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 1f74bd3c9..49bbef401 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc1.bz2 -/patch-2.6.37-rc1-git5.bz2 +/patch-2.6.37-rc1-git7.bz2 diff --git a/kernel.spec b/kernel.spec index 5f2e001ed..5d2afdb82 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 1 # The git snapshot level -%define gitrev 5 +%define gitrev 7 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1901,6 +1901,9 @@ fi # || || %changelog +* Tue Nov 09 2010 Kyle McMartin 2.6.37-0.1.rc1.git7 +- Linux 2.6.37-rc1-git7 + * Mon Nov 08 2010 Kyle McMartin 2.6.37-0.1.rc1.git5 - Linux 2.6.37-rc1-git5 diff --git a/linux-2.6-crash-driver.patch b/linux-2.6-crash-driver.patch index 7b518bb88..0f11aba0d 100644 --- a/linux-2.6-crash-driver.patch +++ b/linux-2.6-crash-driver.patch @@ -233,18 +233,6 @@ index 3141dd3..153658c 100644 config LEGACY_PTY_COUNT int "Maximum number of legacy PTY in use" -diff --git a/drivers/char/Makefile b/drivers/char/Makefile -index f957edf..604c418 100644 ---- a/drivers/char/Makefile -+++ b/drivers/char/Makefile -@@ -111,6 +111,8 @@ obj-$(CONFIG_PS3_FLASH) += ps3flash.o - obj-$(CONFIG_JS_RTC) += js-rtc.o - js-rtc-y = rtc.o - -+obj-$(CONFIG_CRASH) += crash.o -+ - # Files generated that shall be removed upon make clean - clean-files := consolemap_deftbl.c defkeymap.c diff --git a/drivers/char/crash.c b/drivers/char/crash.c new file mode 100644 @@ -380,6 +368,14 @@ index 0000000..e5437de +module_exit(crash_cleanup_module); + +MODULE_LICENSE("GPL"); --- -1.7.0.1 +diff --git a/drivers/char/Makefile b/drivers/char/Makefile +index ba53ec9..6588b33 100644 +--- a/drivers/char/Makefile ++++ b/drivers/char/Makefile +@@ -98,3 +98,5 @@ obj-$(CONFIG_RAMOOPS) += ramoops.o + + obj-$(CONFIG_JS_RTC) += js-rtc.o + js-rtc-y = rtc.o ++ ++obj-$(CONFIG_CRASH) += crash.o diff --git a/sources b/sources index 67b4be7ef..9b2f9bea7 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 7364d9629734c34d09ec9ebd351d40b9 patch-2.6.37-rc1.bz2 -d378228e109a29a513e2ceba02eebf70 patch-2.6.37-rc1-git5.bz2 +b794491328289db900d725673a23fd08 patch-2.6.37-rc1-git7.bz2 From 1d6dcd2719d378a507a5369c6017e8f616333f06 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sat, 13 Nov 2010 22:18:22 -0500 Subject: [PATCH 17/47] Merge 2.6.37-rc1-git10 - Pull in 2.6.37-rc1-git10 snapshot - SECURITY_DMESG_RESTRICT added, the principle of least surprise dictates we should probably have it off. If you want to restrict dmesg access you may use the kernel.dmesg_restrict sysctl. - linux-2.6-bluetooth-autosuspend.patch: merged upstream. --- .gitignore | 2 +- config-generic | 3 + kernel.spec | 11 +- linux-2.6-bluetooth-autosuspend.patch | 159 -------------------------- sources | 2 +- 5 files changed, 13 insertions(+), 164 deletions(-) delete mode 100644 linux-2.6-bluetooth-autosuspend.patch diff --git a/.gitignore b/.gitignore index 49bbef401..165240bfc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc1.bz2 -/patch-2.6.37-rc1-git7.bz2 +/patch-2.6.37-rc1-git10.bz2 diff --git a/config-generic b/config-generic index 9a0b10bc7..5b6b2912d 100644 --- a/config-generic +++ b/config-generic @@ -3670,6 +3670,7 @@ CONFIG_KGDB_LOW_LEVEL_TRAP=y # Security options # CONFIG_SECURITY=y +# CONFIG_SECURITY_DMESG_RESTRICT is not set CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_NETWORK_XFRM=y # CONFIG_SECURITY_PATH is not set @@ -4019,6 +4020,8 @@ CONFIG_LEDS_REGULATOR=m CONFIG_LEDS_LT3593=m CONFIG_LEDS_TRIGGER_GPIO=m CONFIG_LEDS_INTEL_SS4200=m +CONFIG_LEDS_LP5521=m +CONFIG_LEDS_LP5523=m CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y diff --git a/kernel.spec b/kernel.spec index 5d2afdb82..7f1cfd531 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 1 # The git snapshot level -%define gitrev 7 +%define gitrev 10 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -693,7 +693,6 @@ Patch12018: neuter_intel_microcode_load.patch Patch12030: tpm-fix-stall-on-boot.patch # Runtime power management -Patch12200: linux-2.6-bluetooth-autosuspend.patch Patch12203: linux-2.6-usb-pci-autosuspend.patch Patch12204: linux-2.6-enable-more-pci-autosuspend.patch Patch12205: runtime_pm_fixups.patch @@ -1281,7 +1280,6 @@ ApplyPatch neuter_intel_microcode_load.patch ApplyPatch tpm-fix-stall-on-boot.patch # Runtime PM -ApplyPatch linux-2.6-bluetooth-autosuspend.patch ApplyPatch linux-2.6-usb-pci-autosuspend.patch ApplyPatch linux-2.6-enable-more-pci-autosuspend.patch ApplyPatch runtime_pm_fixups.patch @@ -1901,6 +1899,13 @@ fi # || || %changelog +* Sat Nov 13 2010 Kyle McMartin 2.6.37-0.1.rc1.git10 +- Linux 2.6.37-rc1-git10 +- SECURITY_DMESG_RESTRICT added, the principle of least surprise dictates + we should probably have it off. If you want to restrict dmesg access + you may use the kernel.dmesg_restrict sysctl. +- linux-2.6-bluetooth-autosuspend.patch: merged upstream. + * Tue Nov 09 2010 Kyle McMartin 2.6.37-0.1.rc1.git7 - Linux 2.6.37-rc1-git7 diff --git a/linux-2.6-bluetooth-autosuspend.patch b/linux-2.6-bluetooth-autosuspend.patch deleted file mode 100644 index 663b79979..000000000 --- a/linux-2.6-bluetooth-autosuspend.patch +++ /dev/null @@ -1,159 +0,0 @@ -commit 6aa42966dea9a1fc02a714211ea489c3278bf8d4 -Author: Matthew Garrett -Date: Thu Sep 16 13:34:55 2010 -0400 - - bluetooth: Take a runtime pm reference on hid connections - - Bluetooth runtime PM interacts badly with input devices - the connection - will be dropped if the device becomes idle, resulting in noticable lag when - the user interacts with the input device again. Bump the pm runtime count - when the device is associated and release it when it's disassociated in - order to avoid this. - - Signed-off-by: Matthew Garrett - -diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c -index bfe641b..a4489a7 100644 ---- a/net/bluetooth/hidp/core.c -+++ b/net/bluetooth/hidp/core.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -622,6 +623,14 @@ static int hidp_session(void *arg) - return 0; - } - -+static struct hci_dev *hidp_get_hci(struct hidp_session *session) -+{ -+ bdaddr_t *src = &bt_sk(session->ctrl_sock->sk)->src; -+ bdaddr_t *dst = &bt_sk(session->ctrl_sock->sk)->dst; -+ -+ return hci_get_route(dst, src); -+} -+ - static struct device *hidp_get_device(struct hidp_session *session) - { - bdaddr_t *src = &bt_sk(session->ctrl_sock->sk)->src; -@@ -819,6 +828,7 @@ fault: - int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock) - { - struct hidp_session *session, *s; -+ struct hci_dev *hdev; - int err; - - BT_DBG(""); -@@ -889,6 +899,10 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, - hidp_input_event(session->input, EV_LED, 0, 0); - } - -+ hdev = hidp_get_hci(session); -+ pm_runtime_get(hdev->parent); -+ hci_dev_put(hdev); -+ - up_write(&hidp_session_sem); - return 0; - -@@ -925,6 +939,7 @@ failed: - int hidp_del_connection(struct hidp_conndel_req *req) - { - struct hidp_session *session; -+ struct hci_dev *hdev; - int err = 0; - - BT_DBG(""); -@@ -952,6 +967,9 @@ int hidp_del_connection(struct hidp_conndel_req *req) - } else - err = -ENOENT; - -+ hdev = hidp_get_hci(session); -+ pm_runtime_put(hdev->parent); -+ hci_dev_put(hdev); - up_read(&hidp_session_sem); - return err; - } - -commit 482eca592615e85b048753750b101d051b77fde9 -Author: Matthew Garrett -Date: Thu Sep 16 13:49:24 2010 -0400 - - bluetooth: Remove some unnecessary error messages - - The main reason for these urbs to error out on submission is that runtime - pm has kicked in, which is unnecessary noise. Let's just drop them. - - Signed-off-by: Matthew Garrett - -diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index d22ce3c..3ace025 100644 ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -229,11 +229,8 @@ static void btusb_intr_complete(struct urb *urb) - usb_anchor_urb(urb, &data->intr_anchor); - - err = usb_submit_urb(urb, GFP_ATOMIC); -- if (err < 0) { -- BT_ERR("%s urb %p failed to resubmit (%d)", -- hdev->name, urb, -err); -+ if (err < 0) - usb_unanchor_urb(urb); -- } - } - - static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags) -@@ -313,11 +310,8 @@ static void btusb_bulk_complete(struct urb *urb) - usb_mark_last_busy(data->udev); - - err = usb_submit_urb(urb, GFP_ATOMIC); -- if (err < 0) { -- BT_ERR("%s urb %p failed to resubmit (%d)", -- hdev->name, urb, -err); -+ if (err < 0) - usb_unanchor_urb(urb); -- } - } - - static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags) -@@ -402,11 +396,8 @@ static void btusb_isoc_complete(struct urb *urb) - usb_anchor_urb(urb, &data->isoc_anchor); - - err = usb_submit_urb(urb, GFP_ATOMIC); -- if (err < 0) { -- BT_ERR("%s urb %p failed to resubmit (%d)", -- hdev->name, urb, -err); -+ if (err < 0) - usb_unanchor_urb(urb); -- } - } - - static void inline __fill_isoc_descriptor(struct urb *urb, int len, int mtu) - -commit fd763c5b14ed99ac2401f8e8f1a07c3687ae01cc -Author: Matthew Garrett -Date: Thu Sep 16 13:37:38 2010 -0400 - - bluetooth: Enable USB autosuspend by default on btusb - - We've done this for a while in Fedora without any obvious problems other - than some interaction with input devices. Those should be fixed now, so - let's try this in mainline. - - Signed-off-by: Matthew Garrett - -diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index 3ace025..03b64e4 100644 ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -1014,6 +1014,8 @@ static int btusb_probe(struct usb_interface *intf, - - usb_set_intfdata(intf, data); - -+ usb_enable_autosuspend(interface_to_usbdev(intf)); -+ - return 0; - } - diff --git a/sources b/sources index 9b2f9bea7..285c81366 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 7364d9629734c34d09ec9ebd351d40b9 patch-2.6.37-rc1.bz2 -b794491328289db900d725673a23fd08 patch-2.6.37-rc1-git7.bz2 +99827f19411ac74a4789cb6395e4568d patch-2.6.37-rc1-git10.bz2 From 58e831b2c08407c5e7e7da238d2ee0e1b9ad4d3e Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 15 Nov 2010 22:54:32 -0500 Subject: [PATCH 18/47] Linux 2.6.37-rc2 --- .gitignore | 1 + kernel.spec | 7 +++++-- sources | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 165240bfc..7ad8291ef 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ clog kernel-2.6.*/ /patch-2.6.37-rc1.bz2 /patch-2.6.37-rc1-git10.bz2 +/patch-2.6.37-rc2.bz2 diff --git a/kernel.spec b/kernel.spec index 7f1cfd531..6a5c2a2ee 100644 --- a/kernel.spec +++ b/kernel.spec @@ -82,9 +82,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 1 +%define rcrev 2 # The git snapshot level -%define gitrev 10 +%define gitrev 0 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1899,6 +1899,9 @@ fi # || || %changelog +* Mon Nov 15 2010 Kyle McMartin 2.6.37-0.1.rc2.git0 +- Linux 2.6.37-rc2 + * Sat Nov 13 2010 Kyle McMartin 2.6.37-0.1.rc1.git10 - Linux 2.6.37-rc1-git10 - SECURITY_DMESG_RESTRICT added, the principle of least surprise dictates diff --git a/sources b/sources index 285c81366..cf373cdb4 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 7364d9629734c34d09ec9ebd351d40b9 patch-2.6.37-rc1.bz2 99827f19411ac74a4789cb6395e4568d patch-2.6.37-rc1-git10.bz2 +279da99f02bd89e85b1ae5f68f852c0e patch-2.6.37-rc2.bz2 From 754832dcb49b19e83a96b75cc94ce764cae8ae3d Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 16 Nov 2010 01:10:24 -0500 Subject: [PATCH 19/47] hdpvr lost an id upstream --- hdpvr-ir-enable.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hdpvr-ir-enable.patch b/hdpvr-ir-enable.patch index f377d6b4a..e73c42122 100644 --- a/hdpvr-ir-enable.patch +++ b/hdpvr-ir-enable.patch @@ -216,3 +216,14 @@ index b0f046d..2107055 100644 /* I2C lock */ struct mutex i2c_mutex; +diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h +index 4bef5c5..4385341 100644 +--- a/include/linux/i2c-id.h ++++ b/include/linux/i2c-id.h +@@ -33,5 +33,6 @@ + + /* --- Bit algorithm adapters */ + #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ ++#define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ + + #endif /* LINUX_I2C_ID_H */ From ccb40e674588f671092435079c2e503325d3ce34 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 16 Nov 2010 02:06:52 -0500 Subject: [PATCH 20/47] add a target to toggle debuginfo generation (my disk is slow...) --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index c6142c153..ca62cce42 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,8 @@ debug: @perl -pi -e 's/^%define debugbuildsenabled 1/%define debugbuildsenabled 0/' kernel.spec @perl -pi -e 's/^%define rawhide_skip_docs 0/%define rawhide_skip_docs 1/' kernel.spec +nodebuginfo: + @perl -pi -e 's/^%define with_debuginfo %\{\?_without_debuginfo: 0\} %\{\?\!_without_debuginfo: 1\}/%define with_debuginfo %\{\?_without_debuginfo: 0\} %\{\?\!_without_debuginfo: 0\}/' kernel.spec nodebug: release @perl -pi -e 's/^%define debugbuildsenabled 1/%define debugbuildsenabled 0/' kernel.spec release: From d287769cc9dbdad68eb0123b149e8c8edae4632f Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 17 Nov 2010 00:37:01 -0500 Subject: [PATCH 21/47] make vmlinuz/System.map root-only by default --- kernel.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index 6a5c2a2ee..2850a528c 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1840,8 +1840,8 @@ fi %if %{1}\ %{expand:%%files %{?2}}\ %defattr(-,root,root)\ -/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\ -/boot/System.map-%{KVERREL}%{?2:.%{2}}\ +%attr(600,root,root) /%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\ +%attr(600,root,root) /boot/System.map-%{KVERREL}%{?2:.%{2}}\ /boot/config-%{KVERREL}%{?2:.%{2}}\ %dir /lib/modules/%{KVERREL}%{?2:.%{2}}\ /lib/modules/%{KVERREL}%{?2:.%{2}}/kernel\ @@ -1899,6 +1899,10 @@ fi # || || %changelog +* Wed Nov 17 2010 Kyle McMartin +- Make vmlinuz/System.map root read-write only by default. You can just + chmod 644 them later if you (unlikely) need them without root. + * Mon Nov 15 2010 Kyle McMartin 2.6.37-0.1.rc2.git0 - Linux 2.6.37-rc2 From fddecabe0049ffcad3ef1a54eb7eea88aef72bcd Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 17 Nov 2010 12:40:56 -0500 Subject: [PATCH 22/47] Linux 2.6.37-rc2-git2 --- .gitignore | 3 +-- config-s390x | 2 ++ kernel.spec | 6 +++++- sources | 3 +-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7ad8291ef..ad47da49b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ patch-*.bz2 clog *.rpm kernel-2.6.*/ -/patch-2.6.37-rc1.bz2 -/patch-2.6.37-rc1-git10.bz2 /patch-2.6.37-rc2.bz2 +/patch-2.6.37-rc2-git2.bz2 diff --git a/config-s390x b/config-s390x index 148ee5506..780fc9146 100644 --- a/config-s390x +++ b/config-s390x @@ -231,3 +231,5 @@ CONFIG_ZFCP_DIF=y CONFIG_SCHED_MC=y CONFIG_SCHED_BOOK=y + +CONFIG_STRICT_DEVMEM=y diff --git a/kernel.spec b/kernel.spec index 2850a528c..9552ec7fa 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 2 # The git snapshot level -%define gitrev 0 +%define gitrev 2 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1899,6 +1899,10 @@ fi # || || %changelog +* Wed Nov 17 2010 Kyle McMartin 2.6.37-0.1.rc2.git2 +- Linux 2.6.37-rc2-git2 +- enable STRICT_DEVMEM on s390x. + * Wed Nov 17 2010 Kyle McMartin - Make vmlinuz/System.map root read-write only by default. You can just chmod 644 them later if you (unlikely) need them without root. diff --git a/sources b/sources index cf373cdb4..535171430 100644 --- a/sources +++ b/sources @@ -1,4 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 -7364d9629734c34d09ec9ebd351d40b9 patch-2.6.37-rc1.bz2 -99827f19411ac74a4789cb6395e4568d patch-2.6.37-rc1-git10.bz2 279da99f02bd89e85b1ae5f68f852c0e patch-2.6.37-rc2.bz2 +040ff765f6498268c2510640fc412ccd patch-2.6.37-rc2-git2.bz2 From 66ce81a2f2fac22e97b511ffb27cb87026ac4972 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Nov 2010 13:52:09 -0500 Subject: [PATCH 23/47] move %fedora_build in the non-released case --- kernel.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 9552ec7fa..2ae798b27 100644 --- a/kernel.spec +++ b/kernel.spec @@ -175,7 +175,7 @@ Summary: The Linux kernel %else %define gittag .git0 %endif -%define pkg_release 0.%{fedora_build}%{?rctag}%{?gittag}%{?buildid}%{?dist} +%define pkg_release 0%{?rctag}%{?gittag}.%{fedora_build}%{?buildid}%{?dist} %endif @@ -1899,6 +1899,13 @@ fi # || || %changelog +* Thu Nov 18 2010 Kyle McMartin +- Move %{fedora_build} in the un-released (ie: -git/-rc) kernel case for + a variety of reasons, principally so that: + 1: Bumping %baserelease isn't needed if we're just updating snapshots. + 2: %buildid will sort as newer so we don't need to bump baserelease when + building bugzilla fixes. + * Wed Nov 17 2010 Kyle McMartin 2.6.37-0.1.rc2.git2 - Linux 2.6.37-rc2-git2 - enable STRICT_DEVMEM on s390x. From 39c7042fdd9f0bcc838998d3c8db774d56ec2364 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 19 Nov 2010 08:04:35 -0500 Subject: [PATCH 24/47] update to Linux 2.6.37-rc2-git5 --- .gitignore | 2 +- kernel.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ad47da49b..8e9dcc40e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc2.bz2 -/patch-2.6.37-rc2-git2.bz2 +/patch-2.6.37-rc2-git5.bz2 diff --git a/kernel.spec b/kernel.spec index 2ae798b27..7f1b4ab54 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 2 # The git snapshot level -%define gitrev 2 +%define gitrev 5 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1899,6 +1899,9 @@ fi # || || %changelog +* Fri Nov 19 2010 Kyle McMartin 2.6.37-0.rc2.git5.1 +- Linux 2.6.37-rc2-git5 + * Thu Nov 18 2010 Kyle McMartin - Move %{fedora_build} in the un-released (ie: -git/-rc) kernel case for a variety of reasons, principally so that: diff --git a/sources b/sources index 535171430..f3e16f14e 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 279da99f02bd89e85b1ae5f68f852c0e patch-2.6.37-rc2.bz2 -040ff765f6498268c2510640fc412ccd patch-2.6.37-rc2-git2.bz2 +7645b1df8d5741e87c32a9994a14c336 patch-2.6.37-rc2-git5.bz2 From c513bba5960b58475cdf7c13af9f1da2250f30fb Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sat, 20 Nov 2010 20:17:17 -0500 Subject: [PATCH 25/47] Linux 2.6.37-rc2-git7 --- .gitignore | 1 + kernel.spec | 5 ++++- sources | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8e9dcc40e..30e01217d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ clog kernel-2.6.*/ /patch-2.6.37-rc2.bz2 /patch-2.6.37-rc2-git5.bz2 +/patch-2.6.37-rc2-git7.bz2 diff --git a/kernel.spec b/kernel.spec index 7f1b4ab54..15b393d54 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 2 # The git snapshot level -%define gitrev 5 +%define gitrev 7 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1899,6 +1899,9 @@ fi # || || %changelog +* Sat Nov 20 2010 Kyle McMartin 2.6.37-0.rc2.git7.1 +- Linux 2.6.37-rc2-git7 + * Fri Nov 19 2010 Kyle McMartin 2.6.37-0.rc2.git5.1 - Linux 2.6.37-rc2-git5 diff --git a/sources b/sources index f3e16f14e..f6e9fb419 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 279da99f02bd89e85b1ae5f68f852c0e patch-2.6.37-rc2.bz2 7645b1df8d5741e87c32a9994a14c336 patch-2.6.37-rc2-git5.bz2 +5b9f94c8cdc478788fdcdf4eb16cbbcb patch-2.6.37-rc2-git7.bz2 From 017454890583d418c02a6f8d371ac647f9101c1e Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 22 Nov 2010 08:11:09 -0500 Subject: [PATCH 26/47] Linux 2.6.37-rc3 --- .gitignore | 1 + kernel.spec | 7 +++++-- sources | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 30e01217d..a6c09e16c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ kernel-2.6.*/ /patch-2.6.37-rc2.bz2 /patch-2.6.37-rc2-git5.bz2 /patch-2.6.37-rc2-git7.bz2 +/patch-2.6.37-rc3.bz2 diff --git a/kernel.spec b/kernel.spec index 15b393d54..06a6bdadc 100644 --- a/kernel.spec +++ b/kernel.spec @@ -82,9 +82,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 2 +%define rcrev 3 # The git snapshot level -%define gitrev 7 +%define gitrev 0 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1899,6 +1899,9 @@ fi # || || %changelog +* Mon Nov 22 2010 Kyle McMartin 2.6.37-0.rc3.git0.1 +- Linux 2.6.37-rc3 + * Sat Nov 20 2010 Kyle McMartin 2.6.37-0.rc2.git7.1 - Linux 2.6.37-rc2-git7 diff --git a/sources b/sources index f6e9fb419..5f5214c08 100644 --- a/sources +++ b/sources @@ -2,3 +2,4 @@ 279da99f02bd89e85b1ae5f68f852c0e patch-2.6.37-rc2.bz2 7645b1df8d5741e87c32a9994a14c336 patch-2.6.37-rc2-git5.bz2 5b9f94c8cdc478788fdcdf4eb16cbbcb patch-2.6.37-rc2-git7.bz2 +9a487f01d20f9ee6917395a4c3de8ea7 patch-2.6.37-rc3.bz2 From f6dd1f4eacc516221ac8f4a7038ab8b7a8122768 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 22 Nov 2010 08:19:35 -0500 Subject: [PATCH 27/47] make vmlinuz world readable --- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 06a6bdadc..1c7626b50 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1840,7 +1840,7 @@ fi %if %{1}\ %{expand:%%files %{?2}}\ %defattr(-,root,root)\ -%attr(600,root,root) /%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\ +/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\ %attr(600,root,root) /boot/System.map-%{KVERREL}%{?2:.%{2}}\ /boot/config-%{KVERREL}%{?2:.%{2}}\ %dir /lib/modules/%{KVERREL}%{?2:.%{2}}\ From 0f865c9c5e1cc353f4180723bdc0b3575d1ab60c Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 22 Nov 2010 14:45:44 -0500 Subject: [PATCH 28/47] fix incorrect reporting of whether nx is disabled or not Thanks to Kees Cook for noticing. Message-ID: <20101121070342.GE4617@outflux.net> --- linux-2.6-i386-nx-emulation.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-2.6-i386-nx-emulation.patch b/linux-2.6-i386-nx-emulation.patch index 582ce627d..24a2ed500 100644 --- a/linux-2.6-i386-nx-emulation.patch +++ b/linux-2.6-i386-nx-emulation.patch @@ -384,7 +384,7 @@ void __init x86_report_nx(void) { if (!cpu_has_nx) { -+ if (disable_nx) ++ if (!disable_nx) + printk(KERN_INFO "Using x86 segment limits to approximate NX protection\n"); + else + From a0dc92f110e134fbb9d54a8ce883ae7c9eef0327 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 24 Nov 2010 15:07:35 -0500 Subject: [PATCH 29/47] Linux 2.6.37-rc3-git1 --- .gitignore | 4 +--- kernel.spec | 5 ++++- sources | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a6c09e16c..7c1cda260 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,5 @@ patch-*.bz2 clog *.rpm kernel-2.6.*/ -/patch-2.6.37-rc2.bz2 -/patch-2.6.37-rc2-git5.bz2 -/patch-2.6.37-rc2-git7.bz2 /patch-2.6.37-rc3.bz2 +/patch-2.6.37-rc3-git1.bz2 diff --git a/kernel.spec b/kernel.spec index 1c7626b50..3bac19fa4 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 3 # The git snapshot level -%define gitrev 0 +%define gitrev 1 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1899,6 +1899,9 @@ fi # || || %changelog +* Wed Nov 24 2010 Kyle McMartin 2.6.37-0.rc3.git1.1 +- Linux 2.6.37-rc3-git1 + * Mon Nov 22 2010 Kyle McMartin 2.6.37-0.rc3.git0.1 - Linux 2.6.37-rc3 diff --git a/sources b/sources index 5f5214c08..586a11f8d 100644 --- a/sources +++ b/sources @@ -1,5 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 -279da99f02bd89e85b1ae5f68f852c0e patch-2.6.37-rc2.bz2 -7645b1df8d5741e87c32a9994a14c336 patch-2.6.37-rc2-git5.bz2 -5b9f94c8cdc478788fdcdf4eb16cbbcb patch-2.6.37-rc2-git7.bz2 9a487f01d20f9ee6917395a4c3de8ea7 patch-2.6.37-rc3.bz2 +8f2cef2658ffec282f8920677fa97ef0 patch-2.6.37-rc3-git1.bz2 From c3e06ee55aad889b162aa78277b521445347cc75 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 26 Nov 2010 09:15:31 -0500 Subject: [PATCH 30/47] Linux 2.6.37-rc3-git2 --- .gitignore | 2 +- kernel.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7c1cda260..23dedec91 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc3.bz2 -/patch-2.6.37-rc3-git1.bz2 +/patch-2.6.37-rc3-git2.bz2 diff --git a/kernel.spec b/kernel.spec index 3bac19fa4..c1cded595 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 3 # The git snapshot level -%define gitrev 1 +%define gitrev 2 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1899,6 +1899,9 @@ fi # || || %changelog +* Fri Nov 26 2010 Kyle McMartin 2.6.37-0.rc3.git2.1 +- Linux 2.6.37-rc3-git2 + * Wed Nov 24 2010 Kyle McMartin 2.6.37-0.rc3.git1.1 - Linux 2.6.37-rc3-git1 diff --git a/sources b/sources index 586a11f8d..0826a118b 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 9a487f01d20f9ee6917395a4c3de8ea7 patch-2.6.37-rc3.bz2 -8f2cef2658ffec282f8920677fa97ef0 patch-2.6.37-rc3-git1.bz2 +29a4c06a0d766633f5be66cf98c6f378 patch-2.6.37-rc3-git2.bz2 From 2f05b4a2c9603413e1b3832b758d132a24929ec1 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 26 Nov 2010 10:15:29 -0500 Subject: [PATCH 31/47] Linux 2.6.37-rc3-git2 --- config-generic | 3 +- kernel.spec | 9 ++ ...-allow-reopen-when-ldisc-is-changing.patch | 84 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 tty-dont-allow-reopen-when-ldisc-is-changing.patch diff --git a/config-generic b/config-generic index 5b6b2912d..db67c5026 100644 --- a/config-generic +++ b/config-generic @@ -3810,7 +3810,8 @@ CONFIG_CGROUP_DEVICE=y CONFIG_CGROUP_FREEZER=y CONFIG_CGROUP_SCHED=y CONFIG_CGROUP_MEM_RES_CTLR=y -CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y +CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y # XXX disabled by default, pass 'swapaccount' +# CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set CONFIG_BLK_CGROUP=y # CONFIG_DEBUG_BLK_CGROUP is not set diff --git a/kernel.spec b/kernel.spec index c1cded595..9df0131bc 100644 --- a/kernel.spec +++ b/kernel.spec @@ -699,6 +699,8 @@ Patch12205: runtime_pm_fixups.patch Patch12303: dmar-disable-when-ricoh-multifunction.patch +Patch12400: tty-dont-allow-reopen-when-ldisc-is-changing.patch + %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1287,6 +1289,9 @@ ApplyPatch runtime_pm_fixups.patch # rhbz#605888 ApplyPatch dmar-disable-when-ricoh-multifunction.patch +# rhbz#630464 +ApplyPatch tty-dont-allow-reopen-when-ldisc-is-changing.patch + # END OF PATCH APPLICATIONS %endif @@ -1901,6 +1906,10 @@ fi %changelog * Fri Nov 26 2010 Kyle McMartin 2.6.37-0.rc3.git2.1 - Linux 2.6.37-rc3-git2 +- CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set, so the cgroup memory + resource controller swap accounting is disabled by default. You can + enable it with 'swapaccount' if desired. +- TTY: don't allow reopen when ldisc is changing (rhbz#630464) * Wed Nov 24 2010 Kyle McMartin 2.6.37-0.rc3.git1.1 - Linux 2.6.37-rc3-git1 diff --git a/tty-dont-allow-reopen-when-ldisc-is-changing.patch b/tty-dont-allow-reopen-when-ldisc-is-changing.patch new file mode 100644 index 000000000..02d6746fc --- /dev/null +++ b/tty-dont-allow-reopen-when-ldisc-is-changing.patch @@ -0,0 +1,84 @@ +From jirislaby@gmail.com Thu Nov 25 12:16:42 2010 +From: Jiri Slaby +Subject: [PATCH 1/1] TTY: don't allow reopen when ldisc is changing +Date: Thu, 25 Nov 2010 18:16:23 +0100 + +There are many WARNINGs like the following reported nowadays: +WARNING: at drivers/tty/tty_io.c:1331 tty_open+0x2a2/0x49a() +Hardware name: Latitude E6500 +Modules linked in: +Pid: 1207, comm: plymouthd Not tainted 2.6.37-rc3-mmotm1123 #3 +Call Trace: + [] warn_slowpath_common+0x80/0x98 + [] warn_slowpath_null+0x15/0x17 + [] tty_open+0x2a2/0x49a + [] chrdev_open+0x11d/0x146 +... + +This means tty_reopen is called without TTY_LDISC set. For further +considerations, note tty_lock is held in tty_open. TTY_LDISC is cleared in: +1) __tty_hangup from tty_ldisc_hangup to tty_ldisc_enable. During this +section tty_lock is held. + +2) tty_release via tty_ldisc_release till the end of tty existence. If +tty->count <= 1, tty_lock is taken, TTY_CLOSING bit set and then +tty_ldisc_release called. tty_reopen checks TTY_CLOSING before checking +TTY_LDISC. + +3) tty_set_ldisc from tty_ldisc_halt to tty_ldisc_enable. We: + * take tty_lock, set TTY_LDISC_CHANGING, put tty_lock + * call tty_ldisc_halt (clear TTY_LDISC), tty_lock is _not_ held + * do some other work + * take tty_lock, call tty_ldisc_enable (set TTY_LDISC), put + tty_lock + +So the only option I see is 3). The solution is to check +TTY_LDISC_CHANGING along with TTY_CLOSING in tty_reopen. + +Nicely reproducible with two processes: +while (1) { + fd = open("/dev/ttyS1", O_RDWR); + if (fd < 0) { + warn("open"); + continue; + } + close(fd); +} +-------- +while (1) { + fd = open("/dev/ttyS1", O_RDWR); + ld1 = 0; ld2 = 2; + while (1) { + ioctl(fd, TIOCSETD, &ld1); + ioctl(fd, TIOCSETD, &ld2); + } + close(fd); +} + +Signed-off-by: Jiri Slaby +Reported-by: +Cc: Kyle McMartin +Cc: Alan Cox +--- + drivers/tty/tty_io.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c +index c05c5af..878f6d6 100644 +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -1310,7 +1310,8 @@ static int tty_reopen(struct tty_struct *tty) + { + struct tty_driver *driver = tty->driver; + +- if (test_bit(TTY_CLOSING, &tty->flags)) ++ if (test_bit(TTY_CLOSING, &tty->flags) || ++ test_bit(TTY_LDISC_CHANGING, &tty->flags)) + return -EIO; + + if (driver->type == TTY_DRIVER_TYPE_PTY && +-- +1.7.3.1 + + + From e31d248b5c211bc2e8138f04fcd47e1db35cdf1f Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 26 Nov 2010 17:05:38 -0500 Subject: [PATCH 32/47] copy tty debugging from rawhide --- debug-tty-print-dev-name.patch | 17 +++++++++++++++++ kernel.spec | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 debug-tty-print-dev-name.patch diff --git a/debug-tty-print-dev-name.patch b/debug-tty-print-dev-name.patch new file mode 100644 index 000000000..9010b64fa --- /dev/null +++ b/debug-tty-print-dev-name.patch @@ -0,0 +1,17 @@ +diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c +index 613c852..09c86d2 100644 +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -1322,7 +1322,11 @@ static int tty_reopen(struct tty_struct *tty) + tty->driver = driver; /* N.B. why do this every time?? */ + + mutex_lock(&tty->ldisc_mutex); +- WARN_ON(!test_bit(TTY_LDISC, &tty->flags)); ++ if (!test_bit(TTY_LDISC, &tty->flags)) { ++ printk("%s: !test_bit(TTY_LDISC, &tty->flags) dev=%s ldisc=%s\n", ++ __func__, tty->name, tty->ldisc ? tty->ldisc->ops ? tty->ldisc->ops->name : NULL : NULL); ++ WARN_ON(1); ++ } + mutex_unlock(&tty->ldisc_mutex); + + return 0; diff --git a/kernel.spec b/kernel.spec index 9df0131bc..752361548 100644 --- a/kernel.spec +++ b/kernel.spec @@ -700,6 +700,7 @@ Patch12205: runtime_pm_fixups.patch Patch12303: dmar-disable-when-ricoh-multifunction.patch Patch12400: tty-dont-allow-reopen-when-ldisc-is-changing.patch +Patch12401: debug-tty-print-dev-name.patch %endif @@ -1291,6 +1292,7 @@ ApplyPatch dmar-disable-when-ricoh-multifunction.patch # rhbz#630464 ApplyPatch tty-dont-allow-reopen-when-ldisc-is-changing.patch +ApplyPatch debug-tty-print-dev-name.patch # END OF PATCH APPLICATIONS @@ -1904,6 +1906,9 @@ fi # || || %changelog +* Fri Nov 26 2010 Kyle McMartin +- Copy tty_open WARN_ON debugging patch from rawhide. + * Fri Nov 26 2010 Kyle McMartin 2.6.37-0.rc3.git2.1 - Linux 2.6.37-rc3-git2 - CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set, so the cgroup memory From ea17f5cd11149cf323198d4b896819a925357bca Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 26 Nov 2010 22:58:39 -0500 Subject: [PATCH 33/47] Linux 2.6.37-rc3-git3 --- .gitignore | 2 +- debug-tty-print-dev-name.patch | 10 +++++----- kernel.spec | 6 +++++- sources | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 23dedec91..cd75a077e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc3.bz2 -/patch-2.6.37-rc3-git2.bz2 +/patch-2.6.37-rc3-git3.bz2 diff --git a/debug-tty-print-dev-name.patch b/debug-tty-print-dev-name.patch index 9010b64fa..5c06dd991 100644 --- a/debug-tty-print-dev-name.patch +++ b/debug-tty-print-dev-name.patch @@ -1,15 +1,15 @@ -diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c -index 613c852..09c86d2 100644 +diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c +index 878f6d6..8d6867d 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c -@@ -1322,7 +1322,11 @@ static int tty_reopen(struct tty_struct *tty) +@@ -1329,7 +1330,11 @@ static int tty_reopen(struct tty_struct *tty) tty->driver = driver; /* N.B. why do this every time?? */ mutex_lock(&tty->ldisc_mutex); - WARN_ON(!test_bit(TTY_LDISC, &tty->flags)); + if (!test_bit(TTY_LDISC, &tty->flags)) { -+ printk("%s: !test_bit(TTY_LDISC, &tty->flags) dev=%s ldisc=%s\n", -+ __func__, tty->name, tty->ldisc ? tty->ldisc->ops ? tty->ldisc->ops->name : NULL : NULL); ++ printk("%s: !test_bit(TTY_LDISC, &tty->flags) dev=%s ldisc=%s flags=%x\n", ++ __func__, tty->name, tty->ldisc ? tty->ldisc->ops ? tty->ldisc->ops->name : NULL : NULL, tty->flags); + WARN_ON(1); + } mutex_unlock(&tty->ldisc_mutex); diff --git a/kernel.spec b/kernel.spec index 752361548..40ca1897e 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 3 # The git snapshot level -%define gitrev 2 +%define gitrev 3 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1906,6 +1906,10 @@ fi # || || %changelog +* Fri Nov 26 2010 Kyle McMartin 2.6.37-0.rc3.git3.1 +- Linux 2.6.37-rc3-git3 +- Print tty->flags as well in debugging patch... + * Fri Nov 26 2010 Kyle McMartin - Copy tty_open WARN_ON debugging patch from rawhide. diff --git a/sources b/sources index 0826a118b..34f46cd88 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 9a487f01d20f9ee6917395a4c3de8ea7 patch-2.6.37-rc3.bz2 -29a4c06a0d766633f5be66cf98c6f378 patch-2.6.37-rc3-git2.bz2 +cff62cc3166b7ce55b272abc1f62deb9 patch-2.6.37-rc3-git3.bz2 From dadc63b85414eb711425e70b4140a640fa74ef09 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sat, 27 Nov 2010 10:30:59 -0500 Subject: [PATCH 34/47] more patches for this tty open race --- kernel.spec | 6 +- tty-ldisc-fix-open-flag-handling.patch | 54 ++++++++++++++++++ tty-open-hangup-race-fixup.patch | 76 ++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 tty-ldisc-fix-open-flag-handling.patch create mode 100644 tty-open-hangup-race-fixup.patch diff --git a/kernel.spec b/kernel.spec index 40ca1897e..aeefb1b6c 100644 --- a/kernel.spec +++ b/kernel.spec @@ -51,7 +51,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be prepended with "0.", so # for example a 3 here will become 0.3 # -%global baserelease 1 +%global baserelease 2 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -701,6 +701,8 @@ Patch12303: dmar-disable-when-ricoh-multifunction.patch Patch12400: tty-dont-allow-reopen-when-ldisc-is-changing.patch Patch12401: debug-tty-print-dev-name.patch +Patch12402: tty-ldisc-fix-open-flag-handling.patch +Patch12403: tty-open-hangup-race-fixup.patch %endif @@ -1293,6 +1295,8 @@ ApplyPatch dmar-disable-when-ricoh-multifunction.patch # rhbz#630464 ApplyPatch tty-dont-allow-reopen-when-ldisc-is-changing.patch ApplyPatch debug-tty-print-dev-name.patch +ApplyPatch tty-ldisc-fix-open-flag-handling.patch +ApplyPatch tty-open-hangup-race-fixup.patch # END OF PATCH APPLICATIONS diff --git a/tty-ldisc-fix-open-flag-handling.patch b/tty-ldisc-fix-open-flag-handling.patch new file mode 100644 index 000000000..4213aebb5 --- /dev/null +++ b/tty-ldisc-fix-open-flag-handling.patch @@ -0,0 +1,54 @@ +From linux-kernel-owner@vger.kernel.org Wed Nov 24 18:28:11 2010 +From: Jiri Slaby +Subject: [PATCH 1/2] TTY: ldisc, fix open flag handling +Date: Thu, 25 Nov 2010 00:27:54 +0100 + +When a concrete ldisc open fails in tty_ldisc_open, we forget to clear +TTY_LDISC_OPEN. This causes a false warning on the next ldisc open: +WARNING: at drivers/char/tty_ldisc.c:445 tty_ldisc_open+0x26/0x38() +Hardware name: System Product Name +Modules linked in: ... +Pid: 5251, comm: a.out Tainted: G W 2.6.32-5-686 #1 +Call Trace: + [] ? warn_slowpath_common+0x5e/0x8a + [] ? warn_slowpath_null+0xa/0xc + [] ? tty_ldisc_open+0x26/0x38 + [] ? tty_set_ldisc+0x218/0x304 +... + +So clear the bit when failing... + +Introduced in c65c9bc3efa (tty: rewrite the ldisc locking) back in +2.6.31-rc1. + +Signed-off-by: Jiri Slaby +Cc: Alan Cox +Reported-by: Sergey Lapin +Tested-by: Sergey Lapin +--- + drivers/tty/tty_ldisc.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c +index d8e96b0..4214d58 100644 +--- a/drivers/tty/tty_ldisc.c ++++ b/drivers/tty/tty_ldisc.c +@@ -454,6 +454,8 @@ static int tty_ldisc_open(struct tty_struct *tty, struct tty_ldisc *ld) + /* BTM here locks versus a hangup event */ + WARN_ON(!tty_locked()); + ret = ld->ops->open(tty); ++ if (ret) ++ clear_bit(TTY_LDISC_OPEN, &tty->flags); + return ret; + } + return 0; +-- +1.7.3.1 + + +-- +To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html +Please read the FAQ at http://www.tux.org/lkml/ + diff --git a/tty-open-hangup-race-fixup.patch b/tty-open-hangup-race-fixup.patch new file mode 100644 index 000000000..cda7f41b3 --- /dev/null +++ b/tty-open-hangup-race-fixup.patch @@ -0,0 +1,76 @@ +From 9e88e8b9915b5e067507a087437d80e6a133d612 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Sat, 27 Nov 2010 16:06:46 +0100 +Subject: [PATCH 1/1] TTY: open/hangup race fixup + + +Signed-off-by: Jiri Slaby +--- + drivers/tty/tty_io.c | 10 +++++++++- + include/linux/tty.h | 1 + + 2 files changed, 10 insertions(+), 1 deletions(-) + +diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c +index 878f6d6..35480dd 100644 +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -559,6 +559,9 @@ void __tty_hangup(struct tty_struct *tty) + + tty_lock(); + ++ /* some functions below drop BTM, so we need this bit */ ++ set_bit(TTY_HUPPING, &tty->flags); ++ + /* inuse_filps is protected by the single tty lock, + this really needs to change if we want to flush the + workqueue with the lock held */ +@@ -578,6 +581,10 @@ void __tty_hangup(struct tty_struct *tty) + } + spin_unlock(&tty_files_lock); + ++ /* ++ * it drops BTM and thus races with reopen ++ * we protect the race by TTY_HUPPING ++ */ + tty_ldisc_hangup(tty); + + read_lock(&tasklist_lock); +@@ -615,7 +622,6 @@ void __tty_hangup(struct tty_struct *tty) + tty->session = NULL; + tty->pgrp = NULL; + tty->ctrl_status = 0; +- set_bit(TTY_HUPPED, &tty->flags); + spin_unlock_irqrestore(&tty->ctrl_lock, flags); + + /* Account for the p->signal references we killed */ +@@ -641,6 +647,7 @@ void __tty_hangup(struct tty_struct *tty) + * can't yet guarantee all that. + */ + set_bit(TTY_HUPPED, &tty->flags); ++ clear_bit(TTY_HUPPING, &tty->flags); + tty_ldisc_enable(tty); + + tty_unlock(); +@@ -1311,6 +1318,7 @@ static int tty_reopen(struct tty_struct *tty) + struct tty_driver *driver = tty->driver; + + if (test_bit(TTY_CLOSING, &tty->flags) || ++ test_bit(TTY_HUPPING, &tty->flags) || + test_bit(TTY_LDISC_CHANGING, &tty->flags)) + return -EIO; + +diff --git a/include/linux/tty.h b/include/linux/tty.h +index 032d79f..54e4eaa 100644 +--- a/include/linux/tty.h ++++ b/include/linux/tty.h +@@ -366,6 +366,7 @@ struct tty_file_private { + #define TTY_HUPPED 18 /* Post driver->hangup() */ + #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ + #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ ++#define TTY_HUPPING 21 /* ->hangup() in progress */ + + #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) + +-- +1.7.3.1 + From 67f5884c551c70cd29c2b0668b39c5bc8ca14c0a Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 29 Nov 2010 08:32:10 -0500 Subject: [PATCH 35/47] Linux 2.6.37-rc3-git6 --- .gitignore | 2 +- kernel.spec | 6 +++++- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index cd75a077e..02ba0f654 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc3.bz2 -/patch-2.6.37-rc3-git3.bz2 +/patch-2.6.37-rc3-git6.bz2 diff --git a/kernel.spec b/kernel.spec index aeefb1b6c..0b4f1f609 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 3 # The git snapshot level -%define gitrev 3 +%define gitrev 6 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1910,6 +1910,10 @@ fi # || || %changelog +* Mon Nov 29 2010 Kyle McMartin 2.6.37-0.rc3.git6.1 +- Linux 2.6.37-rc3-git6 +- TTY: open/hangup race fixup (rhbz#630464) + * Fri Nov 26 2010 Kyle McMartin 2.6.37-0.rc3.git3.1 - Linux 2.6.37-rc3-git3 - Print tty->flags as well in debugging patch... diff --git a/sources b/sources index 34f46cd88..1eda90cee 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 9a487f01d20f9ee6917395a4c3de8ea7 patch-2.6.37-rc3.bz2 -cff62cc3166b7ce55b272abc1f62deb9 patch-2.6.37-rc3-git3.bz2 +bef0a45c237283fec2f85295f38bed09 patch-2.6.37-rc3-git6.bz2 From 4d70d8dc24db4f98f63c600db89e6e5e750667c4 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 29 Nov 2010 21:10:59 -0500 Subject: [PATCH 36/47] update debug-vm-would-have-oomkilled --- kernel.spec | 5 +- linux-2.6-debug-vm-would-have-oomkilled.patch | 69 ++++++++++--------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/kernel.spec b/kernel.spec index 0b4f1f609..c353b65c0 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1176,7 +1176,7 @@ ApplyPatch acpi-update-battery-information-on-notification-0x81.patch ApplyPatch linux-2.6-debug-sizeof-structs.patch ApplyPatch linux-2.6-debug-nmi-timeout.patch ApplyPatch linux-2.6-debug-taint-vm.patch -###FIX###ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch +ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch ApplyPatch linux-2.6-debug-always-inline-kzalloc.patch # @@ -1910,6 +1910,9 @@ fi # || || %changelog +* Mon Nov 29 2010 Kyle McMartin +- Update debug-vm-would_have_oomkilled patch. + * Mon Nov 29 2010 Kyle McMartin 2.6.37-0.rc3.git6.1 - Linux 2.6.37-rc3-git6 - TTY: open/hangup race fixup (rhbz#630464) diff --git a/linux-2.6-debug-vm-would-have-oomkilled.patch b/linux-2.6-debug-vm-would-have-oomkilled.patch index dd8ba3f0a..8bd05ab06 100644 --- a/linux-2.6-debug-vm-would-have-oomkilled.patch +++ b/linux-2.6-debug-vm-would-have-oomkilled.patch @@ -1,26 +1,30 @@ -From 03657519851cd180983db4bd0c38eaeed4aa2962 Mon Sep 17 00:00:00 2001 -From: Kyle McMartin -Date: Mon, 11 Jan 2010 08:25:12 -0500 -Subject: linux-2.6-debug-vm-would-have-oomkilled.patch +From beb764ac03e52eba1a654afb4273fab1f9de3cff Mon Sep 17 00:00:00 2001 +From: Kyle McMartin +Date: Mon, 29 Nov 2010 20:59:14 -0500 +Subject: [PATCH] linux-2.6-debug-vm-would_have_oomkilled --- - kernel/sysctl.c | 8 ++++++++ - mm/oom_kill.c | 7 +++++++ - 2 files changed, 15 insertions(+), 0 deletions(-) + include/linux/oom.h | 1 + + kernel/sysctl.c | 7 +++++++ + mm/oom_kill.c | 8 ++++++++ + 3 files changed, 16 insertions(+), 0 deletions(-) +diff --git a/include/linux/oom.h b/include/linux/oom.h +index 5e3aa83..79a27b4 100644 +--- a/include/linux/oom.h ++++ b/include/linux/oom.h +@@ -72,5 +72,6 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p); + extern int sysctl_oom_dump_tasks; + extern int sysctl_oom_kill_allocating_task; + extern int sysctl_panic_on_oom; ++extern int sysctl_would_have_oomkilled; + #endif /* __KERNEL__*/ + #endif /* _INCLUDE_LINUX_OOM_H */ diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index 8a68b24..72a4ff1 100644 +index 5abfa15..a0fed6d 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -71,6 +71,7 @@ extern int sysctl_overcommit_ratio; - extern int sysctl_panic_on_oom; - extern int sysctl_oom_kill_allocating_task; - extern int sysctl_oom_dump_tasks; -+extern int sysctl_would_have_oomkilled; - extern int max_threads; - extern int core_uses_pid; - extern int suid_dumpable; -@@ -973,6 +974,13 @@ static struct ctl_table vm_table[] = { +@@ -1000,6 +1000,13 @@ static struct ctl_table vm_table[] = { .proc_handler = proc_dointvec, }, { @@ -28,37 +32,38 @@ index 8a68b24..72a4ff1 100644 + .data = &sysctl_would_have_oomkilled, + .maxlen = sizeof(sysctl_would_have_oomkilled), + .mode = 0644, -+ .proc_handler = &proc_dointvec, ++ .proc_handler = proc_dointvec, + }, + { .procname = "overcommit_ratio", .data = &sysctl_overcommit_ratio, .maxlen = sizeof(sysctl_overcommit_ratio), diff --git a/mm/oom_kill.c b/mm/oom_kill.c -index f52481b..a892f07 100644 +index 7dcca55..281ac39 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c -@@ -31,6 +31,7 @@ +@@ -35,6 +35,7 @@ int sysctl_panic_on_oom; int sysctl_oom_kill_allocating_task; - int sysctl_oom_dump_tasks; + int sysctl_oom_dump_tasks = 1; +int sysctl_would_have_oomkilled; static DEFINE_SPINLOCK(zone_scan_lock); - /* #define DEBUG */ -@@ -396,6 +397,12 @@ static void __oom_kill_task(struct task_struct *p, int verbose) - return; + #ifdef CONFIG_NUMA +@@ -477,6 +478,13 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, } -+ if (sysctl_would_have_oomkilled == 1) { -+ printk(KERN_ERR "Would have killed process %d (%s). But continuing instead.\n", -+ task_pid_nr(p), p->comm); -+ return; + task_lock(p); ++ if (sysctl_would_have_oomkilled) { ++ printk(KERN_ERR "%s: would have killed process %d (%s), but continuing instead...\n", ++ __func__, task_pid_nr(p), p->comm); ++ task_unlock(p); ++ return 0; + } + - if (verbose) - printk(KERN_ERR "Killed process %d (%s) " - "vsz:%lukB, anon-rss:%lukB, file-rss:%lukB\n", + pr_err("%s: Kill process %d (%s) score %d or sacrifice child\n", + message, task_pid_nr(p), p->comm, points); + task_unlock(p); -- -1.6.5.2 +1.7.3.2 From 1a48cbfeed2817323979b251c04f938ee77894b6 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 30 Nov 2010 11:30:30 -0500 Subject: [PATCH 37/47] Linux 2.6.37-rc4 --- .gitignore | 3 +-- kernel.spec | 9 ++++++--- sources | 3 +-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 02ba0f654..2c27f4c08 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ patch-*.bz2 clog *.rpm kernel-2.6.*/ -/patch-2.6.37-rc3.bz2 -/patch-2.6.37-rc3-git6.bz2 +/patch-2.6.37-rc4.bz2 diff --git a/kernel.spec b/kernel.spec index c353b65c0..e9ceaaa2a 100644 --- a/kernel.spec +++ b/kernel.spec @@ -51,7 +51,7 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be prepended with "0.", so # for example a 3 here will become 0.3 # -%global baserelease 2 +%global baserelease 1 %global fedora_build %{baserelease} # base_sublevel is the kernel version we're starting with and patching @@ -82,9 +82,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 3 +%define rcrev 4 # The git snapshot level -%define gitrev 6 +%define gitrev 0 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1910,6 +1910,9 @@ fi # || || %changelog +* Tue Nov 30 2010 Kyle McMartin 2.6.37-0.rc4.git0.1 +- Linux 2.6.37-rc4 + * Mon Nov 29 2010 Kyle McMartin - Update debug-vm-would_have_oomkilled patch. diff --git a/sources b/sources index 1eda90cee..b4276c7a7 100644 --- a/sources +++ b/sources @@ -1,3 +1,2 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 -9a487f01d20f9ee6917395a4c3de8ea7 patch-2.6.37-rc3.bz2 -bef0a45c237283fec2f85295f38bed09 patch-2.6.37-rc3-git6.bz2 +854ca0c7eca8930a71a6382a7dabbf65 patch-2.6.37-rc4.bz2 From 5256969a144384bbc86281c7e50fde4130345b43 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 1 Dec 2010 10:12:17 -0500 Subject: [PATCH 38/47] Linux 2.6.37-rc4-git1 --- .gitignore | 1 + kernel.spec | 5 ++++- sources | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2c27f4c08..28c0a5fd1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc4.bz2 +/patch-2.6.37-rc4-git1.bz2 diff --git a/kernel.spec b/kernel.spec index e9ceaaa2a..170313ff5 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 4 # The git snapshot level -%define gitrev 0 +%define gitrev 1 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1910,6 +1910,9 @@ fi # || || %changelog +* Wed Dec 01 2010 Kyle McMartin 2.6.37-0.rc4.git1.1 +- Linux 2.6.37-rc4-git1 + * Tue Nov 30 2010 Kyle McMartin 2.6.37-0.rc4.git0.1 - Linux 2.6.37-rc4 diff --git a/sources b/sources index b4276c7a7..ceacae587 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 854ca0c7eca8930a71a6382a7dabbf65 patch-2.6.37-rc4.bz2 +c3146fe28bb10e77d8388bc26e16483c patch-2.6.37-rc4-git1.bz2 From f1aeb30fcc5c14d35073a5135c5e02a6405f626d Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 1 Dec 2010 10:27:16 -0500 Subject: [PATCH 39/47] add on drm-fixes until they're queued --- drm-fixes.patch | 1572 +++++++++++++++++++++++++++++++++++++++++++++++ kernel.spec | 3 + 2 files changed, 1575 insertions(+) create mode 100644 drm-fixes.patch diff --git a/drm-fixes.patch b/drm-fixes.patch new file mode 100644 index 000000000..700f43c4d --- /dev/null +++ b/drm-fixes.patch @@ -0,0 +1,1572 @@ +diff --git a/MAINTAINERS b/MAINTAINERS +index b3be8b3..3eafe9e 100644 +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -2080,7 +2080,7 @@ F: include/drm/ + + INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets) + M: Chris Wilson +-L: intel-gfx@lists.freedesktop.org ++L: intel-gfx@lists.freedesktop.org (subscribers-only) + L: dri-devel@lists.freedesktop.org + T: git git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel.git + S: Supported +diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c +index f7af91c..7ca5935 100644 +--- a/drivers/gpu/drm/drm_crtc_helper.c ++++ b/drivers/gpu/drm/drm_crtc_helper.c +@@ -471,6 +471,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) + int count = 0, ro, fail = 0; + struct drm_crtc_helper_funcs *crtc_funcs; + int ret = 0; ++ int i; + + DRM_DEBUG_KMS("\n"); + +@@ -666,6 +667,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) + if (ret != 0) + goto fail; + } ++ DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); ++ for (i = 0; i < set->num_connectors; i++) { ++ DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, ++ drm_get_connector_name(set->connectors[i])); ++ set->connectors[i]->dpms = DRM_MODE_DPMS_ON; ++ } + + kfree(save_connectors); + kfree(save_encoders); +@@ -841,7 +848,7 @@ static void output_poll_execute(struct work_struct *work) + struct delayed_work *delayed_work = to_delayed_work(work); + struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work); + struct drm_connector *connector; +- enum drm_connector_status old_status, status; ++ enum drm_connector_status old_status; + bool repoll = false, changed = false; + + if (!drm_kms_helper_poll) +@@ -866,8 +873,9 @@ static void output_poll_execute(struct work_struct *work) + !(connector->polled & DRM_CONNECTOR_POLL_HPD)) + continue; + +- status = connector->funcs->detect(connector, false); +- if (old_status != status) ++ connector->status = connector->funcs->detect(connector, false); ++ DRM_DEBUG_KMS("connector status updated to %d\n", connector->status); ++ if (old_status != connector->status) + changed = true; + } + +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c +index 17b1cba..5e54821 100644 +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -38,8 +38,7 @@ + + static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); + +-static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, +- bool pipelined); ++static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); + static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); + static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); + static int i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, +@@ -2594,7 +2593,7 @@ i915_gem_object_put_fence_reg(struct drm_gem_object *obj, + if (reg->gpu) { + int ret; + +- ret = i915_gem_object_flush_gpu_write_domain(obj, true); ++ ret = i915_gem_object_flush_gpu_write_domain(obj); + if (ret) + return ret; + +@@ -2742,8 +2741,7 @@ i915_gem_clflush_object(struct drm_gem_object *obj) + + /** Flushes any GPU write domain for the object if it's dirty. */ + static int +-i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, +- bool pipelined) ++i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj) + { + struct drm_device *dev = obj->dev; + uint32_t old_write_domain; +@@ -2762,10 +2760,7 @@ i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, + obj->read_domains, + old_write_domain); + +- if (pipelined) +- return 0; +- +- return i915_gem_object_wait_rendering(obj, true); ++ return 0; + } + + /** Flushes the GTT write domain for the object if it's dirty. */ +@@ -2826,18 +2821,15 @@ i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write) + if (obj_priv->gtt_space == NULL) + return -EINVAL; + +- ret = i915_gem_object_flush_gpu_write_domain(obj, false); ++ ret = i915_gem_object_flush_gpu_write_domain(obj); + if (ret != 0) + return ret; ++ ret = i915_gem_object_wait_rendering(obj, true); ++ if (ret) ++ return ret; + + i915_gem_object_flush_cpu_write_domain(obj); + +- if (write) { +- ret = i915_gem_object_wait_rendering(obj, true); +- if (ret) +- return ret; +- } +- + old_write_domain = obj->write_domain; + old_read_domains = obj->read_domains; + +@@ -2875,7 +2867,7 @@ i915_gem_object_set_to_display_plane(struct drm_gem_object *obj, + if (obj_priv->gtt_space == NULL) + return -EINVAL; + +- ret = i915_gem_object_flush_gpu_write_domain(obj, true); ++ ret = i915_gem_object_flush_gpu_write_domain(obj); + if (ret) + return ret; + +@@ -2924,9 +2916,12 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) + uint32_t old_write_domain, old_read_domains; + int ret; + +- ret = i915_gem_object_flush_gpu_write_domain(obj, false); ++ ret = i915_gem_object_flush_gpu_write_domain(obj); + if (ret != 0) + return ret; ++ ret = i915_gem_object_wait_rendering(obj, true); ++ if (ret) ++ return ret; + + i915_gem_object_flush_gtt_write_domain(obj); + +@@ -2935,12 +2930,6 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) + */ + i915_gem_object_set_to_full_cpu_read_domain(obj); + +- if (write) { +- ret = i915_gem_object_wait_rendering(obj, true); +- if (ret) +- return ret; +- } +- + old_write_domain = obj->write_domain; + old_read_domains = obj->read_domains; + +@@ -3205,9 +3194,13 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, + if (offset == 0 && size == obj->size) + return i915_gem_object_set_to_cpu_domain(obj, 0); + +- ret = i915_gem_object_flush_gpu_write_domain(obj, false); ++ ret = i915_gem_object_flush_gpu_write_domain(obj); + if (ret != 0) + return ret; ++ ret = i915_gem_object_wait_rendering(obj, true); ++ if (ret) ++ return ret; ++ + i915_gem_object_flush_gtt_write_domain(obj); + + /* If we're already fully in the CPU read domain, we're done. */ +@@ -3254,192 +3247,230 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, + return 0; + } + +-/** +- * Pin an object to the GTT and evaluate the relocations landing in it. +- */ + static int +-i915_gem_execbuffer_relocate(struct drm_i915_gem_object *obj, +- struct drm_file *file_priv, +- struct drm_i915_gem_exec_object2 *entry) ++i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, ++ struct drm_file *file_priv, ++ struct drm_i915_gem_exec_object2 *entry, ++ struct drm_i915_gem_relocation_entry *reloc) + { + struct drm_device *dev = obj->base.dev; +- drm_i915_private_t *dev_priv = dev->dev_private; +- struct drm_i915_gem_relocation_entry __user *user_relocs; +- struct drm_gem_object *target_obj = NULL; +- uint32_t target_handle = 0; +- int i, ret = 0; ++ struct drm_gem_object *target_obj; ++ uint32_t target_offset; ++ int ret = -EINVAL; + +- user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr; +- for (i = 0; i < entry->relocation_count; i++) { +- struct drm_i915_gem_relocation_entry reloc; +- uint32_t target_offset; ++ target_obj = drm_gem_object_lookup(dev, file_priv, ++ reloc->target_handle); ++ if (target_obj == NULL) ++ return -ENOENT; + +- if (__copy_from_user_inatomic(&reloc, +- user_relocs+i, +- sizeof(reloc))) { +- ret = -EFAULT; +- break; +- } ++ target_offset = to_intel_bo(target_obj)->gtt_offset; + +- if (reloc.target_handle != target_handle) { +- drm_gem_object_unreference(target_obj); ++#if WATCH_RELOC ++ DRM_INFO("%s: obj %p offset %08x target %d " ++ "read %08x write %08x gtt %08x " ++ "presumed %08x delta %08x\n", ++ __func__, ++ obj, ++ (int) reloc->offset, ++ (int) reloc->target_handle, ++ (int) reloc->read_domains, ++ (int) reloc->write_domain, ++ (int) target_offset, ++ (int) reloc->presumed_offset, ++ reloc->delta); ++#endif + +- target_obj = drm_gem_object_lookup(dev, file_priv, +- reloc.target_handle); +- if (target_obj == NULL) { +- ret = -ENOENT; +- break; +- } ++ /* The target buffer should have appeared before us in the ++ * exec_object list, so it should have a GTT space bound by now. ++ */ ++ if (target_offset == 0) { ++ DRM_ERROR("No GTT space found for object %d\n", ++ reloc->target_handle); ++ goto err; ++ } + +- target_handle = reloc.target_handle; +- } +- target_offset = to_intel_bo(target_obj)->gtt_offset; ++ /* Validate that the target is in a valid r/w GPU domain */ ++ if (reloc->write_domain & (reloc->write_domain - 1)) { ++ DRM_ERROR("reloc with multiple write domains: " ++ "obj %p target %d offset %d " ++ "read %08x write %08x", ++ obj, reloc->target_handle, ++ (int) reloc->offset, ++ reloc->read_domains, ++ reloc->write_domain); ++ goto err; ++ } ++ if (reloc->write_domain & I915_GEM_DOMAIN_CPU || ++ reloc->read_domains & I915_GEM_DOMAIN_CPU) { ++ DRM_ERROR("reloc with read/write CPU domains: " ++ "obj %p target %d offset %d " ++ "read %08x write %08x", ++ obj, reloc->target_handle, ++ (int) reloc->offset, ++ reloc->read_domains, ++ reloc->write_domain); ++ goto err; ++ } ++ if (reloc->write_domain && target_obj->pending_write_domain && ++ reloc->write_domain != target_obj->pending_write_domain) { ++ DRM_ERROR("Write domain conflict: " ++ "obj %p target %d offset %d " ++ "new %08x old %08x\n", ++ obj, reloc->target_handle, ++ (int) reloc->offset, ++ reloc->write_domain, ++ target_obj->pending_write_domain); ++ goto err; ++ } + +-#if WATCH_RELOC +- DRM_INFO("%s: obj %p offset %08x target %d " +- "read %08x write %08x gtt %08x " +- "presumed %08x delta %08x\n", +- __func__, +- obj, +- (int) reloc.offset, +- (int) reloc.target_handle, +- (int) reloc.read_domains, +- (int) reloc.write_domain, +- (int) target_offset, +- (int) reloc.presumed_offset, +- reloc.delta); +-#endif ++ target_obj->pending_read_domains |= reloc->read_domains; ++ target_obj->pending_write_domain |= reloc->write_domain; + +- /* The target buffer should have appeared before us in the +- * exec_object list, so it should have a GTT space bound by now. +- */ +- if (target_offset == 0) { +- DRM_ERROR("No GTT space found for object %d\n", +- reloc.target_handle); +- ret = -EINVAL; +- break; +- } ++ /* If the relocation already has the right value in it, no ++ * more work needs to be done. ++ */ ++ if (target_offset == reloc->presumed_offset) ++ goto out; + +- /* Validate that the target is in a valid r/w GPU domain */ +- if (reloc.write_domain & (reloc.write_domain - 1)) { +- DRM_ERROR("reloc with multiple write domains: " +- "obj %p target %d offset %d " +- "read %08x write %08x", +- obj, reloc.target_handle, +- (int) reloc.offset, +- reloc.read_domains, +- reloc.write_domain); +- ret = -EINVAL; +- break; +- } +- if (reloc.write_domain & I915_GEM_DOMAIN_CPU || +- reloc.read_domains & I915_GEM_DOMAIN_CPU) { +- DRM_ERROR("reloc with read/write CPU domains: " +- "obj %p target %d offset %d " +- "read %08x write %08x", +- obj, reloc.target_handle, +- (int) reloc.offset, +- reloc.read_domains, +- reloc.write_domain); +- ret = -EINVAL; +- break; +- } +- if (reloc.write_domain && target_obj->pending_write_domain && +- reloc.write_domain != target_obj->pending_write_domain) { +- DRM_ERROR("Write domain conflict: " +- "obj %p target %d offset %d " +- "new %08x old %08x\n", +- obj, reloc.target_handle, +- (int) reloc.offset, +- reloc.write_domain, +- target_obj->pending_write_domain); +- ret = -EINVAL; +- break; +- } ++ /* Check that the relocation address is valid... */ ++ if (reloc->offset > obj->base.size - 4) { ++ DRM_ERROR("Relocation beyond object bounds: " ++ "obj %p target %d offset %d size %d.\n", ++ obj, reloc->target_handle, ++ (int) reloc->offset, ++ (int) obj->base.size); ++ goto err; ++ } ++ if (reloc->offset & 3) { ++ DRM_ERROR("Relocation not 4-byte aligned: " ++ "obj %p target %d offset %d.\n", ++ obj, reloc->target_handle, ++ (int) reloc->offset); ++ goto err; ++ } + +- target_obj->pending_read_domains |= reloc.read_domains; +- target_obj->pending_write_domain |= reloc.write_domain; ++ /* and points to somewhere within the target object. */ ++ if (reloc->delta >= target_obj->size) { ++ DRM_ERROR("Relocation beyond target object bounds: " ++ "obj %p target %d delta %d size %d.\n", ++ obj, reloc->target_handle, ++ (int) reloc->delta, ++ (int) target_obj->size); ++ goto err; ++ } + +- /* If the relocation already has the right value in it, no +- * more work needs to be done. +- */ +- if (target_offset == reloc.presumed_offset) +- continue; ++ reloc->delta += target_offset; ++ if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { ++ uint32_t page_offset = reloc->offset & ~PAGE_MASK; ++ char *vaddr; + +- /* Check that the relocation address is valid... */ +- if (reloc.offset > obj->base.size - 4) { +- DRM_ERROR("Relocation beyond object bounds: " +- "obj %p target %d offset %d size %d.\n", +- obj, reloc.target_handle, +- (int) reloc.offset, (int) obj->base.size); +- ret = -EINVAL; +- break; +- } +- if (reloc.offset & 3) { +- DRM_ERROR("Relocation not 4-byte aligned: " +- "obj %p target %d offset %d.\n", +- obj, reloc.target_handle, +- (int) reloc.offset); +- ret = -EINVAL; +- break; +- } ++ vaddr = kmap_atomic(obj->pages[reloc->offset >> PAGE_SHIFT]); ++ *(uint32_t *)(vaddr + page_offset) = reloc->delta; ++ kunmap_atomic(vaddr); ++ } else { ++ struct drm_i915_private *dev_priv = dev->dev_private; ++ uint32_t __iomem *reloc_entry; ++ void __iomem *reloc_page; + +- /* and points to somewhere within the target object. */ +- if (reloc.delta >= target_obj->size) { +- DRM_ERROR("Relocation beyond target object bounds: " +- "obj %p target %d delta %d size %d.\n", +- obj, reloc.target_handle, +- (int) reloc.delta, (int) target_obj->size); +- ret = -EINVAL; +- break; +- } ++ ret = i915_gem_object_set_to_gtt_domain(&obj->base, 1); ++ if (ret) ++ goto err; + +- reloc.delta += target_offset; +- if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { +- uint32_t page_offset = reloc.offset & ~PAGE_MASK; +- char *vaddr; ++ /* Map the page containing the relocation we're going to perform. */ ++ reloc->offset += obj->gtt_offset; ++ reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, ++ reloc->offset & PAGE_MASK); ++ reloc_entry = (uint32_t __iomem *) ++ (reloc_page + (reloc->offset & ~PAGE_MASK)); ++ iowrite32(reloc->delta, reloc_entry); ++ io_mapping_unmap_atomic(reloc_page); ++ } + +- vaddr = kmap_atomic(obj->pages[reloc.offset >> PAGE_SHIFT]); +- *(uint32_t *)(vaddr + page_offset) = reloc.delta; +- kunmap_atomic(vaddr); +- } else { +- uint32_t __iomem *reloc_entry; +- void __iomem *reloc_page; ++ /* and update the user's relocation entry */ ++ reloc->presumed_offset = target_offset; + +- ret = i915_gem_object_set_to_gtt_domain(&obj->base, 1); +- if (ret) +- break; ++out: ++ ret = 0; ++err: ++ drm_gem_object_unreference(target_obj); ++ return ret; ++} + +- /* Map the page containing the relocation we're going to perform. */ +- reloc.offset += obj->gtt_offset; +- reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, +- reloc.offset & PAGE_MASK); +- reloc_entry = (uint32_t __iomem *) +- (reloc_page + (reloc.offset & ~PAGE_MASK)); +- iowrite32(reloc.delta, reloc_entry); +- io_mapping_unmap_atomic(reloc_page); +- } ++static int ++i915_gem_execbuffer_relocate_object(struct drm_i915_gem_object *obj, ++ struct drm_file *file_priv, ++ struct drm_i915_gem_exec_object2 *entry) ++{ ++ struct drm_i915_gem_relocation_entry __user *user_relocs; ++ int i, ret; ++ ++ user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr; ++ for (i = 0; i < entry->relocation_count; i++) { ++ struct drm_i915_gem_relocation_entry reloc; ++ ++ if (__copy_from_user_inatomic(&reloc, ++ user_relocs+i, ++ sizeof(reloc))) ++ return -EFAULT; ++ ++ ret = i915_gem_execbuffer_relocate_entry(obj, file_priv, entry, &reloc); ++ if (ret) ++ return ret; + +- /* and update the user's relocation entry */ +- reloc.presumed_offset = target_offset; + if (__copy_to_user_inatomic(&user_relocs[i].presumed_offset, +- &reloc.presumed_offset, +- sizeof(reloc.presumed_offset))) { +- ret = -EFAULT; +- break; +- } ++ &reloc.presumed_offset, ++ sizeof(reloc.presumed_offset))) ++ return -EFAULT; + } + +- drm_gem_object_unreference(target_obj); +- return ret; ++ return 0; ++} ++ ++static int ++i915_gem_execbuffer_relocate_object_slow(struct drm_i915_gem_object *obj, ++ struct drm_file *file_priv, ++ struct drm_i915_gem_exec_object2 *entry, ++ struct drm_i915_gem_relocation_entry *relocs) ++{ ++ int i, ret; ++ ++ for (i = 0; i < entry->relocation_count; i++) { ++ ret = i915_gem_execbuffer_relocate_entry(obj, file_priv, entry, &relocs[i]); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; + } + + static int +-i915_gem_execbuffer_pin(struct drm_device *dev, +- struct drm_file *file, +- struct drm_gem_object **object_list, +- struct drm_i915_gem_exec_object2 *exec_list, +- int count) ++i915_gem_execbuffer_relocate(struct drm_device *dev, ++ struct drm_file *file, ++ struct drm_gem_object **object_list, ++ struct drm_i915_gem_exec_object2 *exec_list, ++ int count) ++{ ++ int i, ret; ++ ++ for (i = 0; i < count; i++) { ++ struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); ++ obj->base.pending_read_domains = 0; ++ obj->base.pending_write_domain = 0; ++ ret = i915_gem_execbuffer_relocate_object(obj, file, ++ &exec_list[i]); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int ++i915_gem_execbuffer_reserve(struct drm_device *dev, ++ struct drm_file *file, ++ struct drm_gem_object **object_list, ++ struct drm_i915_gem_exec_object2 *exec_list, ++ int count) + { + struct drm_i915_private *dev_priv = dev->dev_private; + int ret, i, retry; +@@ -3502,6 +3533,87 @@ i915_gem_execbuffer_pin(struct drm_device *dev, + } + + static int ++i915_gem_execbuffer_relocate_slow(struct drm_device *dev, ++ struct drm_file *file, ++ struct drm_gem_object **object_list, ++ struct drm_i915_gem_exec_object2 *exec_list, ++ int count) ++{ ++ struct drm_i915_gem_relocation_entry *reloc; ++ int i, total, ret; ++ ++ for (i = 0; i < count; i++) { ++ struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); ++ obj->in_execbuffer = false; ++ } ++ ++ mutex_unlock(&dev->struct_mutex); ++ ++ total = 0; ++ for (i = 0; i < count; i++) ++ total += exec_list[i].relocation_count; ++ ++ reloc = drm_malloc_ab(total, sizeof(*reloc)); ++ if (reloc == NULL) { ++ mutex_lock(&dev->struct_mutex); ++ return -ENOMEM; ++ } ++ ++ total = 0; ++ for (i = 0; i < count; i++) { ++ struct drm_i915_gem_relocation_entry __user *user_relocs; ++ ++ user_relocs = (void __user *)(uintptr_t)exec_list[i].relocs_ptr; ++ ++ if (copy_from_user(reloc+total, user_relocs, ++ exec_list[i].relocation_count * ++ sizeof(*reloc))) { ++ ret = -EFAULT; ++ mutex_lock(&dev->struct_mutex); ++ goto err; ++ } ++ ++ total += exec_list[i].relocation_count; ++ } ++ ++ ret = i915_mutex_lock_interruptible(dev); ++ if (ret) { ++ mutex_lock(&dev->struct_mutex); ++ goto err; ++ } ++ ++ ret = i915_gem_execbuffer_reserve(dev, file, ++ object_list, exec_list, ++ count); ++ if (ret) ++ goto err; ++ ++ total = 0; ++ for (i = 0; i < count; i++) { ++ struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); ++ obj->base.pending_read_domains = 0; ++ obj->base.pending_write_domain = 0; ++ ret = i915_gem_execbuffer_relocate_object_slow(obj, file, ++ &exec_list[i], ++ reloc + total); ++ if (ret) ++ goto err; ++ ++ total += exec_list[i].relocation_count; ++ } ++ ++ /* Leave the user relocations as are, this is the painfully slow path, ++ * and we want to avoid the complication of dropping the lock whilst ++ * having buffers reserved in the aperture and so causing spurious ++ * ENOSPC for random operations. ++ */ ++ ++err: ++ drm_free_large(reloc); ++ return ret; ++} ++ ++static int + i915_gem_execbuffer_move_to_gpu(struct drm_device *dev, + struct drm_file *file, + struct intel_ring_buffer *ring, +@@ -3630,8 +3742,15 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec, + + for (i = 0; i < count; i++) { + char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr; +- size_t length = exec[i].relocation_count * sizeof(struct drm_i915_gem_relocation_entry); ++ int length; /* limited by fault_in_pages_readable() */ ++ ++ /* First check for malicious input causing overflow */ ++ if (exec[i].relocation_count > ++ INT_MAX / sizeof(struct drm_i915_gem_relocation_entry)) ++ return -EINVAL; + ++ length = exec[i].relocation_count * ++ sizeof(struct drm_i915_gem_relocation_entry); + if (!access_ok(VERIFY_READ, ptr, length)) + return -EFAULT; + +@@ -3774,18 +3893,24 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, + } + + /* Move the objects en-masse into the GTT, evicting if necessary. */ +- ret = i915_gem_execbuffer_pin(dev, file, +- object_list, exec_list, +- args->buffer_count); ++ ret = i915_gem_execbuffer_reserve(dev, file, ++ object_list, exec_list, ++ args->buffer_count); + if (ret) + goto err; + + /* The objects are in their final locations, apply the relocations. */ +- for (i = 0; i < args->buffer_count; i++) { +- struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); +- obj->base.pending_read_domains = 0; +- obj->base.pending_write_domain = 0; +- ret = i915_gem_execbuffer_relocate(obj, file, &exec_list[i]); ++ ret = i915_gem_execbuffer_relocate(dev, file, ++ object_list, exec_list, ++ args->buffer_count); ++ if (ret) { ++ if (ret == -EFAULT) { ++ ret = i915_gem_execbuffer_relocate_slow(dev, file, ++ object_list, ++ exec_list, ++ args->buffer_count); ++ BUG_ON(!mutex_is_locked(&dev->struct_mutex)); ++ } + if (ret) + goto err; + } +diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c +index 454c064..42729d2 100644 +--- a/drivers/gpu/drm/i915/i915_suspend.c ++++ b/drivers/gpu/drm/i915/i915_suspend.c +@@ -239,6 +239,16 @@ static void i915_save_modeset_reg(struct drm_device *dev) + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return; + ++ /* Cursor state */ ++ dev_priv->saveCURACNTR = I915_READ(CURACNTR); ++ dev_priv->saveCURAPOS = I915_READ(CURAPOS); ++ dev_priv->saveCURABASE = I915_READ(CURABASE); ++ dev_priv->saveCURBCNTR = I915_READ(CURBCNTR); ++ dev_priv->saveCURBPOS = I915_READ(CURBPOS); ++ dev_priv->saveCURBBASE = I915_READ(CURBBASE); ++ if (IS_GEN2(dev)) ++ dev_priv->saveCURSIZE = I915_READ(CURSIZE); ++ + if (HAS_PCH_SPLIT(dev)) { + dev_priv->savePCH_DREF_CONTROL = I915_READ(PCH_DREF_CONTROL); + dev_priv->saveDISP_ARB_CTL = I915_READ(DISP_ARB_CTL); +@@ -529,6 +539,16 @@ static void i915_restore_modeset_reg(struct drm_device *dev) + I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); + I915_WRITE(DSPBADDR, I915_READ(DSPBADDR)); + ++ /* Cursor state */ ++ I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); ++ I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); ++ I915_WRITE(CURABASE, dev_priv->saveCURABASE); ++ I915_WRITE(CURBPOS, dev_priv->saveCURBPOS); ++ I915_WRITE(CURBCNTR, dev_priv->saveCURBCNTR); ++ I915_WRITE(CURBBASE, dev_priv->saveCURBBASE); ++ if (IS_GEN2(dev)) ++ I915_WRITE(CURSIZE, dev_priv->saveCURSIZE); ++ + return; + } + +@@ -543,16 +563,6 @@ void i915_save_display(struct drm_device *dev) + /* Don't save them in KMS mode */ + i915_save_modeset_reg(dev); + +- /* Cursor state */ +- dev_priv->saveCURACNTR = I915_READ(CURACNTR); +- dev_priv->saveCURAPOS = I915_READ(CURAPOS); +- dev_priv->saveCURABASE = I915_READ(CURABASE); +- dev_priv->saveCURBCNTR = I915_READ(CURBCNTR); +- dev_priv->saveCURBPOS = I915_READ(CURBPOS); +- dev_priv->saveCURBBASE = I915_READ(CURBBASE); +- if (IS_GEN2(dev)) +- dev_priv->saveCURSIZE = I915_READ(CURSIZE); +- + /* CRT state */ + if (HAS_PCH_SPLIT(dev)) { + dev_priv->saveADPA = I915_READ(PCH_ADPA); +@@ -657,16 +667,6 @@ void i915_restore_display(struct drm_device *dev) + /* Don't restore them in KMS mode */ + i915_restore_modeset_reg(dev); + +- /* Cursor state */ +- I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); +- I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); +- I915_WRITE(CURABASE, dev_priv->saveCURABASE); +- I915_WRITE(CURBPOS, dev_priv->saveCURBPOS); +- I915_WRITE(CURBCNTR, dev_priv->saveCURBCNTR); +- I915_WRITE(CURBBASE, dev_priv->saveCURBBASE); +- if (IS_GEN2(dev)) +- I915_WRITE(CURSIZE, dev_priv->saveCURSIZE); +- + /* CRT state */ + if (HAS_PCH_SPLIT(dev)) + I915_WRITE(PCH_ADPA, dev_priv->saveADPA); +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c +index bee24b1..255b52e 100644 +--- a/drivers/gpu/drm/i915/intel_display.c ++++ b/drivers/gpu/drm/i915/intel_display.c +@@ -5336,9 +5336,14 @@ static void intel_setup_outputs(struct drm_device *dev) + struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_encoder *encoder; + bool dpd_is_edp = false; ++ bool has_lvds = false; + + if (IS_MOBILE(dev) && !IS_I830(dev)) +- intel_lvds_init(dev); ++ has_lvds = intel_lvds_init(dev); ++ if (!has_lvds && !HAS_PCH_SPLIT(dev)) { ++ /* disable the panel fitter on everything but LVDS */ ++ I915_WRITE(PFIT_CONTROL, 0); ++ } + + if (HAS_PCH_SPLIT(dev)) { + dpd_is_edp = intel_dpd_is_edp(dev); +diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c +index c8e0055..300f64b 100644 +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -584,17 +584,6 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, + mode->clock = dev_priv->panel_fixed_mode->clock; + } + +- /* Just use VBT values for eDP */ +- if (is_edp(intel_dp)) { +- intel_dp->lane_count = dev_priv->edp.lanes; +- intel_dp->link_bw = dev_priv->edp.rate; +- adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); +- DRM_DEBUG_KMS("eDP link bw %02x lane count %d clock %d\n", +- intel_dp->link_bw, intel_dp->lane_count, +- adjusted_mode->clock); +- return true; +- } +- + for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { + for (clock = 0; clock <= max_clock; clock++) { + int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); +@@ -613,6 +602,19 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, + } + } + ++ if (is_edp(intel_dp)) { ++ /* okay we failed just pick the highest */ ++ intel_dp->lane_count = max_lane_count; ++ intel_dp->link_bw = bws[max_clock]; ++ adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); ++ DRM_DEBUG_KMS("Force picking display port link bw %02x lane " ++ "count %d clock %d\n", ++ intel_dp->link_bw, intel_dp->lane_count, ++ adjusted_mode->clock); ++ ++ return true; ++ } ++ + return false; + } + +@@ -1087,21 +1089,11 @@ intel_get_adjust_train(struct intel_dp *intel_dp) + } + + static uint32_t +-intel_dp_signal_levels(struct intel_dp *intel_dp) ++intel_dp_signal_levels(uint8_t train_set, int lane_count) + { +- struct drm_device *dev = intel_dp->base.base.dev; +- struct drm_i915_private *dev_priv = dev->dev_private; +- uint32_t signal_levels = 0; +- u8 train_set = intel_dp->train_set[0]; +- u32 vswing = train_set & DP_TRAIN_VOLTAGE_SWING_MASK; +- u32 preemphasis = train_set & DP_TRAIN_PRE_EMPHASIS_MASK; ++ uint32_t signal_levels = 0; + +- if (is_edp(intel_dp)) { +- vswing = dev_priv->edp.vswing; +- preemphasis = dev_priv->edp.preemphasis; +- } +- +- switch (vswing) { ++ switch (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) { + case DP_TRAIN_VOLTAGE_SWING_400: + default: + signal_levels |= DP_VOLTAGE_0_4; +@@ -1116,7 +1108,7 @@ intel_dp_signal_levels(struct intel_dp *intel_dp) + signal_levels |= DP_VOLTAGE_1_2; + break; + } +- switch (preemphasis) { ++ switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { + case DP_TRAIN_PRE_EMPHASIS_0: + default: + signal_levels |= DP_PRE_EMPHASIS_0; +@@ -1203,18 +1195,6 @@ intel_channel_eq_ok(struct intel_dp *intel_dp) + } + + static bool +-intel_dp_aux_handshake_required(struct intel_dp *intel_dp) +-{ +- struct drm_device *dev = intel_dp->base.base.dev; +- struct drm_i915_private *dev_priv = dev->dev_private; +- +- if (is_edp(intel_dp) && dev_priv->no_aux_handshake) +- return false; +- +- return true; +-} +- +-static bool + intel_dp_set_link_train(struct intel_dp *intel_dp, + uint32_t dp_reg_value, + uint8_t dp_train_pat) +@@ -1226,9 +1206,6 @@ intel_dp_set_link_train(struct intel_dp *intel_dp, + I915_WRITE(intel_dp->output_reg, dp_reg_value); + POSTING_READ(intel_dp->output_reg); + +- if (!intel_dp_aux_handshake_required(intel_dp)) +- return true; +- + intel_dp_aux_native_write_1(intel_dp, + DP_TRAINING_PATTERN_SET, + dp_train_pat); +@@ -1261,11 +1238,10 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) + POSTING_READ(intel_dp->output_reg); + intel_wait_for_vblank(dev, intel_crtc->pipe); + +- if (intel_dp_aux_handshake_required(intel_dp)) +- /* Write the link configuration data */ +- intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, +- intel_dp->link_configuration, +- DP_LINK_CONFIGURATION_SIZE); ++ /* Write the link configuration data */ ++ intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, ++ intel_dp->link_configuration, ++ DP_LINK_CONFIGURATION_SIZE); + + DP |= DP_PORT_EN; + if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) +@@ -1283,7 +1259,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) + signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); + DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; + } else { +- signal_levels = intel_dp_signal_levels(intel_dp); ++ signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); + DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; + } + +@@ -1297,37 +1273,33 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) + break; + /* Set training pattern 1 */ + +- udelay(500); +- if (intel_dp_aux_handshake_required(intel_dp)) { ++ udelay(100); ++ if (!intel_dp_get_link_status(intel_dp)) + break; +- } else { +- if (!intel_dp_get_link_status(intel_dp)) +- break; + +- if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { +- clock_recovery = true; +- break; +- } ++ if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { ++ clock_recovery = true; ++ break; ++ } + +- /* Check to see if we've tried the max voltage */ +- for (i = 0; i < intel_dp->lane_count; i++) +- if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) +- break; +- if (i == intel_dp->lane_count) ++ /* Check to see if we've tried the max voltage */ ++ for (i = 0; i < intel_dp->lane_count; i++) ++ if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) + break; ++ if (i == intel_dp->lane_count) ++ break; + +- /* Check to see if we've tried the same voltage 5 times */ +- if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { +- ++tries; +- if (tries == 5) +- break; +- } else +- tries = 0; +- voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; ++ /* Check to see if we've tried the same voltage 5 times */ ++ if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { ++ ++tries; ++ if (tries == 5) ++ break; ++ } else ++ tries = 0; ++ voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; + +- /* Compute new intel_dp->train_set as requested by target */ +- intel_get_adjust_train(intel_dp); +- } ++ /* Compute new intel_dp->train_set as requested by target */ ++ intel_get_adjust_train(intel_dp); + } + + intel_dp->DP = DP; +@@ -1354,7 +1326,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) + signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); + DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; + } else { +- signal_levels = intel_dp_signal_levels(intel_dp); ++ signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); + DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; + } + +@@ -1368,28 +1340,24 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) + DP_TRAINING_PATTERN_2)) + break; + +- udelay(500); +- +- if (!intel_dp_aux_handshake_required(intel_dp)) { ++ udelay(400); ++ if (!intel_dp_get_link_status(intel_dp)) + break; +- } else { +- if (!intel_dp_get_link_status(intel_dp)) +- break; + +- if (intel_channel_eq_ok(intel_dp)) { +- channel_eq = true; +- break; +- } ++ if (intel_channel_eq_ok(intel_dp)) { ++ channel_eq = true; ++ break; ++ } + +- /* Try 5 times */ +- if (tries > 5) +- break; ++ /* Try 5 times */ ++ if (tries > 5) ++ break; + +- /* Compute new intel_dp->train_set as requested by target */ +- intel_get_adjust_train(intel_dp); +- ++tries; +- } ++ /* Compute new intel_dp->train_set as requested by target */ ++ intel_get_adjust_train(intel_dp); ++ ++tries; + } ++ + if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) + reg = DP | DP_LINK_TRAIN_OFF_CPT; + else +diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h +index 21551fe..e52c612 100644 +--- a/drivers/gpu/drm/i915/intel_drv.h ++++ b/drivers/gpu/drm/i915/intel_drv.h +@@ -237,7 +237,7 @@ extern bool intel_sdvo_init(struct drm_device *dev, int output_device); + extern void intel_dvo_init(struct drm_device *dev); + extern void intel_tv_init(struct drm_device *dev); + extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); +-extern void intel_lvds_init(struct drm_device *dev); ++extern bool intel_lvds_init(struct drm_device *dev); + extern void intel_dp_init(struct drm_device *dev, int dp_reg); + void + intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, +diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c +index 4324a32..f79327f 100644 +--- a/drivers/gpu/drm/i915/intel_lvds.c ++++ b/drivers/gpu/drm/i915/intel_lvds.c +@@ -837,7 +837,7 @@ static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin) + * Create the connector, register the LVDS DDC bus, and try to figure out what + * modes we can display on the LVDS panel (if present). + */ +-void intel_lvds_init(struct drm_device *dev) ++bool intel_lvds_init(struct drm_device *dev) + { + struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_lvds *intel_lvds; +@@ -853,37 +853,37 @@ void intel_lvds_init(struct drm_device *dev) + + /* Skip init on machines we know falsely report LVDS */ + if (dmi_check_system(intel_no_lvds)) +- return; ++ return false; + + pin = GMBUS_PORT_PANEL; + if (!lvds_is_present_in_vbt(dev, &pin)) { + DRM_DEBUG_KMS("LVDS is not present in VBT\n"); +- return; ++ return false; + } + + if (HAS_PCH_SPLIT(dev)) { + if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) +- return; ++ return false; + if (dev_priv->edp.support) { + DRM_DEBUG_KMS("disable LVDS for eDP support\n"); +- return; ++ return false; + } + } + + if (!intel_lvds_ddc_probe(dev, pin)) { + DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); +- return; ++ return false; + } + + intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); + if (!intel_lvds) { +- return; ++ return false; + } + + intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); + if (!intel_connector) { + kfree(intel_lvds); +- return; ++ return false; + } + + if (!HAS_PCH_SPLIT(dev)) { +@@ -1026,7 +1026,7 @@ out: + /* keep the LVDS connector */ + dev_priv->int_lvds_connector = connector; + drm_sysfs_connector_add(connector); +- return; ++ return true; + + failed: + DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); +@@ -1034,4 +1034,5 @@ failed: + drm_encoder_cleanup(encoder); + kfree(intel_lvds); + kfree(intel_connector); ++ return false; + } +diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c +index de158b7..d97e6cb 100644 +--- a/drivers/gpu/drm/i915/intel_sdvo.c ++++ b/drivers/gpu/drm/i915/intel_sdvo.c +@@ -107,7 +107,8 @@ struct intel_sdvo { + * This is set if we treat the device as HDMI, instead of DVI. + */ + bool is_hdmi; +- bool has_audio; ++ bool has_hdmi_monitor; ++ bool has_hdmi_audio; + + /** + * This is set if we detect output of sdvo device as LVDS and +@@ -1023,7 +1024,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, + if (!intel_sdvo_set_target_input(intel_sdvo)) + return; + +- if (intel_sdvo->is_hdmi && ++ if (intel_sdvo->has_hdmi_monitor && + !intel_sdvo_set_avi_infoframe(intel_sdvo)) + return; + +@@ -1063,7 +1064,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, + } + if (intel_crtc->pipe == 1) + sdvox |= SDVO_PIPE_B_SELECT; +- if (intel_sdvo->has_audio) ++ if (intel_sdvo->has_hdmi_audio) + sdvox |= SDVO_AUDIO_ENABLE; + + if (INTEL_INFO(dev)->gen >= 4) { +@@ -1295,55 +1296,14 @@ intel_sdvo_get_edid(struct drm_connector *connector) + return drm_get_edid(connector, &sdvo->ddc); + } + +-static struct drm_connector * +-intel_find_analog_connector(struct drm_device *dev) +-{ +- struct drm_connector *connector; +- struct intel_sdvo *encoder; +- +- list_for_each_entry(encoder, +- &dev->mode_config.encoder_list, +- base.base.head) { +- if (encoder->base.type == INTEL_OUTPUT_ANALOG) { +- list_for_each_entry(connector, +- &dev->mode_config.connector_list, +- head) { +- if (&encoder->base == +- intel_attached_encoder(connector)) +- return connector; +- } +- } +- } +- +- return NULL; +-} +- +-static int +-intel_analog_is_connected(struct drm_device *dev) +-{ +- struct drm_connector *analog_connector; +- +- analog_connector = intel_find_analog_connector(dev); +- if (!analog_connector) +- return false; +- +- if (analog_connector->funcs->detect(analog_connector, false) == +- connector_status_disconnected) +- return false; +- +- return true; +-} +- + /* Mac mini hack -- use the same DDC as the analog connector */ + static struct edid * + intel_sdvo_get_analog_edid(struct drm_connector *connector) + { + struct drm_i915_private *dev_priv = connector->dev->dev_private; + +- if (!intel_analog_is_connected(connector->dev)) +- return NULL; +- +- return drm_get_edid(connector, &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); ++ return drm_get_edid(connector, ++ &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); + } + + enum drm_connector_status +@@ -1388,8 +1348,10 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) + /* DDC bus is shared, match EDID to connector type */ + if (edid->input & DRM_EDID_INPUT_DIGITAL) { + status = connector_status_connected; +- intel_sdvo->is_hdmi = drm_detect_hdmi_monitor(edid); +- intel_sdvo->has_audio = drm_detect_monitor_audio(edid); ++ if (intel_sdvo->is_hdmi) { ++ intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid); ++ intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid); ++ } + } + connector->display_info.raw_edid = NULL; + kfree(edid); +@@ -1398,7 +1360,7 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) + if (status == connector_status_connected) { + struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); + if (intel_sdvo_connector->force_audio) +- intel_sdvo->has_audio = intel_sdvo_connector->force_audio > 0; ++ intel_sdvo->has_hdmi_audio = intel_sdvo_connector->force_audio > 0; + } + + return status; +@@ -1415,10 +1377,12 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) + if (!intel_sdvo_write_cmd(intel_sdvo, + SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0)) + return connector_status_unknown; +- if (intel_sdvo->is_tv) { +- /* add 30ms delay when the output type is SDVO-TV */ ++ ++ /* add 30ms delay when the output type might be TV */ ++ if (intel_sdvo->caps.output_flags & ++ (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_CVBS0)) + mdelay(30); +- } ++ + if (!intel_sdvo_read_response(intel_sdvo, &response, 2)) + return connector_status_unknown; + +@@ -1472,8 +1436,10 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) + edid = intel_sdvo_get_analog_edid(connector); + + if (edid != NULL) { +- drm_mode_connector_update_edid_property(connector, edid); +- drm_add_edid_modes(connector, edid); ++ if (edid->input & DRM_EDID_INPUT_DIGITAL) { ++ drm_mode_connector_update_edid_property(connector, edid); ++ drm_add_edid_modes(connector, edid); ++ } + connector->display_info.raw_edid = NULL; + kfree(edid); + } +@@ -1713,12 +1679,12 @@ intel_sdvo_set_property(struct drm_connector *connector, + + intel_sdvo_connector->force_audio = val; + +- if (val > 0 && intel_sdvo->has_audio) ++ if (val > 0 && intel_sdvo->has_hdmi_audio) + return 0; +- if (val < 0 && !intel_sdvo->has_audio) ++ if (val < 0 && !intel_sdvo->has_hdmi_audio) + return 0; + +- intel_sdvo->has_audio = val > 0; ++ intel_sdvo->has_hdmi_audio = val > 0; + goto done; + } + +@@ -2070,6 +2036,8 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) + intel_sdvo_set_colorimetry(intel_sdvo, + SDVO_COLORIMETRY_RGB256); + connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; ++ ++ intel_sdvo_add_hdmi_properties(intel_sdvo_connector); + intel_sdvo->is_hdmi = true; + } + intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | +@@ -2077,8 +2045,6 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) + + intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); + +- intel_sdvo_add_hdmi_properties(intel_sdvo_connector); +- + return true; + } + +diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c +index 8e421f6..05efb5b 100644 +--- a/drivers/gpu/drm/radeon/atom.c ++++ b/drivers/gpu/drm/radeon/atom.c +@@ -112,6 +112,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base, + base += 3; + break; + case ATOM_IIO_WRITE: ++ (void)ctx->card->ioreg_read(ctx->card, CU16(base + 1)); + ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); + base += 3; + break; +diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c +index 9bebac1..0f90fc3 100644 +--- a/drivers/gpu/drm/radeon/r600_cs.c ++++ b/drivers/gpu/drm/radeon/r600_cs.c +@@ -315,7 +315,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) + if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { + /* the initial DDX does bad things with the CB size occasionally */ + /* it rounds up height too far for slice tile max but the BO is smaller */ +- tmp = (height - 7) * pitch * bpe; ++ tmp = (height - 7) * 8 * bpe; + if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { + dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); + return -EINVAL; +diff --git a/drivers/gpu/drm/radeon/r600_reg.h b/drivers/gpu/drm/radeon/r600_reg.h +index d84612a..33cda01 100644 +--- a/drivers/gpu/drm/radeon/r600_reg.h ++++ b/drivers/gpu/drm/radeon/r600_reg.h +@@ -86,6 +86,7 @@ + #define R600_HDP_NONSURFACE_BASE 0x2c04 + + #define R600_BUS_CNTL 0x5420 ++# define R600_BIOS_ROM_DIS (1 << 1) + #define R600_CONFIG_CNTL 0x5424 + #define R600_CONFIG_MEMSIZE 0x5428 + #define R600_CONFIG_F0_BASE 0x542C +diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c +index 87ead09..bc5a2c3 100644 +--- a/drivers/gpu/drm/radeon/radeon_atombios.c ++++ b/drivers/gpu/drm/radeon/radeon_atombios.c +@@ -98,6 +98,14 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_dev + } + } + ++ /* some DCE3 boards have bad data for this entry */ ++ if (ASIC_IS_DCE3(rdev)) { ++ if ((i == 4) && ++ (gpio->usClkMaskRegisterIndex == 0x1fda) && ++ (gpio->sucI2cId.ucAccess == 0x94)) ++ gpio->sucI2cId.ucAccess = 0x14; ++ } ++ + if (gpio->sucI2cId.ucAccess == id) { + i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; + i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; +@@ -174,6 +182,14 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev) + } + } + ++ /* some DCE3 boards have bad data for this entry */ ++ if (ASIC_IS_DCE3(rdev)) { ++ if ((i == 4) && ++ (gpio->usClkMaskRegisterIndex == 0x1fda) && ++ (gpio->sucI2cId.ucAccess == 0x94)) ++ gpio->sucI2cId.ucAccess = 0x14; ++ } ++ + i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; + i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; + i2c.en_clk_reg = le16_to_cpu(gpio->usClkEnRegisterIndex) * 4; +diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c +index 654787e..8f2c7b5 100644 +--- a/drivers/gpu/drm/radeon/radeon_bios.c ++++ b/drivers/gpu/drm/radeon/radeon_bios.c +@@ -130,6 +130,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) + } + return true; + } ++ + static bool r700_read_disabled_bios(struct radeon_device *rdev) + { + uint32_t viph_control; +@@ -143,7 +144,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) + bool r; + + viph_control = RREG32(RADEON_VIPH_CONTROL); +- bus_cntl = RREG32(RADEON_BUS_CNTL); ++ bus_cntl = RREG32(R600_BUS_CNTL); + d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); + d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); + vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); +@@ -152,7 +153,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) + /* disable VIP */ + WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); + /* enable the rom */ +- WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); ++ WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); + /* Disable VGA mode */ + WREG32(AVIVO_D1VGA_CONTROL, + (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | +@@ -191,7 +192,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) + cg_spll_status = RREG32(R600_CG_SPLL_STATUS); + } + WREG32(RADEON_VIPH_CONTROL, viph_control); +- WREG32(RADEON_BUS_CNTL, bus_cntl); ++ WREG32(R600_BUS_CNTL, bus_cntl); + WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); + WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); + WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); +@@ -216,7 +217,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) + bool r; + + viph_control = RREG32(RADEON_VIPH_CONTROL); +- bus_cntl = RREG32(RADEON_BUS_CNTL); ++ bus_cntl = RREG32(R600_BUS_CNTL); + d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); + d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); + vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); +@@ -231,7 +232,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) + /* disable VIP */ + WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); + /* enable the rom */ +- WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); ++ WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); + /* Disable VGA mode */ + WREG32(AVIVO_D1VGA_CONTROL, + (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | +@@ -262,7 +263,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) + + /* restore regs */ + WREG32(RADEON_VIPH_CONTROL, viph_control); +- WREG32(RADEON_BUS_CNTL, bus_cntl); ++ WREG32(R600_BUS_CNTL, bus_cntl); + WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); + WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); + WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); +diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c +index 3bddea5..137b807 100644 +--- a/drivers/gpu/drm/radeon/radeon_combios.c ++++ b/drivers/gpu/drm/radeon/radeon_combios.c +@@ -729,7 +729,7 @@ void radeon_combios_i2c_init(struct radeon_device *rdev) + clk = RBIOS8(offset + 3 + (i * 5) + 3); + data = RBIOS8(offset + 3 + (i * 5) + 4); + i2c = combios_setup_i2c_bus(rdev, DDC_MONID, +- clk, data); ++ (1 << clk), (1 << data)); + rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "GPIOPAD_MASK"); + break; + } +diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c +index 3bef9f6..8afaf7a 100644 +--- a/drivers/gpu/drm/radeon/radeon_connectors.c ++++ b/drivers/gpu/drm/radeon/radeon_connectors.c +@@ -1175,6 +1175,8 @@ radeon_add_atom_connector(struct drm_device *dev, + /* no HPD on analog connectors */ + radeon_connector->hpd.hpd = RADEON_HPD_NONE; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; ++ connector->interlace_allowed = true; ++ connector->doublescan_allowed = true; + break; + case DRM_MODE_CONNECTOR_DVIA: + drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); +@@ -1190,6 +1192,8 @@ radeon_add_atom_connector(struct drm_device *dev, + 1); + /* no HPD on analog connectors */ + radeon_connector->hpd.hpd = RADEON_HPD_NONE; ++ connector->interlace_allowed = true; ++ connector->doublescan_allowed = true; + break; + case DRM_MODE_CONNECTOR_DVII: + case DRM_MODE_CONNECTOR_DVID: +@@ -1226,6 +1230,11 @@ radeon_add_atom_connector(struct drm_device *dev, + rdev->mode_info.load_detect_property, + 1); + } ++ connector->interlace_allowed = true; ++ if (connector_type == DRM_MODE_CONNECTOR_DVII) ++ connector->doublescan_allowed = true; ++ else ++ connector->doublescan_allowed = false; + break; + case DRM_MODE_CONNECTOR_HDMIA: + case DRM_MODE_CONNECTOR_HDMIB: +@@ -1256,6 +1265,11 @@ radeon_add_atom_connector(struct drm_device *dev, + 0); + } + subpixel_order = SubPixelHorizontalRGB; ++ connector->interlace_allowed = true; ++ if (connector_type == DRM_MODE_CONNECTOR_HDMIB) ++ connector->doublescan_allowed = true; ++ else ++ connector->doublescan_allowed = false; + break; + case DRM_MODE_CONNECTOR_DisplayPort: + case DRM_MODE_CONNECTOR_eDP: +@@ -1293,6 +1307,9 @@ radeon_add_atom_connector(struct drm_device *dev, + rdev->mode_info.underscan_vborder_property, + 0); + } ++ connector->interlace_allowed = true; ++ /* in theory with a DP to VGA converter... */ ++ connector->doublescan_allowed = false; + break; + case DRM_MODE_CONNECTOR_SVIDEO: + case DRM_MODE_CONNECTOR_Composite: +@@ -1308,6 +1325,8 @@ radeon_add_atom_connector(struct drm_device *dev, + radeon_atombios_get_tv_info(rdev)); + /* no HPD on analog connectors */ + radeon_connector->hpd.hpd = RADEON_HPD_NONE; ++ connector->interlace_allowed = false; ++ connector->doublescan_allowed = false; + break; + case DRM_MODE_CONNECTOR_LVDS: + radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); +@@ -1326,6 +1345,8 @@ radeon_add_atom_connector(struct drm_device *dev, + dev->mode_config.scaling_mode_property, + DRM_MODE_SCALE_FULLSCREEN); + subpixel_order = SubPixelHorizontalRGB; ++ connector->interlace_allowed = false; ++ connector->doublescan_allowed = false; + break; + } + +@@ -1403,6 +1424,8 @@ radeon_add_legacy_connector(struct drm_device *dev, + /* no HPD on analog connectors */ + radeon_connector->hpd.hpd = RADEON_HPD_NONE; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; ++ connector->interlace_allowed = true; ++ connector->doublescan_allowed = true; + break; + case DRM_MODE_CONNECTOR_DVIA: + drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); +@@ -1418,6 +1441,8 @@ radeon_add_legacy_connector(struct drm_device *dev, + 1); + /* no HPD on analog connectors */ + radeon_connector->hpd.hpd = RADEON_HPD_NONE; ++ connector->interlace_allowed = true; ++ connector->doublescan_allowed = true; + break; + case DRM_MODE_CONNECTOR_DVII: + case DRM_MODE_CONNECTOR_DVID: +@@ -1435,6 +1460,11 @@ radeon_add_legacy_connector(struct drm_device *dev, + 1); + } + subpixel_order = SubPixelHorizontalRGB; ++ connector->interlace_allowed = true; ++ if (connector_type == DRM_MODE_CONNECTOR_DVII) ++ connector->doublescan_allowed = true; ++ else ++ connector->doublescan_allowed = false; + break; + case DRM_MODE_CONNECTOR_SVIDEO: + case DRM_MODE_CONNECTOR_Composite: +@@ -1457,6 +1487,8 @@ radeon_add_legacy_connector(struct drm_device *dev, + radeon_combios_get_tv_info(rdev)); + /* no HPD on analog connectors */ + radeon_connector->hpd.hpd = RADEON_HPD_NONE; ++ connector->interlace_allowed = false; ++ connector->doublescan_allowed = false; + break; + case DRM_MODE_CONNECTOR_LVDS: + drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); +@@ -1470,6 +1502,8 @@ radeon_add_legacy_connector(struct drm_device *dev, + dev->mode_config.scaling_mode_property, + DRM_MODE_SCALE_FULLSCREEN); + subpixel_order = SubPixelHorizontalRGB; ++ connector->interlace_allowed = false; ++ connector->doublescan_allowed = false; + break; + } + diff --git a/kernel.spec b/kernel.spec index 170313ff5..67b66b60e 100644 --- a/kernel.spec +++ b/kernel.spec @@ -648,6 +648,7 @@ Patch1555: fix_xen_guest_on_old_EC2.patch # DRM # nouveau + drm fixes +Patch1801: drm-fixes.patch Patch1810: drm-nouveau-updates.patch Patch1819: drm-intel-big-hammer.patch # intel drm is all merged upstream @@ -1242,6 +1243,7 @@ ApplyPatch linux-2.6-e1000-ich9-montevina.patch ApplyPatch fix_xen_guest_on_old_EC2.patch # DRM core +ApplyPatch drm-fixes.patch # Nouveau DRM ApplyOptionalPatch drm-nouveau-updates.patch @@ -1912,6 +1914,7 @@ fi %changelog * Wed Dec 01 2010 Kyle McMartin 2.6.37-0.rc4.git1.1 - Linux 2.6.37-rc4-git1 +- Pull in DRM fixes that are queued for -rc5 [3074adc8] * Tue Nov 30 2010 Kyle McMartin 2.6.37-0.rc4.git0.1 - Linux 2.6.37-rc4 From 8077b629b4f8dedcaafadce6fc40e50de6e1f920 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 1 Dec 2010 15:05:40 -0500 Subject: [PATCH 40/47] suck in edp-fixes too --- drm-fixes.patch | 60 ++++++++++++++++++++++++++++++++++++++++--------- kernel.spec | 1 + 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/drm-fixes.patch b/drm-fixes.patch index 700f43c4d..4d80be1eb 100644 --- a/drm-fixes.patch +++ b/drm-fixes.patch @@ -57,6 +57,19 @@ index f7af91c..7ca5935 100644 changed = true; } +diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c +index f737960..b1f8164 100644 +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -509,6 +509,8 @@ i915_pci_remove(struct pci_dev *pdev) + { + struct drm_device *dev = pci_get_drvdata(pdev); + ++ pci_disable_device(pdev); /* core did previous enable */ ++ + drm_put_dev(dev); + } + diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 17b1cba..5e54821 100644 --- a/drivers/gpu/drm/i915/i915_gem.c @@ -798,7 +811,7 @@ index bee24b1..255b52e 100644 if (HAS_PCH_SPLIT(dev)) { dpd_is_edp = intel_dpd_is_edp(dev); diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c -index c8e0055..300f64b 100644 +index c8e0055..2e3db37 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -584,17 +584,6 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, @@ -839,7 +852,34 @@ index c8e0055..300f64b 100644 return false; } -@@ -1087,21 +1089,11 @@ intel_get_adjust_train(struct intel_dp *intel_dp) +@@ -793,7 +795,8 @@ static bool ironlake_edp_panel_on (struct intel_dp *intel_dp) + { + struct drm_device *dev = intel_dp->base.base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; +- u32 pp, idle_on_mask = PP_ON | PP_SEQUENCE_STATE_ON_IDLE; ++ u32 pp, idle_on = PP_ON | PP_SEQUENCE_STATE_ON_IDLE; ++ u32 idle_on_mask = PP_ON | PP_SEQUENCE_STATE_MASK; + + if (I915_READ(PCH_PP_STATUS) & PP_ON) + return true; +@@ -814,7 +817,7 @@ static bool ironlake_edp_panel_on (struct intel_dp *intel_dp) + */ + msleep(300); + +- if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on_mask, ++ if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on, + 5000)) + DRM_ERROR("panel on wait timed out: 0x%08x\n", + I915_READ(PCH_PP_STATUS)); +@@ -920,6 +923,7 @@ static void intel_dp_prepare(struct drm_encoder *encoder) + + if (is_edp(intel_dp)) { + ironlake_edp_backlight_off(dev); ++ ironlake_edp_panel_off(dev); + ironlake_edp_panel_on(intel_dp); + if (!is_pch_edp(intel_dp)) + ironlake_edp_pll_on(encoder); +@@ -1087,21 +1091,11 @@ intel_get_adjust_train(struct intel_dp *intel_dp) } static uint32_t @@ -864,7 +904,7 @@ index c8e0055..300f64b 100644 case DP_TRAIN_VOLTAGE_SWING_400: default: signal_levels |= DP_VOLTAGE_0_4; -@@ -1116,7 +1108,7 @@ intel_dp_signal_levels(struct intel_dp *intel_dp) +@@ -1116,7 +1110,7 @@ intel_dp_signal_levels(struct intel_dp *intel_dp) signal_levels |= DP_VOLTAGE_1_2; break; } @@ -873,7 +913,7 @@ index c8e0055..300f64b 100644 case DP_TRAIN_PRE_EMPHASIS_0: default: signal_levels |= DP_PRE_EMPHASIS_0; -@@ -1203,18 +1195,6 @@ intel_channel_eq_ok(struct intel_dp *intel_dp) +@@ -1203,18 +1197,6 @@ intel_channel_eq_ok(struct intel_dp *intel_dp) } static bool @@ -892,7 +932,7 @@ index c8e0055..300f64b 100644 intel_dp_set_link_train(struct intel_dp *intel_dp, uint32_t dp_reg_value, uint8_t dp_train_pat) -@@ -1226,9 +1206,6 @@ intel_dp_set_link_train(struct intel_dp *intel_dp, +@@ -1226,9 +1208,6 @@ intel_dp_set_link_train(struct intel_dp *intel_dp, I915_WRITE(intel_dp->output_reg, dp_reg_value); POSTING_READ(intel_dp->output_reg); @@ -902,7 +942,7 @@ index c8e0055..300f64b 100644 intel_dp_aux_native_write_1(intel_dp, DP_TRAINING_PATTERN_SET, dp_train_pat); -@@ -1261,11 +1238,10 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) +@@ -1261,11 +1240,10 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) POSTING_READ(intel_dp->output_reg); intel_wait_for_vblank(dev, intel_crtc->pipe); @@ -918,7 +958,7 @@ index c8e0055..300f64b 100644 DP |= DP_PORT_EN; if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) -@@ -1283,7 +1259,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) +@@ -1283,7 +1261,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; } else { @@ -927,7 +967,7 @@ index c8e0055..300f64b 100644 DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; } -@@ -1297,37 +1273,33 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) +@@ -1297,37 +1275,33 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) break; /* Set training pattern 1 */ @@ -986,7 +1026,7 @@ index c8e0055..300f64b 100644 } intel_dp->DP = DP; -@@ -1354,7 +1326,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) +@@ -1354,7 +1328,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; } else { @@ -995,7 +1035,7 @@ index c8e0055..300f64b 100644 DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; } -@@ -1368,28 +1340,24 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) +@@ -1368,28 +1342,24 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) DP_TRAINING_PATTERN_2)) break; diff --git a/kernel.spec b/kernel.spec index 67b66b60e..b01ba32a2 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1915,6 +1915,7 @@ fi * Wed Dec 01 2010 Kyle McMartin 2.6.37-0.rc4.git1.1 - Linux 2.6.37-rc4-git1 - Pull in DRM fixes that are queued for -rc5 [3074adc8] + + edp-fixes on top * Tue Nov 30 2010 Kyle McMartin 2.6.37-0.rc4.git0.1 - Linux 2.6.37-rc4 From 254585788fce648441c41bf2854ac0899f3e2b1a Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 2 Dec 2010 11:57:44 -0500 Subject: [PATCH 41/47] kswapd fixes from mmotm (queuing them here since it's unclear if they'll go into .37 or wait for .38) --- kernel.spec | 10 + ...counter-threshold-when-memory-is-low.patch | 389 ++++++++++++++++++ ...back-for-adjusting-percpu-thresholds.patch | 167 ++++++++ 3 files changed, 566 insertions(+) create mode 100644 mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch create mode 100644 mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch diff --git a/kernel.spec b/kernel.spec index b01ba32a2..473b6e29d 100644 --- a/kernel.spec +++ b/kernel.spec @@ -705,6 +705,9 @@ Patch12401: debug-tty-print-dev-name.patch Patch12402: tty-ldisc-fix-open-flag-handling.patch Patch12403: tty-open-hangup-race-fixup.patch +Patch12410: mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch +Patch12411: mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch + %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1300,6 +1303,10 @@ ApplyPatch debug-tty-print-dev-name.patch ApplyPatch tty-ldisc-fix-open-flag-handling.patch ApplyPatch tty-open-hangup-race-fixup.patch +# backport some fixes for kswapd from mmotm, rhbz#649694 +ApplyPatch mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch +ApplyPatch mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch + # END OF PATCH APPLICATIONS %endif @@ -1912,6 +1919,9 @@ fi # || || %changelog +* Thu Dec 02 2010 Kyle McMartin +- Grab some of Mel's fixes from -mmotm to hopefully sort out #649694. + * Wed Dec 01 2010 Kyle McMartin 2.6.37-0.rc4.git1.1 - Linux 2.6.37-rc4-git1 - Pull in DRM fixes that are queued for -rc5 [3074adc8] diff --git a/mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch b/mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch new file mode 100644 index 000000000..561c5897e --- /dev/null +++ b/mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch @@ -0,0 +1,389 @@ +From df43fae25437d7bc7dfff72599c1e825038b67cf Mon Sep 17 00:00:00 2001 +From: Mel Gorman +Date: Wed, 24 Nov 2010 22:18:23 -0500 +Subject: [PATCH 1/2] mm: page allocator: Adjust the per-cpu counter threshold when memory is low + +Commit aa45484 ("calculate a better estimate of NR_FREE_PAGES when memory +is low") noted that watermarks were based on the vmstat NR_FREE_PAGES. To +avoid synchronization overhead, these counters are maintained on a per-cpu +basis and drained both periodically and when a threshold is above a +threshold. On large CPU systems, the difference between the estimate and +real value of NR_FREE_PAGES can be very high. The system can get into a +case where pages are allocated far below the min watermark potentially +causing livelock issues. The commit solved the problem by taking a better +reading of NR_FREE_PAGES when memory was low. + +Unfortately, as reported by Shaohua Li this accurate reading can consume a +large amount of CPU time on systems with many sockets due to cache line +bouncing. This patch takes a different approach. For large machines +where counter drift might be unsafe and while kswapd is awake, the per-cpu +thresholds for the target pgdat are reduced to limit the level of drift to +what should be a safe level. This incurs a performance penalty in heavy +memory pressure by a factor that depends on the workload and the machine +but the machine should function correctly without accidentally exhausting +all memory on a node. There is an additional cost when kswapd wakes and +sleeps but the event is not expected to be frequent - in Shaohua's test +case, there was one recorded sleep and wake event at least. + +To ensure that kswapd wakes up, a safe version of zone_watermark_ok() is +introduced that takes a more accurate reading of NR_FREE_PAGES when called +from wakeup_kswapd, when deciding whether it is really safe to go back to +sleep in sleeping_prematurely() and when deciding if a zone is really +balanced or not in balance_pgdat(). We are still using an expensive +function but limiting how often it is called. + +When the test case is reproduced, the time spent in the watermark +functions is reduced. The following report is on the percentage of time +spent cumulatively spent in the functions zone_nr_free_pages(), +zone_watermark_ok(), __zone_watermark_ok(), zone_watermark_ok_safe(), +zone_page_state_snapshot(), zone_page_state(). + +vanilla 11.6615% +disable-threshold 0.2584% + +Reported-by: Shaohua Li +Signed-off-by: Mel Gorman +Reviewed-by: Christoph Lameter +Signed-off-by: Andrew Morton +[[http://userweb.kernel.org/~akpm/mmotm/broken-out/mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch]] +--- + include/linux/mmzone.h | 10 ++----- + include/linux/vmstat.h | 5 +++ + mm/mmzone.c | 21 --------------- + mm/page_alloc.c | 35 +++++++++++++++++++----- + mm/vmscan.c | 23 +++++++++------- + mm/vmstat.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++- + 6 files changed, 115 insertions(+), 47 deletions(-) + +diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h +index 3984c4e..8d789d7 100644 +--- a/include/linux/mmzone.h ++++ b/include/linux/mmzone.h +@@ -448,12 +448,6 @@ static inline int zone_is_oom_locked(const struct zone *zone) + return test_bit(ZONE_OOM_LOCKED, &zone->flags); + } + +-#ifdef CONFIG_SMP +-unsigned long zone_nr_free_pages(struct zone *zone); +-#else +-#define zone_nr_free_pages(zone) zone_page_state(zone, NR_FREE_PAGES) +-#endif /* CONFIG_SMP */ +- + /* + * The "priority" of VM scanning is how much of the queues we will scan in one + * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the +@@ -651,7 +645,9 @@ typedef struct pglist_data { + extern struct mutex zonelists_mutex; + void build_all_zonelists(void *data); + void wakeup_kswapd(struct zone *zone, int order); +-int zone_watermark_ok(struct zone *z, int order, unsigned long mark, ++bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, ++ int classzone_idx, int alloc_flags); ++bool zone_watermark_ok_safe(struct zone *z, int order, unsigned long mark, + int classzone_idx, int alloc_flags); + enum memmap_context { + MEMMAP_EARLY, +diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h +index eaaea37..e4cc21c 100644 +--- a/include/linux/vmstat.h ++++ b/include/linux/vmstat.h +@@ -254,6 +254,8 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); + extern void __dec_zone_state(struct zone *, enum zone_stat_item); + + void refresh_cpu_vm_stats(int); ++void reduce_pgdat_percpu_threshold(pg_data_t *pgdat); ++void restore_pgdat_percpu_threshold(pg_data_t *pgdat); + #else /* CONFIG_SMP */ + + /* +@@ -298,6 +300,9 @@ static inline void __dec_zone_page_state(struct page *page, + #define dec_zone_page_state __dec_zone_page_state + #define mod_zone_page_state __mod_zone_page_state + ++static inline void reduce_pgdat_percpu_threshold(pg_data_t *pgdat) { } ++static inline void restore_pgdat_percpu_threshold(pg_data_t *pgdat) { } ++ + static inline void refresh_cpu_vm_stats(int cpu) { } + #endif + +diff --git a/mm/mmzone.c b/mm/mmzone.c +index e35bfb8..f5b7d17 100644 +--- a/mm/mmzone.c ++++ b/mm/mmzone.c +@@ -87,24 +87,3 @@ int memmap_valid_within(unsigned long pfn, + return 1; + } + #endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */ +- +-#ifdef CONFIG_SMP +-/* Called when a more accurate view of NR_FREE_PAGES is needed */ +-unsigned long zone_nr_free_pages(struct zone *zone) +-{ +- unsigned long nr_free_pages = zone_page_state(zone, NR_FREE_PAGES); +- +- /* +- * While kswapd is awake, it is considered the zone is under some +- * memory pressure. Under pressure, there is a risk that +- * per-cpu-counter-drift will allow the min watermark to be breached +- * potentially causing a live-lock. While kswapd is awake and +- * free pages are low, get a better estimate for free pages +- */ +- if (nr_free_pages < zone->percpu_drift_mark && +- !waitqueue_active(&zone->zone_pgdat->kswapd_wait)) +- return zone_page_state_snapshot(zone, NR_FREE_PAGES); +- +- return nr_free_pages; +-} +-#endif /* CONFIG_SMP */ +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index f12ad18..0286150 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -1454,24 +1454,24 @@ static inline int should_fail_alloc_page(gfp_t gfp_mask, unsigned int order) + #endif /* CONFIG_FAIL_PAGE_ALLOC */ + + /* +- * Return 1 if free pages are above 'mark'. This takes into account the order ++ * Return true if free pages are above 'mark'. This takes into account the order + * of the allocation. + */ +-int zone_watermark_ok(struct zone *z, int order, unsigned long mark, +- int classzone_idx, int alloc_flags) ++static bool __zone_watermark_ok(struct zone *z, int order, unsigned long mark, ++ int classzone_idx, int alloc_flags, long free_pages) + { + /* free_pages my go negative - that's OK */ + long min = mark; +- long free_pages = zone_nr_free_pages(z) - (1 << order) + 1; + int o; + ++ free_pages -= (1 << order) + 1; + if (alloc_flags & ALLOC_HIGH) + min -= min / 2; + if (alloc_flags & ALLOC_HARDER) + min -= min / 4; + + if (free_pages <= min + z->lowmem_reserve[classzone_idx]) +- return 0; ++ return false; + for (o = 0; o < order; o++) { + /* At the next order, this order's pages become unavailable */ + free_pages -= z->free_area[o].nr_free << o; +@@ -1480,9 +1480,28 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark, + min >>= 1; + + if (free_pages <= min) +- return 0; ++ return false; + } +- return 1; ++ return true; ++} ++ ++bool zone_watermark_ok(struct zone *z, int order, unsigned long mark, ++ int classzone_idx, int alloc_flags) ++{ ++ return __zone_watermark_ok(z, order, mark, classzone_idx, alloc_flags, ++ zone_page_state(z, NR_FREE_PAGES)); ++} ++ ++bool zone_watermark_ok_safe(struct zone *z, int order, unsigned long mark, ++ int classzone_idx, int alloc_flags) ++{ ++ long free_pages = zone_page_state(z, NR_FREE_PAGES); ++ ++ if (z->percpu_drift_mark && free_pages < z->percpu_drift_mark) ++ free_pages = zone_page_state_snapshot(z, NR_FREE_PAGES); ++ ++ return __zone_watermark_ok(z, order, mark, classzone_idx, alloc_flags, ++ free_pages); + } + + #ifdef CONFIG_NUMA +@@ -2436,7 +2455,7 @@ void show_free_areas(void) + " all_unreclaimable? %s" + "\n", + zone->name, +- K(zone_nr_free_pages(zone)), ++ K(zone_page_state(zone, NR_FREE_PAGES)), + K(min_wmark_pages(zone)), + K(low_wmark_pages(zone)), + K(high_wmark_pages(zone)), +diff --git a/mm/vmscan.c b/mm/vmscan.c +index c5dfabf..3e71cb1 100644 +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -2082,7 +2082,7 @@ static int sleeping_prematurely(pg_data_t *pgdat, int order, long remaining) + if (zone->all_unreclaimable) + continue; + +- if (!zone_watermark_ok(zone, order, high_wmark_pages(zone), ++ if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), + 0, 0)) + return 1; + } +@@ -2169,7 +2169,7 @@ loop_again: + shrink_active_list(SWAP_CLUSTER_MAX, zone, + &sc, priority, 0); + +- if (!zone_watermark_ok(zone, order, ++ if (!zone_watermark_ok_safe(zone, order, + high_wmark_pages(zone), 0, 0)) { + end_zone = i; + break; +@@ -2215,7 +2215,7 @@ loop_again: + * We put equal pressure on every zone, unless one + * zone has way too many pages free already. + */ +- if (!zone_watermark_ok(zone, order, ++ if (!zone_watermark_ok_safe(zone, order, + 8*high_wmark_pages(zone), end_zone, 0)) + shrink_zone(priority, zone, &sc); + reclaim_state->reclaimed_slab = 0; +@@ -2236,7 +2236,7 @@ loop_again: + total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2) + sc.may_writepage = 1; + +- if (!zone_watermark_ok(zone, order, ++ if (!zone_watermark_ok_safe(zone, order, + high_wmark_pages(zone), end_zone, 0)) { + all_zones_ok = 0; + /* +@@ -2244,7 +2244,7 @@ loop_again: + * means that we have a GFP_ATOMIC allocation + * failure risk. Hurry up! + */ +- if (!zone_watermark_ok(zone, order, ++ if (!zone_watermark_ok_safe(zone, order, + min_wmark_pages(zone), end_zone, 0)) + has_under_min_watermark_zone = 1; + } +@@ -2378,7 +2378,9 @@ static int kswapd(void *p) + */ + if (!sleeping_prematurely(pgdat, order, remaining)) { + trace_mm_vmscan_kswapd_sleep(pgdat->node_id); ++ restore_pgdat_percpu_threshold(pgdat); + schedule(); ++ reduce_pgdat_percpu_threshold(pgdat); + } else { + if (remaining) + count_vm_event(KSWAPD_LOW_WMARK_HIT_QUICKLY); +@@ -2417,16 +2419,17 @@ void wakeup_kswapd(struct zone *zone, int order) + if (!populated_zone(zone)) + return; + +- pgdat = zone->zone_pgdat; +- if (zone_watermark_ok(zone, order, low_wmark_pages(zone), 0, 0)) ++ if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) + return; ++ pgdat = zone->zone_pgdat; + if (pgdat->kswapd_max_order < order) + pgdat->kswapd_max_order = order; +- trace_mm_vmscan_wakeup_kswapd(pgdat->node_id, zone_idx(zone), order); +- if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL)) +- return; + if (!waitqueue_active(&pgdat->kswapd_wait)) + return; ++ if (zone_watermark_ok_safe(zone, order, low_wmark_pages(zone), 0, 0)) ++ return; ++ ++ trace_mm_vmscan_wakeup_kswapd(pgdat->node_id, zone_idx(zone), order); + wake_up_interruptible(&pgdat->kswapd_wait); + } + +diff --git a/mm/vmstat.c b/mm/vmstat.c +index 355a9e6..4d7faeb 100644 +--- a/mm/vmstat.c ++++ b/mm/vmstat.c +@@ -81,6 +81,30 @@ EXPORT_SYMBOL(vm_stat); + + #ifdef CONFIG_SMP + ++static int calculate_pressure_threshold(struct zone *zone) ++{ ++ int threshold; ++ int watermark_distance; ++ ++ /* ++ * As vmstats are not up to date, there is drift between the estimated ++ * and real values. For high thresholds and a high number of CPUs, it ++ * is possible for the min watermark to be breached while the estimated ++ * value looks fine. The pressure threshold is a reduced value such ++ * that even the maximum amount of drift will not accidentally breach ++ * the min watermark ++ */ ++ watermark_distance = low_wmark_pages(zone) - min_wmark_pages(zone); ++ threshold = max(1, (int)(watermark_distance / num_online_cpus())); ++ ++ /* ++ * Maximum threshold is 125 ++ */ ++ threshold = min(125, threshold); ++ ++ return threshold; ++} ++ + static int calculate_threshold(struct zone *zone) + { + int threshold; +@@ -159,6 +183,48 @@ static void refresh_zone_stat_thresholds(void) + } + } + ++void reduce_pgdat_percpu_threshold(pg_data_t *pgdat) ++{ ++ struct zone *zone; ++ int cpu; ++ int threshold; ++ int i; ++ ++ get_online_cpus(); ++ for (i = 0; i < pgdat->nr_zones; i++) { ++ zone = &pgdat->node_zones[i]; ++ if (!zone->percpu_drift_mark) ++ continue; ++ ++ threshold = calculate_pressure_threshold(zone); ++ for_each_online_cpu(cpu) ++ per_cpu_ptr(zone->pageset, cpu)->stat_threshold ++ = threshold; ++ } ++ put_online_cpus(); ++} ++ ++void restore_pgdat_percpu_threshold(pg_data_t *pgdat) ++{ ++ struct zone *zone; ++ int cpu; ++ int threshold; ++ int i; ++ ++ get_online_cpus(); ++ for (i = 0; i < pgdat->nr_zones; i++) { ++ zone = &pgdat->node_zones[i]; ++ if (!zone->percpu_drift_mark) ++ continue; ++ ++ threshold = calculate_threshold(zone); ++ for_each_online_cpu(cpu) ++ per_cpu_ptr(zone->pageset, cpu)->stat_threshold ++ = threshold; ++ } ++ put_online_cpus(); ++} ++ + /* + * For use when we know that interrupts are disabled. + */ +@@ -826,7 +892,7 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat, + "\n scanned %lu" + "\n spanned %lu" + "\n present %lu", +- zone_nr_free_pages(zone), ++ zone_page_state(zone, NR_FREE_PAGES), + min_wmark_pages(zone), + low_wmark_pages(zone), + high_wmark_pages(zone), +-- +1.7.3.2 + diff --git a/mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch b/mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch new file mode 100644 index 000000000..058b1399a --- /dev/null +++ b/mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch @@ -0,0 +1,167 @@ +From 82e3d4969144377d13da97d511e849e8cf3e6dcc Mon Sep 17 00:00:00 2001 +From: Mel Gorman +Date: Wed, 24 Nov 2010 22:24:24 -0500 +Subject: [PATCH 2/2] mm: vmstat: Use a single setter function and callback for adjusting percpu thresholds + +reduce_pgdat_percpu_threshold() and restore_pgdat_percpu_threshold() exist +to adjust the per-cpu vmstat thresholds while kswapd is awake to avoid +errors due to counter drift. The functions duplicate some code so this +patch replaces them with a single set_pgdat_percpu_threshold() that takes +a callback function to calculate the desired threshold as a parameter. + +Signed-off-by: Mel Gorman +Reviewed-by: Christoph Lameter +Reviewed-by: KAMEZAWA Hiroyuki +Signed-off-by: Andrew Morton +[the various mmotm patches updating this were rolled up. --kyle] +[[http://userweb.kernel.org/~akpm/mmotm/broken-out/mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds-fix-set_pgdat_percpu_threshold-dont-use-for_each_online_cpu.patch]] +--- + include/linux/vmstat.h | 10 ++++++---- + mm/vmscan.c | 19 +++++++++++++++++-- + mm/vmstat.c | 36 +++++++----------------------------- + 3 files changed, 30 insertions(+), 35 deletions(-) + +diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h +index e4cc21c..833e676 100644 +--- a/include/linux/vmstat.h ++++ b/include/linux/vmstat.h +@@ -254,8 +254,11 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); + extern void __dec_zone_state(struct zone *, enum zone_stat_item); + + void refresh_cpu_vm_stats(int); +-void reduce_pgdat_percpu_threshold(pg_data_t *pgdat); +-void restore_pgdat_percpu_threshold(pg_data_t *pgdat); ++ ++int calculate_pressure_threshold(struct zone *zone); ++int calculate_normal_threshold(struct zone *zone); ++void set_pgdat_percpu_threshold(pg_data_t *pgdat, ++ int (*calculate_pressure)(struct zone *)); + #else /* CONFIG_SMP */ + + /* +@@ -300,8 +303,7 @@ static inline void __dec_zone_page_state(struct page *page, + #define dec_zone_page_state __dec_zone_page_state + #define mod_zone_page_state __mod_zone_page_state + +-static inline void reduce_pgdat_percpu_threshold(pg_data_t *pgdat) { } +-static inline void restore_pgdat_percpu_threshold(pg_data_t *pgdat) { } ++#define set_pgdat_percpu_threshold(pgdat, callback) { } + + static inline void refresh_cpu_vm_stats(int cpu) { } + #endif +diff --git a/mm/vmscan.c b/mm/vmscan.c +index 3e71cb1..ba39948 100644 +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -2378,9 +2378,24 @@ static int kswapd(void *p) + */ + if (!sleeping_prematurely(pgdat, order, remaining)) { + trace_mm_vmscan_kswapd_sleep(pgdat->node_id); +- restore_pgdat_percpu_threshold(pgdat); ++ ++ /* ++ * vmstat counters are not perfectly ++ * accurate and the estimated value ++ * for counters such as NR_FREE_PAGES ++ * can deviate from the true value by ++ * nr_online_cpus * threshold. To ++ * avoid the zone watermarks being ++ * breached while under pressure, we ++ * reduce the per-cpu vmstat threshold ++ * while kswapd is awake and restore ++ * them before going back to sleep. ++ */ ++ set_pgdat_percpu_threshold(pgdat, ++ calculate_normal_threshold); + schedule(); +- reduce_pgdat_percpu_threshold(pgdat); ++ set_pgdat_percpu_threshold(pgdat, ++ calculate_pressure_threshold); + } else { + if (remaining) + count_vm_event(KSWAPD_LOW_WMARK_HIT_QUICKLY); +diff --git a/mm/vmstat.c b/mm/vmstat.c +index 4d7faeb..511c2c0 100644 +--- a/mm/vmstat.c ++++ b/mm/vmstat.c +@@ -81,7 +81,7 @@ EXPORT_SYMBOL(vm_stat); + + #ifdef CONFIG_SMP + +-static int calculate_pressure_threshold(struct zone *zone) ++int calculate_pressure_threshold(struct zone *zone) + { + int threshold; + int watermark_distance; +@@ -105,7 +105,7 @@ static int calculate_pressure_threshold(struct zone *zone) + return threshold; + } + +-static int calculate_threshold(struct zone *zone) ++int calculate_normal_threshold(struct zone *zone) + { + int threshold; + int mem; /* memory in 128 MB units */ +@@ -164,7 +164,7 @@ static void refresh_zone_stat_thresholds(void) + for_each_populated_zone(zone) { + unsigned long max_drift, tolerate_drift; + +- threshold = calculate_threshold(zone); ++ threshold = calculate_normal_threshold(zone); + + for_each_online_cpu(cpu) + per_cpu_ptr(zone->pageset, cpu)->stat_threshold +@@ -183,46 +183,24 @@ static void refresh_zone_stat_thresholds(void) + } + } + +-void reduce_pgdat_percpu_threshold(pg_data_t *pgdat) ++void set_pgdat_percpu_threshold(pg_data_t *pgdat, ++ int (*calculate_pressure)(struct zone *)) + { + struct zone *zone; + int cpu; + int threshold; + int i; + +- get_online_cpus(); +- for (i = 0; i < pgdat->nr_zones; i++) { +- zone = &pgdat->node_zones[i]; +- if (!zone->percpu_drift_mark) +- continue; +- +- threshold = calculate_pressure_threshold(zone); +- for_each_online_cpu(cpu) +- per_cpu_ptr(zone->pageset, cpu)->stat_threshold +- = threshold; +- } +- put_online_cpus(); +-} +- +-void restore_pgdat_percpu_threshold(pg_data_t *pgdat) +-{ +- struct zone *zone; +- int cpu; +- int threshold; +- int i; +- +- get_online_cpus(); + for (i = 0; i < pgdat->nr_zones; i++) { + zone = &pgdat->node_zones[i]; + if (!zone->percpu_drift_mark) + continue; + +- threshold = calculate_threshold(zone); +- for_each_online_cpu(cpu) ++ threshold = (*calculate_pressure)(zone); ++ for_each_possible_cpu(cpu) + per_cpu_ptr(zone->pageset, cpu)->stat_threshold + = threshold; + } +- put_online_cpus(); + } + + /* +-- +1.7.3.2 + From 5acda9367767857702a5fd08308e8bdfccbbac84 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 3 Dec 2010 07:26:49 -0500 Subject: [PATCH 42/47] Linux 2.6.37-rc4-git3 --- .gitignore | 2 +- config-generic | 1 + config-x86_64-generic | 2 + drm-fixes.patch | 1612 ----------------- drm-intel-edp-fixes.patch | 44 + kernel.spec | 21 +- sources | 2 +- ...-allow-reopen-when-ldisc-is-changing.patch | 84 - tty-ldisc-fix-open-flag-handling.patch | 54 - tty-open-hangup-race-fixup.patch | 76 - 10 files changed, 61 insertions(+), 1837 deletions(-) delete mode 100644 drm-fixes.patch create mode 100644 drm-intel-edp-fixes.patch delete mode 100644 tty-dont-allow-reopen-when-ldisc-is-changing.patch delete mode 100644 tty-ldisc-fix-open-flag-handling.patch delete mode 100644 tty-open-hangup-race-fixup.patch diff --git a/.gitignore b/.gitignore index 28c0a5fd1..1906c3468 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc4.bz2 -/patch-2.6.37-rc4-git1.bz2 +/patch-2.6.37-rc4-git3.bz2 diff --git a/config-generic b/config-generic index db67c5026..f12c7c7d9 100644 --- a/config-generic +++ b/config-generic @@ -3529,6 +3529,7 @@ CONFIG_CIFS_UPCALL=y CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y CONFIG_CIFS_FSCACHE=y +CONFIG_CIFS_ACL=y CONFIG_CIFS_WEAK_PW_HASH=y # CONFIG_CIFS_DEBUG2 is not set CONFIG_CIFS_DFS_UPCALL=y diff --git a/config-x86_64-generic b/config-x86_64-generic index a521b72b6..b09e5112c 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -437,3 +437,5 @@ CONFIG_PCH_PHUB=m CONFIG_VIDEO_VIA_CAMERA=m CONFIG_JUMP_LABEL=y + +CONFIG_HP_ILO=m diff --git a/drm-fixes.patch b/drm-fixes.patch deleted file mode 100644 index 4d80be1eb..000000000 --- a/drm-fixes.patch +++ /dev/null @@ -1,1612 +0,0 @@ -diff --git a/MAINTAINERS b/MAINTAINERS -index b3be8b3..3eafe9e 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -2080,7 +2080,7 @@ F: include/drm/ - - INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets) - M: Chris Wilson --L: intel-gfx@lists.freedesktop.org -+L: intel-gfx@lists.freedesktop.org (subscribers-only) - L: dri-devel@lists.freedesktop.org - T: git git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel.git - S: Supported -diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c -index f7af91c..7ca5935 100644 ---- a/drivers/gpu/drm/drm_crtc_helper.c -+++ b/drivers/gpu/drm/drm_crtc_helper.c -@@ -471,6 +471,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) - int count = 0, ro, fail = 0; - struct drm_crtc_helper_funcs *crtc_funcs; - int ret = 0; -+ int i; - - DRM_DEBUG_KMS("\n"); - -@@ -666,6 +667,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) - if (ret != 0) - goto fail; - } -+ DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); -+ for (i = 0; i < set->num_connectors; i++) { -+ DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, -+ drm_get_connector_name(set->connectors[i])); -+ set->connectors[i]->dpms = DRM_MODE_DPMS_ON; -+ } - - kfree(save_connectors); - kfree(save_encoders); -@@ -841,7 +848,7 @@ static void output_poll_execute(struct work_struct *work) - struct delayed_work *delayed_work = to_delayed_work(work); - struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work); - struct drm_connector *connector; -- enum drm_connector_status old_status, status; -+ enum drm_connector_status old_status; - bool repoll = false, changed = false; - - if (!drm_kms_helper_poll) -@@ -866,8 +873,9 @@ static void output_poll_execute(struct work_struct *work) - !(connector->polled & DRM_CONNECTOR_POLL_HPD)) - continue; - -- status = connector->funcs->detect(connector, false); -- if (old_status != status) -+ connector->status = connector->funcs->detect(connector, false); -+ DRM_DEBUG_KMS("connector status updated to %d\n", connector->status); -+ if (old_status != connector->status) - changed = true; - } - -diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c -index f737960..b1f8164 100644 ---- a/drivers/gpu/drm/i915/i915_drv.c -+++ b/drivers/gpu/drm/i915/i915_drv.c -@@ -509,6 +509,8 @@ i915_pci_remove(struct pci_dev *pdev) - { - struct drm_device *dev = pci_get_drvdata(pdev); - -+ pci_disable_device(pdev); /* core did previous enable */ -+ - drm_put_dev(dev); - } - -diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c -index 17b1cba..5e54821 100644 ---- a/drivers/gpu/drm/i915/i915_gem.c -+++ b/drivers/gpu/drm/i915/i915_gem.c -@@ -38,8 +38,7 @@ - - static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); - --static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, -- bool pipelined); -+static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); - static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); - static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); - static int i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, -@@ -2594,7 +2593,7 @@ i915_gem_object_put_fence_reg(struct drm_gem_object *obj, - if (reg->gpu) { - int ret; - -- ret = i915_gem_object_flush_gpu_write_domain(obj, true); -+ ret = i915_gem_object_flush_gpu_write_domain(obj); - if (ret) - return ret; - -@@ -2742,8 +2741,7 @@ i915_gem_clflush_object(struct drm_gem_object *obj) - - /** Flushes any GPU write domain for the object if it's dirty. */ - static int --i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, -- bool pipelined) -+i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj) - { - struct drm_device *dev = obj->dev; - uint32_t old_write_domain; -@@ -2762,10 +2760,7 @@ i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, - obj->read_domains, - old_write_domain); - -- if (pipelined) -- return 0; -- -- return i915_gem_object_wait_rendering(obj, true); -+ return 0; - } - - /** Flushes the GTT write domain for the object if it's dirty. */ -@@ -2826,18 +2821,15 @@ i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write) - if (obj_priv->gtt_space == NULL) - return -EINVAL; - -- ret = i915_gem_object_flush_gpu_write_domain(obj, false); -+ ret = i915_gem_object_flush_gpu_write_domain(obj); - if (ret != 0) - return ret; -+ ret = i915_gem_object_wait_rendering(obj, true); -+ if (ret) -+ return ret; - - i915_gem_object_flush_cpu_write_domain(obj); - -- if (write) { -- ret = i915_gem_object_wait_rendering(obj, true); -- if (ret) -- return ret; -- } -- - old_write_domain = obj->write_domain; - old_read_domains = obj->read_domains; - -@@ -2875,7 +2867,7 @@ i915_gem_object_set_to_display_plane(struct drm_gem_object *obj, - if (obj_priv->gtt_space == NULL) - return -EINVAL; - -- ret = i915_gem_object_flush_gpu_write_domain(obj, true); -+ ret = i915_gem_object_flush_gpu_write_domain(obj); - if (ret) - return ret; - -@@ -2924,9 +2916,12 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) - uint32_t old_write_domain, old_read_domains; - int ret; - -- ret = i915_gem_object_flush_gpu_write_domain(obj, false); -+ ret = i915_gem_object_flush_gpu_write_domain(obj); - if (ret != 0) - return ret; -+ ret = i915_gem_object_wait_rendering(obj, true); -+ if (ret) -+ return ret; - - i915_gem_object_flush_gtt_write_domain(obj); - -@@ -2935,12 +2930,6 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) - */ - i915_gem_object_set_to_full_cpu_read_domain(obj); - -- if (write) { -- ret = i915_gem_object_wait_rendering(obj, true); -- if (ret) -- return ret; -- } -- - old_write_domain = obj->write_domain; - old_read_domains = obj->read_domains; - -@@ -3205,9 +3194,13 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, - if (offset == 0 && size == obj->size) - return i915_gem_object_set_to_cpu_domain(obj, 0); - -- ret = i915_gem_object_flush_gpu_write_domain(obj, false); -+ ret = i915_gem_object_flush_gpu_write_domain(obj); - if (ret != 0) - return ret; -+ ret = i915_gem_object_wait_rendering(obj, true); -+ if (ret) -+ return ret; -+ - i915_gem_object_flush_gtt_write_domain(obj); - - /* If we're already fully in the CPU read domain, we're done. */ -@@ -3254,192 +3247,230 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, - return 0; - } - --/** -- * Pin an object to the GTT and evaluate the relocations landing in it. -- */ - static int --i915_gem_execbuffer_relocate(struct drm_i915_gem_object *obj, -- struct drm_file *file_priv, -- struct drm_i915_gem_exec_object2 *entry) -+i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, -+ struct drm_file *file_priv, -+ struct drm_i915_gem_exec_object2 *entry, -+ struct drm_i915_gem_relocation_entry *reloc) - { - struct drm_device *dev = obj->base.dev; -- drm_i915_private_t *dev_priv = dev->dev_private; -- struct drm_i915_gem_relocation_entry __user *user_relocs; -- struct drm_gem_object *target_obj = NULL; -- uint32_t target_handle = 0; -- int i, ret = 0; -+ struct drm_gem_object *target_obj; -+ uint32_t target_offset; -+ int ret = -EINVAL; - -- user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr; -- for (i = 0; i < entry->relocation_count; i++) { -- struct drm_i915_gem_relocation_entry reloc; -- uint32_t target_offset; -+ target_obj = drm_gem_object_lookup(dev, file_priv, -+ reloc->target_handle); -+ if (target_obj == NULL) -+ return -ENOENT; - -- if (__copy_from_user_inatomic(&reloc, -- user_relocs+i, -- sizeof(reloc))) { -- ret = -EFAULT; -- break; -- } -+ target_offset = to_intel_bo(target_obj)->gtt_offset; - -- if (reloc.target_handle != target_handle) { -- drm_gem_object_unreference(target_obj); -+#if WATCH_RELOC -+ DRM_INFO("%s: obj %p offset %08x target %d " -+ "read %08x write %08x gtt %08x " -+ "presumed %08x delta %08x\n", -+ __func__, -+ obj, -+ (int) reloc->offset, -+ (int) reloc->target_handle, -+ (int) reloc->read_domains, -+ (int) reloc->write_domain, -+ (int) target_offset, -+ (int) reloc->presumed_offset, -+ reloc->delta); -+#endif - -- target_obj = drm_gem_object_lookup(dev, file_priv, -- reloc.target_handle); -- if (target_obj == NULL) { -- ret = -ENOENT; -- break; -- } -+ /* The target buffer should have appeared before us in the -+ * exec_object list, so it should have a GTT space bound by now. -+ */ -+ if (target_offset == 0) { -+ DRM_ERROR("No GTT space found for object %d\n", -+ reloc->target_handle); -+ goto err; -+ } - -- target_handle = reloc.target_handle; -- } -- target_offset = to_intel_bo(target_obj)->gtt_offset; -+ /* Validate that the target is in a valid r/w GPU domain */ -+ if (reloc->write_domain & (reloc->write_domain - 1)) { -+ DRM_ERROR("reloc with multiple write domains: " -+ "obj %p target %d offset %d " -+ "read %08x write %08x", -+ obj, reloc->target_handle, -+ (int) reloc->offset, -+ reloc->read_domains, -+ reloc->write_domain); -+ goto err; -+ } -+ if (reloc->write_domain & I915_GEM_DOMAIN_CPU || -+ reloc->read_domains & I915_GEM_DOMAIN_CPU) { -+ DRM_ERROR("reloc with read/write CPU domains: " -+ "obj %p target %d offset %d " -+ "read %08x write %08x", -+ obj, reloc->target_handle, -+ (int) reloc->offset, -+ reloc->read_domains, -+ reloc->write_domain); -+ goto err; -+ } -+ if (reloc->write_domain && target_obj->pending_write_domain && -+ reloc->write_domain != target_obj->pending_write_domain) { -+ DRM_ERROR("Write domain conflict: " -+ "obj %p target %d offset %d " -+ "new %08x old %08x\n", -+ obj, reloc->target_handle, -+ (int) reloc->offset, -+ reloc->write_domain, -+ target_obj->pending_write_domain); -+ goto err; -+ } - --#if WATCH_RELOC -- DRM_INFO("%s: obj %p offset %08x target %d " -- "read %08x write %08x gtt %08x " -- "presumed %08x delta %08x\n", -- __func__, -- obj, -- (int) reloc.offset, -- (int) reloc.target_handle, -- (int) reloc.read_domains, -- (int) reloc.write_domain, -- (int) target_offset, -- (int) reloc.presumed_offset, -- reloc.delta); --#endif -+ target_obj->pending_read_domains |= reloc->read_domains; -+ target_obj->pending_write_domain |= reloc->write_domain; - -- /* The target buffer should have appeared before us in the -- * exec_object list, so it should have a GTT space bound by now. -- */ -- if (target_offset == 0) { -- DRM_ERROR("No GTT space found for object %d\n", -- reloc.target_handle); -- ret = -EINVAL; -- break; -- } -+ /* If the relocation already has the right value in it, no -+ * more work needs to be done. -+ */ -+ if (target_offset == reloc->presumed_offset) -+ goto out; - -- /* Validate that the target is in a valid r/w GPU domain */ -- if (reloc.write_domain & (reloc.write_domain - 1)) { -- DRM_ERROR("reloc with multiple write domains: " -- "obj %p target %d offset %d " -- "read %08x write %08x", -- obj, reloc.target_handle, -- (int) reloc.offset, -- reloc.read_domains, -- reloc.write_domain); -- ret = -EINVAL; -- break; -- } -- if (reloc.write_domain & I915_GEM_DOMAIN_CPU || -- reloc.read_domains & I915_GEM_DOMAIN_CPU) { -- DRM_ERROR("reloc with read/write CPU domains: " -- "obj %p target %d offset %d " -- "read %08x write %08x", -- obj, reloc.target_handle, -- (int) reloc.offset, -- reloc.read_domains, -- reloc.write_domain); -- ret = -EINVAL; -- break; -- } -- if (reloc.write_domain && target_obj->pending_write_domain && -- reloc.write_domain != target_obj->pending_write_domain) { -- DRM_ERROR("Write domain conflict: " -- "obj %p target %d offset %d " -- "new %08x old %08x\n", -- obj, reloc.target_handle, -- (int) reloc.offset, -- reloc.write_domain, -- target_obj->pending_write_domain); -- ret = -EINVAL; -- break; -- } -+ /* Check that the relocation address is valid... */ -+ if (reloc->offset > obj->base.size - 4) { -+ DRM_ERROR("Relocation beyond object bounds: " -+ "obj %p target %d offset %d size %d.\n", -+ obj, reloc->target_handle, -+ (int) reloc->offset, -+ (int) obj->base.size); -+ goto err; -+ } -+ if (reloc->offset & 3) { -+ DRM_ERROR("Relocation not 4-byte aligned: " -+ "obj %p target %d offset %d.\n", -+ obj, reloc->target_handle, -+ (int) reloc->offset); -+ goto err; -+ } - -- target_obj->pending_read_domains |= reloc.read_domains; -- target_obj->pending_write_domain |= reloc.write_domain; -+ /* and points to somewhere within the target object. */ -+ if (reloc->delta >= target_obj->size) { -+ DRM_ERROR("Relocation beyond target object bounds: " -+ "obj %p target %d delta %d size %d.\n", -+ obj, reloc->target_handle, -+ (int) reloc->delta, -+ (int) target_obj->size); -+ goto err; -+ } - -- /* If the relocation already has the right value in it, no -- * more work needs to be done. -- */ -- if (target_offset == reloc.presumed_offset) -- continue; -+ reloc->delta += target_offset; -+ if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { -+ uint32_t page_offset = reloc->offset & ~PAGE_MASK; -+ char *vaddr; - -- /* Check that the relocation address is valid... */ -- if (reloc.offset > obj->base.size - 4) { -- DRM_ERROR("Relocation beyond object bounds: " -- "obj %p target %d offset %d size %d.\n", -- obj, reloc.target_handle, -- (int) reloc.offset, (int) obj->base.size); -- ret = -EINVAL; -- break; -- } -- if (reloc.offset & 3) { -- DRM_ERROR("Relocation not 4-byte aligned: " -- "obj %p target %d offset %d.\n", -- obj, reloc.target_handle, -- (int) reloc.offset); -- ret = -EINVAL; -- break; -- } -+ vaddr = kmap_atomic(obj->pages[reloc->offset >> PAGE_SHIFT]); -+ *(uint32_t *)(vaddr + page_offset) = reloc->delta; -+ kunmap_atomic(vaddr); -+ } else { -+ struct drm_i915_private *dev_priv = dev->dev_private; -+ uint32_t __iomem *reloc_entry; -+ void __iomem *reloc_page; - -- /* and points to somewhere within the target object. */ -- if (reloc.delta >= target_obj->size) { -- DRM_ERROR("Relocation beyond target object bounds: " -- "obj %p target %d delta %d size %d.\n", -- obj, reloc.target_handle, -- (int) reloc.delta, (int) target_obj->size); -- ret = -EINVAL; -- break; -- } -+ ret = i915_gem_object_set_to_gtt_domain(&obj->base, 1); -+ if (ret) -+ goto err; - -- reloc.delta += target_offset; -- if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { -- uint32_t page_offset = reloc.offset & ~PAGE_MASK; -- char *vaddr; -+ /* Map the page containing the relocation we're going to perform. */ -+ reloc->offset += obj->gtt_offset; -+ reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, -+ reloc->offset & PAGE_MASK); -+ reloc_entry = (uint32_t __iomem *) -+ (reloc_page + (reloc->offset & ~PAGE_MASK)); -+ iowrite32(reloc->delta, reloc_entry); -+ io_mapping_unmap_atomic(reloc_page); -+ } - -- vaddr = kmap_atomic(obj->pages[reloc.offset >> PAGE_SHIFT]); -- *(uint32_t *)(vaddr + page_offset) = reloc.delta; -- kunmap_atomic(vaddr); -- } else { -- uint32_t __iomem *reloc_entry; -- void __iomem *reloc_page; -+ /* and update the user's relocation entry */ -+ reloc->presumed_offset = target_offset; - -- ret = i915_gem_object_set_to_gtt_domain(&obj->base, 1); -- if (ret) -- break; -+out: -+ ret = 0; -+err: -+ drm_gem_object_unreference(target_obj); -+ return ret; -+} - -- /* Map the page containing the relocation we're going to perform. */ -- reloc.offset += obj->gtt_offset; -- reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, -- reloc.offset & PAGE_MASK); -- reloc_entry = (uint32_t __iomem *) -- (reloc_page + (reloc.offset & ~PAGE_MASK)); -- iowrite32(reloc.delta, reloc_entry); -- io_mapping_unmap_atomic(reloc_page); -- } -+static int -+i915_gem_execbuffer_relocate_object(struct drm_i915_gem_object *obj, -+ struct drm_file *file_priv, -+ struct drm_i915_gem_exec_object2 *entry) -+{ -+ struct drm_i915_gem_relocation_entry __user *user_relocs; -+ int i, ret; -+ -+ user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr; -+ for (i = 0; i < entry->relocation_count; i++) { -+ struct drm_i915_gem_relocation_entry reloc; -+ -+ if (__copy_from_user_inatomic(&reloc, -+ user_relocs+i, -+ sizeof(reloc))) -+ return -EFAULT; -+ -+ ret = i915_gem_execbuffer_relocate_entry(obj, file_priv, entry, &reloc); -+ if (ret) -+ return ret; - -- /* and update the user's relocation entry */ -- reloc.presumed_offset = target_offset; - if (__copy_to_user_inatomic(&user_relocs[i].presumed_offset, -- &reloc.presumed_offset, -- sizeof(reloc.presumed_offset))) { -- ret = -EFAULT; -- break; -- } -+ &reloc.presumed_offset, -+ sizeof(reloc.presumed_offset))) -+ return -EFAULT; - } - -- drm_gem_object_unreference(target_obj); -- return ret; -+ return 0; -+} -+ -+static int -+i915_gem_execbuffer_relocate_object_slow(struct drm_i915_gem_object *obj, -+ struct drm_file *file_priv, -+ struct drm_i915_gem_exec_object2 *entry, -+ struct drm_i915_gem_relocation_entry *relocs) -+{ -+ int i, ret; -+ -+ for (i = 0; i < entry->relocation_count; i++) { -+ ret = i915_gem_execbuffer_relocate_entry(obj, file_priv, entry, &relocs[i]); -+ if (ret) -+ return ret; -+ } -+ -+ return 0; - } - - static int --i915_gem_execbuffer_pin(struct drm_device *dev, -- struct drm_file *file, -- struct drm_gem_object **object_list, -- struct drm_i915_gem_exec_object2 *exec_list, -- int count) -+i915_gem_execbuffer_relocate(struct drm_device *dev, -+ struct drm_file *file, -+ struct drm_gem_object **object_list, -+ struct drm_i915_gem_exec_object2 *exec_list, -+ int count) -+{ -+ int i, ret; -+ -+ for (i = 0; i < count; i++) { -+ struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); -+ obj->base.pending_read_domains = 0; -+ obj->base.pending_write_domain = 0; -+ ret = i915_gem_execbuffer_relocate_object(obj, file, -+ &exec_list[i]); -+ if (ret) -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int -+i915_gem_execbuffer_reserve(struct drm_device *dev, -+ struct drm_file *file, -+ struct drm_gem_object **object_list, -+ struct drm_i915_gem_exec_object2 *exec_list, -+ int count) - { - struct drm_i915_private *dev_priv = dev->dev_private; - int ret, i, retry; -@@ -3502,6 +3533,87 @@ i915_gem_execbuffer_pin(struct drm_device *dev, - } - - static int -+i915_gem_execbuffer_relocate_slow(struct drm_device *dev, -+ struct drm_file *file, -+ struct drm_gem_object **object_list, -+ struct drm_i915_gem_exec_object2 *exec_list, -+ int count) -+{ -+ struct drm_i915_gem_relocation_entry *reloc; -+ int i, total, ret; -+ -+ for (i = 0; i < count; i++) { -+ struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); -+ obj->in_execbuffer = false; -+ } -+ -+ mutex_unlock(&dev->struct_mutex); -+ -+ total = 0; -+ for (i = 0; i < count; i++) -+ total += exec_list[i].relocation_count; -+ -+ reloc = drm_malloc_ab(total, sizeof(*reloc)); -+ if (reloc == NULL) { -+ mutex_lock(&dev->struct_mutex); -+ return -ENOMEM; -+ } -+ -+ total = 0; -+ for (i = 0; i < count; i++) { -+ struct drm_i915_gem_relocation_entry __user *user_relocs; -+ -+ user_relocs = (void __user *)(uintptr_t)exec_list[i].relocs_ptr; -+ -+ if (copy_from_user(reloc+total, user_relocs, -+ exec_list[i].relocation_count * -+ sizeof(*reloc))) { -+ ret = -EFAULT; -+ mutex_lock(&dev->struct_mutex); -+ goto err; -+ } -+ -+ total += exec_list[i].relocation_count; -+ } -+ -+ ret = i915_mutex_lock_interruptible(dev); -+ if (ret) { -+ mutex_lock(&dev->struct_mutex); -+ goto err; -+ } -+ -+ ret = i915_gem_execbuffer_reserve(dev, file, -+ object_list, exec_list, -+ count); -+ if (ret) -+ goto err; -+ -+ total = 0; -+ for (i = 0; i < count; i++) { -+ struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); -+ obj->base.pending_read_domains = 0; -+ obj->base.pending_write_domain = 0; -+ ret = i915_gem_execbuffer_relocate_object_slow(obj, file, -+ &exec_list[i], -+ reloc + total); -+ if (ret) -+ goto err; -+ -+ total += exec_list[i].relocation_count; -+ } -+ -+ /* Leave the user relocations as are, this is the painfully slow path, -+ * and we want to avoid the complication of dropping the lock whilst -+ * having buffers reserved in the aperture and so causing spurious -+ * ENOSPC for random operations. -+ */ -+ -+err: -+ drm_free_large(reloc); -+ return ret; -+} -+ -+static int - i915_gem_execbuffer_move_to_gpu(struct drm_device *dev, - struct drm_file *file, - struct intel_ring_buffer *ring, -@@ -3630,8 +3742,15 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec, - - for (i = 0; i < count; i++) { - char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr; -- size_t length = exec[i].relocation_count * sizeof(struct drm_i915_gem_relocation_entry); -+ int length; /* limited by fault_in_pages_readable() */ -+ -+ /* First check for malicious input causing overflow */ -+ if (exec[i].relocation_count > -+ INT_MAX / sizeof(struct drm_i915_gem_relocation_entry)) -+ return -EINVAL; - -+ length = exec[i].relocation_count * -+ sizeof(struct drm_i915_gem_relocation_entry); - if (!access_ok(VERIFY_READ, ptr, length)) - return -EFAULT; - -@@ -3774,18 +3893,24 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, - } - - /* Move the objects en-masse into the GTT, evicting if necessary. */ -- ret = i915_gem_execbuffer_pin(dev, file, -- object_list, exec_list, -- args->buffer_count); -+ ret = i915_gem_execbuffer_reserve(dev, file, -+ object_list, exec_list, -+ args->buffer_count); - if (ret) - goto err; - - /* The objects are in their final locations, apply the relocations. */ -- for (i = 0; i < args->buffer_count; i++) { -- struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); -- obj->base.pending_read_domains = 0; -- obj->base.pending_write_domain = 0; -- ret = i915_gem_execbuffer_relocate(obj, file, &exec_list[i]); -+ ret = i915_gem_execbuffer_relocate(dev, file, -+ object_list, exec_list, -+ args->buffer_count); -+ if (ret) { -+ if (ret == -EFAULT) { -+ ret = i915_gem_execbuffer_relocate_slow(dev, file, -+ object_list, -+ exec_list, -+ args->buffer_count); -+ BUG_ON(!mutex_is_locked(&dev->struct_mutex)); -+ } - if (ret) - goto err; - } -diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c -index 454c064..42729d2 100644 ---- a/drivers/gpu/drm/i915/i915_suspend.c -+++ b/drivers/gpu/drm/i915/i915_suspend.c -@@ -239,6 +239,16 @@ static void i915_save_modeset_reg(struct drm_device *dev) - if (drm_core_check_feature(dev, DRIVER_MODESET)) - return; - -+ /* Cursor state */ -+ dev_priv->saveCURACNTR = I915_READ(CURACNTR); -+ dev_priv->saveCURAPOS = I915_READ(CURAPOS); -+ dev_priv->saveCURABASE = I915_READ(CURABASE); -+ dev_priv->saveCURBCNTR = I915_READ(CURBCNTR); -+ dev_priv->saveCURBPOS = I915_READ(CURBPOS); -+ dev_priv->saveCURBBASE = I915_READ(CURBBASE); -+ if (IS_GEN2(dev)) -+ dev_priv->saveCURSIZE = I915_READ(CURSIZE); -+ - if (HAS_PCH_SPLIT(dev)) { - dev_priv->savePCH_DREF_CONTROL = I915_READ(PCH_DREF_CONTROL); - dev_priv->saveDISP_ARB_CTL = I915_READ(DISP_ARB_CTL); -@@ -529,6 +539,16 @@ static void i915_restore_modeset_reg(struct drm_device *dev) - I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); - I915_WRITE(DSPBADDR, I915_READ(DSPBADDR)); - -+ /* Cursor state */ -+ I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); -+ I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); -+ I915_WRITE(CURABASE, dev_priv->saveCURABASE); -+ I915_WRITE(CURBPOS, dev_priv->saveCURBPOS); -+ I915_WRITE(CURBCNTR, dev_priv->saveCURBCNTR); -+ I915_WRITE(CURBBASE, dev_priv->saveCURBBASE); -+ if (IS_GEN2(dev)) -+ I915_WRITE(CURSIZE, dev_priv->saveCURSIZE); -+ - return; - } - -@@ -543,16 +563,6 @@ void i915_save_display(struct drm_device *dev) - /* Don't save them in KMS mode */ - i915_save_modeset_reg(dev); - -- /* Cursor state */ -- dev_priv->saveCURACNTR = I915_READ(CURACNTR); -- dev_priv->saveCURAPOS = I915_READ(CURAPOS); -- dev_priv->saveCURABASE = I915_READ(CURABASE); -- dev_priv->saveCURBCNTR = I915_READ(CURBCNTR); -- dev_priv->saveCURBPOS = I915_READ(CURBPOS); -- dev_priv->saveCURBBASE = I915_READ(CURBBASE); -- if (IS_GEN2(dev)) -- dev_priv->saveCURSIZE = I915_READ(CURSIZE); -- - /* CRT state */ - if (HAS_PCH_SPLIT(dev)) { - dev_priv->saveADPA = I915_READ(PCH_ADPA); -@@ -657,16 +667,6 @@ void i915_restore_display(struct drm_device *dev) - /* Don't restore them in KMS mode */ - i915_restore_modeset_reg(dev); - -- /* Cursor state */ -- I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); -- I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); -- I915_WRITE(CURABASE, dev_priv->saveCURABASE); -- I915_WRITE(CURBPOS, dev_priv->saveCURBPOS); -- I915_WRITE(CURBCNTR, dev_priv->saveCURBCNTR); -- I915_WRITE(CURBBASE, dev_priv->saveCURBBASE); -- if (IS_GEN2(dev)) -- I915_WRITE(CURSIZE, dev_priv->saveCURSIZE); -- - /* CRT state */ - if (HAS_PCH_SPLIT(dev)) - I915_WRITE(PCH_ADPA, dev_priv->saveADPA); -diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c -index bee24b1..255b52e 100644 ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -5336,9 +5336,14 @@ static void intel_setup_outputs(struct drm_device *dev) - struct drm_i915_private *dev_priv = dev->dev_private; - struct intel_encoder *encoder; - bool dpd_is_edp = false; -+ bool has_lvds = false; - - if (IS_MOBILE(dev) && !IS_I830(dev)) -- intel_lvds_init(dev); -+ has_lvds = intel_lvds_init(dev); -+ if (!has_lvds && !HAS_PCH_SPLIT(dev)) { -+ /* disable the panel fitter on everything but LVDS */ -+ I915_WRITE(PFIT_CONTROL, 0); -+ } - - if (HAS_PCH_SPLIT(dev)) { - dpd_is_edp = intel_dpd_is_edp(dev); -diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c -index c8e0055..2e3db37 100644 ---- a/drivers/gpu/drm/i915/intel_dp.c -+++ b/drivers/gpu/drm/i915/intel_dp.c -@@ -584,17 +584,6 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, - mode->clock = dev_priv->panel_fixed_mode->clock; - } - -- /* Just use VBT values for eDP */ -- if (is_edp(intel_dp)) { -- intel_dp->lane_count = dev_priv->edp.lanes; -- intel_dp->link_bw = dev_priv->edp.rate; -- adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); -- DRM_DEBUG_KMS("eDP link bw %02x lane count %d clock %d\n", -- intel_dp->link_bw, intel_dp->lane_count, -- adjusted_mode->clock); -- return true; -- } -- - for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { - for (clock = 0; clock <= max_clock; clock++) { - int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); -@@ -613,6 +602,19 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, - } - } - -+ if (is_edp(intel_dp)) { -+ /* okay we failed just pick the highest */ -+ intel_dp->lane_count = max_lane_count; -+ intel_dp->link_bw = bws[max_clock]; -+ adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); -+ DRM_DEBUG_KMS("Force picking display port link bw %02x lane " -+ "count %d clock %d\n", -+ intel_dp->link_bw, intel_dp->lane_count, -+ adjusted_mode->clock); -+ -+ return true; -+ } -+ - return false; - } - -@@ -793,7 +795,8 @@ static bool ironlake_edp_panel_on (struct intel_dp *intel_dp) - { - struct drm_device *dev = intel_dp->base.base.dev; - struct drm_i915_private *dev_priv = dev->dev_private; -- u32 pp, idle_on_mask = PP_ON | PP_SEQUENCE_STATE_ON_IDLE; -+ u32 pp, idle_on = PP_ON | PP_SEQUENCE_STATE_ON_IDLE; -+ u32 idle_on_mask = PP_ON | PP_SEQUENCE_STATE_MASK; - - if (I915_READ(PCH_PP_STATUS) & PP_ON) - return true; -@@ -814,7 +817,7 @@ static bool ironlake_edp_panel_on (struct intel_dp *intel_dp) - */ - msleep(300); - -- if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on_mask, -+ if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on, - 5000)) - DRM_ERROR("panel on wait timed out: 0x%08x\n", - I915_READ(PCH_PP_STATUS)); -@@ -920,6 +923,7 @@ static void intel_dp_prepare(struct drm_encoder *encoder) - - if (is_edp(intel_dp)) { - ironlake_edp_backlight_off(dev); -+ ironlake_edp_panel_off(dev); - ironlake_edp_panel_on(intel_dp); - if (!is_pch_edp(intel_dp)) - ironlake_edp_pll_on(encoder); -@@ -1087,21 +1091,11 @@ intel_get_adjust_train(struct intel_dp *intel_dp) - } - - static uint32_t --intel_dp_signal_levels(struct intel_dp *intel_dp) -+intel_dp_signal_levels(uint8_t train_set, int lane_count) - { -- struct drm_device *dev = intel_dp->base.base.dev; -- struct drm_i915_private *dev_priv = dev->dev_private; -- uint32_t signal_levels = 0; -- u8 train_set = intel_dp->train_set[0]; -- u32 vswing = train_set & DP_TRAIN_VOLTAGE_SWING_MASK; -- u32 preemphasis = train_set & DP_TRAIN_PRE_EMPHASIS_MASK; -+ uint32_t signal_levels = 0; - -- if (is_edp(intel_dp)) { -- vswing = dev_priv->edp.vswing; -- preemphasis = dev_priv->edp.preemphasis; -- } -- -- switch (vswing) { -+ switch (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) { - case DP_TRAIN_VOLTAGE_SWING_400: - default: - signal_levels |= DP_VOLTAGE_0_4; -@@ -1116,7 +1110,7 @@ intel_dp_signal_levels(struct intel_dp *intel_dp) - signal_levels |= DP_VOLTAGE_1_2; - break; - } -- switch (preemphasis) { -+ switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { - case DP_TRAIN_PRE_EMPHASIS_0: - default: - signal_levels |= DP_PRE_EMPHASIS_0; -@@ -1203,18 +1197,6 @@ intel_channel_eq_ok(struct intel_dp *intel_dp) - } - - static bool --intel_dp_aux_handshake_required(struct intel_dp *intel_dp) --{ -- struct drm_device *dev = intel_dp->base.base.dev; -- struct drm_i915_private *dev_priv = dev->dev_private; -- -- if (is_edp(intel_dp) && dev_priv->no_aux_handshake) -- return false; -- -- return true; --} -- --static bool - intel_dp_set_link_train(struct intel_dp *intel_dp, - uint32_t dp_reg_value, - uint8_t dp_train_pat) -@@ -1226,9 +1208,6 @@ intel_dp_set_link_train(struct intel_dp *intel_dp, - I915_WRITE(intel_dp->output_reg, dp_reg_value); - POSTING_READ(intel_dp->output_reg); - -- if (!intel_dp_aux_handshake_required(intel_dp)) -- return true; -- - intel_dp_aux_native_write_1(intel_dp, - DP_TRAINING_PATTERN_SET, - dp_train_pat); -@@ -1261,11 +1240,10 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) - POSTING_READ(intel_dp->output_reg); - intel_wait_for_vblank(dev, intel_crtc->pipe); - -- if (intel_dp_aux_handshake_required(intel_dp)) -- /* Write the link configuration data */ -- intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, -- intel_dp->link_configuration, -- DP_LINK_CONFIGURATION_SIZE); -+ /* Write the link configuration data */ -+ intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, -+ intel_dp->link_configuration, -+ DP_LINK_CONFIGURATION_SIZE); - - DP |= DP_PORT_EN; - if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) -@@ -1283,7 +1261,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) - signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); - DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; - } else { -- signal_levels = intel_dp_signal_levels(intel_dp); -+ signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); - DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; - } - -@@ -1297,37 +1275,33 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) - break; - /* Set training pattern 1 */ - -- udelay(500); -- if (intel_dp_aux_handshake_required(intel_dp)) { -+ udelay(100); -+ if (!intel_dp_get_link_status(intel_dp)) - break; -- } else { -- if (!intel_dp_get_link_status(intel_dp)) -- break; - -- if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { -- clock_recovery = true; -- break; -- } -+ if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { -+ clock_recovery = true; -+ break; -+ } - -- /* Check to see if we've tried the max voltage */ -- for (i = 0; i < intel_dp->lane_count; i++) -- if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) -- break; -- if (i == intel_dp->lane_count) -+ /* Check to see if we've tried the max voltage */ -+ for (i = 0; i < intel_dp->lane_count; i++) -+ if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) - break; -+ if (i == intel_dp->lane_count) -+ break; - -- /* Check to see if we've tried the same voltage 5 times */ -- if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { -- ++tries; -- if (tries == 5) -- break; -- } else -- tries = 0; -- voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; -+ /* Check to see if we've tried the same voltage 5 times */ -+ if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { -+ ++tries; -+ if (tries == 5) -+ break; -+ } else -+ tries = 0; -+ voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; - -- /* Compute new intel_dp->train_set as requested by target */ -- intel_get_adjust_train(intel_dp); -- } -+ /* Compute new intel_dp->train_set as requested by target */ -+ intel_get_adjust_train(intel_dp); - } - - intel_dp->DP = DP; -@@ -1354,7 +1328,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) - signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); - DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; - } else { -- signal_levels = intel_dp_signal_levels(intel_dp); -+ signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); - DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; - } - -@@ -1368,28 +1342,24 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) - DP_TRAINING_PATTERN_2)) - break; - -- udelay(500); -- -- if (!intel_dp_aux_handshake_required(intel_dp)) { -+ udelay(400); -+ if (!intel_dp_get_link_status(intel_dp)) - break; -- } else { -- if (!intel_dp_get_link_status(intel_dp)) -- break; - -- if (intel_channel_eq_ok(intel_dp)) { -- channel_eq = true; -- break; -- } -+ if (intel_channel_eq_ok(intel_dp)) { -+ channel_eq = true; -+ break; -+ } - -- /* Try 5 times */ -- if (tries > 5) -- break; -+ /* Try 5 times */ -+ if (tries > 5) -+ break; - -- /* Compute new intel_dp->train_set as requested by target */ -- intel_get_adjust_train(intel_dp); -- ++tries; -- } -+ /* Compute new intel_dp->train_set as requested by target */ -+ intel_get_adjust_train(intel_dp); -+ ++tries; - } -+ - if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) - reg = DP | DP_LINK_TRAIN_OFF_CPT; - else -diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h -index 21551fe..e52c612 100644 ---- a/drivers/gpu/drm/i915/intel_drv.h -+++ b/drivers/gpu/drm/i915/intel_drv.h -@@ -237,7 +237,7 @@ extern bool intel_sdvo_init(struct drm_device *dev, int output_device); - extern void intel_dvo_init(struct drm_device *dev); - extern void intel_tv_init(struct drm_device *dev); - extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); --extern void intel_lvds_init(struct drm_device *dev); -+extern bool intel_lvds_init(struct drm_device *dev); - extern void intel_dp_init(struct drm_device *dev, int dp_reg); - void - intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, -diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c -index 4324a32..f79327f 100644 ---- a/drivers/gpu/drm/i915/intel_lvds.c -+++ b/drivers/gpu/drm/i915/intel_lvds.c -@@ -837,7 +837,7 @@ static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin) - * Create the connector, register the LVDS DDC bus, and try to figure out what - * modes we can display on the LVDS panel (if present). - */ --void intel_lvds_init(struct drm_device *dev) -+bool intel_lvds_init(struct drm_device *dev) - { - struct drm_i915_private *dev_priv = dev->dev_private; - struct intel_lvds *intel_lvds; -@@ -853,37 +853,37 @@ void intel_lvds_init(struct drm_device *dev) - - /* Skip init on machines we know falsely report LVDS */ - if (dmi_check_system(intel_no_lvds)) -- return; -+ return false; - - pin = GMBUS_PORT_PANEL; - if (!lvds_is_present_in_vbt(dev, &pin)) { - DRM_DEBUG_KMS("LVDS is not present in VBT\n"); -- return; -+ return false; - } - - if (HAS_PCH_SPLIT(dev)) { - if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) -- return; -+ return false; - if (dev_priv->edp.support) { - DRM_DEBUG_KMS("disable LVDS for eDP support\n"); -- return; -+ return false; - } - } - - if (!intel_lvds_ddc_probe(dev, pin)) { - DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); -- return; -+ return false; - } - - intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); - if (!intel_lvds) { -- return; -+ return false; - } - - intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); - if (!intel_connector) { - kfree(intel_lvds); -- return; -+ return false; - } - - if (!HAS_PCH_SPLIT(dev)) { -@@ -1026,7 +1026,7 @@ out: - /* keep the LVDS connector */ - dev_priv->int_lvds_connector = connector; - drm_sysfs_connector_add(connector); -- return; -+ return true; - - failed: - DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); -@@ -1034,4 +1034,5 @@ failed: - drm_encoder_cleanup(encoder); - kfree(intel_lvds); - kfree(intel_connector); -+ return false; - } -diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c -index de158b7..d97e6cb 100644 ---- a/drivers/gpu/drm/i915/intel_sdvo.c -+++ b/drivers/gpu/drm/i915/intel_sdvo.c -@@ -107,7 +107,8 @@ struct intel_sdvo { - * This is set if we treat the device as HDMI, instead of DVI. - */ - bool is_hdmi; -- bool has_audio; -+ bool has_hdmi_monitor; -+ bool has_hdmi_audio; - - /** - * This is set if we detect output of sdvo device as LVDS and -@@ -1023,7 +1024,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, - if (!intel_sdvo_set_target_input(intel_sdvo)) - return; - -- if (intel_sdvo->is_hdmi && -+ if (intel_sdvo->has_hdmi_monitor && - !intel_sdvo_set_avi_infoframe(intel_sdvo)) - return; - -@@ -1063,7 +1064,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, - } - if (intel_crtc->pipe == 1) - sdvox |= SDVO_PIPE_B_SELECT; -- if (intel_sdvo->has_audio) -+ if (intel_sdvo->has_hdmi_audio) - sdvox |= SDVO_AUDIO_ENABLE; - - if (INTEL_INFO(dev)->gen >= 4) { -@@ -1295,55 +1296,14 @@ intel_sdvo_get_edid(struct drm_connector *connector) - return drm_get_edid(connector, &sdvo->ddc); - } - --static struct drm_connector * --intel_find_analog_connector(struct drm_device *dev) --{ -- struct drm_connector *connector; -- struct intel_sdvo *encoder; -- -- list_for_each_entry(encoder, -- &dev->mode_config.encoder_list, -- base.base.head) { -- if (encoder->base.type == INTEL_OUTPUT_ANALOG) { -- list_for_each_entry(connector, -- &dev->mode_config.connector_list, -- head) { -- if (&encoder->base == -- intel_attached_encoder(connector)) -- return connector; -- } -- } -- } -- -- return NULL; --} -- --static int --intel_analog_is_connected(struct drm_device *dev) --{ -- struct drm_connector *analog_connector; -- -- analog_connector = intel_find_analog_connector(dev); -- if (!analog_connector) -- return false; -- -- if (analog_connector->funcs->detect(analog_connector, false) == -- connector_status_disconnected) -- return false; -- -- return true; --} -- - /* Mac mini hack -- use the same DDC as the analog connector */ - static struct edid * - intel_sdvo_get_analog_edid(struct drm_connector *connector) - { - struct drm_i915_private *dev_priv = connector->dev->dev_private; - -- if (!intel_analog_is_connected(connector->dev)) -- return NULL; -- -- return drm_get_edid(connector, &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); -+ return drm_get_edid(connector, -+ &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); - } - - enum drm_connector_status -@@ -1388,8 +1348,10 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) - /* DDC bus is shared, match EDID to connector type */ - if (edid->input & DRM_EDID_INPUT_DIGITAL) { - status = connector_status_connected; -- intel_sdvo->is_hdmi = drm_detect_hdmi_monitor(edid); -- intel_sdvo->has_audio = drm_detect_monitor_audio(edid); -+ if (intel_sdvo->is_hdmi) { -+ intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid); -+ intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid); -+ } - } - connector->display_info.raw_edid = NULL; - kfree(edid); -@@ -1398,7 +1360,7 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) - if (status == connector_status_connected) { - struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); - if (intel_sdvo_connector->force_audio) -- intel_sdvo->has_audio = intel_sdvo_connector->force_audio > 0; -+ intel_sdvo->has_hdmi_audio = intel_sdvo_connector->force_audio > 0; - } - - return status; -@@ -1415,10 +1377,12 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) - if (!intel_sdvo_write_cmd(intel_sdvo, - SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0)) - return connector_status_unknown; -- if (intel_sdvo->is_tv) { -- /* add 30ms delay when the output type is SDVO-TV */ -+ -+ /* add 30ms delay when the output type might be TV */ -+ if (intel_sdvo->caps.output_flags & -+ (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_CVBS0)) - mdelay(30); -- } -+ - if (!intel_sdvo_read_response(intel_sdvo, &response, 2)) - return connector_status_unknown; - -@@ -1472,8 +1436,10 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) - edid = intel_sdvo_get_analog_edid(connector); - - if (edid != NULL) { -- drm_mode_connector_update_edid_property(connector, edid); -- drm_add_edid_modes(connector, edid); -+ if (edid->input & DRM_EDID_INPUT_DIGITAL) { -+ drm_mode_connector_update_edid_property(connector, edid); -+ drm_add_edid_modes(connector, edid); -+ } - connector->display_info.raw_edid = NULL; - kfree(edid); - } -@@ -1713,12 +1679,12 @@ intel_sdvo_set_property(struct drm_connector *connector, - - intel_sdvo_connector->force_audio = val; - -- if (val > 0 && intel_sdvo->has_audio) -+ if (val > 0 && intel_sdvo->has_hdmi_audio) - return 0; -- if (val < 0 && !intel_sdvo->has_audio) -+ if (val < 0 && !intel_sdvo->has_hdmi_audio) - return 0; - -- intel_sdvo->has_audio = val > 0; -+ intel_sdvo->has_hdmi_audio = val > 0; - goto done; - } - -@@ -2070,6 +2036,8 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) - intel_sdvo_set_colorimetry(intel_sdvo, - SDVO_COLORIMETRY_RGB256); - connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; -+ -+ intel_sdvo_add_hdmi_properties(intel_sdvo_connector); - intel_sdvo->is_hdmi = true; - } - intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | -@@ -2077,8 +2045,6 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) - - intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); - -- intel_sdvo_add_hdmi_properties(intel_sdvo_connector); -- - return true; - } - -diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c -index 8e421f6..05efb5b 100644 ---- a/drivers/gpu/drm/radeon/atom.c -+++ b/drivers/gpu/drm/radeon/atom.c -@@ -112,6 +112,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base, - base += 3; - break; - case ATOM_IIO_WRITE: -+ (void)ctx->card->ioreg_read(ctx->card, CU16(base + 1)); - ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); - base += 3; - break; -diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c -index 9bebac1..0f90fc3 100644 ---- a/drivers/gpu/drm/radeon/r600_cs.c -+++ b/drivers/gpu/drm/radeon/r600_cs.c -@@ -315,7 +315,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) - if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { - /* the initial DDX does bad things with the CB size occasionally */ - /* it rounds up height too far for slice tile max but the BO is smaller */ -- tmp = (height - 7) * pitch * bpe; -+ tmp = (height - 7) * 8 * bpe; - if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { - dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); - return -EINVAL; -diff --git a/drivers/gpu/drm/radeon/r600_reg.h b/drivers/gpu/drm/radeon/r600_reg.h -index d84612a..33cda01 100644 ---- a/drivers/gpu/drm/radeon/r600_reg.h -+++ b/drivers/gpu/drm/radeon/r600_reg.h -@@ -86,6 +86,7 @@ - #define R600_HDP_NONSURFACE_BASE 0x2c04 - - #define R600_BUS_CNTL 0x5420 -+# define R600_BIOS_ROM_DIS (1 << 1) - #define R600_CONFIG_CNTL 0x5424 - #define R600_CONFIG_MEMSIZE 0x5428 - #define R600_CONFIG_F0_BASE 0x542C -diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c -index 87ead09..bc5a2c3 100644 ---- a/drivers/gpu/drm/radeon/radeon_atombios.c -+++ b/drivers/gpu/drm/radeon/radeon_atombios.c -@@ -98,6 +98,14 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_dev - } - } - -+ /* some DCE3 boards have bad data for this entry */ -+ if (ASIC_IS_DCE3(rdev)) { -+ if ((i == 4) && -+ (gpio->usClkMaskRegisterIndex == 0x1fda) && -+ (gpio->sucI2cId.ucAccess == 0x94)) -+ gpio->sucI2cId.ucAccess = 0x14; -+ } -+ - if (gpio->sucI2cId.ucAccess == id) { - i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; - i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; -@@ -174,6 +182,14 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev) - } - } - -+ /* some DCE3 boards have bad data for this entry */ -+ if (ASIC_IS_DCE3(rdev)) { -+ if ((i == 4) && -+ (gpio->usClkMaskRegisterIndex == 0x1fda) && -+ (gpio->sucI2cId.ucAccess == 0x94)) -+ gpio->sucI2cId.ucAccess = 0x14; -+ } -+ - i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; - i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; - i2c.en_clk_reg = le16_to_cpu(gpio->usClkEnRegisterIndex) * 4; -diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c -index 654787e..8f2c7b5 100644 ---- a/drivers/gpu/drm/radeon/radeon_bios.c -+++ b/drivers/gpu/drm/radeon/radeon_bios.c -@@ -130,6 +130,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) - } - return true; - } -+ - static bool r700_read_disabled_bios(struct radeon_device *rdev) - { - uint32_t viph_control; -@@ -143,7 +144,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) - bool r; - - viph_control = RREG32(RADEON_VIPH_CONTROL); -- bus_cntl = RREG32(RADEON_BUS_CNTL); -+ bus_cntl = RREG32(R600_BUS_CNTL); - d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); - d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); - vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); -@@ -152,7 +153,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) - /* disable VIP */ - WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); - /* enable the rom */ -- WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); -+ WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); - /* Disable VGA mode */ - WREG32(AVIVO_D1VGA_CONTROL, - (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | -@@ -191,7 +192,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) - cg_spll_status = RREG32(R600_CG_SPLL_STATUS); - } - WREG32(RADEON_VIPH_CONTROL, viph_control); -- WREG32(RADEON_BUS_CNTL, bus_cntl); -+ WREG32(R600_BUS_CNTL, bus_cntl); - WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); - WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); - WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); -@@ -216,7 +217,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) - bool r; - - viph_control = RREG32(RADEON_VIPH_CONTROL); -- bus_cntl = RREG32(RADEON_BUS_CNTL); -+ bus_cntl = RREG32(R600_BUS_CNTL); - d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); - d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); - vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); -@@ -231,7 +232,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) - /* disable VIP */ - WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); - /* enable the rom */ -- WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); -+ WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); - /* Disable VGA mode */ - WREG32(AVIVO_D1VGA_CONTROL, - (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | -@@ -262,7 +263,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) - - /* restore regs */ - WREG32(RADEON_VIPH_CONTROL, viph_control); -- WREG32(RADEON_BUS_CNTL, bus_cntl); -+ WREG32(R600_BUS_CNTL, bus_cntl); - WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); - WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); - WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); -diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c -index 3bddea5..137b807 100644 ---- a/drivers/gpu/drm/radeon/radeon_combios.c -+++ b/drivers/gpu/drm/radeon/radeon_combios.c -@@ -729,7 +729,7 @@ void radeon_combios_i2c_init(struct radeon_device *rdev) - clk = RBIOS8(offset + 3 + (i * 5) + 3); - data = RBIOS8(offset + 3 + (i * 5) + 4); - i2c = combios_setup_i2c_bus(rdev, DDC_MONID, -- clk, data); -+ (1 << clk), (1 << data)); - rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "GPIOPAD_MASK"); - break; - } -diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c -index 3bef9f6..8afaf7a 100644 ---- a/drivers/gpu/drm/radeon/radeon_connectors.c -+++ b/drivers/gpu/drm/radeon/radeon_connectors.c -@@ -1175,6 +1175,8 @@ radeon_add_atom_connector(struct drm_device *dev, - /* no HPD on analog connectors */ - radeon_connector->hpd.hpd = RADEON_HPD_NONE; - connector->polled = DRM_CONNECTOR_POLL_CONNECT; -+ connector->interlace_allowed = true; -+ connector->doublescan_allowed = true; - break; - case DRM_MODE_CONNECTOR_DVIA: - drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); -@@ -1190,6 +1192,8 @@ radeon_add_atom_connector(struct drm_device *dev, - 1); - /* no HPD on analog connectors */ - radeon_connector->hpd.hpd = RADEON_HPD_NONE; -+ connector->interlace_allowed = true; -+ connector->doublescan_allowed = true; - break; - case DRM_MODE_CONNECTOR_DVII: - case DRM_MODE_CONNECTOR_DVID: -@@ -1226,6 +1230,11 @@ radeon_add_atom_connector(struct drm_device *dev, - rdev->mode_info.load_detect_property, - 1); - } -+ connector->interlace_allowed = true; -+ if (connector_type == DRM_MODE_CONNECTOR_DVII) -+ connector->doublescan_allowed = true; -+ else -+ connector->doublescan_allowed = false; - break; - case DRM_MODE_CONNECTOR_HDMIA: - case DRM_MODE_CONNECTOR_HDMIB: -@@ -1256,6 +1265,11 @@ radeon_add_atom_connector(struct drm_device *dev, - 0); - } - subpixel_order = SubPixelHorizontalRGB; -+ connector->interlace_allowed = true; -+ if (connector_type == DRM_MODE_CONNECTOR_HDMIB) -+ connector->doublescan_allowed = true; -+ else -+ connector->doublescan_allowed = false; - break; - case DRM_MODE_CONNECTOR_DisplayPort: - case DRM_MODE_CONNECTOR_eDP: -@@ -1293,6 +1307,9 @@ radeon_add_atom_connector(struct drm_device *dev, - rdev->mode_info.underscan_vborder_property, - 0); - } -+ connector->interlace_allowed = true; -+ /* in theory with a DP to VGA converter... */ -+ connector->doublescan_allowed = false; - break; - case DRM_MODE_CONNECTOR_SVIDEO: - case DRM_MODE_CONNECTOR_Composite: -@@ -1308,6 +1325,8 @@ radeon_add_atom_connector(struct drm_device *dev, - radeon_atombios_get_tv_info(rdev)); - /* no HPD on analog connectors */ - radeon_connector->hpd.hpd = RADEON_HPD_NONE; -+ connector->interlace_allowed = false; -+ connector->doublescan_allowed = false; - break; - case DRM_MODE_CONNECTOR_LVDS: - radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); -@@ -1326,6 +1345,8 @@ radeon_add_atom_connector(struct drm_device *dev, - dev->mode_config.scaling_mode_property, - DRM_MODE_SCALE_FULLSCREEN); - subpixel_order = SubPixelHorizontalRGB; -+ connector->interlace_allowed = false; -+ connector->doublescan_allowed = false; - break; - } - -@@ -1403,6 +1424,8 @@ radeon_add_legacy_connector(struct drm_device *dev, - /* no HPD on analog connectors */ - radeon_connector->hpd.hpd = RADEON_HPD_NONE; - connector->polled = DRM_CONNECTOR_POLL_CONNECT; -+ connector->interlace_allowed = true; -+ connector->doublescan_allowed = true; - break; - case DRM_MODE_CONNECTOR_DVIA: - drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); -@@ -1418,6 +1441,8 @@ radeon_add_legacy_connector(struct drm_device *dev, - 1); - /* no HPD on analog connectors */ - radeon_connector->hpd.hpd = RADEON_HPD_NONE; -+ connector->interlace_allowed = true; -+ connector->doublescan_allowed = true; - break; - case DRM_MODE_CONNECTOR_DVII: - case DRM_MODE_CONNECTOR_DVID: -@@ -1435,6 +1460,11 @@ radeon_add_legacy_connector(struct drm_device *dev, - 1); - } - subpixel_order = SubPixelHorizontalRGB; -+ connector->interlace_allowed = true; -+ if (connector_type == DRM_MODE_CONNECTOR_DVII) -+ connector->doublescan_allowed = true; -+ else -+ connector->doublescan_allowed = false; - break; - case DRM_MODE_CONNECTOR_SVIDEO: - case DRM_MODE_CONNECTOR_Composite: -@@ -1457,6 +1487,8 @@ radeon_add_legacy_connector(struct drm_device *dev, - radeon_combios_get_tv_info(rdev)); - /* no HPD on analog connectors */ - radeon_connector->hpd.hpd = RADEON_HPD_NONE; -+ connector->interlace_allowed = false; -+ connector->doublescan_allowed = false; - break; - case DRM_MODE_CONNECTOR_LVDS: - drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); -@@ -1470,6 +1502,8 @@ radeon_add_legacy_connector(struct drm_device *dev, - dev->mode_config.scaling_mode_property, - DRM_MODE_SCALE_FULLSCREEN); - subpixel_order = SubPixelHorizontalRGB; -+ connector->interlace_allowed = false; -+ connector->doublescan_allowed = false; - break; - } - diff --git a/drm-intel-edp-fixes.patch b/drm-intel-edp-fixes.patch new file mode 100644 index 000000000..c77ef116c --- /dev/null +++ b/drm-intel-edp-fixes.patch @@ -0,0 +1,44 @@ +diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c +index f737960..b1f8164 100644 +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -509,6 +509,8 @@ i915_pci_remove(struct pci_dev *pdev) + { + struct drm_device *dev = pci_get_drvdata(pdev); + ++ pci_disable_device(pdev); /* core did previous enable */ ++ + drm_put_dev(dev); + } + +diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c +index 300f64b..2e3db37 100644 +--- a/drivers/gpu/drm/i915/intel_dp.c ++++ b/drivers/gpu/drm/i915/intel_dp.c +@@ -795,7 +795,8 @@ static bool ironlake_edp_panel_on (struct intel_dp *intel_dp) + { + struct drm_device *dev = intel_dp->base.base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; +- u32 pp, idle_on_mask = PP_ON | PP_SEQUENCE_STATE_ON_IDLE; ++ u32 pp, idle_on = PP_ON | PP_SEQUENCE_STATE_ON_IDLE; ++ u32 idle_on_mask = PP_ON | PP_SEQUENCE_STATE_MASK; + + if (I915_READ(PCH_PP_STATUS) & PP_ON) + return true; +@@ -816,7 +817,7 @@ static bool ironlake_edp_panel_on (struct intel_dp *intel_dp) + */ + msleep(300); + +- if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on_mask, ++ if (wait_for((I915_READ(PCH_PP_STATUS) & idle_on_mask) == idle_on, + 5000)) + DRM_ERROR("panel on wait timed out: 0x%08x\n", + I915_READ(PCH_PP_STATUS)); +@@ -922,6 +923,7 @@ static void intel_dp_prepare(struct drm_encoder *encoder) + + if (is_edp(intel_dp)) { + ironlake_edp_backlight_off(dev); ++ ironlake_edp_panel_off(dev); + ironlake_edp_panel_on(intel_dp); + if (!is_pch_edp(intel_dp)) + ironlake_edp_pll_on(encoder); diff --git a/kernel.spec b/kernel.spec index 473b6e29d..35d76d85f 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 4 # The git snapshot level -%define gitrev 1 +%define gitrev 3 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -648,13 +648,14 @@ Patch1555: fix_xen_guest_on_old_EC2.patch # DRM # nouveau + drm fixes -Patch1801: drm-fixes.patch Patch1810: drm-nouveau-updates.patch Patch1819: drm-intel-big-hammer.patch # intel drm is all merged upstream Patch1824: drm-intel-next.patch # make sure the lvds comes back on lid open Patch1825: drm-intel-make-lvds-work.patch +Patch1826: drm-intel-edp-fixes.patch + Patch1900: linux-2.6-intel-iommu-igfx.patch # linux1394 git patches @@ -700,10 +701,7 @@ Patch12205: runtime_pm_fixups.patch Patch12303: dmar-disable-when-ricoh-multifunction.patch -Patch12400: tty-dont-allow-reopen-when-ldisc-is-changing.patch Patch12401: debug-tty-print-dev-name.patch -Patch12402: tty-ldisc-fix-open-flag-handling.patch -Patch12403: tty-open-hangup-race-fixup.patch Patch12410: mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch Patch12411: mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch @@ -1246,7 +1244,6 @@ ApplyPatch linux-2.6-e1000-ich9-montevina.patch ApplyPatch fix_xen_guest_on_old_EC2.patch # DRM core -ApplyPatch drm-fixes.patch # Nouveau DRM ApplyOptionalPatch drm-nouveau-updates.patch @@ -1256,6 +1253,7 @@ ApplyOptionalPatch drm-intel-next.patch ApplyPatch drm-intel-big-hammer.patch ApplyPatch drm-intel-make-lvds-work.patch ApplyPatch linux-2.6-intel-iommu-igfx.patch +ApplyPatch drm-intel-edp-fixes.patch # linux1394 git patches #ApplyPatch linux-2.6-firewire-git-update.patch @@ -1298,10 +1296,7 @@ ApplyPatch runtime_pm_fixups.patch ApplyPatch dmar-disable-when-ricoh-multifunction.patch # rhbz#630464 -ApplyPatch tty-dont-allow-reopen-when-ldisc-is-changing.patch ApplyPatch debug-tty-print-dev-name.patch -ApplyPatch tty-ldisc-fix-open-flag-handling.patch -ApplyPatch tty-open-hangup-race-fixup.patch # backport some fixes for kswapd from mmotm, rhbz#649694 ApplyPatch mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch @@ -1919,6 +1914,14 @@ fi # || || %changelog +* Fri Dec 03 2010 Kyle McMartin +- Linux 2.6.37-rc4-git3 +- Enable HP ILO on x86_64 for (#571329) +- Drop merged drm-fixes.patch, split out edp-fixes. +- tty-dont-allow-reopen-when-ldisc-is-changing.patch: upstream. +- tty-ldisc-fix-open-flag-handling.patch: upstream. +- Enable CIFS_ACL. + * Thu Dec 02 2010 Kyle McMartin - Grab some of Mel's fixes from -mmotm to hopefully sort out #649694. diff --git a/sources b/sources index ceacae587..057161d82 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 854ca0c7eca8930a71a6382a7dabbf65 patch-2.6.37-rc4.bz2 -c3146fe28bb10e77d8388bc26e16483c patch-2.6.37-rc4-git1.bz2 +e8f83da2932eb4ca1dda9b66c66f0980 patch-2.6.37-rc4-git3.bz2 diff --git a/tty-dont-allow-reopen-when-ldisc-is-changing.patch b/tty-dont-allow-reopen-when-ldisc-is-changing.patch deleted file mode 100644 index 02d6746fc..000000000 --- a/tty-dont-allow-reopen-when-ldisc-is-changing.patch +++ /dev/null @@ -1,84 +0,0 @@ -From jirislaby@gmail.com Thu Nov 25 12:16:42 2010 -From: Jiri Slaby -Subject: [PATCH 1/1] TTY: don't allow reopen when ldisc is changing -Date: Thu, 25 Nov 2010 18:16:23 +0100 - -There are many WARNINGs like the following reported nowadays: -WARNING: at drivers/tty/tty_io.c:1331 tty_open+0x2a2/0x49a() -Hardware name: Latitude E6500 -Modules linked in: -Pid: 1207, comm: plymouthd Not tainted 2.6.37-rc3-mmotm1123 #3 -Call Trace: - [] warn_slowpath_common+0x80/0x98 - [] warn_slowpath_null+0x15/0x17 - [] tty_open+0x2a2/0x49a - [] chrdev_open+0x11d/0x146 -... - -This means tty_reopen is called without TTY_LDISC set. For further -considerations, note tty_lock is held in tty_open. TTY_LDISC is cleared in: -1) __tty_hangup from tty_ldisc_hangup to tty_ldisc_enable. During this -section tty_lock is held. - -2) tty_release via tty_ldisc_release till the end of tty existence. If -tty->count <= 1, tty_lock is taken, TTY_CLOSING bit set and then -tty_ldisc_release called. tty_reopen checks TTY_CLOSING before checking -TTY_LDISC. - -3) tty_set_ldisc from tty_ldisc_halt to tty_ldisc_enable. We: - * take tty_lock, set TTY_LDISC_CHANGING, put tty_lock - * call tty_ldisc_halt (clear TTY_LDISC), tty_lock is _not_ held - * do some other work - * take tty_lock, call tty_ldisc_enable (set TTY_LDISC), put - tty_lock - -So the only option I see is 3). The solution is to check -TTY_LDISC_CHANGING along with TTY_CLOSING in tty_reopen. - -Nicely reproducible with two processes: -while (1) { - fd = open("/dev/ttyS1", O_RDWR); - if (fd < 0) { - warn("open"); - continue; - } - close(fd); -} --------- -while (1) { - fd = open("/dev/ttyS1", O_RDWR); - ld1 = 0; ld2 = 2; - while (1) { - ioctl(fd, TIOCSETD, &ld1); - ioctl(fd, TIOCSETD, &ld2); - } - close(fd); -} - -Signed-off-by: Jiri Slaby -Reported-by: -Cc: Kyle McMartin -Cc: Alan Cox ---- - drivers/tty/tty_io.c | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c -index c05c5af..878f6d6 100644 ---- a/drivers/tty/tty_io.c -+++ b/drivers/tty/tty_io.c -@@ -1310,7 +1310,8 @@ static int tty_reopen(struct tty_struct *tty) - { - struct tty_driver *driver = tty->driver; - -- if (test_bit(TTY_CLOSING, &tty->flags)) -+ if (test_bit(TTY_CLOSING, &tty->flags) || -+ test_bit(TTY_LDISC_CHANGING, &tty->flags)) - return -EIO; - - if (driver->type == TTY_DRIVER_TYPE_PTY && --- -1.7.3.1 - - - diff --git a/tty-ldisc-fix-open-flag-handling.patch b/tty-ldisc-fix-open-flag-handling.patch deleted file mode 100644 index 4213aebb5..000000000 --- a/tty-ldisc-fix-open-flag-handling.patch +++ /dev/null @@ -1,54 +0,0 @@ -From linux-kernel-owner@vger.kernel.org Wed Nov 24 18:28:11 2010 -From: Jiri Slaby -Subject: [PATCH 1/2] TTY: ldisc, fix open flag handling -Date: Thu, 25 Nov 2010 00:27:54 +0100 - -When a concrete ldisc open fails in tty_ldisc_open, we forget to clear -TTY_LDISC_OPEN. This causes a false warning on the next ldisc open: -WARNING: at drivers/char/tty_ldisc.c:445 tty_ldisc_open+0x26/0x38() -Hardware name: System Product Name -Modules linked in: ... -Pid: 5251, comm: a.out Tainted: G W 2.6.32-5-686 #1 -Call Trace: - [] ? warn_slowpath_common+0x5e/0x8a - [] ? warn_slowpath_null+0xa/0xc - [] ? tty_ldisc_open+0x26/0x38 - [] ? tty_set_ldisc+0x218/0x304 -... - -So clear the bit when failing... - -Introduced in c65c9bc3efa (tty: rewrite the ldisc locking) back in -2.6.31-rc1. - -Signed-off-by: Jiri Slaby -Cc: Alan Cox -Reported-by: Sergey Lapin -Tested-by: Sergey Lapin ---- - drivers/tty/tty_ldisc.c | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c -index d8e96b0..4214d58 100644 ---- a/drivers/tty/tty_ldisc.c -+++ b/drivers/tty/tty_ldisc.c -@@ -454,6 +454,8 @@ static int tty_ldisc_open(struct tty_struct *tty, struct tty_ldisc *ld) - /* BTM here locks versus a hangup event */ - WARN_ON(!tty_locked()); - ret = ld->ops->open(tty); -+ if (ret) -+ clear_bit(TTY_LDISC_OPEN, &tty->flags); - return ret; - } - return 0; --- -1.7.3.1 - - --- -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html -Please read the FAQ at http://www.tux.org/lkml/ - diff --git a/tty-open-hangup-race-fixup.patch b/tty-open-hangup-race-fixup.patch deleted file mode 100644 index cda7f41b3..000000000 --- a/tty-open-hangup-race-fixup.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 9e88e8b9915b5e067507a087437d80e6a133d612 Mon Sep 17 00:00:00 2001 -From: Jiri Slaby -Date: Sat, 27 Nov 2010 16:06:46 +0100 -Subject: [PATCH 1/1] TTY: open/hangup race fixup - - -Signed-off-by: Jiri Slaby ---- - drivers/tty/tty_io.c | 10 +++++++++- - include/linux/tty.h | 1 + - 2 files changed, 10 insertions(+), 1 deletions(-) - -diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c -index 878f6d6..35480dd 100644 ---- a/drivers/tty/tty_io.c -+++ b/drivers/tty/tty_io.c -@@ -559,6 +559,9 @@ void __tty_hangup(struct tty_struct *tty) - - tty_lock(); - -+ /* some functions below drop BTM, so we need this bit */ -+ set_bit(TTY_HUPPING, &tty->flags); -+ - /* inuse_filps is protected by the single tty lock, - this really needs to change if we want to flush the - workqueue with the lock held */ -@@ -578,6 +581,10 @@ void __tty_hangup(struct tty_struct *tty) - } - spin_unlock(&tty_files_lock); - -+ /* -+ * it drops BTM and thus races with reopen -+ * we protect the race by TTY_HUPPING -+ */ - tty_ldisc_hangup(tty); - - read_lock(&tasklist_lock); -@@ -615,7 +622,6 @@ void __tty_hangup(struct tty_struct *tty) - tty->session = NULL; - tty->pgrp = NULL; - tty->ctrl_status = 0; -- set_bit(TTY_HUPPED, &tty->flags); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - - /* Account for the p->signal references we killed */ -@@ -641,6 +647,7 @@ void __tty_hangup(struct tty_struct *tty) - * can't yet guarantee all that. - */ - set_bit(TTY_HUPPED, &tty->flags); -+ clear_bit(TTY_HUPPING, &tty->flags); - tty_ldisc_enable(tty); - - tty_unlock(); -@@ -1311,6 +1318,7 @@ static int tty_reopen(struct tty_struct *tty) - struct tty_driver *driver = tty->driver; - - if (test_bit(TTY_CLOSING, &tty->flags) || -+ test_bit(TTY_HUPPING, &tty->flags) || - test_bit(TTY_LDISC_CHANGING, &tty->flags)) - return -EIO; - -diff --git a/include/linux/tty.h b/include/linux/tty.h -index 032d79f..54e4eaa 100644 ---- a/include/linux/tty.h -+++ b/include/linux/tty.h -@@ -366,6 +366,7 @@ struct tty_file_private { - #define TTY_HUPPED 18 /* Post driver->hangup() */ - #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ - #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ -+#define TTY_HUPPING 21 /* ->hangup() in progress */ - - #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) - --- -1.7.3.1 - From 8002c02cae42afb7b947b90fc4e579379232043c Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sat, 4 Dec 2010 11:36:16 -0500 Subject: [PATCH 43/47] enable cplus_demangle in perf --- kernel.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 35d76d85f..16631dc55 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1609,7 +1609,7 @@ BuildKernel %make_target %kernel_image smp %endif %global perf_make \ - make %{?_smp_mflags} -C tools/perf -s V=1 NO_DEMANGLE=1 prefix=%{_prefix} + make %{?_smp_mflags} -C tools/perf -s V=1 HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} %if %{with_perf} %{perf_make} all %{perf_make} man || %{doc_build_fail} @@ -1914,6 +1914,10 @@ fi # || || %changelog +* Sat Dec 04 2010 Kyle McMartin +- Enable C++ symbol demangling with perf by linking against libiberty.a, + which is LGPL2. + * Fri Dec 03 2010 Kyle McMartin - Linux 2.6.37-rc4-git3 - Enable HP ILO on x86_64 for (#571329) From 4b3b40727e6ba302124850e2a5d3ef8b6bf2cfef Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 6 Dec 2010 10:41:38 -0500 Subject: [PATCH 44/47] don't prune kernel-devel in the %with_headers install section commit c1bdfc8b broke the build on s390 since it is headers only, and had nothing installed in /usr/src/kernels... since kernel-devel is only produced when there's a BuildKernel, just prune '*.cmd' when doing BuildKernel for the same net result. --- kernel.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel.spec b/kernel.spec index 16631dc55..0f274d957 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1572,9 +1572,12 @@ BuildKernel() { done # Move the devel headers out of the root file system - mkdir -p $RPM_BUILD_ROOT/usr/src/kernels + mkdir -p $RPM_BUILD_ROOT/$DevelDir mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir ln -sf ../../..$DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build + + # prune junk from kernel-devel + find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -exec rm -f {} \; } ### @@ -1693,8 +1696,6 @@ find $RPM_BUILD_ROOT/usr/include \ \( -name .install -o -name .check -o \ -name ..install.cmd -o -name ..check.cmd \) | xargs rm -f -find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -exec rm -f {} \; - # glibc provides scsi headers for itself, for now rm -rf $RPM_BUILD_ROOT/usr/include/scsi rm -f $RPM_BUILD_ROOT/usr/include/asm*/atomic.h From f6c1ae10e35fb9da3c58b47e9acd943c9981d9a0 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 6 Dec 2010 12:49:34 -0500 Subject: [PATCH 45/47] fix thinko in previous commit, resulting in /usr/src/kernels/$ver/build/ --- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 0f274d957..bf58213a6 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1572,7 +1572,7 @@ BuildKernel() { done # Move the devel headers out of the root file system - mkdir -p $RPM_BUILD_ROOT/$DevelDir + mkdir -p $RPM_BUILD_ROOT/usr/src/kernels mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir ln -sf ../../..$DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build From abce2aa994d41917a4c62e0e1c43ec533a964ffb Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 7 Dec 2010 21:29:28 -0500 Subject: [PATCH 46/47] Linux 2.6.37-rc5 --- .gitignore | 3 +-- kernel.spec | 7 +++++-- sources | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 1906c3468..f6b905069 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ patch-*.bz2 clog *.rpm kernel-2.6.*/ -/patch-2.6.37-rc4.bz2 -/patch-2.6.37-rc4-git3.bz2 +/patch-2.6.37-rc5.bz2 diff --git a/kernel.spec b/kernel.spec index bf58213a6..83dfede97 100644 --- a/kernel.spec +++ b/kernel.spec @@ -82,9 +82,9 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 4 +%define rcrev 5 # The git snapshot level -%define gitrev 3 +%define gitrev 0 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -1915,6 +1915,9 @@ fi # || || %changelog +* Tue Dec 07 2010 Kyle McMartin 2.6.37-0.rc5.git0.1 +- Linux 2.6.37-rc5 + * Sat Dec 04 2010 Kyle McMartin - Enable C++ symbol demangling with perf by linking against libiberty.a, which is LGPL2. diff --git a/sources b/sources index 057161d82..cd7d2d270 100644 --- a/sources +++ b/sources @@ -1,3 +1,2 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 -854ca0c7eca8930a71a6382a7dabbf65 patch-2.6.37-rc4.bz2 -e8f83da2932eb4ca1dda9b66c66f0980 patch-2.6.37-rc4-git3.bz2 +a84cf559615b5168ec1d5591841601ed patch-2.6.37-rc5.bz2 From 98e6119f39d3b83af3b533bed6bcff0e096f2397 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Wed, 8 Dec 2010 16:23:18 -0500 Subject: [PATCH 47/47] Linux 2.6.37-rc5-git2 --- .gitignore | 1 + kernel.spec | 10 +- sched-cure-more-NO_HZ-load-average-woes.patch | 273 ++++++++++++++++++ sources | 1 + 4 files changed, 284 insertions(+), 1 deletion(-) create mode 100644 sched-cure-more-NO_HZ-load-average-woes.patch diff --git a/.gitignore b/.gitignore index f6b905069..05a9df52c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ clog *.rpm kernel-2.6.*/ /patch-2.6.37-rc5.bz2 +/patch-2.6.37-rc5-git2.bz2 diff --git a/kernel.spec b/kernel.spec index 83dfede97..be5fcc0ad 100644 --- a/kernel.spec +++ b/kernel.spec @@ -84,7 +84,7 @@ Summary: The Linux kernel # The rc snapshot level %define rcrev 5 # The git snapshot level -%define gitrev 0 +%define gitrev 2 # Set rpm version accordingly %define rpmversion 2.6.%{upstream_sublevel} %endif @@ -706,6 +706,9 @@ Patch12401: debug-tty-print-dev-name.patch Patch12410: mm-page-allocator-adjust-the-per-cpu-counter-threshold-when-memory-is-low.patch Patch12411: mm-vmstat-use-a-single-setter-function-and-callback-for-adjusting-percpu-thresholds.patch +# rhbz#650934 +Patch12420: sched-cure-more-NO_HZ-load-average-woes.patch + %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1915,6 +1918,11 @@ fi # || || %changelog +* Wed Dec 08 2010 Kyle McMartin 2.6.37-0.rc5.git2.1 +- Linux 2.6.37-rc5-git2 +- sched-cure-more-NO_HZ-load-average-woes.patch: fix some of the complaints + in 2.6.35+ about load average with dynticks. (rhbz#650934) + * Tue Dec 07 2010 Kyle McMartin 2.6.37-0.rc5.git0.1 - Linux 2.6.37-rc5 diff --git a/sched-cure-more-NO_HZ-load-average-woes.patch b/sched-cure-more-NO_HZ-load-average-woes.patch new file mode 100644 index 000000000..a4053c3b4 --- /dev/null +++ b/sched-cure-more-NO_HZ-load-average-woes.patch @@ -0,0 +1,273 @@ +From bounces.tip@hpa.at.zytor.com Wed Dec 8 15:40:48 2010 +From: tip-bot for Peter Zijlstra +In-Reply-To: <1291129145.32004.874.camel@laptop> +References: <1291129145.32004.874.camel@laptop> +Subject: [tip:sched/urgent] sched: Cure more NO_HZ load average woes +Message-ID: +Git-Commit-ID: 0f004f5a696a9434b7214d0d3cbd0525ee77d428 + +Commit-ID: 0f004f5a696a9434b7214d0d3cbd0525ee77d428 +Gitweb: http://git.kernel.org/tip/0f004f5a696a9434b7214d0d3cbd0525ee77d428 +Author: Peter Zijlstra +AuthorDate: Tue, 30 Nov 2010 19:48:45 +0100 +Committer: Ingo Molnar +CommitDate: Wed, 8 Dec 2010 20:15:04 +0100 + +sched: Cure more NO_HZ load average woes + +There's a long-running regression that proved difficult to fix and +which is hitting certain people and is rather annoying in its effects. + +Damien reported that after 74f5187ac8 (sched: Cure load average vs +NO_HZ woes) his load average is unnaturally high, he also noted that +even with that patch reverted the load avgerage numbers are not +correct. + +The problem is that the previous patch only solved half the NO_HZ +problem, it addressed the part of going into NO_HZ mode, not of +comming out of NO_HZ mode. This patch implements that missing half. + +When comming out of NO_HZ mode there are two important things to take +care of: + + - Folding the pending idle delta into the global active count. + - Correctly aging the averages for the idle-duration. + +So with this patch the NO_HZ interaction should be complete and +behaviour between CONFIG_NO_HZ=[yn] should be equivalent. + +Furthermore, this patch slightly changes the load average computation +by adding a rounding term to the fixed point multiplication. + +Reported-by: Damien Wyart +Reported-by: Tim McGrath +Tested-by: Damien Wyart +Tested-by: Orion Poplawski +Tested-by: Kyle McMartin +Signed-off-by: Peter Zijlstra +Cc: stable@kernel.org +Cc: Chase Douglas +LKML-Reference: <1291129145.32004.874.camel@laptop> +Signed-off-by: Ingo Molnar +--- + include/linux/sched.h | 2 +- + kernel/sched.c | 150 +++++++++++++++++++++++++++++++++++++++++++++---- + kernel/timer.c | 2 +- + 3 files changed, 141 insertions(+), 13 deletions(-) + +diff --git a/include/linux/sched.h b/include/linux/sched.h +index 2c79e92..2238745 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -143,7 +143,7 @@ extern unsigned long nr_iowait_cpu(int cpu); + extern unsigned long this_cpu_load(void); + + +-extern void calc_global_load(void); ++extern void calc_global_load(unsigned long ticks); + + extern unsigned long get_parent_ip(unsigned long addr); + +diff --git a/kernel/sched.c b/kernel/sched.c +index dc91a4d..6b7c26a 100644 +--- a/kernel/sched.c ++++ b/kernel/sched.c +@@ -3119,6 +3119,15 @@ static long calc_load_fold_active(struct rq *this_rq) + return delta; + } + ++static unsigned long ++calc_load(unsigned long load, unsigned long exp, unsigned long active) ++{ ++ load *= exp; ++ load += active * (FIXED_1 - exp); ++ load += 1UL << (FSHIFT - 1); ++ return load >> FSHIFT; ++} ++ + #ifdef CONFIG_NO_HZ + /* + * For NO_HZ we delay the active fold to the next LOAD_FREQ update. +@@ -3148,6 +3157,128 @@ static long calc_load_fold_idle(void) + + return delta; + } ++ ++/** ++ * fixed_power_int - compute: x^n, in O(log n) time ++ * ++ * @x: base of the power ++ * @frac_bits: fractional bits of @x ++ * @n: power to raise @x to. ++ * ++ * By exploiting the relation between the definition of the natural power ++ * function: x^n := x*x*...*x (x multiplied by itself for n times), and ++ * the binary encoding of numbers used by computers: n := \Sum n_i * 2^i, ++ * (where: n_i \elem {0, 1}, the binary vector representing n), ++ * we find: x^n := x^(\Sum n_i * 2^i) := \Prod x^(n_i * 2^i), which is ++ * of course trivially computable in O(log_2 n), the length of our binary ++ * vector. ++ */ ++static unsigned long ++fixed_power_int(unsigned long x, unsigned int frac_bits, unsigned int n) ++{ ++ unsigned long result = 1UL << frac_bits; ++ ++ if (n) for (;;) { ++ if (n & 1) { ++ result *= x; ++ result += 1UL << (frac_bits - 1); ++ result >>= frac_bits; ++ } ++ n >>= 1; ++ if (!n) ++ break; ++ x *= x; ++ x += 1UL << (frac_bits - 1); ++ x >>= frac_bits; ++ } ++ ++ return result; ++} ++ ++/* ++ * a1 = a0 * e + a * (1 - e) ++ * ++ * a2 = a1 * e + a * (1 - e) ++ * = (a0 * e + a * (1 - e)) * e + a * (1 - e) ++ * = a0 * e^2 + a * (1 - e) * (1 + e) ++ * ++ * a3 = a2 * e + a * (1 - e) ++ * = (a0 * e^2 + a * (1 - e) * (1 + e)) * e + a * (1 - e) ++ * = a0 * e^3 + a * (1 - e) * (1 + e + e^2) ++ * ++ * ... ++ * ++ * an = a0 * e^n + a * (1 - e) * (1 + e + ... + e^n-1) [1] ++ * = a0 * e^n + a * (1 - e) * (1 - e^n)/(1 - e) ++ * = a0 * e^n + a * (1 - e^n) ++ * ++ * [1] application of the geometric series: ++ * ++ * n 1 - x^(n+1) ++ * S_n := \Sum x^i = ------------- ++ * i=0 1 - x ++ */ ++static unsigned long ++calc_load_n(unsigned long load, unsigned long exp, ++ unsigned long active, unsigned int n) ++{ ++ ++ return calc_load(load, fixed_power_int(exp, FSHIFT, n), active); ++} ++ ++/* ++ * NO_HZ can leave us missing all per-cpu ticks calling ++ * calc_load_account_active(), but since an idle CPU folds its delta into ++ * calc_load_tasks_idle per calc_load_account_idle(), all we need to do is fold ++ * in the pending idle delta if our idle period crossed a load cycle boundary. ++ * ++ * Once we've updated the global active value, we need to apply the exponential ++ * weights adjusted to the number of cycles missed. ++ */ ++static void calc_global_nohz(unsigned long ticks) ++{ ++ long delta, active, n; ++ ++ if (time_before(jiffies, calc_load_update)) ++ return; ++ ++ /* ++ * If we crossed a calc_load_update boundary, make sure to fold ++ * any pending idle changes, the respective CPUs might have ++ * missed the tick driven calc_load_account_active() update ++ * due to NO_HZ. ++ */ ++ delta = calc_load_fold_idle(); ++ if (delta) ++ atomic_long_add(delta, &calc_load_tasks); ++ ++ /* ++ * If we were idle for multiple load cycles, apply them. ++ */ ++ if (ticks >= LOAD_FREQ) { ++ n = ticks / LOAD_FREQ; ++ ++ active = atomic_long_read(&calc_load_tasks); ++ active = active > 0 ? active * FIXED_1 : 0; ++ ++ avenrun[0] = calc_load_n(avenrun[0], EXP_1, active, n); ++ avenrun[1] = calc_load_n(avenrun[1], EXP_5, active, n); ++ avenrun[2] = calc_load_n(avenrun[2], EXP_15, active, n); ++ ++ calc_load_update += n * LOAD_FREQ; ++ } ++ ++ /* ++ * Its possible the remainder of the above division also crosses ++ * a LOAD_FREQ period, the regular check in calc_global_load() ++ * which comes after this will take care of that. ++ * ++ * Consider us being 11 ticks before a cycle completion, and us ++ * sleeping for 4*LOAD_FREQ + 22 ticks, then the above code will ++ * age us 4 cycles, and the test in calc_global_load() will ++ * pick up the final one. ++ */ ++} + #else + static void calc_load_account_idle(struct rq *this_rq) + { +@@ -3157,6 +3288,10 @@ static inline long calc_load_fold_idle(void) + { + return 0; + } ++ ++static void calc_global_nohz(unsigned long ticks) ++{ ++} + #endif + + /** +@@ -3174,24 +3309,17 @@ void get_avenrun(unsigned long *loads, unsigned long offset, int shift) + loads[2] = (avenrun[2] + offset) << shift; + } + +-static unsigned long +-calc_load(unsigned long load, unsigned long exp, unsigned long active) +-{ +- load *= exp; +- load += active * (FIXED_1 - exp); +- return load >> FSHIFT; +-} +- + /* + * calc_load - update the avenrun load estimates 10 ticks after the + * CPUs have updated calc_load_tasks. + */ +-void calc_global_load(void) ++void calc_global_load(unsigned long ticks) + { +- unsigned long upd = calc_load_update + 10; + long active; + +- if (time_before(jiffies, upd)) ++ calc_global_nohz(ticks); ++ ++ if (time_before(jiffies, calc_load_update + 10)) + return; + + active = atomic_long_read(&calc_load_tasks); +diff --git a/kernel/timer.c b/kernel/timer.c +index 68a9ae7..7bd715f 100644 +--- a/kernel/timer.c ++++ b/kernel/timer.c +@@ -1319,7 +1319,7 @@ void do_timer(unsigned long ticks) + { + jiffies_64 += ticks; + update_wall_time(); +- calc_global_load(); ++ calc_global_load(ticks); + } + + #ifdef __ARCH_WANT_SYS_ALARM + diff --git a/sources b/sources index cd7d2d270..d52c071f5 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ 61f3739a73afb6914cb007f37fb09b62 linux-2.6.36.tar.bz2 a84cf559615b5168ec1d5591841601ed patch-2.6.37-rc5.bz2 +dbc90858467e28b39539ad6d3415a956 patch-2.6.37-rc5-git2.bz2