summaryrefslogtreecommitdiffstats
path: root/freed-ora/current
diff options
context:
space:
mode:
authorAlexandre Oliva <lxoliva@fsfla.org>2013-04-30 22:04:41 +0000
committerAlexandre Oliva <lxoliva@fsfla.org>2013-04-30 22:04:41 +0000
commit3975cc728b70f9a304474f0835e68db68666d11d (patch)
tree5efdbfea594722963afcdb85ee4830d2c7dcf206 /freed-ora/current
parent6a305355a26b4666ec860534044a371114540546 (diff)
downloadlinux-libre-raptor-3975cc728b70f9a304474f0835e68db68666d11d.tar.gz
linux-libre-raptor-3975cc728b70f9a304474f0835e68db68666d11d.zip
3.9.0-1.fc20.gnu
Diffstat (limited to 'freed-ora/current')
-rw-r--r--freed-ora/current/master/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch61
-rw-r--r--freed-ora/current/master/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch162
-rw-r--r--freed-ora/current/master/Input-add-support-for-Cypress-PS2-Trackpads.patch1063
-rw-r--r--freed-ora/current/master/Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch30
-rw-r--r--freed-ora/current/master/Makefile.config37
-rw-r--r--freed-ora/current/master/VMX-x86-handle-host-TSC-calibration-failure.patch58
-rw-r--r--freed-ora/current/master/acpi-debug-infinite-loop.patch25
-rw-r--r--freed-ora/current/master/alps-v2.patch2494
-rw-r--r--freed-ora/current/master/arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch80
-rw-r--r--freed-ora/current/master/arm-imx-fixdrm.patch37
-rw-r--r--freed-ora/current/master/arm-lpae-ax88796.patch21
-rw-r--r--freed-ora/current/master/arm-of-dma.patch43
-rw-r--r--freed-ora/current/master/arm-omap-ehci-fix.patch190
-rw-r--r--freed-ora/current/master/arm-tegra-fixclk.patch28
-rw-r--r--freed-ora/current/master/arm-tegra-nvec-kconfig.patch10
-rw-r--r--freed-ora/current/master/blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch79
-rw-r--r--freed-ora/current/master/cfg80211-mac80211-disconnect-on-suspend.patch219
-rw-r--r--freed-ora/current/master/config-arm-generic403
-rw-r--r--freed-ora/current/master/config-arm-kirkwood74
-rw-r--r--freed-ora/current/master/config-arm-omap279
-rw-r--r--freed-ora/current/master/config-armv7628
-rw-r--r--freed-ora/current/master/config-armv7-generic466
-rw-r--r--freed-ora/current/master/config-armv7-lpae95
-rw-r--r--freed-ora/current/master/config-armv7-tegra (renamed from freed-ora/current/master/config-arm-tegra)75
-rw-r--r--freed-ora/current/master/config-debug1
-rw-r--r--freed-ora/current/master/config-generic134
-rw-r--r--freed-ora/current/master/config-nodebug3
-rw-r--r--freed-ora/current/master/config-powerpc-generic7
-rw-r--r--freed-ora/current/master/config-powerpc644
-rw-r--r--freed-ora/current/master/config-powerpc64p73
-rw-r--r--freed-ora/current/master/config-s390x14
-rw-r--r--freed-ora/current/master/config-x86-32-generic3
-rw-r--r--freed-ora/current/master/config-x86-generic34
-rw-r--r--freed-ora/current/master/config-x86_64-generic24
-rwxr-xr-xfreed-ora/current/master/deblob-3.9 (renamed from freed-ora/current/master/deblob-3.8)93
-rwxr-xr-xfreed-ora/current/master/deblob-check180
-rw-r--r--freed-ora/current/master/debug-bad-pte-dmi.patch71
-rw-r--r--freed-ora/current/master/debug-bad-pte-modules.patch25
-rw-r--r--freed-ora/current/master/devel-pekey-secure-boot-20130306.patch (renamed from freed-ora/current/master/devel-pekey-secure-boot-20130219.patch)412
-rw-r--r--freed-ora/current/master/dmar-disable-when-ricoh-multifunction.patch33
-rw-r--r--freed-ora/current/master/drm-i915-dp-stfu.patch18
-rw-r--r--freed-ora/current/master/drm-qxl-driver.patch7444
-rw-r--r--freed-ora/current/master/drm-ttm-exports-for-qxl.patch86
-rw-r--r--freed-ora/current/master/fix-child-thread-introspection.patch76
-rw-r--r--freed-ora/current/master/forcedeth-dma-error-check.patch132
-rw-r--r--freed-ora/current/master/iwlegacy-add-flush-callback.patch103
-rw-r--r--freed-ora/current/master/iwlwifi-fix-freeing-uninitialized-pointer.patch51
-rw-r--r--freed-ora/current/master/kernel.spec594
-rw-r--r--freed-ora/current/master/linux-libre-3.8-gnu.tar.xz.sign7
-rw-r--r--freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xzbin98440 -> 0 bytes
-rw-r--r--freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xz.sign7
-rw-r--r--freed-ora/current/master/linux-libre-3.9-gnu.tar.xz.sign7
-rw-r--r--freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xzbin0 -> 86032 bytes
-rw-r--r--freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz.sign7
-rw-r--r--freed-ora/current/master/mac80211-improve-latency-and-throughput-while-software.patch142
-rw-r--r--freed-ora/current/master/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch73
-rwxr-xr-xfreed-ora/current/master/mod-sign.sh22
-rw-r--r--freed-ora/current/master/pstore-Create-a-convenient-mount-point-for-pstore.patch85
-rw-r--r--freed-ora/current/master/quiet-apm.patch13
-rw-r--r--freed-ora/current/master/serial-460800.patch4
-rw-r--r--freed-ora/current/master/silence-empty-ipi-mask-warning.patch11
-rw-r--r--freed-ora/current/master/sources2
-rw-r--r--freed-ora/current/master/taint-vbox.patch10
-rw-r--r--freed-ora/current/master/usb-cypress-supertop.patch38
-rw-r--r--freed-ora/current/master/wireless-regulatory-fix-channel-disabling-race-condition.patch40
65 files changed, 10905 insertions, 5765 deletions
diff --git a/freed-ora/current/master/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch b/freed-ora/current/master/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch
deleted file mode 100644
index a14532b22..000000000
--- a/freed-ora/current/master/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From fe7963cbe464048cfae4523975aa208a6c7dc420 Mon Sep 17 00:00:00 2001
-From: Josh Boyer <jwboyer@redhat.com>
-Date: Mon, 18 Feb 2013 10:32:13 -0500
-Subject: [PATCH] bluetooth: Add support for atheros 04ca:3004 device to ath3k
-
-Yet another version of the atheros bluetooth chipset
-
-T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
-D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
-P: Vendor=04ca ProdID=3004 Rev=00.01
-S: Manufacturer=Atheros Communications
-S: Product=Bluetooth USB Host Controller
-S: SerialNumber=Alaska Day 2006
-C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
-I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
-I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
-
-This resolves https://bugzilla.redhat.com/show_bug.cgi?id=844750
-
-Reported-by: niktr@mail.ru
-Signed-off-by: Josh Boyer <jwboyer@redhat.com>
----
- drivers/bluetooth/ath3k.c | 2 ++
- drivers/bluetooth/btusb.c | 1 +
- 2 files changed, 3 insertions(+)
-
-diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
-index 33c9a44..b9908dd 100644
---- a/drivers/bluetooth/ath3k.c
-+++ b/drivers/bluetooth/ath3k.c
-@@ -76,6 +76,7 @@ static struct usb_device_id ath3k_table[] = {
- { USB_DEVICE(0x0CF3, 0x3004) },
- { USB_DEVICE(0x0CF3, 0x311D) },
- { USB_DEVICE(0x13d3, 0x3375) },
-+ { USB_DEVICE(0x04CA, 0x3004) },
- { USB_DEVICE(0x04CA, 0x3005) },
- { USB_DEVICE(0x04CA, 0x3006) },
- { USB_DEVICE(0x04CA, 0x3008) },
-@@ -108,6 +109,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
- { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
-+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
-diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
-index 7e351e3..59cde8e 100644
---- a/drivers/bluetooth/btusb.c
-+++ b/drivers/bluetooth/btusb.c
-@@ -134,6 +134,7 @@ static struct usb_device_id blacklist_table[] = {
- { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
-+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
- { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
---
-1.8.1.2
-
diff --git a/freed-ora/current/master/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch b/freed-ora/current/master/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch
new file mode 100644
index 000000000..c42c8c4f1
--- /dev/null
+++ b/freed-ora/current/master/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch
@@ -0,0 +1,162 @@
+From ce10d1b72b4da3c98bbbcb1b945687d964c31923 Mon Sep 17 00:00:00 2001
+From: Josh Boyer <jwboyer@redhat.com>
+Date: Tue, 9 Apr 2013 11:08:13 -0400
+Subject: [PATCH] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg
+
+The dmesg_restrict sysctl currently covers the syslog method for access
+dmesg, however /dev/kmsg isn't covered by the same protections. Most
+people haven't noticed because util-linux dmesg(1) defaults to using the
+syslog method for access in older versions. With util-linux dmesg(1)
+defaults to reading directly from /dev/kmsg.
+
+Fix this by reworking all of the access methods to use the
+check_syslog_permissions function and adding checks to devkmsg_open and
+devkmsg_read.
+
+This fixes https://bugzilla.redhat.com/show_bug.cgi?id=903192
+
+Reported-by: Christian Kujau <lists@nerdbynature.de>
+CC: stable@vger.kernel.org
+Signed-off-by: Eric Paris <eparis@redhat.com>
+Signed-off-by: Josh Boyer <jwboyer@redhat.com>
+---
+ kernel/printk.c | 91 +++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 47 insertions(+), 44 deletions(-)
+
+diff --git a/kernel/printk.c b/kernel/printk.c
+index abbdd9e..5541095 100644
+--- a/kernel/printk.c
++++ b/kernel/printk.c
+@@ -368,6 +368,46 @@ static void log_store(int facility, int level,
+ log_next_seq++;
+ }
+
++#ifdef CONFIG_SECURITY_DMESG_RESTRICT
++int dmesg_restrict = 1;
++#else
++int dmesg_restrict;
++#endif
++
++static int syslog_action_restricted(int type)
++{
++ if (dmesg_restrict)
++ return 1;
++ /* Unless restricted, we allow "read all" and "get buffer size" for everybody */
++ return type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER;
++}
++
++static int check_syslog_permissions(int type, bool from_file)
++{
++ /*
++ * If this is from /proc/kmsg and we've already opened it, then we've
++ * already done the capabilities checks at open time.
++ */
++ if (from_file && type != SYSLOG_ACTION_OPEN)
++ goto ok;
++
++ if (syslog_action_restricted(type)) {
++ if (capable(CAP_SYSLOG))
++ goto ok;
++ /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */
++ if (capable(CAP_SYS_ADMIN)) {
++ printk_once(KERN_WARNING "%s (%d): "
++ "Attempt to access syslog with CAP_SYS_ADMIN "
++ "but no CAP_SYSLOG (deprecated).\n",
++ current->comm, task_pid_nr(current));
++ goto ok;
++ }
++ return -EPERM;
++ }
++ok:
++ return security_syslog(type);
++}
++
+ /* /dev/kmsg - userspace message inject/listen interface */
+ struct devkmsg_user {
+ u64 seq;
+@@ -443,10 +483,16 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf,
+ char cont = '-';
+ size_t len;
+ ssize_t ret;
++ int err;
+
+ if (!user)
+ return -EBADF;
+
++ err = check_syslog_permissions(SYSLOG_ACTION_READ_ALL,
++ SYSLOG_FROM_FILE);
++ if (err)
++ return err;
++
+ ret = mutex_lock_interruptible(&user->lock);
+ if (ret)
+ return ret;
+@@ -624,7 +670,7 @@ static int devkmsg_open(struct inode *inode, struct file *file)
+ if ((file->f_flags & O_ACCMODE) == O_WRONLY)
+ return 0;
+
+- err = security_syslog(SYSLOG_ACTION_READ_ALL);
++ err = check_syslog_permissions(SYSLOG_ACTION_OPEN, SYSLOG_FROM_FILE);
+ if (err)
+ return err;
+
+@@ -817,45 +863,6 @@ static inline void boot_delay_msec(int level)
+ }
+ #endif
+
+-#ifdef CONFIG_SECURITY_DMESG_RESTRICT
+-int dmesg_restrict = 1;
+-#else
+-int dmesg_restrict;
+-#endif
+-
+-static int syslog_action_restricted(int type)
+-{
+- if (dmesg_restrict)
+- return 1;
+- /* Unless restricted, we allow "read all" and "get buffer size" for everybody */
+- return type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER;
+-}
+-
+-static int check_syslog_permissions(int type, bool from_file)
+-{
+- /*
+- * If this is from /proc/kmsg and we've already opened it, then we've
+- * already done the capabilities checks at open time.
+- */
+- if (from_file && type != SYSLOG_ACTION_OPEN)
+- return 0;
+-
+- if (syslog_action_restricted(type)) {
+- if (capable(CAP_SYSLOG))
+- return 0;
+- /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */
+- if (capable(CAP_SYS_ADMIN)) {
+- printk_once(KERN_WARNING "%s (%d): "
+- "Attempt to access syslog with CAP_SYS_ADMIN "
+- "but no CAP_SYSLOG (deprecated).\n",
+- current->comm, task_pid_nr(current));
+- return 0;
+- }
+- return -EPERM;
+- }
+- return 0;
+-}
+-
+ #if defined(CONFIG_PRINTK_TIME)
+ static bool printk_time = 1;
+ #else
+@@ -1131,10 +1138,6 @@ int do_syslog(int type, char __user *buf, int len, bool from_file)
+ if (error)
+ goto out;
+
+- error = security_syslog(type);
+- if (error)
+- return error;
+-
+ switch (type) {
+ case SYSLOG_ACTION_CLOSE: /* Close log */
+ break;
+--
+1.8.1.4
+
diff --git a/freed-ora/current/master/Input-add-support-for-Cypress-PS2-Trackpads.patch b/freed-ora/current/master/Input-add-support-for-Cypress-PS2-Trackpads.patch
deleted file mode 100644
index 8c5e569f9..000000000
--- a/freed-ora/current/master/Input-add-support-for-Cypress-PS2-Trackpads.patch
+++ /dev/null
@@ -1,1063 +0,0 @@
-From 0799a924bc93ba46a23e8e7e6b1431ab585fd2ea Mon Sep 17 00:00:00 2001
-From: Dudley Du <dudl@cypress.com>
-Date: Sat, 5 Jan 2013 00:14:22 -0800
-Subject: [PATCH] Input: add support for Cypress PS/2 Trackpads
-
-This driver, submitted on behalf of Cypress Semiconductor Corporation and
-additional contributors, provides support for the Cypress PS/2 Trackpad.
-
-Original code contributed by Dudley Du (Cypress Semiconductor Corporation),
-modified by Kamal Mostafa and Kyle Fazzari.
-
-BugLink: http://launchpad.net/bugs/978807
-
-Signed-off-by: Dudley Du <dudl@cypress.com>
-Signed-off-by: Kamal Mostafa <kamal@canonical.com>
-Signed-off-by: Kyle Fazzari <git@status.e4ward.com>
-Signed-off-by: Mario Limonciello <mario_limonciello@dell.com>
-Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-Acked-by: Herton Krzesinski <herton.krzesinski@canonical.com>
-Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
-Reviewed-by: Dudley Du <dudl@cypress.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/Kconfig | 10 +
- drivers/input/mouse/Makefile | 1 +
- drivers/input/mouse/cypress_ps2.c | 725 ++++++++++++++++++++++++++++++++++++
- drivers/input/mouse/cypress_ps2.h | 191 ++++++++++
- drivers/input/mouse/psmouse-base.c | 32 ++
- drivers/input/mouse/psmouse.h | 1 +
- 6 files changed, 960 insertions(+), 0 deletions(-)
- create mode 100644 drivers/input/mouse/cypress_ps2.c
- create mode 100644 drivers/input/mouse/cypress_ps2.h
-
-diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
-index cd6268c..88954dd 100644
---- a/drivers/input/mouse/Kconfig
-+++ b/drivers/input/mouse/Kconfig
-@@ -68,6 +68,16 @@ config MOUSE_PS2_SYNAPTICS
-
- If unsure, say Y.
-
-+config MOUSE_PS2_CYPRESS
-+ bool "Cypress PS/2 mouse protocol extension" if EXPERT
-+ default y
-+ depends on MOUSE_PS2
-+ help
-+ Say Y here if you have a Cypress PS/2 Trackpad connected to
-+ your system.
-+
-+ If unsure, say Y.
-+
- config MOUSE_PS2_LIFEBOOK
- bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EXPERT
- default y
-diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
-index 46ba755..323e352 100644
---- a/drivers/input/mouse/Makefile
-+++ b/drivers/input/mouse/Makefile
-@@ -32,3 +32,4 @@ psmouse-$(CONFIG_MOUSE_PS2_LIFEBOOK) += lifebook.o
- psmouse-$(CONFIG_MOUSE_PS2_SENTELIC) += sentelic.o
- psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o
- psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o
-+psmouse-$(CONFIG_MOUSE_PS2_CYPRESS) += cypress_ps2.o
-diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c
-new file mode 100644
-index 0000000..1673dc6
---- /dev/null
-+++ b/drivers/input/mouse/cypress_ps2.c
-@@ -0,0 +1,725 @@
-+/*
-+ * Cypress Trackpad PS/2 mouse driver
-+ *
-+ * Copyright (c) 2012 Cypress Semiconductor Corporation.
-+ *
-+ * Author:
-+ * Dudley Du <dudl@cypress.com>
-+ *
-+ * Additional contributors include:
-+ * Kamal Mostafa <kamal@canonical.com>
-+ * Kyle Fazzari <git@status.e4ward.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License version 2 as published by
-+ * the Free Software Foundation.
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/slab.h>
-+#include <linux/serio.h>
-+#include <linux/libps2.h>
-+#include <linux/input.h>
-+#include <linux/input/mt.h>
-+#include <linux/sched.h>
-+#include <linux/wait.h>
-+
-+#include "cypress_ps2.h"
-+
-+#undef CYTP_DEBUG_VERBOSE /* define this and DEBUG for more verbose dump */
-+
-+static void cypress_set_packet_size(struct psmouse *psmouse, unsigned int n)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+ cytp->pkt_size = n;
-+}
-+
-+static const unsigned char cytp_rate[] = {10, 20, 40, 60, 100, 200};
-+static const unsigned char cytp_resolution[] = {0x00, 0x01, 0x02, 0x03};
-+
-+static int cypress_ps2_sendbyte(struct psmouse *psmouse, int value)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+
-+ if (ps2_sendbyte(ps2dev, value & 0xff, CYTP_CMD_TIMEOUT) < 0) {
-+ psmouse_dbg(psmouse,
-+ "sending command 0x%02x failed, resp 0x%02x\n",
-+ value & 0xff, ps2dev->nak);
-+ if (ps2dev->nak == CYTP_PS2_RETRY)
-+ return CYTP_PS2_RETRY;
-+ else
-+ return CYTP_PS2_ERROR;
-+ }
-+
-+#ifdef CYTP_DEBUG_VERBOSE
-+ psmouse_dbg(psmouse, "sending command 0x%02x succeeded, resp 0xfa\n",
-+ value & 0xff);
-+#endif
-+
-+ return 0;
-+}
-+
-+static int cypress_ps2_ext_cmd(struct psmouse *psmouse, unsigned short cmd,
-+ unsigned char data)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+ int tries = CYTP_PS2_CMD_TRIES;
-+ int rc;
-+
-+ ps2_begin_command(ps2dev);
-+
-+ do {
-+ /*
-+ * Send extension command byte (0xE8 or 0xF3).
-+ * If sending the command fails, send recovery command
-+ * to make the device return to the ready state.
-+ */
-+ rc = cypress_ps2_sendbyte(psmouse, cmd & 0xff);
-+ if (rc == CYTP_PS2_RETRY) {
-+ rc = cypress_ps2_sendbyte(psmouse, 0x00);
-+ if (rc == CYTP_PS2_RETRY)
-+ rc = cypress_ps2_sendbyte(psmouse, 0x0a);
-+ }
-+ if (rc == CYTP_PS2_ERROR)
-+ continue;
-+
-+ rc = cypress_ps2_sendbyte(psmouse, data);
-+ if (rc == CYTP_PS2_RETRY)
-+ rc = cypress_ps2_sendbyte(psmouse, data);
-+ if (rc == CYTP_PS2_ERROR)
-+ continue;
-+ else
-+ break;
-+ } while (--tries > 0);
-+
-+ ps2_end_command(ps2dev);
-+
-+ return rc;
-+}
-+
-+static int cypress_ps2_read_cmd_status(struct psmouse *psmouse,
-+ unsigned char cmd,
-+ unsigned char *param)
-+{
-+ int rc;
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+ enum psmouse_state old_state;
-+ int pktsize;
-+
-+ ps2_begin_command(&psmouse->ps2dev);
-+
-+ old_state = psmouse->state;
-+ psmouse->state = PSMOUSE_CMD_MODE;
-+ psmouse->pktcnt = 0;
-+
-+ pktsize = (cmd == CYTP_CMD_READ_TP_METRICS) ? 8 : 3;
-+ memset(param, 0, pktsize);
-+
-+ rc = cypress_ps2_sendbyte(psmouse, 0xe9);
-+ if (rc < 0)
-+ goto out;
-+
-+ wait_event_timeout(ps2dev->wait,
-+ (psmouse->pktcnt >= pktsize),
-+ msecs_to_jiffies(CYTP_CMD_TIMEOUT));
-+
-+ memcpy(param, psmouse->packet, pktsize);
-+
-+ psmouse_dbg(psmouse, "Command 0x%02x response data (0x): %*ph\n",
-+ cmd, pktsize, param);
-+
-+out:
-+ psmouse->state = old_state;
-+ psmouse->pktcnt = 0;
-+
-+ ps2_end_command(&psmouse->ps2dev);
-+
-+ return rc;
-+}
-+
-+static bool cypress_verify_cmd_state(struct psmouse *psmouse,
-+ unsigned char cmd, unsigned char *param)
-+{
-+ bool rate_match = false;
-+ bool resolution_match = false;
-+ int i;
-+
-+ /* callers will do further checking. */
-+ if (cmd == CYTP_CMD_READ_CYPRESS_ID ||
-+ cmd == CYTP_CMD_STANDARD_MODE ||
-+ cmd == CYTP_CMD_READ_TP_METRICS)
-+ return true;
-+
-+ if ((~param[0] & DFLT_RESP_BITS_VALID) == DFLT_RESP_BITS_VALID &&
-+ (param[0] & DFLT_RESP_BIT_MODE) == DFLT_RESP_STREAM_MODE) {
-+ for (i = 0; i < sizeof(cytp_resolution); i++)
-+ if (cytp_resolution[i] == param[1])
-+ resolution_match = true;
-+
-+ for (i = 0; i < sizeof(cytp_rate); i++)
-+ if (cytp_rate[i] == param[2])
-+ rate_match = true;
-+
-+ if (resolution_match && rate_match)
-+ return true;
-+ }
-+
-+ psmouse_dbg(psmouse, "verify cmd state failed.\n");
-+ return false;
-+}
-+
-+static int cypress_send_ext_cmd(struct psmouse *psmouse, unsigned char cmd,
-+ unsigned char *param)
-+{
-+ int tries = CYTP_PS2_CMD_TRIES;
-+ int rc;
-+
-+ psmouse_dbg(psmouse, "send extension cmd 0x%02x, [%d %d %d %d]\n",
-+ cmd, DECODE_CMD_AA(cmd), DECODE_CMD_BB(cmd),
-+ DECODE_CMD_CC(cmd), DECODE_CMD_DD(cmd));
-+
-+ do {
-+ cypress_ps2_ext_cmd(psmouse,
-+ PSMOUSE_CMD_SETRES, DECODE_CMD_DD(cmd));
-+ cypress_ps2_ext_cmd(psmouse,
-+ PSMOUSE_CMD_SETRES, DECODE_CMD_CC(cmd));
-+ cypress_ps2_ext_cmd(psmouse,
-+ PSMOUSE_CMD_SETRES, DECODE_CMD_BB(cmd));
-+ cypress_ps2_ext_cmd(psmouse,
-+ PSMOUSE_CMD_SETRES, DECODE_CMD_AA(cmd));
-+
-+ rc = cypress_ps2_read_cmd_status(psmouse, cmd, param);
-+ if (rc)
-+ continue;
-+
-+ if (cypress_verify_cmd_state(psmouse, cmd, param))
-+ return 0;
-+
-+ } while (--tries > 0);
-+
-+ return -EIO;
-+}
-+
-+int cypress_detect(struct psmouse *psmouse, bool set_properties)
-+{
-+ unsigned char param[3];
-+
-+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_CYPRESS_ID, param))
-+ return -ENODEV;
-+
-+ /* Check for Cypress Trackpad signature bytes: 0x33 0xCC */
-+ if (param[0] != 0x33 || param[1] != 0xCC)
-+ return -ENODEV;
-+
-+ if (set_properties) {
-+ psmouse->vendor = "Cypress";
-+ psmouse->name = "Trackpad";
-+ }
-+
-+ return 0;
-+}
-+
-+static int cypress_read_fw_version(struct psmouse *psmouse)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+ unsigned char param[3];
-+
-+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_CYPRESS_ID, param))
-+ return -ENODEV;
-+
-+ /* Check for Cypress Trackpad signature bytes: 0x33 0xCC */
-+ if (param[0] != 0x33 || param[1] != 0xCC)
-+ return -ENODEV;
-+
-+ cytp->fw_version = param[2] & FW_VERSION_MASX;
-+ cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0;
-+
-+ psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version);
-+ psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n",
-+ cytp->tp_metrics_supported);
-+
-+ return 0;
-+}
-+
-+static int cypress_read_tp_metrics(struct psmouse *psmouse)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+ unsigned char param[8];
-+
-+ /* set default values for tp metrics. */
-+ cytp->tp_width = CYTP_DEFAULT_WIDTH;
-+ cytp->tp_high = CYTP_DEFAULT_HIGH;
-+ cytp->tp_max_abs_x = CYTP_ABS_MAX_X;
-+ cytp->tp_max_abs_y = CYTP_ABS_MAX_Y;
-+ cytp->tp_min_pressure = CYTP_MIN_PRESSURE;
-+ cytp->tp_max_pressure = CYTP_MAX_PRESSURE;
-+ cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width;
-+ cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high;
-+
-+ memset(param, 0, sizeof(param));
-+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_TP_METRICS, param) == 0) {
-+ /* Update trackpad parameters. */
-+ cytp->tp_max_abs_x = (param[1] << 8) | param[0];
-+ cytp->tp_max_abs_y = (param[3] << 8) | param[2];
-+ cytp->tp_min_pressure = param[4];
-+ cytp->tp_max_pressure = param[5];
-+ }
-+
-+ if (!cytp->tp_max_pressure ||
-+ cytp->tp_max_pressure < cytp->tp_min_pressure ||
-+ !cytp->tp_width || !cytp->tp_high ||
-+ !cytp->tp_max_abs_x ||
-+ cytp->tp_max_abs_x < cytp->tp_width ||
-+ !cytp->tp_max_abs_y ||
-+ cytp->tp_max_abs_y < cytp->tp_high)
-+ return -EINVAL;
-+
-+ cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width;
-+ cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high;
-+
-+#ifdef CYTP_DEBUG_VERBOSE
-+ psmouse_dbg(psmouse, "Dump trackpad hardware configuration as below:\n");
-+ psmouse_dbg(psmouse, "cytp->tp_width = %d\n", cytp->tp_width);
-+ psmouse_dbg(psmouse, "cytp->tp_high = %d\n", cytp->tp_high);
-+ psmouse_dbg(psmouse, "cytp->tp_max_abs_x = %d\n", cytp->tp_max_abs_x);
-+ psmouse_dbg(psmouse, "cytp->tp_max_abs_y = %d\n", cytp->tp_max_abs_y);
-+ psmouse_dbg(psmouse, "cytp->tp_min_pressure = %d\n", cytp->tp_min_pressure);
-+ psmouse_dbg(psmouse, "cytp->tp_max_pressure = %d\n", cytp->tp_max_pressure);
-+ psmouse_dbg(psmouse, "cytp->tp_res_x = %d\n", cytp->tp_res_x);
-+ psmouse_dbg(psmouse, "cytp->tp_res_y = %d\n", cytp->tp_res_y);
-+
-+ psmouse_dbg(psmouse, "tp_type_APA = %d\n",
-+ (param[6] & TP_METRICS_BIT_APA) ? 1 : 0);
-+ psmouse_dbg(psmouse, "tp_type_MTG = %d\n",
-+ (param[6] & TP_METRICS_BIT_MTG) ? 1 : 0);
-+ psmouse_dbg(psmouse, "tp_palm = %d\n",
-+ (param[6] & TP_METRICS_BIT_PALM) ? 1 : 0);
-+ psmouse_dbg(psmouse, "tp_stubborn = %d\n",
-+ (param[6] & TP_METRICS_BIT_STUBBORN) ? 1 : 0);
-+ psmouse_dbg(psmouse, "tp_1f_jitter = %d\n",
-+ (param[6] & TP_METRICS_BIT_1F_JITTER) >> 2);
-+ psmouse_dbg(psmouse, "tp_2f_jitter = %d\n",
-+ (param[6] & TP_METRICS_BIT_2F_JITTER) >> 4);
-+ psmouse_dbg(psmouse, "tp_1f_spike = %d\n",
-+ param[7] & TP_METRICS_BIT_1F_SPIKE);
-+ psmouse_dbg(psmouse, "tp_2f_spike = %d\n",
-+ (param[7] & TP_METRICS_BIT_2F_SPIKE) >> 2);
-+ psmouse_dbg(psmouse, "tp_abs_packet_format_set = %d\n",
-+ (param[7] & TP_METRICS_BIT_ABS_PKT_FORMAT_SET) >> 4);
-+#endif
-+
-+ return 0;
-+}
-+
-+static int cypress_query_hardware(struct psmouse *psmouse)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+ int ret;
-+
-+ ret = cypress_read_fw_version(psmouse);
-+ if (ret)
-+ return ret;
-+
-+ if (cytp->tp_metrics_supported) {
-+ ret = cypress_read_tp_metrics(psmouse);
-+ if (ret)
-+ return ret;
-+ }
-+
-+ return 0;
-+}
-+
-+static int cypress_set_absolute_mode(struct psmouse *psmouse)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+ unsigned char param[3];
-+
-+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_ABS_WITH_PRESSURE_MODE, param) < 0)
-+ return -1;
-+
-+ cytp->mode = (cytp->mode & ~CYTP_BIT_ABS_REL_MASK)
-+ | CYTP_BIT_ABS_PRESSURE;
-+ cypress_set_packet_size(psmouse, 5);
-+
-+ return 0;
-+}
-+
-+/*
-+ * Reset trackpad device.
-+ * This is also the default mode when trackpad powered on.
-+ */
-+static void cypress_reset(struct psmouse *psmouse)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+
-+ cytp->mode = 0;
-+
-+ psmouse_reset(psmouse);
-+}
-+
-+static int cypress_set_input_params(struct input_dev *input,
-+ struct cytp_data *cytp)
-+{
-+ int ret;
-+
-+ if (!cytp->tp_res_x || !cytp->tp_res_y)
-+ return -EINVAL;
-+
-+ __set_bit(EV_ABS, input->evbit);
-+ input_set_abs_params(input, ABS_X, 0, cytp->tp_max_abs_x, 0, 0);
-+ input_set_abs_params(input, ABS_Y, 0, cytp->tp_max_abs_y, 0, 0);
-+ input_set_abs_params(input, ABS_PRESSURE,
-+ cytp->tp_min_pressure, cytp->tp_max_pressure, 0, 0);
-+ input_set_abs_params(input, ABS_TOOL_WIDTH, 0, 255, 0, 0);
-+
-+ /* finger position */
-+ input_set_abs_params(input, ABS_MT_POSITION_X, 0, cytp->tp_max_abs_x, 0, 0);
-+ input_set_abs_params(input, ABS_MT_POSITION_Y, 0, cytp->tp_max_abs_y, 0, 0);
-+ input_set_abs_params(input, ABS_MT_PRESSURE, 0, 255, 0, 0);
-+
-+ ret = input_mt_init_slots(input, CYTP_MAX_MT_SLOTS,
-+ INPUT_MT_DROP_UNUSED|INPUT_MT_TRACK);
-+ if (ret < 0)
-+ return ret;
-+
-+ __set_bit(INPUT_PROP_SEMI_MT, input->propbit);
-+
-+ input_abs_set_res(input, ABS_X, cytp->tp_res_x);
-+ input_abs_set_res(input, ABS_Y, cytp->tp_res_y);
-+
-+ input_abs_set_res(input, ABS_MT_POSITION_X, cytp->tp_res_x);
-+ input_abs_set_res(input, ABS_MT_POSITION_Y, cytp->tp_res_y);
-+
-+ __set_bit(BTN_TOUCH, input->keybit);
-+ __set_bit(BTN_TOOL_FINGER, input->keybit);
-+ __set_bit(BTN_TOOL_DOUBLETAP, input->keybit);
-+ __set_bit(BTN_TOOL_TRIPLETAP, input->keybit);
-+ __set_bit(BTN_TOOL_QUADTAP, input->keybit);
-+ __set_bit(BTN_TOOL_QUINTTAP, input->keybit);
-+
-+ __clear_bit(EV_REL, input->evbit);
-+ __clear_bit(REL_X, input->relbit);
-+ __clear_bit(REL_Y, input->relbit);
-+
-+ __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
-+ __set_bit(EV_KEY, input->evbit);
-+ __set_bit(BTN_LEFT, input->keybit);
-+ __set_bit(BTN_RIGHT, input->keybit);
-+ __set_bit(BTN_MIDDLE, input->keybit);
-+
-+ input_set_drvdata(input, cytp);
-+
-+ return 0;
-+}
-+
-+static int cypress_get_finger_count(unsigned char header_byte)
-+{
-+ unsigned char bits6_7;
-+ int finger_count;
-+
-+ bits6_7 = header_byte >> 6;
-+ finger_count = bits6_7 & 0x03;
-+
-+ if (finger_count == 1)
-+ return 1;
-+
-+ if (header_byte & ABS_HSCROLL_BIT) {
-+ /* HSCROLL gets added on to 0 finger count. */
-+ switch (finger_count) {
-+ case 0: return 4;
-+ case 2: return 5;
-+ default:
-+ /* Invalid contact (e.g. palm). Ignore it. */
-+ return -1;
-+ }
-+ }
-+
-+ return finger_count;
-+}
-+
-+
-+static int cypress_parse_packet(struct psmouse *psmouse,
-+ struct cytp_data *cytp, struct cytp_report_data *report_data)
-+{
-+ unsigned char *packet = psmouse->packet;
-+ unsigned char header_byte = packet[0];
-+ int contact_cnt;
-+
-+ memset(report_data, 0, sizeof(struct cytp_report_data));
-+
-+ contact_cnt = cypress_get_finger_count(header_byte);
-+
-+ if (contact_cnt < 0) /* e.g. palm detect */
-+ return -EINVAL;
-+
-+ report_data->contact_cnt = contact_cnt;
-+
-+ report_data->tap = (header_byte & ABS_MULTIFINGER_TAP) ? 1 : 0;
-+
-+ if (report_data->contact_cnt == 1) {
-+ report_data->contacts[0].x =
-+ ((packet[1] & 0x70) << 4) | packet[2];
-+ report_data->contacts[0].y =
-+ ((packet[1] & 0x07) << 8) | packet[3];
-+ if (cytp->mode & CYTP_BIT_ABS_PRESSURE)
-+ report_data->contacts[0].z = packet[4];
-+
-+ } else if (report_data->contact_cnt >= 2) {
-+ report_data->contacts[0].x =
-+ ((packet[1] & 0x70) << 4) | packet[2];
-+ report_data->contacts[0].y =
-+ ((packet[1] & 0x07) << 8) | packet[3];
-+ if (cytp->mode & CYTP_BIT_ABS_PRESSURE)
-+ report_data->contacts[0].z = packet[4];
-+
-+ report_data->contacts[1].x =
-+ ((packet[5] & 0xf0) << 4) | packet[6];
-+ report_data->contacts[1].y =
-+ ((packet[5] & 0x0f) << 8) | packet[7];
-+ if (cytp->mode & CYTP_BIT_ABS_PRESSURE)
-+ report_data->contacts[1].z = report_data->contacts[0].z;
-+ }
-+
-+ report_data->left = (header_byte & BTN_LEFT_BIT) ? 1 : 0;
-+ report_data->right = (header_byte & BTN_RIGHT_BIT) ? 1 : 0;
-+
-+ /*
-+ * This is only true if one of the mouse buttons were tapped. Make
-+ * sure it doesn't turn into a click. The regular tap-to-click
-+ * functionality will handle that on its own. If we don't do this,
-+ * disabling tap-to-click won't affect the mouse button zones.
-+ */
-+ if (report_data->tap)
-+ report_data->left = 0;
-+
-+#ifdef CYTP_DEBUG_VERBOSE
-+ {
-+ int i;
-+ int n = report_data->contact_cnt;
-+ psmouse_dbg(psmouse, "Dump parsed report data as below:\n");
-+ psmouse_dbg(psmouse, "contact_cnt = %d\n",
-+ report_data->contact_cnt);
-+ if (n > CYTP_MAX_MT_SLOTS)
-+ n = CYTP_MAX_MT_SLOTS;
-+ for (i = 0; i < n; i++)
-+ psmouse_dbg(psmouse, "contacts[%d] = {%d, %d, %d}\n", i,
-+ report_data->contacts[i].x,
-+ report_data->contacts[i].y,
-+ report_data->contacts[i].z);
-+ psmouse_dbg(psmouse, "left = %d\n", report_data->left);
-+ psmouse_dbg(psmouse, "right = %d\n", report_data->right);
-+ psmouse_dbg(psmouse, "middle = %d\n", report_data->middle);
-+ }
-+#endif
-+
-+ return 0;
-+}
-+
-+static void cypress_process_packet(struct psmouse *psmouse, bool zero_pkt)
-+{
-+ int i;
-+ struct input_dev *input = psmouse->dev;
-+ struct cytp_data *cytp = psmouse->private;
-+ struct cytp_report_data report_data;
-+ struct cytp_contact *contact;
-+ struct input_mt_pos pos[CYTP_MAX_MT_SLOTS];
-+ int slots[CYTP_MAX_MT_SLOTS];
-+ int n;
-+
-+ if (cypress_parse_packet(psmouse, cytp, &report_data))
-+ return;
-+
-+ n = report_data.contact_cnt;
-+
-+ if (n > CYTP_MAX_MT_SLOTS)
-+ n = CYTP_MAX_MT_SLOTS;
-+
-+ for (i = 0; i < n; i++) {
-+ contact = &report_data.contacts[i];
-+ pos[i].x = contact->x;
-+ pos[i].y = contact->y;
-+ }
-+
-+ input_mt_assign_slots(input, slots, pos, n);
-+
-+ for (i = 0; i < n; i++) {
-+ contact = &report_data.contacts[i];
-+ input_mt_slot(input, slots[i]);
-+ input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
-+ input_report_abs(input, ABS_MT_POSITION_X, contact->x);
-+ input_report_abs(input, ABS_MT_POSITION_Y, contact->y);
-+ input_report_abs(input, ABS_MT_PRESSURE, contact->z);
-+ }
-+
-+ input_mt_sync_frame(input);
-+
-+ input_mt_report_finger_count(input, report_data.contact_cnt);
-+
-+ input_report_key(input, BTN_LEFT, report_data.left);
-+ input_report_key(input, BTN_RIGHT, report_data.right);
-+ input_report_key(input, BTN_MIDDLE, report_data.middle);
-+
-+ input_sync(input);
-+}
-+
-+static psmouse_ret_t cypress_validate_byte(struct psmouse *psmouse)
-+{
-+ int contact_cnt;
-+ int index = psmouse->pktcnt - 1;
-+ unsigned char *packet = psmouse->packet;
-+ struct cytp_data *cytp = psmouse->private;
-+
-+ if (index < 0 || index > cytp->pkt_size)
-+ return PSMOUSE_BAD_DATA;
-+
-+ if (index == 0 && (packet[0] & 0xfc) == 0) {
-+ /* call packet process for reporting finger leave. */
-+ cypress_process_packet(psmouse, 1);
-+ return PSMOUSE_FULL_PACKET;
-+ }
-+
-+ /*
-+ * Perform validation (and adjust packet size) based only on the
-+ * first byte; allow all further bytes through.
-+ */
-+ if (index != 0)
-+ return PSMOUSE_GOOD_DATA;
-+
-+ /*
-+ * If absolute/relative mode bit has not been set yet, just pass
-+ * the byte through.
-+ */
-+ if ((cytp->mode & CYTP_BIT_ABS_REL_MASK) == 0)
-+ return PSMOUSE_GOOD_DATA;
-+
-+ if ((packet[0] & 0x08) == 0x08)
-+ return PSMOUSE_BAD_DATA;
-+
-+ contact_cnt = cypress_get_finger_count(packet[0]);
-+
-+ if (contact_cnt < 0)
-+ return PSMOUSE_BAD_DATA;
-+
-+ if (cytp->mode & CYTP_BIT_ABS_NO_PRESSURE)
-+ cypress_set_packet_size(psmouse, contact_cnt == 2 ? 7 : 4);
-+ else
-+ cypress_set_packet_size(psmouse, contact_cnt == 2 ? 8 : 5);
-+
-+ return PSMOUSE_GOOD_DATA;
-+}
-+
-+static psmouse_ret_t cypress_protocol_handler(struct psmouse *psmouse)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+
-+ if (psmouse->pktcnt >= cytp->pkt_size) {
-+ cypress_process_packet(psmouse, 0);
-+ return PSMOUSE_FULL_PACKET;
-+ }
-+
-+ return cypress_validate_byte(psmouse);
-+}
-+
-+static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate)
-+{
-+ struct cytp_data *cytp = psmouse->private;
-+
-+ if (rate >= 80) {
-+ psmouse->rate = 80;
-+ cytp->mode |= CYTP_BIT_HIGH_RATE;
-+ } else {
-+ psmouse->rate = 40;
-+ cytp->mode &= ~CYTP_BIT_HIGH_RATE;
-+ }
-+
-+ ps2_command(&psmouse->ps2dev, (unsigned char *)&psmouse->rate,
-+ PSMOUSE_CMD_SETRATE);
-+}
-+
-+static void cypress_disconnect(struct psmouse *psmouse)
-+{
-+ cypress_reset(psmouse);
-+ kfree(psmouse->private);
-+ psmouse->private = NULL;
-+}
-+
-+static int cypress_reconnect(struct psmouse *psmouse)
-+{
-+ int tries = CYTP_PS2_CMD_TRIES;
-+ int rc;
-+
-+ do {
-+ cypress_reset(psmouse);
-+ rc = cypress_detect(psmouse, false);
-+ } while (rc && (--tries > 0));
-+
-+ if (rc) {
-+ psmouse_err(psmouse, "Reconnect: unable to detect trackpad.\n");
-+ return -1;
-+ }
-+
-+ if (cypress_set_absolute_mode(psmouse)) {
-+ psmouse_err(psmouse, "Reconnect: Unable to initialize Cypress absolute mode.\n");
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+
-+int cypress_init(struct psmouse *psmouse)
-+{
-+ struct cytp_data *cytp;
-+
-+ cytp = (struct cytp_data *)kzalloc(sizeof(struct cytp_data), GFP_KERNEL);
-+ psmouse->private = (void *)cytp;
-+ if (cytp == NULL)
-+ return -ENOMEM;
-+
-+ cypress_reset(psmouse);
-+
-+ psmouse->pktsize = 8;
-+
-+ if (cypress_query_hardware(psmouse)) {
-+ psmouse_err(psmouse, "Unable to query Trackpad hardware.\n");
-+ goto err_exit;
-+ }
-+
-+ if (cypress_set_absolute_mode(psmouse)) {
-+ psmouse_err(psmouse, "init: Unable to initialize Cypress absolute mode.\n");
-+ goto err_exit;
-+ }
-+
-+ if (cypress_set_input_params(psmouse->dev, cytp) < 0) {
-+ psmouse_err(psmouse, "init: Unable to set input params.\n");
-+ goto err_exit;
-+ }
-+
-+ psmouse->model = 1;
-+ psmouse->protocol_handler = cypress_protocol_handler;
-+ psmouse->set_rate = cypress_set_rate;
-+ psmouse->disconnect = cypress_disconnect;
-+ psmouse->reconnect = cypress_reconnect;
-+ psmouse->cleanup = cypress_reset;
-+ psmouse->resync_time = 0;
-+
-+ return 0;
-+
-+err_exit:
-+ /*
-+ * Reset Cypress Trackpad as a standard mouse. Then
-+ * let psmouse driver commmunicating with it as default PS2 mouse.
-+ */
-+ cypress_reset(psmouse);
-+
-+ psmouse->private = NULL;
-+ kfree(cytp);
-+
-+ return -1;
-+}
-+
-+bool cypress_supported(void)
-+{
-+ return true;
-+}
-diff --git a/drivers/input/mouse/cypress_ps2.h b/drivers/input/mouse/cypress_ps2.h
-new file mode 100644
-index 0000000..4720f21
---- /dev/null
-+++ b/drivers/input/mouse/cypress_ps2.h
-@@ -0,0 +1,191 @@
-+#ifndef _CYPRESS_PS2_H
-+#define _CYPRESS_PS2_H
-+
-+#include "psmouse.h"
-+
-+#define CMD_BITS_MASK 0x03
-+#define COMPOSIT(x, s) (((x) & CMD_BITS_MASK) << (s))
-+
-+#define ENCODE_CMD(aa, bb, cc, dd) \
-+ (COMPOSIT((aa), 6) | COMPOSIT((bb), 4) | COMPOSIT((cc), 2) | COMPOSIT((dd), 0))
-+#define CYTP_CMD_ABS_NO_PRESSURE_MODE ENCODE_CMD(0, 1, 0, 0)
-+#define CYTP_CMD_ABS_WITH_PRESSURE_MODE ENCODE_CMD(0, 1, 0, 1)
-+#define CYTP_CMD_SMBUS_MODE ENCODE_CMD(0, 1, 1, 0)
-+#define CYTP_CMD_STANDARD_MODE ENCODE_CMD(0, 2, 0, 0) /* not implemented yet. */
-+#define CYTP_CMD_CYPRESS_REL_MODE ENCODE_CMD(1, 1, 1, 1) /* not implemented yet. */
-+#define CYTP_CMD_READ_CYPRESS_ID ENCODE_CMD(0, 0, 0, 0)
-+#define CYTP_CMD_READ_TP_METRICS ENCODE_CMD(0, 0, 0, 1)
-+#define CYTP_CMD_SET_HSCROLL_WIDTH(w) ENCODE_CMD(1, 1, 0, (w))
-+#define CYTP_CMD_SET_HSCROLL_MASK ENCODE_CMD(1, 1, 0, 0)
-+#define CYTP_CMD_SET_VSCROLL_WIDTH(w) ENCODE_CMD(1, 2, 0, (w))
-+#define CYTP_CMD_SET_VSCROLL_MASK ENCODE_CMD(1, 2, 0, 0)
-+#define CYTP_CMD_SET_PALM_GEOMETRY(e) ENCODE_CMD(1, 2, 1, (e))
-+#define CYTP_CMD_PALM_GEMMETRY_MASK ENCODE_CMD(1, 2, 1, 0)
-+#define CYTP_CMD_SET_PALM_SENSITIVITY(s) ENCODE_CMD(1, 2, 2, (s))
-+#define CYTP_CMD_PALM_SENSITIVITY_MASK ENCODE_CMD(1, 2, 2, 0)
-+#define CYTP_CMD_SET_MOUSE_SENSITIVITY(s) ENCODE_CMD(1, 3, ((s) >> 2), (s))
-+#define CYTP_CMD_MOUSE_SENSITIVITY_MASK ENCODE_CMD(1, 3, 0, 0)
-+#define CYTP_CMD_REQUEST_BASELINE_STATUS ENCODE_CMD(2, 0, 0, 1)
-+#define CYTP_CMD_REQUEST_RECALIBRATION ENCODE_CMD(2, 0, 0, 3)
-+
-+#define DECODE_CMD_AA(x) (((x) >> 6) & CMD_BITS_MASK)
-+#define DECODE_CMD_BB(x) (((x) >> 4) & CMD_BITS_MASK)
-+#define DECODE_CMD_CC(x) (((x) >> 2) & CMD_BITS_MASK)
-+#define DECODE_CMD_DD(x) ((x) & CMD_BITS_MASK)
-+
-+/* Cypress trackpad working mode. */
-+#define CYTP_BIT_ABS_PRESSURE (1 << 3)
-+#define CYTP_BIT_ABS_NO_PRESSURE (1 << 2)
-+#define CYTP_BIT_CYPRESS_REL (1 << 1)
-+#define CYTP_BIT_STANDARD_REL (1 << 0)
-+#define CYTP_BIT_REL_MASK (CYTP_BIT_CYPRESS_REL | CYTP_BIT_STANDARD_REL)
-+#define CYTP_BIT_ABS_MASK (CYTP_BIT_ABS_PRESSURE | CYTP_BIT_ABS_NO_PRESSURE)
-+#define CYTP_BIT_ABS_REL_MASK (CYTP_BIT_ABS_MASK | CYTP_BIT_REL_MASK)
-+
-+#define CYTP_BIT_HIGH_RATE (1 << 4)
-+/*
-+ * report mode bit is set, firmware working in Remote Mode.
-+ * report mode bit is cleared, firmware working in Stream Mode.
-+ */
-+#define CYTP_BIT_REPORT_MODE (1 << 5)
-+
-+/* scrolling width values for set HSCROLL and VSCROLL width command. */
-+#define SCROLL_WIDTH_NARROW 1
-+#define SCROLL_WIDTH_NORMAL 2
-+#define SCROLL_WIDTH_WIDE 3
-+
-+#define PALM_GEOMETRY_ENABLE 1
-+#define PALM_GEOMETRY_DISABLE 0
-+
-+#define TP_METRICS_MASK 0x80
-+#define FW_VERSION_MASX 0x7f
-+#define FW_VER_HIGH_MASK 0x70
-+#define FW_VER_LOW_MASK 0x0f
-+
-+/* Times to retry a ps2_command and millisecond delay between tries. */
-+#define CYTP_PS2_CMD_TRIES 3
-+#define CYTP_PS2_CMD_DELAY 500
-+
-+/* time out for PS/2 command only in milliseconds. */
-+#define CYTP_CMD_TIMEOUT 200
-+#define CYTP_DATA_TIMEOUT 30
-+
-+#define CYTP_EXT_CMD 0xe8
-+#define CYTP_PS2_RETRY 0xfe
-+#define CYTP_PS2_ERROR 0xfc
-+
-+#define CYTP_RESP_RETRY 0x01
-+#define CYTP_RESP_ERROR 0xfe
-+
-+
-+#define CYTP_105001_WIDTH 97 /* Dell XPS 13 */
-+#define CYTP_105001_HIGH 59
-+#define CYTP_DEFAULT_WIDTH (CYTP_105001_WIDTH)
-+#define CYTP_DEFAULT_HIGH (CYTP_105001_HIGH)
-+
-+#define CYTP_ABS_MAX_X 1600
-+#define CYTP_ABS_MAX_Y 900
-+#define CYTP_MAX_PRESSURE 255
-+#define CYTP_MIN_PRESSURE 0
-+
-+/* header byte bits of relative package. */
-+#define BTN_LEFT_BIT 0x01
-+#define BTN_RIGHT_BIT 0x02
-+#define BTN_MIDDLE_BIT 0x04
-+#define REL_X_SIGN_BIT 0x10
-+#define REL_Y_SIGN_BIT 0x20
-+
-+/* header byte bits of absolute package. */
-+#define ABS_VSCROLL_BIT 0x10
-+#define ABS_HSCROLL_BIT 0x20
-+#define ABS_MULTIFINGER_TAP 0x04
-+#define ABS_EDGE_MOTION_MASK 0x80
-+
-+#define DFLT_RESP_BITS_VALID 0x88 /* SMBus bit should not be set. */
-+#define DFLT_RESP_SMBUS_BIT 0x80
-+#define DFLT_SMBUS_MODE 0x80
-+#define DFLT_PS2_MODE 0x00
-+#define DFLT_RESP_BIT_MODE 0x40
-+#define DFLT_RESP_REMOTE_MODE 0x40
-+#define DFLT_RESP_STREAM_MODE 0x00
-+#define DFLT_RESP_BIT_REPORTING 0x20
-+#define DFLT_RESP_BIT_SCALING 0x10
-+
-+#define TP_METRICS_BIT_PALM 0x80
-+#define TP_METRICS_BIT_STUBBORN 0x40
-+#define TP_METRICS_BIT_2F_JITTER 0x30
-+#define TP_METRICS_BIT_1F_JITTER 0x0c
-+#define TP_METRICS_BIT_APA 0x02
-+#define TP_METRICS_BIT_MTG 0x01
-+#define TP_METRICS_BIT_ABS_PKT_FORMAT_SET 0xf0
-+#define TP_METRICS_BIT_2F_SPIKE 0x0c
-+#define TP_METRICS_BIT_1F_SPIKE 0x03
-+
-+/* bits of first byte response of E9h-Status Request command. */
-+#define RESP_BTN_RIGHT_BIT 0x01
-+#define RESP_BTN_MIDDLE_BIT 0x02
-+#define RESP_BTN_LEFT_BIT 0x04
-+#define RESP_SCALING_BIT 0x10
-+#define RESP_ENABLE_BIT 0x20
-+#define RESP_REMOTE_BIT 0x40
-+#define RESP_SMBUS_BIT 0x80
-+
-+#define CYTP_MAX_MT_SLOTS 2
-+
-+struct cytp_contact {
-+ int x;
-+ int y;
-+ int z; /* also named as touch pressure. */
-+};
-+
-+/* The structure of Cypress Trackpad event data. */
-+struct cytp_report_data {
-+ int contact_cnt;
-+ struct cytp_contact contacts[CYTP_MAX_MT_SLOTS];
-+ unsigned int left:1;
-+ unsigned int right:1;
-+ unsigned int middle:1;
-+ unsigned int tap:1; /* multi-finger tap detected. */
-+};
-+
-+/* The structure of Cypress Trackpad device private data. */
-+struct cytp_data {
-+ int fw_version;
-+
-+ int pkt_size;
-+ int mode;
-+
-+ int tp_min_pressure;
-+ int tp_max_pressure;
-+ int tp_width; /* X direction physical size in mm. */
-+ int tp_high; /* Y direction physical size in mm. */
-+ int tp_max_abs_x; /* Max X absolute units that can be reported. */
-+ int tp_max_abs_y; /* Max Y absolute units that can be reported. */
-+
-+ int tp_res_x; /* X resolution in units/mm. */
-+ int tp_res_y; /* Y resolution in units/mm. */
-+
-+ int tp_metrics_supported;
-+};
-+
-+
-+#ifdef CONFIG_MOUSE_PS2_CYPRESS
-+int cypress_detect(struct psmouse *psmouse, bool set_properties);
-+int cypress_init(struct psmouse *psmouse);
-+bool cypress_supported(void);
-+#else
-+inline int cypress_detect(struct psmouse *psmouse, bool set_properties)
-+{
-+ return -ENOSYS;
-+}
-+inline int cypress_init(struct psmouse *psmouse)
-+{
-+ return -ENOSYS;
-+}
-+inline bool cypress_supported(void)
-+{
-+ return 0;
-+}
-+#endif /* CONFIG_MOUSE_PS2_CYPRESS */
-+
-+#endif /* _CYPRESS_PS2_H */
-diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
-index 22fe254..cff065f 100644
---- a/drivers/input/mouse/psmouse-base.c
-+++ b/drivers/input/mouse/psmouse-base.c
-@@ -34,6 +34,7 @@
- #include "touchkit_ps2.h"
- #include "elantech.h"
- #include "sentelic.h"
-+#include "cypress_ps2.h"
-
- #define DRIVER_DESC "PS/2 mouse driver"
-
-@@ -759,6 +760,28 @@ static int psmouse_extensions(struct psmouse *psmouse,
- }
-
- /*
-+ * Try Cypress Trackpad.
-+ * Must try it before Finger Sensing Pad because Finger Sensing Pad probe
-+ * upsets some modules of Cypress Trackpads.
-+ */
-+ if (max_proto > PSMOUSE_IMEX &&
-+ cypress_detect(psmouse, set_properties) == 0) {
-+ if (cypress_supported()) {
-+ if (cypress_init(psmouse) == 0)
-+ return PSMOUSE_CYPRESS;
-+
-+ /*
-+ * Finger Sensing Pad probe upsets some modules of
-+ * Cypress Trackpad, must avoid Finger Sensing Pad
-+ * probe if Cypress Trackpad device detected.
-+ */
-+ return PSMOUSE_PS2;
-+ }
-+
-+ max_proto = PSMOUSE_IMEX;
-+ }
-+
-+/*
- * Try ALPS TouchPad
- */
- if (max_proto > PSMOUSE_IMEX) {
-@@ -896,6 +919,15 @@ static const struct psmouse_protocol psmouse_protocols[] = {
- .alias = "thinkps",
- .detect = thinking_detect,
- },
-+#ifdef CONFIG_MOUSE_PS2_CYPRESS
-+ {
-+ .type = PSMOUSE_CYPRESS,
-+ .name = "CyPS/2",
-+ .alias = "cypress",
-+ .detect = cypress_detect,
-+ .init = cypress_init,
-+ },
-+#endif
- {
- .type = PSMOUSE_GENPS,
- .name = "GenPS/2",
-diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
-index fe1df23..2f0b39d 100644
---- a/drivers/input/mouse/psmouse.h
-+++ b/drivers/input/mouse/psmouse.h
-@@ -95,6 +95,7 @@ enum psmouse_type {
- PSMOUSE_ELANTECH,
- PSMOUSE_FSP,
- PSMOUSE_SYNAPTICS_RELATIVE,
-+ PSMOUSE_CYPRESS,
- PSMOUSE_AUTO /* This one should always be last */
- };
-
---
-1.7.7.6
-
diff --git a/freed-ora/current/master/Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch b/freed-ora/current/master/Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch
deleted file mode 100644
index c3548aa07..000000000
--- a/freed-ora/current/master/Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 80524f083e2c3e70057f5bb476db92baa14cb22b Mon Sep 17 00:00:00 2001
-From: Kamal Mostafa <kamal@canonical.com>
-Date: Tue, 20 Nov 2012 23:04:35 -0800
-Subject: [PATCH] Input: increase struct ps2dev cmdbuf[] to 8 bytes
-
-Cypress PS/2 Trackpad (drivers/input/mouse/cypress_ps2.c) needs
-this larger cmdbuf[] to handle 8-byte packet responses.
-
-Signed-off-by: Kamal Mostafa <kamal@canonical.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- include/linux/libps2.h | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/include/linux/libps2.h b/include/linux/libps2.h
-index 79603a6..4ad06e8 100644
---- a/include/linux/libps2.h
-+++ b/include/linux/libps2.h
-@@ -36,7 +36,7 @@ struct ps2dev {
- wait_queue_head_t wait;
-
- unsigned long flags;
-- unsigned char cmdbuf[6];
-+ unsigned char cmdbuf[8];
- unsigned char cmdcnt;
- unsigned char nak;
- };
---
-1.7.7.6
-
diff --git a/freed-ora/current/master/Makefile.config b/freed-ora/current/master/Makefile.config
index 21c2a837b..69b12baa4 100644
--- a/freed-ora/current/master/Makefile.config
+++ b/freed-ora/current/master/Makefile.config
@@ -9,10 +9,8 @@ CONFIGFILES = \
$(CFG)-i686-PAE.config $(CFG)-i686-PAEdebug.config \
$(CFG)-x86_64.config $(CFG)-x86_64-debug.config \
$(CFG)-s390x.config \
- $(CFG)-armv5tel-kirkwood.config \
- $(CFG)-armv7l.config $(CFG)-armv7hl.config \
- $(CFG)-armv7l-omap.config $(CFG)-armv7hl-omap.config \
- $(CFG)-armv7l-tegra.config $(CFG)-armv7hl-tegra.config \
+ $(CFG)-armv7hl.config $(CFG)-armv7hl-lpae.config\
+ $(CFG)-armv7hl-tegra.config \
$(CFG)-ppc.config $(CFG)-ppc-smp.config \
$(CFG)-ppc64.config $(CFG)-ppc64p7.config $(CFG)-ppc64-debug.config
@@ -34,19 +32,16 @@ temp-generic: config-generic
temp-debug-generic: config-generic
cat config-generic config-debug > temp-debug-generic
-temp-armv7: config-armv7 temp-generic
+temp-armv7-generic: config-armv7-generic temp-generic
perl merge.pl $^ > $@
-temp-arm-generic: config-arm-generic temp-generic
- perl merge.pl $^ > $@
-
-temp-armv7l-omap: config-arm-omap temp-arm-generic
- perl merge.pl $^ > $@
+temp-armv7: config-armv7 temp-armv7-generic
+ perl merge.pl $^ > $@
-temp-armv7l-tegra: config-arm-tegra temp-arm-generic
- perl merge.pl $^ > $@
+temp-armv7-lpae: config-armv7-lpae temp-armv7-generic
+ perl merge.pl $^ > $@
-temp-armv5tel-kirkwood: config-arm-kirkwood temp-arm-generic
+temp-armv7-tegra: config-armv7-tegra temp-armv7-generic
perl merge.pl $^ > $@
temp-x86-32: config-x86-32-generic config-x86-generic
@@ -112,25 +107,13 @@ kernel-$(VERSION)-ppc64p7.config: config-powerpc64p7 temp-powerpc64-generic
kernel-$(VERSION)-s390x.config: config-s390x temp-s390-generic
perl merge.pl $^ s390 > $@
-kernel-$(VERSION)-armv5tel-kirkwood.config: /dev/null temp-armv5tel-kirkwood
- perl merge.pl $^ arm > $@
-
-kernel-$(VERSION)-armv7l.config: /dev/null temp-armv7
- perl merge.pl $^ arm > $@
-
-kernel-$(VERSION)-armv7l-omap.config: /dev/null temp-armv7l-omap
- perl merge.pl $^ arm > $@
-
-kernel-$(VERSION)-armv7l-tegra.config: /dev/null temp-armv7l-tegra
- perl merge.pl $^ arm > $@
-
kernel-$(VERSION)-armv7hl.config: /dev/null temp-armv7
perl merge.pl $^ arm > $@
-kernel-$(VERSION)-armv7hl-omap.config: /dev/null temp-armv7l-omap
+kernel-$(VERSION)-armv7hl-lpae.config: /dev/null temp-armv7-lpae
perl merge.pl $^ arm > $@
-kernel-$(VERSION)-armv7hl-tegra.config: /dev/null temp-armv7l-tegra
+kernel-$(VERSION)-armv7hl-tegra.config: /dev/null temp-armv7-tegra
perl merge.pl $^ arm > $@
kernel-$(VERSION)-ppc.config: /dev/null temp-powerpc32-generic
diff --git a/freed-ora/current/master/VMX-x86-handle-host-TSC-calibration-failure.patch b/freed-ora/current/master/VMX-x86-handle-host-TSC-calibration-failure.patch
new file mode 100644
index 000000000..6b6ddd2d2
--- /dev/null
+++ b/freed-ora/current/master/VMX-x86-handle-host-TSC-calibration-failure.patch
@@ -0,0 +1,58 @@
+@@ -, +, @@
+ VMX: x86: handle host TSC calibration failure
+
+ If the host TSC calibration fails, tsc_khz is zero (see tsc_init.c).
+ Handle such case properly in KVM (instead of dividing by zero).
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=859282
+
+ Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
+ Signed-off-by: Gleb Natapov <gleb@redhat.com>
+--- a/arch/x86/kvm/x86.c
++++ a/arch/x86/kvm/x86.c
+@@ -1079,6 +1079,10 @@ static void kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 this_tsc_khz)
+ u32 thresh_lo, thresh_hi;
+ int use_scaling = 0;
+
++ /* tsc_khz can be zero if TSC calibration fails */
++ if (this_tsc_khz == 0)
++ return;
++
+ /* Compute a scale to convert nanoseconds in TSC cycles */
+ kvm_get_time_scale(this_tsc_khz, NSEC_PER_SEC / 1000,
+ &vcpu->arch.virtual_tsc_shift,
+@@ -1156,20 +1160,23 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr)
+ ns = get_kernel_ns();
+ elapsed = ns - kvm->arch.last_tsc_nsec;
+
+- /* n.b - signed multiplication and division required */
+- usdiff = data - kvm->arch.last_tsc_write;
++ if (vcpu->arch.virtual_tsc_khz) {
++ /* n.b - signed multiplication and division required */
++ usdiff = data - kvm->arch.last_tsc_write;
+ #ifdef CONFIG_X86_64
+- usdiff = (usdiff * 1000) / vcpu->arch.virtual_tsc_khz;
++ usdiff = (usdiff * 1000) / vcpu->arch.virtual_tsc_khz;
+ #else
+- /* do_div() only does unsigned */
+- asm("idivl %2; xor %%edx, %%edx"
+- : "=A"(usdiff)
+- : "A"(usdiff * 1000), "rm"(vcpu->arch.virtual_tsc_khz));
++ /* do_div() only does unsigned */
++ asm("idivl %2; xor %%edx, %%edx"
++ : "=A"(usdiff)
++ : "A"(usdiff * 1000), "rm"(vcpu->arch.virtual_tsc_khz));
+ #endif
+- do_div(elapsed, 1000);
+- usdiff -= elapsed;
+- if (usdiff < 0)
+- usdiff = -usdiff;
++ do_div(elapsed, 1000);
++ usdiff -= elapsed;
++ if (usdiff < 0)
++ usdiff = -usdiff;
++ } else
++ usdiff = USEC_PER_SEC; /* disable TSC match window below */
+
+ /*
+ * Special case: TSC write with a small delta (1 second) of virtual
diff --git a/freed-ora/current/master/acpi-debug-infinite-loop.patch b/freed-ora/current/master/acpi-debug-infinite-loop.patch
deleted file mode 100644
index f2cc1a55e..000000000
--- a/freed-ora/current/master/acpi-debug-infinite-loop.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- linux-2.6.34.noarch/include/acpi/acconfig.h~ 2010-07-01 14:49:03.000000000 -0400
-+++ linux-2.6.34.noarch/include/acpi/acconfig.h 2010-07-01 14:49:17.000000000 -0400
-@@ -117,7 +117,7 @@
-
- /* Maximum number of While() loop iterations before forced abort */
-
--#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF
-+#define ACPI_MAX_LOOP_ITERATIONS 0xFFFFFF
-
- /* Maximum sleep allowed via Sleep() operator */
-
---- a/drivers/acpi/acpica/dscontrol.c
-+++ b/drivers/acpi/acpica/dscontrol.c
-@@ -212,6 +212,11 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
- * loop does not implement a timeout.
- */
- control_state->control.loop_count++;
-+ if ((control_state->control.loop_count > 1) &&
-+ (control_state->control.loop_count % 0xffff == 0))
-+ printk("ACPI: While loop taking a really long time. loop_count=0x%x\n",
-+ control_state->control.loop_count);
-+
- if (control_state->control.loop_count >
- ACPI_MAX_LOOP_ITERATIONS) {
- status = AE_AML_INFINITE_LOOP;
diff --git a/freed-ora/current/master/alps-v2.patch b/freed-ora/current/master/alps-v2.patch
deleted file mode 100644
index d394c4a92..000000000
--- a/freed-ora/current/master/alps-v2.patch
+++ /dev/null
@@ -1,2494 +0,0 @@
-From f822982515378982dc8d8e6058579288d0ee3cff Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 20:55:19 -0800
-Subject: [PATCH 01/15] Input: ALPS - document the alps.h data structures
-
-Add kernel-doc markup.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.h | 74 ++++++++++++++++++++++++++++++++++++++--------
- 1 file changed, 61 insertions(+), 13 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
-index ae1ac35..67be4e5 100644
---- a/drivers/input/mouse/alps.h
-+++ b/drivers/input/mouse/alps.h
-@@ -17,30 +17,78 @@
- #define ALPS_PROTO_V3 2
- #define ALPS_PROTO_V4 3
-
-+/**
-+ * struct alps_model_info - touchpad ID table
-+ * @signature: E7 response string to match.
-+ * @command_mode_resp: For V3/V4 touchpads, the final byte of the EC response
-+ * (aka command mode response) identifies the firmware minor version. This
-+ * can be used to distinguish different hardware models which are not
-+ * uniquely identifiable through their E7 responses.
-+ * @proto_version: Indicates V1/V2/V3/...
-+ * @byte0: Helps figure out whether a position report packet matches the
-+ * known format for this model. The first byte of the report, ANDed with
-+ * mask0, should match byte0.
-+ * @mask0: The mask used to check the first byte of the report.
-+ * @flags: Additional device capabilities (passthrough port, trackstick, etc.).
-+ *
-+ * Many (but not all) ALPS touchpads can be identified by looking at the
-+ * values returned in the "E7 report" and/or the "EC report." This table
-+ * lists a number of such touchpads.
-+ */
- struct alps_model_info {
-- unsigned char signature[3];
-- unsigned char command_mode_resp; /* v3/v4 only */
-+ unsigned char signature[3];
-+ unsigned char command_mode_resp;
- unsigned char proto_version;
-- unsigned char byte0, mask0;
-- unsigned char flags;
-+ unsigned char byte0, mask0;
-+ unsigned char flags;
- };
-
-+/**
-+ * struct alps_nibble_commands - encodings for register accesses
-+ * @command: PS/2 command used for the nibble
-+ * @data: Data supplied as an argument to the PS/2 command, if applicable
-+ *
-+ * The ALPS protocol uses magic sequences to transmit binary data to the
-+ * touchpad, as it is generally not OK to send arbitrary bytes out the
-+ * PS/2 port. Each of the sequences in this table sends one nibble of the
-+ * register address or (write) data. Different versions of the ALPS protocol
-+ * use slightly different encodings.
-+ */
- struct alps_nibble_commands {
- int command;
- unsigned char data;
- };
-
-+/**
-+ * struct alps_data - private data structure for the ALPS driver
-+ * @dev2: "Relative" device used to report trackstick or mouse activity.
-+ * @phys: Physical path for the relative device.
-+ * @i: Information on the detected touchpad model.
-+ * @nibble_commands: Command mapping used for touchpad register accesses.
-+ * @addr_command: Command used to tell the touchpad that a register address
-+ * follows.
-+ * @prev_fin: Finger bit from previous packet.
-+ * @multi_packet: Multi-packet data in progress.
-+ * @multi_data: Saved multi-packet data.
-+ * @x1: First X coordinate from last MT report.
-+ * @x2: Second X coordinate from last MT report.
-+ * @y1: First Y coordinate from last MT report.
-+ * @y2: Second Y coordinate from last MT report.
-+ * @fingers: Number of fingers from last MT report.
-+ * @quirks: Bitmap of ALPS_QUIRK_*.
-+ * @timer: Timer for flushing out the final report packet in the stream.
-+ */
- struct alps_data {
-- struct input_dev *dev2; /* Relative device */
-- char phys[32]; /* Phys */
-- const struct alps_model_info *i;/* Info */
-+ struct input_dev *dev2;
-+ char phys[32];
-+ const struct alps_model_info *i;
- const struct alps_nibble_commands *nibble_commands;
-- int addr_command; /* Command to set register address */
-- int prev_fin; /* Finger bit from previous packet */
-- int multi_packet; /* Multi-packet data in progress */
-- unsigned char multi_data[6]; /* Saved multi-packet data */
-- int x1, x2, y1, y2; /* Coordinates from last MT report */
-- int fingers; /* Number of fingers from MT report */
-+ int addr_command;
-+ int prev_fin;
-+ int multi_packet;
-+ unsigned char multi_data[6];
-+ int x1, x2, y1, y2;
-+ int fingers;
- u8 quirks;
- struct timer_list timer;
- };
---
-1.8.1.2
-
-
-From 196069863604cb55061a02ad5f046c5e4054ba54 Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 20:56:33 -0800
-Subject: [PATCH 02/15] Input: ALPS - copy "model" info into alps_data struct
-
-Not every type of ALPS touchpad is well-suited to table-based detection.
-Start moving the various alps_model_data attributes into the alps_data
-struct so that we don't need a unique table entry for every possible
-permutation of protocol version, flags, byte0/mask0, etc.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 63 +++++++++++++++++++++++-----------------------
- drivers/input/mouse/alps.h | 14 +++++++++--
- 2 files changed, 43 insertions(+), 34 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index e229fa3..33ee6e0 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -122,10 +122,10 @@ static const struct alps_model_info alps_model_data[] = {
-
- /* Packet formats are described in Documentation/input/alps.txt */
-
--static bool alps_is_valid_first_byte(const struct alps_model_info *model,
-+static bool alps_is_valid_first_byte(struct alps_data *priv,
- unsigned char data)
- {
-- return (data & model->mask0) == model->byte0;
-+ return (data & priv->mask0) == priv->byte0;
- }
-
- static void alps_report_buttons(struct psmouse *psmouse,
-@@ -158,14 +158,13 @@ static void alps_report_buttons(struct psmouse *psmouse,
- static void alps_process_packet_v1_v2(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
-- const struct alps_model_info *model = priv->i;
- unsigned char *packet = psmouse->packet;
- struct input_dev *dev = psmouse->dev;
- struct input_dev *dev2 = priv->dev2;
- int x, y, z, ges, fin, left, right, middle;
- int back = 0, forward = 0;
-
-- if (model->proto_version == ALPS_PROTO_V1) {
-+ if (priv->proto_version == ALPS_PROTO_V1) {
- left = packet[2] & 0x10;
- right = packet[2] & 0x08;
- middle = 0;
-@@ -181,12 +180,12 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
- z = packet[5];
- }
-
-- if (model->flags & ALPS_FW_BK_1) {
-+ if (priv->flags & ALPS_FW_BK_1) {
- back = packet[0] & 0x10;
- forward = packet[2] & 4;
- }
-
-- if (model->flags & ALPS_FW_BK_2) {
-+ if (priv->flags & ALPS_FW_BK_2) {
- back = packet[3] & 4;
- forward = packet[2] & 4;
- if ((middle = forward && back))
-@@ -196,7 +195,7 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
- ges = packet[2] & 1;
- fin = packet[2] & 2;
-
-- if ((model->flags & ALPS_DUALPOINT) && z == 127) {
-+ if ((priv->flags & ALPS_DUALPOINT) && z == 127) {
- input_report_rel(dev2, REL_X, (x > 383 ? (x - 768) : x));
- input_report_rel(dev2, REL_Y, -(y > 255 ? (y - 512) : y));
-
-@@ -239,15 +238,15 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
- input_report_abs(dev, ABS_PRESSURE, z);
- input_report_key(dev, BTN_TOOL_FINGER, z > 0);
-
-- if (model->flags & ALPS_WHEEL)
-+ if (priv->flags & ALPS_WHEEL)
- input_report_rel(dev, REL_WHEEL, ((packet[2] << 1) & 0x08) - ((packet[0] >> 4) & 0x07));
-
-- if (model->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) {
-+ if (priv->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) {
- input_report_key(dev, BTN_FORWARD, forward);
- input_report_key(dev, BTN_BACK, back);
- }
-
-- if (model->flags & ALPS_FOUR_BUTTONS) {
-+ if (priv->flags & ALPS_FOUR_BUTTONS) {
- input_report_key(dev, BTN_0, packet[2] & 4);
- input_report_key(dev, BTN_1, packet[0] & 0x10);
- input_report_key(dev, BTN_2, packet[3] & 4);
-@@ -699,9 +698,8 @@ static void alps_process_packet_v4(struct psmouse *psmouse)
- static void alps_process_packet(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
-- const struct alps_model_info *model = priv->i;
-
-- switch (model->proto_version) {
-+ switch (priv->proto_version) {
- case ALPS_PROTO_V1:
- case ALPS_PROTO_V2:
- alps_process_packet_v1_v2(psmouse);
-@@ -765,7 +763,7 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse)
- if (((psmouse->packet[3] |
- psmouse->packet[4] |
- psmouse->packet[5]) & 0x80) ||
-- (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) {
-+ (!alps_is_valid_first_byte(priv, psmouse->packet[6]))) {
- psmouse_dbg(psmouse,
- "refusing packet %4ph (suspected interleaved ps/2)\n",
- psmouse->packet + 3);
-@@ -844,7 +842,6 @@ static void alps_flush_packet(unsigned long data)
- static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
-- const struct alps_model_info *model = priv->i;
-
- if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */
- if (psmouse->pktcnt == 3) {
-@@ -857,15 +854,15 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
-
- /* Check for PS/2 packet stuffed in the middle of ALPS packet. */
-
-- if ((model->flags & ALPS_PS2_INTERLEAVED) &&
-+ if ((priv->flags & ALPS_PS2_INTERLEAVED) &&
- psmouse->pktcnt >= 4 && (psmouse->packet[3] & 0x0f) == 0x0f) {
- return alps_handle_interleaved_ps2(psmouse);
- }
-
-- if (!alps_is_valid_first_byte(model, psmouse->packet[0])) {
-+ if (!alps_is_valid_first_byte(priv, psmouse->packet[0])) {
- psmouse_dbg(psmouse,
- "refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n",
-- psmouse->packet[0], model->mask0, model->byte0);
-+ psmouse->packet[0], priv->mask0, priv->byte0);
- return PSMOUSE_BAD_DATA;
- }
-
-@@ -1190,16 +1187,16 @@ static int alps_poll(struct psmouse *psmouse)
- unsigned char buf[sizeof(psmouse->packet)];
- bool poll_failed;
-
-- if (priv->i->flags & ALPS_PASS)
-+ if (priv->flags & ALPS_PASS)
- alps_passthrough_mode_v2(psmouse, true);
-
- poll_failed = ps2_command(&psmouse->ps2dev, buf,
- PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)) < 0;
-
-- if (priv->i->flags & ALPS_PASS)
-+ if (priv->flags & ALPS_PASS)
- alps_passthrough_mode_v2(psmouse, false);
-
-- if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0)
-+ if (poll_failed || (buf[0] & priv->mask0) != priv->byte0)
- return -1;
-
- if ((psmouse->badbyte & 0xc8) == 0x08) {
-@@ -1217,9 +1214,8 @@ static int alps_poll(struct psmouse *psmouse)
- static int alps_hw_init_v1_v2(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
-- const struct alps_model_info *model = priv->i;
-
-- if ((model->flags & ALPS_PASS) &&
-+ if ((priv->flags & ALPS_PASS) &&
- alps_passthrough_mode_v2(psmouse, true)) {
- return -1;
- }
-@@ -1234,7 +1230,7 @@ static int alps_hw_init_v1_v2(struct psmouse *psmouse)
- return -1;
- }
-
-- if ((model->flags & ALPS_PASS) &&
-+ if ((priv->flags & ALPS_PASS) &&
- alps_passthrough_mode_v2(psmouse, false)) {
- return -1;
- }
-@@ -1520,10 +1516,9 @@ error:
- static int alps_hw_init(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
-- const struct alps_model_info *model = priv->i;
- int ret = -1;
-
-- switch (model->proto_version) {
-+ switch (priv->proto_version) {
- case ALPS_PROTO_V1:
- case ALPS_PROTO_V2:
- ret = alps_hw_init_v1_v2(psmouse);
-@@ -1585,7 +1580,10 @@ int alps_init(struct psmouse *psmouse)
- if (!model)
- goto init_fail;
-
-- priv->i = model;
-+ priv->proto_version = model->proto_version;
-+ priv->byte0 = model->byte0;
-+ priv->mask0 = model->mask0;
-+ priv->flags = model->flags;
-
- if (alps_hw_init(psmouse))
- goto init_fail;
-@@ -1609,7 +1607,7 @@ int alps_init(struct psmouse *psmouse)
-
- dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS);
-
-- switch (model->proto_version) {
-+ switch (priv->proto_version) {
- case ALPS_PROTO_V1:
- case ALPS_PROTO_V2:
- input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0);
-@@ -1633,17 +1631,17 @@ int alps_init(struct psmouse *psmouse)
-
- input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0);
-
-- if (model->flags & ALPS_WHEEL) {
-+ if (priv->flags & ALPS_WHEEL) {
- dev1->evbit[BIT_WORD(EV_REL)] |= BIT_MASK(EV_REL);
- dev1->relbit[BIT_WORD(REL_WHEEL)] |= BIT_MASK(REL_WHEEL);
- }
-
-- if (model->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) {
-+ if (priv->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) {
- dev1->keybit[BIT_WORD(BTN_FORWARD)] |= BIT_MASK(BTN_FORWARD);
- dev1->keybit[BIT_WORD(BTN_BACK)] |= BIT_MASK(BTN_BACK);
- }
-
-- if (model->flags & ALPS_FOUR_BUTTONS) {
-+ if (priv->flags & ALPS_FOUR_BUTTONS) {
- dev1->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_0);
- dev1->keybit[BIT_WORD(BTN_1)] |= BIT_MASK(BTN_1);
- dev1->keybit[BIT_WORD(BTN_2)] |= BIT_MASK(BTN_2);
-@@ -1654,7 +1652,8 @@ int alps_init(struct psmouse *psmouse)
-
- snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys);
- dev2->phys = priv->phys;
-- dev2->name = (model->flags & ALPS_DUALPOINT) ? "DualPoint Stick" : "PS/2 Mouse";
-+ dev2->name = (priv->flags & ALPS_DUALPOINT) ?
-+ "DualPoint Stick" : "PS/2 Mouse";
- dev2->id.bustype = BUS_I8042;
- dev2->id.vendor = 0x0002;
- dev2->id.product = PSMOUSE_ALPS;
-@@ -1673,7 +1672,7 @@ int alps_init(struct psmouse *psmouse)
- psmouse->poll = alps_poll;
- psmouse->disconnect = alps_disconnect;
- psmouse->reconnect = alps_reconnect;
-- psmouse->pktsize = model->proto_version == ALPS_PROTO_V4 ? 8 : 6;
-+ psmouse->pktsize = priv->proto_version == ALPS_PROTO_V4 ? 8 : 6;
-
- /* We are having trouble resyncing ALPS touchpads so disable it for now */
- psmouse->resync_time = 0;
-diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
-index 67be4e5..efd0eea 100644
---- a/drivers/input/mouse/alps.h
-+++ b/drivers/input/mouse/alps.h
-@@ -63,10 +63,15 @@ struct alps_nibble_commands {
- * struct alps_data - private data structure for the ALPS driver
- * @dev2: "Relative" device used to report trackstick or mouse activity.
- * @phys: Physical path for the relative device.
-- * @i: Information on the detected touchpad model.
- * @nibble_commands: Command mapping used for touchpad register accesses.
- * @addr_command: Command used to tell the touchpad that a register address
- * follows.
-+ * @proto_version: Indicates V1/V2/V3/...
-+ * @byte0: Helps figure out whether a position report packet matches the
-+ * known format for this model. The first byte of the report, ANDed with
-+ * mask0, should match byte0.
-+ * @mask0: The mask used to check the first byte of the report.
-+ * @flags: Additional device capabilities (passthrough port, trackstick, etc.).
- * @prev_fin: Finger bit from previous packet.
- * @multi_packet: Multi-packet data in progress.
- * @multi_data: Saved multi-packet data.
-@@ -81,9 +86,14 @@ struct alps_nibble_commands {
- struct alps_data {
- struct input_dev *dev2;
- char phys[32];
-- const struct alps_model_info *i;
-+
-+ /* these are autodetected when the device is identified */
- const struct alps_nibble_commands *nibble_commands;
- int addr_command;
-+ unsigned char proto_version;
-+ unsigned char byte0, mask0;
-+ unsigned char flags;
-+
- int prev_fin;
- int multi_packet;
- unsigned char multi_data[6];
---
-1.8.1.2
-
-
-From b856c913996a38ced60bdf41aeae4da00882bf1f Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 20:57:04 -0800
-Subject: [PATCH 03/15] Input: ALPS - move alps_get_model() down below hw_init
- code
-
-This will minimize the number of forward declarations needed when
-alps_get_model() starts assigning function pointers.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 186 ++++++++++++++++++++++-----------------------
- 1 file changed, 93 insertions(+), 93 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index 33ee6e0..c473549 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -998,99 +998,6 @@ static inline int alps_exit_command_mode(struct psmouse *psmouse)
- return 0;
- }
-
--static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version)
--{
-- struct ps2dev *ps2dev = &psmouse->ps2dev;
-- static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 };
-- unsigned char param[4];
-- const struct alps_model_info *model = NULL;
-- int i;
--
-- /*
-- * First try "E6 report".
-- * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
-- * The bits 0-2 of the first byte will be 1s if some buttons are
-- * pressed.
-- */
-- param[0] = 0;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11))
-- return NULL;
--
-- param[0] = param[1] = param[2] = 0xff;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-- return NULL;
--
-- psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
-- param[0], param[1], param[2]);
--
-- if ((param[0] & 0xf8) != 0 || param[1] != 0 ||
-- (param[2] != 10 && param[2] != 100))
-- return NULL;
--
-- /*
-- * Now try "E7 report". Allowed responses are in
-- * alps_model_data[].signature
-- */
-- param[0] = 0;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21))
-- return NULL;
--
-- param[0] = param[1] = param[2] = 0xff;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-- return NULL;
--
-- psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x",
-- param[0], param[1], param[2]);
--
-- if (version) {
-- for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
-- /* empty */;
-- *version = (param[0] << 8) | (param[1] << 4) | i;
-- }
--
-- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
-- if (!memcmp(param, alps_model_data[i].signature,
-- sizeof(alps_model_data[i].signature))) {
-- model = alps_model_data + i;
-- break;
-- }
-- }
--
-- if (model && model->proto_version > ALPS_PROTO_V2) {
-- /*
-- * Need to check command mode response to identify
-- * model
-- */
-- model = NULL;
-- if (alps_enter_command_mode(psmouse, param)) {
-- psmouse_warn(psmouse,
-- "touchpad failed to enter command mode\n");
-- } else {
-- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
-- if (alps_model_data[i].proto_version > ALPS_PROTO_V2 &&
-- alps_model_data[i].command_mode_resp == param[0]) {
-- model = alps_model_data + i;
-- break;
-- }
-- }
-- alps_exit_command_mode(psmouse);
--
-- if (!model)
-- psmouse_dbg(psmouse,
-- "Unknown command mode response %2.2x\n",
-- param[0]);
-- }
-- }
--
-- return model;
--}
--
- /*
- * For DualPoint devices select the device that should respond to
- * subsequent commands. It looks like glidepad is behind stickpointer,
-@@ -1534,6 +1441,99 @@ static int alps_hw_init(struct psmouse *psmouse)
- return ret;
- }
-
-+static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+ static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 };
-+ unsigned char param[4];
-+ const struct alps_model_info *model = NULL;
-+ int i;
-+
-+ /*
-+ * First try "E6 report".
-+ * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
-+ * The bits 0-2 of the first byte will be 1s if some buttons are
-+ * pressed.
-+ */
-+ param[0] = 0;
-+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11))
-+ return NULL;
-+
-+ param[0] = param[1] = param[2] = 0xff;
-+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-+ return NULL;
-+
-+ psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
-+ param[0], param[1], param[2]);
-+
-+ if ((param[0] & 0xf8) != 0 || param[1] != 0 ||
-+ (param[2] != 10 && param[2] != 100))
-+ return NULL;
-+
-+ /*
-+ * Now try "E7 report". Allowed responses are in
-+ * alps_model_data[].signature
-+ */
-+ param[0] = 0;
-+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21))
-+ return NULL;
-+
-+ param[0] = param[1] = param[2] = 0xff;
-+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-+ return NULL;
-+
-+ psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x",
-+ param[0], param[1], param[2]);
-+
-+ if (version) {
-+ for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
-+ /* empty */;
-+ *version = (param[0] << 8) | (param[1] << 4) | i;
-+ }
-+
-+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
-+ if (!memcmp(param, alps_model_data[i].signature,
-+ sizeof(alps_model_data[i].signature))) {
-+ model = alps_model_data + i;
-+ break;
-+ }
-+ }
-+
-+ if (model && model->proto_version > ALPS_PROTO_V2) {
-+ /*
-+ * Need to check command mode response to identify
-+ * model
-+ */
-+ model = NULL;
-+ if (alps_enter_command_mode(psmouse, param)) {
-+ psmouse_warn(psmouse,
-+ "touchpad failed to enter command mode\n");
-+ } else {
-+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
-+ if (alps_model_data[i].proto_version > ALPS_PROTO_V2 &&
-+ alps_model_data[i].command_mode_resp == param[0]) {
-+ model = alps_model_data + i;
-+ break;
-+ }
-+ }
-+ alps_exit_command_mode(psmouse);
-+
-+ if (!model)
-+ psmouse_dbg(psmouse,
-+ "Unknown command mode response %2.2x\n",
-+ param[0]);
-+ }
-+ }
-+
-+ return model;
-+}
-+
- static int alps_reconnect(struct psmouse *psmouse)
- {
- const struct alps_model_info *model;
---
-1.8.1.2
-
-
-From b719d56d5743e2c338568f4edb6eab17ea9c9eec Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:19:01 -0800
-Subject: [PATCH 04/15] Input: ALPS - introduce helper function for repeated
- commands
-
-Several ALPS driver init sequences repeat a command three times, then
-issue PSMOUSE_CMD_GETINFO to read the result. Move this into a helper
-function to simplify the code.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 71 ++++++++++++++++++++--------------------------
- 1 file changed, 30 insertions(+), 41 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index c473549..1ca854b 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -964,24 +964,42 @@ static int alps_command_mode_write_reg(struct psmouse *psmouse, int addr,
- return __alps_command_mode_write_reg(psmouse, value);
- }
-
-+static int alps_rpt_cmd(struct psmouse *psmouse, int init_command,
-+ int repeated_command, unsigned char *param)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+
-+ param[0] = 0;
-+ if (init_command && ps2_command(ps2dev, param, init_command))
-+ return -EIO;
-+
-+ if (ps2_command(ps2dev, NULL, repeated_command) ||
-+ ps2_command(ps2dev, NULL, repeated_command) ||
-+ ps2_command(ps2dev, NULL, repeated_command))
-+ return -EIO;
-+
-+ param[0] = param[1] = param[2] = 0xff;
-+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-+ return -EIO;
-+
-+ psmouse_dbg(psmouse, "%2.2X report: %2.2x %2.2x %2.2x\n",
-+ repeated_command, param[0], param[1], param[2]);
-+ return 0;
-+}
-+
- static int alps_enter_command_mode(struct psmouse *psmouse,
- unsigned char *resp)
- {
- unsigned char param[4];
-- struct ps2dev *ps2dev = &psmouse->ps2dev;
-
-- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) ||
-- ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) {
-+ if (alps_rpt_cmd(psmouse, 0, PSMOUSE_CMD_RESET_WRAP, param)) {
- psmouse_err(psmouse, "failed to enter command mode\n");
- return -1;
- }
-
- if (param[0] != 0x88 && param[1] != 0x07) {
- psmouse_dbg(psmouse,
-- "unknown response while entering command mode: %2.2x %2.2x %2.2x\n",
-- param[0], param[1], param[2]);
-+ "unknown response while entering command mode\n");
- return -1;
- }
-
-@@ -1041,18 +1059,10 @@ static int alps_absolute_mode_v1_v2(struct psmouse *psmouse)
-
- static int alps_get_status(struct psmouse *psmouse, char *param)
- {
-- struct ps2dev *ps2dev = &psmouse->ps2dev;
--
- /* Get status: 0xF5 0xF5 0xF5 0xE9 */
-- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) ||
-- ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-+ if (alps_rpt_cmd(psmouse, 0, PSMOUSE_CMD_DISABLE, param))
- return -1;
-
-- psmouse_dbg(psmouse, "Status: %2.2x %2.2x %2.2x",
-- param[0], param[1], param[2]);
--
- return 0;
- }
-
-@@ -1443,7 +1453,6 @@ static int alps_hw_init(struct psmouse *psmouse)
-
- static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version)
- {
-- struct ps2dev *ps2dev = &psmouse->ps2dev;
- static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 };
- unsigned char param[4];
- const struct alps_model_info *model = NULL;
-@@ -1455,20 +1464,10 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
- * The bits 0-2 of the first byte will be 1s if some buttons are
- * pressed.
- */
-- param[0] = 0;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11))
-- return NULL;
--
-- param[0] = param[1] = param[2] = 0xff;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE11,
-+ param))
- return NULL;
-
-- psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
-- param[0], param[1], param[2]);
--
- if ((param[0] & 0xf8) != 0 || param[1] != 0 ||
- (param[2] != 10 && param[2] != 100))
- return NULL;
-@@ -1477,20 +1476,10 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
- * Now try "E7 report". Allowed responses are in
- * alps_model_data[].signature
- */
-- param[0] = 0;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21))
-- return NULL;
--
-- param[0] = param[1] = param[2] = 0xff;
-- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
-+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE21,
-+ param))
- return NULL;
-
-- psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x",
-- param[0], param[1], param[2]);
--
- if (version) {
- for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
- /* empty */;
---
-1.8.1.2
-
-
-From c7fd5d0e90f577072ece70651aeecb37f62f5fdb Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:19:59 -0800
-Subject: [PATCH 05/15] Input: ALPS - rework detection sequence
-
-If the E6 report test passes, get the E7 and EC reports right away and
-then try to match an entry in the table.
-
-Pass in the alps_data struct, so that the detection code will be able to
-set operating parameters based on information found during detection.
-
-Change the version (psmouse->model) to report the protocol version only,
-in preparation for supporting models that do not show up in the ID table.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 124 +++++++++++++++++++--------------------------
- drivers/input/mouse/alps.h | 8 +--
- 2 files changed, 56 insertions(+), 76 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index 1ca854b..e6a27a5 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -1451,86 +1451,76 @@ static int alps_hw_init(struct psmouse *psmouse)
- return ret;
- }
-
--static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version)
-+static int alps_match_table(struct psmouse *psmouse, struct alps_data *priv,
-+ unsigned char *e7, unsigned char *ec)
- {
-- static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 };
-- unsigned char param[4];
-- const struct alps_model_info *model = NULL;
-+ const struct alps_model_info *model;
- int i;
-
-+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
-+ model = &alps_model_data[i];
-+
-+ if (!memcmp(e7, model->signature, sizeof(model->signature)) &&
-+ (!model->command_mode_resp ||
-+ model->command_mode_resp == ec[2])) {
-+
-+ priv->proto_version = model->proto_version;
-+ priv->flags = model->flags;
-+ priv->byte0 = model->byte0;
-+ priv->mask0 = model->mask0;
-+
-+ return 0;
-+ }
-+ }
-+
-+ return -EINVAL;
-+}
-+
-+static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
-+{
-+ unsigned char e6[4], e7[4], ec[4];
-+
- /*
- * First try "E6 report".
- * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
- * The bits 0-2 of the first byte will be 1s if some buttons are
- * pressed.
- */
-- if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE11,
-- param))
-- return NULL;
-+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES,
-+ PSMOUSE_CMD_SETSCALE11, e6))
-+ return -EIO;
-
-- if ((param[0] & 0xf8) != 0 || param[1] != 0 ||
-- (param[2] != 10 && param[2] != 100))
-- return NULL;
-+ if ((e6[0] & 0xf8) != 0 || e6[1] != 0 || (e6[2] != 10 && e6[2] != 100))
-+ return -EINVAL;
-
- /*
-- * Now try "E7 report". Allowed responses are in
-- * alps_model_data[].signature
-+ * Now get the "E7" and "EC" reports. These will uniquely identify
-+ * most ALPS touchpads.
- */
-- if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE21,
-- param))
-- return NULL;
--
-- if (version) {
-- for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++)
-- /* empty */;
-- *version = (param[0] << 8) | (param[1] << 4) | i;
-- }
--
-- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
-- if (!memcmp(param, alps_model_data[i].signature,
-- sizeof(alps_model_data[i].signature))) {
-- model = alps_model_data + i;
-- break;
-- }
-- }
-+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES,
-+ PSMOUSE_CMD_SETSCALE21, e7) ||
-+ alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES,
-+ PSMOUSE_CMD_RESET_WRAP, ec) ||
-+ alps_exit_command_mode(psmouse))
-+ return -EIO;
-
-- if (model && model->proto_version > ALPS_PROTO_V2) {
-- /*
-- * Need to check command mode response to identify
-- * model
-- */
-- model = NULL;
-- if (alps_enter_command_mode(psmouse, param)) {
-- psmouse_warn(psmouse,
-- "touchpad failed to enter command mode\n");
-- } else {
-- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) {
-- if (alps_model_data[i].proto_version > ALPS_PROTO_V2 &&
-- alps_model_data[i].command_mode_resp == param[0]) {
-- model = alps_model_data + i;
-- break;
-- }
-- }
-- alps_exit_command_mode(psmouse);
-+ if (alps_match_table(psmouse, priv, e7, ec) == 0)
-+ return 0;
-
-- if (!model)
-- psmouse_dbg(psmouse,
-- "Unknown command mode response %2.2x\n",
-- param[0]);
-- }
-- }
-+ psmouse_info(psmouse,
-+ "Unknown ALPS touchpad: E7=%2.2x %2.2x %2.2x, EC=%2.2x %2.2x %2.2x\n",
-+ e7[0], e7[1], e7[2], ec[0], ec[1], ec[2]);
-
-- return model;
-+ return -EINVAL;
- }
-
- static int alps_reconnect(struct psmouse *psmouse)
- {
-- const struct alps_model_info *model;
-+ struct alps_data *priv = psmouse->private;
-
- psmouse_reset(psmouse);
-
-- model = alps_get_model(psmouse, NULL);
-- if (!model)
-+ if (alps_identify(psmouse, priv) < 0)
- return -1;
-
- return alps_hw_init(psmouse);
-@@ -1549,9 +1539,7 @@ static void alps_disconnect(struct psmouse *psmouse)
- int alps_init(struct psmouse *psmouse)
- {
- struct alps_data *priv;
-- const struct alps_model_info *model;
- struct input_dev *dev1 = psmouse->dev, *dev2;
-- int version;
-
- priv = kzalloc(sizeof(struct alps_data), GFP_KERNEL);
- dev2 = input_allocate_device();
-@@ -1565,15 +1553,9 @@ int alps_init(struct psmouse *psmouse)
-
- psmouse_reset(psmouse);
-
-- model = alps_get_model(psmouse, &version);
-- if (!model)
-+ if (alps_identify(psmouse, priv) < 0)
- goto init_fail;
-
-- priv->proto_version = model->proto_version;
-- priv->byte0 = model->byte0;
-- priv->mask0 = model->mask0;
-- priv->flags = model->flags;
--
- if (alps_hw_init(psmouse))
- goto init_fail;
-
-@@ -1678,18 +1660,16 @@ init_fail:
-
- int alps_detect(struct psmouse *psmouse, bool set_properties)
- {
-- int version;
-- const struct alps_model_info *model;
-+ struct alps_data dummy;
-
-- model = alps_get_model(psmouse, &version);
-- if (!model)
-+ if (alps_identify(psmouse, &dummy) < 0)
- return -1;
-
- if (set_properties) {
- psmouse->vendor = "ALPS";
-- psmouse->name = model->flags & ALPS_DUALPOINT ?
-+ psmouse->name = dummy.flags & ALPS_DUALPOINT ?
- "DualPoint TouchPad" : "GlidePoint";
-- psmouse->model = version;
-+ psmouse->model = dummy.proto_version << 8;
- }
- return 0;
- }
-diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
-index efd0eea..a81b318 100644
---- a/drivers/input/mouse/alps.h
-+++ b/drivers/input/mouse/alps.h
-@@ -12,10 +12,10 @@
- #ifndef _ALPS_H
- #define _ALPS_H
-
--#define ALPS_PROTO_V1 0
--#define ALPS_PROTO_V2 1
--#define ALPS_PROTO_V3 2
--#define ALPS_PROTO_V4 3
-+#define ALPS_PROTO_V1 1
-+#define ALPS_PROTO_V2 2
-+#define ALPS_PROTO_V3 3
-+#define ALPS_PROTO_V4 4
-
- /**
- * struct alps_model_info - touchpad ID table
---
-1.8.1.2
-
-
-From c7fb8a63ba1257e2ee829425ef7197c7cbe893a1 Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:22:08 -0800
-Subject: [PATCH 06/15] Input: ALPS - use function pointers for different
- protocol handlers
-
-In anticipation of adding more ALPS protocols and more per-device quirks,
-use function pointers instead of switch statements to call functions that
-differ from one device to the next.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 101 +++++++++++++++++++++------------------------
- drivers/input/mouse/alps.h | 7 ++++
- 2 files changed, 54 insertions(+), 54 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index e6a27a5..fe45687 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -114,6 +114,11 @@ static const struct alps_model_info alps_model_data[] = {
- { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 },
- };
-
-+static void alps_set_abs_params_st(struct alps_data *priv,
-+ struct input_dev *dev1);
-+static void alps_set_abs_params_mt(struct alps_data *priv,
-+ struct input_dev *dev1);
-+
- /*
- * XXX - this entry is suspicious. First byte has zero lower nibble,
- * which is what a normal mouse would report. Also, the value 0x0e
-@@ -695,24 +700,6 @@ static void alps_process_packet_v4(struct psmouse *psmouse)
- input_sync(dev);
- }
-
--static void alps_process_packet(struct psmouse *psmouse)
--{
-- struct alps_data *priv = psmouse->private;
--
-- switch (priv->proto_version) {
-- case ALPS_PROTO_V1:
-- case ALPS_PROTO_V2:
-- alps_process_packet_v1_v2(psmouse);
-- break;
-- case ALPS_PROTO_V3:
-- alps_process_packet_v3(psmouse);
-- break;
-- case ALPS_PROTO_V4:
-- alps_process_packet_v4(psmouse);
-- break;
-- }
--}
--
- static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
- unsigned char packet[],
- bool report_buttons)
-@@ -770,7 +757,7 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse)
- return PSMOUSE_BAD_DATA;
- }
-
-- alps_process_packet(psmouse);
-+ priv->process_packet(psmouse);
-
- /* Continue with the next packet */
- psmouse->packet[0] = psmouse->packet[6];
-@@ -814,6 +801,7 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse)
- static void alps_flush_packet(unsigned long data)
- {
- struct psmouse *psmouse = (struct psmouse *)data;
-+ struct alps_data *priv = psmouse->private;
-
- serio_pause_rx(psmouse->ps2dev.serio);
-
-@@ -831,7 +819,7 @@ static void alps_flush_packet(unsigned long data)
- "refusing packet %3ph (suspected interleaved ps/2)\n",
- psmouse->packet + 3);
- } else {
-- alps_process_packet(psmouse);
-+ priv->process_packet(psmouse);
- }
- psmouse->pktcnt = 0;
- }
-@@ -876,7 +864,7 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
- }
-
- if (psmouse->pktcnt == psmouse->pktsize) {
-- alps_process_packet(psmouse);
-+ priv->process_packet(psmouse);
- return PSMOUSE_FULL_PACKET;
- }
-
-@@ -1430,25 +1418,26 @@ error:
- return -1;
- }
-
--static int alps_hw_init(struct psmouse *psmouse)
-+static void alps_set_defaults(struct alps_data *priv)
- {
-- struct alps_data *priv = psmouse->private;
-- int ret = -1;
--
- switch (priv->proto_version) {
- case ALPS_PROTO_V1:
- case ALPS_PROTO_V2:
-- ret = alps_hw_init_v1_v2(psmouse);
-+ priv->hw_init = alps_hw_init_v1_v2;
-+ priv->process_packet = alps_process_packet_v1_v2;
-+ priv->set_abs_params = alps_set_abs_params_st;
- break;
- case ALPS_PROTO_V3:
-- ret = alps_hw_init_v3(psmouse);
-+ priv->hw_init = alps_hw_init_v3;
-+ priv->process_packet = alps_process_packet_v3;
-+ priv->set_abs_params = alps_set_abs_params_mt;
- break;
- case ALPS_PROTO_V4:
-- ret = alps_hw_init_v4(psmouse);
-+ priv->hw_init = alps_hw_init_v4;
-+ priv->process_packet = alps_process_packet_v4;
-+ priv->set_abs_params = alps_set_abs_params_mt;
- break;
- }
--
-- return ret;
- }
-
- static int alps_match_table(struct psmouse *psmouse, struct alps_data *priv,
-@@ -1465,6 +1454,8 @@ static int alps_match_table(struct psmouse *psmouse, struct alps_data *priv,
- model->command_mode_resp == ec[2])) {
-
- priv->proto_version = model->proto_version;
-+ alps_set_defaults(priv);
-+
- priv->flags = model->flags;
- priv->byte0 = model->byte0;
- priv->mask0 = model->mask0;
-@@ -1523,7 +1514,7 @@ static int alps_reconnect(struct psmouse *psmouse)
- if (alps_identify(psmouse, priv) < 0)
- return -1;
-
-- return alps_hw_init(psmouse);
-+ return priv->hw_init(psmouse);
- }
-
- static void alps_disconnect(struct psmouse *psmouse)
-@@ -1536,6 +1527,29 @@ static void alps_disconnect(struct psmouse *psmouse)
- kfree(priv);
- }
-
-+static void alps_set_abs_params_st(struct alps_data *priv,
-+ struct input_dev *dev1)
-+{
-+ input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0);
-+ input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0);
-+}
-+
-+static void alps_set_abs_params_mt(struct alps_data *priv,
-+ struct input_dev *dev1)
-+{
-+ set_bit(INPUT_PROP_SEMI_MT, dev1->propbit);
-+ input_mt_init_slots(dev1, 2, 0);
-+ input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, ALPS_V3_X_MAX, 0, 0);
-+ input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, ALPS_V3_Y_MAX, 0, 0);
-+
-+ set_bit(BTN_TOOL_DOUBLETAP, dev1->keybit);
-+ set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit);
-+ set_bit(BTN_TOOL_QUADTAP, dev1->keybit);
-+
-+ input_set_abs_params(dev1, ABS_X, 0, ALPS_V3_X_MAX, 0, 0);
-+ input_set_abs_params(dev1, ABS_Y, 0, ALPS_V3_Y_MAX, 0, 0);
-+}
-+
- int alps_init(struct psmouse *psmouse)
- {
- struct alps_data *priv;
-@@ -1556,7 +1570,7 @@ int alps_init(struct psmouse *psmouse)
- if (alps_identify(psmouse, priv) < 0)
- goto init_fail;
-
-- if (alps_hw_init(psmouse))
-+ if (priv->hw_init(psmouse))
- goto init_fail;
-
- /*
-@@ -1578,28 +1592,7 @@ int alps_init(struct psmouse *psmouse)
-
- dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS);
-
-- switch (priv->proto_version) {
-- case ALPS_PROTO_V1:
-- case ALPS_PROTO_V2:
-- input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0);
-- input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0);
-- break;
-- case ALPS_PROTO_V3:
-- case ALPS_PROTO_V4:
-- set_bit(INPUT_PROP_SEMI_MT, dev1->propbit);
-- input_mt_init_slots(dev1, 2, 0);
-- input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, ALPS_V3_X_MAX, 0, 0);
-- input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, ALPS_V3_Y_MAX, 0, 0);
--
-- set_bit(BTN_TOOL_DOUBLETAP, dev1->keybit);
-- set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit);
-- set_bit(BTN_TOOL_QUADTAP, dev1->keybit);
--
-- input_set_abs_params(dev1, ABS_X, 0, ALPS_V3_X_MAX, 0, 0);
-- input_set_abs_params(dev1, ABS_Y, 0, ALPS_V3_Y_MAX, 0, 0);
-- break;
-- }
--
-+ priv->set_abs_params(priv, dev1);
- input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0);
-
- if (priv->flags & ALPS_WHEEL) {
-diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
-index a81b318..0934f8b 100644
---- a/drivers/input/mouse/alps.h
-+++ b/drivers/input/mouse/alps.h
-@@ -72,6 +72,9 @@ struct alps_nibble_commands {
- * mask0, should match byte0.
- * @mask0: The mask used to check the first byte of the report.
- * @flags: Additional device capabilities (passthrough port, trackstick, etc.).
-+ * @hw_init: Protocol-specific hardware init function.
-+ * @process_packet: Protocol-specific function to process a report packet.
-+ * @set_abs_params: Protocol-specific function to configure the input_dev.
- * @prev_fin: Finger bit from previous packet.
- * @multi_packet: Multi-packet data in progress.
- * @multi_data: Saved multi-packet data.
-@@ -94,6 +97,10 @@ struct alps_data {
- unsigned char byte0, mask0;
- unsigned char flags;
-
-+ int (*hw_init)(struct psmouse *psmouse);
-+ void (*process_packet)(struct psmouse *psmouse);
-+ void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1);
-+
- int prev_fin;
- int multi_packet;
- unsigned char multi_data[6];
---
-1.8.1.2
-
-
-From e2600c708bef8e1c8126ca9b8d4ce1f83c002688 Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:23:04 -0800
-Subject: [PATCH 07/15] Input: ALPS - move {addr,nibble}_command settings into
- alps_set_defaults()
-
-This allows alps_identify() to override these settings based on the
-device characteristics, if it is ever necessary.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index fe45687..2221a00 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -1190,14 +1190,10 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)
-
- static int alps_hw_init_v3(struct psmouse *psmouse)
- {
-- struct alps_data *priv = psmouse->private;
- struct ps2dev *ps2dev = &psmouse->ps2dev;
- int reg_val;
- unsigned char param[4];
-
-- priv->nibble_commands = alps_v3_nibble_commands;
-- priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
--
- if (alps_enter_command_mode(psmouse, NULL))
- goto error;
-
-@@ -1343,13 +1339,9 @@ static int alps_absolute_mode_v4(struct psmouse *psmouse)
-
- static int alps_hw_init_v4(struct psmouse *psmouse)
- {
-- struct alps_data *priv = psmouse->private;
- struct ps2dev *ps2dev = &psmouse->ps2dev;
- unsigned char param[4];
-
-- priv->nibble_commands = alps_v4_nibble_commands;
-- priv->addr_command = PSMOUSE_CMD_DISABLE;
--
- if (alps_enter_command_mode(psmouse, NULL))
- goto error;
-
-@@ -1431,11 +1423,15 @@ static void alps_set_defaults(struct alps_data *priv)
- priv->hw_init = alps_hw_init_v3;
- priv->process_packet = alps_process_packet_v3;
- priv->set_abs_params = alps_set_abs_params_mt;
-+ priv->nibble_commands = alps_v3_nibble_commands;
-+ priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
- break;
- case ALPS_PROTO_V4:
- priv->hw_init = alps_hw_init_v4;
- priv->process_packet = alps_process_packet_v4;
- priv->set_abs_params = alps_set_abs_params_mt;
-+ priv->nibble_commands = alps_v4_nibble_commands;
-+ priv->addr_command = PSMOUSE_CMD_DISABLE;
- break;
- }
- }
---
-1.8.1.2
-
-
-From df0bf385112a7b38c5c3d307bb9399f9f3b3bba2 Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:23:34 -0800
-Subject: [PATCH 08/15] Input: ALPS - rework detection of Pinnacle AGx
- touchpads
-
-The official ALPS driver uses the EC report, not the E7 report, to detect
-these devices. Also, they check for a range of values; the original
-table-based code only checked for two specific ones.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index 2221a00..eafeae2 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -109,8 +109,6 @@ static const struct alps_model_info alps_model_data[] = {
- { { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */
- { { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff,
- ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */
-- { { 0x73, 0x02, 0x64 }, 0x9b, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT },
-- { { 0x73, 0x02, 0x64 }, 0x9d, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT },
- { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 },
- };
-
-@@ -1412,6 +1410,10 @@ error:
-
- static void alps_set_defaults(struct alps_data *priv)
- {
-+ priv->byte0 = 0x8f;
-+ priv->mask0 = 0x8f;
-+ priv->flags = ALPS_DUALPOINT;
-+
- switch (priv->proto_version) {
- case ALPS_PROTO_V1:
- case ALPS_PROTO_V2:
-@@ -1491,8 +1493,15 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
- alps_exit_command_mode(psmouse))
- return -EIO;
-
-- if (alps_match_table(psmouse, priv, e7, ec) == 0)
-+ if (alps_match_table(psmouse, priv, e7, ec) == 0) {
-+ return 0;
-+ } else if (ec[0] == 0x88 && ec[1] == 0x07 &&
-+ ec[2] >= 0x90 && ec[2] <= 0x9d) {
-+ priv->proto_version = ALPS_PROTO_V3;
-+ alps_set_defaults(priv);
-+
- return 0;
-+ }
-
- psmouse_info(psmouse,
- "Unknown ALPS touchpad: E7=%2.2x %2.2x %2.2x, EC=%2.2x %2.2x %2.2x\n",
---
-1.8.1.2
-
-
-From 8e6493f800dc08a28abd59dfe63790aaade0c700 Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:24:22 -0800
-Subject: [PATCH 09/15] Input: ALPS - fix command mode check
-
-Pinnacle class devices should return "88 07 xx" or "88 08 xx" when
-entering command mode. If either the first byte or the second byte is
-invalid, return an error.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index eafeae2..bfc1938 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -983,7 +983,7 @@ static int alps_enter_command_mode(struct psmouse *psmouse,
- return -1;
- }
-
-- if (param[0] != 0x88 && param[1] != 0x07) {
-+ if (param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) {
- psmouse_dbg(psmouse,
- "unknown response while entering command mode\n");
- return -1;
---
-1.8.1.2
-
-
-From 0302b4c4a1b4201bf82a45c46084f3ccd0ee696f Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:24:55 -0800
-Subject: [PATCH 10/15] Input: ALPS - move pixel and bitmap info into alps_data
- struct
-
-Newer touchpads use different constants, so make them runtime-
-configurable.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 47 ++++++++++++++++++++++++----------------------
- drivers/input/mouse/alps.h | 8 ++++++++
- 2 files changed, 33 insertions(+), 22 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index bfc1938..2cd8be7 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -27,12 +27,6 @@
- /*
- * Definitions for ALPS version 3 and 4 command mode protocol
- */
--#define ALPS_V3_X_MAX 2000
--#define ALPS_V3_Y_MAX 1400
--
--#define ALPS_BITMAP_X_BITS 15
--#define ALPS_BITMAP_Y_BITS 11
--
- #define ALPS_CMD_NIBBLE_10 0x01f2
-
- static const struct alps_nibble_commands alps_v3_nibble_commands[] = {
-@@ -269,7 +263,8 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
- * These points are returned in x1, y1, x2, and y2 when the return value
- * is greater than 0.
- */
--static int alps_process_bitmap(unsigned int x_map, unsigned int y_map,
-+static int alps_process_bitmap(struct alps_data *priv,
-+ unsigned int x_map, unsigned int y_map,
- int *x1, int *y1, int *x2, int *y2)
- {
- struct alps_bitmap_point {
-@@ -311,7 +306,7 @@ static int alps_process_bitmap(unsigned int x_map, unsigned int y_map,
- * y bitmap is reversed for what we need (lower positions are in
- * higher bits), so we process from the top end.
- */
-- y_map = y_map << (sizeof(y_map) * BITS_PER_BYTE - ALPS_BITMAP_Y_BITS);
-+ y_map = y_map << (sizeof(y_map) * BITS_PER_BYTE - priv->y_bits);
- prev_bit = 0;
- point = &y_low;
- for (i = 0; y_map != 0; i++, y_map <<= 1) {
-@@ -357,16 +352,18 @@ static int alps_process_bitmap(unsigned int x_map, unsigned int y_map,
- }
- }
-
-- *x1 = (ALPS_V3_X_MAX * (2 * x_low.start_bit + x_low.num_bits - 1)) /
-- (2 * (ALPS_BITMAP_X_BITS - 1));
-- *y1 = (ALPS_V3_Y_MAX * (2 * y_low.start_bit + y_low.num_bits - 1)) /
-- (2 * (ALPS_BITMAP_Y_BITS - 1));
-+ *x1 = (priv->x_max * (2 * x_low.start_bit + x_low.num_bits - 1)) /
-+ (2 * (priv->x_bits - 1));
-+ *y1 = (priv->y_max * (2 * y_low.start_bit + y_low.num_bits - 1)) /
-+ (2 * (priv->y_bits - 1));
-
- if (fingers > 1) {
-- *x2 = (ALPS_V3_X_MAX * (2 * x_high.start_bit + x_high.num_bits - 1)) /
-- (2 * (ALPS_BITMAP_X_BITS - 1));
-- *y2 = (ALPS_V3_Y_MAX * (2 * y_high.start_bit + y_high.num_bits - 1)) /
-- (2 * (ALPS_BITMAP_Y_BITS - 1));
-+ *x2 = (priv->x_max *
-+ (2 * x_high.start_bit + x_high.num_bits - 1)) /
-+ (2 * (priv->x_bits - 1));
-+ *y2 = (priv->y_max *
-+ (2 * y_high.start_bit + y_high.num_bits - 1)) /
-+ (2 * (priv->y_bits - 1));
- }
-
- return fingers;
-@@ -484,7 +481,8 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- ((packet[2] & 0x7f) << 1) |
- (packet[4] & 0x01);
-
-- bmap_fingers = alps_process_bitmap(x_bitmap, y_bitmap,
-+ bmap_fingers = alps_process_bitmap(priv,
-+ x_bitmap, y_bitmap,
- &x1, &y1, &x2, &y2);
-
- /*
-@@ -641,7 +639,7 @@ static void alps_process_packet_v4(struct psmouse *psmouse)
- ((priv->multi_data[3] & 0x1f) << 5) |
- (priv->multi_data[1] & 0x1f);
-
-- fingers = alps_process_bitmap(x_bitmap, y_bitmap,
-+ fingers = alps_process_bitmap(priv, x_bitmap, y_bitmap,
- &x1, &y1, &x2, &y2);
-
- /* Store MT data.*/
-@@ -1414,6 +1412,11 @@ static void alps_set_defaults(struct alps_data *priv)
- priv->mask0 = 0x8f;
- priv->flags = ALPS_DUALPOINT;
-
-+ priv->x_max = 2000;
-+ priv->y_max = 1400;
-+ priv->x_bits = 15;
-+ priv->y_bits = 11;
-+
- switch (priv->proto_version) {
- case ALPS_PROTO_V1:
- case ALPS_PROTO_V2:
-@@ -1544,15 +1547,15 @@ static void alps_set_abs_params_mt(struct alps_data *priv,
- {
- set_bit(INPUT_PROP_SEMI_MT, dev1->propbit);
- input_mt_init_slots(dev1, 2, 0);
-- input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, ALPS_V3_X_MAX, 0, 0);
-- input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, ALPS_V3_Y_MAX, 0, 0);
-+ input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, priv->x_max, 0, 0);
-+ input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, priv->y_max, 0, 0);
-
- set_bit(BTN_TOOL_DOUBLETAP, dev1->keybit);
- set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit);
- set_bit(BTN_TOOL_QUADTAP, dev1->keybit);
-
-- input_set_abs_params(dev1, ABS_X, 0, ALPS_V3_X_MAX, 0, 0);
-- input_set_abs_params(dev1, ABS_Y, 0, ALPS_V3_Y_MAX, 0, 0);
-+ input_set_abs_params(dev1, ABS_X, 0, priv->x_max, 0, 0);
-+ input_set_abs_params(dev1, ABS_Y, 0, priv->y_max, 0, 0);
- }
-
- int alps_init(struct psmouse *psmouse)
-diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
-index 0934f8b..5e638be 100644
---- a/drivers/input/mouse/alps.h
-+++ b/drivers/input/mouse/alps.h
-@@ -72,6 +72,10 @@ struct alps_nibble_commands {
- * mask0, should match byte0.
- * @mask0: The mask used to check the first byte of the report.
- * @flags: Additional device capabilities (passthrough port, trackstick, etc.).
-+ * @x_max: Largest possible X position value.
-+ * @y_max: Largest possible Y position value.
-+ * @x_bits: Number of X bits in the MT bitmap.
-+ * @y_bits: Number of Y bits in the MT bitmap.
- * @hw_init: Protocol-specific hardware init function.
- * @process_packet: Protocol-specific function to process a report packet.
- * @set_abs_params: Protocol-specific function to configure the input_dev.
-@@ -96,6 +100,10 @@ struct alps_data {
- unsigned char proto_version;
- unsigned char byte0, mask0;
- unsigned char flags;
-+ int x_max;
-+ int y_max;
-+ int x_bits;
-+ int y_bits;
-
- int (*hw_init)(struct psmouse *psmouse);
- void (*process_packet)(struct psmouse *psmouse);
---
-1.8.1.2
-
-
-From 3c9d054fef84ccc967445b330ab6012c6b6bd85b Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:26:11 -0800
-Subject: [PATCH 11/15] Input: ALPS - make the V3 packet field decoder
- "pluggable"
-
-A number of different ALPS touchpad protocols can reuse
-alps_process_touchpad_packet_v3() with small tweaks to the bitfield
-decoding. Create a new priv->decode_fields() callback that handles the
-per-model differences.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 101 +++++++++++++++++++++++++--------------------
- drivers/input/mouse/alps.h | 38 +++++++++++++++++
- 2 files changed, 95 insertions(+), 44 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index 2cd8be7..270b7de 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -447,17 +447,49 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse)
- return;
- }
-
-+static void alps_decode_buttons_v3(struct alps_fields *f, unsigned char *p)
-+{
-+ f->left = !!(p[3] & 0x01);
-+ f->right = !!(p[3] & 0x02);
-+ f->middle = !!(p[3] & 0x04);
-+
-+ f->ts_left = !!(p[3] & 0x10);
-+ f->ts_right = !!(p[3] & 0x20);
-+ f->ts_middle = !!(p[3] & 0x40);
-+}
-+
-+static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p)
-+{
-+ f->first_mp = !!(p[4] & 0x40);
-+ f->is_mp = !!(p[0] & 0x40);
-+
-+ f->fingers = (p[5] & 0x3) + 1;
-+ f->x_map = ((p[4] & 0x7e) << 8) |
-+ ((p[1] & 0x7f) << 2) |
-+ ((p[0] & 0x30) >> 4);
-+ f->y_map = ((p[3] & 0x70) << 4) |
-+ ((p[2] & 0x7f) << 1) |
-+ (p[4] & 0x01);
-+
-+ f->x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) |
-+ ((p[0] & 0x30) >> 4);
-+ f->y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f);
-+ f->z = p[5] & 0x7f;
-+
-+ alps_decode_buttons_v3(f, p);
-+}
-+
- static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
- unsigned char *packet = psmouse->packet;
- struct input_dev *dev = psmouse->dev;
- struct input_dev *dev2 = priv->dev2;
-- int x, y, z;
-- int left, right, middle;
- int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
- int fingers = 0, bmap_fingers;
-- unsigned int x_bitmap, y_bitmap;
-+ struct alps_fields f;
-+
-+ priv->decode_fields(&f, packet);
-
- /*
- * There's no single feature of touchpad position and bitmap packets
-@@ -472,17 +504,10 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- * packet. Check for this, and when it happens process the
- * position packet as usual.
- */
-- if (packet[0] & 0x40) {
-- fingers = (packet[5] & 0x3) + 1;
-- x_bitmap = ((packet[4] & 0x7e) << 8) |
-- ((packet[1] & 0x7f) << 2) |
-- ((packet[0] & 0x30) >> 4);
-- y_bitmap = ((packet[3] & 0x70) << 4) |
-- ((packet[2] & 0x7f) << 1) |
-- (packet[4] & 0x01);
--
-+ if (f.is_mp) {
-+ fingers = f.fingers;
- bmap_fingers = alps_process_bitmap(priv,
-- x_bitmap, y_bitmap,
-+ f.x_map, f.y_map,
- &x1, &y1, &x2, &y2);
-
- /*
-@@ -493,7 +518,7 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- fingers = bmap_fingers;
-
- /* Now process position packet */
-- packet = priv->multi_data;
-+ priv->decode_fields(&f, priv->multi_data);
- } else {
- priv->multi_packet = 0;
- }
-@@ -507,10 +532,10 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- * out misidentified bitmap packets, we reject anything with this
- * bit set.
- */
-- if (packet[0] & 0x40)
-+ if (f.is_mp)
- return;
-
-- if (!priv->multi_packet && (packet[4] & 0x40)) {
-+ if (!priv->multi_packet && f.first_mp) {
- priv->multi_packet = 1;
- memcpy(priv->multi_data, packet, sizeof(priv->multi_data));
- return;
-@@ -518,22 +543,13 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
-
- priv->multi_packet = 0;
-
-- left = packet[3] & 0x01;
-- right = packet[3] & 0x02;
-- middle = packet[3] & 0x04;
--
-- x = ((packet[1] & 0x7f) << 4) | ((packet[4] & 0x30) >> 2) |
-- ((packet[0] & 0x30) >> 4);
-- y = ((packet[2] & 0x7f) << 4) | (packet[4] & 0x0f);
-- z = packet[5] & 0x7f;
--
- /*
- * Sometimes the hardware sends a single packet with z = 0
- * in the middle of a stream. Real releases generate packets
- * with x, y, and z all zero, so these seem to be flukes.
- * Ignore them.
- */
-- if (x && y && !z)
-+ if (f.x && f.y && !f.z)
- return;
-
- /*
-@@ -541,12 +557,12 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- * to rely on ST data.
- */
- if (!fingers) {
-- x1 = x;
-- y1 = y;
-- fingers = z > 0 ? 1 : 0;
-+ x1 = f.x;
-+ y1 = f.y;
-+ fingers = f.z > 0 ? 1 : 0;
- }
-
-- if (z >= 64)
-+ if (f.z >= 64)
- input_report_key(dev, BTN_TOUCH, 1);
- else
- input_report_key(dev, BTN_TOUCH, 0);
-@@ -555,26 +571,22 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
-
- input_mt_report_finger_count(dev, fingers);
-
-- input_report_key(dev, BTN_LEFT, left);
-- input_report_key(dev, BTN_RIGHT, right);
-- input_report_key(dev, BTN_MIDDLE, middle);
-+ input_report_key(dev, BTN_LEFT, f.left);
-+ input_report_key(dev, BTN_RIGHT, f.right);
-+ input_report_key(dev, BTN_MIDDLE, f.middle);
-
-- if (z > 0) {
-- input_report_abs(dev, ABS_X, x);
-- input_report_abs(dev, ABS_Y, y);
-+ if (f.z > 0) {
-+ input_report_abs(dev, ABS_X, f.x);
-+ input_report_abs(dev, ABS_Y, f.y);
- }
-- input_report_abs(dev, ABS_PRESSURE, z);
-+ input_report_abs(dev, ABS_PRESSURE, f.z);
-
- input_sync(dev);
-
- if (!(priv->quirks & ALPS_QUIRK_TRACKSTICK_BUTTONS)) {
-- left = packet[3] & 0x10;
-- right = packet[3] & 0x20;
-- middle = packet[3] & 0x40;
--
-- input_report_key(dev2, BTN_LEFT, left);
-- input_report_key(dev2, BTN_RIGHT, right);
-- input_report_key(dev2, BTN_MIDDLE, middle);
-+ input_report_key(dev2, BTN_LEFT, f.ts_left);
-+ input_report_key(dev2, BTN_RIGHT, f.ts_right);
-+ input_report_key(dev2, BTN_MIDDLE, f.ts_middle);
- input_sync(dev2);
- }
- }
-@@ -1428,6 +1440,7 @@ static void alps_set_defaults(struct alps_data *priv)
- priv->hw_init = alps_hw_init_v3;
- priv->process_packet = alps_process_packet_v3;
- priv->set_abs_params = alps_set_abs_params_mt;
-+ priv->decode_fields = alps_decode_pinnacle;
- priv->nibble_commands = alps_v3_nibble_commands;
- priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
- break;
-diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
-index 5e638be..9704805 100644
---- a/drivers/input/mouse/alps.h
-+++ b/drivers/input/mouse/alps.h
-@@ -60,6 +60,42 @@ struct alps_nibble_commands {
- };
-
- /**
-+ * struct alps_fields - decoded version of the report packet
-+ * @x_map: Bitmap of active X positions for MT.
-+ * @y_map: Bitmap of active Y positions for MT.
-+ * @fingers: Number of fingers for MT.
-+ * @x: X position for ST.
-+ * @y: Y position for ST.
-+ * @z: Z position for ST.
-+ * @first_mp: Packet is the first of a multi-packet report.
-+ * @is_mp: Packet is part of a multi-packet report.
-+ * @left: Left touchpad button is active.
-+ * @right: Right touchpad button is active.
-+ * @middle: Middle touchpad button is active.
-+ * @ts_left: Left trackstick button is active.
-+ * @ts_right: Right trackstick button is active.
-+ * @ts_middle: Middle trackstick button is active.
-+ */
-+struct alps_fields {
-+ unsigned int x_map;
-+ unsigned int y_map;
-+ unsigned int fingers;
-+ unsigned int x;
-+ unsigned int y;
-+ unsigned int z;
-+ unsigned int first_mp:1;
-+ unsigned int is_mp:1;
-+
-+ unsigned int left:1;
-+ unsigned int right:1;
-+ unsigned int middle:1;
-+
-+ unsigned int ts_left:1;
-+ unsigned int ts_right:1;
-+ unsigned int ts_middle:1;
-+};
-+
-+/**
- * struct alps_data - private data structure for the ALPS driver
- * @dev2: "Relative" device used to report trackstick or mouse activity.
- * @phys: Physical path for the relative device.
-@@ -78,6 +114,7 @@ struct alps_nibble_commands {
- * @y_bits: Number of Y bits in the MT bitmap.
- * @hw_init: Protocol-specific hardware init function.
- * @process_packet: Protocol-specific function to process a report packet.
-+ * @decode_fields: Protocol-specific function to read packet bitfields.
- * @set_abs_params: Protocol-specific function to configure the input_dev.
- * @prev_fin: Finger bit from previous packet.
- * @multi_packet: Multi-packet data in progress.
-@@ -107,6 +144,7 @@ struct alps_data {
-
- int (*hw_init)(struct psmouse *psmouse);
- void (*process_packet)(struct psmouse *psmouse);
-+ void (*decode_fields)(struct alps_fields *f, unsigned char *p);
- void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1);
-
- int prev_fin;
---
-1.8.1.2
-
-
-From 9e7c99b6c125653f53ef0999a176c3a79de21be8 Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:27:08 -0800
-Subject: [PATCH 12/15] Input: ALPS - add support for "Rushmore" touchpads
-
-Rushmore touchpads are found on Dell E6230/E6430/E6530. They use the V3
-protocol with slightly tweaked init sequences and report formats.
-
-The E7 report is 73 03 0a, and the EC report is 88 08 1d
-
-Credits: Emmanuel Thome reported the MT bitmap changes.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 52 insertions(+)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index 270b7de..bf2fa51 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -479,6 +479,14 @@ static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p)
- alps_decode_buttons_v3(f, p);
- }
-
-+static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p)
-+{
-+ alps_decode_pinnacle(f, p);
-+
-+ f->x_map |= (p[5] & 0x10) << 11;
-+ f->y_map |= (p[5] & 0x20) << 6;
-+}
-+
- static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
-@@ -1329,6 +1337,40 @@ error:
- return -1;
- }
-
-+static int alps_hw_init_rushmore_v3(struct psmouse *psmouse)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+ int reg_val, ret = -1;
-+
-+ if (alps_enter_command_mode(psmouse, NULL) ||
-+ alps_command_mode_read_reg(psmouse, 0xc2d9) == -1 ||
-+ alps_command_mode_write_reg(psmouse, 0xc2cb, 0x00))
-+ goto error;
-+
-+ reg_val = alps_command_mode_read_reg(psmouse, 0xc2c6);
-+ if (reg_val == -1)
-+ goto error;
-+ if (__alps_command_mode_write_reg(psmouse, reg_val & 0xfd))
-+ goto error;
-+
-+ if (alps_command_mode_write_reg(psmouse, 0xc2c9, 0x64))
-+ goto error;
-+
-+ /* enter absolute mode */
-+ reg_val = alps_command_mode_read_reg(psmouse, 0xc2c4);
-+ if (reg_val == -1)
-+ goto error;
-+ if (__alps_command_mode_write_reg(psmouse, reg_val | 0x02))
-+ goto error;
-+
-+ alps_exit_command_mode(psmouse);
-+ return ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);
-+
-+error:
-+ alps_exit_command_mode(psmouse);
-+ return ret;
-+}
-+
- /* Must be in command mode when calling this function */
- static int alps_absolute_mode_v4(struct psmouse *psmouse)
- {
-@@ -1511,6 +1553,16 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
-
- if (alps_match_table(psmouse, priv, e7, ec) == 0) {
- return 0;
-+ } else if (ec[0] == 0x88 && ec[1] == 0x08) {
-+ priv->proto_version = ALPS_PROTO_V3;
-+ alps_set_defaults(priv);
-+
-+ priv->hw_init = alps_hw_init_rushmore_v3;
-+ priv->decode_fields = alps_decode_rushmore;
-+ priv->x_bits = 16;
-+ priv->y_bits = 12;
-+
-+ return 0;
- } else if (ec[0] == 0x88 && ec[1] == 0x07 &&
- ec[2] >= 0x90 && ec[2] <= 0x9d) {
- priv->proto_version = ALPS_PROTO_V3;
---
-1.8.1.2
-
-
-From e5ca58dc506fb7f64760b483ecd407593b764f3b Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Wed, 13 Feb 2013 22:28:07 -0800
-Subject: [PATCH 13/15] Input: ALPS - enable trackstick on Rushmore touchpads
-
-Separate out the common trackstick probe/setup sequences, then call them
-from each of the v3 init functions.
-
-Credits: Emmanual Thome furnished the information on the trackstick init
-and how it affected the report format.
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
-Tested-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
----
- drivers/input/mouse/alps.c | 185 ++++++++++++++++++++++++++++-----------------
- 1 file changed, 115 insertions(+), 70 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index bf2fa51..7b99fc7 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -29,6 +29,9 @@
- */
- #define ALPS_CMD_NIBBLE_10 0x01f2
-
-+#define ALPS_REG_BASE_RUSHMORE 0xc2c0
-+#define ALPS_REG_BASE_PINNACLE 0x0000
-+
- static const struct alps_nibble_commands alps_v3_nibble_commands[] = {
- { PSMOUSE_CMD_SETPOLL, 0x00 }, /* 0 */
- { PSMOUSE_CMD_RESET_DIS, 0x00 }, /* 1 */
-@@ -1166,26 +1169,31 @@ static int alps_hw_init_v1_v2(struct psmouse *psmouse)
- }
-
- /*
-- * Enable or disable passthrough mode to the trackstick. Must be in
-- * command mode when calling this function.
-+ * Enable or disable passthrough mode to the trackstick.
- */
--static int alps_passthrough_mode_v3(struct psmouse *psmouse, bool enable)
-+static int alps_passthrough_mode_v3(struct psmouse *psmouse,
-+ int reg_base, bool enable)
- {
-- int reg_val;
-+ int reg_val, ret = -1;
-
-- reg_val = alps_command_mode_read_reg(psmouse, 0x0008);
-- if (reg_val == -1)
-+ if (alps_enter_command_mode(psmouse, NULL))
- return -1;
-
-+ reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x0008);
-+ if (reg_val == -1)
-+ goto error;
-+
- if (enable)
- reg_val |= 0x01;
- else
- reg_val &= ~0x01;
-
-- if (__alps_command_mode_write_reg(psmouse, reg_val))
-- return -1;
-+ ret = __alps_command_mode_write_reg(psmouse, reg_val);
-
-- return 0;
-+error:
-+ if (alps_exit_command_mode(psmouse))
-+ ret = -1;
-+ return ret;
- }
-
- /* Must be in command mode when calling this function */
-@@ -1204,69 +1212,102 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)
- return 0;
- }
-
--static int alps_hw_init_v3(struct psmouse *psmouse)
-+static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base)
- {
-- struct ps2dev *ps2dev = &psmouse->ps2dev;
-- int reg_val;
-- unsigned char param[4];
-+ int ret = -EIO, reg_val;
-
- if (alps_enter_command_mode(psmouse, NULL))
- goto error;
-
-- /* Check for trackstick */
-- reg_val = alps_command_mode_read_reg(psmouse, 0x0008);
-+ reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x08);
- if (reg_val == -1)
- goto error;
-- if (reg_val & 0x80) {
-- if (alps_passthrough_mode_v3(psmouse, true))
-- goto error;
-- if (alps_exit_command_mode(psmouse))
-- goto error;
-+
-+ /* bit 7: trackstick is present */
-+ ret = reg_val & 0x80 ? 0 : -ENODEV;
-+
-+error:
-+ alps_exit_command_mode(psmouse);
-+ return ret;
-+}
-+
-+static int alps_setup_trackstick_v3(struct psmouse *psmouse, int reg_base)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+ int ret = 0;
-+ unsigned char param[4];
-+
-+ if (alps_passthrough_mode_v3(psmouse, reg_base, true))
-+ return -EIO;
-+
-+ /*
-+ * E7 report for the trackstick
-+ *
-+ * There have been reports of failures to seem to trace back
-+ * to the above trackstick check failing. When these occur
-+ * this E7 report fails, so when that happens we continue
-+ * with the assumption that there isn't a trackstick after
-+ * all.
-+ */
-+ if (alps_rpt_cmd(psmouse, 0, PSMOUSE_CMD_SETSCALE21, param)) {
-+ psmouse_warn(psmouse, "trackstick E7 report failed\n");
-+ ret = -ENODEV;
-+ } else {
-+ psmouse_dbg(psmouse,
-+ "trackstick E7 report: %2.2x %2.2x %2.2x\n",
-+ param[0], param[1], param[2]);
-
- /*
-- * E7 report for the trackstick
-- *
-- * There have been reports of failures to seem to trace back
-- * to the above trackstick check failing. When these occur
-- * this E7 report fails, so when that happens we continue
-- * with the assumption that there isn't a trackstick after
-- * all.
-+ * Not sure what this does, but it is absolutely
-+ * essential. Without it, the touchpad does not
-+ * work at all and the trackstick just emits normal
-+ * PS/2 packets.
- */
-- param[0] = 0x64;
-- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) ||
-- ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) {
-- psmouse_warn(psmouse, "trackstick E7 report failed\n");
-- } else {
-- psmouse_dbg(psmouse,
-- "trackstick E7 report: %2.2x %2.2x %2.2x\n",
-- param[0], param[1], param[2]);
--
-- /*
-- * Not sure what this does, but it is absolutely
-- * essential. Without it, the touchpad does not
-- * work at all and the trackstick just emits normal
-- * PS/2 packets.
-- */
-- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-- alps_command_mode_send_nibble(psmouse, 0x9) ||
-- alps_command_mode_send_nibble(psmouse, 0x4)) {
-- psmouse_err(psmouse,
-- "Error sending magic E6 sequence\n");
-- goto error_passthrough;
-- }
-+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
-+ alps_command_mode_send_nibble(psmouse, 0x9) ||
-+ alps_command_mode_send_nibble(psmouse, 0x4)) {
-+ psmouse_err(psmouse,
-+ "Error sending magic E6 sequence\n");
-+ ret = -EIO;
-+ goto error;
- }
-
-- if (alps_enter_command_mode(psmouse, NULL))
-- goto error_passthrough;
-- if (alps_passthrough_mode_v3(psmouse, false))
-- goto error;
-+ /*
-+ * This ensures the trackstick packets are in the format
-+ * supported by this driver. If bit 1 isn't set the packet
-+ * format is different.
-+ */
-+ if (alps_enter_command_mode(psmouse, NULL) ||
-+ alps_command_mode_write_reg(psmouse,
-+ reg_base + 0x08, 0x82) ||
-+ alps_exit_command_mode(psmouse))
-+ ret = -EIO;
- }
-
-- if (alps_absolute_mode_v3(psmouse)) {
-+error:
-+ if (alps_passthrough_mode_v3(psmouse, reg_base, false))
-+ ret = -EIO;
-+
-+ return ret;
-+}
-+
-+static int alps_hw_init_v3(struct psmouse *psmouse)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+ int reg_val;
-+ unsigned char param[4];
-+
-+ reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE);
-+ if (reg_val == -EIO)
-+ goto error;
-+ if (reg_val == 0 &&
-+ alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO)
-+ goto error;
-+
-+ if (alps_enter_command_mode(psmouse, NULL) ||
-+ alps_absolute_mode_v3(psmouse)) {
- psmouse_err(psmouse, "Failed to enter absolute mode\n");
- goto error;
- }
-@@ -1303,14 +1344,6 @@ static int alps_hw_init_v3(struct psmouse *psmouse)
- if (alps_command_mode_write_reg(psmouse, 0x0162, 0x04))
- goto error;
-
-- /*
-- * This ensures the trackstick packets are in the format
-- * supported by this driver. If bit 1 isn't set the packet
-- * format is different.
-- */
-- if (alps_command_mode_write_reg(psmouse, 0x0008, 0x82))
-- goto error;
--
- alps_exit_command_mode(psmouse);
-
- /* Set rate and enable data reporting */
-@@ -1323,10 +1356,6 @@ static int alps_hw_init_v3(struct psmouse *psmouse)
-
- return 0;
-
--error_passthrough:
-- /* Something failed while in passthrough mode, so try to get out */
-- if (!alps_enter_command_mode(psmouse, NULL))
-- alps_passthrough_mode_v3(psmouse, false);
- error:
- /*
- * Leaving the touchpad in command mode will essentially render
-@@ -1339,9 +1368,19 @@ error:
-
- static int alps_hw_init_rushmore_v3(struct psmouse *psmouse)
- {
-+ struct alps_data *priv = psmouse->private;
- struct ps2dev *ps2dev = &psmouse->ps2dev;
- int reg_val, ret = -1;
-
-+ if (priv->flags & ALPS_DUALPOINT) {
-+ reg_val = alps_setup_trackstick_v3(psmouse,
-+ ALPS_REG_BASE_RUSHMORE);
-+ if (reg_val == -EIO)
-+ goto error;
-+ if (reg_val == -ENODEV)
-+ priv->flags &= ~ALPS_DUALPOINT;
-+ }
-+
- if (alps_enter_command_mode(psmouse, NULL) ||
- alps_command_mode_read_reg(psmouse, 0xc2d9) == -1 ||
- alps_command_mode_write_reg(psmouse, 0xc2cb, 0x00))
-@@ -1562,6 +1601,12 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
- priv->x_bits = 16;
- priv->y_bits = 12;
-
-+ /* hack to make addr_command, nibble_command available */
-+ psmouse->private = priv;
-+
-+ if (alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_RUSHMORE))
-+ priv->flags &= ~ALPS_DUALPOINT;
-+
- return 0;
- } else if (ec[0] == 0x88 && ec[1] == 0x07 &&
- ec[2] >= 0x90 && ec[2] <= 0x9d) {
---
-1.8.1.2
-
-
-From db7192fa07fa5c70c9849d8f658a7ff696cff99d Mon Sep 17 00:00:00 2001
-From: Kevin Cernekee <cernekee@gmail.com>
-Date: Sat, 16 Feb 2013 22:40:03 -0800
-Subject: [PATCH 14/15] Input: ALPS - Remove unused argument to
- alps_enter_command_mode()
-
-Now that alps_identify() explicitly issues an EC report using
-alps_rpt_cmd(), we no longer need to look at the magic numbers returned
-by alps_enter_command_mode().
-
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
----
- drivers/input/mouse/alps.c | 18 +++++++-----------
- 1 file changed, 7 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index 7b99fc7..9c97531 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -994,8 +994,7 @@ static int alps_rpt_cmd(struct psmouse *psmouse, int init_command,
- return 0;
- }
-
--static int alps_enter_command_mode(struct psmouse *psmouse,
-- unsigned char *resp)
-+static int alps_enter_command_mode(struct psmouse *psmouse)
- {
- unsigned char param[4];
-
-@@ -1009,9 +1008,6 @@ static int alps_enter_command_mode(struct psmouse *psmouse,
- "unknown response while entering command mode\n");
- return -1;
- }
--
-- if (resp)
-- *resp = param[2];
- return 0;
- }
-
-@@ -1176,7 +1172,7 @@ static int alps_passthrough_mode_v3(struct psmouse *psmouse,
- {
- int reg_val, ret = -1;
-
-- if (alps_enter_command_mode(psmouse, NULL))
-+ if (alps_enter_command_mode(psmouse))
- return -1;
-
- reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x0008);
-@@ -1216,7 +1212,7 @@ static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base)
- {
- int ret = -EIO, reg_val;
-
-- if (alps_enter_command_mode(psmouse, NULL))
-+ if (alps_enter_command_mode(psmouse))
- goto error;
-
- reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x08);
-@@ -1279,7 +1275,7 @@ static int alps_setup_trackstick_v3(struct psmouse *psmouse, int reg_base)
- * supported by this driver. If bit 1 isn't set the packet
- * format is different.
- */
-- if (alps_enter_command_mode(psmouse, NULL) ||
-+ if (alps_enter_command_mode(psmouse) ||
- alps_command_mode_write_reg(psmouse,
- reg_base + 0x08, 0x82) ||
- alps_exit_command_mode(psmouse))
-@@ -1306,7 +1302,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse)
- alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO)
- goto error;
-
-- if (alps_enter_command_mode(psmouse, NULL) ||
-+ if (alps_enter_command_mode(psmouse) ||
- alps_absolute_mode_v3(psmouse)) {
- psmouse_err(psmouse, "Failed to enter absolute mode\n");
- goto error;
-@@ -1381,7 +1377,7 @@ static int alps_hw_init_rushmore_v3(struct psmouse *psmouse)
- priv->flags &= ~ALPS_DUALPOINT;
- }
-
-- if (alps_enter_command_mode(psmouse, NULL) ||
-+ if (alps_enter_command_mode(psmouse) ||
- alps_command_mode_read_reg(psmouse, 0xc2d9) == -1 ||
- alps_command_mode_write_reg(psmouse, 0xc2cb, 0x00))
- goto error;
-@@ -1431,7 +1427,7 @@ static int alps_hw_init_v4(struct psmouse *psmouse)
- struct ps2dev *ps2dev = &psmouse->ps2dev;
- unsigned char param[4];
-
-- if (alps_enter_command_mode(psmouse, NULL))
-+ if (alps_enter_command_mode(psmouse))
- goto error;
-
- if (alps_absolute_mode_v4(psmouse)) {
---
-1.8.1.2
-
-
-From 10740a25bb3b895b5de7773f926a978416b38409 Mon Sep 17 00:00:00 2001
-From: Dave Turvene <dturvene@dahetral.com>
-Date: Sat, 16 Feb 2013 22:40:04 -0800
-Subject: [PATCH 15/15] Input: ALPS - Add "Dolphin V1" touchpad support
-
-These touchpads use a different protocol; they have been seen on Dell
-N5110, Dell 17R SE, and others.
-
-The official ALPS driver identifies them by looking for an exact match
-on the E7 report: 73 03 50. Dolphin V1 returns an EC report of
-73 01 xx (02 and 0d have been seen); Dolphin V2 returns an EC report of
-73 02 xx (02 has been seen).
-
-Dolphin V2 probably needs a different initialization sequence and/or
-report parser, so it is left for a future commit.
-
-Signed-off-by: Dave Turvene <dturvene@dahetral.com>
-Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
----
- drivers/input/mouse/alps.c | 67 ++++++++++++++++++++++++++++++++++++++++++++--
- drivers/input/mouse/alps.h | 1 +
- 2 files changed, 66 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
-index 9c97531..0238e0e 100644
---- a/drivers/input/mouse/alps.c
-+++ b/drivers/input/mouse/alps.c
-@@ -490,6 +490,29 @@ static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p)
- f->y_map |= (p[5] & 0x20) << 6;
- }
-
-+static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p)
-+{
-+ f->first_mp = !!(p[0] & 0x02);
-+ f->is_mp = !!(p[0] & 0x20);
-+
-+ f->fingers = ((p[0] & 0x6) >> 1 |
-+ (p[0] & 0x10) >> 2);
-+ f->x_map = ((p[2] & 0x60) >> 5) |
-+ ((p[4] & 0x7f) << 2) |
-+ ((p[5] & 0x7f) << 9) |
-+ ((p[3] & 0x07) << 16) |
-+ ((p[3] & 0x70) << 15) |
-+ ((p[0] & 0x01) << 22);
-+ f->y_map = (p[1] & 0x7f) |
-+ ((p[2] & 0x1f) << 7);
-+
-+ f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7));
-+ f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3));
-+ f->z = (p[0] & 4) ? 0 : p[5] & 0x7f;
-+
-+ alps_decode_buttons_v3(f, p);
-+}
-+
- static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
- {
- struct alps_data *priv = psmouse->private;
-@@ -874,7 +897,8 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
- }
-
- /* Bytes 2 - pktsize should have 0 in the highest bit */
-- if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize &&
-+ if (priv->proto_version != ALPS_PROTO_V5 &&
-+ psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize &&
- (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) {
- psmouse_dbg(psmouse, "refusing packet[%i] = %x\n",
- psmouse->pktcnt - 1,
-@@ -1003,7 +1027,8 @@ static int alps_enter_command_mode(struct psmouse *psmouse)
- return -1;
- }
-
-- if (param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) {
-+ if ((param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) &&
-+ param[0] != 0x73) {
- psmouse_dbg(psmouse,
- "unknown response while entering command mode\n");
- return -1;
-@@ -1495,6 +1520,23 @@ error:
- return -1;
- }
-
-+static int alps_hw_init_dolphin_v1(struct psmouse *psmouse)
-+{
-+ struct ps2dev *ps2dev = &psmouse->ps2dev;
-+ unsigned char param[2];
-+
-+ /* This is dolphin "v1" as empirically defined by florin9doi */
-+ param[0] = 0x64;
-+ param[1] = 0x28;
-+
-+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSTREAM) ||
-+ ps2_command(ps2dev, &param[0], PSMOUSE_CMD_SETRATE) ||
-+ ps2_command(ps2dev, &param[1], PSMOUSE_CMD_SETRATE))
-+ return -1;
-+
-+ return 0;
-+}
-+
- static void alps_set_defaults(struct alps_data *priv)
- {
- priv->byte0 = 0x8f;
-@@ -1528,6 +1570,21 @@ static void alps_set_defaults(struct alps_data *priv)
- priv->nibble_commands = alps_v4_nibble_commands;
- priv->addr_command = PSMOUSE_CMD_DISABLE;
- break;
-+ case ALPS_PROTO_V5:
-+ priv->hw_init = alps_hw_init_dolphin_v1;
-+ priv->process_packet = alps_process_packet_v3;
-+ priv->decode_fields = alps_decode_dolphin;
-+ priv->set_abs_params = alps_set_abs_params_mt;
-+ priv->nibble_commands = alps_v3_nibble_commands;
-+ priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
-+ priv->byte0 = 0xc8;
-+ priv->mask0 = 0xc8;
-+ priv->flags = 0;
-+ priv->x_max = 1360;
-+ priv->y_max = 660;
-+ priv->x_bits = 23;
-+ priv->y_bits = 12;
-+ break;
- }
- }
-
-@@ -1588,6 +1645,12 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
-
- if (alps_match_table(psmouse, priv, e7, ec) == 0) {
- return 0;
-+ } else if (e7[0] == 0x73 && e7[1] == 0x03 && e7[2] == 0x50 &&
-+ ec[0] == 0x73 && ec[1] == 0x01) {
-+ priv->proto_version = ALPS_PROTO_V5;
-+ alps_set_defaults(priv);
-+
-+ return 0;
- } else if (ec[0] == 0x88 && ec[1] == 0x08) {
- priv->proto_version = ALPS_PROTO_V3;
- alps_set_defaults(priv);
-diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
-index 9704805..eee5985 100644
---- a/drivers/input/mouse/alps.h
-+++ b/drivers/input/mouse/alps.h
-@@ -16,6 +16,7 @@
- #define ALPS_PROTO_V2 2
- #define ALPS_PROTO_V3 3
- #define ALPS_PROTO_V4 4
-+#define ALPS_PROTO_V5 5
-
- /**
- * struct alps_model_info - touchpad ID table
---
-1.8.1.2
-
diff --git a/freed-ora/current/master/arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch b/freed-ora/current/master/arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch
deleted file mode 100644
index fd92c1664..000000000
--- a/freed-ora/current/master/arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From patchwork Sun Jul 22 10:01:43 2012
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: arm-allnoconfig error: '__LINUX_ARM_ARCH__' undeclared
-Date: Sun, 22 Jul 2012 10:01:43 -0000
-From: Arnd Bergmann <arnd@arndb.de>
-X-Patchwork-Id: 1224201
-Message-Id: <201207221001.43528.arnd@arndb.de>
-To: Fengguang Wu <fengguang.wu@intel.com>
-Cc: Russell King <linux@arm.linux.org.uk>,
- LKML <linux-kernel@vger.kernel.org>, linux-arm-kernel@lists.infradead.org
-
-On Sunday 22 July 2012, Fengguang Wu wrote:
-> Kernel build failed on arm-allnoconfig:
->
-> include/linux/math64.h:55:15: error: '__LINUX_ARM_ARCH__' undeclared (first use in this function)
-> arch/arm/include/asm/glue-cache.h:129:2: error: #error Unknown cache maintenance model
-> arch/arm/include/asm/glue-df.h:99:2: error: #error Unknown data abort handler type
-> arch/arm/include/asm/glue-pf.h:54:2: error: #error Unknown prefetch abort handler type
->
-> Do you think this allnoconfig test meaningful at all?
-
-The allno/mod/yesconfig tests on ARM are somewhat limited in their
-usefulness at the moment because they always pick the same platform
-type (versatile) and don't really cover the cases that most people
-are interested in.
-
-The particular problem with allnoconfig is that the logic to determine
-the architecture level depends on at least one platform being selected,
-and there are also problems with nommu kernels that tend to not work
-if certain other options are not set correctly.
-
-We can make the nommu case go away if we make hide the option for
-non-expert configurations including allnoconfig. I suggested adding
-some logic to all the subarch Kconfig files that forces at least
-one of the boards to be enabled like the patch below, but a number
-of people didn't like it.
-
-For reference, here is what I would use in order to get 'make
-allnoconfig' to work on ARM. My impression is at the moment that
-we should make a more serious attempt at fixing all the possible
-configurations when we get to 'multiplatform' configurations,
-because that will be more interesting than doing it just for
-the versatile platform.
-
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-
-
-diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index a306d6d..e43e743 100644
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -236,7 +236,7 @@ source "kernel/Kconfig.freezer"
- menu "System Type"
-
- config MMU
-- bool "MMU-based Paged Memory Management Support"
-+ bool "MMU-based Paged Memory Management Support" if EXPERT
- default y
- help
- Select if you want MMU-based virtualised addressing space
-diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
-index c1f38f6..455f20a 100644
---- a/arch/arm/mach-versatile/Kconfig
-+++ b/arch/arm/mach-versatile/Kconfig
-@@ -25,4 +25,13 @@ config MACH_VERSATILE_DT
- Include support for the ARM(R) Versatile/PB platform,
- using the device tree for discovery
-
-+config MACH_VERSATILE_AUTO
-+ def_bool y
-+ depends on !ARCH_VERSATILE_PB
-+ depends on !MACH_VERSATILE_AB
-+ select MACH_VERSATILE_DT
-+ help
-+ We autoselect MACH_VERSATILE_DT if both PB and AB are
-+ disabled, to ensure that at least one platform is enabled.
-+
- endmenu
diff --git a/freed-ora/current/master/arm-imx-fixdrm.patch b/freed-ora/current/master/arm-imx-fixdrm.patch
deleted file mode 100644
index 069cbb005..000000000
--- a/freed-ora/current/master/arm-imx-fixdrm.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-This fixes the following error when building for arm-imx:
-> ERROR: "__clk_get_name" [drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.ko] undefined!
-> make[1]: *** [__modpost] Error 1
-> make: *** [modules] Error 2
-
-There are valid usecases to get the name of a clock, be it for debugging
-purposes or to register a children of a clock like done in this IPU driver.
-Therefore exporting __clk_get_name() and make it available for others makes
-sense.
-
-Reported-by: Peter Robinson <pbrobinson at gmail.com>
-CC: Sascha Hauer <s.hauer at pengutronix.de>
-CC: Mike Turquette <mturquette at linaro.org>
-Signed-off-by: Niels de Vos <ndevos at redhat.com>
----
- drivers/clk/clk.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
-index 251e45d..fbe0f3a 100644
---- a/drivers/clk/clk.c
-+++ b/drivers/clk/clk.c
-@@ -259,10 +259,11 @@ late_initcall(clk_disable_unused);
-
- /*** helper functions ***/
-
--inline const char *__clk_get_name(struct clk *clk)
-+const char *__clk_get_name(struct clk *clk)
- {
- return !clk ? NULL : clk->name;
- }
-+EXPORT_SYMBOL_GPL(__clk_get_name);
-
- inline struct clk_hw *__clk_get_hw(struct clk *clk)
- {
---
-1.7.11.7
diff --git a/freed-ora/current/master/arm-lpae-ax88796.patch b/freed-ora/current/master/arm-lpae-ax88796.patch
new file mode 100644
index 000000000..b1bdc760c
--- /dev/null
+++ b/freed-ora/current/master/arm-lpae-ax88796.patch
@@ -0,0 +1,21 @@
+X-Git-Url: http://git.linaro.org/gitweb?p=people%2Fahs3%2Farndale-acpi.git;a=blobdiff_plain;f=drivers%2Fnet%2Fethernet%2F8390%2Fax88796.c;fp=drivers%2Fnet%2Fethernet%2F8390%2Fax88796.c;h=763e575c82bc5d24e1927ad685dfbdd7a0eaa19e;hp=70dba5d01ad3cc8178318f9976a5922894a86859;hb=fe8e7c500d3d25234759351096d457b6e557ebd9;hpb=af28003b46fa7b2c5d7b52e0d4bc8f725a6305f1
+
+diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
+index 70dba5d..763e575 100644
+--- a/drivers/net/ethernet/8390/ax88796.c
++++ b/drivers/net/ethernet/8390/ax88796.c
+@@ -828,7 +828,14 @@ static int ax_probe(struct platform_device *pdev)
+ struct ei_device *ei_local;
+ struct ax_device *ax;
+ struct resource *irq, *mem, *mem2;
++#ifndef CONFIG_ARM_LPAE
++ /* LPAE breaks this code as __aeabi_uldivmod for 64-bit
++ * is not supported in lib1funcs.s yet
++ */
+ unsigned long mem_size, mem2_size = 0;
++#else
++ u32 mem_size, mem2_size = 0;
++#endif
+ int ret = 0;
+
+ dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
diff --git a/freed-ora/current/master/arm-of-dma.patch b/freed-ora/current/master/arm-of-dma.patch
new file mode 100644
index 000000000..c3223a4e6
--- /dev/null
+++ b/freed-ora/current/master/arm-of-dma.patch
@@ -0,0 +1,43 @@
+From 7362f04c2888b14c20f8aaa02e1a897025261768 Mon Sep 17 00:00:00 2001
+From: Viresh Kumar <viresh.kumar@linaro.org>
+Date: Fri, 15 Mar 2013 08:48:20 +0000
+Subject: DMA: OF: Check properties value before running be32_to_cpup() on it
+
+In of_dma_controller_register() routine we are calling of_get_property() as an
+parameter to be32_to_cpup(). In case the property doesn't exist we will get a
+crash.
+
+This patch changes this code to check if we got a valid property first and then
+runs be32_to_cpup() on it.
+
+Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Vinod Koul <vinod.koul@intel.com>
+---
+diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
+index 6036cd0..00db454 100644
+--- a/drivers/dma/of-dma.c
++++ b/drivers/dma/of-dma.c
+@@ -93,6 +93,7 @@ int of_dma_controller_register(struct device_node *np,
+ {
+ struct of_dma *ofdma;
+ int nbcells;
++ const __be32 *prop;
+
+ if (!np || !of_dma_xlate) {
+ pr_err("%s: not enough information provided\n", __func__);
+@@ -103,8 +104,11 @@ int of_dma_controller_register(struct device_node *np,
+ if (!ofdma)
+ return -ENOMEM;
+
+- nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL));
+- if (!nbcells) {
++ prop = of_get_property(np, "#dma-cells", NULL);
++ if (prop)
++ nbcells = be32_to_cpup(prop);
++
++ if (!prop || !nbcells) {
+ pr_err("%s: #dma-cells property is missing or invalid\n",
+ __func__);
+ kfree(ofdma);
+--
+cgit v0.9.1
diff --git a/freed-ora/current/master/arm-omap-ehci-fix.patch b/freed-ora/current/master/arm-omap-ehci-fix.patch
new file mode 100644
index 000000000..f6fc0a934
--- /dev/null
+++ b/freed-ora/current/master/arm-omap-ehci-fix.patch
@@ -0,0 +1,190 @@
+From 54a419668b0f27b7982807fb2376d237e0a0ce05 Mon Sep 17 00:00:00 2001
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Tue, 12 Mar 2013 10:44:39 +0000
+Subject: USB: EHCI: split ehci-omap out to a separate driver
+
+This patch (as1645) converts ehci-omap over to the new "ehci-hcd is a
+library" approach, so that it can coexist peacefully with other EHCI
+platform drivers and can make use of the private area allocated at
+the end of struct ehci_hcd.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
+index c59a112..62f4e9a 100644
+--- a/drivers/usb/host/Kconfig
++++ b/drivers/usb/host/Kconfig
+@@ -155,7 +155,7 @@ config USB_EHCI_MXC
+ Variation of ARC USB block used in some Freescale chips.
+
+ config USB_EHCI_HCD_OMAP
+- bool "EHCI support for OMAP3 and later chips"
++ tristate "EHCI support for OMAP3 and later chips"
+ depends on USB_EHCI_HCD && ARCH_OMAP
+ default y
+ ---help---
+diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
+index 001fbff..56de410 100644
+--- a/drivers/usb/host/Makefile
++++ b/drivers/usb/host/Makefile
+@@ -27,6 +27,7 @@ obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
+ obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
+ obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o
+ obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
++obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o
+
+ obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
+ obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
+diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
+index b416a3f..303b022 100644
+--- a/drivers/usb/host/ehci-hcd.c
++++ b/drivers/usb/host/ehci-hcd.c
+@@ -1252,11 +1252,6 @@ MODULE_LICENSE ("GPL");
+ #define PLATFORM_DRIVER ehci_hcd_sh_driver
+ #endif
+
+-#ifdef CONFIG_USB_EHCI_HCD_OMAP
+-#include "ehci-omap.c"
+-#define PLATFORM_DRIVER ehci_hcd_omap_driver
+-#endif
+-
+ #ifdef CONFIG_PPC_PS3
+ #include "ehci-ps3.c"
+ #define PS3_SYSTEM_BUS_DRIVER ps3_ehci_driver
+@@ -1346,6 +1341,7 @@ MODULE_LICENSE ("GPL");
+ !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \
+ !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \
+ !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
++ !IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \
+ !defined(PLATFORM_DRIVER) && \
+ !defined(PS3_SYSTEM_BUS_DRIVER) && \
+ !defined(OF_PLATFORM_DRIVER) && \
+diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
+index 0555ee4..fa66757 100644
+--- a/drivers/usb/host/ehci-omap.c
++++ b/drivers/usb/host/ehci-omap.c
+@@ -36,6 +36,9 @@
+ * - convert to use hwmod and runtime PM
+ */
+
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/io.h>
+ #include <linux/platform_device.h>
+ #include <linux/slab.h>
+ #include <linux/usb/ulpi.h>
+@@ -43,6 +46,10 @@
+ #include <linux/pm_runtime.h>
+ #include <linux/gpio.h>
+ #include <linux/clk.h>
++#include <linux/usb.h>
++#include <linux/usb/hcd.h>
++
++#include "ehci.h"
+
+ #include <linux/platform_data/usb-omap.h>
+
+@@ -57,9 +64,11 @@
+ #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8
+ #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0
+
+-/*-------------------------------------------------------------------------*/
++#define DRIVER_DESC "OMAP-EHCI Host Controller driver"
+
+-static const struct hc_driver ehci_omap_hc_driver;
++static const char hcd_name[] = "ehci-omap";
++
++/*-------------------------------------------------------------------------*/
+
+
+ static inline void ehci_write(void __iomem *base, u32 reg, u32 val)
+@@ -166,6 +175,12 @@ static void disable_put_regulator(
+ /* configure so an HC device and id are always provided */
+ /* always called with process context; sleeping is OK */
+
++static struct hc_driver __read_mostly ehci_omap_hc_driver;
++
++static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {
++ .reset = omap_ehci_init,
++};
++
+ /**
+ * ehci_hcd_omap_probe - initialize TI-based HCDs
+ *
+@@ -315,56 +330,33 @@ static struct platform_driver ehci_hcd_omap_driver = {
+ /*.suspend = ehci_hcd_omap_suspend, */
+ /*.resume = ehci_hcd_omap_resume, */
+ .driver = {
+- .name = "ehci-omap",
++ .name = hcd_name,
+ }
+ };
+
+ /*-------------------------------------------------------------------------*/
+
+-static const struct hc_driver ehci_omap_hc_driver = {
+- .description = hcd_name,
+- .product_desc = "OMAP-EHCI Host Controller",
+- .hcd_priv_size = sizeof(struct ehci_hcd),
+-
+- /*
+- * generic hardware linkage
+- */
+- .irq = ehci_irq,
+- .flags = HCD_MEMORY | HCD_USB2,
+-
+- /*
+- * basic lifecycle operations
+- */
+- .reset = omap_ehci_init,
+- .start = ehci_run,
+- .stop = ehci_stop,
+- .shutdown = ehci_shutdown,
+-
+- /*
+- * managing i/o requests and associated device resources
+- */
+- .urb_enqueue = ehci_urb_enqueue,
+- .urb_dequeue = ehci_urb_dequeue,
+- .endpoint_disable = ehci_endpoint_disable,
+- .endpoint_reset = ehci_endpoint_reset,
++static int __init ehci_omap_init(void)
++{
++ if (usb_disabled())
++ return -ENODEV;
+
+- /*
+- * scheduling support
+- */
+- .get_frame_number = ehci_get_frame,
++ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+
+- /*
+- * root hub support
+- */
+- .hub_status_data = ehci_hub_status_data,
+- .hub_control = ehci_hub_control,
+- .bus_suspend = ehci_bus_suspend,
+- .bus_resume = ehci_bus_resume,
++ ehci_init_driver(&ehci_omap_hc_driver, &ehci_omap_overrides);
++ return platform_driver_register(&ehci_hcd_omap_driver);
++}
++module_init(ehci_omap_init);
+
+- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
+-};
++static void __exit ehci_omap_cleanup(void)
++{
++ platform_driver_unregister(&ehci_hcd_omap_driver);
++}
++module_exit(ehci_omap_cleanup);
+
+ MODULE_ALIAS("platform:ehci-omap");
+ MODULE_AUTHOR("Texas Instruments, Inc.");
+ MODULE_AUTHOR("Felipe Balbi <felipe.balbi@nokia.com>");
+
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL");
+--
+cgit v0.9.1
diff --git a/freed-ora/current/master/arm-tegra-fixclk.patch b/freed-ora/current/master/arm-tegra-fixclk.patch
new file mode 100644
index 000000000..df0991293
--- /dev/null
+++ b/freed-ora/current/master/arm-tegra-fixclk.patch
@@ -0,0 +1,28 @@
+diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c
+index 788486e..2f4d0e3 100644
+--- a/drivers/clk/tegra/clk-periph.c
++++ b/drivers/clk/tegra/clk-periph.c
+@@ -18,6 +18,7 @@
+ #include <linux/clk-provider.h>
+ #include <linux/slab.h>
+ #include <linux/err.h>
++#include <linux/export.h>
+
+ #include "clk.h"
+
+@@ -128,6 +129,7 @@ void tegra_periph_reset_deassert(struct clk *c)
+
+ tegra_periph_reset(gate, 0);
+ }
++EXPORT_SYMBOL_GPL(tegra_periph_reset_deassert);
+
+ void tegra_periph_reset_assert(struct clk *c)
+ {
+@@ -147,6 +149,7 @@ void tegra_periph_reset_assert(struct clk *c)
+
+ tegra_periph_reset(gate, 1);
+ }
++EXPORT_SYMBOL_GPL(tegra_periph_reset_assert);
+
+ const struct clk_ops tegra_clk_periph_ops = {
+ .get_parent = clk_periph_get_parent,
diff --git a/freed-ora/current/master/arm-tegra-nvec-kconfig.patch b/freed-ora/current/master/arm-tegra-nvec-kconfig.patch
deleted file mode 100644
index 64aa9f8e3..000000000
--- a/freed-ora/current/master/arm-tegra-nvec-kconfig.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- linux-3.8.0-0.rc2.git1.1.fc19.x86_64/drivers/staging/nvec/Kconfig.orig 2013-01-07 11:04:43.493510550 +0000
-+++ linux-3.8.0-0.rc2.git1.1.fc19.x86_64/drivers/staging/nvec/Kconfig 2013-01-07 11:14:18.186033211 +0000
-@@ -1,6 +1,6 @@
- config MFD_NVEC
- bool "NV Tegra Embedded Controller SMBus Interface"
-- depends on I2C && GPIOLIB && ARCH_TEGRA
-+ depends on I2C && GPIOLIB && ARCH_TEGRA && MFD_CORE
- select MFD_CORE
- help
- Say Y here to enable support for a nVidia compliant embedded
diff --git a/freed-ora/current/master/blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch b/freed-ora/current/master/blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch
new file mode 100644
index 000000000..615d7555b
--- /dev/null
+++ b/freed-ora/current/master/blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch
@@ -0,0 +1,79 @@
+From e5072664f8237cf53b0bd68a51aa1a7bc69061c5 Mon Sep 17 00:00:00 2001
+From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
+Date: Tue, 09 Apr 2013 13:01:21 +0000
+Subject: blkcg: fix "scheduling while atomic" in blk_queue_bypass_start
+
+Since 749fefe677 in v3.7 ("block: lift the initial queue bypass mode
+on blk_register_queue() instead of blk_init_allocated_queue()"),
+the following warning appears when multipath is used with CONFIG_PREEMPT=y.
+
+This patch moves blk_queue_bypass_start() before radix_tree_preload()
+to avoid the sleeping call while preemption is disabled.
+
+ BUG: scheduling while atomic: multipath/2460/0x00000002
+ 1 lock held by multipath/2460:
+ #0: (&md->type_lock){......}, at: [<ffffffffa019fb05>] dm_lock_md_type+0x17/0x19 [dm_mod]
+ Modules linked in: ...
+ Pid: 2460, comm: multipath Tainted: G W 3.7.0-rc2 #1
+ Call Trace:
+ [<ffffffff810723ae>] __schedule_bug+0x6a/0x78
+ [<ffffffff81428ba2>] __schedule+0xb4/0x5e0
+ [<ffffffff814291e6>] schedule+0x64/0x66
+ [<ffffffff8142773a>] schedule_timeout+0x39/0xf8
+ [<ffffffff8108ad5f>] ? put_lock_stats+0xe/0x29
+ [<ffffffff8108ae30>] ? lock_release_holdtime+0xb6/0xbb
+ [<ffffffff814289e3>] wait_for_common+0x9d/0xee
+ [<ffffffff8107526c>] ? try_to_wake_up+0x206/0x206
+ [<ffffffff810c0eb8>] ? kfree_call_rcu+0x1c/0x1c
+ [<ffffffff81428aec>] wait_for_completion+0x1d/0x1f
+ [<ffffffff810611f9>] wait_rcu_gp+0x5d/0x7a
+ [<ffffffff81061216>] ? wait_rcu_gp+0x7a/0x7a
+ [<ffffffff8106fb18>] ? complete+0x21/0x53
+ [<ffffffff810c0556>] synchronize_rcu+0x1e/0x20
+ [<ffffffff811dd903>] blk_queue_bypass_start+0x5d/0x62
+ [<ffffffff811ee109>] blkcg_activate_policy+0x73/0x270
+ [<ffffffff81130521>] ? kmem_cache_alloc_node_trace+0xc7/0x108
+ [<ffffffff811f04b3>] cfq_init_queue+0x80/0x28e
+ [<ffffffffa01a1600>] ? dm_blk_ioctl+0xa7/0xa7 [dm_mod]
+ [<ffffffff811d8c41>] elevator_init+0xe1/0x115
+ [<ffffffff811e229f>] ? blk_queue_make_request+0x54/0x59
+ [<ffffffff811dd743>] blk_init_allocated_queue+0x8c/0x9e
+ [<ffffffffa019ffcd>] dm_setup_md_queue+0x36/0xaa [dm_mod]
+ [<ffffffffa01a60e6>] table_load+0x1bd/0x2c8 [dm_mod]
+ [<ffffffffa01a7026>] ctl_ioctl+0x1d6/0x236 [dm_mod]
+ [<ffffffffa01a5f29>] ? table_clear+0xaa/0xaa [dm_mod]
+ [<ffffffffa01a7099>] dm_ctl_ioctl+0x13/0x17 [dm_mod]
+ [<ffffffff811479fc>] do_vfs_ioctl+0x3fb/0x441
+ [<ffffffff811b643c>] ? file_has_perm+0x8a/0x99
+ [<ffffffff81147aa0>] sys_ioctl+0x5e/0x82
+ [<ffffffff812010be>] ? trace_hardirqs_on_thunk+0x3a/0x3f
+ [<ffffffff814310d9>] system_call_fastpath+0x16/0x1b
+
+Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
+Acked-by: Vivek Goyal <vgoyal@redhat.com>
+Acked-by: Tejun Heo <tj@kernel.org>
+Cc: Alasdair G Kergon <agk@redhat.com>
+Cc: stable@kernel.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+---
+(limited to 'block/blk-cgroup.c')
+
+diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
+index b2b9837..e8918ff 100644
+--- a/block/blk-cgroup.c
++++ b/block/blk-cgroup.c
+@@ -972,10 +972,10 @@ int blkcg_activate_policy(struct request_queue *q,
+ if (!new_blkg)
+ return -ENOMEM;
+
+- preloaded = !radix_tree_preload(GFP_KERNEL);
+-
+ blk_queue_bypass_start(q);
+
++ preloaded = !radix_tree_preload(GFP_KERNEL);
++
+ /*
+ * Make sure the root blkg exists and count the existing blkgs. As
+ * @q is bypassing at this point, blkg_lookup_create() can't be
+--
+cgit v0.9.1
diff --git a/freed-ora/current/master/cfg80211-mac80211-disconnect-on-suspend.patch b/freed-ora/current/master/cfg80211-mac80211-disconnect-on-suspend.patch
new file mode 100644
index 000000000..b3180fb54
--- /dev/null
+++ b/freed-ora/current/master/cfg80211-mac80211-disconnect-on-suspend.patch
@@ -0,0 +1,219 @@
+From 8125696991194aacb1173b6e8196d19098b44e17 Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+Date: Thu, 28 Feb 2013 09:55:25 +0000
+Subject: cfg80211/mac80211: disconnect on suspend
+
+If possible that after suspend, cfg80211 will receive request to
+disconnect what require action on interface that was removed during
+suspend.
+
+Problem can manifest itself by various warnings similar to below one:
+
+WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]()
+wlan0: Failed check-sdata-in-driver check, flags: 0x4
+Call Trace:
+ [<c043e0b3>] warn_slowpath_fmt+0x33/0x40
+ [<f83707c9>] ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]
+ [<f83a660a>] ieee80211_recalc_ps_vif+0x2a/0x30 [mac80211]
+ [<f83a6706>] ieee80211_set_disassoc+0xf6/0x500 [mac80211]
+ [<f83a9441>] ieee80211_mgd_deauth+0x1f1/0x280 [mac80211]
+ [<f8381b36>] ieee80211_deauth+0x16/0x20 [mac80211]
+ [<f8261e70>] cfg80211_mlme_down+0x70/0xc0 [cfg80211]
+ [<f8264de1>] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211]
+
+To fix the problem disconnect from any associated network before
+suspend. User space is responsible to establish connection again
+after resume. This basically need to be done by user space anyway,
+because associated stations can go away during suspend (for example
+NetworkManager disconnects on suspend and connect on resume by default).
+
+Patch also handle situation when driver refuse to suspend with wowlan
+configured and try to suspend again without it.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
+index d0275f3..4d105c7 100644
+--- a/net/mac80211/pm.c
++++ b/net/mac80211/pm.c
+@@ -93,7 +93,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
+ return err;
+ } else if (err > 0) {
+ WARN_ON(err != 1);
+- local->wowlan = false;
++ return err;
+ } else {
+ list_for_each_entry(sdata, &local->interfaces, list)
+ if (ieee80211_sdata_running(sdata))
+diff --git a/net/wireless/core.c b/net/wireless/core.c
+index ea4155f..f382cae 100644
+--- a/net/wireless/core.c
++++ b/net/wireless/core.c
+@@ -814,6 +814,46 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
+ rdev->num_running_monitor_ifaces += num;
+ }
+
++void cfg80211_leave(struct cfg80211_registered_device *rdev,
++ struct wireless_dev *wdev)
++{
++ struct net_device *dev = wdev->netdev;
++
++ switch (wdev->iftype) {
++ case NL80211_IFTYPE_ADHOC:
++ cfg80211_leave_ibss(rdev, dev, true);
++ break;
++ case NL80211_IFTYPE_P2P_CLIENT:
++ case NL80211_IFTYPE_STATION:
++ mutex_lock(&rdev->sched_scan_mtx);
++ __cfg80211_stop_sched_scan(rdev, false);
++ mutex_unlock(&rdev->sched_scan_mtx);
++
++ wdev_lock(wdev);
++#ifdef CONFIG_CFG80211_WEXT
++ kfree(wdev->wext.ie);
++ wdev->wext.ie = NULL;
++ wdev->wext.ie_len = 0;
++ wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
++#endif
++ __cfg80211_disconnect(rdev, dev,
++ WLAN_REASON_DEAUTH_LEAVING, true);
++ cfg80211_mlme_down(rdev, dev);
++ wdev_unlock(wdev);
++ break;
++ case NL80211_IFTYPE_MESH_POINT:
++ cfg80211_leave_mesh(rdev, dev);
++ break;
++ case NL80211_IFTYPE_AP:
++ cfg80211_stop_ap(rdev, dev);
++ break;
++ default:
++ break;
++ }
++
++ wdev->beacon_interval = 0;
++}
++
+ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
+ unsigned long state,
+ void *ndev)
+@@ -882,38 +922,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
+ dev->priv_flags |= IFF_DONT_BRIDGE;
+ break;
+ case NETDEV_GOING_DOWN:
+- switch (wdev->iftype) {
+- case NL80211_IFTYPE_ADHOC:
+- cfg80211_leave_ibss(rdev, dev, true);
+- break;
+- case NL80211_IFTYPE_P2P_CLIENT:
+- case NL80211_IFTYPE_STATION:
+- mutex_lock(&rdev->sched_scan_mtx);
+- __cfg80211_stop_sched_scan(rdev, false);
+- mutex_unlock(&rdev->sched_scan_mtx);
+-
+- wdev_lock(wdev);
+-#ifdef CONFIG_CFG80211_WEXT
+- kfree(wdev->wext.ie);
+- wdev->wext.ie = NULL;
+- wdev->wext.ie_len = 0;
+- wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
+-#endif
+- __cfg80211_disconnect(rdev, dev,
+- WLAN_REASON_DEAUTH_LEAVING, true);
+- cfg80211_mlme_down(rdev, dev);
+- wdev_unlock(wdev);
+- break;
+- case NL80211_IFTYPE_MESH_POINT:
+- cfg80211_leave_mesh(rdev, dev);
+- break;
+- case NL80211_IFTYPE_AP:
+- cfg80211_stop_ap(rdev, dev);
+- break;
+- default:
+- break;
+- }
+- wdev->beacon_interval = 0;
++ cfg80211_leave(rdev, wdev);
+ break;
+ case NETDEV_DOWN:
+ cfg80211_update_iface_num(rdev, wdev->iftype, -1);
+diff --git a/net/wireless/core.h b/net/wireless/core.h
+index 9a2be8d..d5d06fd 100644
+--- a/net/wireless/core.h
++++ b/net/wireless/core.h
+@@ -503,6 +503,9 @@ int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
+ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
+ enum nl80211_iftype iftype, int num);
+
++void cfg80211_leave(struct cfg80211_registered_device *rdev,
++ struct wireless_dev *wdev);
++
+ void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev);
+
+diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
+index 8c8b26f..d77e1c1 100644
+--- a/net/wireless/rdev-ops.h
++++ b/net/wireless/rdev-ops.h
+@@ -6,11 +6,12 @@
+ #include "core.h"
+ #include "trace.h"
+
+-static inline int rdev_suspend(struct cfg80211_registered_device *rdev)
++static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
++ struct cfg80211_wowlan *wowlan)
+ {
+ int ret;
+- trace_rdev_suspend(&rdev->wiphy, rdev->wowlan);
+- ret = rdev->ops->suspend(&rdev->wiphy, rdev->wowlan);
++ trace_rdev_suspend(&rdev->wiphy, wowlan);
++ ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
+ trace_rdev_return_int(&rdev->wiphy, ret);
+ return ret;
+ }
+diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c
+index 238ee49..8f28b9f 100644
+--- a/net/wireless/sysfs.c
++++ b/net/wireless/sysfs.c
+@@ -83,6 +83,14 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env)
+ return 0;
+ }
+
++static void cfg80211_leave_all(struct cfg80211_registered_device *rdev)
++{
++ struct wireless_dev *wdev;
++
++ list_for_each_entry(wdev, &rdev->wdev_list, list)
++ cfg80211_leave(rdev, wdev);
++}
++
+ static int wiphy_suspend(struct device *dev, pm_message_t state)
+ {
+ struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
+@@ -90,12 +98,19 @@ static int wiphy_suspend(struct device *dev, pm_message_t state)
+
+ rdev->suspend_at = get_seconds();
+
+- if (rdev->ops->suspend) {
+- rtnl_lock();
+- if (rdev->wiphy.registered)
+- ret = rdev_suspend(rdev);
+- rtnl_unlock();
++ rtnl_lock();
++ if (rdev->wiphy.registered) {
++ if (!rdev->wowlan)
++ cfg80211_leave_all(rdev);
++ if (rdev->ops->suspend)
++ ret = rdev_suspend(rdev, rdev->wowlan);
++ if (ret == 1) {
++ /* Driver refuse to configure wowlan */
++ cfg80211_leave_all(rdev);
++ ret = rdev_suspend(rdev, NULL);
++ }
+ }
++ rtnl_unlock();
+
+ return ret;
+ }
+--
+cgit v0.9.1
diff --git a/freed-ora/current/master/config-arm-generic b/freed-ora/current/master/config-arm-generic
deleted file mode 100644
index f1306225b..000000000
--- a/freed-ora/current/master/config-arm-generic
+++ /dev/null
@@ -1,403 +0,0 @@
-# Generic ARM config. This is common config options that should be
-# enabled on all ARM kernels and hence should be added here
-#
-# FIXME - we need to add debug/nodebug generic build options
-# CONFIG_DEBUG_PER_CPU_MAPS is not set
-
-# Generic ARM processor options
-CONFIG_ARM=y
-
-CONFIG_ARM_THUMB=y
-CONFIG_AEABI=y
-CONFIG_VFP=y
-CONFIG_ARM_UNWIND=y
-# CONFIG_ARCH_MULTI_V7 is not set
-# CONFIG_OABI_COMPAT is not set
-
-CONFIG_SMP=y
-CONFIG_NR_CPUS=4
-CONFIG_SMP_ON_UP=y
-
-CONFIG_ARM_ARCH_TIMER=y
-
-CONFIG_CMDLINE=""
-
-# CONFIG_ARM_LPAE is not set
-# CONFIG_FPE_NWFPE is not set
-CONFIG_FPE_FASTFPE=y
-CONFIG_HIGHPTE=y
-CONFIG_HW_PERF_EVENTS=y
-CONFIG_UACCESS_WITH_MEMCPY=y
-# CONFIG_GENERIC_CPUFREQ_CPU0 is not set
-
-# Generic ARM Errata
-CONFIG_ARM_ERRATA_720789=y
-CONFIG_ARM_ERRATA_751472=y
-CONFIG_ARM_ERRATA_742230=y
-CONFIG_ARM_ERRATA_742231=y
-CONFIG_ARM_ERRATA_754327=y
-CONFIG_ARM_ERRATA_764369=y
-CONFIG_ARM_ERRATA_775420=y
-
-# Generic ARM config options
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_LOCAL_TIMERS=y
-
-CONFIG_ATAGS=y
-CONFIG_ATAGS_PROC=y
-
-CONFIG_PL330_DMA=y
-CONFIG_AMBA_PL08X=y
-CONFIG_PL330_DMA=y
-# CONFIG_XIP_KERNEL is not set
-# CONFIG_PID_IN_CONTEXTIDR is not set
-
-# Generic options we want for ARM that aren't defualt
-CONFIG_HIGHMEM=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-
-CONFIG_SCHED_MC=y
-CONFIG_SCHED_SMT=y
-
-CONFIG_RCU_FANOUT=32
-
-CONFIG_CPU_IDLE=y
-# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set
-# CONFIG_CPU_IDLE_GOV_LADDER is not set
-CONFIG_CPU_IDLE_GOV_MENU=y
-
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-
-CONFIG_PM=y
-CONFIG_PM_STD_PARTITION=""
-CONFIG_SUSPEND=y
-CONFIG_ARM_CPU_SUSPEND=y
-CONFIG_ARM_CPU_TOPOLOGY=y
-
-CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
-CONFIG_LSM_MMAP_MIN_ADDR=32768
-
-# CONFIG_XEN is not set
-
-CONFIG_PINCTRL=y
-CONFIG_PINCONF=y
-
-CONFIG_COMMON_CLK=y
-
-CONFIG_THERMAL=y
-
-CONFIG_ETHERNET=y
-
-CONFIG_PERF_EVENTS=y
-CONFIG_PERF_COUNTERS=y
-
-CONFIG_CC_STACKPROTECTOR=y
-
-CONFIG_SECCOMP=y
-CONFIG_STRICT_DEVMEM=y
-
-CONFIG_SPARSE_IRQ=y
-
-# Generic HW for all ARM platforms
-CONFIG_LEDS_GPIO=m
-
-CONFIG_LBDAF=y
-
-CONFIG_GPIOLIB=y
-CONFIG_RFKILL_GPIO=m
-CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
-CONFIG_GPIO_GENERIC_PLATFORM=m
-CONFIG_PINCTRL_SINGLE=m
-CONFIG_POWER_RESET_GPIO=y
-
-CONFIG_USB_ULPI=y
-
-CONFIG_SND_ARM=y
-CONFIG_SND_ARMAACI=m
-CONFIG_SND_SOC=m
-CONFIG_SND_DESIGNWARE_I2S=m
-CONFIG_SND_SIMPLE_CARD=m
-# CONFIG_SND_SOC_CACHE_LZO is not set
-CONFIG_SND_SOC_ALL_CODECS=m
-
-CONFIG_AX88796=m
-CONFIG_AX88796_93CX6=y
-CONFIG_SMC91X=m
-CONFIG_DM9000=m
-CONFIG_DM9000_DEBUGLEVEL=4
-# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set
-CONFIG_SMC911X=m
-CONFIG_SMSC911X=m
-
-CONFIG_SERIO_AMBAKMI=m
-CONFIG_I2C_NOMADIK=m
-CONFIG_ARM_SP805_WATCHDOG=m
-CONFIG_FB_ARMCLCD=m
-CONFIG_FB_SSD1307=m
-CONFIG_MPCORE_WATCHDOG=m
-CONFIG_BACKLIGHT_PWM=m
-
-CONFIG_MMC_ARMMMCI=m
-CONFIG_MMC_SDHCI_PLTFM=m
-CONFIG_MMC_SDHCI_OF=m
-CONFIG_MMC_SPI=m
-CONFIG_MMC_DW=m
-CONFIG_MMC_DW_PLTFM=m
-CONFIG_MMC_DW_PCI=m
-# CONFIG_MMC_DW_EXYNOS is not set
-# CONFIG_MMC_DW_IDMAC is not set
-CONFIG_MMC_SDHCI_PXAV3=m
-CONFIG_MMC_SDHCI_PXAV2=m
-
-# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set
-
-# Generic GPIO options
-CONFIG_GENERIC_GPIO=y
-
-CONFIG_MTD=m
-CONFIG_MTD_TESTS=m
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_OF_PARTS=y
-CONFIG_MTD_PHYSMAP_OF=y
-# CONFIG_MTD_AFS_PARTS is not set
-CONFIG_MTD_CHAR=m
-CONFIG_MTD_BLKDEVS=m
-CONFIG_MTD_BLOCK=m
-# CONFIG_MTD_TESTS is not set
-# CONFIG_MTD_BLOCK_RO is not set
-# CONFIG_MTD_AR7_PARTS is not set
-CONFIG_MTD_CFI=m
-CONFIG_MTD_CFI_AMDSTD=m
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_NOSWAP=y
-CONFIG_MTD_CFI_GEOMETRY=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_DOC2000=m
-CONFIG_MTD_DOC2001=m
-CONFIG_MTD_DOC2001PLUS=m
-# CONFIG_MTD_DOCPROBE_ADVANCED is not set
-CONFIG_MTD_ALAUDA=m
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_JEDECPROBE=m
-CONFIG_MTD_GEN_PROBE=y
-CONFIG_MTD_IMPA7=m
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-CONFIG_MTD_PHYSMAP=m
-# CONFIG_MTD_PHYSMAP_COMPAT is not set
-CONFIG_MTD_M25P80=m
-CONFIG_M25PXX_USE_FAST_READ=y
-CONFIG_MTD_NAND=m
-CONFIG_MTD_NAND_ECC=m
-CONFIG_MTD_NAND_IDS=m
-# CONFIG_MTD_NAND_CAFE is not set
-# CONFIG_MTD_NAND_ECC_SMC is not set
-# CONFIG_MTD_NAND_DENALI is not set
-# CONFIG_MTD_NAND_DOCG4 is not set
-CONFIG_MTD_NAND_GPIO=m
-# CONFIG_MTD_INTEL_VR_NOR is not set
-# CONFIG_MTD_NAND_NANDSIM is not set
-CONFIG_MTD_NAND_ORION=m
-# CONFIG_MTD_NAND_RICOH is not set
-# CONFIG_MTD_NAND_PLATFORM is not set
-# CONFIG_MTD_OTP is not set
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_SLRAM is not set
-CONFIG_MTD_UBI=m
-CONFIG_MTD_UBI_WL_THRESHOLD=4096
-CONFIG_MTD_UBI_BEB_RESERVE=1
-# CONFIG_MTD_UBI_GLUEBI is not set
-# CONFIG_MTD_UBI_DEBUG is not set
-CONFIG_MG_DISK=m
-CONFIG_MG_DISK_RES=0
-
-# CONFIG_SM_FTL is not set
-
-CONFIG_JFFS2_FS=m
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
-# CONFIG_JFFS2_SUMMARY is not set
-# CONFIG_JFFS2_FS_XATTR is not set
-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
-CONFIG_JFFS2_ZLIB=y
-# CONFIG_JFFS2_LZO is not set
-CONFIG_JFFS2_RTIME=y
-# CONFIG_JFFS2_RUBIN is not set
-
-CONFIG_UBIFS_FS=m
-CONFIG_UBIFS_FS_XATTR=y
-CONFIG_UBIFS_FS_ADVANCED_COMPR=y
-CONFIG_UBIFS_FS_LZO=y
-CONFIG_UBIFS_FS_ZLIB=y
-# CONFIG_UBIFS_FS_DEBUG is not set
-
-# HW crypto and rng
-CONFIG_CRYPTO_SHA1_ARM=m
-CONFIG_CRYPTO_AES_ARM=m
-CONFIG_HW_RANDOM_ATMEL=m
-CONFIG_HW_RANDOM_EXYNOS=m
-
-# Device tree
-CONFIG_DTC=y
-CONFIG_OF=y
-CONFIG_USE_OF=y
-CONFIG_OF_DEVICE=y
-CONFIG_OF_IRQ=y
-CONFIG_ARM_ATAG_DTB_COMPAT=y
-CONFIG_ARM_APPENDED_DTB=y
-CONFIG_PROC_DEVICETREE=y
-# CONFIG_OF_SELFTEST is not set
-
-CONFIG_SERIAL_OF_PLATFORM=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_I2C_MUX_PINCTRL=m
-CONFIG_OF_MDIO=m
-CONFIG_MDIO_BUS_MUX_GPIO=m
-CONFIG_MDIO_BUS_MUX_MMIOREG=m
-
-CONFIG_BPF_JIT=y
-
-CONFIG_RCU_FANOUT_LEAF=16
-CONFIG_EDAC=y
-CONFIG_EDAC_MM_EDAC=m
-CONFIG_EDAC_LEGACY_SYSFS=y
-
-CONFIG_RTC_DRV_88PM80X=m
-CONFIG_RTC_DRV_PL030=m
-CONFIG_RTC_DRV_PL031=m
-CONFIG_RTC_DRV_SNVS=m
-CONFIG_RFKILL_REGULATOR=m
-CONFIG_INPUT_88PM80X_ONKEY=y
-CONFIG_INPUT_GP2A=m
-CONFIG_INPUT_GPIO_TILT_POLLED=m
-CONFIG_INPUT_PWM_BEEPER=m
-CONFIG_SERIAL_AMBA_PL010=m
-CONFIG_SERIAL_AMBA_PL011=m
-CONFIG_GPIO_PL061=y
-CONFIG_GPIO_MCP23S08=m
-CONFIG_GPIO_ADNP=m
-CONFIG_PL310_ERRATA_753970=y
-
-CONFIG_MFD_CORE=m
-CONFIG_MFD_88PM800=m
-CONFIG_MFD_88PM805=m
-CONFIG_MFD_SYSCON=y
-# CONFIG_MFD_TPS80031 is not set
-# CONFIG_MFD_AS3711 is not set
-# CONFIG_MFD_SMSC is not set
-# CONFIG_MFD_DA9055 is not set
-# CONFIG_MFD_MAX8907 is not set
-
-CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
-CONFIG_REGULATOR_USERSPACE_CONSUMER=m
-# CONFIG_REGULATOR_DUMMY is not set
-CONFIG_REGULATOR_GPIO=m
-CONFIG_REGULATOR_AD5398=m
-CONFIG_REGULATOR_ANATOP=m
-CONFIG_REGULATOR_FAN53555=m
-CONFIG_REGULATOR_ISL6271A=m
-CONFIG_REGULATOR_LP3972=m
-CONFIG_REGULATOR_MAX1586=m
-CONFIG_REGULATOR_MAX8649=m
-CONFIG_REGULATOR_MAX8660=m
-CONFIG_REGULATOR_MAX8952=m
-CONFIG_REGULATOR_MAX8973=m
-CONFIG_REGULATOR_LP3971=m
-CONFIG_REGULATOR_TPS51632=m
-CONFIG_REGULATOR_TPS62360=m
-CONFIG_REGULATOR_TPS65023=m
-CONFIG_REGULATOR_TPS6507X=m
-CONFIG_CHARGER_MANAGER=y
-CONFIG_EXTCON_GPIO=m
-
-# CONFIG_ARM_VIRT_EXT is not set
-# CONFIG_PINCTRL_EXYNOS4 is not set
-# CONFIG_PINCTRL_EXYNOS5440 is not set
-
-# CONFIG_AUTO_ZRELADDR is not set
-# CONFIG_ASYMMETRIC_KEY_TYPE is not set
-
-# CONFIG_VFIO is not set
-
-# CONFIG_XIP_KERNEL is not set
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_APM_EMULATION is not set
-# CONFIG_DEPRECATED_PARAM_STRUCT is not set
-
-# CONFIG_SERIAL_8250_EM is not set
-# CONFIG_GPIO_EM is not set
-# CONFIG_HVC_DCC is not set
-# CONFIG_LEDS_RENESAS_TPU is not set
-# CONFIG_VIRTIO_CONSOLE is not set
-
-# Possibly part of Snowball
-# CONFIG_MFD_T7L66XB is not set
-# CONFIG_MFD_TC6387XB is not set
-
-# CONFIG_IRQ_DOMAIN_DEBUG is not set
-# CONFIG_COMMON_CLK_DEBUG is not set
-# CONFIG_DEBUG_USER is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_ARM_KPROBES_TEST is not set
-# CONFIG_SGI_IOC4 is not set
-# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
-
-# CONFIG_DEBUG_PINCTRL is not set
-
-# HW Disabled because it causes issues on ARM platforms
-
-# disable TPM on arm at least on the trimslices it causes havoc
-# CONFIG_TCG_TPM is not set
-
-# CONFIG_IMA is not set
-
-# ERROR: "__bswapsi2" [drivers/staging/crystalhd/crystalhd.ko] undefined!
-# CONFIG_CRYSTALHD is not set
-
-# these modules all fail with missing __bad_udelay
-# http://www.spinics.net/lists/arm/msg15615.html provides some background
-# CONFIG_SUNGEM is not set
-# CONFIG_FB_SAVAGE is not set
-# CONFIG_FB_RADEON is not set
-# CONFIG_DRM_RADEON is not set
-# CONFIG_ATM_HE is not set
-# CONFIG_SCSI_ACARD is not set
-# CONFIG_SFC is not set
-
-# these all currently fail due to missing symbols __bad_udelay or
-# error: implicit declaration of function ‘iowrite32be’
-# CONFIG_SND_ALI5451 is not set
-# CONFIG_DRM_NOUVEAU is not set
-# CONFIG_MLX4_EN is not set
-
-# drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration]
-# CONFIG_TOUCHSCREEN_EETI is not set
-# CONFIG_TOUCHSCREEN_EGALAX is not set
-# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
-#
-# CONFIG_FB_MX3 is not set
-# CONFIG_MX3_IPU is not set
-# CONFIG_MX3_IPU_IRQS is not set
-
-# CONFIG_NET_VENDOR_CIRRUS is not set
-# CONFIG_CS89x0 is not set
-# CONFIG_DVB_USB_PCTV452E is not set
-# CONFIG_PINCTRL_EXYNOS is not set
diff --git a/freed-ora/current/master/config-arm-kirkwood b/freed-ora/current/master/config-arm-kirkwood
deleted file mode 100644
index f4fea2955..000000000
--- a/freed-ora/current/master/config-arm-kirkwood
+++ /dev/null
@@ -1,74 +0,0 @@
-CONFIG_ARCH_KIRKWOOD=y
-CONFIG_ARCH_KIRKWOOD_DT=y
-# CONFIG_SMP is not set
-# CONFIG_VFP is not set
-
-CONFIG_MACH_D2NET_V2=y
-CONFIG_MACH_DB88F6281_BP=y
-CONFIG_MACH_DOCKSTAR=y
-CONFIG_MACH_DOCKSTAR_DT=y
-CONFIG_MACH_DREAMPLUG_DT=y
-CONFIG_MACH_ESATA_SHEEVAPLUG=y
-CONFIG_MACH_DLINK_KIRKWOOD_DT=y
-CONFIG_MACH_GOFLEXNET_DT=y
-CONFIG_MACH_GURUPLUG=y
-CONFIG_MACH_ICONNECT_DT=y
-CONFIG_MACH_IB62X0_DT=y
-CONFIG_MACH_INETSPACE_V2=y
-CONFIG_MACH_INETSPACE_V2_DT=y
-CONFIG_MACH_IOMEGA_IX2_200_DT=y
-CONFIG_MACH_KM_KIRKWOOD_DT=y
-CONFIG_MACH_LSXL_DT=y
-CONFIG_MACH_MPLCEC4_DT=y
-CONFIG_MACH_MV88F6281GTW_GE=y
-CONFIG_MACH_NETSPACE_LITE_V2_DT=y
-CONFIG_MACH_NETSPACE_MAX_V2=y
-CONFIG_MACH_NETSPACE_MAX_V2_DT=y
-CONFIG_MACH_NETSPACE_MINI_V2_DT=y
-CONFIG_MACH_NETSPACE_V2=y
-CONFIG_MACH_NETSPACE_V2_DT=y
-CONFIG_MACH_NET2BIG_V2=y
-CONFIG_MACH_NET5BIG_V2=y
-CONFIG_MACH_NSA310_DT=y
-CONFIG_MACH_OPENBLOCKS_A6_DT=y
-CONFIG_MACH_OPENRD_BASE=y
-CONFIG_MACH_OPENRD_CLIENT=y
-CONFIG_MACH_OPENRD_ULTIMATE=y
-CONFIG_MACH_RD88F6192_NAS=y
-CONFIG_MACH_RD88F6281=y
-CONFIG_MACH_SHEEVAPLUG=y
-CONFIG_MACH_TOPKICK_DT=y
-CONFIG_MACH_TS219=y
-CONFIG_MACH_TS219_DT=y
-CONFIG_MACH_TS41X=y
-CONFIG_MACH_T5325=y
-
-CONFIG_CACHE_FEROCEON_L2=y
-CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH=y
-CONFIG_MTD_NAND_ORION=m
-CONFIG_MV643XX_ETH=m
-CONFIG_I2C_MV64XXX=m
-CONFIG_GPIO_GENERIC_PLATFORM=y
-CONFIG_GPIO_MCP23S08=m
-CONFIG_ORION_WATCHDOG=m
-CONFIG_SND_KIRKWOOD_SOC=m
-CONFIG_SND_KIRKWOOD_SOC_OPENRD=m
-CONFIG_SND_KIRKWOOD_SOC_T5325=m
-CONFIG_MMC_MVSDIO=m
-CONFIG_LEDS_NS2=m
-CONFIG_LEDS_NETXBIG=m
-CONFIG_RTC_DRV_MV=y
-CONFIG_MV_XOR=y
-CONFIG_CRYPTO_DEV_MV_CESA=m
-# CONFIG_PINCTRL_EXYNOS is not set
-CONFIG_PINCTRL_MVEBU=y
-CONFIG_PINCTRL_KIRKWOOD=y
-
-# CONFIG_CPU_FEROCEON_OLD_ID is not set
-# CONFIG_INPUT_GP2A is not set
-# CONFIG_INPUT_GPIO_TILT_POLLED is not set
-# CONFIG_HIGHPTE is not set
-# CONFIG_EDAC is not set
-
-
-CONFIG_FB_XGI=m
diff --git a/freed-ora/current/master/config-arm-omap b/freed-ora/current/master/config-arm-omap
index a53983357..877f7c16b 100644
--- a/freed-ora/current/master/config-arm-omap
+++ b/freed-ora/current/master/config-arm-omap
@@ -1,51 +1,6 @@
-CONFIG_ARCH_OMAP=y
-CONFIG_ARCH_OMAP_OTG=y
-# CONFIG_ARCH_OMAP1 is not set
-CONFIG_ARCH_OMAP2PLUS=y
-
-#
-# OMAP Feature Selections
-#
-CONFIG_OMAP_SMARTREFLEX=y
-CONFIG_OMAP_SMARTREFLEX_CLASS3=y
-CONFIG_OMAP_RESET_CLOCKS=y
-CONFIG_OMAP_MUX=y
-# CONFIG_OMAP_MUX_DEBUG is not set
-CONFIG_OMAP_MUX_WARNINGS=y
-CONFIG_OMAP_MCBSP=y
-CONFIG_OMAP_MBOX_FWK=m
-CONFIG_OMAP_MBOX_KFIFO_SIZE=256
-CONFIG_OMAP_32K_TIMER=y
-# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set
-CONFIG_OMAP_32K_TIMER_HZ=128
-CONFIG_OMAP_DM_TIMER=y
-# CONFIG_OMAP_PM_NONE is not set
-CONFIG_OMAP_PM_NOOP=y
-CONFIG_OMAP_IOMMU=y
-# CONFIG_OMAP_IOMMU_DEBUG is not set
-CONFIG_OMAP3_EMU=y
-CONFIG_HWSPINLOCK_OMAP=m
-CONFIG_DMA_OMAP=y
-# CONFIG_DMADEVICES_VDEBUG is not set
-
-CONFIG_ARM_OMAP2PLUS_CPUFREQ=y
-
-#
-# TI OMAP2/3/4 Specific Features
-#
-CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
-# CONFIG_ARCH_OMAP2 is not set
-CONFIG_ARCH_OMAP3=y
-CONFIG_ARCH_OMAP4=y
-CONFIG_SOC_OMAP3430=y
-CONFIG_SOC_TI81XX=y
-CONFIG_SOC_AM33XX=y
-CONFIG_SOC_OMAPTI816X=y
-# CONFIG_SOC_OMAP5 is not set
CONFIG_OMAP_PACKAGE_CBB=y
CONFIG_OMAP_PACKAGE_CBL=y
CONFIG_OMAP_PACKAGE_CBS=y
-# CONFIG_OMAP4_ERRATA_I688 is not set
#
# OMAP Board Type
@@ -85,272 +40,40 @@ CONFIG_MACH_TOUCHBOOK=y
# System MMU
-CONFIG_CPU_32v6K=y
-CONFIG_CPU_V7=y
-CONFIG_CPU_32v7=y
-CONFIG_CPU_ABRT_EV7=y
-CONFIG_CPU_PABRT_V7=y
-CONFIG_CPU_CACHE_V7=y
-CONFIG_CPU_CACHE_VIPT=y
-CONFIG_CPU_COPY_V6=y
-CONFIG_CPU_TLB_V7=y
-CONFIG_CPU_HAS_ASID=y
-CONFIG_ARM_THUMBEE=y
CONFIG_SWP_EMULATE=y
# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_OUTER_CACHE=y
-CONFIG_OUTER_CACHE_SYNC=y
-CONFIG_CACHE_L2X0=y
-CONFIG_CACHE_PL310=y
-CONFIG_ARM_DMA_MEM_BUFFERABLE=y
-CONFIG_CPU_HAS_PMU=y
-CONFIG_ARM_ERRATA_430973=y
-# CONFIG_ARM_ERRATA_458693 is not set
-# CONFIG_ARM_ERRATA_460075 is not set
-# CONFIG_ARM_ERRATA_742230 is not set
-# CONFIG_ARM_ERRATA_742231 is not set
-CONFIG_PL310_ERRATA_588369=y
-CONFIG_PL310_ERRATA_769419=y
-CONFIG_ARM_ERRATA_720789=y
-# CONFIG_ARM_ERRATA_743622 is not set
-# CONFIG_ARM_ERRATA_751472 is not set
-# CONFIG_ARM_ERRATA_753970 is not set
-# CONFIG_ARM_ERRATA_754322 is not set
-# CONFIG_ARM_ERRATA_754327 is not set
-# CONFIG_ARM_ERRATA_764369 is not set
-CONFIG_ARM_GIC=y
-CONFIG_HAVE_ARM_SCU=y
-CONFIG_HAVE_ARM_TWD=y
-CONFIG_HOTPLUG_CPU=y
-CONFIG_HZ=128
# CONFIG_THUMB2_KERNEL is not set
-CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
-CONFIG_SPLIT_PTLOCK_CPUS=4
-# CONFIG_KSM is not set
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE=""
-# CONFIG_AUTO_ZRELADDR is not set
-CONFIG_VFPv3=y
-CONFIG_NEON=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_MISC=m
-CONFIG_PM_DEBUG=y
-# CONFIG_PM_ADVANCED_DEBUG is not set
-# CONFIG_PM_VERBOSE is not set
CONFIG_CAN_PM_TRACE=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_ARCH_HAS_OPP=y
CONFIG_PM_OPP=y
-CONFIG_OMAP4_THERMAL=y
-CONFIG_OMAP5_THERMAL=y
-
#
# OMAP Hardware
#
-CONFIG_WL_TI=y
-CONFIG_WLCORE_SDIO=m
-CONFIG_TI_ST=m
-# CONFIG_TI_CPSW is not set
-CONFIG_MTD_NAND_OMAP2=y
-CONFIG_MTD_NAND_OMAP_PREFETCH=y
-CONFIG_MTD_NAND_OMAP_PREFETCH_DMA=y
-CONFIG_WL1251_SPI=m
-CONFIG_WL12XX_SPI=m
-CONFIG_WL12XX_SDIO_TEST=m
-CONFIG_WL18XX=m
-CONFIG_NFC_WILINK=m
-CONFIG_INPUT_TWL4030_PWRBUTTON=m
-CONFIG_INPUT_TWL4030_VIBRA=m
-CONFIG_INPUT_TWL6040_VIBRA=m
-CONFIG_KEYBOARD_OMAP4=m
-CONFIG_KEYBOARD_TWL4030=m
-CONFIG_TOUCHSCREEN_TI_TSCADC=m
-CONFIG_SERIAL_OMAP=y
-CONFIG_SERIAL_OMAP_CONSOLE=y
-CONFIG_OMAP_WATCHDOG=y
-CONFIG_CLK_TWL6040=m
-CONFIG_TWL4030_CORE=y
-CONFIG_TWL4030_MADC=m
-CONFIG_TWL4030_POWER=y
-CONFIG_TWL4030_CODEC=y
-CONFIG_TWL4030_WATCHDOG=m
-CONFIG_GPIO_TWL4030=m
-CONFIG_GPIO_TWL6040=m
-CONFIG_CHARGER_TWL4030=m
-CONFIG_TWL6030_PWM=m
-CONFIG_TWL6040_CORE=y
-CONFIG_SENSORS_TWL4030_MADC=m
-CONFIG_SENSORS_LIS3_I2C=m
-CONFIG_TI_DAVINCI_EMAC=m
-CONFIG_TI_DAVINCI_MDIO=m
-CONFIG_TI_DAVINCI_CPDMA=m
CONFIG_LEDS_PWM=m
CONFIG_LEDS_LP8788=m
CONFIG_MTD_ONENAND_OMAP2=y
-CONFIG_HDQ_MASTER_OMAP=m
-CONFIG_I2C_OMAP=m
-CONFIG_SPI_OMAP24XX=m
-CONFIG_MFD_OMAP_USB_HOST=y
-CONFIG_MFD_WL1273_CORE=m
CONFIG_MFD_LP8788=y
CONFIG_MFD_TPS65910=y
CONFIG_GPIO_TPS65910=y
-CONFIG_REGULATOR_TWL4030=y
CONFIG_REGULATOR_LP8788=y
CONFIG_REGULATOR_TPS65217=y
CONFIG_REGULATOR_TPS65910=y
-# Enable V4L2 drivers for OMAP2+
-CONFIG_MEDIA_CONTROLLER=y
-CONFIG_VIDEO_V4L2_SUBDEV_API=y
-CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_VPFE_CAPTURE=m
-CONFIG_VIDEO_OMAP2_VOUT=m
-CONFIG_VIDEO_DM6446_CCDC=m
-# CONFIG_VIDEO_OMAP3 is not set
-# Also enable vivi driver - useful for testing a full kernelspace V4L2 driver
-CONFIG_V4L_TEST_DRIVERS=y
-CONFIG_VIDEO_VIVI=m
-
-CONFIG_DRM=m
-CONFIG_DRM_OMAP=m
-CONFIG_DRM_OMAP_NUM_CRTCS=2
-# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
-# CONFIG_FB_OMAP_LCD_VGA is not set
-CONFIG_OMAP2_VRAM=y
-CONFIG_OMAP2_VRAM_SIZE=0
-CONFIG_OMAP2_VRFB=y
-# CONFIG_FB_OMAP2 is not set
-
-CONFIG_OMAP2_DSS=m
-CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
-# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
-CONFIG_OMAP2_DSS_DPI=y
-CONFIG_OMAP2_DSS_RFBI=y
-CONFIG_OMAP2_DSS_VENC=y
-CONFIG_OMAP4_DSS_HDMI=y
-CONFIG_OMAP2_DSS_SDI=y
-CONFIG_OMAP2_DSS_DSI=y
-# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
-CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
-CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET=y
-CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y
-
-CONFIG_FB_DA8XX=m
-CONFIG_FB_DA8XX_CONSISTENT_DMA_SIZE=5
CONFIG_LCD_CLASS_DEVICE=m
-CONFIG_PANEL_GENERIC_DPI=m
-CONFIG_PANEL_TFP410=m
-CONFIG_PANEL_TAAL=m
-CONFIG_PANEL_PICODLP=m
-CONFIG_PANEL_SHARP_LS037V7DW01=m
-CONFIG_PANEL_NEC_NL8048HL11_01B=m
-CONFIG_PANEL_TPO_TD043MTEA1=m
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BACKLIGHT_CLASS_DEVICE=m
+CONFIG_BACKLIGHT_LP8788=m
CONFIG_BACKLIGHT_PWM=m
CONFIG_BACKLIGHT_PANDORA=m
-
-CONFIG_SND_OMAP_SOC=y
-CONFIG_SND_OMAP_SOC_DMIC=m
-CONFIG_SND_OMAP_SOC_MCBSP=m
-CONFIG_SND_OMAP_SOC_MCPDM=m
-CONFIG_SND_OMAP_SOC_OVERO=m
-CONFIG_SND_OMAP_SOC_OMAP3EVM=m
-CONFIG_SND_OMAP_SOC_AM3517EVM=m
-CONFIG_SND_OMAP_SOC_SDP3430=m
-CONFIG_SND_OMAP_SOC_SDP4430=m
-CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m
-CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=m
-CONFIG_SND_OMAP_SOC_ZOOM2=m
-CONFIG_SND_OMAP_SOC_IGEP0020=m
-CONFIG_SND_OMAP_SOC_OMAP_HDMI=m
-CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
-CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
-CONFIG_SND_SOC_I2C_AND_SPI=y
-# CONFIG_SND_OMAP_SOC_RX51 is not set
-# CONFIG_SND_SOC_ALL_CODECS is not set
-CONFIG_SND_SOC_TLV320AIC23=m
-CONFIG_SND_SOC_TLV320AIC3X=m
-CONFIG_SND_SOC_TWL4030=m
-CONFIG_SND_SOC_TWL6040=m
-CONFIG_RADIO_WL128X=m
-
-CONFIG_USB_OTG=y
-CONFIG_USB_EHCI_HCD_OMAP=y
-CONFIG_USB_MUSB_OMAP2PLUS=y
-CONFIG_USB_MUSB_HDRC=y
-CONFIG_USB_OHCI_HCD_OMAP3=y
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
-# CONFIG_MUSB_PIO_ONLY is not set
-# CONFIG_USB_MUSB_DEBUG is not set
-#
# CONFIG_USB_GADGET_OMAP is not set
# CONFIG_ISP1301_OMAP is not set
-
-# This block is temporary until we work out why the MMC modules don't work as modules
-CONFIG_MMC=y
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_PLTFM=y
-CONFIG_MMC_SDHCI_OF=y
-CONFIG_MMC_SPI=y
-
-CONFIG_MMC_OMAP=y
-CONFIG_MMC_OMAP_HS=y
-CONFIG_TWL4030_USB=y
-CONFIG_TWL6030_USB=y
-CONFIG_RTC_DRV_OMAP=m
-CONFIG_RTC_DRV_TWL4030=y
-CONFIG_RTC_DRV_TPS65910=m
-
-CONFIG_PWM_TIECAP=m
-CONFIG_PWM_TIEHRPWM=m
-CONFIG_PWM_TWL=m
-CONFIG_PWM_TWL_LED=m
-
-# CONFIG_IR_RX51 is not set
-# CONFIG_BATTERY_RX51 is not set
-
-# CONFIG_TIDSPBRIDGE is not set
-# CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000
-# CONFIG_TIDSPBRIDGE_DEBUG is not set
-# CONFIG_TIDSPBRIDGE_RECOVERY=y
-# CONFIG_TIDSPBRIDGE_CACHE_LINE_CHECK is not set
-# CONFIG_TIDSPBRIDGE_WDT3=y
-# CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5
-# CONFIG_TIDSPBRIDGE_NTFY_PWRERR is not set
-# CONFIG_TIDSPBRIDGE_BACKTRACE is not set
-
-# CONFIG_OMAP_REMOTEPROC is not set
-# CONFIG_OMAP_BANDGAP is not set
-# CONFIG_OMAP_IOVMM is not set
-
-CONFIG_CRYPTO_DEV_OMAP_SHAM=m
-CONFIG_CRYPTO_DEV_OMAP_AES=m
-
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_MTD_NAND_OMAP_BCH is not set
-# CONFIG_MFD_TPS65912_I2C is not set
-# CONFIG_PMIC_DA903X is not set
-# CONFIG_MFD_DA9052_I2C is not set
-# CONFIG_PMIC_ADP5520 is not set
-# CONFIG_MFD_MAX77686 is not set
-# CONFIG_MFD_MAX77693 is not set
-# CONFIG_MFD_MAX8997 is not set
-# CONFIG_MFD_SEC_CORE is not set
-# CONFIG_MFD_TPS65090 is not set
-# CONFIG_MFD_AAT2870_CORE is not set
-# CONFIG_MFD_RC5T583 is not set
-# CONFIG_MFD_PALMAS is not set
-# CONFIG_REGULATOR_LP3972 is not set
-# CONFIG_REGULATOR_LP872X is not set
-
-# CONFIG_OMAP2_DSS_DEBUG is not set
-# CONFIG_OMAP2_DSS_DEBUGFS is not set
diff --git a/freed-ora/current/master/config-armv7 b/freed-ora/current/master/config-armv7
index c3af272a1..4f27e5c06 100644
--- a/freed-ora/current/master/config-armv7
+++ b/freed-ora/current/master/config-armv7
@@ -10,166 +10,32 @@ CONFIG_ARCH_MULTI_V7=y
CONFIG_ARCH_HIGHBANK=y
CONFIG_ARCH_MVEBU=y
# CONFIG_ARCH_MXC is not set
+CONFIG_ARCH_OMAP2PLUS=y
CONFIG_ARCH_PICOXCELL=y
CONFIG_ARCH_SOCFPGA=y
CONFIG_ARCH_SUNXI=y
CONFIG_ARCH_VEXPRESS_CA9X4=y
CONFIG_ARCH_VEXPRESS_DT=y
-# not enabling first round
-# CONFIG_ARCH_ZYNQ is not set
+CONFIG_ARCH_VIRT=y
+# CONFIG_ARCH_WM8850 is not set
+CONFIG_ARCH_ZYNQ=y
-CONFIG_MACH_ARMADA_370_XP=y
-CONFIG_MACH_ARMADA_370=y
-CONFIG_MACH_ARMADA_XP=y
-
-# generic ARM config options
-CONFIG_CMDLINE=""
-CONFIG_ARM_ARCH_TIMER=y
-CONFIG_AEABI=y
-CONFIG_VFP=y
-CONFIG_VFPv3=y
-CONFIG_NEON=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_ARM_UNWIND=y
-CONFIG_ARM_THUMB=y
-CONFIG_ARM_THUMBEE=y
-CONFIG_ARM_GIC=y
-CONFIG_ARM_ASM_UNIFIED=y
-CONFIG_ARM_CPU_TOPOLOGY=y
-CONFIG_ARM_DMA_MEM_BUFFERABLE=y
-CONFIG_SWP_EMULATE=y
-CONFIG_CPU_BPREDICT_DISABLE=y
-CONFIG_CACHE_L2X0=y
-CONFIG_HIGHPTE=y
-# CONFIG_OABI_COMPAT is not set
-# CONFIG_ATAGS is not set
-# CONFIG_ATAGS_PROC is not set
-# CONFIG_FPE_NWFPE is not set
-# CONFIG_FPE_FASTFPE is not set
-# CONFIG_APM_EMULATION is not set
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_DMA_CACHE_RWFO is not set
+# These are supported in the LPAE kernel
# CONFIG_ARM_LPAE is not set
-# CONFIG_THUMB2_KERNEL is not set
# CONFIG_XEN is not set
-# CONFIG_HVC_DCC is not set
# CONFIG_VIRTIO_CONSOLE is not set
-
# CONFIG_ARM_VIRT_EXT is not set
-# errata
-# v5/v6
-# CONFIG_ARM_ERRATA_326103 is not set
-# CONFIG_ARM_ERRATA_411920 is not set
-# Cortex-A8
-# CONFIG_ARM_ERRATA_430973 is not set
-# CONFIG_ARM_ERRATA_458693 is not set
-# CONFIG_ARM_ERRATA_460075 is not set
-# Cortex-A9
-CONFIG_ARM_ERRATA_742230=y
-CONFIG_ARM_ERRATA_742231=y
-CONFIG_ARM_ERRATA_743622=y
-CONFIG_ARM_ERRATA_754322=y
-CONFIG_ARM_ERRATA_754327=y
-CONFIG_ARM_ERRATA_764369=y
-CONFIG_ARM_ERRATA_775420=y
-# Disabled due to causing highbank to crash
-# CONFIG_PL310_ERRATA_588369 is not set
-# CONFIG_PL310_ERRATA_727915 is not set
-CONFIG_PL310_ERRATA_769419=y
-
-# generic that deviates from or should be merged into config-generic
-CONFIG_SMP=y
-CONFIG_NR_CPUS=4
-CONFIG_SMP_ON_UP=y
-CONFIG_HIGHMEM=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-
-CONFIG_SCHED_MC=y
-CONFIG_SCHED_SMT=y
-
-CONFIG_RCU_FANOUT=32
-CONFIG_RCU_FANOUT_LEAF=16
-
-CONFIG_CPU_IDLE=y
-# CONFIG_CPU_IDLE_GOV_LADDER is not set
-CONFIG_CPU_IDLE_GOV_MENU=y
-CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y
-
-CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
-CONFIG_LSM_MMAP_MIN_ADDR=32768
-
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-
-CONFIG_SECCOMP=y
-CONFIG_STRICT_DEVMEM=y
-
-CONFIG_PM=y
-CONFIG_PM_STD_PARTITION=""
-CONFIG_SUSPEND=y
-CONFIG_ARM_CPU_SUSPEND=y
-CONFIG_ARM_CPU_TOPOLOGY=y
-
-CONFIG_LOCAL_TIMERS=y
-CONFIG_HW_PERF_EVENTS=y
-CONFIG_UACCESS_WITH_MEMCPY=y
-CONFIG_CC_STACKPROTECTOR=y
-
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_UTS_NS is not set
-# CONFIG_IPC_NS is not set
-# CONFIG_PID_NS is not set
-# CONFIG_NET_NS is not set
-
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-
-CONFIG_PINCTRL=y
-CONFIG_PINCONF=y
-
-CONFIG_NFS_FS=y
-CONFIG_ROOT_NFS=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_EARLY_PRINTK=y
-
-CONFIG_LBDAF=y
-
-CONFIG_COMMON_CLK=y
-
-# Versatile and highbank
-CONFIG_ARM_TIMER_SP804=y
-
-CONFIG_SERIO_AMBAKMI=m
-CONFIG_SERIAL_AMBA_PL010=y
-CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
-CONFIG_SERIAL_AMBA_PL011=y
-CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-
-CONFIG_RTC_DRV_PL030=y
-CONFIG_RTC_DRV_PL031=y
-
-CONFIG_PL330_DMA=y
-CONFIG_AMBA_PL08X=y
-CONFIG_ARM_SP805_WATCHDOG=m
-
# highbank
-CONFIG_CPU_IDLE_CALXEDA=y
-
+# 2013/04/19 - stability issues
+# CONFIG_CPU_IDLE_CALXEDA is not set
CONFIG_EDAC_HIGHBANK_MC=m
CONFIG_EDAC_HIGHBANK_L2=m
-
-CONFIG_OC_ETM=y
-
CONFIG_SATA_HIGHBANK=m
+CONFIG_ARM_HIGHBANK_CPUFREQ=m
# versatile
+CONFIG_VEXPRESS_CONFIG=y
CONFIG_FB=y
CONFIG_FB_ARMCLCD=m
CONFIG_FB_CFB_COPYAREA=m
@@ -177,17 +43,16 @@ CONFIG_FB_CFB_FILLRECT=m
CONFIG_FB_CFB_IMAGEBLIT=m
CONFIG_TOUCHSCREEN_ADS7846=m
-CONFIG_I2C_VERSATILE=m
CONFIG_OC_ETM=y
CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA=y
-CONFIG_SENSORS_VEXPRESS=m
-
-# unknown and needs review
-CONFIG_ARM_AMBA=y
# mvebu
+CONFIG_MACH_ARMADA_370_XP=y
+CONFIG_MACH_ARMADA_370=y
+CONFIG_MACH_ARMADA_XP=y
+
+CONFIG_CACHE_TAUROS2=y
CONFIG_MV_XOR=y
-CONFIG_RTC_DRV_88PM80X=m
CONFIG_CRYPTO_DEV_MV_CESA=m
CONFIG_MV643XX_ETH=m
CONFIG_I2C_MV64XXX=m
@@ -196,13 +61,279 @@ CONFIG_PINCTRL_ARMADA_370=y
CONFIG_PINCTRL_ARMADA_XP=y
CONFIG_PINCTRL_DOVE=y
CONFIG_EDAC_MV64X60=m
+CONFIG_RTC_DRV_S35390A=m
+CONFIG_RTC_DRV_88PM80X=m
+CONFIG_RTC_DRV_MV=m
CONFIG_MVNETA=m
-CONFIG_SATA_MV=m
-CONFIG_MARVELL_PHY=m
-CONFIG_RTC_DRV_S35390A=y
-CONFIG_USB_EHCI_MV=m
+CONFIG_GPIO_MVEBU=y
+CONFIG_MVEBU_CLK_CORE=y
+CONFIG_MVEBU_CLK_GATING=y
+CONFIG_MMC_MVSDIO=m
+CONFIG_SPI_ORION=m
+CONFIG_USB_MV_UDC=m
+
+# omap
+CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+CONFIG_ARCH_OMAP4=y
+# CONFIG_SOC_OMAP5 is not set
+# CONFIG_SOC_OMAP2420 is not set
+# CONFIG_SOC_OMAP2430 is not set
+CONFIG_SOC_OMAP3430=y
+CONFIG_SOC_TI81XX=y
+CONFIG_SOC_AM33XX=y
+CONFIG_MACH_OMAP_GENERIC=y
+CONFIG_MACH_OMAP3_BEAGLE=y
+CONFIG_MACH_DEVKIT8000=y
+CONFIG_MACH_OMAP_LDP=y
+CONFIG_MACH_OMAP3530_LV_SOM=y
+CONFIG_MACH_OMAP3_TORPEDO=y
+CONFIG_MACH_OVERO=y
+CONFIG_MACH_OMAP3EVM=y
+CONFIG_MACH_OMAP3517EVM=y
+CONFIG_MACH_CRANEBOARD=y
+CONFIG_MACH_OMAP3_PANDORA=y
+CONFIG_MACH_TOUCHBOOK=y
+CONFIG_MACH_OMAP_3430SDP=y
+# CONFIG_MACH_NOKIA_N8X0 is not set
+# CONFIG_MACH_NOKIA_RM680 is not set
+# CONFIG_MACH_NOKIA_RX51 is not set
+CONFIG_MACH_OMAP_ZOOM2=y
+CONFIG_MACH_OMAP_ZOOM3=y
+CONFIG_MACH_CM_T35=y
+CONFIG_MACH_CM_T3517=y
+CONFIG_MACH_IGEP0030=y
+CONFIG_MACH_SBC3530=y
+CONFIG_MACH_OMAP_3630SDP=y
+CONFIG_MACH_TI8168EVM=y
+CONFIG_MACH_TI8148EVM=y
+CONFIG_MACH_OMAP_4430SDP=y
+CONFIG_MACH_OMAP4_PANDA=y
+
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_MUX=y
+CONFIG_OMAP_MUX_WARNINGS=y
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set
+
+CONFIG_OMAP_MCBSP=y
+CONFIG_OMAP_MBOX_FWK=m
+CONFIG_OMAP_MBOX_KFIFO_SIZE=256
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_PM_NOOP=y
+CONFIG_OMAP_IOMMU=y
+CONFIG_OMAP_IOVMM=m
+CONFIG_OMAP3_EMU=y
+# CONFIG_OMAP3_SDRC_AC_TIMING is not set
+CONFIG_ARM_OMAP2PLUS_CPUFREQ=y
+
+CONFIG_TI_ST=m
+CONFIG_TI_DAC7512=m
+CONFIG_TI_DAVINCI_EMAC=m
+CONFIG_TI_DAVINCI_MDIO=m
+CONFIG_TI_DAVINCI_CPDMA=m
+CONFIG_TI_CPSW=m
+CONFIG_TI_CPTS=y
+CONFIG_TI_EMIF=m
+
+CONFIG_SERIAL_OMAP=y
+CONFIG_SERIAL_OMAP_CONSOLE=y
+
+CONFIG_GPIO_TWL4030=m
+CONFIG_GPIO_TWL6040=m
+CONFIG_I2C_OMAP=m
+CONFIG_CHARGER_TWL4030=m
+CONFIG_OMAP_WATCHDOG=m
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_POWER=y
+CONFIG_TWL4030_CODEC=y
+CONFIG_TWL4030_WATCHDOG=m
+CONFIG_TWL4030_USB=m
+CONFIG_TWL6030_USB=m
+CONFIG_TWL6030_PWM=m
+CONFIG_TWL6040_CORE=y
+CONFIG_CLK_TWL6040=m
+CONFIG_OMAP_INTERCONNECT=m
+# CONFIG_MFD_TPS80031 is not set
+CONFIG_MFD_TI_AM335X_TSCADC=m
+CONFIG_MFD_OMAP_USB_HOST=y
+CONFIG_MTD_ONENAND_OMAP2=m
+CONFIG_HDQ_MASTER_OMAP=m
+CONFIG_REGULATOR_TWL4030=y
+CONFIG_BACKLIGHT_PANDORA=m
+CONFIG_OMAP_OCP2SCP=m
+CONFIG_USB_EHCI_HCD_OMAP=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_OHCI_HCD_OMAP3=y
+CONFIG_USB_MUSB_AM35X=m
+CONFIG_USB_MUSB_OMAP2PLUS=m
+CONFIG_USB_MUSB_HDRC=m
+CONFIG_USB_GADGET_MUSB_HDRC=m
+# CONFIG_MUSB_PIO_ONLY is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+CONFIG_OMAP_CONTROL_USB=m
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_MMC_OMAP=y
+CONFIG_MMC_OMAP_HS=y
+CONFIG_RTC_DRV_MAX8907=m
+# CONFIG_RTC_DRV_TWL92330 is not set
+CONFIG_RTC_DRV_TWL4030=m
+CONFIG_RTC_DRV_OMAP=m
+# Note needs to be compiled in until we build MMC modular
+CONFIG_DMA_OMAP=y
+CONFIG_OMAP_IOVMM=m
+CONFIG_HWSPINLOCK_OMAP=m
+CONFIG_SENSORS_TWL4030_MADC=m
+
+CONFIG_WL_TI=y
+CONFIG_WLCORE_SDIO=m
+CONFIG_WLCORE_SPI=m
+CONFIG_WL1251_SPI=m
+CONFIG_WL12XX_SPI=m
+CONFIG_WL12XX_SDIO_TEST=m
+CONFIG_WL18XX=m
+CONFIG_WILINK_PLATFORM_DATA=y
+CONFIG_MFD_WL1273_CORE=m
+CONFIG_NFC_WILINK=m
+
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_OMAP_PREFETCH=y
+CONFIG_MTD_NAND_OMAP_PREFETCH_DMA=y
+CONFIG_SPI_DAVINCI=m
+CONFIG_SPI_OMAP24XX=y
+CONFIG_MFD_TI_SSP=m
+CONFIG_SPI_TI_SSP=m
+
+CONFIG_INPUT_TWL4030_PWRBUTTON=m
+CONFIG_INPUT_TWL4030_VIBRA=m
+CONFIG_INPUT_TWL6040_VIBRA=m
+CONFIG_KEYBOARD_OMAP4=m
+CONFIG_KEYBOARD_TWL4030=m
+CONFIG_TOUCHSCREEN_TI_TSCADC=m
+
+# OMAP thermal temp. Can likely be built as module but doesn't autoload so build in to ensure performance on PandaES
+CONFIG_OMAP_BANDGAP=y
+CONFIG_OMAP4_THERMAL=y
+CONFIG_OMAP5_THERMAL=y
+
+# OMAP3 thermal/power
+CONFIG_POWER_AVS=y
+CONFIG_POWER_AVS_OMAP=y
+CONFIG_POWER_AVS_OMAP_CLASS3=y
+
+CONFIG_ARM_OMAP2PLUS_CPUFREQ=y
+
+CONFIG_PWM_TIECAP=m
+CONFIG_PWM_TIEHRPWM=m
+CONFIG_PWM_TWL=m
+CONFIG_PWM_TWL_LED=m
+
+CONFIG_CRYPTO_DEV_OMAP_SHAM=m
+CONFIG_CRYPTO_DEV_OMAP_AES=m
+CONFIG_HW_RANDOM_OMAP=m
+
+# CONFIG_DRM_TILCDC is not set
+CONFIG_DRM_OMAP=m
+CONFIG_DRM_OMAP_NUM_CRTCS=2
+CONFIG_OMAP2_VRAM=y
+CONFIG_OMAP2_VRAM_SIZE=0
+CONFIG_OMAP2_VRFB=y
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+# CONFIG_FB_OMAP_LCD_VGA is not set
+# CONFIG_FB_OMAP2 is not set
+# CONFIG_FB_DA8XX is not set
+
+CONFIG_OMAP2_DSS=m
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
+CONFIG_OMAP2_DSS_DPI=y
+CONFIG_OMAP2_DSS_RFBI=y
+CONFIG_OMAP2_DSS_VENC=y
+CONFIG_OMAP4_DSS_HDMI=y
+CONFIG_OMAP2_DSS_SDI=y
+CONFIG_OMAP2_DSS_DSI=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET=y
+CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y
+
+CONFIG_PANEL_GENERIC_DPI=m
+CONFIG_PANEL_TFP410=m
+CONFIG_PANEL_SHARP_LS037V7DW01=m
+CONFIG_PANEL_PICODLP=m
+CONFIG_PANEL_TAAL=m
+CONFIG_PANEL_NEC_NL8048HL11_01B=m
+CONFIG_PANEL_TPO_TD043MTEA1=m
+CONFIG_PANEL_LGPHILIPS_LB035Q02=m
+CONFIG_PANEL_ACX565AKM=m
+# CONFIG_PANEL_N8X0 is not set
+
+# Enable V4L2 drivers for OMAP2+
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
+# CONFIG_VIDEO_OMAP2_VOUT is not set
+# CONFIG_VIDEO_OMAP3 is not set
+# CONFIG_VIDEO_VPFE_CAPTURE is not set
+# The ones below are for TI Davinci
+# CONFIG_VIDEO_VPSS_SYSTEM is not set
+# CONFIG_VIDEO_DM6446_CCDC is not set
+# CONFIG_VIDEO_DM644X_VPBE is not set
+# CONFIG_VIDEO_DM355_CCDC is not set
+# CONFIG_VIDEO_ISIF is not set
+# Also enable vivi driver - useful for testing a full kernelspace V4L2 driver
+CONFIG_V4L_TEST_DRIVERS=y
+CONFIG_VIDEO_VIVI=m
+
+CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
+CONFIG_SND_OMAP_SOC_OMAP_HDMI=m
+CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
+CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m
+
+CONFIG_SND_OMAP_SOC=m
+CONFIG_SND_SOC_I2C_AND_SPI=m
+CONFIG_SND_OMAP_SOC_AM3517EVM=m
+CONFIG_SND_OMAP_SOC_DMIC=m
+CONFIG_SND_OMAP_SOC_IGEP0020=m
+CONFIG_SND_OMAP_SOC_MCBSP=m
+CONFIG_SND_OMAP_SOC_MCPDM=m
+CONFIG_SND_OMAP_SOC_OMAP_HDMI=m
+CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
+CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
+CONFIG_SND_OMAP_SOC_OMAP3EVM=m
+CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=m
+CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m
+CONFIG_SND_OMAP_SOC_OVERO=m
+# CONFIG_SND_OMAP_SOC_RX51 is not set
+CONFIG_SND_OMAP_SOC_SDP4430=m
+CONFIG_SND_SOC_TLV320AIC23=m
+CONFIG_SND_SOC_TLV320AIC3X=m
+CONFIG_SND_SOC_TWL4030=m
+CONFIG_SND_SOC_TWL6040=m
+CONFIG_RADIO_WL128X=m
+
+# CONFIG_OMAP_REMOTEPROC is not set
+
+# CONFIG_TIDSPBRIDGE is not set
+# CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000
+# CONFIG_TIDSPBRIDGE_DEBUG is not set
+# CONFIG_TIDSPBRIDGE_RECOVERY=y
+# CONFIG_TIDSPBRIDGE_CACHE_LINE_CHECK is not set
+# CONFIG_TIDSPBRIDGE_WDT3=y
+# CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5
+# CONFIG_TIDSPBRIDGE_NTFY_PWRERR is not set
+# CONFIG_TIDSPBRIDGE_BACKTRACE is not set
+
+# CONFIG_OMAP2_DSS_DEBUGFS is not set
+# CONFIG_OMAP_IOMMU_DEBUG is not set
+# CONFIG_OMAP_MUX_DEBUG is not set
+# CONFIG_VIDEO_OMAP3_DEBUG is not set
# Allwinner a1x
+CONFIG_PINCTRL_SUNXI=y
# CONFIG_SUNXI_RFKILL=y
# CONFIG_SUNXI_NAND=y
# CONFIG_SUNXI_DBGREG=m
@@ -239,7 +370,7 @@ CONFIG_USB_EHCI_MV=m
# CONFIG_RTC_DRV_SUN4I=y
# imx
-CONFIG_BACKLIGHT_PWM=m
+# CONFIG_BACKLIGHT_PWM is not set
# CONFIG_DRM_IMX is not set
# CONFIG_DRM_IMX_FB_HELPER=m
# CONFIG_DRM_IMX_PARALLEL_DISPLAY=m
@@ -248,6 +379,7 @@ CONFIG_BACKLIGHT_PWM=m
# CONFIG_VIDEO_CODA is not set
CONFIG_INPUT_PWM_BEEPER=m
+CONFIG_INPUT_88PM80X_ONKEY=m
# exynos
# CONFIG_DRM_EXYNOS is not set
@@ -256,151 +388,65 @@ CONFIG_INPUT_PWM_BEEPER=m
# picoxcell
CONFIG_CRYPTO_DEV_PICOXCELL=m
+CONFIG_HW_RANDOM_PICOXCELL=m
# ST Ericsson
# CONFIG_I2C_NOMADIK is not set
-
-# OMAP
# CONFIG_SENSORS_LIS3_I2C is not set
-# General ARM drivers
-# Device tree
-CONFIG_DTC=y
-CONFIG_OF=y
-CONFIG_USE_OF=y
-CONFIG_OF_DEVICE=y
-CONFIG_OF_IRQ=y
-CONFIG_ARM_ATAG_DTB_COMPAT=y
-CONFIG_ARM_APPENDED_DTB=y
-CONFIG_PROC_DEVICETREE=y
-# CONFIG_OF_SELFTEST is not set
-CONFIG_SERIAL_OF_PLATFORM=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_I2C_MUX_PINCTRL=m
-CONFIG_OF_MDIO=m
-
-CONFIG_MDIO_BUS_MUX_GPIO=m
-CONFIG_GPIOLIB=y
+# ZYNQ
+CONFIG_LATTICE_ECP3_CONFIG=m
# MMC/SD
-CONFIG_MMC=y
-CONFIG_MMC_ARMMMCI=y
-CONFIG_MMC_SDHCI_PLTFM=m
-CONFIG_MMC_SDHCI_OF=m
-CONFIG_MMC_SPI=m
-CONFIG_MMC_DW=m
-CONFIG_MMC_DW_PLTFM=m
-CONFIG_MMC_DW_PCI=m
-# CONFIG_MMC_DW_EXYNOS is not set
-# CONFIG_MMC_DW_IDMAC is not set
CONFIG_MMC_TMIO=m
CONFIG_MMC_SDHCI_PXAV3=m
CONFIG_MMC_SDHCI_PXAV2=m
-CONFIG_MMC_MVSDIO=m
-
-# usb
-CONFIG_USB_ULPI=y
-CONFIG_AX88796=m
-CONFIG_AX88796_93CX6=y
-CONFIG_SMC91X=m
-CONFIG_SMC911X=m
-CONFIG_SMSC911X=m
-CONFIG_USB_ISP1760_HCD=m
-
-# HW crypto and rng
-CONFIG_CRYPTO_SHA1_ARM=m
-CONFIG_CRYPTO_AES_ARM=m
-CONFIG_HW_RANDOM_ATMEL=m
-CONFIG_HW_RANDOM_EXYNOS=m
-
-# Sound
-CONFIG_SND_ARM=y
-CONFIG_SND_ARMAACI=m
-CONFIG_SND_SOC=m
-CONFIG_SND_DESIGNWARE_I2S=m
-CONFIG_SND_SIMPLE_CARD=m
-CONFIG_SND_SOC_CACHE_LZO=y
-CONFIG_SND_SOC_ALL_CODECS=m
-
-# EDAC
-CONFIG_EDAC=y
-CONFIG_EDAC_MM_EDAC=m
-CONFIG_EDAC_LEGACY_SYSFS=y
-
-# Watchdog
-CONFIG_MPCORE_WATCHDOG=m
# Multi function devices
CONFIG_MFD_CORE=m
+CONFIG_MFD_SYSCON=y
+CONFIG_MFD_88PM800=m
+CONFIG_MFD_88PM805=m
CONFIG_MFD_T7L66XB=y
CONFIG_MFD_TC6387XB=y
-CONFIG_MFD_SYSCON=y
-CONFIG_MFD_MAX8907=m
-# CONFIG_MFD_DA9055 is not set
-# CONFIG_MFD_SMSC is not set
-
-# RTC
-CONFIG_RTC_DRV_SNVS=m
-
-# Pin stuff
-CONFIG_PINMUX=y
-CONFIG_PINCONF=y
-CONFIG_PINCTRL_SINGLE=m
-# CONFIG_PINCTRL_SAMSUNG is not set
-# CONFIG_PINCTRL_EXYNOS4 is not set
-
-# GPIO
-CONFIG_GPIO_GENERIC_PLATFORM=m
-CONFIG_GPIO_EM=m
-CONFIG_GPIO_ADNP=m
-CONFIG_GPIO_MCP23S08=m
-CONFIG_POWER_RESET_GPIO=y
-CONFIG_RFKILL_GPIO=m
-CONFIG_SERIAL_8250_EM=m
-CONFIG_INPUT_GP2A=m
-CONFIG_INPUT_GPIO_TILT_POLLED=m
-CONFIG_MDIO_BUS_MUX_MMIOREG=m
-
-# MTD
-CONFIG_MTD_OF_PARTS=y
-# CONFIG_MG_DISK is not set
-
-# Framebuffers
-CONFIG_FB_SSD1307=m
# Regulator drivers
CONFIG_REGULATOR_FAN53555=m
+# CONFIG_CHARGER_MANAGER is not set
+# CONFIG_REGULATOR_DUMMY is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+CONFIG_RFKILL_REGULATOR=m
+CONFIG_REGULATOR_GPIO=m
+CONFIG_REGULATOR_AD5398=m
+CONFIG_REGULATOR_ISL6271A=m
+CONFIG_REGULATOR_MAX1586=m
+CONFIG_REGULATOR_MAX8649=m
+CONFIG_REGULATOR_MAX8660=m
+CONFIG_REGULATOR_MAX8952=m
+CONFIG_REGULATOR_MAX8973=m
+CONFIG_REGULATOR_LP3971=m
+CONFIG_REGULATOR_LP3972=m
+CONFIG_REGULATOR_TPS51632=m
+CONFIG_REGULATOR_TPS62360=m
+CONFIG_REGULATOR_TPS65023=m
+CONFIG_REGULATOR_TPS6524X=m
+CONFIG_REGULATOR_TPS6507X=m
+CONFIG_REGULATOR_TPS65912=m
+CONFIG_REGULATOR_MAX8907=m
+CONFIG_REGULATOR_LP872X=y
+CONFIG_REGULATOR_LP8755=m
+
# Needs work/investigation
# CONFIG_ARM_CHARLCD is not set
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_IP_PNP_RARP is not set
-# CONFIG_BPF_JIT is not set
# CONFIG_ASYMMETRIC_KEY_TYPE is not set
# CONFIG_PID_IN_CONTEXTIDR is not set
# CONFIG_DEPRECATED_PARAM_STRUCT is not set
-# CONFIG_IRQ_DOMAIN_DEBUG is not set
-# CONFIG_COMMON_CLK_DEBUG is not set
-# CONFIG_DEBUG_USER is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_DEBUG_PINCTRL is not set
-
-# CONFIG_CS89x0 is not set
-# CONFIG_DM9000 is not set
-
-# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set
# CONFIG_ARM_KPROBES_TEST is not set
-# CONFIG_LEDS_RENESAS_TPU is not set
-
-CONFIG_ETHERNET=y
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_CIRRUS is not set
-CONFIG_THERMAL=y
-# CONFIG_PATA_PLATFORM is not set
-CONFIG_PERF_EVENTS=y
# Defined config options we don't use yet
# CONFIG_PINCTRL_IMX35 is not set
@@ -410,25 +456,33 @@ CONFIG_PERF_EVENTS=y
# CONFIG_DRM_IMX_IPUV3 is not set
# CONFIG_REGULATOR_ANATOP is not set
-# CONFIG_GPIO_TWL6040 is not set
-# CONFIG_SND_OMAP_SOC_OMAP_TWL4030 is not set
-# CONFIG_VIDEO_DM6446_CCDC is not set
-# CONFIG_PANEL_TAAL is not set
+# CONFIG_BATTERY_RX51 is not set
# CONFIG_IR_RX51 is not set
-# CONFIG_DRM_OMAP is not set
-
# CONFIG_GENERIC_CPUFREQ_CPU0 is not set
-# CONFIG_GPIO_TWL6040 is not set
# CONFIG_MFD_SMSC is not set
+# CONFIG_MFD_SEC_CORE is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_LP8788 is not set
# CONFIG_MFD_MAX8907 is not set
-# CONFIG_REGULATOR_FAN53555 is not set
-# CONFIG_REGULATOR_ANATOP is not set
-# CONFIG_IR_RX51 is not set
-# CONFIG_VIDEO_DM6446_CCDC is not set
-# CONFIG_PANEL_TAAL is not set
-# CONFIG_SND_OMAP_SOC_OMAP_TWL4030 is not set
+# CONFIG_MFD_TPS65912_I2C is not set
+# CONFIG_MFD_DA9052_I2C is not set
+# CONFIG_MFD_MAX77686 is not set
+# CONFIG_MFD_MAX77693 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_TPS65090 is not set
+# CONFIG_MFD_AAT2870_CORE is not set
+# CONFIG_MFD_RC5T583 is not set
+# CONFIG_MFD_PALMAS is not set
+# CONFIG_MFD_DA9055 is not set
+# CONFIG_MFD_SMSC is not set
+# CONFIG_MFD_TPS65910 is not set
+# CONFIG_MFD_AS3711 is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+# CONFIG_REGULATOR_LP872X is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_DVB_USB_PCTV452E is not set
# We need to fix these as they should be either generic includes or kconfig fixes
@@ -436,3 +490,9 @@ CONFIG_PERF_EVENTS=y
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_EGALAX is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
+
+# CONFIG_VIRTUALIZATION is not set
+# CONFIG_CHARGER_MANAGER is not set
+# CONFIG_POWER_RESET_QNAP is not set
+# CONFIG_POWER_RESET_RESTART is not set
+# CONFIG_OMAP2_DSS_DEBUG is not set
diff --git a/freed-ora/current/master/config-armv7-generic b/freed-ora/current/master/config-armv7-generic
new file mode 100644
index 000000000..4105483df
--- /dev/null
+++ b/freed-ora/current/master/config-armv7-generic
@@ -0,0 +1,466 @@
+# arm configs for sharing between armv7 and armv7-lpae
+# Generic ARM config options
+CONFIG_ARM=y
+
+CONFIG_CMDLINE=""
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_HAVE_ARM_TWD=y
+CONFIG_AEABI=y
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+CONFIG_ARM_UNWIND=y
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_ASM_UNIFIED=y
+CONFIG_ARM_CPU_TOPOLOGY=y
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+CONFIG_SWP_EMULATE=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CACHE_PL310=y
+CONFIG_HIGHPTE=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_ATAGS=y
+CONFIG_ATAGS_PROC=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARCH_HAS_TICK_BROADCAST=y
+CONFIG_ALWAYS_USE_PERSISTENT_CLOCK=y
+
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_FPE_NWFPE is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_APM_EMULATION is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+# CONFIG_DMA_CACHE_RWFO is not set
+# CONFIG_THUMB2_KERNEL is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_ARM_VIRT_EXT is not set
+
+# errata
+# v5/v6
+# CONFIG_ARM_ERRATA_326103 is not set
+# CONFIG_ARM_ERRATA_411920 is not set
+# Cortex-A8
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_458693 is not set
+# CONFIG_ARM_ERRATA_460075 is not set
+# Cortex-A9
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_742230=y
+CONFIG_ARM_ERRATA_742231=y
+CONFIG_ARM_ERRATA_743622=y
+CONFIG_ARM_ERRATA_751472=y
+CONFIG_ARM_ERRATA_754322=y
+CONFIG_ARM_ERRATA_754327=y
+CONFIG_ARM_ERRATA_764369=y
+CONFIG_ARM_ERRATA_775420=y
+# Disabled due to causing highbank to crash
+# CONFIG_PL310_ERRATA_588369 is not set
+# CONFIG_PL310_ERRATA_727915 is not set
+CONFIG_PL310_ERRATA_753970=y
+CONFIG_PL310_ERRATA_769419=y
+# Cortex-A15
+CONFIG_ARM_ERRATA_798181=y
+
+# generic that deviates from or should be merged into config-generic
+CONFIG_SMP=y
+CONFIG_NR_CPUS=8
+CONFIG_SMP_ON_UP=y
+CONFIG_HIGHMEM=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+CONFIG_SCHED_MC=y
+CONFIG_SCHED_SMT=y
+
+CONFIG_RCU_FANOUT=32
+CONFIG_RCU_FANOUT_LEAF=16
+
+# 2013/04/19 - disable due to stability issues in 3.9 for the moment
+# CONFIG_CPU_IDLE is not set
+## CONFIG_CPU_IDLE_GOV_LADDER is not set
+# CONFIG_CPU_IDLE_GOV_MENU is not set
+# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set
+
+CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
+CONFIG_LSM_MMAP_MIN_ADDR=32768
+
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+
+CONFIG_SECCOMP=y
+CONFIG_STRICT_DEVMEM=y
+
+CONFIG_XZ_DEC_ARM=y
+CONFIG_OC_ETM=y
+
+CONFIG_PM=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_SUSPEND=y
+CONFIG_ARM_CPU_SUSPEND=y
+
+CONFIG_LOCAL_TIMERS=y
+CONFIG_HW_PERF_EVENTS=y
+CONFIG_UACCESS_WITH_MEMCPY=y
+CONFIG_CC_STACKPROTECTOR=y
+
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+
+# Root as NFS, different from mainline
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+
+CONFIG_LBDAF=y
+
+CONFIG_COMMON_CLK=y
+
+# Device tree
+CONFIG_DTC=y
+CONFIG_OF=y
+CONFIG_USE_OF=y
+CONFIG_OF_DEVICE=y
+CONFIG_OF_IRQ=y
+CONFIG_DMA_OF=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_OF_SELFTEST is not set
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_OF_GPIO=y
+CONFIG_I2C_MUX_PINCTRL=m
+CONFIG_OF_MDIO=m
+
+CONFIG_OF_DISPLAY_TIMING=y
+CONFIG_OF_VIDEOMODE=y
+
+# General vexpress ARM drivers
+CONFIG_ARM_AMBA=y
+CONFIG_ARM_TIMER_SP804=y
+
+CONFIG_SERIO_AMBAKMI=m
+CONFIG_SERIAL_AMBA_PL010=y
+CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+
+CONFIG_RTC_DRV_PL030=y
+CONFIG_RTC_DRV_PL031=y
+
+CONFIG_PL330_DMA=m
+CONFIG_AMBA_PL08X=y
+CONFIG_ARM_SP805_WATCHDOG=m
+CONFIG_I2C_VERSATILE=m
+CONFIG_GPIO_PL061=y
+CONFIG_SENSORS_VEXPRESS=m
+CONFIG_FB_ARMCLCD=m
+CONFIG_REGULATOR_VEXPRESS=m
+
+# usb
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_ULPI=y
+CONFIG_AX88796=m
+CONFIG_AX88796_93CX6=y
+CONFIG_SMC91X=m
+CONFIG_SMC911X=m
+CONFIG_SMSC911X=m
+CONFIG_USB_ISP1760_HCD=m
+
+# Multifunction Devices
+CONFIG_MFD_SYSCON=y
+CONFIG_MFD_TPS65912_SPI=y
+# CONFIG_MFD_DA9052_SPI is not set
+# CONFIG_MFD_ARIZONA_SPI is not set
+# CONFIG_MFD_WM831X_SPI is not set
+# CONFIG_MFD_MC13XXX_SPI is not set
+
+# Pin stuff
+CONFIG_PINMUX=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_SINGLE=m
+# CONFIG_PINCTRL_SAMSUNG is not set
+# CONFIG_PINCTRL_EXYNOS4 is not set
+
+# GPIO
+CONFIG_GPIO_GENERIC_PLATFORM=m
+CONFIG_EXTCON_GPIO=m
+CONFIG_GENERIC_GPIO=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIO_EM is not set
+CONFIG_GPIO_ADNP=m
+CONFIG_GPIO_MCP23S08=m
+CONFIG_POWER_RESET_GPIO=y
+CONFIG_RFKILL_GPIO=m
+CONFIG_SERIAL_8250_EM=m
+CONFIG_INPUT_GPIO_TILT_POLLED=m
+CONFIG_MDIO_BUS_MUX_GPIO=m
+CONFIG_MDIO_BUS_MUX_MMIOREG=m
+CONFIG_LEDS_GPIO=m
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_MAX7301=m
+CONFIG_GPIO_MC33880=m
+CONFIG_GPIO_74X164=m
+CONFIG_GPIO_TPS65912=m
+CONFIG_W1_MASTER_GPIO=m
+CONFIG_CHARGER_GPIO=m
+
+CONFIG_SPI=y
+CONFIG_SPI_GPIO=m
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_PL022=m
+CONFIG_SPI_SPIDEV=m
+CONFIG_SPI_ALTERA=m
+CONFIG_SPI_BUTTERFLY=m
+CONFIG_SPI_LM70_LLP=m
+CONFIG_SPI_OC_TINY=m
+CONFIG_SPI_S3C64XX=m
+CONFIG_SPI_SC18IS602=m
+CONFIG_SPI_XCOMM=m
+CONFIG_SPI_XILINX=m
+CONFIG_SPI_DESIGNWARE=m
+CONFIG_SPI_TLE62X0=m
+
+# HW crypto and rng
+CONFIG_CRYPTO_SHA1_ARM=m
+CONFIG_CRYPTO_AES_ARM=m
+
+# EDAC
+CONFIG_EDAC=y
+CONFIG_EDAC_MM_EDAC=m
+CONFIG_EDAC_LEGACY_SYSFS=y
+
+# Watchdog
+CONFIG_MPCORE_WATCHDOG=m
+
+# Thermal / powersaving
+CONFIG_THERMAL=y
+CONFIG_POWER_RESET_RESTART=y
+CONFIG_ARM_PSCI=y
+
+# MTD
+CONFIG_MTD_OF_PARTS=y
+# CONFIG_MG_DISK is not set
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y
+CONFIG_MTD_DATAFLASH_OTP=y
+CONFIG_MTD_M25P80=m
+CONFIG_MTD_SST25L=m
+CONFIG_EEPROM_AT25=m
+CONFIG_EEPROM_93XX46=m
+
+# MMC/SD
+CONFIG_MMC=y
+CONFIG_MMC_ARMMMCI=y
+CONFIG_MMC_SDHCI_PLTFM=m
+CONFIG_MMC_SPI=m
+CONFIG_MMC_DW=m
+CONFIG_MMC_DW_PLTFM=m
+CONFIG_MMC_DW_PCI=m
+CONFIG_SPI_DW_MMIO=m
+# CONFIG_MMC_DW_EXYNOS is not set
+# CONFIG_MMC_DW_IDMAC is not set
+
+# Sound
+CONFIG_SND_ARM=y
+CONFIG_SND_ARMAACI=m
+CONFIG_SND_SOC=m
+CONFIG_SND_SPI=y
+CONFIG_SND_DESIGNWARE_I2S=m
+CONFIG_SND_SIMPLE_CARD=m
+CONFIG_SND_SOC_CACHE_LZO=y
+CONFIG_SND_SOC_ALL_CODECS=m
+# CONFIG_SND_ATMEL_SOC is not set
+
+# Displays
+CONFIG_FB_SSD1307=m
+
+# PWM
+CONFIG_PWM=y
+CONFIG_BACKLIGHT_PWM=m
+
+# RTC
+CONFIG_RTC_DRV_M41T93=m
+CONFIG_RTC_DRV_M41T94=m
+CONFIG_RTC_DRV_DS1305=m
+CONFIG_RTC_DRV_DS1390=m
+CONFIG_RTC_DRV_MAX6902=m
+CONFIG_RTC_DRV_R9701=m
+CONFIG_RTC_DRV_RS5C348=m
+CONFIG_RTC_DRV_DS3234=m
+CONFIG_RTC_DRV_PCF2123=m
+CONFIG_RTC_DRV_RX4581=m
+
+# Regulators
+CONFIG_REGULATOR=y
+CONFIG_RFKILL_REGULATOR=m
+CONFIG_CHARGER_MANAGER=y
+# CONFIG_REGULATOR_DUMMY is not set
+CONFIG_REGULATOR_FIXED_VOLTAGE=m
+CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
+CONFIG_REGULATOR_USERSPACE_CONSUMER=m
+CONFIG_REGULATOR_GPIO=m
+CONFIG_REGULATOR_AD5398=m
+CONFIG_REGULATOR_FAN53555=m
+CONFIG_REGULATOR_ANATOP=m
+CONFIG_REGULATOR_ISL6271A=m
+CONFIG_REGULATOR_MAX1586=m
+CONFIG_REGULATOR_MAX8649=m
+CONFIG_REGULATOR_MAX8660=m
+CONFIG_REGULATOR_MAX8952=m
+CONFIG_REGULATOR_MAX8973=m
+CONFIG_REGULATOR_LP3971=m
+CONFIG_REGULATOR_LP3972=m
+CONFIG_REGULATOR_LP8755=m
+CONFIG_REGULATOR_TPS51632=m
+CONFIG_REGULATOR_TPS62360=m
+CONFIG_REGULATOR_TPS65023=m
+CONFIG_REGULATOR_TPS6507X=m
+CONFIG_REGULATOR_TPS6524X=m
+CONFIG_REGULATOR_TPS65912=m
+
+CONFIG_SENSORS_AD7314=m
+CONFIG_SENSORS_ADCXX=m
+CONFIG_SENSORS_LM70=m
+CONFIG_SENSORS_MAX1111=m
+CONFIG_SENSORS_ADS7871=m
+CONFIG_SENSORS_LIS3_SPI=m
+CONFIG_SENSORS_GPIO_FAN=m
+
+CONFIG_LCD_L4F00242T03=m
+CONFIG_LCD_LMS283GF05=m
+CONFIG_LCD_LTV350QV=m
+CONFIG_LCD_ILI9320=m
+CONFIG_LCD_TDO24M=m
+CONFIG_LCD_VGG2432A4=m
+CONFIG_LCD_S6E63M0=m
+CONFIG_LCD_LD9040=m
+CONFIG_LCD_AMS369FG06=m
+CONFIG_LCD_LMS501KF03=m
+CONFIG_LCD_HX8357=m
+
+CONFIG_INPUT_PWM_BEEPER=m
+CONFIG_INPUT_GP2A=m
+CONFIG_INPUT_ARIZONA_HAPTICS=m
+CONFIG_INPUT_MC13783_PWRBUTTON=m
+
+
+CONFIG_TOUCHSCREEN_ADS7846=m
+CONFIG_TOUCHSCREEN_AD7877=m
+CONFIG_TOUCHSCREEN_MC13783=m
+CONFIG_TOUCHSCREEN_TSC2005=m
+
+CONFIG_LEDS_DAC124S085=m
+CONFIG_LEDS_PWM=m
+CONFIG_BMP085_SPI=m
+
+# Ethernet
+CONFIG_KS8851=m
+CONFIG_ENC28J60=m
+CONFIG_LIBERTAS_SPI=m
+CONFIG_P54_SPI=m
+CONFIG_P54_SPI_DEFAULT_EEPROM=n
+CONFIG_MICREL_KS8995MA=m
+CONFIG_IEEE802154_AT86RF230=m
+CONFIG_IEEE802154_MRF24J40=m
+
+CONFIG_ARM_KPROBES_TEST=m
+
+# jffs2
+CONFIG_JFFS2_FS=m
+CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+CONFIG_JFFS2_FS_XATTR=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_ZLIB=y
+
+CONFIG_UBIFS_FS=m
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_FS_DEBUG is not set
+
+# Should be in generic
+CONFIG_ETHERNET=y
+CONFIG_BPF_JIT=y
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+
+# CONFIG_PATA_PLATFORM is not set
+CONFIG_PERF_EVENTS=y
+
+# CONFIG_RTC_DRV_SNVS is not set
+# CONFIG_DRM_EXYNOS is not set
+# CONFIG_DRM_TILCDC is not set
+# CONFIG_DRM_IMX is not set
+# CONFIG_MMC_SDHCI_PXAV3 is not set
+# CONFIG_MMC_SDHCI_PXAV2 is not set
+# CONFIG_CS89x0 is not set
+# CONFIG_DM9000 is not set
+# CONFIG_HW_RANDOM_ATMEL is not set
+# CONFIG_HW_RANDOM_EXYNOS is not set
+# CONFIG_I2C_NOMADIK is not set
+# CONFIG_LEDS_RENESAS_TPU is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_TI_DAC7512 is not set
+# CONFIG_EZX_PCAP is not set
+
+# Needs work/investigation
+# CONFIG_ARM_CHARLCD is not set
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_ASYMMETRIC_KEY_TYPE is not set
+# CONFIG_PID_IN_CONTEXTIDR is not set
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+# CONFIG_LATTICE_ECP3_CONFIG is not set
+# CONFIG_M25PXX_USE_FAST_READ is not set
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX310X is not set
+# CONFIG_SERIAL_IFX6X60 is not set
+
+# these modules all fail with missing __bad_udelay
+# http://www.spinics.net/lists/arm/msg15615.html provides some background
+# CONFIG_SUNGEM is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_DRM_RADEON is not set
+# CONFIG_ATM_HE is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SFC is not set
+
+# these all currently fail due to missing symbols __bad_udelay or
+# error: implicit declaration of function ‘iowrite32be’
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_DRM_NOUVEAU is not set
+# CONFIG_MLX4_EN is not set
+
+# Debug options. We need to deal with them at some point like x86
+# CONFIG_COMMON_CLK_DEBUG is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_IRQ_DOMAIN_DEBUG is not set
+# CONFIG_DEBUG_PINCTRL is not set
diff --git a/freed-ora/current/master/config-armv7-lpae b/freed-ora/current/master/config-armv7-lpae
new file mode 100644
index 000000000..15b0d53cd
--- /dev/null
+++ b/freed-ora/current/master/config-armv7-lpae
@@ -0,0 +1,95 @@
+# ARM unified arch kernel
+CONFIG_CPU_V7=y
+CONFIG_ARCH_EXYNOS=y
+CONFIG_ARCH_VIRT=y
+
+# CONFIG_ARCH_EXYNOS4 is not set
+CONFIG_ARCH_EXYNOS5=y
+
+CONFIG_ARM_LPAE=y
+CONFIG_VIRTIO_CONSOLE=m
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_VIRTUALIZATION=y
+
+CONFIG_KVM=y
+CONFIG_KVM_ARM_HOST=y
+CONFIG_KVM_ARM_MAX_VCPUS=8
+CONFIG_KVM_ARM_VGIC=y
+CONFIG_KVM_ARM_TIMER=y
+
+CONFIG_XEN=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m
+CONFIG_XEN_BLKDEV_FRONTEND=m
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_FRONTEND=m
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_XEN_DEV_EVTCHN=m
+CONFIG_XEN_BACKEND=y
+CONFIG_XENFS=m
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=m
+CONFIG_XEN_WDT=m
+
+CONFIG_S3C_BOOT_ERROR_RESET=y
+CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
+CONFIG_S3C_LOWLEVEL_UART_PORT=0
+CONFIG_S3C_GPIO_SPACE=8
+CONFIG_S3C_ADC=y
+CONFIG_S3C24XX_PWM=y
+# CONFIG_SAMSUNG_PM_DEBUG is not set
+# CONFIG_SAMSUNG_PM_CHECK is not set
+CONFIG_SOC_EXYNOS5250=y
+CONFIG_SOC_EXYNOS5440=y
+CONFIG_MACH_EXYNOS5_DT=y
+CONFIG_ARM_EXYNOS_CPUFREQ=y
+CONFIG_SERIAL_SAMSUNG=y
+CONFIG_I2C_S3C2410=m
+CONFIG_PINCTRL_EXYNOS=y
+CONFIG_PINCTRL_EXYNOS5440=y
+CONFIG_S3C2410_WATCHDOG=m
+CONFIG_VIDEO_SAMSUNG_S5P_G2D=m
+CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m
+CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
+CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
+CONFIG_EXYNOS_VIDEO=y
+CONFIG_EXYNOS_MIPI_DSI=y
+CONFIG_EXYNOS_DP=y
+# CONFIG_EXYNOS_LCD_S6E8AX0 is not set
+# CONFIG_DRM_EXYNOS is not set
+CONFIG_DRM_EXYNOS_IOMMU=y
+CONFIG_DRM_EXYNOS_DMABUF=y
+CONFIG_DRM_EXYNOS_FIMD=y
+CONFIG_DRM_EXYNOS_HDMI=y
+CONFIG_DRM_EXYNOS_VIDI=y
+CONFIG_DRM_EXYNOS_G2D=y
+CONFIG_DRM_EXYNOS_IPP=y
+CONFIG_DRM_EXYNOS_FIMC=y
+CONFIG_DRM_EXYNOS_ROTATOR=y
+CONFIG_DRM_EXYNOS_GSC=y
+# CONFIG_FB_S3C is not set
+CONFIG_SND_SOC_SAMSUNG=m
+CONFIG_USB_EHCI_S5P=y
+CONFIG_USB_OHCI_EXYNOS=y
+CONFIG_MMC_SDHCI_S3C=m
+CONFIG_MMC_SDHCI_S3C_DMA=y
+CONFIG_RTC_DRV_S3C=m
+CONFIG_PWM_SAMSUNG=m
+CONFIG_S3C_BOOT_WATCHDOG=y
+CONFIG_SAMSUNG_GPIO_EXTRA=8
+CONFIG_SERIAL_SAMSUNG_CONSOLE=y
+CONFIG_BATTERY_S3C_ADC=m
+CONFIG_SENSORS_S3C=m
+CONFIG_SENSORS_S3C_RAW=y
+CONFIG_FB_S3C_DEBUG_REGWRITE=y
+CONFIG_SND_SOC_SAMSUNG_SMDK_SPDIF=m
+CONFIG_USB_EHCI_S5P=y
+CONFIG_SAMSUNG_USBPHY=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_PLTFM=y
+CONFIG_MMC_DW_PCI=y
+CONFIG_MMC_DW_EXYNOS=y
diff --git a/freed-ora/current/master/config-arm-tegra b/freed-ora/current/master/config-armv7-tegra
index 869b1728a..20cda8a7b 100644
--- a/freed-ora/current/master/config-arm-tegra
+++ b/freed-ora/current/master/config-armv7-tegra
@@ -2,10 +2,15 @@ CONFIG_ARCH_TEGRA=y
CONFIG_ARCH_TEGRA_2x_SOC=y
# CONFIG_ARCH_TEGRA_3x_SOC is not set
-# CONFIG_ARM_LPAE is not set
+# CONFIG_ARCH_TEGRA_114_SOC is not set
-CONFIG_VFP=y
-CONFIG_VFPv3=y
+# CONFIG_NEON is not set
+# These are supported in the LPAE kernel
+# CONFIG_ARM_LPAE is not set
+# CONFIG_XEN is not set
+# CONFIG_VIRTIO_CONSOLE is not set
+# CONFIG_ARM_VIRT_EXT is not set
+# CONFIG_VIRTUALIZATION is not set
# CONFIG_MACH_HARMONY is not set
CONFIG_MACH_KAEN=y
@@ -16,9 +21,6 @@ CONFIG_MACH_TRIMSLICE=y
CONFIG_MACH_WARIO=y
CONFIG_MACH_VENTANA=y
-CONFIG_TEGRA_DEBUG_UARTD=y
-CONFIG_ARM_CPU_TOPOLOGY=y
-
CONFIG_TEGRA_PCI=y
CONFIG_TEGRA_IOMMU_GART=y
CONFIG_TEGRA_IOMMU_SMMU=y
@@ -31,39 +33,19 @@ CONFIG_MMC_BLOCK=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_OF=y
-CONFIG_MMC_SPI=y
-
CONFIG_MMC_SDHCI_TEGRA=y
-# CONFIG_RCU_BOOST is not set
CONFIG_TEGRA_SYSTEM_DMA=y
CONFIG_TEGRA_EMC_SCALING_ENABLE=y
CONFIG_TEGRA_AHB=y
CONFIG_TEGRA20_APB_DMA=y
-CONFIG_ARM_THUMBEE=y
-CONFIG_SWP_EMULATE=y
-# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_CACHE_L2X0=y
-CONFIG_ARM_ERRATA_430973=y
-# CONFIG_ARM_ERRATA_458693 is not set
-# CONFIG_ARM_ERRATA_460075 is not set
-CONFIG_ARM_ERRATA_742230=y
-# CONFIG_ARM_ERRATA_742231 is not set
-CONFIG_PL310_ERRATA_588369=y
-CONFIG_PL310_ERRATA_769419=y
-CONFIG_ARM_ERRATA_720789=y
-# CONFIG_PL310_ERRATA_727915 is not set
-# CONFIG_ARM_ERRATA_743622 is not set
-# CONFIG_ARM_ERRATA_751472 is not set
-# CONFIG_ARM_ERRATA_753970 is not set
-# CONFIG_ARM_ERRATA_754322 is not set
-# CONFIG_ARM_ERRATA_754327 is not set
-# CONFIG_ARM_ERRATA_764369 is not set
-# CONFIG_THUMB2_KERNEL is not set
-# CONFIG_NEON is not set
-CONFIG_GPIO_GENERIC_PLATFORM=y
-# CONFIG_GPIO_MCP23S08 is not set
-# CONFIG_KEYBOARD_TEGRA is not set
+CONFIG_SPI_TEGRA20_SFLASH=m
+CONFIG_SPI_TEGRA20_SLINK=m
+
+CONFIG_KEYBOARD_TEGRA=m
+CONFIG_PINCTRL_TEGRA=y
+CONFIG_PINCTRL_TEGRA20=y
+CONFIG_PINCTRL_TEGRA30=y
CONFIG_USB_EHCI_TEGRA=y
CONFIG_RTC_DRV_TEGRA=y
@@ -71,12 +53,14 @@ CONFIG_SND_SOC_TEGRA=m
CONFIG_SND_SOC_TEGRA_ALC5632=m
CONFIG_SND_SOC_TEGRA_WM8753=m
CONFIG_SND_SOC_TEGRA_WM8903=m
+CONFIG_SND_SOC_TEGRA_WM9712=m
CONFIG_SND_SOC_TEGRA_TRIMSLICE=m
CONFIG_SND_SOC_TEGRA30_AHUB=m
CONFIG_SND_SOC_TEGRA30_I2S=m
+CONFIG_SND_SOC_TEGRA20_AC97=m
# AC100 (PAZ00)
-# CONFIG_MFD_NVEC is not set
+CONFIG_MFD_NVEC=y
CONFIG_MFD_TPS80031=y
CONFIG_KEYBOARD_NVEC=y
CONFIG_SERIO_NVEC_PS2=y
@@ -90,20 +74,35 @@ CONFIG_NVEC_PAZ00=y
CONFIG_PWM_TEGRA=m
-CONFIG_DRM_TEGRA=m
+CONFIG_CMA=y
+# CONFIG_CMA_DEBUG is not set
+CONFIG_CMA_SIZE_MBYTES=16
+CONFIG_CMA_SIZE_SEL_MBYTES=y
+# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
+# CONFIG_CMA_SIZE_SEL_MIN is not set
+# CONFIG_CMA_SIZE_SEL_MAX is not set
+CONFIG_CMA_ALIGNMENT=8
+CONFIG_CMA_AREAS=7
-CONFIG_CPU_PM=y
-CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_DRM_TEGRA=m
CONFIG_CRYPTO_DEV_TEGRA_AES=m
-CONFIG_PL310_ERRATA_753970=y
CONFIG_LEDS_RENESAS_TPU=y
CONFIG_OF=y
CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_TEGRA=y
CONFIG_OF_GPIO=y
CONFIG_OF_PCI=y
CONFIG_OF_PCI_IRQ=y
# CONFIG_DRM_TEGRA_DEBUG is not set
+# CONFIG_TI_DAC7512 is not set
+# CONFIG_SPI_TOPCLIFF_PCH is not set
+# CONFIG_SPI_DW_PCI is not set
+# CONFIG_SPI_PXA2XX is not set
+# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_PINCTRL_EXYNOS is not set
+# CONFIG_PINCTRL_EXYNOS5440 is not set
diff --git a/freed-ora/current/master/config-debug b/freed-ora/current/master/config-debug
index e1b3f9db2..43655a1a1 100644
--- a/freed-ora/current/master/config-debug
+++ b/freed-ora/current/master/config-debug
@@ -96,6 +96,7 @@ CONFIG_PCI_DEFAULT_USE_CRS=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
+CONFIG_KDB_CONTINUE_CATASTROPHIC=0
CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
CONFIG_TEST_LIST_SORT=y
diff --git a/freed-ora/current/master/config-generic b/freed-ora/current/master/config-generic
index 96fe207a0..df7d399a4 100644
--- a/freed-ora/current/master/config-generic
+++ b/freed-ora/current/master/config-generic
@@ -188,6 +188,9 @@ CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
+# Give this a try in rawhide for now
+# CONFIG_FW_LOADER_USER_HELPER is not set
+
# CONFIG_CMA is not set
# CONFIG_SPI is not set
@@ -199,6 +202,7 @@ CONFIG_MTD=m
# CONFIG_MTD_TESTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_AR7_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
#
# User Modules And Translation Layers
@@ -320,6 +324,7 @@ CONFIG_BLK_DEV_THROTTLING=y
# CONFIG_IDE is not set
# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_RSXX is not set
CONFIG_SCSI_VIRTIO=m
CONFIG_VIRTIO_BLK=m
@@ -328,7 +333,6 @@ CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_MMIO=m
# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set
CONFIG_VIRTIO_NET=m
-CONFIG_VMXNET3=m
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_VIRTIO_CONSOLE=y
CONFIG_VHOST_NET=m
@@ -394,7 +398,8 @@ CONFIG_SCSI_3W_9XXX=m
CONFIG_SCSI_ACARD=m
CONFIG_SCSI_AACRAID=m
CONFIG_SCSI_AIC7XXX=m
-CONFIG_SCSI_AIC7XXX_OLD=m
+# http://lists.fedoraproject.org/pipermail/kernel/2013-February/004102.html
+# CONFIG_SCSI_AIC7XXX_OLD is not set
CONFIG_AIC7XXX_CMDS_PER_DEVICE=4
CONFIG_AIC7XXX_RESET_DELAY_MS=15000
# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
@@ -428,6 +433,7 @@ CONFIG_SCSI_MPT3SAS_MAX_SGE=128
CONFIG_SCSI_MPT3SAS_LOGGING=y
CONFIG_SCSI_UFSHCD=m
+CONFIG_SCSI_UFSHCD_PCI=m
CONFIG_SCSI_MVUMI=m
@@ -437,6 +443,7 @@ CONFIG_SCSI_OSD_DPRINT_SENSE=1
# CONFIG_SCSI_OSD_DEBUG is not set
CONFIG_SCSI_BNX2_ISCSI=m
+CONFIG_SCSI_BNX2X_FCOE=m
CONFIG_BE2ISCSI=m
CONFIG_SCSI_PMCRAID=m
@@ -450,7 +457,7 @@ CONFIG_SCSI_ARCMSR=m
CONFIG_SCSI_BUSLOGIC=m
CONFIG_SCSI_INITIO=m
CONFIG_SCSI_FLASHPOINT=y
-# CONFIG_SCSI_DMX3191D is not set
+CONFIG_SCSI_DMX3191D=m
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
@@ -476,7 +483,9 @@ CONFIG_SCSI_DC390T=m
CONFIG_SCSI_QLA_FC=m
CONFIG_TCM_QLA2XXX=m
CONFIG_SCSI_QLA_ISCSI=m
-# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_IPR=m
+CONFIG_SCSI_IPR_TRACE=y
+CONFIG_SCSI_IPR_DUMP=y
# CONFIG_SCSI_DPT_I2O is not set
CONFIG_SCSI_LPFC=m
# CONFIG_SCSI_LPFC_DEBUG_FS is not set
@@ -509,6 +518,7 @@ CONFIG_SATA_SX4=m
CONFIG_SATA_ULI=m
CONFIG_SATA_VIA=m
CONFIG_SATA_VITESSE=m
+# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_ACARD_AHCI=m
# CONFIG_PATA_LEGACY is not set
@@ -580,11 +590,14 @@ CONFIG_ASYNC_RAID6_TEST=m
CONFIG_BLK_DEV_DM=y
CONFIG_DM_CRYPT=m
CONFIG_DM_DEBUG=y
-# CONFIG_DM_DELAY is not set
+CONFIG_DM_DELAY=m
CONFIG_DM_MIRROR=y
CONFIG_DM_MULTIPATH=m
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_THIN_PROVISIONING=m
+CONFIG_DM_CACHE=m
+CONFIG_DM_CACHE_MQ=m
+CONFIG_DM_CACHE_CLEANER=m
# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set
# CONFIG_DM_DEBUG_SPACE_MAPS is not set
CONFIG_DM_UEVENT=y
@@ -761,6 +774,7 @@ CONFIG_NET_9P_RDMA=m
# CONFIG_DECNET is not set
CONFIG_BRIDGE=m
CONFIG_BRIDGE_IGMP_SNOOPING=y
+CONFIG_BRIDGE_VLAN_FILTERING=y
# PHY timestamping adds overhead
CONFIG_NETWORK_PHY_TIMESTAMPING=y
@@ -803,10 +817,12 @@ CONFIG_NETFILTER_XT_TARGET_TEE=m
CONFIG_NETFILTER_XT_TARGET_TPROXY=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
+CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CPU=m
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
@@ -926,7 +942,7 @@ CONFIG_IP6_NF_TARGET_LOG=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_TARGET_HL=m
CONFIG_NF_NAT_IPV6=m
-# CONFIG_IP6_NF_TARGET_MASQUERADE is not set
+CONFIG_IP6_NF_TARGET_MASQUERADE=m
# CONFIG_IP6_NF_TARGET_NPT is not set
#
@@ -996,6 +1012,7 @@ CONFIG_SCTP_COOKIE_HMAC_SHA1=y
CONFIG_ATM=m
CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
+CONFIG_VLAN_8021Q_MVRP=y
CONFIG_LLC=m
# CONFIG_LLC2 is not set
CONFIG_IPX=m
@@ -1020,7 +1037,8 @@ CONFIG_IP_DCCP_CCID3=y
#
# TIPC Configuration (EXPERIMENTAL)
#
-# CONFIG_TIPC is not set
+CONFIG_TIPC=m
+CONFIG_TIPC_PORTS=8192
# CONFIG_TIPC_ADVANCED is not set
# CONFIG_TIPC_DEBUG is not set
@@ -1093,6 +1111,7 @@ CONFIG_BATMAN_ADV_BLA=y
CONFIG_BATMAN_ADV_DAT=y
# CONFIG_BATMAN_ADV_DEBUG is not set
CONFIG_OPENVSWITCH=m
+CONFIG_VSOCKETS=m
CONFIG_NETPRIO_CGROUP=m
@@ -1260,6 +1279,7 @@ CONFIG_E100=m
CONFIG_E1000=m
CONFIG_E1000E=m
CONFIG_IGB=m
+CONFIG_IGB_HWMON=y
CONFIG_IGB_DCA=y
CONFIG_IGB_PTP=y
CONFIG_IGBVF=m
@@ -1412,6 +1432,8 @@ CONFIG_NET_PCI=y
CONFIG_B44=m
CONFIG_B44_PCI=y
CONFIG_BNX2=m
+CONFIG_BNX2X=m
+CONFIG_BNX2X_SRIOV=y
CONFIG_CNIC=m
CONFIG_FEALNX=m
CONFIG_NET_POCKET=y
@@ -1426,16 +1448,9 @@ CONFIG_JME=m
#
# Ethernet (10000 Mbit)
#
-CONFIG_IP1000=m
-CONFIG_MLX4_EN=m
-CONFIG_MLX4_EN_DCB=y
-# CONFIG_MLX4_DEBUG is not set
-CONFIG_SFC=m
-CONFIG_SFC_MCDI_MON=y
-CONFIG_SFC_SRIOV=y
-CONFIG_SFC_PTP=y
-
-# CONFIG_SFC_MTD is not set
+# CONFIG_IP1000 is not set
+# CONFIG_MLX4_EN is not set
+# CONFIG_SFC is not set
# CONFIG_FDDI is not set
# CONFIG_DEFXX is not set
@@ -1579,6 +1594,8 @@ CONFIG_LIBERTAS_SDIO=m
# CONFIG_LIBERTAS_THINFIRM is not set
CONFIG_LIBERTAS_MESH=y
CONFIG_IWLWIFI=m
+CONFIG_IWLDVM=m
+CONFIG_IWLMVM=m
CONFIG_IWLWIFI_DEBUG=y
CONFIG_IWLWIFI_DEBUGFS=y
CONFIG_IWLWIFI_DEVICE_SVTOOL=y
@@ -1620,7 +1637,6 @@ CONFIG_RT2800PCI_RT53XX=y
CONFIG_RT73USB=m
CONFIG_RTL8180=m
CONFIG_RTL8187=m
-# CONFIG_RTLWIFI_DEBUG is not set
# CONFIG_USB_ZD1201 is not set
CONFIG_USB_NET_RNDIS_WLAN=m
CONFIG_USB_NET_KALMIA=m
@@ -1641,6 +1657,8 @@ CONFIG_WL1251=m
CONFIG_WL1251_SPI=m
CONFIG_WL1251_SDIO=m
+CONFIG_RTLWIFI=m
+# CONFIG_RTLWIFI_DEBUG is not set
CONFIG_RTL8192CE=m
CONFIG_RTL8192SE=m
CONFIG_RTL8192CU=m
@@ -1701,9 +1719,11 @@ CONFIG_NFC_LLCP=y
#
# Near Field Communication (NFC) devices
#
-CONFIG_PN544_NFC=m
-CONFIG_PN544_HCI_NFC=m
+CONFIG_NFC_PN544=m
+CONFIG_NFC_PN544_I2C=m
CONFIG_NFC_PN533=m
+CONFIG_NFC_MICROREAD=m
+CONFIG_NFC_MICROREAD_I2C=m
#
# IrDA (infrared) support
@@ -1998,6 +2018,7 @@ CONFIG_MOUSE_APPLETOUCH=m
CONFIG_MOUSE_BCM5974=m
CONFIG_MOUSE_SYNAPTICS_I2C=m
CONFIG_MOUSE_SYNAPTICS_USB=m
+CONFIG_MOUSE_CYAPA=m
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_ANALOG=m
CONFIG_JOYSTICK_A3D=m
@@ -2118,12 +2139,14 @@ CONFIG_TCG_TIS=m
CONFIG_TCG_NSC=m
CONFIG_TCG_ATMEL=m
# CONFIG_TCG_INFINEON is not set
+# CONFIG_TCG_ST33_I2C is not set
CONFIG_TELCLOCK=m
#
# Serial drivers
#
CONFIG_SERIAL_8250=y
+# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_CS=m
CONFIG_SERIAL_8250_NR_UARTS=32
@@ -2285,6 +2308,7 @@ CONFIG_SENSORS_LM93=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_MAX1619=m
CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_MAX6697=m
CONFIG_SENSORS_MCP3021=m
CONFIG_SENSORS_NTC_THERMISTOR=m
CONFIG_SENSORS_PC87360=m
@@ -2325,6 +2349,7 @@ CONFIG_SENSORS_WM831X=m
CONFIG_SENSORS_LM73=m
CONFIG_SENSORS_AMC6821=m
CONFIG_SENSORS_INA2XX=m
+CONFIG_SENSORS_INA209=m
CONFIG_SENSORS_ADT7411=m
CONFIG_SENSORS_ASC7621=m
CONFIG_SENSORS_EMC1403=m
@@ -2371,6 +2396,7 @@ CONFIG_SENSORS_MAX197=m
# CONFIG_USB_SWITCH_FSA9480 is not set
CONFIG_SERIAL_ARC=m
CONFIG_SERIAL_ARC_NR_PORTS=1
+# CONFIG_SERIAL_RP2 is not set
CONFIG_W1=m
CONFIG_W1_CON=y
@@ -2382,6 +2408,7 @@ CONFIG_W1_MASTER_DS1WM=m
CONFIG_W1_SLAVE_THERM=m
CONFIG_W1_SLAVE_SMEM=m
CONFIG_W1_SLAVE_DS2408=m
+CONFIG_W1_SLAVE_DS2413=m
CONFIG_W1_SLAVE_DS2423=m
CONFIG_W1_SLAVE_DS2431=m
CONFIG_W1_SLAVE_DS2433=m
@@ -2457,6 +2484,7 @@ CONFIG_HW_RANDOM_TPM=m
# CONFIG_GEN_RTC is not set
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
+# CONFIG_RTC_SYSTOHC is not set
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
@@ -2501,6 +2529,10 @@ CONFIG_RTC_DRV_MSM6242=m
CONFIG_RTC_DRV_RP5C01=m
CONFIG_RTC_DRV_EM3027=m
CONFIG_RTC_DRV_RV3029C2=m
+CONFIG_RTC_DRV_PCF50633=m
+CONFIG_RTC_DRV_DS3232=m
+CONFIG_RTC_DRV_ISL12022=m
+# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
CONFIG_R3964=m
# CONFIG_APPLICOM is not set
@@ -2534,6 +2566,7 @@ CONFIG_DRM_CIRRUS_QEMU=m # do not enable on f17 or older
# CONFIG_DRM_R128 is not set
CONFIG_DRM_RADEON=m
CONFIG_DRM_RADEON_KMS=y
+# CONFIG_DRM_RADEON_UMS is not set
# CONFIG_DRM_I810 is not set
# CONFIG_DRM_MGA is not set
CONFIG_DRM_MGAG200=m # do not enable on f17 or older
@@ -2550,10 +2583,12 @@ CONFIG_DRM_NOUVEAU_DEBUG=y
# CONFIG_DRM_PSB is not set
CONFIG_DRM_I2C_CH7006=m
CONFIG_DRM_I2C_SIL164=m
+CONFIG_DRM_I2C_NXP_TDA998X=m
CONFIG_DRM_UDL=m
CONFIG_DRM_VMWGFX=m
CONFIG_DRM_VMWGFX_FBCON=y
CONFIG_DRM_VGEM=m
+CONFIG_DRM_QXL=m
#
# PCMCIA character devices
@@ -2584,6 +2619,7 @@ CONFIG_VIDEO_DEV=m
# CONFIG_VIDEO_ADV_DEBUG is not set
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_V4L2=y
+# CONFIG_VIDEO_V4L2_INT_DEVICE is not set
CONFIG_VIDEO_V4L2_SUBDEV_API=y
# CONFIG_VIDEO_VIVI is not set
@@ -2598,6 +2634,7 @@ CONFIG_V4L_USB_DRIVERS=y
CONFIG_VIDEO_CAPTURE_DRIVERS=y
CONFIG_V4L_PCI_DRIVERS=y
CONFIG_VIDEO_AU0828=m
+CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_BT848=m
CONFIG_VIDEO_BT848_DVB=y
CONFIG_VIDEO_BWQCAM=m
@@ -2816,6 +2853,7 @@ CONFIG_IR_GPIO_CIR=m
CONFIG_V4L_MEM2MEM_DRIVERS=y
# CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set
+# CONFIG_VIDEO_SH_VEU is not set
# CONFIG_V4L_TEST_DRIVERS is not set
# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set
@@ -2901,6 +2939,7 @@ CONFIG_FB_EFI=y
# CONFIG_FB_TMIO is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_UDL is not set
+# CONFIG_FB_GOLDFISH is not set
# CONFIG_FIRMWARE_EDID is not set
@@ -3025,6 +3064,7 @@ CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_CODEC_CA0132=y
+CONFIG_SND_HDA_CODEC_CA0132_DSP=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
@@ -3209,9 +3249,11 @@ CONFIG_HID_ROCCAT_KONE=m
CONFIG_HID_SAMSUNG=m
CONFIG_HID_SONY=m
CONFIG_HID_SUNPLUS=m
+CONFIG_HID_STEELSERIES=m
CONFIG_HID_GREENASIA=m
CONFIG_HID_SMARTJOYPLUS=m
CONFIG_HID_TOPSEED=m
+CONFIG_HID_THINGM=m
CONFIG_HID_THRUSTMASTER=m
CONFIG_HID_ZEROPLUS=m
CONFIG_HID_ZYDACRON=m
@@ -3320,6 +3362,7 @@ CONFIG_USB_RTL8150=m
CONFIG_USB_USBNET=m
CONFIG_USB_SPEEDTOUCH=m
CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_AX88179_178A=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_GL620A=m
@@ -3429,6 +3472,7 @@ CONFIG_USB_SERIAL_WHITEHEAT=m
CONFIG_USB_SERIAL_XIRCOM=m
CONFIG_USB_SERIAL_QCAUX=m
CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m
+CONFIG_USB_SERIAL_XSENS_MT=m
CONFIG_USB_SERIAL_DEBUG=m
CONFIG_USB_SERIAL_SSU100=m
CONFIG_USB_SERIAL_QT2=m
@@ -3450,6 +3494,8 @@ CONFIG_USB_SEVSEG=m
CONFIG_USB_ALI_M5632=y
CONFIG_USB_APPLEDISPLAY=m
# CONFIG_OMAP_USB2 is not set
+# CONFIG_OMAP_USB3 is not set
+# CONFIG_OMAP_CONTROL_USB is not set
CONFIG_USB_RCAR_PHY=m
CONFIG_USB_ATM=m
CONFIG_USB_CXACRU=m
@@ -3470,6 +3516,7 @@ CONFIG_USB_IOWARRIOR=m
CONFIG_USB_ISIGHTFW=m
CONFIG_USB_YUREX=m
CONFIG_USB_EZUSB_FX2=m
+CONFIG_USB_HSIC_USB3503=m
CONFIG_USB_LCD=m
CONFIG_USB_LD=m
CONFIG_USB_LEGOTOWER=m
@@ -3482,6 +3529,7 @@ CONFIG_USB_SISUSBVGA=m
CONFIG_USB_SISUSBVGA_CON=y
CONFIG_RADIO_SI470X=y
CONFIG_USB_KEENE=m
+CONFIG_USB_MA901=m
CONFIG_USB_SI470X=m
CONFIG_I2C_SI470X=m
CONFIG_RADIO_SI4713=m
@@ -3520,9 +3568,6 @@ CONFIG_PCF50633_GPIO=m
# CONFIG_AB3100_CORE is not set
CONFIG_INPUT_PCF50633_PMU=m
CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
-CONFIG_RTC_DRV_PCF50633=m
-CONFIG_RTC_DRV_DS3232=m
-CONFIG_RTC_DRV_ISL12022=m
CONFIG_MFD_SUPPORT=y
CONFIG_MFD_VX855=m
@@ -3629,7 +3674,7 @@ CONFIG_CACHEFILES=m
#
# CD-ROM/DVD Filesystems
#
-CONFIG_ISO9660_FS=y
+CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
@@ -3663,6 +3708,7 @@ CONFIG_DEBUG_FS=y
# CONFIG_ADFS_FS is not set
CONFIG_AFFS_FS=m
CONFIG_ECRYPT_FS=m
+# CONFIG_ECRYPT_FS_MESSAGING is not set
CONFIG_HFS_FS=m
CONFIG_HFSPLUS_FS=m
CONFIG_BEFS_FS=m
@@ -3785,7 +3831,8 @@ CONFIG_AMIGA_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_EFI_PARTITION=y
CONFIG_KARMA_PARTITION=y
-# CONFIG_LDM_PARTITION is not set
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_MINIX_SUBPARTITION=y
@@ -3905,6 +3952,7 @@ CONFIG_LOCKUP_DETECTOR=y
# CONFIG_DEBUG_INFO_REDUCED is not set
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
+# CONFIG_PANIC_ON_OOPS is not set
CONFIG_ATOMIC64_SELFTEST=y
CONFIG_MEMORY_FAILURE=y
CONFIG_HWPOISON_INJECT=m
@@ -3980,6 +4028,7 @@ CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_CRC32=m
CONFIG_CRYPTO_CTR=y
CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_DEFLATE=m
@@ -4119,9 +4168,10 @@ CONFIG_HWMON=y
CONFIG_THERMAL_HWMON=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
-CONFIG_FAIR_SHARE=y
-CONFIG_STEP_WISE=y
-# CONFIG_USER_SPACE is not set
+CONFIG_THERMAL_GOV_FAIR_SHARE=y
+# CONFIG_THERMAL_GOV_USER_SPACE is not set
+CONFIG_THERMAL_GOV_STEP_WISE=y
+# CONFIG_THERMAL_EMULATION is not set
# CONFIG_CPU_THERMAL is not set
CONFIG_INOTIFY=y
@@ -4216,6 +4266,7 @@ CONFIG_LEDS_DELL_NETBOOKS=m
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_OT200 is not set
+# CONFIG_LEDS_PWM is not set
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=m
CONFIG_LEDS_TRIGGER_ONESHOT=m
@@ -4244,6 +4295,7 @@ CONFIG_LEDS_WM831X_STATUS=m
CONFIG_DMADEVICES=y
CONFIG_DMA_ENGINE=y
CONFIG_DW_DMAC=m
+# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set
# CONFIG_TIMB_DMA is not set
# CONFIG_DMATEST is not set
CONFIG_ASYNC_TX_DMA=y
@@ -4257,6 +4309,7 @@ CONFIG_DYNAMIC_FTRACE=y
# CONFIG_IRQSOFF_TRACER is not set
CONFIG_SCHED_TRACER=y
CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_TRACER_SNAPSHOT=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_FTRACE_MCOUNT_RECORD=y
# CONFIG_FTRACE_STARTUP_TEST is not set
@@ -4304,6 +4357,7 @@ CONFIG_APM_POWER=m
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_BATTERY_GOLDFISH is not set
# CONFIG_CHARGER_ISP1704 is not set
# CONFIG_CHARGER_MAX8903 is not set
@@ -4349,9 +4403,6 @@ CONFIG_LIRC_TTUSBIR=m
# CONFIG_DEVKMEM is not set
-CONFIG_BNX2X=m
-CONFIG_SCSI_BNX2X_FCOE=m
-
CONFIG_NOZOMI=m
# CONFIG_TPS65010 is not set
@@ -4397,6 +4448,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=m
# CONFIG_PHONET is not set
# CONFIG_ICS932S401 is not set
+# CONFIG_ATMEL_SSC is not set
# CONFIG_C2PORT is not set
@@ -4410,7 +4462,7 @@ CONFIG_WM8350_POWER=m
CONFIG_USB_WUSB=m
CONFIG_USB_WUSB_CBAF=m
# CONFIG_USB_WUSB_CBAF_DEBUG is not set
-CONFIG_USB_WHCI_HCD=m
+# CONFIG_USB_WHCI_HCD is not set
CONFIG_USB_HWA_HCD=m
# CONFIG_USB_HCD_BCMA is not set
# CONFIG_USB_HCD_SSB is not set
@@ -4421,7 +4473,6 @@ CONFIG_UWB_WHCI=m
CONFIG_UWB_I1480U=m
CONFIG_STAGING=y
-# CONFIG_RTLLIB is not set
# CONFIG_ANDROID is not set
CONFIG_STAGING_MEDIA=y
# CONFIG_DVB_AS102 is not set
@@ -4450,7 +4501,12 @@ CONFIG_USB_ATMEL=m
# CONFIG_RAR_REGISTER is not set
# CONFIG_VT6656 is not set
# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
-# CONFIG_RTL8192E is not set
+# Larry Finger maintains these (rhbz 913753)
+CONFIG_RTLLIB=m
+CONFIG_RTLLIB_CRYPTO_CCMP=m
+CONFIG_RTLLIB_CRYPTO_TKIP=m
+CONFIG_RTLLIB_CRYPTO_WEP=m
+CONFIG_RTL8192E=m
# CONFIG_INPUT_GPIO is not set
# CONFIG_VIDEO_CX25821 is not set
# CONFIG_R8187SE is not set
@@ -4601,6 +4657,13 @@ CONFIG_GPIO_VIPERBOARD=m
CONFIG_EVENT_POWER_TRACING_DEPRECATED=y
CONFIG_TEST_KSTRTOX=y
+CONFIG_XZ_DEC=y
+# CONFIG_XZ_DEC_X86 is not set
+# CONFIG_XZ_DEC_POWERPC is not set
+# CONFIG_XZ_DEC_IA64 is not set
+# CONFIG_XZ_DEC_ARM is not set
+# CONFIG_XZ_DEC_ARMTHUMB is not set
+# CONFIG_XZ_DEC_SPARC is not set
# CONFIG_XZ_DEC_TEST is not set
# CONFIG_POWER_AVS is not set
@@ -4623,6 +4686,7 @@ CONFIG_PSTORE_RAM=m
# CONFIG_AVERAGE is not set
+# CONFIG_VMXNET3 is not set
# CONFIG_SIGMA is not set
@@ -4640,6 +4704,8 @@ CONFIG_BCMA_DRIVER_GPIO=y
# CONFIG_INTEL_MID_PTI is not set
CONFIG_IOMMU_SUPPORT=y
+# CONFIG_MAILBOX is not set
+
# CONFIG_HSI is not set
# CONFIG_PM_DEVFREQ is not set
diff --git a/freed-ora/current/master/config-nodebug b/freed-ora/current/master/config-nodebug
index c471b853e..aa7568c82 100644
--- a/freed-ora/current/master/config-nodebug
+++ b/freed-ora/current/master/config-nodebug
@@ -96,6 +96,7 @@ CONFIG_PCI_DEFAULT_USE_CRS=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
+CONFIG_KDB_CONTINUE_CATASTROPHIC=0
# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
# CONFIG_TEST_LIST_SORT is not set
@@ -114,3 +115,5 @@ CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_EDAC_DEBUG is not set
+
+# CONFIG_SPI_DEBUG is not set
diff --git a/freed-ora/current/master/config-powerpc-generic b/freed-ora/current/master/config-powerpc-generic
index 902dccdee..b6df88ea8 100644
--- a/freed-ora/current/master/config-powerpc-generic
+++ b/freed-ora/current/master/config-powerpc-generic
@@ -39,6 +39,7 @@ CONFIG_FB_OF=y
# CONFIG_FB_CONTROL is not set
CONFIG_FB_IBM_GXT4500=y
CONFIG_FB_MATROX=y
+CONFIG_FB_MATROX_G=y
# CONFIG_FB_VGA16 is not set
CONFIG_FB_ATY128_BACKLIGHT=y
CONFIG_FB_ATY_BACKLIGHT=y
@@ -345,6 +346,7 @@ CONFIG_I2C_MPC=m
CONFIG_RFKILL_GPIO=m
# CONFIG_CRYPTO_DEV_FSL_CAAM is not set
+# CONFIG_CRYPTO_SHA1_PPC is not set
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_MCP23S08 is not set
@@ -380,8 +382,13 @@ CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RTC_DRV_SNVS is not set
# CONFIG_ASYMMETRIC_KEY_TYPE is not set
+# CONFIG_OF_DISPLAY_TIMING is not set
+# CONFIG_OF_VIDEOMODE is not set
+
CONFIG_POWER_RESET_GPIO=y
CONFIG_FB_SSD1307=m
CONFIG_INPUT_PWM_BEEPER=m
CONFIG_BACKLIGHT_PWM=m
CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=n
+
+CONFIG_XZ_DEC_POWERPC=y
diff --git a/freed-ora/current/master/config-powerpc64 b/freed-ora/current/master/config-powerpc64
index 7c0477cf1..d0e0aab5b 100644
--- a/freed-ora/current/master/config-powerpc64
+++ b/freed-ora/current/master/config-powerpc64
@@ -178,4 +178,6 @@ CONFIG_BPF_JIT=y
# CONFIG_PPC_ICSWX_USE_SIGILL is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_PCIEPORTBUS is not set
-
+# CONFIG_PPC_TRANSACTIONAL_MEM is not set
+# CONFIG_SND_HDA_INTEL is not set
+CONFIG_BLK_DEV_RSXX=m
diff --git a/freed-ora/current/master/config-powerpc64p7 b/freed-ora/current/master/config-powerpc64p7
index 9a8289588..285d9fff9 100644
--- a/freed-ora/current/master/config-powerpc64p7
+++ b/freed-ora/current/master/config-powerpc64p7
@@ -169,4 +169,5 @@ CONFIG_BPF_JIT=y
# CONFIG_PPC_ICSWX_USE_SIGILL is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_PCIEPORTBUS is not set
-
+# CONFIG_SND_HDA_INTEL is not set
+CONFIG_BLK_DEV_RSXX=m
diff --git a/freed-ora/current/master/config-s390x b/freed-ora/current/master/config-s390x
index c0ae0aa0a..99c16ef96 100644
--- a/freed-ora/current/master/config-s390x
+++ b/freed-ora/current/master/config-s390x
@@ -260,6 +260,14 @@ CONFIG_HOTPLUG_PCI_S390=m
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_MCP23S08 is not set
-# CONFIG_PCI is not set
-# CONFIG_NET_VENDOR_MARVELL is not set
-# CONFIG_PTP_1588_CLOCK_PCH is not set
+# CONFIG_MEDIA_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_DRM is not set
+# CONFIG_SOUND is not set
+# CONFIG_DW_DMAC is not set
+# CONFIG_I2C_SMBUS is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_HELPER_AUTO is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_NFORCE2 is not set
diff --git a/freed-ora/current/master/config-x86-32-generic b/freed-ora/current/master/config-x86-32-generic
index 0e9b3f4be..6b6c60d30 100644
--- a/freed-ora/current/master/config-x86-32-generic
+++ b/freed-ora/current/master/config-x86-32-generic
@@ -3,6 +3,7 @@
CONFIG_X86_32_NON_STANDARD=y
# CONFIG_X86_ELAN is not set
+# CONFIG_X86_GOLDFISH is not set
# CONFIG_X86_NUMAQ is not set
# CONFIG_X86_SUMMIT is not set
CONFIG_X86_BIGSMP=y
@@ -227,3 +228,5 @@ CONFIG_BACKLIGHT_PWM=m
# CONFIG_GPIO_ADNP is not set
# CONFIG_BACKLIGHT_OT200 is not set
# CONFIG_RTC_DRV_SNVS is not set
+# CONFIG_OF_DISPLAY_TIMING is not set
+# CONFIG_OF_VIDEOMODE is not set
diff --git a/freed-ora/current/master/config-x86-generic b/freed-ora/current/master/config-x86-generic
index 45552bd23..7820755c7 100644
--- a/freed-ora/current/master/config-x86-generic
+++ b/freed-ora/current/master/config-x86-generic
@@ -14,6 +14,7 @@ CONFIG_I8K=m
CONFIG_SONYPI_COMPAT=y
CONFIG_MICROCODE=m
CONFIG_MICROCODE_INTEL=y
+CONFIG_MICROCODE_INTEL_EARLY=y
CONFIG_MICROCODE_AMD=y
CONFIG_X86_MSR=y
@@ -36,6 +37,8 @@ CONFIG_X86_PM_TIMER=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_VARS=y
+CONFIG_EFI_VARS_PSTORE=y
+CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y
CONFIG_EFI_PCDP=y
CONFIG_FB_EFI=y
@@ -67,7 +70,7 @@ CONFIG_ACPI_AC=y
# CONFIG_ACPI_ASUS is not set
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
-CONFIG_ACPI_CONTAINER=m
+CONFIG_ACPI_CONTAINER=y
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_NUMA=y
@@ -94,11 +97,12 @@ CONFIG_ACPI_IPMI=m
CONFIG_ACPI_CUSTOM_METHOD=m
CONFIG_ACPI_BGRT=y
-CONFIG_X86_ACPI_CPUFREQ=y
-CONFIG_X86_PCC_CPUFREQ=y
+CONFIG_X86_INTEL_PSTATE=y
+CONFIG_X86_ACPI_CPUFREQ=m
CONFIG_X86_ACPI_CPUFREQ_CPB=y
-CONFIG_X86_POWERNOW_K8=y
-CONFIG_X86_P4_CLOCKMOD=y
+CONFIG_X86_PCC_CPUFREQ=m
+CONFIG_X86_POWERNOW_K8=m
+CONFIG_X86_P4_CLOCKMOD=m
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
#
@@ -142,6 +146,7 @@ CONFIG_I2C_AMD756_S4882=m
CONFIG_I2C_AMD8111=m
CONFIG_I2C_I801=m
CONFIG_I2C_ISCH=m
+CONFIG_I2C_ISMT=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_NFORCE2_S4985=m
CONFIG_I2C_PIIX4=m
@@ -194,6 +199,7 @@ CONFIG_AMILO_RFKILL=m
CONFIG_ASUS_LAPTOP=m
CONFIG_COMPAL_LAPTOP=m
CONFIG_DELL_LAPTOP=m
+CONFIG_CHROMEOS_LAPTOP=m
CONFIG_EEEPC_LAPTOP=m
CONFIG_FUJITSU_TABLET=m
CONFIG_FUJITSU_LAPTOP=m
@@ -346,7 +352,7 @@ CONFIG_PERF_EVENTS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
-# CONFIG_X86_MCE_INJECT is not set
+CONFIG_X86_MCE_INJECT=m
CONFIG_SFI=y
@@ -364,6 +370,7 @@ CONFIG_LPC_SCH=m
CONFIG_LPC_ICH=m
CONFIG_GPIO_ICH=m
+# CONFIG_GPIO_LYNXPOINT is not set
CONFIG_PCI_CNB20LE_QUIRK=y
@@ -394,6 +401,7 @@ CONFIG_PCH_PHUB=m
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_SERPENT_SSE2_586=m
+CONFIG_CRYPTO_CRC32_PCLMUL=m
CONFIG_HP_ACCEL=m
@@ -423,17 +431,31 @@ CONFIG_DRM_GMA3600=y
CONFIG_RCU_FANOUT_LEAF=16
CONFIG_INTEL_MEI=m
+CONFIG_INTEL_MEI_ME=y
# Maybe enable in debug kernels?
# CONFIG_DEBUG_NMI_SELFTEST is not set
+# CONFIG_X86_INTEL_LPSS is not set
+
+# CONFIG_INTEL_POWERCLAMP is not set
+
+CONFIG_VMWARE_VMCI=m
+CONFIG_VMWARE_VMCI_VSOCKETS=m
+
+CONFIG_XZ_DEC_X86=y
+
CONFIG_MPILIB=y
CONFIG_PKCS7_MESSAGE_PARSER=y
CONFIG_PE_FILE_PARSER=y
CONFIG_MODULE_SIG=y
+CONFIG_MODULE_SIG_ALL=y
# CONFIG_MODULE_SIG_SHA1 is not set
CONFIG_MODULE_SIG_SHA256=y
# CONFIG_MODULE_SIG_FORCE is not set
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
CONFIG_MODULE_SIG_UEFI=y
+
+CONFIG_VMXNET3=m
+CONFIG_VFIO_PCI_VGA=y
diff --git a/freed-ora/current/master/config-x86_64-generic b/freed-ora/current/master/config-x86_64-generic
index 54403ba68..92f283073 100644
--- a/freed-ora/current/master/config-x86_64-generic
+++ b/freed-ora/current/master/config-x86_64-generic
@@ -97,6 +97,7 @@ CONFIG_XEN_MAX_DOMAIN_MEMORY=128
CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_SYS_HYPERVISOR=y
# CONFIG_XEN_MCE_LOG is not set
+# CONFIG_XEN_STUB is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
@@ -133,3 +134,26 @@ CONFIG_CHECKPOINT_RESTORE=y
# Should be 32bit only, but lacks KConfig depends
# CONFIG_XO15_EBOOK is not set
+CONFIG_NTB=m
+CONFIG_NTB_NETDEV=m
+
+CONFIG_SFC=m
+CONFIG_SFC_MCDI_MON=y
+CONFIG_SFC_SRIOV=y
+CONFIG_SFC_PTP=y
+
+# 10GigE
+#
+CONFIG_IP1000=m
+CONFIG_MLX4_EN=m
+CONFIG_MLX4_EN_DCB=y
+# CONFIG_MLX4_DEBUG is not set
+CONFIG_SFC=m
+CONFIG_SFC_MCDI_MON=y
+CONFIG_SFC_SRIOV=y
+CONFIG_SFC_PTP=y
+CONFIG_SFC_MTD=y
+# Override MTD stuff because SFC_MTD needs it
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLOCK=m
+
diff --git a/freed-ora/current/master/deblob-3.8 b/freed-ora/current/master/deblob-3.9
index 31417db08..684190ae7 100755
--- a/freed-ora/current/master/deblob-3.8
+++ b/freed-ora/current/master/deblob-3.9
@@ -48,7 +48,7 @@
# For each kver release, start extra with an empty string, then count
# from 1 if changes are needed that require rebuilding the tarball.
-kver=3.8 extra=
+kver=3.9 extra=
case $1 in
--force)
@@ -452,6 +452,12 @@ clean_blob arch/x86/kernel/microcode_intel.c
clean_kconfig arch/x86/Kconfig 'MICROCODE_INTEL'
clean_mk CONFIG_MICROCODE_INTEL arch/x86/kernel/Makefile
+announce MICROCODE_INTEL_EARLY - "Ă‹arly load microcode"
+clean_blob arch/x86/kernel/microcode_intel_early.c
+clean_blob Documentation/x86/early-microcode.txt
+clean_kconfig arch/x86/Kconfig 'MICROCODE_INTEL_EARLY'
+clean_mk CONFIG_MICROCODE_INTEL_EARLY arch/x86/kernel/Makefile
+
# arm
announce IXP4XX_NPE - "IXP4xx Network Processor Engine support"
@@ -606,7 +612,7 @@ clean_blob arch/arm/mach-imx/mm-imx3.c
clean_blob arch/arm/mach-imx/mm-imx5.c
clean_blob arch/arm/boot/dts/imx51.dtsi
clean_blob arch/arm/boot/dts/imx53.dtsi
-clean_blob arch/arm/boot/dts/imx6q.dtsi
+clean_blob arch/arm/boot/dts/imx6qdl.dtsi
clean_blob Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
clean_kconfig drivers/dma/Kconfig 'IMX_SDMA'
clean_mk CONFIG_IMX_SDMA drivers/dma/Makefile
@@ -1028,6 +1034,7 @@ reject_firmware drivers/media/pci/cx23885/cx23885-417.c
clean_blob drivers/media/pci/cx23885/cx23885-417.c
reject_firmware drivers/media/pci/cx23885/cx23885-cards.c
clean_blob drivers/media/pci/cx23885/cx23885-cards.c
+clean_blob drivers/media/pci/cx23885/cx23885-video.c
clean_kconfig drivers/media/pci/cx23885/Kconfig 'VIDEO_CX23885'
clean_mk CONFIG_VIDEO_CX23885 drivers/media/pci/cx23885/Makefile
@@ -1094,6 +1101,12 @@ clean_blob drivers/media/usb/tlg2300/pd-main.c
clean_kconfig drivers/media/usb/tlg2300/Kconfig 'VIDEO_TLG2300'
clean_mk CONFIG_VIDEO_TLG2300 drivers/media/usb/tlg2300/Makefile
+announce VIDEO_S5C73M3 - "Samsung S5C73M3 sensor support"
+reject_firmware drivers/media/i2c/s5c73m3/s5c73m3-core.c
+clean_blob drivers/media/i2c/s5c73m3/s5c73m3-core.c
+clean_kconfig drivers/media/i2c/Kconfig 'VIDEO_S5C73M3'
+clean_mk CONFIG_VIDEO_S5C73M3 drivers/media/i2c/s5c73m3/Makefile
+
announce VIDEO_S5K4ECGX - "Samsung S5K4ECGX sensor support"
reject_firmware drivers/media/i2c/s5k4ecgx.c
clean_blob drivers/media/i2c/s5k4ecgx.c
@@ -1187,14 +1200,14 @@ clean_sed '
}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 'report missing Free firmware'
clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
clean_sed '
-/^bool bnx2x_test_firmware_version/,/^}$/{
- /^ u32 my_fw = /i\
- /*(DEBLOBBED)*/
- /^ u32 my_fw = /,/<< 24);/d;
- /^ u32 loaded_fw = /,/^$/{
+/^int bnx2x_nic_load_analyze_req/,/^}$/{
+ /^ u32 my_fw = /i\
+ /*(DEBLOBBED)*/
+ /^ u32 my_fw = /,/<< 24);/d;
+ /^ u32 loaded_fw = /,/^$/{
/^$/i\
\
- u32 my_fw = ~loaded_fw;
+ u32 my_fw = ~loaded_fw;
}
}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c 'fail already-loaded test'
clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
@@ -1288,8 +1301,10 @@ clean_mk CONFIG_NETXEN_NIC drivers/net/ethernet/qlogic/Makefile
announce QLCNIC - "QLOGIC QLCNIC 1/10Gb Converged Ethernet NIC Support"
reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
clean_blob drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+clean_blob drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
clean_blob drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
clean_kconfig drivers/net/ethernet/qlogic/Kconfig 'QLCNIC'
clean_mk CONFIG_QLCNIC drivers/net/ethernet/qlogic/qlcnic/Makefile
@@ -1567,6 +1582,7 @@ reject_firmware drivers/net/wireless/iwlwifi/iwl-drv.c
clean_blob drivers/net/wireless/iwlwifi/iwl-drv.c
clean_blob drivers/net/wireless/iwlwifi/pcie/5000.c
clean_blob drivers/net/wireless/iwlwifi/pcie/6000.c
+clean_blob drivers/net/wireless/iwlwifi/pcie/7000.c
clean_blob drivers/net/wireless/iwlwifi/pcie/1000.c
clean_blob drivers/net/wireless/iwlwifi/pcie/2000.c
clean_kconfig drivers/net/wireless/iwlwifi/Kconfig 'IWLWIFI'
@@ -1665,17 +1681,6 @@ clean_blob drivers/net/wireless/ath/ath6kl/usb.c
clean_kconfig drivers/net/wireless/ath/ath6kl/Kconfig 'ATH6KL_USB'
clean_mk CONFIG_ATH6KL_USB drivers/net/wireless/ath/ath6kl/Makefile
-announce ATH9K - "Atheros 802.11n wireless cards support"
-reject_firmware drivers/net/wireless/ath/ath9k/init.c
-clean_kconfig drivers/net/wireless/ath/ath9k/Kconfig 'ATH9K'
-clean_mk CONFIG_ATH9K drivers/net/wireless/ath/ath9k/Makefile
-
-announce ATH9K_HTC - "Atheros HTC based wireless cards support"
-reject_firmware drivers/net/wireless/ath/ath9k/hif_usb.c
-clean_blob drivers/net/wireless/ath/ath9k/hif_usb.c
-clean_kconfig drivers/net/wireless/ath/ath9k/Kconfig 'ATH9K_HTC'
-clean_mk CONFIG_ATH9K_HTC drivers/net/wireless/ath/ath9k/Makefile
-
announce PRISM2_USB - "Prism2.5/3 USB driver"
reject_firmware drivers/staging/wlan-ng/prism2fw.c
clean_blob drivers/staging/wlan-ng/prism2fw.c
@@ -1982,6 +1987,33 @@ clean_blob drivers/tty/serial/ucc_uart.c
clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_QE'
clean_mk CONFIG_SERIAL_QE drivers/tty/serial/Makefile
+announce SERIAL_RP2 - "Comtrol RocketPort EXPRESS/INFINITY support"
+reject_firmware drivers/tty/serial/rp2.c
+clean_blob drivers/tty/serial/rp2.c
+clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_RP2'
+clean_mk CONFIG_SERIAL_RP2 drivers/tty/serial/Makefile
+
+########
+# Leds #
+########
+
+announce LEDS_LP55XX_COMMON - "Common Driver for TI/National LP5521 and LP5523/55231"
+reject_firmware drivers/leds/leds-lp55xx-common.c
+clean_kconfig drivers/leds/Kconfig 'LEDS_LP55XX_COMMON'
+clean_mk CONFIG_LEDS_LP55XX_COMMON drivers/leds/Makefile
+
+announce LEDS_LP5521 - "LED Support for N.S. LP5521 LED driver chip"
+# The blob name is the chip name; no point in deblobbing that.
+# clean_blob drivers/leds/leds-lp5521.c
+clean_kconfig drivers/leds/Kconfig 'LEDS_LP5521'
+clean_mk CONFIG_LEDS_LP5521 drivers/leds/Makefile
+
+announce LEDS_LP5523 - "LED Support for TI/National LP5523/55231 LED driver chip"
+# The blob name is the chip name; no point in deblobbing that.
+# clean_blob drivers/leds/leds-lp5523.c
+clean_kconfig drivers/leds/Kconfig 'LEDS_LP5523'
+clean_mk CONFIG_LEDS_LP5523 drivers/leds/Makefile
+
#########
# input #
#########
@@ -2295,9 +2327,15 @@ clean_mk CONFIG_UWB_I1480U drivers/uwb/i1480/dfu/Makefile
-##############
-# RemoteProc #
-##############
+################
+# Programmable #
+################
+
+announce LATTICE_ECP3_CONFIG - "Lattice ECP3 FPGA bitstrap configuration via SPI"
+reject_firmware drivers/misc/lattice-ecp3-config.c
+clean_blob drivers/misc/lattice-ecp3-config.c
+clean_kconfig drivers/misc/Kconfig 'LATTICE_ECP3_CONFIG'
+clean_mk CONFIG_LATTICE_ECP3_CONFIG drivers/misc/Makefile
announce STE_MODEM_RPROC - "STE-Modem remoteproc support"
maybe_reject_firmware drivers/remoteproc/remoteproc_core.c
@@ -2497,6 +2535,17 @@ clean_mk CONFIG_SND_RIPTIDE sound/pci/riptide/Makefile
#reject_firmware sound/pci/hda/hda_hwdep.c
#clean_kconfig sound/pci/hda/Kconfig 'SND_HDA_PATCH_LOADER'
+announce SND_HDA_CODEC_CA0132_DSP - "Support new DSP code for CA0132 codec"
+reject_firmware sound/pci/hda/patch_ca0132.c
+clean_blob sound/pci/hda/patch_ca0132.c
+clean_sed '
+/^config SND_HDA_CODEC_CA0132_DSP$/, /^config / {
+ s,(ctefx.bin),(/*(DEBLOBBED)*/),;
+}' sound/pci/hda/Kconfig 'removed blob name'
+clean_kconfig sound/pci/hda/Kconfig 'SND_HDA_CODEC_CA0132_DSP'
+# There are no separate source files or Makefile entries for the _DSP option.
+clean_mk CONFIG_SND_HDA_CODEC_CA0132 sound/pci/hda/Makefile
+
announce SND_HDSP - "RME Hammerfall DSP Audio"
reject_firmware sound/pci/rme9652/hdsp.c
clean_blob sound/pci/rme9652/hdsp.c
diff --git a/freed-ora/current/master/deblob-check b/freed-ora/current/master/deblob-check
index ee62c57fa..ce469b9cb 100755
--- a/freed-ora/current/master/deblob-check
+++ b/freed-ora/current/master/deblob-check
@@ -1,6 +1,6 @@
#! /bin/sh
-# deblob-check version 2013-02-06
+# deblob-check version 2013-04-28
# Inspired in gNewSense's find-firmware script.
# Written by Alexandre Oliva <lxoliva@fsfla.org>
@@ -1878,7 +1878,7 @@ set_except () {
initnc '[ ][ ]static[ ]unsigned[ ]char[ ]const[ ]data_bit\[64\][ ]='
initnc '[ ][ ]static[ ]const[ ]u8[ ]data_sbit\[32\][ ]='
initnc '[ ]\.RightCoefs[ ]='
- initnc '[ ]#define[ ]WakeupSeq[ ][ ][ ][ ][{]'
+ defsnc '[ ]#define[ ]WakeupSeq[ ][ ][ ][ ][{]' drivers/net/ethernet/i825xx/eepro.c
initnc '[ ]SetRate44100\[\][ ]='
initnc '[ ]const[ ]short[ ]period\[32\][ ]='
defsnc '[ ]\(const[ ]static\|static[ ]const\)[ ]int[ ]desc_idx_table\[\][ ]=' 'arch/arm/include/asm/hardware/iop3xx-adma.h|include/asm-arm/hardware/iop3xx-adma.h'
@@ -1901,7 +1901,7 @@ set_except () {
defsnc '[ ]static[ ]u16[ ]tables\[\][ ]=' drivers/media/pci/meye/meye.c
initnc '[ ]static[ ]u32[ ]logMagTable\[128\][ ]='
defsnc '[ ]static[ ]u8[ ]init_bufs\[13\]\[5\][ ]=' drivers/media/pci/cx88/cx88-cards.c
- initnc '[ ]static[ ]u_short[ ]geometry_table\[\]\[[45]\][ ]='
+ defsnc '[ ]static[ ]u_short[ ]geometry_table\[\]\[[45]\][ ]=' drivers/block/xd.c
initnc '[ ]static[ ]unsigned[ ]char[ ]CRCTable1\[\][ ]='
initnc '[ ]static[ ]unsigned[ ]char[ ]CRCTable2\[\][ ]='
initnc '[ ]static[ ]unsigned[ ]char[ ]default_colors\[\][ ]='
@@ -2491,7 +2491,6 @@ set_except () {
defsnc 'static[ ]struct[ ]v_table[ ]v_table\[\][ ]=' drivers/gpu/drm/i915/i915_dma.c
blobname 'orinoco_ezusb_fw' drivers/net/wireless/orinoco/orinoco_usb.c
defsc 'static[ ]const[ ]struct[ ]ar9300_eeprom[ ]ar9300_default[ ]=' drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
- blobname 'ar9271[.]fw' drivers/net/wireless/ath/ath9k/hif_usb.c
accept '[ ]hif_dev->firmware[ ]=[ ]NULL[;]' drivers/net/wireless/ath/ath9k/hif_usb.c
defsnc 'static[ ]const[ ]u32[ ]ar9300_2p[02]_\(radio\|mac\|baseband\)_postamble\[\]\[5\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9003_\(2p[02]_\)\?initvals\.h'
defsnc 'static[ ]const[ ]u32[ ]ar9300Modes_\(\(low\(est\)\?\|high\)_ob_db\|high_power\)_tx_gain_table_2p[02]\[\]\[5\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9003_\(2p[02]_\)\?initvals\.h'
@@ -2555,7 +2554,6 @@ set_except () {
blobname 'lgs8g75\.fw' drivers/media/dvb/frontends/lgs8gxx.c
defsnc 'static[ ]const[ ]struct[ ]ucbus_write_cmd[ ]\(icx098bq\|lz24bp\)_start_[012]\[\][ ]=' drivers/media/video/gspca/sq930x.c
defsnc '[}][ ]capconfig\[4\]\[2\][ ]=' drivers/media/video/gspca/sq930x.c
- blobname 'ar7010\(_1_1\)\?[.]fw' drivers/net/wireless/ath/ath9k/hif_usb.c
defsnc 'static[ ]u8[ ]sa2400_rf_rssi_map\[\][ ]=' drivers/net/wireless/rtl818x/rtl8180_sa2400.c
defsnc 'static[ ]const[ ]unsigned[ ]char[ ]pwm_lookup_table\[256\][ ]=' drivers/platform/x86/compal-laptop.c
defsnc 'static[ ]int[ ]tps6586x_\(ldo4\|sm2\|dvm\)_voltages\[\][ ]=' drivers/regulator/tps6586x-regulator.c
@@ -2845,7 +2843,6 @@ set_except () {
defsnc 'static[ ]struct[ ]pll_limit[ ]\(cle266\|k800\|cx700\|vx855\)_pll_limits\[\][ ]=' drivers/video/via/hw.c
accept '[ ][ ]-e[ ]["][$]tmp_dir[/]lib[/]modules[/][$]KERNELRELEASE[/]modules\.dep\.bin["]' scripts/depmod.sh
blobname 'wm8958_\(enh_eq\|mbc\(_vss\)\?\)\.wfw' sound/soc/codecs/wm8958-dsp2.c
- blobname 'htc_\(7010\|9271\)\.fw' drivers/net/wireless/ath/ath9k/hif_usb.c
blobname 'rtl_nic[/]rtl8168e-[12]\.fw' drivers/net/r8169.c
defsnc '[ ]static[ ]const[ ]struct[ ]ephy_info[ ]e_info_8168e\[\][ ]=' drivers/net/r8169.c
blobname 'ti-connectivity[/]wl128x-fw\(-ap\)\?\.bin' drivers/net/wireless/wl12xx/wl12xx.h
@@ -3256,12 +3253,181 @@ set_except () {
blobname '%s-dsp%d\.\(wmfw\|bin\)' sound/soc/codecs/wm_adsp.c
blobname 'fw-4\.bin' drivers/net/wireless/ath/ath6kl/core.h
accept '[ ]hdsp->firmware[ ]=[ ]fw' sound/pci/rme9652/hdsp.c
+
+ # ath9k firmware is now Free Software.
+ accept '[ ]err[ ]=[ ]request_firmware_nowait[(]THIS_MODULE[,][ ]1[,][ ]name[,][ ]sc->dev[,][ ]GFP_KERNEL[,][\n][ ]*[&]ec[,][ ]ath9k_eeprom_request_cb[)][;]' drivers/net/wireless/ath/ath9k/init.c
+ accept '[#]define[ ]FIRMWARE_AR7010_1_1[ ]*["]htc_7010\.fw["]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[#]define[ ]FIRMWARE_AR9271[ ]*["]htc_9271\.fw["]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept 'MODULE_FIRMWARE[(]FIRMWARE_AR7010_1_1[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept 'MODULE_FIRMWARE[(]FIRMWARE_AR9271[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[ ]ret[ ]=[ ]request_firmware_nowait[(]THIS_MODULE[,][ ]true[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[,][ ]GFP_KERNEL[,][\n][ ]*hif_dev[,][ ]ath9k_hif_usb_firmware_cb[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[ ]ret[ ]=[ ]request_firmware[(][&]hif_dev->firmware[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[ ][ ]ret[ ]=[ ]request_firmware[(][&]fw[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+
+ # New in 3.9
+ blobname 'imx[/]sdma[/]sdma-imx6q\.bin' arch/arm/boot/dts/imx6qdl.dtsi
+ accept '[ ]*nvidia,emc-registers[ ]=[ ]*<\(0x[0-9a-f]*[ \n]*\)*>[;]' arch/arm/boot/dts/tegra20-colibri-512.dtsi
+ blobname 'kernel[/]x86[/]microcode[/]GenuineIntel\.bin' arch/x86/kernel/microcode_intel_early.c
+ accept '[0-9][0-9]*[ ][0-3][ ][0-3][ ]0\([\n][0-9][0-9]*[ ][0-3][ ][0-3][ ]0\)*' Documentation/thermal/intel_powerclamp.txt
+ accept '[ ]return[ ]_request_firmware_load[(]fw_priv[,]' drivers/base/firmware_class.c
+ accept 'static[ ]int[\n]_request_firmware_prepare[(]struct[ ]firmware[ ][*][*]\?firmware_p' drivers/base/firmware_class.c
+ accept '[/][*][ ]called[ ]from[ ]request_firmware[(][)][ ]and[ ]request_firmware_work_func[(][)][ ][*][/]' drivers/base/firmware_class.c
+ accept '[ ]_request_firmware[(][&]fw[,][ ]fw_work->name' drivers/base/firmware_class.c
+ accept '[ ]put_device[(]fw_work->device[)][;][ ][/][*][ ]taken[ ]in[ ]request_firmware_nowait[(][)][ ][*][/]' drivers/base/firmware_class.c
+ defsnc 'static[ ]const[ ]u16[ ]x[48]_vectors\[\][ ]=' drivers/edac/amd64_edac.c
+ defsnc 'static[ ]const[ ]struct[ ]hdmiphy_config[ ]hdmiphy_v14_configs\[\][ ]=' drivers/gpu/drm/exynos/exynos_hdmi.c
+ defsnc 'static[ ]const[ ]u32[ ]oland_io_mc_regs\[TAHITI_IO_MC_REGS_SIZE\]\[2\][ ]=' drivers/gpu/drm/radeon/si.c
+ defsnc 'static[ ]const[ ]u8[ ]sixaxis_rdesc_fixup2\?\[\][ ]=' drivers/hid/hid-sony.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]tuner_init_fc0012\[\][ ]=' drivers/media/dvb-frontends/af9033_priv.h
+ defsnc '\(static[ ]\)\?struct[ ]linear_segments[ ]cnr_\(to_db\|\(64\|16\)qam\|qpsk\)_table\[\][ ]=' drivers/media/dvb-frontends/mb86a20s.c
+ blobname 'SlimISP_\(%\.2s\|..\)\.bin' drivers/media/i2c/s5c73m3/s5c73m3-core.c
+ defsc 'static[ ]const[ ]struct[ ]i2c_rv[ ]ov965x_init_regs\[\][ ]=' drivers/media/i2c/ov9650.c
+ accept 'static[ ]struct[ ]dvb_usb_device_properties[ ]vp7049_properties[ ]=[ ][{][\n]\([ ]\.\(caps\|usb_ctrl\)[ ]*=[ ][^",]*,[\n]*\)*[ ]\.firmware[ ]*=[ ]' drivers/media/dvb/dvb-usb/m920x.c
+ blobname 'dvb-usb-vp7049-0\.95\.fw' drivers/media/dvb/dvb-usb/m920x.c
+ # The blob name is just the chip name, so no point in deblobbing;
+ # more so considering the number of false positives this would
+ # bring about.
+ # blobname 'lp5521' drivers/leds/leds-lp5521.c
+ # blobname 'lp55231\?' drivers/leds/leds-lp5523.c
+ blobname 'lattice-ecp3\.bit' drivers/misc/lattice-ecp3-config.c
+ defsnc '[ ]*static[ ]const[ ]uint8_t[ ]rss_key\[UPT1_RSS_MAX_KEY_SIZE\][ ]=' drivers/net/vmxnet3/vmxnet3_drv.c
+ defsnc 'static[ ]const[ ]u32[ ]ar9300Modes_\(mixed_ob_db\|type5\)_tx_gain_table_2p2\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+ defsnc 'static[ ]const[ ]u32[ ]ar9340Modes_low_ob_db_and_spur_tx_gain_table_1p0\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9340_initvals.h
+ defsnc 'static[ ]const[ ]u32[ ]ar9485Modes_green_spur_ob_db_tx_gain_1_1\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+ defsnc 'static[ ]const[ ]u32[ ]ar9580_1p0_type6_tx_gain_table\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
+ blobname 'iwlwifi-\(7260\|3160\)-' drivers/net/wireless/iwlwifi/pcie/7000.c
+ blobname 'mrvl[/]pcie8897_uapsta\.bin' drivers/net/wireless/mwifiex/pcie.h
+ accept 'static[ ]const[ ]struct[ ]mwifiex_pcie_device[ ]mwifiex_pcie\(8766\|8897\)[ ]=[ ][{][\n][ ]\.firmware[ ]*=' drivers/net/wireless/mwifiex/pcie.h
+ accept '[ ][ ]card->pcie\.firmware[ ]=' drivers/net/wireless/mwifiex/pcie.c
+ accept '[ ][ ]\.per_chan_pwr_limit_arr_11abg[ ]*=[ ][{][ 0xf,\n]*' drivers/net/wireless/ti/wl18xx/main.c
+ blobname 'ti-connectivity[/]wl18xx-fw-2\.bin' drivers/net/wireless/ti/wl18xx/main.c
+ blobname '%s-dsp%d-%s\.\(wmfw\|bin\)' sound/soc/codecs/wm_adsp.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_addr[ ]\(idle_\)\?reg_addrs\[\][ ]=' drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
+ blobname '83xx_fw\.bin' drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+ defsnc 'static[ ]const[ ]unsigned[ ]int[ ]dump_num_registers\[NUM_CHIPS\]\[NUM_PRESETS\][ ]=' drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
+ defsnc 'static[ ]int[ ]pm2xxx_charger_voltage_map\[\][ ]=' drivers/power/pm2301_charger.c
+ accept '[ ][*][ ]comedi[ ]drivers\.[ ]The[ ]request_firmware[(][)][ ]hotplug' drivers/staging/comedi/comedi.h
+ blobname 'rp2\.fw' drivers/tty/serial/rp2.c
+ defsnc 'static[ ]const[ ]unsigned[ ]char[ ]seq_\(w\|rgb\)_gamma\[\][ ]=' drivers/video/backlight/lms501kf03.c
+ defsnc '[#]include[ ]<video[/]mmp_disp\.h>[\n]*static[ ]u16[ ]init\[\][ ]=' drivers/video/mmp/panel/tpo_tj032md01bw.c
+ defsnc 'static[ ]struct[ ]tegra_clk_pll_freq_table[ ]pll_[mpadcu]_freq_table\[\][ ]=' 'drivers/clk/tegra/clk-tegra[23]0\.c'
+ blobname 'ctefx\.bin' sound/pci/hda/patch_ca0132.c
+ defsnc 'static[ ]unsigned[ ]int[ ]\(voice_focus\|mic_svm\|equalizer\)_vals_lookup\[\][ ]=' sound/pci/hda/patch_ca0132.c
+ defsnc 'static[ ]struct[ ]hda_verb[ ]ca0132_init_verbs0\[\][ ]=' sound/pci/hda/patch_ca0132.c
+ defsnc 'static[ ]const[ ]int[ ]dmic_comp\[6\]\[6\][ ]=' sound/soc/codecs/max98090.c
;;
*/*freedo*.patch | */*logo*.patch)
accept 'P[13]\([\n]#[^\n]*\)*[\n]*\([\n][0-9 ]*\)\+' drivers/video/logo/logo_libre_clut224.ppm
;;
+ */patch-3.8*)
+ # Present in 3.8 but patched in stable releases.
+ defsnc '\(static[ ]\)\?const[ ]u16[ ]dot11lcn_sw_ctrl_tbl_\(4313_\)\?\(bt_\)\?\(epa_\)\?\(p250_\)\?rev0\(_combo\)\?\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_lcn\.c\|brcmsmac/phy/phytbl_lcn\.c\)'
+ # ath9k firmware is now Free Software.
+ accept '[ ]err[ ]=[ ]request_firmware_nowait[(]THIS_MODULE[,][ ]1[,][ ]name[,][ ]sc->dev[,][ ]GFP_KERNEL[,][\n][ ]*[&]ec[,][ ]ath9k_eeprom_request_cb[)][;]' drivers/net/wireless/ath/ath9k/init.c
+ accept '[#]define[ ]FIRMWARE_AR7010_1_1[ ]*["]htc_7010\.fw["]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[#]define[ ]FIRMWARE_AR9271[ ]*["]htc_9271\.fw["]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept 'MODULE_FIRMWARE[(]FIRMWARE_AR7010_1_1[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept 'MODULE_FIRMWARE[(]FIRMWARE_AR9271[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[ ]ret[ ]=[ ]request_firmware_nowait[(]THIS_MODULE[,][ ]true[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[,][ ]GFP_KERNEL[,][\n][ ]*hif_dev[,][ ]ath9k_hif_usb_firmware_cb[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[ ]ret[ ]=[ ]request_firmware[(][&]hif_dev->firmware[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ accept '[ ][ ]ret[ ]=[ ]request_firmware[(][&]fw[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ # Present in 3.8
+ accept '[ ]-[ ]request_firmware[(][)][ ]hotplug[ ]interface[ ]info.' Documentation/00-INDEX
+ defsnc 'static[ ]struct[ ]nand_ecclayout[ ]qi_lb60_ecclayout_[12]gb[ ]=' arch/mips/jz4740/board-qi_lb60.c
+ defsnc 'static[ ]struct[ ]comp_testvec[ ]\(deflate\|lzo\)_\(de\)\?comp_tv_template\[\][ ]=' 'crypto/\(tcrypt\|testmgr\).h'
+ defsc 'static[ ]const[ ]struct[ ]minimode[ ]est3_modes\[\][ ]=' drivers/gpu/drm/drm_edid_modes.h
+ defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_\(radio\|baseband\|mac\)_postamble\[\]\[5\][ ]' drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
+ defsnc 'static[ ]const[ ]u32[ ]ar955x_1p0_modes_\(no_\)\?xpa_tx_gain_table\[\]\[9\][ ]=' drivers/net/wireless/ath/ath9k/955x_1p0_initvals.h
+ defsnc 'static[ ]struct[ ]pinmux_cfg_reg[ ]pinmux_config_regs\[\][ ]=' 'arch/sh/kernel/cpu/sh2a/pinmux-sh7203\.c\|arch/arm/mach-shmobile/pfc-sh73[67]7\.c'
+ accept '#define[ ]CONFIG_PATH[ ]*["][/]etc[/]vntconfiguration[.]dat["]' drivers/staging/vt6655/device_cfg.h
+ # For 3.8-to-3.9 patch:
+ accept '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?\(static[ ]\(void\|int\)[ ]\)\?_\?request_firmware\(_load\|_work_func\)\?[(]' drivers/base/firmware_class.c
+ accept '[ ]ret[ ]=[ ]_request_firmware_prepare[(]' drivers/base/firmware_class.c
+ accept '[ ]*return[ ]_request_firmware[(]firmware_p,' drivers/base/firmware_class.c
+ initnc '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?static[ ]const[ ]struct[ ]reg_val[ ]tuner_init_f\(c0011\[\][ ]=\)\?\(\([ ][{]\)\?[*][/][;]\)\?' drivers/media/dvb/frontends/af9033_priv.h
+ initnc '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?static[ ]struct[ ]regdata[ ]mb86a20s_init\[\][ ]=\([ ]\?[{]\?[*][/][;]\)\?' drivers/media/dvb/frontends/mb86a20s.c
+ accept '[ ]\.firmware[ ]=[ ]\(DW210[24]\|DW3101\|S630\)_FIRMWARE' drivers/media/usb/dvb-usb/dw2102.c
+ accept '[ ]\(p1100\|s660\|p7500\)->firmware[ ]=[ ]\(P1100\|S660\|P7500\)_FIRMWARE' drivers/media/usb/dvb-usb/dw2102.c
+ defsnc 'static[ ]const[ ]u32[ ]ar9485Modes_green_ob_db_tx_gain_1_1\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+ initnc '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?static[ ]const[ ]u32[ ]ar955x_1p0_\(radio\|baseband\|mac\)_pos\(tamble\[\]\[5\][ ]=\)\?\([ ]\?[{]\?[*][/][;]\)\?' drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
+ defsnc '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?static[ ]const[ ]u32[ ]ar955x_1p0_modes_\(no_\)\?xpa_tx\(_gain_table\[\]\[9\][ ]=\)\?\([ ]\?[{]\?[*][/][;]\)\?' drivers/net/wireless/ath/ath9k/955x_1p0_initvals.h
+ initnc '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?u16[ ]MCS_DATA_RATE\[2\]\[2\]\[77\][ ]=\([*][/][;]\)\?' 'drivers/staging/\(rtl8192su/ieee80211/rtl819x_HTProc\.c\|rtl8192u/r819xU_firmware\.c\)'
+ accept '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?static[ ]int[ ]do_mod_firmware_load[(]' sound/sound_firmware.c
+ # New in 3.9
+ blobname 'imx[/]sdma[/]sdma-imx6q\.bin' arch/arm/boot/dts/imx6qdl.dtsi
+ accept '[ ]*nvidia,emc-registers[ ]=[ ]*<\(0x[0-9a-f]*[ \n]*\)*>[;]' arch/arm/boot/dts/tegra20-colibri-512.dtsi
+ blobname 'kernel[/]x86[/]microcode[/]GenuineIntel\.bin' arch/x86/kernel/microcode_intel_early.c
+ accept '[0-9][0-9]*[ ][0-3][ ][0-3][ ]0\([\n][0-9][0-9]*[ ][0-3][ ][0-3][ ]0\)*' Documentation/thermal/intel_powerclamp.txt
+ accept '[ ]return[ ]_request_firmware_load[(]fw_priv[,]' drivers/base/firmware_class.c
+ accept 'static[ ]int[\n]_request_firmware_prepare[(]struct[ ]firmware[ ][*][*]\?firmware_p' drivers/base/firmware_class.c
+ accept '[/][*][ ]called[ ]from[ ]request_firmware[(][)][ ]and[ ]request_firmware_work_func[(][)][ ][*][/]' drivers/base/firmware_class.c
+ accept '[ ]_request_firmware[(][&]fw[,][ ]fw_work->name' drivers/base/firmware_class.c
+ accept '[ ]put_device[(]fw_work->device[)][;][ ][/][*][ ]taken[ ]in[ ]request_firmware_nowait[(][)][ ][*][/]' drivers/base/firmware_class.c
+ defsnc 'static[ ]const[ ]u16[ ]x[48]_vectors\[\][ ]=' drivers/edac/amd64_edac.c
+ defsnc 'static[ ]const[ ]struct[ ]hdmiphy_config[ ]hdmiphy_v14_configs\[\][ ]=' drivers/gpu/drm/exynos/exynos_hdmi.c
+ defsnc 'static[ ]const[ ]u32[ ]oland_io_mc_regs\[TAHITI_IO_MC_REGS_SIZE\]\[2\][ ]=' drivers/gpu/drm/radeon/si.c
+ defsnc 'static[ ]const[ ]u8[ ]sixaxis_rdesc_fixup2\?\[\][ ]=' drivers/hid/hid-sony.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]tuner_init_fc0012\[\][ ]=' drivers/media/dvb-frontends/af9033_priv.h
+ defsnc '\(static[ ]\)\?struct[ ]linear_segments[ ]cnr_\(to_db\|\(64\|16\)qam\|qpsk\)_table\[\][ ]=' drivers/media/dvb-frontends/mb86a20s.c
+ blobname 'SlimISP_\(%\.2s\|..\)\.bin' drivers/media/i2c/s5c73m3/s5c73m3-core.c
+ defsc 'static[ ]const[ ]struct[ ]i2c_rv[ ]ov965x_init_regs\[\][ ]=' drivers/media/i2c/ov9650.c
+ accept 'static[ ]struct[ ]dvb_usb_device_properties[ ]vp7049_properties[ ]=[ ][{][\n]\([ ]\.\(caps\|usb_ctrl\)[ ]*=[ ][^",]*,[\n]*\)*[ ]\.firmware[ ]*=[ ]' drivers/media/dvb/dvb-usb/m920x.c
+ blobname 'dvb-usb-vp7049-0\.95\.fw' drivers/media/dvb/dvb-usb/m920x.c
+ # The blob name is just the chip name, so no point in deblobbing;
+ # more so considering the number of false positives this would
+ # bring about.
+ # blobname 'lp5521' drivers/leds/leds-lp5521.c
+ # blobname 'lp55231\?' drivers/leds/leds-lp5523.c
+ blobname 'lattice-ecp3\.bit' drivers/misc/lattice-ecp3-config.c
+ defsnc '[ ]*static[ ]const[ ]uint8_t[ ]rss_key\[UPT1_RSS_MAX_KEY_SIZE\][ ]=' drivers/net/vmxnet3/vmxnet3_drv.c
+ defsnc 'static[ ]const[ ]u32[ ]ar9300Modes_\(mixed_ob_db\|type5\)_tx_gain_table_2p2\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+ defsnc 'static[ ]const[ ]u32[ ]ar9340Modes_low_ob_db_and_spur_tx_gain_table_1p0\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9340_initvals.h
+ defsnc 'static[ ]const[ ]u32[ ]ar9485Modes_green_spur_ob_db_tx_gain_1_1\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+ defsnc 'static[ ]const[ ]u32[ ]ar9580_1p0_type6_tx_gain_table\[\]\[5\][ ]=' drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
+ blobname 'iwlwifi-\(7260\|3160\)-' drivers/net/wireless/iwlwifi/pcie/7000.c
+ blobname 'mrvl[/]pcie8897_uapsta\.bin' drivers/net/wireless/mwifiex/pcie.h
+ accept 'static[ ]const[ ]struct[ ]mwifiex_pcie_device[ ]mwifiex_pcie\(8766\|8897\)[ ]=[ ][{][\n][ ]\.firmware[ ]*=' drivers/net/wireless/mwifiex/pcie.h
+ accept '[ ][ ]card->pcie\.firmware[ ]=' drivers/net/wireless/mwifiex/pcie.c
+ accept '[ ][ ]\.per_chan_pwr_limit_arr_11abg[ ]*=[ ][{][ 0xf,\n]*' drivers/net/wireless/ti/wl18xx/main.c
+ blobname 'ti-connectivity[/]wl18xx-fw-2\.bin' drivers/net/wireless/ti/wl18xx/main.c
+ blobname '%s-dsp%d-%s\.\(wmfw\|bin\)' sound/soc/codecs/wm_adsp.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_addr[ ]\(idle_\)\?reg_addrs\[\][ ]=' drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
+ blobname '83xx_fw\.bin' drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+ defsnc 'static[ ]const[ ]unsigned[ ]int[ ]dump_num_registers\[NUM_CHIPS\]\[NUM_PRESETS\][ ]=' drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h
+ defsnc 'static[ ]int[ ]pm2xxx_charger_voltage_map\[\][ ]=' drivers/power/pm2301_charger.c
+ accept '[ ][*][ ]comedi[ ]drivers\.[ ]The[ ]request_firmware[(][)][ ]hotplug' drivers/staging/comedi/comedi.h
+ blobname 'rp2\.fw' drivers/tty/serial/rp2.c
+ defsnc 'static[ ]const[ ]unsigned[ ]char[ ]seq_\(w\|rgb\)_gamma\[\][ ]=' drivers/video/backlight/lms501kf03.c
+ defsnc '[#]include[ ]<video[/]mmp_disp\.h>[\n]*static[ ]u16[ ]init\[\][ ]=' drivers/video/mmp/panel/tpo_tj032md01bw.c
+ defsnc 'static[ ]struct[ ]tegra_clk_pll_freq_table[ ]pll_[mpadcu]_freq_table\[\][ ]=' 'drivers/clk/tegra/clk-tegra[23]0\.c'
+ blobname 'ctefx\.bin' sound/pci/hda/patch_ca0132.c
+ defsnc 'static[ ]unsigned[ ]int[ ]\(voice_focus\|mic_svm\|equalizer\)_vals_lookup\[\][ ]=' sound/pci/hda/patch_ca0132.c
+ defsnc 'static[ ]struct[ ]hda_verb[ ]ca0132_init_verbs0\[\][ ]=' sound/pci/hda/patch_ca0132.c
+ defsnc 'static[ ]const[ ]int[ ]dmic_comp\[6\]\[6\][ ]=' sound/soc/codecs/max98090.c
+ # Reverse 3.8-to-3.9 patch:
+ accept '0x102c[ ][ ][ ][ ][ ]0x6151[\n]'"$blobpat*" Documentation/video4linux/et61x251.txt
+ accept '0x041e[ ][ ][ ][ ][ ]0x4017[\n]'"$blobpat*" Documentation/video4linux/zc0301.txt
+ defsnc 'static[ ]struct[ ]clk_pll_\(freq_\)\?table[ ]tegra_pll_[adpxm]_\(freq_\)\?table\[\][ ]=' arch/arm/mach-tegra/tegra2_clocks.c
+ defsnc 'static[ ]struct[ ]clk_pll_freq_table[ ]tegra_pll_[cu]_freq_table\[\][ ]=' arch/arm/mach-tegra/tegra30_clocks.c
+ accept '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?\(static[ ]\(void\|int\)[ ]\)\?_\?request_firmware\(_cleanup\|_prepare\)\?[(]' drivers/base/firmware_class.c
+ accept '[ ]*\(\(fw_priv\|ret\)[ ]=[ ]\)\?_\?request_firmware_\(load\|prepare\|cleanup\)' drivers/base/firmware_class.c
+ defsnc '[ ]static[ ]u_short[ ]geometry_table\[\]\[[45]\][ ]=' drivers/block/xd.c
+ defsnc 'static[ ]const[ ]u8[ ]hdmiphy_conf\(27\(_027\)\?\|74\(_175\|_25\)\|148_5\)\[32\][ ]=' drivers/media/video/s5p-tv/hdmiphy_drv.c
+ defsnc 'static[ ]const[ ]u8[ ]hdmiphy_conf74_176\[32\][ ]=' drivers/gpu/drm/exynos/exynos_hdmi.c
+ accept '[ ]\.firmware[ ]=[ ]["][/][*][(]DEBLOBBED[)][*][/]["]' drivers/media/usb/dvb-usb/dw2102.c
+ accept '[ ]\(p1100\|s660\)->firmware[ ]=' drivers/media/dvb/dvb-usb/dw2102.c
+ accept '[ ]p7500->firmware[ ]=' drivers/media/dvb/dvb-usb/dw2102.c
+ defsnc '[ ]#define[ ]WakeupSeq[ ][ ][ ][ ][{]' drivers/net/ethernet/i825xx/eepro.c
+ defsnc '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?\(static[ ]\)\?\(const[ ]\)\?\(struct[ ]\)\?\(SiS\|XGI\)_[ME]CLKData\(Struct\)\?[ ]XGI\(340\|27\)\(\(New\)\?_[ME]CLKData\[\][ ]*=\|N\)\?\([ ]\?[{]\?[*][/][;]\)\?' drivers/staging/xgifb/vb_table.h
+ defsnc '\(static[ ]\)\?\(const[ ]\)\?\(UCHAR\|unsigned[ ]char\)[ ]XGI340_CR6[BE]\[8\]\[4\][ ]*=' drivers/staging/xgifb/vb_table.h
+ ;;
+
+ */drm-qxl-driver.patch)
+ defsnc '[ ][}][ ]common_modes\[\][ ]=' drivers/gpu/drm/qxl/qxl_display.c
+ ;;
+
*/patch-3.7*)
# Removed chunks matched by entries that don't appear in the patch context.
initnc '[ ]0x019806b8[,][\n][ ]0x1427f116[,]' drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h
@@ -4707,7 +4873,6 @@ set_except () {
defsnc 'static[ ]const[ ]u32[ ]ar9300Modes_\(\(low\(est\)\?\|high\)_ob_db\|high_power\)_tx_gain_table_2p[02]\[\]\[5\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9003_\(2p[02]_\)\?initvals\.h'
defsnc 'static[ ]const[ ]u32[ ]ar9\(300\|200_merlin\)_2p[02]_\(radio\|mac\|baseband\)_core\[\]\[2\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9003_\(2p[02]_\)\?initvals\.h'
defsnc 'static[ ]const[ ]u32[ ]ar9300Common_\(wo_xlna_\)\?rx_gain_table_\(merlin_\)\?2p[02]\[\]\[2\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9003_\(2p[02]_\)\?initvals\.h'
- blobname 'ar9271[.]fw' drivers/net/wireless/ath/ath9k/hif_usb.c
accept 'static[ ]int[ ]ipw2100_mod_firmware_load[(]' 'drivers/net/wireless/\(ipw2x00/\)\?ipw2100\.c'
accept '[ ]*card->firmware[ ]=[ ]\(if_sdio\|lbs_fw\|fw_name\)' drivers/net/wireless/libertas/if_sdio.c
blobname 'rt\(28[67]0\|30[79][01]\)\.bin' drivers/staging/rt2860/common/rtmp_mcu.c
@@ -4748,7 +4913,6 @@ set_except () {
blobname 'lgs8g75\.fw' drivers/media/dvb/frontends/lgs8gxx.c
defsnc 'static[ ]const[ ]struct[ ]ucbus_write_cmd[ ]\(icx098bq\|lz24bp\)_start_[012]\[\][ ]=' drivers/media/video/gspca/sq930x.c
defsnc '[}][ ]capconfig\[4\]\[2\][ ]=' drivers/media/video/gspca/sq930x.c
- blobname 'ar7010\(_1_1\)\?[.]fw' drivers/net/wireless/ath/ath9k/hif_usb.c
defsnc 'static[ ]u8[ ]sa2400_rf_rssi_map\[\][ ]=' drivers/net/wireless/rtl818x/rtl8180_sa2400.c
defsnc 'static[ ]const[ ]unsigned[ ]char[ ]pwm_lookup_table\[256\][ ]=' drivers/platform/x86/compal-laptop.c
defsnc 'static[ ]int[ ]tps6586x_\(ldo4\|sm2\|dvm\)_voltages\[\][ ]=' drivers/regulator/tps6586x-regulator.c
diff --git a/freed-ora/current/master/debug-bad-pte-dmi.patch b/freed-ora/current/master/debug-bad-pte-dmi.patch
new file mode 100644
index 000000000..f9485b880
--- /dev/null
+++ b/freed-ora/current/master/debug-bad-pte-dmi.patch
@@ -0,0 +1,71 @@
+Occasionally we see reports of page table corruption, and it's not clear why.
+By printing out the hardware name, we could potentially see some patterns.
+
+Signed-off-by: Dave Jones <davej@redhat.com>
+
+--- linux.orig/include/asm-generic/bug.h
++++ linux/include/asm-generic/bug.h
+@@ -55,6 +55,8 @@ struct bug_entry {
+ #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
+ #endif
+
++void print_hardware_dmi_name(void);
++
+ /*
+ * WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report
+ * significant issues that need prompt attention if they should ever
+--- linux.orig/kernel/panic.c
++++ linux/kernel/panic.c
+@@ -391,6 +391,15 @@ void oops_exit(void)
+ kmsg_dump(KMSG_DUMP_OOPS);
+ }
+
++void print_hardware_dmi_name(void)
++{
++ const char *board;
++
++ board = dmi_get_system_info(DMI_PRODUCT_NAME);
++ if (board)
++ printk(KERN_WARNING "Hardware name: %s\n", board);
++}
++
+ #ifdef WANT_WARN_ON_SLOWPATH
+ struct slowpath_args {
+ const char *fmt;
+@@ -400,13 +409,10 @@ struct slowpath_args {
+ static void warn_slowpath_common(const char *file, int line, void *caller,
+ unsigned taint, struct slowpath_args *args)
+ {
+- const char *board;
+-
+ printk(KERN_WARNING "------------[ cut here ]------------\n");
+ printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
+- board = dmi_get_system_info(DMI_PRODUCT_NAME);
+- if (board)
+- printk(KERN_WARNING "Hardware name: %s\n", board);
++
++ print_hardware_dmi_name();
+
+ if (args)
+ vprintk(args->fmt, args->args);
+--- linux.orig/mm/memory.c
++++ linux/mm/memory.c
+@@ -706,6 +706,8 @@ static void print_bad_pte(struct vm_area
+ "BUG: Bad page map in process %s pte:%08llx pmd:%08llx\n",
+ current->comm,
+ (long long)pte_val(pte), (long long)pmd_val(*pmd));
++ print_hardware_dmi_name();
++
+ if (page)
+ dump_page(page);
+ printk(KERN_ALERT
+--- linux.orig/mm/page_alloc.c
++++ linux/mm/page_alloc.c
+@@ -321,6 +321,7 @@ static void bad_page(struct page *page)
+ current->comm, page_to_pfn(page));
+ dump_page(page);
+
++ print_hardware_dmi_name();
+ print_modules();
+ dump_stack();
+ out:
diff --git a/freed-ora/current/master/debug-bad-pte-modules.patch b/freed-ora/current/master/debug-bad-pte-modules.patch
new file mode 100644
index 000000000..047231087
--- /dev/null
+++ b/freed-ora/current/master/debug-bad-pte-modules.patch
@@ -0,0 +1,25 @@
+When we encounter a bad PTE, print out what modules were loaded,
+so we can see if there is a common driver potentially at fault.
+
+Signed-off-by: Dave Jones <davej@redhat.com>
+
+diff -durpN '--exclude-from=/home/davej/.exclude' /home/davej/src/kernel/git-trees/linux/mm/memory.c linux-dj/mm/memory.c
+--- /home/davej/src/kernel/git-trees/linux/mm/memory.c 2013-02-26 14:41:18.591116577 -0500
++++ linux-dj/mm/memory.c 2013-02-28 20:04:37.678304092 -0500
+@@ -57,6 +57,7 @@
+ #include <linux/swapops.h>
+ #include <linux/elf.h>
+ #include <linux/gfp.h>
++#include <linux/module.h>
+ #include <linux/migrate.h>
+ #include <linux/string.h>
+
+@@ -719,6 +722,7 @@ static void print_bad_pte(struct vm_area
+ if (vma->vm_file && vma->vm_file->f_op)
+ print_symbol(KERN_ALERT "vma->vm_file->f_op->mmap: %s\n",
+ (unsigned long)vma->vm_file->f_op->mmap);
++ print_modules();
+ dump_stack();
+ add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
+ }
+
diff --git a/freed-ora/current/master/devel-pekey-secure-boot-20130219.patch b/freed-ora/current/master/devel-pekey-secure-boot-20130306.patch
index 0c49c5a2e..85bcec738 100644
--- a/freed-ora/current/master/devel-pekey-secure-boot-20130219.patch
+++ b/freed-ora/current/master/devel-pekey-secure-boot-20130306.patch
@@ -1,7 +1,7 @@
-From 11e4fd0629497bbf56245e6aa3a776f350e1f340 Mon Sep 17 00:00:00 2001
+From 1693ee9461cddd18c607f7126ac3d300915dbc05 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Fri, 18 Jan 2013 13:53:35 +0000
-Subject: [PATCH 01/46] KEYS: Load *.x509 files into kernel keyring
+Subject: [PATCH 02/48] KEYS: Load *.x509 files into kernel keyring
Load all the files matching the pattern "*.x509" that are to be found in kernel
base source dir and base build dir into the module signing keyring.
@@ -15,11 +15,11 @@ Signed-off-by: David Howells <dhowells@redhat.com>
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/kernel/Makefile b/kernel/Makefile
-index 6c072b6..bdabd1d 100644
+index bbde5f1..6cb07a0 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
-@@ -134,17 +134,40 @@ $(obj)/timeconst.h: $(src)/timeconst.pl FORCE
- $(call if_changed,timeconst)
+@@ -140,17 +140,40 @@ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE
+ $(call if_changed,bc)
ifeq ($(CONFIG_MODULE_SIG),y)
+###############################################################################
@@ -81,10 +81,10 @@ index 246b4c6..0a60203 100644
1.8.1.2
-From 9029c0a6ee6069d1da0c40a10ac7fbc9ab11241d Mon Sep 17 00:00:00 2001
+From 80e06b81dec8a01819170c4d102a05d98df4c6f7 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 18:39:54 +0000
-Subject: [PATCH 02/46] KEYS: Separate the kernel signature checking keyring
+Subject: [PATCH 03/48] KEYS: Separate the kernel signature checking keyring
from module signing
Separate the kernel signature checking keyring from module signing so that it
@@ -95,15 +95,13 @@ Signed-off-by: David Howells <dhowells@redhat.com>
include/keys/system_keyring.h | 23 ++++++++++
init/Kconfig | 13 ++++++
kernel/Makefile | 17 ++++---
- kernel/modsign_certificate.S | 18 --------
kernel/modsign_pubkey.c | 104 ------------------------------------------
kernel/module-internal.h | 2 -
kernel/module_signing.c | 3 +-
kernel/system_certificates.S | 18 ++++++++
kernel/system_keyring.c | 101 ++++++++++++++++++++++++++++++++++++++++
- 9 files changed, 168 insertions(+), 131 deletions(-)
+ 8 files changed, 168 insertions(+), 113 deletions(-)
create mode 100644 include/keys/system_keyring.h
- delete mode 100644 kernel/modsign_certificate.S
delete mode 100644 kernel/modsign_pubkey.c
create mode 100644 kernel/system_certificates.S
create mode 100644 kernel/system_keyring.c
@@ -138,10 +136,10 @@ index 0000000..8dabc39
+
+#endif /* _KEYS_SYSTEM_KEYRING_H */
diff --git a/init/Kconfig b/init/Kconfig
-index be8b7f5..e05877b 100644
+index 22616cd..e988655 100644
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1568,6 +1568,18 @@ config BASE_SMALL
+@@ -1575,6 +1575,18 @@ config BASE_SMALL
default 0 if BASE_FULL
default 1 if !BASE_FULL
@@ -160,7 +158,7 @@ index be8b7f5..e05877b 100644
menuconfig MODULES
bool "Enable loadable module support"
help
-@@ -1640,6 +1652,7 @@ config MODULE_SRCVERSION_ALL
+@@ -1647,6 +1659,7 @@ config MODULE_SRCVERSION_ALL
config MODULE_SIG
bool "Module signature verification"
depends on MODULES
@@ -169,10 +167,10 @@ index be8b7f5..e05877b 100644
select CRYPTO
select ASYMMETRIC_KEY_TYPE
diff --git a/kernel/Makefile b/kernel/Makefile
-index bdabd1d..0ca8c0a 100644
+index 6cb07a0..a9ecd52 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
-@@ -53,8 +53,9 @@ obj-$(CONFIG_SMP) += spinlock.o
+@@ -51,8 +51,9 @@ obj-$(CONFIG_SMP) += spinlock.o
obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
obj-$(CONFIG_UID16) += uid16.o
@@ -183,9 +181,9 @@ index bdabd1d..0ca8c0a 100644
obj-$(CONFIG_KALLSYMS) += kallsyms.o
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
obj-$(CONFIG_KEXEC) += kexec.o
-@@ -133,13 +134,14 @@ targets += timeconst.h
- $(obj)/timeconst.h: $(src)/timeconst.pl FORCE
- $(call if_changed,timeconst)
+@@ -139,13 +140,14 @@ targets += timeconst.h
+ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE
+ $(call if_changed,bc)
-ifeq ($(CONFIG_MODULE_SIG),y)
###############################################################################
@@ -201,7 +199,7 @@ index bdabd1d..0ca8c0a 100644
X509_CERTIFICATES-y := $(wildcard *.x509) $(wildcard $(srctree)/*.x509)
X509_CERTIFICATES-$(CONFIG_MODULE_SIG) += signing_key.x509
X509_CERTIFICATES := $(sort $(X509_CERTIFICATES-y))
-@@ -155,10 +157,11 @@ $(shell rm $(obj)/.x509.list)
+@@ -161,10 +163,11 @@ $(shell rm $(obj)/.x509.list)
endif
endif
@@ -215,7 +213,7 @@ index bdabd1d..0ca8c0a 100644
targets += $(obj)/x509_certificate_list
$(obj)/x509_certificate_list: $(X509_CERTIFICATES) $(obj)/.x509.list
$(call if_changed,x509certs)
-@@ -168,7 +171,9 @@ $(obj)/.x509.list:
+@@ -174,7 +177,9 @@ $(obj)/.x509.list:
@echo $(X509_CERTIFICATES) >$@
clean-files := x509_certificate_list .x509.list
@@ -225,30 +223,6 @@ index bdabd1d..0ca8c0a 100644
###############################################################################
#
# If module signing is requested, say by allyesconfig, but a key has not been
-diff --git a/kernel/modsign_certificate.S b/kernel/modsign_certificate.S
-deleted file mode 100644
-index 0a60203..0000000
---- a/kernel/modsign_certificate.S
-+++ /dev/null
-@@ -1,18 +0,0 @@
--/* SYMBOL_PREFIX defined on commandline from CONFIG_SYMBOL_PREFIX */
--#ifndef SYMBOL_PREFIX
--#define ASM_SYMBOL(sym) sym
--#else
--#define PASTE2(x,y) x##y
--#define PASTE(x,y) PASTE2(x,y)
--#define ASM_SYMBOL(sym) PASTE(SYMBOL_PREFIX, sym)
--#endif
--
--#define GLOBAL(name) \
-- .globl ASM_SYMBOL(name); \
-- ASM_SYMBOL(name):
--
-- .section ".init.data","aw"
--
--GLOBAL(modsign_certificate_list)
-- .incbin "kernel/x509_certificate_list"
--GLOBAL(modsign_certificate_list_end)
diff --git a/kernel/modsign_pubkey.c b/kernel/modsign_pubkey.c
deleted file mode 100644
index 2b6e699..0000000
@@ -526,10 +500,10 @@ index 0000000..a3ca76f
1.8.1.2
-From ff91a380ea23be02cbb7de1af30845c6ec275d41 Mon Sep 17 00:00:00 2001
+From a2512743c97ac3c236eaf9ce6b2879cb0ff61dd5 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Thu, 17 Jan 2013 16:25:00 +0000
-Subject: [PATCH 03/46] KEYS: Add a 'trusted' flag and a 'trusted only' flag
+Subject: [PATCH 04/48] KEYS: Add a 'trusted' flag and a 'trusted only' flag
Add KEY_FLAG_TRUSTED to indicate that a key either comes from a trusted source
or had a cryptographic signature chain that led back to a trusted key the
@@ -655,10 +629,10 @@ index 6ece7f2..f18d7ff 100644
1.8.1.2
-From 47fb497e684ae5efa3c5573247917a528bdf8cee Mon Sep 17 00:00:00 2001
+From a466fb7f25a238e646970d1dbdbb5143f9b3b066 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:32 +0000
-Subject: [PATCH 04/46] KEYS: Rename public key parameter name arrays
+Subject: [PATCH 05/48] KEYS: Rename public key parameter name arrays
Rename the arrays of public key parameters (public key algorithm names, hash
algorithm names and ID type names) so that the array name ends in "_name".
@@ -810,10 +784,10 @@ index 0034e36..0b6b870 100644
1.8.1.2
-From f8383dd2291f8bceb9bfb185c162c537c8a0befb Mon Sep 17 00:00:00 2001
+From bb9a97b29085a9dfbda5b32a6dbdfaec5612e46b Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:33 +0000
-Subject: [PATCH 05/46] KEYS: Move the algorithm pointer array from x509 to
+Subject: [PATCH 06/48] KEYS: Move the algorithm pointer array from x509 to
public_key.c
Move the public-key algorithm pointer array from x509_public_key.c to
@@ -892,10 +866,10 @@ index 619d570..46bde25 100644
1.8.1.2
-From 34e16d2c23a9ba6c54447ce81c52fe5807d26dd2 Mon Sep 17 00:00:00 2001
+From 35da3ee1a151d44c8e0b38422584918f39d66298 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:33 +0000
-Subject: [PATCH 06/46] KEYS: Store public key algo ID in public_key struct
+Subject: [PATCH 07/48] KEYS: Store public key algo ID in public_key struct
Store public key algo ID in public_key struct for reference purposes. This
allows it to be removed from the x509_certificate struct and used to find a
@@ -977,10 +951,10 @@ index 46bde25..05778df 100644
1.8.1.2
-From d6dd79d03285dc9b32e5ab54a33853881dde01d8 Mon Sep 17 00:00:00 2001
+From a837dc33a6ca6a4c11d7485ac51951992e7ccf53 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:34 +0000
-Subject: [PATCH 07/46] KEYS: Split public_key_verify_signature() and make
+Subject: [PATCH 08/48] KEYS: Split public_key_verify_signature() and make
available
Modify public_key_verify_signature() so that it now takes a public_key struct
@@ -1093,10 +1067,10 @@ index fac574c..8cb2f70 100644
1.8.1.2
-From 064a635b699548b2ca23a308db449336a3a4fdf0 Mon Sep 17 00:00:00 2001
+From def87e748398cfd083e79ae48556aa2144873fc4 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:35 +0000
-Subject: [PATCH 08/46] KEYS: Store public key algo ID in public_key_signature
+Subject: [PATCH 09/48] KEYS: Store public key algo ID in public_key_signature
struct
Store public key algorithm ID in public_key_signature struct for reference
@@ -1126,10 +1100,10 @@ index 05778df..b34fda4 100644
1.8.1.2
-From a0b84a599f5ac6f53227fa74853ba6fa3cb0da23 Mon Sep 17 00:00:00 2001
+From 87230ff62f9901069b350c57aaa996dabe191165 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:35 +0000
-Subject: [PATCH 09/46] X.509: struct x509_certificate needs struct tm
+Subject: [PATCH 10/48] X.509: struct x509_certificate needs struct tm
declaring
struct x509_certificate needs struct tm declaring by #inclusion of linux/time.h
@@ -1158,10 +1132,10 @@ index e583ad0..2d01182 100644
1.8.1.2
-From e393e194decebbe6b93033318d68b53eeae2d1fb Mon Sep 17 00:00:00 2001
+From 82c121f975c92d34202a9248f94de9c9ada4f9a2 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:35 +0000
-Subject: [PATCH 10/46] X.509: Add bits needed for PKCS#7
+Subject: [PATCH 11/48] X.509: Add bits needed for PKCS#7
PKCS#7 validation requires access to the serial number and the raw names in an
X.509 certificate.
@@ -1256,10 +1230,10 @@ index 2d01182..a6ce46f 100644
1.8.1.2
-From 85a9279f58f9fc1c1db6e75eb2ff7d88f58139df Mon Sep 17 00:00:00 2001
+From 57fb22f1b578187da39d5edfdcaf22daea5fddcb Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:36 +0000
-Subject: [PATCH 11/46] X.509: Embed public_key_signature struct and create
+Subject: [PATCH 12/48] X.509: Embed public_key_signature struct and create
filler function
Embed a public_key_signature struct in struct x509_certificate, eliminating
@@ -1524,10 +1498,10 @@ index 8cb2f70..b7c81d8 100644
1.8.1.2
-From 2bcc73fb25a5959bd4e6da8af3a4bc8cde807f3d Mon Sep 17 00:00:00 2001
+From c882d17501c48b2ea515b2c6cba21d91ad3ce4c4 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:36 +0000
-Subject: [PATCH 12/46] X.509: Check the algorithm IDs obtained from parsing an
+Subject: [PATCH 13/48] X.509: Check the algorithm IDs obtained from parsing an
X.509 certificate
Check that the algorithm IDs obtained from the ASN.1 parse by OID lookup
@@ -1565,10 +1539,10 @@ index b7c81d8..eb368d4 100644
1.8.1.2
-From 65ee135783ff5d7dcec21f89aa8a458928aa8be8 Mon Sep 17 00:00:00 2001
+From a5e4fc67608e4f63189263c9840eab47569ab78b Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:37 +0000
-Subject: [PATCH 13/46] X.509: Handle certificates that lack an
+Subject: [PATCH 14/48] X.509: Handle certificates that lack an
authorityKeyIdentifier field
Handle certificates that lack an authorityKeyIdentifier field by assuming
@@ -1612,10 +1586,10 @@ index eb368d4..0f55e3b 100644
1.8.1.2
-From cda5d188ec1ea1d599d3005017656ea08a50a4c9 Mon Sep 17 00:00:00 2001
+From 91fc935afe02fedb2cbf4e77994d226f0fbd25eb Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:37 +0000
-Subject: [PATCH 14/46] X.509: Export certificate parse and free functions
+Subject: [PATCH 15/48] X.509: Export certificate parse and free functions
Export certificate parse and free functions for use by modules.
@@ -1658,10 +1632,10 @@ index 931f069..9cf0e16 100644
1.8.1.2
-From 26f7a461be88d22b6ccd357b5bf9784bff53cbad Mon Sep 17 00:00:00 2001
+From 14b152615af5ca6b274714b1e515d7dcf142a55b Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:38 +0000
-Subject: [PATCH 15/46] PKCS#7: Implement a parser [RFC 2315]
+Subject: [PATCH 16/48] PKCS#7: Implement a parser [RFC 2315]
Implement a parser for a PKCS#7 signed-data message as described in part of
RFC 2315.
@@ -2271,10 +2245,10 @@ index 6926db7..edeff85 100644
1.8.1.2
-From e99cd6117fce747b0867eac7f09369b6fbfe1fbc Mon Sep 17 00:00:00 2001
+From ec62dd1e7576f4b83d6374cd900049c7c555a7d0 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:38 +0000
-Subject: [PATCH 16/46] PKCS#7: Digest the data in a signed-data message
+Subject: [PATCH 17/48] PKCS#7: Digest the data in a signed-data message
Digest the data in a PKCS#7 signed-data message and attach to the
public_key_signature struct contained in the pkcs7_message struct.
@@ -2445,10 +2419,10 @@ index 0000000..2f9f26c
1.8.1.2
-From c803112feb230b4e5d5a91f0a358007a397f85d3 Mon Sep 17 00:00:00 2001
+From e90ddcd9bc29ed13b4b2808029c6580f3444c5b3 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:39 +0000
-Subject: [PATCH 17/46] PKCS#7: Find the right key in the PKCS#7 key list and
+Subject: [PATCH 18/48] PKCS#7: Find the right key in the PKCS#7 key list and
verify the signature
Find the appropriate key in the PKCS#7 key list and verify the signature with
@@ -2544,10 +2518,10 @@ index 2f9f26c..3f6f0e2 100644
1.8.1.2
-From f54c32c382837a59ee4e3e4d381b4a97301d5960 Mon Sep 17 00:00:00 2001
+From 8e22cd5881575b9dcdd45b29671935fce505d056 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:39 +0000
-Subject: [PATCH 18/46] PKCS#7: Verify internal certificate chain
+Subject: [PATCH 19/48] PKCS#7: Verify internal certificate chain
Verify certificate chain in the X.509 certificates contained within the PKCS#7
message as far as possible. If any signature that we should be able to verify
@@ -2660,10 +2634,10 @@ index 6b1d877..5e35fba 100644
1.8.1.2
-From 07951d065ba4cc729217477486e5d1eaa4288762 Mon Sep 17 00:00:00 2001
+From 185c80f1aa2a59a7494db7f57eba30f54a46152a Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:42 +0000
-Subject: [PATCH 19/46] PKCS#7: Find intersection between PKCS#7 message and
+Subject: [PATCH 20/48] PKCS#7: Find intersection between PKCS#7 message and
known, trusted keys
Find the intersection between the X.509 certificate chain contained in a PKCS#7
@@ -2867,10 +2841,10 @@ index 0000000..cc226f5
1.8.1.2
-From 29267ccd926681bbf19594da3e920ff07f70f172 Mon Sep 17 00:00:00 2001
+From 5b9065e00fb0d0b5fd87f41d8e4c19522a624d6f Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:39 +0000
-Subject: [PATCH 20/46] Provide PE binary definitions
+Subject: [PATCH 21/48] Provide PE binary definitions
Provide some PE binary structural and constant definitions as taken from the
pesign package sources.
@@ -3340,10 +3314,10 @@ index 0000000..9234aef
1.8.1.2
-From 658b2426b8704e4440d2d1614406be25385ffe0e Mon Sep 17 00:00:00 2001
+From 0514d1400ccf6602fa4f4a45d54e82c0386788fb Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:40 +0000
-Subject: [PATCH 21/46] pefile: Parse a PE binary to find a key and a signature
+Subject: [PATCH 22/48] pefile: Parse a PE binary to find a key and a signature
contained therein
Parse a PE binary to find a key and a signature contained therein. Later
@@ -3634,10 +3608,10 @@ index 0000000..82bcaf6
1.8.1.2
-From 0405dbbba60584930e238a98e0de48b70141e5ba Mon Sep 17 00:00:00 2001
+From 84598b0ba0da9e914fe13cd8e73b4d77a77f8a8e Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:40 +0000
-Subject: [PATCH 22/46] pefile: Strip the wrapper off of the cert data block
+Subject: [PATCH 23/48] pefile: Strip the wrapper off of the cert data block
The certificate data block in a PE binary has a wrapper around the PKCS#7
signature we actually want to get at. Strip this off and check that we've got
@@ -3738,10 +3712,10 @@ index fb80cf0..f2d4df0 100644
1.8.1.2
-From 6c5d86f5c8be7c3357c143ab1b2fba9ebc5bf16e Mon Sep 17 00:00:00 2001
+From 6c9fdc4a6bb91f67ba83a164bed515f86b487804 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:40 +0000
-Subject: [PATCH 23/46] pefile: Parse the presumed PKCS#7 content of the
+Subject: [PATCH 24/48] pefile: Parse the presumed PKCS#7 content of the
certificate blob
Parse the content of the certificate blob, presuming it to be PKCS#7 format.
@@ -3792,10 +3766,10 @@ index f2d4df0..056500f 100644
1.8.1.2
-From 73a990445ce2d4ad35dca7b67ac3fbf280a9dafa Mon Sep 17 00:00:00 2001
+From 7816d32941300ae8ed25cc98baf13064854e6cb9 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:41 +0000
-Subject: [PATCH 24/46] pefile: Parse the "Microsoft individual code signing"
+Subject: [PATCH 25/48] pefile: Parse the "Microsoft individual code signing"
data blob
The PKCS#7 certificate should contain a "Microsoft individual code signing"
@@ -4035,10 +4009,10 @@ index edeff85..332dcf5 100644
1.8.1.2
-From e969b6b286982975f056d8eb5d951be992a4ff96 Mon Sep 17 00:00:00 2001
+From 9e97d5c51460969ff04d3027e734a69437518cfd Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:41 +0000
-Subject: [PATCH 25/46] pefile: Digest the PE binary and compare to the PKCS#7
+Subject: [PATCH 26/48] pefile: Digest the PE binary and compare to the PKCS#7
data
Digest the signed parts of the PE binary, canonicalising the section table
@@ -4271,10 +4245,10 @@ index f1c8cc1..dfdb85e 100644
1.8.1.2
-From 860c4eb4665073836356c04b13a09464c56a7f7c Mon Sep 17 00:00:00 2001
+From 2b5752323fc40cd9145150158f32b088fb0d4fa2 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Fri, 18 Jan 2013 13:58:35 +0000
-Subject: [PATCH 26/46] PEFILE: Validate PKCS#7 trust chain
+Subject: [PATCH 27/48] PEFILE: Validate PKCS#7 trust chain
Validate the PKCS#7 trust chain against the contents of the system keyring.
@@ -4323,10 +4297,10 @@ index dfdb85e..edad948 100644
1.8.1.2
-From 8fe70d2f6b5c7119629d984d63ffa2ea6f86e3ec Mon Sep 17 00:00:00 2001
+From 1d94bb9d91322f250d870a1df94e24f9717a1660 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Tue, 15 Jan 2013 15:33:42 +0000
-Subject: [PATCH 27/46] PEFILE: Load the contained key if we consider the
+Subject: [PATCH 28/48] PEFILE: Load the contained key if we consider the
container to be validly signed
Load the key contained in the PE binary if the signature on the container can
@@ -4414,10 +4388,65 @@ index 0f55e3b..c3e5a6d 100644
1.8.1.2
-From 9bd76edb23767533d299459f595c7b3730c320a5 Mon Sep 17 00:00:00 2001
+From ef929c440551421ba319fe2305a063706ce7c8a6 Mon Sep 17 00:00:00 2001
+From: Chun-Yi Lee <joeyli.kernel@gmail.com>
+Date: Thu, 21 Feb 2013 19:23:49 +0800
+Subject: [PATCH 29/48] MODSIGN: Fix including certificate twice when the
+ signing_key.x509 already exists
+
+This issue was found in devel-pekey branch on linux-modsign.git tree. The
+x509_certificate_list includes certificate twice when the signing_key.x509
+already exists.
+We can reproduce this issue by making kernel twice, the build log of
+second time looks like this:
+
+...
+ CHK kernel/config_data.h
+ CERTS kernel/x509_certificate_list
+ - Including cert /ramdisk/working/joey/linux-modsign/signing_key.x509
+ - Including cert signing_key.x509
+...
+
+Actually the build path was the same with the srctree path when building
+kernel. It causes the size of bzImage increased by packaging certificates
+twice.
+
+Cc: Rusty Russell <rusty@rustcorp.com.au>
+Cc: Josh Boyer <jwboyer@redhat.com>
+Cc: Randy Dunlap <rdunlap@xenotime.net>
+Cc: Herbert Xu <herbert@gondor.apana.org.au>
+Cc: "David S. Miller" <davem@davemloft.net>
+Cc: Michal Marek <mmarek@suse.com>
+Signed-off-by: Chun-Yi Lee <jlee@suse.com>
+Signed-off-by: David Howells <dhowells@redhat.com>
+---
+ kernel/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/Makefile b/kernel/Makefile
+index a9ecd52..c94d081 100644
+--- a/kernel/Makefile
++++ b/kernel/Makefile
+@@ -148,7 +148,10 @@ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE
+ #
+ ###############################################################################
+ ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y)
+-X509_CERTIFICATES-y := $(wildcard *.x509) $(wildcard $(srctree)/*.x509)
++X509_CERTIFICATES-y := $(wildcard *.x509)
++ifneq ($(shell pwd), $(srctree))
++X509_CERTIFICATES-y += $(wildcard $(srctree)/*.x509)
++endif
+ X509_CERTIFICATES-$(CONFIG_MODULE_SIG) += signing_key.x509
+ X509_CERTIFICATES := $(sort $(X509_CERTIFICATES-y))
+
+--
+1.8.1.2
+
+
+From 614232115eed153b4f56f37319114a18d590daaa Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Thu, 20 Sep 2012 10:40:56 -0400
-Subject: [PATCH 28/46] Secure boot: Add new capability
+Subject: [PATCH 30/48] Secure boot: Add new capability
Secure boot adds certain policy requirements, including that root must not
be able to do anything that could cause the kernel to execute arbitrary code.
@@ -4451,10 +4480,10 @@ index ba478fa..7109e65 100644
1.8.1.2
-From af74a1cc301f6042cd8d972d2b2b713592c547e6 Mon Sep 17 00:00:00 2001
+From 5c31721c6ec69d901a3f81a1cfa1518ca138ab75 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Thu, 20 Sep 2012 10:41:05 -0400
-Subject: [PATCH 29/46] SELinux: define mapping for new Secure Boot capability
+Subject: [PATCH 31/48] SELinux: define mapping for new Secure Boot capability
Add the name of the new Secure Boot capability. This allows SELinux
policies to properly map CAP_COMPROMISE_KERNEL to the appropriate
@@ -4484,10 +4513,10 @@ index 14d04e6..ed99a2d 100644
1.8.1.2
-From be17631af0e3aa91cdee269ba065271a08ad2352 Mon Sep 17 00:00:00 2001
+From b7c947a5862f33eb44bc33211a89ac1d8fd32475 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Thu, 20 Sep 2012 10:41:02 -0400
-Subject: [PATCH 30/46] Secure boot: Add a dummy kernel parameter that will
+Subject: [PATCH 32/48] Secure boot: Add a dummy kernel parameter that will
switch on Secure Boot mode
This forcibly drops CAP_COMPROMISE_KERNEL from both cap_permitted and cap_bset
@@ -4501,10 +4530,10 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com>
2 files changed, 24 insertions(+)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 6c72381..7dffdd5 100644
+index 4609e81..7c0b137 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
-@@ -2654,6 +2654,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
+@@ -2683,6 +2683,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Note: increases power consumption, thus should only be
enabled if running jitter sensitive (HPC/RT) workloads.
@@ -4550,10 +4579,10 @@ index e0573a4..c3f4e3e 100644
1.8.1.2
-From 4eb5ffe8e7d462f431da2714feb617d82fc50893 Mon Sep 17 00:00:00 2001
+From b218aab3dcc56d27324b2fc170d620e98c726603 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Thu, 20 Sep 2012 10:41:03 -0400
-Subject: [PATCH 31/46] efi: Enable secure boot lockdown automatically when
+Subject: [PATCH 33/48] efi: Enable secure boot lockdown automatically when
enabled in firmware
The firmware has a set of flags that indicate whether secure boot is enabled
@@ -4564,13 +4593,14 @@ EFI_SECURE_BOOT bit for use with efi_enabled.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
---
- Documentation/x86/zero-page.txt | 2 ++
- arch/x86/boot/compressed/eboot.c | 32 ++++++++++++++++++++++++++++++++
- arch/x86/include/uapi/asm/bootparam.h | 3 ++-
- arch/x86/kernel/setup.c | 7 +++++++
- include/linux/cred.h | 2 ++
- include/linux/efi.h | 1 +
- 6 files changed, 46 insertions(+), 1 deletion(-)
+ Documentation/x86/zero-page.txt | 2 ++
+ arch/x86/boot/compressed/eboot.c | 32 ++++++++++++++++++++++++++++++++
+ arch/x86/include/asm/bootparam_utils.h | 8 ++++++--
+ arch/x86/include/uapi/asm/bootparam.h | 3 ++-
+ arch/x86/kernel/setup.c | 7 +++++++
+ include/linux/cred.h | 2 ++
+ include/linux/efi.h | 1 +
+ 7 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/Documentation/x86/zero-page.txt b/Documentation/x86/zero-page.txt
index 199f453..ff651d3 100644
@@ -4586,10 +4616,10 @@ index 199f453..ff651d3 100644
290/040 ALL edd_mbr_sig_buffer EDD MBR signatures
2D0/A00 ALL e820_map E820 memory map table
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
-index f8fa411..96bd86b 100644
+index c205035..96d859d 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
-@@ -849,6 +849,36 @@ fail:
+@@ -861,6 +861,36 @@ fail:
return status;
}
@@ -4626,7 +4656,7 @@ index f8fa411..96bd86b 100644
/*
* Because the x86 boot code expects to be passed a boot_params we
* need to create one ourselves (usually the bootloader would create
-@@ -1143,6 +1173,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table,
+@@ -1155,6 +1185,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table,
if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
goto fail;
@@ -4635,6 +4665,26 @@ index f8fa411..96bd86b 100644
setup_graphics(boot_params);
setup_efi_pci(boot_params);
+diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h
+index ae93f72..05ecc52 100644
+--- a/arch/x86/include/asm/bootparam_utils.h
++++ b/arch/x86/include/asm/bootparam_utils.h
+@@ -22,9 +22,13 @@ static void sanitize_boot_params(struct boot_params *boot_params)
+ memset(&boot_params->olpc_ofw_header, 0,
+ (char *)&boot_params->efi_info -
+ (char *)&boot_params->olpc_ofw_header);
+- memset(&boot_params->kbd_status, 0,
++ memset(&boot_params->kbd_status, 0, sizeof(boot_params->kbd_status));
++ /* don't clear boot_params->secure_boot. we set that ourselves
++ * earlier.
++ */
++ memset(&boot_params->_pad5[0], 0,
+ (char *)&boot_params->hdr -
+- (char *)&boot_params->kbd_status);
++ (char *)&boot_params->_pad5[0]);
+ memset(&boot_params->_pad7[0], 0,
+ (char *)&boot_params->edd_mbr_sig_buffer[0] -
+ (char *)&boot_params->_pad7[0]);
diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h
index c15ddaf..85d7685 100644
--- a/arch/x86/include/uapi/asm/bootparam.h
@@ -4650,10 +4700,10 @@ index c15ddaf..85d7685 100644
* The sentinel is set to a nonzero value (0xff) in header.S.
*
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
-index 8b24289..d74b441 100644
+index 84d3285..2485897 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
-@@ -1042,6 +1042,13 @@ void __init setup_arch(char **cmdline_p)
+@@ -1098,6 +1098,13 @@ void __init setup_arch(char **cmdline_p)
io_delay_init();
@@ -4681,7 +4731,7 @@ index 04421e8..9e69542 100644
* check for validity of credentials
*/
diff --git a/include/linux/efi.h b/include/linux/efi.h
-index 7a9498a..1ae16b6 100644
+index 9bf2f1f..1bf382b 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -627,6 +627,7 @@ extern int __init efi_setup_pcdp_console(char *);
@@ -4696,10 +4746,10 @@ index 7a9498a..1ae16b6 100644
1.8.1.2
-From 66e152817df3a3856ae268ae7c817b42f23d3e55 Mon Sep 17 00:00:00 2001
+From c2a1ee697d989d5d5ba7c5d7c20abf6d320afe74 Mon Sep 17 00:00:00 2001
From: Dave Howells <dhowells@redhat.com>
Date: Tue, 23 Oct 2012 09:30:54 -0400
-Subject: [PATCH 32/46] Add EFI signature data types
+Subject: [PATCH 34/48] Add EFI signature data types
Add the data types that are used for containing hashes, keys and certificates
for cryptographic verification.
@@ -4710,7 +4760,7 @@ Signed-off-by: David Howells <dhowells@redhat.com>
1 file changed, 20 insertions(+)
diff --git a/include/linux/efi.h b/include/linux/efi.h
-index 1ae16b6..de7021d 100644
+index 1bf382b..8902faf 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -388,6 +388,12 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
@@ -4751,10 +4801,10 @@ index 1ae16b6..de7021d 100644
1.8.1.2
-From 620c32412493f6a5e961a2e7636c8785c14ff21e Mon Sep 17 00:00:00 2001
+From 03401c77362c324756e7f4ce3b0e72f06e79e0d7 Mon Sep 17 00:00:00 2001
From: Dave Howells <dhowells@redhat.com>
Date: Tue, 23 Oct 2012 09:36:28 -0400
-Subject: [PATCH 33/46] Add an EFI signature blob parser and key loader.
+Subject: [PATCH 35/48] Add an EFI signature blob parser and key loader.
X.509 certificates are loaded into the specified keyring as asymmetric type
keys.
@@ -4913,7 +4963,7 @@ index 0000000..424896a
+ return 0;
+}
diff --git a/include/linux/efi.h b/include/linux/efi.h
-index de7021d..64b3e55 100644
+index 8902faf..ff3c599 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -612,6 +612,10 @@ extern int efi_set_rtc_mmss(unsigned long nowtime);
@@ -4931,10 +4981,10 @@ index de7021d..64b3e55 100644
1.8.1.2
-From 03476516aa5a12706ee151344b36f759c67a5030 Mon Sep 17 00:00:00 2001
+From 5f7f02ad9d46cf93090a0aed55530c44ce96cb96 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 26 Oct 2012 12:36:24 -0400
-Subject: [PATCH 34/46] KEYS: Add a system blacklist keyring
+Subject: [PATCH 36/48] KEYS: Add a system blacklist keyring
This adds an additional keyring that is used to store certificates that
are blacklisted. This keyring is searched first when loading signed modules
@@ -4965,10 +5015,10 @@ index 8dabc39..e466de1 100644
#endif /* _KEYS_SYSTEM_KEYRING_H */
diff --git a/init/Kconfig b/init/Kconfig
-index e05877b..2e82b25 100644
+index e988655..3cac597 100644
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1580,6 +1580,15 @@ config SYSTEM_TRUSTED_KEYRING
+@@ -1587,6 +1587,15 @@ config SYSTEM_TRUSTED_KEYRING
Keys in this keyring are used by module signature checking.
@@ -5046,10 +5096,10 @@ index dae8778..2913c70 100644
1.8.1.2
-From 8ac54dcfcae74c88919cf4713bf5e3946ed7d6df Mon Sep 17 00:00:00 2001
+From 4fa15a799f5955b7f82b83953fc6726f9113e385 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 26 Oct 2012 12:42:16 -0400
-Subject: [PATCH 35/46] MODSIGN: Import certificates from UEFI Secure Boot
+Subject: [PATCH 37/48] MODSIGN: Import certificates from UEFI Secure Boot
Secure Boot stores a list of allowed certificates in the 'db' variable.
This imports those certificates into the system trusted keyring. This
@@ -5074,7 +5124,7 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com>
create mode 100644 kernel/modsign_uefi.c
diff --git a/include/linux/efi.h b/include/linux/efi.h
-index 64b3e55..76fe526 100644
+index ff3c599..8400949 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -394,6 +394,12 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
@@ -5091,12 +5141,12 @@ index 64b3e55..76fe526 100644
efi_guid_t guid;
u64 table;
diff --git a/init/Kconfig b/init/Kconfig
-index 2e82b25..143f898 100644
+index 3cac597..e7e0216 100644
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1687,6 +1687,15 @@ config MODULE_SIG_FORCE
- Reject unsigned modules or signed modules for which we don't have a
- key. Without this, such modules will simply taint the kernel.
+@@ -1705,6 +1705,15 @@ config MODULE_SIG_ALL
+ comment "Do not forget to sign required modules with scripts/sign-file"
+ depends on MODULE_SIG_FORCE && !MODULE_SIG_ALL
+config MODULE_SIG_UEFI
+ bool "Allow modules signed with certs stored in UEFI"
@@ -5111,10 +5161,10 @@ index 2e82b25..143f898 100644
prompt "Which hash algorithm should modules be signed with?"
depends on MODULE_SIG
diff --git a/kernel/Makefile b/kernel/Makefile
-index 0ca8c0a..25af667 100644
+index c94d081..94be1fc 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
-@@ -56,6 +56,7 @@ obj-$(CONFIG_UID16) += uid16.o
+@@ -54,6 +54,7 @@ obj-$(CONFIG_UID16) += uid16.o
obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_MODULE_SIG) += module_signing.o
@@ -5122,7 +5172,7 @@ index 0ca8c0a..25af667 100644
obj-$(CONFIG_KALLSYMS) += kallsyms.o
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
obj-$(CONFIG_KEXEC) += kexec.o
-@@ -115,6 +116,8 @@ obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
+@@ -113,6 +114,8 @@ obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
$(obj)/configs.o: $(obj)/config_data.h
@@ -5232,10 +5282,10 @@ index 0000000..df831ff
1.8.1.2
-From 14963f73dc1daf7932262c4128a49bf4c2737ac3 Mon Sep 17 00:00:00 2001
+From 439626853a29ad3a731d5563a0ee82645eb4f012 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Thu, 20 Sep 2012 10:40:57 -0400
-Subject: [PATCH 36/46] PCI: Lock down BAR access in secure boot environments
+Subject: [PATCH 38/48] PCI: Lock down BAR access in secure boot environments
Any hardware that can potentially generate DMA has to be locked down from
userspace in order to avoid it being possible for an attacker to cause
@@ -5284,7 +5334,7 @@ index 9c6e9bb..b966089 100644
}
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
-index 9b8505c..35580bc 100644
+index 0b00947..7639f68 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -139,6 +139,9 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
@@ -5333,10 +5383,10 @@ index e1c1ec5..97e785f 100644
1.8.1.2
-From 0795d98bc16865e22d35e43534b2db96fc140cd1 Mon Sep 17 00:00:00 2001
+From 55d73bfee2d162dadf4f697cfeb1235a68c90aa8 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Thu, 20 Sep 2012 10:40:58 -0400
-Subject: [PATCH 37/46] x86: Lock down IO port access in secure boot
+Subject: [PATCH 39/48] x86: Lock down IO port access in secure boot
environments
IO port access would permit users to gain access to PCI configuration
@@ -5351,7 +5401,7 @@ Signed-off-by: Matthew Garrett <mjg@redhat.com>
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
-index 8c96897..a2578c4 100644
+index 4ddaf66..f505995 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -28,7 +28,7 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
@@ -5363,7 +5413,7 @@ index 8c96897..a2578c4 100644
return -EPERM;
/*
-@@ -102,7 +102,7 @@ long sys_iopl(unsigned int level, struct pt_regs *regs)
+@@ -103,7 +103,7 @@ SYSCALL_DEFINE1(iopl, unsigned int, level)
return -EINVAL;
/* Trying to gain more privileges? */
if (level > old) {
@@ -5373,12 +5423,12 @@ index 8c96897..a2578c4 100644
}
regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index c6fa3bc..fc28099 100644
+index 2c644af..7eee4d8 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -597,6 +597,9 @@ static ssize_t write_port(struct file *file, const char __user *buf,
unsigned long i = *ppos;
- const char __user * tmp = buf;
+ const char __user *tmp = buf;
+ if (!capable(CAP_COMPROMISE_KERNEL))
+ return -EPERM;
@@ -5390,10 +5440,10 @@ index c6fa3bc..fc28099 100644
1.8.1.2
-From 22aed1e0667a2032e407c3faafeed1503abd3f22 Mon Sep 17 00:00:00 2001
+From 985b096320b1689dbe91a97e999d0607f5461068 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Thu, 20 Sep 2012 10:40:59 -0400
-Subject: [PATCH 38/46] ACPI: Limit access to custom_method
+Subject: [PATCH 40/48] ACPI: Limit access to custom_method
It must be impossible for even root to get code executed in kernel context
under a secure boot environment. custom_method effectively allows arbitrary
@@ -5405,7 +5455,7 @@ Signed-off-by: Matthew Garrett <mjg@redhat.com>
1 file changed, 3 insertions(+)
diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c
-index 5d42c24..247d58b 100644
+index 12b62f2..edf0710 100644
--- a/drivers/acpi/custom_method.c
+++ b/drivers/acpi/custom_method.c
@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
@@ -5422,10 +5472,10 @@ index 5d42c24..247d58b 100644
1.8.1.2
-From f283bb6b091b903122ac1d75da3e73c078402cf1 Mon Sep 17 00:00:00 2001
+From 6fe8ea348f67771efa9738b4484e658521f42d1e Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Thu, 20 Sep 2012 10:41:00 -0400
-Subject: [PATCH 39/46] asus-wmi: Restrict debugfs interface
+Subject: [PATCH 41/48] asus-wmi: Restrict debugfs interface
We have no way of validating what all of the Asus WMI methods do on a
given machine, and there's a risk that some will allow hardware state to
@@ -5438,10 +5488,10 @@ Signed-off-by: Matthew Garrett <mjg@redhat.com>
1 file changed, 9 insertions(+)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
-index f80ae4d..059195f 100644
+index c11b242..6d5f88f 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
-@@ -1521,6 +1521,9 @@ static int show_dsts(struct seq_file *m, void *data)
+@@ -1617,6 +1617,9 @@ static int show_dsts(struct seq_file *m, void *data)
int err;
u32 retval = -1;
@@ -5451,7 +5501,7 @@ index f80ae4d..059195f 100644
err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval);
if (err < 0)
-@@ -1537,6 +1540,9 @@ static int show_devs(struct seq_file *m, void *data)
+@@ -1633,6 +1636,9 @@ static int show_devs(struct seq_file *m, void *data)
int err;
u32 retval = -1;
@@ -5461,7 +5511,7 @@ index f80ae4d..059195f 100644
err = asus_wmi_set_devstate(asus->debug.dev_id, asus->debug.ctrl_param,
&retval);
-@@ -1561,6 +1567,9 @@ static int show_call(struct seq_file *m, void *data)
+@@ -1657,6 +1663,9 @@ static int show_call(struct seq_file *m, void *data)
union acpi_object *obj;
acpi_status status;
@@ -5475,10 +5525,10 @@ index f80ae4d..059195f 100644
1.8.1.2
-From f8aa6f1cf4fbd8c4431dc71d718365ee7e59c961 Mon Sep 17 00:00:00 2001
+From ddaafd6f64c317ad0fc33d06449e01632883b4b3 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Thu, 20 Sep 2012 10:41:01 -0400
-Subject: [PATCH 40/46] Restrict /dev/mem and /dev/kmem in secure boot setups
+Subject: [PATCH 42/48] Restrict /dev/mem and /dev/kmem in secure boot setups
Allowing users to write to address space makes it possible for the kernel
to be subverted. Restrict this when we need to protect the kernel.
@@ -5489,7 +5539,7 @@ Signed-off-by: Matthew Garrett <mjg@redhat.com>
1 file changed, 6 insertions(+)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index fc28099..b5df7a8 100644
+index 7eee4d8..772ee2b 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -158,6 +158,9 @@ static ssize_t write_mem(struct file *file, const char __user *buf,
@@ -5503,7 +5553,7 @@ index fc28099..b5df7a8 100644
return -EFAULT;
@@ -530,6 +533,9 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
- char * kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */
+ char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */
int err = 0;
+ if (!capable(CAP_COMPROMISE_KERNEL))
@@ -5516,10 +5566,10 @@ index fc28099..b5df7a8 100644
1.8.1.2
-From 0363f298cfa74fb6d3f01f3351b2a4cad2e25d8f Mon Sep 17 00:00:00 2001
+From acb828bd8b69f66957865a66420e543bf0666b21 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Thu, 20 Sep 2012 10:41:04 -0400
-Subject: [PATCH 41/46] acpi: Ignore acpi_rsdp kernel parameter in a secure
+Subject: [PATCH 43/48] acpi: Ignore acpi_rsdp kernel parameter in a secure
boot environment
This option allows userspace to pass the RSDP address to the kernel. This
@@ -5535,10 +5585,10 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
-index bd22f86..d68c04f 100644
+index 586e7e9..8950454 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
-@@ -246,7 +246,7 @@ early_param("acpi_rsdp", setup_acpi_rsdp);
+@@ -245,7 +245,7 @@ early_param("acpi_rsdp", setup_acpi_rsdp);
acpi_physical_address __init acpi_os_get_root_pointer(void)
{
#ifdef CONFIG_KEXEC
@@ -5551,10 +5601,10 @@ index bd22f86..d68c04f 100644
1.8.1.2
-From 40ec2252761b1574d3ee0ed639b117e40075cdee Mon Sep 17 00:00:00 2001
+From 0d76357d15402c418cf3345239462e30062a3245 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Tue, 4 Sep 2012 11:55:13 -0400
-Subject: [PATCH 42/46] kexec: Disable in a secure boot environment
+Subject: [PATCH 44/48] kexec: Disable in a secure boot environment
kexec could be used as a vector for a malicious user to use a signed kernel
to circumvent the secure boot trust model. In the long run we'll want to
@@ -5567,10 +5617,10 @@ Signed-off-by: Matthew Garrett <mjg@redhat.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kexec.c b/kernel/kexec.c
-index 5e4bd78..dd464e0 100644
+index bddd3d7..cbdb930 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
-@@ -943,7 +943,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
+@@ -946,7 +946,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
int result;
/* We only trust the superuser with rebooting the system. */
@@ -5583,10 +5633,10 @@ index 5e4bd78..dd464e0 100644
1.8.1.2
-From f2242ba8cc35f8a89e7a8df46fac08bed9b86080 Mon Sep 17 00:00:00 2001
+From 8ef1f60c8c529785450ee97365714c940d4f2d8e Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 5 Oct 2012 10:12:48 -0400
-Subject: [PATCH 43/46] MODSIGN: Always enforce module signing in a Secure Boot
+Subject: [PATCH 45/48] MODSIGN: Always enforce module signing in a Secure Boot
environment
If a machine is booted into a Secure Boot environment, we need to
@@ -5626,7 +5676,7 @@ index c3f4e3e..c5554e0 100644
/* Dummy Secure Boot enable option to fake out UEFI SB=1 */
diff --git a/kernel/module.c b/kernel/module.c
-index eab0827..93a16dc 100644
+index 0925c9a..af4a476 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -109,9 +109,9 @@ struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */
@@ -5645,10 +5695,10 @@ index eab0827..93a16dc 100644
1.8.1.2
-From 5356f058f306024cb085b6b2c6ba39407a3a2fae Mon Sep 17 00:00:00 2001
+From b1e2ed158dd5ba3e18a9542802bdeb9d762f0656 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Fri, 26 Oct 2012 14:02:09 -0400
-Subject: [PATCH 44/46] hibernate: Disable in a Secure Boot environment
+Subject: [PATCH 46/48] hibernate: Disable in a Secure Boot environment
There is currently no way to verify the resume image when returning
from hibernate. This might compromise the secure boot trust model,
@@ -5717,7 +5767,7 @@ index b26f5f1..7f63cb4 100644
len = p ? p - buf : n;
diff --git a/kernel/power/main.c b/kernel/power/main.c
-index 1c16f91..4f915fc 100644
+index d77663b..78f8ed5 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -15,6 +15,7 @@
@@ -5759,10 +5809,10 @@ index 4ed81e7..b11a0f4 100644
1.8.1.2
-From 063f12d80498c1c2799022ced6aa1399234da409 Mon Sep 17 00:00:00 2001
+From 4c086b0bca62d3028dfd4faf6e6852ce59788333 Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Tue, 5 Feb 2013 19:25:05 -0500
-Subject: [PATCH 45/46] efi: Disable secure boot if shim is in insecure mode
+Subject: [PATCH 47/48] efi: Disable secure boot if shim is in insecure mode
A user can manually tell the shim boot loader to disable validation of
images it loads. When a user does this, it creates a UEFI variable called
@@ -5776,10 +5826,10 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com>
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
-index 96bd86b..6e1331c 100644
+index 96d859d..c9ffd2f 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
-@@ -851,8 +851,9 @@ fail:
+@@ -863,8 +863,9 @@ fail:
static int get_secure_boot(efi_system_table_t *_table)
{
@@ -5790,7 +5840,7 @@ index 96bd86b..6e1331c 100644
efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID;
efi_status_t status;
-@@ -876,6 +877,23 @@ static int get_secure_boot(efi_system_table_t *_table)
+@@ -888,6 +889,23 @@ static int get_secure_boot(efi_system_table_t *_table)
if (setup == 1)
return 0;
@@ -5818,10 +5868,10 @@ index 96bd86b..6e1331c 100644
1.8.1.2
-From b8cdeb4d1ab3939d9c70e2377d22922ef74a38c7 Mon Sep 17 00:00:00 2001
+From 8225ade084c6137223579c69f17677fdd994940c Mon Sep 17 00:00:00 2001
From: Kees Cook <keescook@chromium.org>
Date: Fri, 8 Feb 2013 11:12:13 -0800
-Subject: [PATCH 46/46] x86: Lock down MSR writing in secure boot
+Subject: [PATCH 48/48] x86: Lock down MSR writing in secure boot
Writing to MSRs should not be allowed unless CAP_COMPROMISE_KERNEL is
set since it could lead to execution of arbitrary code in kernel mode.
@@ -5832,7 +5882,7 @@ Signed-off-by: Kees Cook <keescook@chromium.org>
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
-index 4929502..adaab3d 100644
+index ce13049..fa4dc6c 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -103,6 +103,9 @@ static ssize_t msr_write(struct file *file, const char __user *buf,
diff --git a/freed-ora/current/master/dmar-disable-when-ricoh-multifunction.patch b/freed-ora/current/master/dmar-disable-when-ricoh-multifunction.patch
deleted file mode 100644
index 839db5940..000000000
--- a/freed-ora/current/master/dmar-disable-when-ricoh-multifunction.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From da7662784dcced04a5b7a3a5b2bbb8276d699522 Mon Sep 17 00:00:00 2001
-From: Kyle McMartin <kyle@mcmartin.ca>
-Date: Sun, 17 Oct 2010 15:55:32 -0400
-Subject: [PATCH] dmar: disable if ricoh multifunction detected
-
----
- drivers/pci/intel-iommu.c | 10 ++++++++++
- 1 files changed, 10 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
-index 4789f8e..5923914 100644
---- a/drivers/iommu/intel-iommu.c
-+++ b/drivers/iommu/intel-iommu.c
-@@ -3784,6 +3784,16 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_g
- DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt);
- DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt);
-
-+/* https://bugzilla.redhat.com/show_bug.cgi?id=605888 */
-+static void quirk_ricoh_multifunction(struct pci_dev *dev)
-+{
-+ dmar_disabled = 1;
-+}
-+DECLARE_PCI_FIXUP_HEADER(0x1180, 0xe822, quirk_ricoh_multifunction);
-+DECLARE_PCI_FIXUP_HEADER(0x1180, 0xe230, quirk_ricoh_multifunction);
-+DECLARE_PCI_FIXUP_HEADER(0x1180, 0xe832, quirk_ricoh_multifunction);
-+DECLARE_PCI_FIXUP_HEADER(0x1180, 0xe476, quirk_ricoh_multifunction);
-+
- /* On Tylersburg chipsets, some BIOSes have been known to enable the
- ISOCH DMAR unit for the Azalia sound device, but not give it any
- TLB entries, which causes it to deadlock. Check for that. We do
---
-1.7.3.1
-
diff --git a/freed-ora/current/master/drm-i915-dp-stfu.patch b/freed-ora/current/master/drm-i915-dp-stfu.patch
index c005a06ba..78fb5fe60 100644
--- a/freed-ora/current/master/drm-i915-dp-stfu.patch
+++ b/freed-ora/current/master/drm-i915-dp-stfu.patch
@@ -1,8 +1,8 @@
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
-index 296cfc2..516e1e2 100644
+index f61cb79..64a24c0 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
-@@ -350,7 +350,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp)
+@@ -315,7 +315,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp)
if (!is_edp(intel_dp))
return;
if (!ironlake_edp_have_panel_power(intel_dp) && !ironlake_edp_have_panel_vdd(intel_dp)) {
@@ -11,16 +11,16 @@ index 296cfc2..516e1e2 100644
DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n",
I915_READ(PCH_PP_STATUS),
I915_READ(PCH_PP_CONTROL));
-@@ -400,7 +400,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
+@@ -446,7 +446,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
}
if (try == 3) {
- WARN(1, "dp_aux_ch not started status 0x%08x\n",
+ DRM_ERROR("dp_aux_ch not started status 0x%08x\n",
I915_READ(ch_ctl));
- return -EBUSY;
- }
-@@ -1024,8 +1024,8 @@ static void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
+ ret = -EBUSY;
+ goto out;
+@@ -1083,8 +1083,8 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
return;
DRM_DEBUG_KMS("Turn eDP VDD on\n");
@@ -31,7 +31,7 @@ index 296cfc2..516e1e2 100644
intel_dp->want_panel_vdd = true;
-@@ -1090,7 +1090,8 @@ static void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
+@@ -1151,7 +1151,8 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
return;
DRM_DEBUG_KMS("Turn eDP VDD off %d\n", intel_dp->want_panel_vdd);
@@ -41,7 +41,7 @@ index 296cfc2..516e1e2 100644
intel_dp->want_panel_vdd = false;
-@@ -1160,7 +1161,8 @@ static void ironlake_edp_panel_off(struct intel_dp *intel_dp)
+@@ -1221,7 +1222,8 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp)
DRM_DEBUG_KMS("Turn eDP power off\n");
@@ -50,4 +50,4 @@ index 296cfc2..516e1e2 100644
+ DRM_ERROR("Need VDD to turn off panel\n");
pp = ironlake_get_pp_control(dev_priv);
- pp &= ~(POWER_TARGET_ON | PANEL_POWER_RESET | EDP_BLC_ENABLE);
+ /* We need to switch off panel power _and_ force vdd, for otherwise some
diff --git a/freed-ora/current/master/drm-qxl-driver.patch b/freed-ora/current/master/drm-qxl-driver.patch
new file mode 100644
index 000000000..6a6bf111d
--- /dev/null
+++ b/freed-ora/current/master/drm-qxl-driver.patch
@@ -0,0 +1,7444 @@
+From 1a401a749cb1f06e637ef0e91fb8c120963aa356 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@gmail.com>
+Date: Mon, 25 Feb 2013 14:47:55 +1000
+Subject: [PATCH 2/2] drm: add new QXL driver. (v1.3)
+
+QXL is a paravirtual graphics device used by the Spice virtual desktop
+interface.
+
+The drivers uses GEM and TTM to manage memory, the qxl hw fencing however
+is quite different than normal TTM expects, we have to keep track of a number
+of non-linear fence ids per bo that we need to have released by the hardware.
+
+The releases are freed from a workqueue that wakes up and processes the
+release ring.
+
+releases are suballocated from a BO, there are 3 release categories, drawables,
+surfaces and cursor cmds. The hw also has 3 rings for commands, cursor and release handling.
+
+The hardware also have a surface id tracking mechnaism and the driver encapsulates it completely inside the kernel, userspace never sees the actual hw surface
+ids.
+
+This requires a newer version of the QXL userspace driver, so shouldn't be
+enabled until that has been placed into your distro of choice.
+
+Authors: Dave Airlie, Alon Levy
+
+v1.1: fixup some issues in the ioctl interface with padding
+v1.2: add module device table
+v1.3: fix nomodeset, fbcon leak, dumb bo create, release ring irq,
+ don't try flush release ring (broken hw), fix -modesetting.
+
+Signed-off-by: Alon Levy <alevy@redhat.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+---
+ drivers/gpu/drm/Kconfig | 2 +
+ drivers/gpu/drm/Makefile | 1 +
+ drivers/gpu/drm/qxl/Kconfig | 10 +
+ drivers/gpu/drm/qxl/Makefile | 9 +
+ drivers/gpu/drm/qxl/qxl_cmd.c | 707 +++++++++++++++++++++++++++
+ drivers/gpu/drm/qxl/qxl_debugfs.c | 135 ++++++
+ drivers/gpu/drm/qxl/qxl_dev.h | 879 ++++++++++++++++++++++++++++++++++
+ drivers/gpu/drm/qxl/qxl_display.c | 981 ++++++++++++++++++++++++++++++++++++++
+ drivers/gpu/drm/qxl/qxl_draw.c | 384 +++++++++++++++
+ drivers/gpu/drm/qxl/qxl_drv.c | 145 ++++++
+ drivers/gpu/drm/qxl/qxl_drv.h | 566 ++++++++++++++++++++++
+ drivers/gpu/drm/qxl/qxl_dumb.c | 93 ++++
+ drivers/gpu/drm/qxl/qxl_fb.c | 567 ++++++++++++++++++++++
+ drivers/gpu/drm/qxl/qxl_fence.c | 97 ++++
+ drivers/gpu/drm/qxl/qxl_gem.c | 178 +++++++
+ drivers/gpu/drm/qxl/qxl_image.c | 120 +++++
+ drivers/gpu/drm/qxl/qxl_ioctl.c | 411 ++++++++++++++++
+ drivers/gpu/drm/qxl/qxl_irq.c | 97 ++++
+ drivers/gpu/drm/qxl/qxl_kms.c | 302 ++++++++++++
+ drivers/gpu/drm/qxl/qxl_object.c | 365 ++++++++++++++
+ drivers/gpu/drm/qxl/qxl_object.h | 112 +++++
+ drivers/gpu/drm/qxl/qxl_release.c | 307 ++++++++++++
+ drivers/gpu/drm/qxl/qxl_ttm.c | 577 ++++++++++++++++++++++
+ include/uapi/drm/Kbuild | 1 +
+ include/uapi/drm/qxl_drm.h | 152 ++++++
+ 25 files changed, 7198 insertions(+)
+ create mode 100644 drivers/gpu/drm/qxl/Kconfig
+ create mode 100644 drivers/gpu/drm/qxl/Makefile
+ create mode 100644 drivers/gpu/drm/qxl/qxl_cmd.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_debugfs.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_dev.h
+ create mode 100644 drivers/gpu/drm/qxl/qxl_display.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_draw.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_drv.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_drv.h
+ create mode 100644 drivers/gpu/drm/qxl/qxl_dumb.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_fb.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_fence.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_gem.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_image.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_ioctl.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_irq.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_kms.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_object.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_object.h
+ create mode 100644 drivers/gpu/drm/qxl/qxl_release.c
+ create mode 100644 drivers/gpu/drm/qxl/qxl_ttm.c
+ create mode 100644 include/uapi/drm/qxl_drm.h
+
+diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
+index 1e82882..19b8e0d 100644
+--- a/drivers/gpu/drm/Kconfig
++++ b/drivers/gpu/drm/Kconfig
+@@ -220,3 +220,5 @@ source "drivers/gpu/drm/tegra/Kconfig"
+ source "drivers/gpu/drm/omapdrm/Kconfig"
+
+ source "drivers/gpu/drm/tilcdc/Kconfig"
++
++source "drivers/gpu/drm/qxl/Kconfig"
+diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
+index 0d59b24..6a42115 100644
+--- a/drivers/gpu/drm/Makefile
++++ b/drivers/gpu/drm/Makefile
+@@ -52,4 +52,5 @@ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
+ obj-$(CONFIG_DRM_TEGRA) += tegra/
+ obj-$(CONFIG_DRM_OMAP) += omapdrm/
+ obj-$(CONFIG_DRM_TILCDC) += tilcdc/
++obj-$(CONFIG_DRM_QXL) += qxl/
+ obj-y += i2c/
+diff --git a/drivers/gpu/drm/qxl/Kconfig b/drivers/gpu/drm/qxl/Kconfig
+new file mode 100644
+index 0000000..2f1a57e
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/Kconfig
+@@ -0,0 +1,10 @@
++config DRM_QXL
++ tristate "QXL virtual GPU"
++ depends on DRM && PCI
++ select FB_SYS_FILLRECT
++ select FB_SYS_COPYAREA
++ select FB_SYS_IMAGEBLIT
++ select DRM_KMS_HELPER
++ select DRM_TTM
++ help
++ QXL virtual GPU for Spice virtualization desktop integration. Do not enable this driver unless your distro ships a corresponding X.org QXL driver that can handle kernel modesetting.
+diff --git a/drivers/gpu/drm/qxl/Makefile b/drivers/gpu/drm/qxl/Makefile
+new file mode 100644
+index 0000000..ea046ba
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/Makefile
+@@ -0,0 +1,9 @@
++#
++# Makefile for the drm device driver. This driver provides support for the
++# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
++
++ccflags-y := -Iinclude/drm
++
++qxl-y := qxl_drv.o qxl_kms.o qxl_display.o qxl_ttm.o qxl_fb.o qxl_object.o qxl_gem.o qxl_cmd.o qxl_image.o qxl_draw.o qxl_debugfs.o qxl_irq.o qxl_dumb.o qxl_ioctl.o qxl_fence.o qxl_release.o
++
++obj-$(CONFIG_DRM_QXL)+= qxl.o
+diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c
+new file mode 100644
+index 0000000..804b411
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_cmd.c
+@@ -0,0 +1,707 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++/* QXL cmd/ring handling */
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++static int qxl_reap_surface_id(struct qxl_device *qdev, int max_to_reap);
++
++struct ring {
++ struct qxl_ring_header header;
++ uint8_t elements[0];
++};
++
++struct qxl_ring {
++ struct ring *ring;
++ int element_size;
++ int n_elements;
++ int prod_notify;
++ wait_queue_head_t *push_event;
++ spinlock_t lock;
++};
++
++void qxl_ring_free(struct qxl_ring *ring)
++{
++ kfree(ring);
++}
++
++struct qxl_ring *
++qxl_ring_create(struct qxl_ring_header *header,
++ int element_size,
++ int n_elements,
++ int prod_notify,
++ bool set_prod_notify,
++ wait_queue_head_t *push_event)
++{
++ struct qxl_ring *ring;
++
++ ring = kmalloc(sizeof(*ring), GFP_KERNEL);
++ if (!ring)
++ return NULL;
++
++ ring->ring = (struct ring *)header;
++ ring->element_size = element_size;
++ ring->n_elements = n_elements;
++ ring->prod_notify = prod_notify;
++ ring->push_event = push_event;
++ if (set_prod_notify)
++ header->notify_on_prod = ring->n_elements;
++ spin_lock_init(&ring->lock);
++ return ring;
++}
++
++static int qxl_check_header(struct qxl_ring *ring)
++{
++ int ret;
++ struct qxl_ring_header *header = &(ring->ring->header);
++ unsigned long flags;
++ spin_lock_irqsave(&ring->lock, flags);
++ ret = header->prod - header->cons < header->num_items;
++ if (ret == 0)
++ header->notify_on_cons = header->cons + 1;
++ spin_unlock_irqrestore(&ring->lock, flags);
++ return ret;
++}
++
++static int qxl_check_idle(struct qxl_ring *ring)
++{
++ int ret;
++ struct qxl_ring_header *header = &(ring->ring->header);
++ unsigned long flags;
++ spin_lock_irqsave(&ring->lock, flags);
++ ret = header->prod == header->cons;
++ spin_unlock_irqrestore(&ring->lock, flags);
++ return ret;
++}
++
++int qxl_ring_push(struct qxl_ring *ring,
++ const void *new_elt, bool interruptible)
++{
++ struct qxl_ring_header *header = &(ring->ring->header);
++ uint8_t *elt;
++ int idx, ret;
++ unsigned long flags;
++ spin_lock_irqsave(&ring->lock, flags);
++ if (header->prod - header->cons == header->num_items) {
++ header->notify_on_cons = header->cons + 1;
++ mb();
++ spin_unlock_irqrestore(&ring->lock, flags);
++ if (!drm_can_sleep()) {
++ while (!qxl_check_header(ring))
++ udelay(1);
++ } else {
++ if (interruptible) {
++ ret = wait_event_interruptible(*ring->push_event,
++ qxl_check_header(ring));
++ if (ret)
++ return ret;
++ } else {
++ wait_event(*ring->push_event,
++ qxl_check_header(ring));
++ }
++
++ }
++ spin_lock_irqsave(&ring->lock, flags);
++ }
++
++ idx = header->prod & (ring->n_elements - 1);
++ elt = ring->ring->elements + idx * ring->element_size;
++
++ memcpy((void *)elt, new_elt, ring->element_size);
++
++ header->prod++;
++
++ mb();
++
++ if (header->prod == header->notify_on_prod)
++ outb(0, ring->prod_notify);
++
++ spin_unlock_irqrestore(&ring->lock, flags);
++ return 0;
++}
++
++bool qxl_ring_pop(struct qxl_ring *ring,
++ void *element)
++{
++ volatile struct qxl_ring_header *header = &(ring->ring->header);
++ volatile uint8_t *ring_elt;
++ int idx;
++ unsigned long flags;
++ spin_lock_irqsave(&ring->lock, flags);
++ if (header->cons == header->prod) {
++ header->notify_on_prod = header->cons + 1;
++ spin_unlock_irqrestore(&ring->lock, flags);
++ return false;
++ }
++
++ idx = header->cons & (ring->n_elements - 1);
++ ring_elt = ring->ring->elements + idx * ring->element_size;
++
++ memcpy(element, (void *)ring_elt, ring->element_size);
++
++ header->cons++;
++
++ spin_unlock_irqrestore(&ring->lock, flags);
++ return true;
++}
++
++void qxl_ring_wait_idle(struct qxl_ring *ring)
++{
++ struct qxl_ring_header *header = &(ring->ring->header);
++ unsigned long flags;
++
++ spin_lock_irqsave(&ring->lock, flags);
++ if (ring->ring->header.cons < ring->ring->header.prod) {
++ header->notify_on_cons = header->prod;
++ mb();
++ spin_unlock_irqrestore(&ring->lock, flags);
++ wait_event_interruptible(*ring->push_event,
++ qxl_check_idle(ring));
++ spin_lock_irqsave(&ring->lock, flags);
++ }
++ spin_unlock_irqrestore(&ring->lock, flags);
++}
++
++int
++qxl_push_command_ring_release(struct qxl_device *qdev, struct qxl_release *release,
++ uint32_t type, bool interruptible)
++{
++ struct qxl_command cmd;
++
++ cmd.type = type;
++ cmd.data = qxl_bo_physical_address(qdev, release->bos[0], release->release_offset);
++
++ return qxl_ring_push(qdev->command_ring, &cmd, interruptible);
++}
++
++int
++qxl_push_cursor_ring_release(struct qxl_device *qdev, struct qxl_release *release,
++ uint32_t type, bool interruptible)
++{
++ struct qxl_command cmd;
++
++ cmd.type = type;
++ cmd.data = qxl_bo_physical_address(qdev, release->bos[0], release->release_offset);
++
++ return qxl_ring_push(qdev->cursor_ring, &cmd, interruptible);
++}
++
++bool qxl_queue_garbage_collect(struct qxl_device *qdev, bool flush)
++{
++ if (!qxl_check_idle(qdev->release_ring)) {
++ queue_work(qdev->gc_queue, &qdev->gc_work);
++ if (flush)
++ flush_work(&qdev->gc_work);
++ return true;
++ }
++ return false;
++}
++
++int qxl_garbage_collect(struct qxl_device *qdev)
++{
++ struct qxl_release *release;
++ uint64_t id, next_id;
++ int i = 0;
++ int ret;
++ union qxl_release_info *info;
++
++ while (qxl_ring_pop(qdev->release_ring, &id)) {
++ QXL_INFO(qdev, "popped %lld\n", id);
++ while (id) {
++ release = qxl_release_from_id_locked(qdev, id);
++ if (release == NULL)
++ break;
++
++ ret = qxl_release_reserve(qdev, release, false);
++ if (ret) {
++ qxl_io_log(qdev, "failed to reserve release on garbage collect %lld\n", id);
++ DRM_ERROR("failed to reserve release %lld\n", id);
++ }
++
++ info = qxl_release_map(qdev, release);
++ next_id = info->next;
++ qxl_release_unmap(qdev, release, info);
++
++ qxl_release_unreserve(qdev, release);
++ QXL_INFO(qdev, "popped %lld, next %lld\n", id,
++ next_id);
++
++ switch (release->type) {
++ case QXL_RELEASE_DRAWABLE:
++ case QXL_RELEASE_SURFACE_CMD:
++ case QXL_RELEASE_CURSOR_CMD:
++ break;
++ default:
++ DRM_ERROR("unexpected release type\n");
++ break;
++ }
++ id = next_id;
++
++ qxl_release_free(qdev, release);
++ ++i;
++ }
++ }
++
++ QXL_INFO(qdev, "%s: %lld\n", __func__, i);
++
++ return i;
++}
++
++int qxl_alloc_bo_reserved(struct qxl_device *qdev, unsigned long size,
++ struct qxl_bo **_bo)
++{
++ struct qxl_bo *bo;
++ int ret;
++
++ ret = qxl_bo_create(qdev, size, false /* not kernel - device */,
++ QXL_GEM_DOMAIN_VRAM, NULL, &bo);
++ if (ret) {
++ DRM_ERROR("failed to allocate VRAM BO\n");
++ return ret;
++ }
++ ret = qxl_bo_reserve(bo, false);
++ if (unlikely(ret != 0))
++ goto out_unref;
++
++ *_bo = bo;
++ return 0;
++out_unref:
++ qxl_bo_unref(&bo);
++ return 0;
++}
++
++static int wait_for_io_cmd_user(struct qxl_device *qdev, uint8_t val, long port)
++{
++ int irq_num;
++ long addr = qdev->io_base + port;
++ int ret;
++
++ mutex_lock(&qdev->async_io_mutex);
++ irq_num = atomic_read(&qdev->irq_received_io_cmd);
++
++
++ if (qdev->last_sent_io_cmd > irq_num) {
++ ret = wait_event_interruptible(qdev->io_cmd_event,
++ atomic_read(&qdev->irq_received_io_cmd) > irq_num);
++ if (ret)
++ goto out;
++ irq_num = atomic_read(&qdev->irq_received_io_cmd);
++ }
++ outb(val, addr);
++ qdev->last_sent_io_cmd = irq_num + 1;
++ ret = wait_event_interruptible(qdev->io_cmd_event,
++ atomic_read(&qdev->irq_received_io_cmd) > irq_num);
++out:
++ mutex_unlock(&qdev->async_io_mutex);
++ return ret;
++}
++
++static void wait_for_io_cmd(struct qxl_device *qdev, uint8_t val, long port)
++{
++ int ret;
++
++restart:
++ ret = wait_for_io_cmd_user(qdev, val, port);
++ if (ret == -ERESTARTSYS)
++ goto restart;
++}
++
++int qxl_io_update_area(struct qxl_device *qdev, struct qxl_bo *surf,
++ const struct qxl_rect *area)
++{
++ int surface_id;
++ uint32_t surface_width, surface_height;
++ int ret;
++
++ if (!surf->hw_surf_alloc)
++ DRM_ERROR("got io update area with no hw surface\n");
++
++ if (surf->is_primary)
++ surface_id = 0;
++ else
++ surface_id = surf->surface_id;
++ surface_width = surf->surf.width;
++ surface_height = surf->surf.height;
++
++ if (area->left < 0 || area->top < 0 ||
++ area->right > surface_width || area->bottom > surface_height) {
++ qxl_io_log(qdev, "%s: not doing area update for "
++ "%d, (%d,%d,%d,%d) (%d,%d)\n", __func__, surface_id, area->left,
++ area->top, area->right, area->bottom, surface_width, surface_height);
++ return -EINVAL;
++ }
++ mutex_lock(&qdev->update_area_mutex);
++ qdev->ram_header->update_area = *area;
++ qdev->ram_header->update_surface = surface_id;
++ ret = wait_for_io_cmd_user(qdev, 0, QXL_IO_UPDATE_AREA_ASYNC);
++ mutex_unlock(&qdev->update_area_mutex);
++ return ret;
++}
++
++void qxl_io_notify_oom(struct qxl_device *qdev)
++{
++ outb(0, qdev->io_base + QXL_IO_NOTIFY_OOM);
++}
++
++void qxl_io_flush_release(struct qxl_device *qdev)
++{
++ outb(0, qdev->io_base + QXL_IO_FLUSH_RELEASE);
++}
++
++void qxl_io_flush_surfaces(struct qxl_device *qdev)
++{
++ wait_for_io_cmd(qdev, 0, QXL_IO_FLUSH_SURFACES_ASYNC);
++}
++
++
++void qxl_io_destroy_primary(struct qxl_device *qdev)
++{
++ wait_for_io_cmd(qdev, 0, QXL_IO_DESTROY_PRIMARY_ASYNC);
++}
++
++void qxl_io_create_primary(struct qxl_device *qdev, unsigned width,
++ unsigned height, unsigned offset, struct qxl_bo *bo)
++{
++ struct qxl_surface_create *create;
++
++ QXL_INFO(qdev, "%s: qdev %p, ram_header %p\n", __func__, qdev,
++ qdev->ram_header);
++ create = &qdev->ram_header->create_surface;
++ create->format = bo->surf.format;
++ create->width = width;
++ create->height = height;
++ create->stride = bo->surf.stride;
++ create->mem = qxl_bo_physical_address(qdev, bo, offset);
++
++ QXL_INFO(qdev, "%s: mem = %llx, from %p\n", __func__, create->mem,
++ bo->kptr);
++
++ create->flags = QXL_SURF_FLAG_KEEP_DATA;
++ create->type = QXL_SURF_TYPE_PRIMARY;
++
++ wait_for_io_cmd(qdev, 0, QXL_IO_CREATE_PRIMARY_ASYNC);
++}
++
++void qxl_io_memslot_add(struct qxl_device *qdev, uint8_t id)
++{
++ QXL_INFO(qdev, "qxl_memslot_add %d\n", id);
++ wait_for_io_cmd(qdev, id, QXL_IO_MEMSLOT_ADD_ASYNC);
++}
++
++void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...)
++{
++ va_list args;
++
++ va_start(args, fmt);
++ vsnprintf(qdev->ram_header->log_buf, QXL_LOG_BUF_SIZE, fmt, args);
++ va_end(args);
++ /*
++ * DO not do a DRM output here - this will call printk, which will
++ * call back into qxl for rendering (qxl_fb)
++ */
++ outb(0, qdev->io_base + QXL_IO_LOG);
++}
++
++void qxl_io_reset(struct qxl_device *qdev)
++{
++ outb(0, qdev->io_base + QXL_IO_RESET);
++}
++
++void qxl_io_monitors_config(struct qxl_device *qdev)
++{
++ qxl_io_log(qdev, "%s: %d [%dx%d+%d+%d]\n", __func__,
++ qdev->monitors_config ?
++ qdev->monitors_config->count : -1,
++ qdev->monitors_config && qdev->monitors_config->count ?
++ qdev->monitors_config->heads[0].width : -1,
++ qdev->monitors_config && qdev->monitors_config->count ?
++ qdev->monitors_config->heads[0].height : -1,
++ qdev->monitors_config && qdev->monitors_config->count ?
++ qdev->monitors_config->heads[0].x : -1,
++ qdev->monitors_config && qdev->monitors_config->count ?
++ qdev->monitors_config->heads[0].y : -1
++ );
++
++ wait_for_io_cmd(qdev, 0, QXL_IO_MONITORS_CONFIG_ASYNC);
++}
++
++int qxl_surface_id_alloc(struct qxl_device *qdev,
++ struct qxl_bo *surf)
++{
++ uint32_t handle = -ENOMEM;
++ int idr_ret;
++ int count = 0;
++again:
++ if (idr_pre_get(&qdev->surf_id_idr, GFP_ATOMIC) == 0) {
++ DRM_ERROR("Out of memory for surf idr\n");
++ kfree(surf);
++ goto alloc_fail;
++ }
++
++ spin_lock(&qdev->surf_id_idr_lock);
++ idr_ret = idr_get_new_above(&qdev->surf_id_idr, NULL, 1, &handle);
++ spin_unlock(&qdev->surf_id_idr_lock);
++
++ if (idr_ret == -EAGAIN)
++ goto again;
++
++ if (handle >= qdev->rom->n_surfaces) {
++ count++;
++ spin_lock(&qdev->surf_id_idr_lock);
++ idr_remove(&qdev->surf_id_idr, handle);
++ spin_unlock(&qdev->surf_id_idr_lock);
++ qxl_reap_surface_id(qdev, 2);
++ goto again;
++ }
++ surf->surface_id = handle;
++
++ spin_lock(&qdev->surf_id_idr_lock);
++ qdev->last_alloced_surf_id = handle;
++ spin_unlock(&qdev->surf_id_idr_lock);
++ alloc_fail:
++ return 0;
++}
++
++void qxl_surface_id_dealloc(struct qxl_device *qdev,
++ uint32_t surface_id)
++{
++ spin_lock(&qdev->surf_id_idr_lock);
++ idr_remove(&qdev->surf_id_idr, surface_id);
++ spin_unlock(&qdev->surf_id_idr_lock);
++}
++
++int qxl_hw_surface_alloc(struct qxl_device *qdev,
++ struct qxl_bo *surf,
++ struct ttm_mem_reg *new_mem)
++{
++ struct qxl_surface_cmd *cmd;
++ struct qxl_release *release;
++ int ret;
++
++ if (surf->hw_surf_alloc)
++ return 0;
++
++ ret = qxl_alloc_surface_release_reserved(qdev, QXL_SURFACE_CMD_CREATE,
++ NULL,
++ &release);
++ if (ret)
++ return ret;
++
++ cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release);
++ cmd->type = QXL_SURFACE_CMD_CREATE;
++ cmd->u.surface_create.format = surf->surf.format;
++ cmd->u.surface_create.width = surf->surf.width;
++ cmd->u.surface_create.height = surf->surf.height;
++ cmd->u.surface_create.stride = surf->surf.stride;
++ if (new_mem) {
++ int slot_id = surf->type == QXL_GEM_DOMAIN_VRAM ? qdev->main_mem_slot : qdev->surfaces_mem_slot;
++ struct qxl_memslot *slot = &(qdev->mem_slots[slot_id]);
++
++ /* TODO - need to hold one of the locks to read tbo.offset */
++ cmd->u.surface_create.data = slot->high_bits;
++
++ cmd->u.surface_create.data |= (new_mem->start << PAGE_SHIFT) + surf->tbo.bdev->man[new_mem->mem_type].gpu_offset;
++ } else
++ cmd->u.surface_create.data = qxl_bo_physical_address(qdev, surf, 0);
++ cmd->surface_id = surf->surface_id;
++ qxl_release_unmap(qdev, release, &cmd->release_info);
++
++ surf->surf_create = release;
++
++ /* no need to add a release to the fence for this bo,
++ since it is only released when we ask to destroy the surface
++ and it would never signal otherwise */
++ qxl_fence_releaseable(qdev, release);
++
++ qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false);
++
++ qxl_release_unreserve(qdev, release);
++
++ surf->hw_surf_alloc = true;
++ spin_lock(&qdev->surf_id_idr_lock);
++ idr_replace(&qdev->surf_id_idr, surf, surf->surface_id);
++ spin_unlock(&qdev->surf_id_idr_lock);
++ return 0;
++}
++
++int qxl_hw_surface_dealloc(struct qxl_device *qdev,
++ struct qxl_bo *surf)
++{
++ struct qxl_surface_cmd *cmd;
++ struct qxl_release *release;
++ int ret;
++ int id;
++
++ if (!surf->hw_surf_alloc)
++ return 0;
++
++ ret = qxl_alloc_surface_release_reserved(qdev, QXL_SURFACE_CMD_DESTROY,
++ surf->surf_create,
++ &release);
++ if (ret)
++ return ret;
++
++ surf->surf_create = NULL;
++ /* remove the surface from the idr, but not the surface id yet */
++ spin_lock(&qdev->surf_id_idr_lock);
++ idr_replace(&qdev->surf_id_idr, NULL, surf->surface_id);
++ spin_unlock(&qdev->surf_id_idr_lock);
++ surf->hw_surf_alloc = false;
++
++ id = surf->surface_id;
++ surf->surface_id = 0;
++
++ release->surface_release_id = id;
++ cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release);
++ cmd->type = QXL_SURFACE_CMD_DESTROY;
++ cmd->surface_id = id;
++ qxl_release_unmap(qdev, release, &cmd->release_info);
++
++ qxl_fence_releaseable(qdev, release);
++
++ qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false);
++
++ qxl_release_unreserve(qdev, release);
++
++
++ return 0;
++}
++
++int qxl_update_surface(struct qxl_device *qdev, struct qxl_bo *surf)
++{
++ struct qxl_rect rect;
++ int ret;
++
++ /* if we are evicting, we need to make sure the surface is up
++ to date */
++ rect.left = 0;
++ rect.right = surf->surf.width;
++ rect.top = 0;
++ rect.bottom = surf->surf.height;
++retry:
++ ret = qxl_io_update_area(qdev, surf, &rect);
++ if (ret == -ERESTARTSYS)
++ goto retry;
++ return ret;
++}
++
++void qxl_surface_evict_locked(struct qxl_device *qdev, struct qxl_bo *surf, bool do_update_area)
++{
++ /* no need to update area if we are just freeing the surface normally */
++ if (do_update_area)
++ qxl_update_surface(qdev, surf);
++
++ /* nuke the surface id at the hw */
++ qxl_hw_surface_dealloc(qdev, surf);
++}
++
++void qxl_surface_evict(struct qxl_device *qdev, struct qxl_bo *surf, bool do_update_area)
++{
++ mutex_lock(&qdev->surf_evict_mutex);
++ qxl_surface_evict_locked(qdev, surf, do_update_area);
++ mutex_unlock(&qdev->surf_evict_mutex);
++}
++
++static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stall)
++{
++ int ret;
++
++ ret = qxl_bo_reserve(surf, false);
++ if (ret == -EBUSY)
++ return -EBUSY;
++
++ if (surf->fence.num_active_releases > 0 && stall == false) {
++ qxl_bo_unreserve(surf);
++ return -EBUSY;
++ }
++
++ if (stall)
++ mutex_unlock(&qdev->surf_evict_mutex);
++
++ spin_lock(&surf->tbo.bdev->fence_lock);
++ ret = ttm_bo_wait(&surf->tbo, true, true, !stall);
++ spin_unlock(&surf->tbo.bdev->fence_lock);
++
++ if (stall)
++ mutex_lock(&qdev->surf_evict_mutex);
++ if (ret == -EBUSY) {
++ qxl_bo_unreserve(surf);
++ return -EBUSY;
++ }
++
++ qxl_surface_evict_locked(qdev, surf, true);
++ qxl_bo_unreserve(surf);
++ return 0;
++}
++
++static int qxl_reap_surface_id(struct qxl_device *qdev, int max_to_reap)
++{
++ int num_reaped = 0;
++ int i, ret;
++ bool stall = false;
++ int start = 0;
++
++ mutex_lock(&qdev->surf_evict_mutex);
++again:
++
++ spin_lock(&qdev->surf_id_idr_lock);
++ start = qdev->last_alloced_surf_id + 1;
++ spin_unlock(&qdev->surf_id_idr_lock);
++
++ for (i = start; i < start + qdev->rom->n_surfaces; i++) {
++ void *objptr;
++ int surfid = i % qdev->rom->n_surfaces;
++
++ /* this avoids the case where the objects is in the
++ idr but has been evicted half way - its makes
++ the idr lookup atomic with the eviction */
++ spin_lock(&qdev->surf_id_idr_lock);
++ objptr = idr_find(&qdev->surf_id_idr, surfid);
++ spin_unlock(&qdev->surf_id_idr_lock);
++
++ if (!objptr)
++ continue;
++
++ ret = qxl_reap_surf(qdev, objptr, stall);
++ if (ret == 0)
++ num_reaped++;
++ if (num_reaped >= max_to_reap)
++ break;
++ }
++ if (num_reaped == 0 && stall == false) {
++ stall = true;
++ goto again;
++ }
++
++ mutex_unlock(&qdev->surf_evict_mutex);
++ if (num_reaped) {
++ usleep_range(500, 1000);
++ qxl_queue_garbage_collect(qdev, true);
++ }
++
++ return 0;
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c
+new file mode 100644
+index 0000000..c630152
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_debugfs.c
+@@ -0,0 +1,135 @@
++/*
++ * Copyright (C) 2009 Red Hat <bskeggs@redhat.com>
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial
++ * portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++/*
++ * Authors:
++ * Alon Levy <alevy@redhat.com>
++ */
++
++#include <linux/debugfs.h>
++
++#include "drmP.h"
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++
++static int
++qxl_debugfs_irq_received(struct seq_file *m, void *data)
++{
++ struct drm_info_node *node = (struct drm_info_node *) m->private;
++ struct qxl_device *qdev = node->minor->dev->dev_private;
++
++ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received));
++ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_display));
++ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_cursor));
++ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_io_cmd));
++ seq_printf(m, "%d\n", qdev->irq_received_error);
++ return 0;
++}
++
++static int
++qxl_debugfs_buffers_info(struct seq_file *m, void *data)
++{
++ struct drm_info_node *node = (struct drm_info_node *) m->private;
++ struct qxl_device *qdev = node->minor->dev->dev_private;
++ struct qxl_bo *bo;
++
++ list_for_each_entry(bo, &qdev->gem.objects, list) {
++ seq_printf(m, "size %ld, pc %d, sync obj %p, num releases %d\n",
++ (unsigned long)bo->gem_base.size, bo->pin_count,
++ bo->tbo.sync_obj, bo->fence.num_active_releases);
++ }
++ return 0;
++}
++
++static struct drm_info_list qxl_debugfs_list[] = {
++ { "irq_received", qxl_debugfs_irq_received, 0, NULL },
++ { "qxl_buffers", qxl_debugfs_buffers_info, 0, NULL },
++};
++#define QXL_DEBUGFS_ENTRIES ARRAY_SIZE(qxl_debugfs_list)
++
++int
++qxl_debugfs_init(struct drm_minor *minor)
++{
++ drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
++ minor->debugfs_root, minor);
++ return 0;
++}
++
++void
++qxl_debugfs_takedown(struct drm_minor *minor)
++{
++ drm_debugfs_remove_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
++ minor);
++}
++
++int qxl_debugfs_add_files(struct qxl_device *qdev,
++ struct drm_info_list *files,
++ unsigned nfiles)
++{
++ unsigned i;
++
++ for (i = 0; i < qdev->debugfs_count; i++) {
++ if (qdev->debugfs[i].files == files) {
++ /* Already registered */
++ return 0;
++ }
++ }
++
++ i = qdev->debugfs_count + 1;
++ if (i > QXL_DEBUGFS_MAX_COMPONENTS) {
++ DRM_ERROR("Reached maximum number of debugfs components.\n");
++ DRM_ERROR("Report so we increase QXL_DEBUGFS_MAX_COMPONENTS.\n");
++ return -EINVAL;
++ }
++ qdev->debugfs[qdev->debugfs_count].files = files;
++ qdev->debugfs[qdev->debugfs_count].num_files = nfiles;
++ qdev->debugfs_count = i;
++#if defined(CONFIG_DEBUG_FS)
++ drm_debugfs_create_files(files, nfiles,
++ qdev->ddev->control->debugfs_root,
++ qdev->ddev->control);
++ drm_debugfs_create_files(files, nfiles,
++ qdev->ddev->primary->debugfs_root,
++ qdev->ddev->primary);
++#endif
++ return 0;
++}
++
++void qxl_debugfs_remove_files(struct qxl_device *qdev)
++{
++#if defined(CONFIG_DEBUG_FS)
++ unsigned i;
++
++ for (i = 0; i < qdev->debugfs_count; i++) {
++ drm_debugfs_remove_files(qdev->debugfs[i].files,
++ qdev->debugfs[i].num_files,
++ qdev->ddev->control);
++ drm_debugfs_remove_files(qdev->debugfs[i].files,
++ qdev->debugfs[i].num_files,
++ qdev->ddev->primary);
++ }
++#endif
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_dev.h b/drivers/gpu/drm/qxl/qxl_dev.h
+new file mode 100644
+index 0000000..94c5aec
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_dev.h
+@@ -0,0 +1,879 @@
++/*
++ Copyright (C) 2009 Red Hat, Inc.
++
++ Redistribution and use in source and binary forms, with or without
++ modification, are permitted provided that the following conditions are
++ met:
++
++ * Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ * Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in
++ the documentation and/or other materials provided with the
++ distribution.
++ * Neither the name of the copyright holder nor the names of its
++ contributors may be used to endorse or promote products derived
++ from this software without specific prior written permission.
++
++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
++ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
++ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++
++#ifndef H_QXL_DEV
++#define H_QXL_DEV
++
++#include <linux/types.h>
++
++/*
++ * from spice-protocol
++ * Release 0.10.0
++ */
++
++/* enums.h */
++
++enum SpiceImageType {
++ SPICE_IMAGE_TYPE_BITMAP,
++ SPICE_IMAGE_TYPE_QUIC,
++ SPICE_IMAGE_TYPE_RESERVED,
++ SPICE_IMAGE_TYPE_LZ_PLT = 100,
++ SPICE_IMAGE_TYPE_LZ_RGB,
++ SPICE_IMAGE_TYPE_GLZ_RGB,
++ SPICE_IMAGE_TYPE_FROM_CACHE,
++ SPICE_IMAGE_TYPE_SURFACE,
++ SPICE_IMAGE_TYPE_JPEG,
++ SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS,
++ SPICE_IMAGE_TYPE_ZLIB_GLZ_RGB,
++ SPICE_IMAGE_TYPE_JPEG_ALPHA,
++
++ SPICE_IMAGE_TYPE_ENUM_END
++};
++
++enum SpiceBitmapFmt {
++ SPICE_BITMAP_FMT_INVALID,
++ SPICE_BITMAP_FMT_1BIT_LE,
++ SPICE_BITMAP_FMT_1BIT_BE,
++ SPICE_BITMAP_FMT_4BIT_LE,
++ SPICE_BITMAP_FMT_4BIT_BE,
++ SPICE_BITMAP_FMT_8BIT,
++ SPICE_BITMAP_FMT_16BIT,
++ SPICE_BITMAP_FMT_24BIT,
++ SPICE_BITMAP_FMT_32BIT,
++ SPICE_BITMAP_FMT_RGBA,
++
++ SPICE_BITMAP_FMT_ENUM_END
++};
++
++enum SpiceSurfaceFmt {
++ SPICE_SURFACE_FMT_INVALID,
++ SPICE_SURFACE_FMT_1_A,
++ SPICE_SURFACE_FMT_8_A = 8,
++ SPICE_SURFACE_FMT_16_555 = 16,
++ SPICE_SURFACE_FMT_32_xRGB = 32,
++ SPICE_SURFACE_FMT_16_565 = 80,
++ SPICE_SURFACE_FMT_32_ARGB = 96,
++
++ SPICE_SURFACE_FMT_ENUM_END
++};
++
++enum SpiceClipType {
++ SPICE_CLIP_TYPE_NONE,
++ SPICE_CLIP_TYPE_RECTS,
++
++ SPICE_CLIP_TYPE_ENUM_END
++};
++
++enum SpiceRopd {
++ SPICE_ROPD_INVERS_SRC = (1 << 0),
++ SPICE_ROPD_INVERS_BRUSH = (1 << 1),
++ SPICE_ROPD_INVERS_DEST = (1 << 2),
++ SPICE_ROPD_OP_PUT = (1 << 3),
++ SPICE_ROPD_OP_OR = (1 << 4),
++ SPICE_ROPD_OP_AND = (1 << 5),
++ SPICE_ROPD_OP_XOR = (1 << 6),
++ SPICE_ROPD_OP_BLACKNESS = (1 << 7),
++ SPICE_ROPD_OP_WHITENESS = (1 << 8),
++ SPICE_ROPD_OP_INVERS = (1 << 9),
++ SPICE_ROPD_INVERS_RES = (1 << 10),
++
++ SPICE_ROPD_MASK = 0x7ff
++};
++
++enum SpiceBrushType {
++ SPICE_BRUSH_TYPE_NONE,
++ SPICE_BRUSH_TYPE_SOLID,
++ SPICE_BRUSH_TYPE_PATTERN,
++
++ SPICE_BRUSH_TYPE_ENUM_END
++};
++
++enum SpiceCursorType {
++ SPICE_CURSOR_TYPE_ALPHA,
++ SPICE_CURSOR_TYPE_MONO,
++ SPICE_CURSOR_TYPE_COLOR4,
++ SPICE_CURSOR_TYPE_COLOR8,
++ SPICE_CURSOR_TYPE_COLOR16,
++ SPICE_CURSOR_TYPE_COLOR24,
++ SPICE_CURSOR_TYPE_COLOR32,
++
++ SPICE_CURSOR_TYPE_ENUM_END
++};
++
++/* qxl_dev.h */
++
++#pragma pack(push, 1)
++
++#define REDHAT_PCI_VENDOR_ID 0x1b36
++
++/* 0x100-0x11f reserved for spice, 0x1ff used for unstable work */
++#define QXL_DEVICE_ID_STABLE 0x0100
++
++enum {
++ QXL_REVISION_STABLE_V04 = 0x01,
++ QXL_REVISION_STABLE_V06 = 0x02,
++ QXL_REVISION_STABLE_V10 = 0x03,
++ QXL_REVISION_STABLE_V12 = 0x04,
++};
++
++#define QXL_DEVICE_ID_DEVEL 0x01ff
++#define QXL_REVISION_DEVEL 0x01
++
++#define QXL_ROM_MAGIC (*(uint32_t *)"QXRO")
++#define QXL_RAM_MAGIC (*(uint32_t *)"QXRA")
++
++enum {
++ QXL_RAM_RANGE_INDEX,
++ QXL_VRAM_RANGE_INDEX,
++ QXL_ROM_RANGE_INDEX,
++ QXL_IO_RANGE_INDEX,
++
++ QXL_PCI_RANGES
++};
++
++/* qxl-1 compat: append only */
++enum {
++ QXL_IO_NOTIFY_CMD,
++ QXL_IO_NOTIFY_CURSOR,
++ QXL_IO_UPDATE_AREA,
++ QXL_IO_UPDATE_IRQ,
++ QXL_IO_NOTIFY_OOM,
++ QXL_IO_RESET,
++ QXL_IO_SET_MODE, /* qxl-1 */
++ QXL_IO_LOG,
++ /* appended for qxl-2 */
++ QXL_IO_MEMSLOT_ADD,
++ QXL_IO_MEMSLOT_DEL,
++ QXL_IO_DETACH_PRIMARY,
++ QXL_IO_ATTACH_PRIMARY,
++ QXL_IO_CREATE_PRIMARY,
++ QXL_IO_DESTROY_PRIMARY,
++ QXL_IO_DESTROY_SURFACE_WAIT,
++ QXL_IO_DESTROY_ALL_SURFACES,
++ /* appended for qxl-3 */
++ QXL_IO_UPDATE_AREA_ASYNC,
++ QXL_IO_MEMSLOT_ADD_ASYNC,
++ QXL_IO_CREATE_PRIMARY_ASYNC,
++ QXL_IO_DESTROY_PRIMARY_ASYNC,
++ QXL_IO_DESTROY_SURFACE_ASYNC,
++ QXL_IO_DESTROY_ALL_SURFACES_ASYNC,
++ QXL_IO_FLUSH_SURFACES_ASYNC,
++ QXL_IO_FLUSH_RELEASE,
++ /* appended for qxl-4 */
++ QXL_IO_MONITORS_CONFIG_ASYNC,
++
++ QXL_IO_RANGE_SIZE
++};
++
++typedef uint64_t QXLPHYSICAL;
++typedef int32_t QXLFIXED; /* fixed 28.4 */
++
++struct qxl_point_fix {
++ QXLFIXED x;
++ QXLFIXED y;
++};
++
++struct qxl_point {
++ int32_t x;
++ int32_t y;
++};
++
++struct qxl_point_1_6 {
++ int16_t x;
++ int16_t y;
++};
++
++struct qxl_rect {
++ int32_t top;
++ int32_t left;
++ int32_t bottom;
++ int32_t right;
++};
++
++struct qxl_urect {
++ uint32_t top;
++ uint32_t left;
++ uint32_t bottom;
++ uint32_t right;
++};
++
++/* qxl-1 compat: append only */
++struct qxl_rom {
++ uint32_t magic;
++ uint32_t id;
++ uint32_t update_id;
++ uint32_t compression_level;
++ uint32_t log_level;
++ uint32_t mode; /* qxl-1 */
++ uint32_t modes_offset;
++ uint32_t num_io_pages;
++ uint32_t pages_offset; /* qxl-1 */
++ uint32_t draw_area_offset; /* qxl-1 */
++ uint32_t surface0_area_size; /* qxl-1 name: draw_area_size */
++ uint32_t ram_header_offset;
++ uint32_t mm_clock;
++ /* appended for qxl-2 */
++ uint32_t n_surfaces;
++ uint64_t flags;
++ uint8_t slots_start;
++ uint8_t slots_end;
++ uint8_t slot_gen_bits;
++ uint8_t slot_id_bits;
++ uint8_t slot_generation;
++ /* appended for qxl-4 */
++ uint8_t client_present;
++ uint8_t client_capabilities[58];
++ uint32_t client_monitors_config_crc;
++ struct {
++ uint16_t count;
++ uint16_t padding;
++ struct qxl_urect heads[64];
++ } client_monitors_config;
++};
++
++/* qxl-1 compat: fixed */
++struct qxl_mode {
++ uint32_t id;
++ uint32_t x_res;
++ uint32_t y_res;
++ uint32_t bits;
++ uint32_t stride;
++ uint32_t x_mili;
++ uint32_t y_mili;
++ uint32_t orientation;
++};
++
++/* qxl-1 compat: fixed */
++struct qxl_modes {
++ uint32_t n_modes;
++ struct qxl_mode modes[0];
++};
++
++/* qxl-1 compat: append only */
++enum qxl_cmd_type {
++ QXL_CMD_NOP,
++ QXL_CMD_DRAW,
++ QXL_CMD_UPDATE,
++ QXL_CMD_CURSOR,
++ QXL_CMD_MESSAGE,
++ QXL_CMD_SURFACE,
++};
++
++/* qxl-1 compat: fixed */
++struct qxl_command {
++ QXLPHYSICAL data;
++ uint32_t type;
++ uint32_t padding;
++};
++
++#define QXL_COMMAND_FLAG_COMPAT (1<<0)
++#define QXL_COMMAND_FLAG_COMPAT_16BPP (2<<0)
++
++struct qxl_command_ext {
++ struct qxl_command cmd;
++ uint32_t group_id;
++ uint32_t flags;
++};
++
++struct qxl_mem_slot {
++ uint64_t mem_start;
++ uint64_t mem_end;
++};
++
++#define QXL_SURF_TYPE_PRIMARY 0
++
++#define QXL_SURF_FLAG_KEEP_DATA (1 << 0)
++
++struct qxl_surface_create {
++ uint32_t width;
++ uint32_t height;
++ int32_t stride;
++ uint32_t format;
++ uint32_t position;
++ uint32_t mouse_mode;
++ uint32_t flags;
++ uint32_t type;
++ QXLPHYSICAL mem;
++};
++
++#define QXL_COMMAND_RING_SIZE 32
++#define QXL_CURSOR_RING_SIZE 32
++#define QXL_RELEASE_RING_SIZE 8
++
++#define QXL_LOG_BUF_SIZE 4096
++
++#define QXL_INTERRUPT_DISPLAY (1 << 0)
++#define QXL_INTERRUPT_CURSOR (1 << 1)
++#define QXL_INTERRUPT_IO_CMD (1 << 2)
++#define QXL_INTERRUPT_ERROR (1 << 3)
++#define QXL_INTERRUPT_CLIENT (1 << 4)
++#define QXL_INTERRUPT_CLIENT_MONITORS_CONFIG (1 << 5)
++
++struct qxl_ring_header {
++ uint32_t num_items;
++ uint32_t prod;
++ uint32_t notify_on_prod;
++ uint32_t cons;
++ uint32_t notify_on_cons;
++};
++
++/* qxl-1 compat: append only */
++struct qxl_ram_header {
++ uint32_t magic;
++ uint32_t int_pending;
++ uint32_t int_mask;
++ uint8_t log_buf[QXL_LOG_BUF_SIZE];
++ struct qxl_ring_header cmd_ring_hdr;
++ struct qxl_command cmd_ring[QXL_COMMAND_RING_SIZE];
++ struct qxl_ring_header cursor_ring_hdr;
++ struct qxl_command cursor_ring[QXL_CURSOR_RING_SIZE];
++ struct qxl_ring_header release_ring_hdr;
++ uint64_t release_ring[QXL_RELEASE_RING_SIZE];
++ struct qxl_rect update_area;
++ /* appended for qxl-2 */
++ uint32_t update_surface;
++ struct qxl_mem_slot mem_slot;
++ struct qxl_surface_create create_surface;
++ uint64_t flags;
++
++ /* appended for qxl-4 */
++
++ /* used by QXL_IO_MONITORS_CONFIG_ASYNC */
++ QXLPHYSICAL monitors_config;
++ uint8_t guest_capabilities[64];
++};
++
++union qxl_release_info {
++ uint64_t id; /* in */
++ uint64_t next; /* out */
++};
++
++struct qxl_release_info_ext {
++ union qxl_release_info *info;
++ uint32_t group_id;
++};
++
++struct qxl_data_chunk {
++ uint32_t data_size;
++ QXLPHYSICAL prev_chunk;
++ QXLPHYSICAL next_chunk;
++ uint8_t data[0];
++};
++
++struct qxl_message {
++ union qxl_release_info release_info;
++ uint8_t data[0];
++};
++
++struct qxl_compat_update_cmd {
++ union qxl_release_info release_info;
++ struct qxl_rect area;
++ uint32_t update_id;
++};
++
++struct qxl_update_cmd {
++ union qxl_release_info release_info;
++ struct qxl_rect area;
++ uint32_t update_id;
++ uint32_t surface_id;
++};
++
++struct qxl_cursor_header {
++ uint64_t unique;
++ uint16_t type;
++ uint16_t width;
++ uint16_t height;
++ uint16_t hot_spot_x;
++ uint16_t hot_spot_y;
++};
++
++struct qxl_cursor {
++ struct qxl_cursor_header header;
++ uint32_t data_size;
++ struct qxl_data_chunk chunk;
++};
++
++enum {
++ QXL_CURSOR_SET,
++ QXL_CURSOR_MOVE,
++ QXL_CURSOR_HIDE,
++ QXL_CURSOR_TRAIL,
++};
++
++#define QXL_CURSOR_DEVICE_DATA_SIZE 128
++
++struct qxl_cursor_cmd {
++ union qxl_release_info release_info;
++ uint8_t type;
++ union {
++ struct {
++ struct qxl_point_1_6 position;
++ uint8_t visible;
++ QXLPHYSICAL shape;
++ } set;
++ struct {
++ uint16_t length;
++ uint16_t frequency;
++ } trail;
++ struct qxl_point_1_6 position;
++ } u;
++ /* todo: dynamic size from rom */
++ uint8_t device_data[QXL_CURSOR_DEVICE_DATA_SIZE];
++};
++
++enum {
++ QXL_DRAW_NOP,
++ QXL_DRAW_FILL,
++ QXL_DRAW_OPAQUE,
++ QXL_DRAW_COPY,
++ QXL_COPY_BITS,
++ QXL_DRAW_BLEND,
++ QXL_DRAW_BLACKNESS,
++ QXL_DRAW_WHITENESS,
++ QXL_DRAW_INVERS,
++ QXL_DRAW_ROP3,
++ QXL_DRAW_STROKE,
++ QXL_DRAW_TEXT,
++ QXL_DRAW_TRANSPARENT,
++ QXL_DRAW_ALPHA_BLEND,
++ QXL_DRAW_COMPOSITE
++};
++
++struct qxl_raster_glyph {
++ struct qxl_point render_pos;
++ struct qxl_point glyph_origin;
++ uint16_t width;
++ uint16_t height;
++ uint8_t data[0];
++};
++
++struct qxl_string {
++ uint32_t data_size;
++ uint16_t length;
++ uint16_t flags;
++ struct qxl_data_chunk chunk;
++};
++
++struct qxl_copy_bits {
++ struct qxl_point src_pos;
++};
++
++enum qxl_effect_type {
++ QXL_EFFECT_BLEND = 0,
++ QXL_EFFECT_OPAQUE = 1,
++ QXL_EFFECT_REVERT_ON_DUP = 2,
++ QXL_EFFECT_BLACKNESS_ON_DUP = 3,
++ QXL_EFFECT_WHITENESS_ON_DUP = 4,
++ QXL_EFFECT_NOP_ON_DUP = 5,
++ QXL_EFFECT_NOP = 6,
++ QXL_EFFECT_OPAQUE_BRUSH = 7
++};
++
++struct qxl_pattern {
++ QXLPHYSICAL pat;
++ struct qxl_point pos;
++};
++
++struct qxl_brush {
++ uint32_t type;
++ union {
++ uint32_t color;
++ struct qxl_pattern pattern;
++ } u;
++};
++
++struct qxl_q_mask {
++ uint8_t flags;
++ struct qxl_point pos;
++ QXLPHYSICAL bitmap;
++};
++
++struct qxl_fill {
++ struct qxl_brush brush;
++ uint16_t rop_descriptor;
++ struct qxl_q_mask mask;
++};
++
++struct qxl_opaque {
++ QXLPHYSICAL src_bitmap;
++ struct qxl_rect src_area;
++ struct qxl_brush brush;
++ uint16_t rop_descriptor;
++ uint8_t scale_mode;
++ struct qxl_q_mask mask;
++};
++
++struct qxl_copy {
++ QXLPHYSICAL src_bitmap;
++ struct qxl_rect src_area;
++ uint16_t rop_descriptor;
++ uint8_t scale_mode;
++ struct qxl_q_mask mask;
++};
++
++struct qxl_transparent {
++ QXLPHYSICAL src_bitmap;
++ struct qxl_rect src_area;
++ uint32_t src_color;
++ uint32_t true_color;
++};
++
++struct qxl_alpha_blend {
++ uint16_t alpha_flags;
++ uint8_t alpha;
++ QXLPHYSICAL src_bitmap;
++ struct qxl_rect src_area;
++};
++
++struct qxl_compat_alpha_blend {
++ uint8_t alpha;
++ QXLPHYSICAL src_bitmap;
++ struct qxl_rect src_area;
++};
++
++struct qxl_rop_3 {
++ QXLPHYSICAL src_bitmap;
++ struct qxl_rect src_area;
++ struct qxl_brush brush;
++ uint8_t rop3;
++ uint8_t scale_mode;
++ struct qxl_q_mask mask;
++};
++
++struct qxl_line_attr {
++ uint8_t flags;
++ uint8_t join_style;
++ uint8_t end_style;
++ uint8_t style_nseg;
++ QXLFIXED width;
++ QXLFIXED miter_limit;
++ QXLPHYSICAL style;
++};
++
++struct qxl_stroke {
++ QXLPHYSICAL path;
++ struct qxl_line_attr attr;
++ struct qxl_brush brush;
++ uint16_t fore_mode;
++ uint16_t back_mode;
++};
++
++struct qxl_text {
++ QXLPHYSICAL str;
++ struct qxl_rect back_area;
++ struct qxl_brush fore_brush;
++ struct qxl_brush back_brush;
++ uint16_t fore_mode;
++ uint16_t back_mode;
++};
++
++struct qxl_mask {
++ struct qxl_q_mask mask;
++};
++
++struct qxl_clip {
++ uint32_t type;
++ QXLPHYSICAL data;
++};
++
++enum qxl_operator {
++ QXL_OP_CLEAR = 0x00,
++ QXL_OP_SOURCE = 0x01,
++ QXL_OP_DST = 0x02,
++ QXL_OP_OVER = 0x03,
++ QXL_OP_OVER_REVERSE = 0x04,
++ QXL_OP_IN = 0x05,
++ QXL_OP_IN_REVERSE = 0x06,
++ QXL_OP_OUT = 0x07,
++ QXL_OP_OUT_REVERSE = 0x08,
++ QXL_OP_ATOP = 0x09,
++ QXL_OP_ATOP_REVERSE = 0x0a,
++ QXL_OP_XOR = 0x0b,
++ QXL_OP_ADD = 0x0c,
++ QXL_OP_SATURATE = 0x0d,
++ /* Note the jump here from 0x0d to 0x30 */
++ QXL_OP_MULTIPLY = 0x30,
++ QXL_OP_SCREEN = 0x31,
++ QXL_OP_OVERLAY = 0x32,
++ QXL_OP_DARKEN = 0x33,
++ QXL_OP_LIGHTEN = 0x34,
++ QXL_OP_COLOR_DODGE = 0x35,
++ QXL_OP_COLOR_BURN = 0x36,
++ QXL_OP_HARD_LIGHT = 0x37,
++ QXL_OP_SOFT_LIGHT = 0x38,
++ QXL_OP_DIFFERENCE = 0x39,
++ QXL_OP_EXCLUSION = 0x3a,
++ QXL_OP_HSL_HUE = 0x3b,
++ QXL_OP_HSL_SATURATION = 0x3c,
++ QXL_OP_HSL_COLOR = 0x3d,
++ QXL_OP_HSL_LUMINOSITY = 0x3e
++};
++
++struct qxl_transform {
++ uint32_t t00;
++ uint32_t t01;
++ uint32_t t02;
++ uint32_t t10;
++ uint32_t t11;
++ uint32_t t12;
++};
++
++/* The flags field has the following bit fields:
++ *
++ * operator: [ 0 - 7 ]
++ * src_filter: [ 8 - 10 ]
++ * mask_filter: [ 11 - 13 ]
++ * src_repeat: [ 14 - 15 ]
++ * mask_repeat: [ 16 - 17 ]
++ * component_alpha: [ 18 - 18 ]
++ * reserved: [ 19 - 31 ]
++ *
++ * The repeat and filter values are those of pixman:
++ * REPEAT_NONE = 0
++ * REPEAT_NORMAL = 1
++ * REPEAT_PAD = 2
++ * REPEAT_REFLECT = 3
++ *
++ * The filter values are:
++ * FILTER_NEAREST = 0
++ * FILTER_BILINEAR = 1
++ */
++struct qxl_composite {
++ uint32_t flags;
++
++ QXLPHYSICAL src;
++ QXLPHYSICAL src_transform; /* May be NULL */
++ QXLPHYSICAL mask; /* May be NULL */
++ QXLPHYSICAL mask_transform; /* May be NULL */
++ struct qxl_point_1_6 src_origin;
++ struct qxl_point_1_6 mask_origin;
++};
++
++struct qxl_compat_drawable {
++ union qxl_release_info release_info;
++ uint8_t effect;
++ uint8_t type;
++ uint16_t bitmap_offset;
++ struct qxl_rect bitmap_area;
++ struct qxl_rect bbox;
++ struct qxl_clip clip;
++ uint32_t mm_time;
++ union {
++ struct qxl_fill fill;
++ struct qxl_opaque opaque;
++ struct qxl_copy copy;
++ struct qxl_transparent transparent;
++ struct qxl_compat_alpha_blend alpha_blend;
++ struct qxl_copy_bits copy_bits;
++ struct qxl_copy blend;
++ struct qxl_rop_3 rop3;
++ struct qxl_stroke stroke;
++ struct qxl_text text;
++ struct qxl_mask blackness;
++ struct qxl_mask invers;
++ struct qxl_mask whiteness;
++ } u;
++};
++
++struct qxl_drawable {
++ union qxl_release_info release_info;
++ uint32_t surface_id;
++ uint8_t effect;
++ uint8_t type;
++ uint8_t self_bitmap;
++ struct qxl_rect self_bitmap_area;
++ struct qxl_rect bbox;
++ struct qxl_clip clip;
++ uint32_t mm_time;
++ int32_t surfaces_dest[3];
++ struct qxl_rect surfaces_rects[3];
++ union {
++ struct qxl_fill fill;
++ struct qxl_opaque opaque;
++ struct qxl_copy copy;
++ struct qxl_transparent transparent;
++ struct qxl_alpha_blend alpha_blend;
++ struct qxl_copy_bits copy_bits;
++ struct qxl_copy blend;
++ struct qxl_rop_3 rop3;
++ struct qxl_stroke stroke;
++ struct qxl_text text;
++ struct qxl_mask blackness;
++ struct qxl_mask invers;
++ struct qxl_mask whiteness;
++ struct qxl_composite composite;
++ } u;
++};
++
++enum qxl_surface_cmd_type {
++ QXL_SURFACE_CMD_CREATE,
++ QXL_SURFACE_CMD_DESTROY,
++};
++
++struct qxl_surface {
++ uint32_t format;
++ uint32_t width;
++ uint32_t height;
++ int32_t stride;
++ QXLPHYSICAL data;
++};
++
++struct qxl_surface_cmd {
++ union qxl_release_info release_info;
++ uint32_t surface_id;
++ uint8_t type;
++ uint32_t flags;
++ union {
++ struct qxl_surface surface_create;
++ } u;
++};
++
++struct qxl_clip_rects {
++ uint32_t num_rects;
++ struct qxl_data_chunk chunk;
++};
++
++enum {
++ QXL_PATH_BEGIN = (1 << 0),
++ QXL_PATH_END = (1 << 1),
++ QXL_PATH_CLOSE = (1 << 3),
++ QXL_PATH_BEZIER = (1 << 4),
++};
++
++struct qxl_path_seg {
++ uint32_t flags;
++ uint32_t count;
++ struct qxl_point_fix points[0];
++};
++
++struct qxl_path {
++ uint32_t data_size;
++ struct qxl_data_chunk chunk;
++};
++
++enum {
++ QXL_IMAGE_GROUP_DRIVER,
++ QXL_IMAGE_GROUP_DEVICE,
++ QXL_IMAGE_GROUP_RED,
++ QXL_IMAGE_GROUP_DRIVER_DONT_CACHE,
++};
++
++struct qxl_image_id {
++ uint32_t group;
++ uint32_t unique;
++};
++
++union qxl_image_id_union {
++ struct qxl_image_id id;
++ uint64_t value;
++};
++
++enum qxl_image_flags {
++ QXL_IMAGE_CACHE = (1 << 0),
++ QXL_IMAGE_HIGH_BITS_SET = (1 << 1),
++};
++
++enum qxl_bitmap_flags {
++ QXL_BITMAP_DIRECT = (1 << 0),
++ QXL_BITMAP_UNSTABLE = (1 << 1),
++ QXL_BITMAP_TOP_DOWN = (1 << 2), /* == SPICE_BITMAP_FLAGS_TOP_DOWN */
++};
++
++#define QXL_SET_IMAGE_ID(image, _group, _unique) { \
++ (image)->descriptor.id = (((uint64_t)_unique) << 32) | _group; \
++}
++
++struct qxl_image_descriptor {
++ uint64_t id;
++ uint8_t type;
++ uint8_t flags;
++ uint32_t width;
++ uint32_t height;
++};
++
++struct qxl_palette {
++ uint64_t unique;
++ uint16_t num_ents;
++ uint32_t ents[0];
++};
++
++struct qxl_bitmap {
++ uint8_t format;
++ uint8_t flags;
++ uint32_t x;
++ uint32_t y;
++ uint32_t stride;
++ QXLPHYSICAL palette;
++ QXLPHYSICAL data; /* data[0] ? */
++};
++
++struct qxl_surface_id {
++ uint32_t surface_id;
++};
++
++struct qxl_encoder_data {
++ uint32_t data_size;
++ uint8_t data[0];
++};
++
++struct qxl_image {
++ struct qxl_image_descriptor descriptor;
++ union { /* variable length */
++ struct qxl_bitmap bitmap;
++ struct qxl_encoder_data quic;
++ struct qxl_surface_id surface_image;
++ } u;
++};
++
++/* A QXLHead is a single monitor output backed by a QXLSurface.
++ * x and y offsets are unsigned since they are used in relation to
++ * the given surface, not the same as the x, y coordinates in the guest
++ * screen reference frame. */
++struct qxl_head {
++ uint32_t id;
++ uint32_t surface_id;
++ uint32_t width;
++ uint32_t height;
++ uint32_t x;
++ uint32_t y;
++ uint32_t flags;
++};
++
++struct qxl_monitors_config {
++ uint16_t count;
++ uint16_t max_allowed; /* If it is 0 no fixed limit is given by the
++ driver */
++ struct qxl_head heads[0];
++};
++
++#pragma pack(pop)
++
++#endif /* _H_QXL_DEV */
+diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
+new file mode 100644
+index 0000000..c80ddfe
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_display.c
+@@ -0,0 +1,981 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++
++#include "linux/crc32.h"
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++#include "drm_crtc_helper.h"
++
++static void qxl_crtc_set_to_mode(struct qxl_device *qdev,
++ struct drm_connector *connector,
++ struct qxl_head *head)
++{
++ struct drm_device *dev = connector->dev;
++ struct drm_display_mode *mode, *t;
++ int width = head->width;
++ int height = head->height;
++
++ if (width < 320 || height < 240) {
++ qxl_io_log(qdev, "%s: bad head: %dx%d", width, height);
++ width = 1024;
++ height = 768;
++ }
++ if (width * height * 4 > 16*1024*1024) {
++ width = 1024;
++ height = 768;
++ }
++ /* TODO: go over regular modes and removed preferred? */
++ list_for_each_entry_safe(mode, t, &connector->probed_modes, head)
++ drm_mode_remove(connector, mode);
++ mode = drm_cvt_mode(dev, width, height, 60, false, false, false);
++ mode->type |= DRM_MODE_TYPE_PREFERRED;
++ mode->status = MODE_OK;
++ drm_mode_probed_add(connector, mode);
++ qxl_io_log(qdev, "%s: %d x %d\n", __func__, width, height);
++}
++
++void qxl_crtc_set_from_monitors_config(struct qxl_device *qdev)
++{
++ struct drm_connector *connector;
++ int i;
++ struct drm_device *dev = qdev->ddev;
++
++ i = 0;
++ qxl_io_log(qdev, "%s: %d, %d\n", __func__,
++ dev->mode_config.num_connector,
++ qdev->monitors_config->count);
++ list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
++ if (i > qdev->monitors_config->count) {
++ /* crtc will be reported as disabled */
++ continue;
++ }
++ qxl_crtc_set_to_mode(qdev, connector,
++ &qdev->monitors_config->heads[i]);
++ ++i;
++ }
++}
++
++void qxl_alloc_client_monitors_config(struct qxl_device *qdev, unsigned count)
++{
++ if (qdev->client_monitors_config &&
++ count > qdev->client_monitors_config->count) {
++ kfree(qdev->client_monitors_config);
++ }
++ if (!qdev->client_monitors_config) {
++ qdev->client_monitors_config = kzalloc(
++ sizeof(struct qxl_monitors_config) +
++ sizeof(struct qxl_head) * count, GFP_KERNEL);
++ if (!qdev->client_monitors_config) {
++ qxl_io_log(qdev,
++ "%s: allocation failure for %u heads\n",
++ __func__, count);
++ return;
++ }
++ }
++ qdev->client_monitors_config->count = count;
++}
++
++static int qxl_display_copy_rom_client_monitors_config(struct qxl_device *qdev)
++{
++ int i;
++ int num_monitors;
++ uint32_t crc;
++
++ BUG_ON(!qdev->monitors_config);
++ num_monitors = qdev->rom->client_monitors_config.count;
++ crc = crc32(0, (const uint8_t *)&qdev->rom->client_monitors_config,
++ sizeof(qdev->rom->client_monitors_config));
++ if (crc != qdev->rom->client_monitors_config_crc) {
++ qxl_io_log(qdev, "crc mismatch: have %X (%d) != %X\n", crc,
++ sizeof(qdev->rom->client_monitors_config),
++ qdev->rom->client_monitors_config_crc);
++ return 1;
++ }
++ if (num_monitors > qdev->monitors_config->max_allowed) {
++ DRM_INFO("client monitors list will be truncated: %d < %d\n",
++ qdev->monitors_config->max_allowed, num_monitors);
++ num_monitors = qdev->monitors_config->max_allowed;
++ } else {
++ num_monitors = qdev->rom->client_monitors_config.count;
++ }
++ qxl_alloc_client_monitors_config(qdev, num_monitors);
++ /* we copy max from the client but it isn't used */
++ qdev->client_monitors_config->max_allowed =
++ qdev->monitors_config->max_allowed;
++ for (i = 0 ; i < qdev->client_monitors_config->count ; ++i) {
++ struct qxl_urect *c_rect =
++ &qdev->rom->client_monitors_config.heads[i];
++ struct qxl_head *client_head =
++ &qdev->client_monitors_config->heads[i];
++ struct qxl_head *head = &qdev->monitors_config->heads[i];
++ client_head->x = head->x = c_rect->left;
++ client_head->y = head->y = c_rect->top;
++ client_head->width = head->width =
++ c_rect->right - c_rect->left;
++ client_head->height = head->height =
++ c_rect->bottom - c_rect->top;
++ client_head->surface_id = head->surface_id = 0;
++ client_head->id = head->id = i;
++ client_head->flags = head->flags = 0;
++ QXL_DEBUG(qdev, "read %dx%d+%d+%d\n", head->width, head->height,
++ head->x, head->y);
++ }
++ return 0;
++}
++
++void qxl_display_read_client_monitors_config(struct qxl_device *qdev)
++{
++
++ while (qxl_display_copy_rom_client_monitors_config(qdev)) {
++ qxl_io_log(qdev, "failed crc check for client_monitors_config,"
++ " retrying\n");
++ }
++ qxl_crtc_set_from_monitors_config(qdev);
++ /* fire off a uevent and let userspace tell us what to do */
++ qxl_io_log(qdev, "calling drm_sysfs_hotplug_event\n");
++ drm_sysfs_hotplug_event(qdev->ddev);
++}
++
++static int qxl_add_monitors_config_modes(struct drm_connector *connector)
++{
++ struct drm_device *dev = connector->dev;
++ struct qxl_device *qdev = dev->dev_private;
++ struct qxl_output *output = drm_connector_to_qxl_output(connector);
++ int h = output->index;
++ struct drm_display_mode *mode = NULL;
++ struct qxl_head *head;
++
++ if (!qdev->monitors_config)
++ return 0;
++ head = &qdev->monitors_config->heads[h];
++
++ mode = drm_cvt_mode(dev, head->width, head->height, 60, false, false,
++ false);
++ mode->type |= DRM_MODE_TYPE_PREFERRED;
++ drm_mode_probed_add(connector, mode);
++ return 1;
++}
++
++static int qxl_add_common_modes(struct drm_connector *connector)
++{
++ struct drm_device *dev = connector->dev;
++ struct drm_display_mode *mode = NULL;
++ int i;
++ struct mode_size {
++ int w;
++ int h;
++ } common_modes[] = {
++ { 640, 480},
++ { 720, 480},
++ { 800, 600},
++ { 848, 480},
++ {1024, 768},
++ {1152, 768},
++ {1280, 720},
++ {1280, 800},
++ {1280, 854},
++ {1280, 960},
++ {1280, 1024},
++ {1440, 900},
++ {1400, 1050},
++ {1680, 1050},
++ {1600, 1200},
++ {1920, 1080},
++ {1920, 1200}
++ };
++
++ for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
++ if (common_modes[i].w < 320 || common_modes[i].h < 200)
++ continue;
++
++ mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h,
++ 60, false, false, false);
++ if (common_modes[i].w == 1024 && common_modes[i].h == 768)
++ mode->type |= DRM_MODE_TYPE_PREFERRED;
++ drm_mode_probed_add(connector, mode);
++ }
++ return i - 1;
++}
++
++static void qxl_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
++ u16 *blue, uint32_t start, uint32_t size)
++{
++ /* TODO */
++}
++
++static void qxl_crtc_destroy(struct drm_crtc *crtc)
++{
++ struct qxl_crtc *qxl_crtc = to_qxl_crtc(crtc);
++
++ drm_crtc_cleanup(crtc);
++ kfree(qxl_crtc);
++}
++
++static void
++qxl_hide_cursor(struct qxl_device *qdev)
++{
++ struct qxl_release *release;
++ struct qxl_cursor_cmd *cmd;
++ int ret;
++
++ ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd), QXL_RELEASE_CURSOR_CMD,
++ &release, NULL);
++
++ cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release);
++ cmd->type = QXL_CURSOR_HIDE;
++ qxl_release_unmap(qdev, release, &cmd->release_info);
++
++ qxl_fence_releaseable(qdev, release);
++ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
++ qxl_release_unreserve(qdev, release);
++}
++
++static int qxl_crtc_cursor_set(struct drm_crtc *crtc,
++ struct drm_file *file_priv,
++ uint32_t handle,
++ uint32_t width,
++ uint32_t height)
++{
++ struct drm_device *dev = crtc->dev;
++ struct qxl_device *qdev = dev->dev_private;
++ struct qxl_crtc *qcrtc = to_qxl_crtc(crtc);
++ struct drm_gem_object *obj;
++ struct qxl_cursor *cursor;
++ struct qxl_cursor_cmd *cmd;
++ struct qxl_bo *cursor_bo, *user_bo;
++ struct qxl_release *release;
++ void *user_ptr;
++
++ int size = 64*64*4;
++ int ret = 0;
++ if (!handle) {
++ qxl_hide_cursor(qdev);
++ return 0;
++ }
++
++ obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
++ if (!obj) {
++ DRM_ERROR("cannot find cursor object\n");
++ return -ENOENT;
++ }
++
++ user_bo = gem_to_qxl_bo(obj);
++
++ ret = qxl_bo_reserve(user_bo, false);
++ if (ret)
++ goto out_unref;
++
++ ret = qxl_bo_pin(user_bo, QXL_GEM_DOMAIN_CPU, NULL);
++ if (ret)
++ goto out_unreserve;
++
++ ret = qxl_bo_kmap(user_bo, &user_ptr);
++ if (ret)
++ goto out_unpin;
++
++ ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd),
++ QXL_RELEASE_CURSOR_CMD,
++ &release, NULL);
++ if (ret)
++ goto out_kunmap;
++ ret = qxl_alloc_bo_reserved(qdev, sizeof(struct qxl_cursor) + size,
++ &cursor_bo);
++ if (ret)
++ goto out_free_release;
++ ret = qxl_bo_kmap(cursor_bo, (void **)&cursor);
++ if (ret)
++ goto out_free_bo;
++
++ cursor->header.unique = 0;
++ cursor->header.type = SPICE_CURSOR_TYPE_ALPHA;
++ cursor->header.width = 64;
++ cursor->header.height = 64;
++ cursor->header.hot_spot_x = 0;
++ cursor->header.hot_spot_y = 0;
++ cursor->data_size = size;
++ cursor->chunk.next_chunk = 0;
++ cursor->chunk.prev_chunk = 0;
++ cursor->chunk.data_size = size;
++
++ memcpy(cursor->chunk.data, user_ptr, size);
++
++ qxl_bo_kunmap(cursor_bo);
++
++ /* finish with the userspace bo */
++ qxl_bo_kunmap(user_bo);
++ qxl_bo_unpin(user_bo);
++ qxl_bo_unreserve(user_bo);
++ drm_gem_object_unreference_unlocked(obj);
++
++ cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release);
++ cmd->type = QXL_CURSOR_SET;
++ cmd->u.set.position.x = qcrtc->cur_x;
++ cmd->u.set.position.y = qcrtc->cur_y;
++
++ cmd->u.set.shape = qxl_bo_physical_address(qdev, cursor_bo, 0);
++ qxl_release_add_res(qdev, release, cursor_bo);
++
++ cmd->u.set.visible = 1;
++ qxl_release_unmap(qdev, release, &cmd->release_info);
++
++ qxl_fence_releaseable(qdev, release);
++ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
++ qxl_release_unreserve(qdev, release);
++
++ qxl_bo_unreserve(cursor_bo);
++ qxl_bo_unref(&cursor_bo);
++
++ return ret;
++out_free_bo:
++ qxl_bo_unref(&cursor_bo);
++out_free_release:
++ qxl_release_unreserve(qdev, release);
++ qxl_release_free(qdev, release);
++out_kunmap:
++ qxl_bo_kunmap(user_bo);
++out_unpin:
++ qxl_bo_unpin(user_bo);
++out_unreserve:
++ qxl_bo_unreserve(user_bo);
++out_unref:
++ drm_gem_object_unreference_unlocked(obj);
++ return ret;
++}
++
++static int qxl_crtc_cursor_move(struct drm_crtc *crtc,
++ int x, int y)
++{
++ struct drm_device *dev = crtc->dev;
++ struct qxl_device *qdev = dev->dev_private;
++ struct qxl_crtc *qcrtc = to_qxl_crtc(crtc);
++ struct qxl_release *release;
++ struct qxl_cursor_cmd *cmd;
++ int ret;
++
++ ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd), QXL_RELEASE_CURSOR_CMD,
++ &release, NULL);
++
++ qcrtc->cur_x = x;
++ qcrtc->cur_y = y;
++
++ cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release);
++ cmd->type = QXL_CURSOR_MOVE;
++ cmd->u.position.x = qcrtc->cur_x;
++ cmd->u.position.y = qcrtc->cur_y;
++ qxl_release_unmap(qdev, release, &cmd->release_info);
++
++ qxl_fence_releaseable(qdev, release);
++ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
++ qxl_release_unreserve(qdev, release);
++ return 0;
++}
++
++
++static const struct drm_crtc_funcs qxl_crtc_funcs = {
++ .cursor_set = qxl_crtc_cursor_set,
++ .cursor_move = qxl_crtc_cursor_move,
++ .gamma_set = qxl_crtc_gamma_set,
++ .set_config = drm_crtc_helper_set_config,
++ .destroy = qxl_crtc_destroy,
++};
++
++static void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
++{
++ struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
++
++ if (qxl_fb->obj)
++ drm_gem_object_unreference_unlocked(qxl_fb->obj);
++ drm_framebuffer_cleanup(fb);
++ kfree(qxl_fb);
++}
++
++int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
++ struct drm_file *file_priv,
++ unsigned flags, unsigned color,
++ struct drm_clip_rect *clips,
++ unsigned num_clips)
++{
++ /* TODO: vmwgfx where this was cribbed from had locking. Why? */
++ struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
++ struct qxl_device *qdev = qxl_fb->base.dev->dev_private;
++ struct drm_clip_rect norect;
++ struct qxl_bo *qobj;
++ int inc = 1;
++
++ qobj = gem_to_qxl_bo(qxl_fb->obj);
++ if (qxl_fb != qdev->active_user_framebuffer) {
++ DRM_INFO("%s: qxl_fb 0x%p != qdev->active_user_framebuffer 0x%p\n",
++ __func__, qxl_fb, qdev->active_user_framebuffer);
++ }
++ if (!num_clips) {
++ num_clips = 1;
++ clips = &norect;
++ norect.x1 = norect.y1 = 0;
++ norect.x2 = fb->width;
++ norect.y2 = fb->height;
++ } else if (flags & DRM_MODE_FB_DIRTY_ANNOTATE_COPY) {
++ num_clips /= 2;
++ inc = 2; /* skip source rects */
++ }
++
++ qxl_draw_dirty_fb(qdev, qxl_fb, qobj, flags, color,
++ clips, num_clips, inc);
++ return 0;
++}
++
++static const struct drm_framebuffer_funcs qxl_fb_funcs = {
++ .destroy = qxl_user_framebuffer_destroy,
++ .dirty = qxl_framebuffer_surface_dirty,
++/* TODO?
++ * .create_handle = qxl_user_framebuffer_create_handle, */
++};
++
++int
++qxl_framebuffer_init(struct drm_device *dev,
++ struct qxl_framebuffer *qfb,
++ struct drm_mode_fb_cmd2 *mode_cmd,
++ struct drm_gem_object *obj)
++{
++ int ret;
++
++ qfb->obj = obj;
++ ret = drm_framebuffer_init(dev, &qfb->base, &qxl_fb_funcs);
++ if (ret) {
++ qfb->obj = NULL;
++ return ret;
++ }
++ drm_helper_mode_fill_fb_struct(&qfb->base, mode_cmd);
++ return 0;
++}
++
++static void qxl_crtc_dpms(struct drm_crtc *crtc, int mode)
++{
++}
++
++static bool qxl_crtc_mode_fixup(struct drm_crtc *crtc,
++ const struct drm_display_mode *mode,
++ struct drm_display_mode *adjusted_mode)
++{
++ struct drm_device *dev = crtc->dev;
++ struct qxl_device *qdev = dev->dev_private;
++
++ qxl_io_log(qdev, "%s: (%d,%d) => (%d,%d)\n",
++ __func__,
++ mode->hdisplay, mode->vdisplay,
++ adjusted_mode->hdisplay,
++ adjusted_mode->vdisplay);
++ return true;
++}
++
++void
++qxl_send_monitors_config(struct qxl_device *qdev)
++{
++ int i;
++
++ BUG_ON(!qdev->ram_header->monitors_config);
++
++ if (qdev->monitors_config->count == 0) {
++ qxl_io_log(qdev, "%s: 0 monitors??\n", __func__);
++ return;
++ }
++ for (i = 0 ; i < qdev->monitors_config->count ; ++i) {
++ struct qxl_head *head = &qdev->monitors_config->heads[i];
++
++ if (head->y > 8192 || head->y < head->x ||
++ head->width > 8192 || head->height > 8192) {
++ DRM_ERROR("head %d wrong: %dx%d+%d+%d\n",
++ i, head->width, head->height,
++ head->x, head->y);
++ return;
++ }
++ }
++ qxl_io_monitors_config(qdev);
++}
++
++static void qxl_monitors_config_set_single(struct qxl_device *qdev,
++ unsigned x, unsigned y,
++ unsigned width, unsigned height)
++{
++ DRM_DEBUG("%dx%d+%d+%d\n", width, height, x, y);
++ qdev->monitors_config->count = 1;
++ qdev->monitors_config->heads[0].x = x;
++ qdev->monitors_config->heads[0].y = y;
++ qdev->monitors_config->heads[0].width = width;
++ qdev->monitors_config->heads[0].height = height;
++}
++
++static int qxl_crtc_mode_set(struct drm_crtc *crtc,
++ struct drm_display_mode *mode,
++ struct drm_display_mode *adjusted_mode,
++ int x, int y,
++ struct drm_framebuffer *old_fb)
++{
++ struct drm_device *dev = crtc->dev;
++ struct qxl_device *qdev = dev->dev_private;
++ struct qxl_mode *m = (void *)mode->private;
++ struct qxl_framebuffer *qfb;
++ struct qxl_bo *bo, *old_bo = NULL;
++ uint32_t width, height, base_offset;
++ bool recreate_primary = false;
++ int ret;
++
++ if (!crtc->fb) {
++ DRM_DEBUG_KMS("No FB bound\n");
++ return 0;
++ }
++
++ if (old_fb) {
++ qfb = to_qxl_framebuffer(old_fb);
++ old_bo = gem_to_qxl_bo(qfb->obj);
++ }
++ qfb = to_qxl_framebuffer(crtc->fb);
++ bo = gem_to_qxl_bo(qfb->obj);
++ if (!m)
++ /* and do we care? */
++ DRM_DEBUG("%dx%d: not a native mode\n", x, y);
++ else
++ DRM_DEBUG("%dx%d: qxl id %d\n",
++ mode->hdisplay, mode->vdisplay, m->id);
++ DRM_DEBUG("+%d+%d (%d,%d) => (%d,%d)\n",
++ x, y,
++ mode->hdisplay, mode->vdisplay,
++ adjusted_mode->hdisplay,
++ adjusted_mode->vdisplay);
++
++ recreate_primary = true;
++
++ width = mode->hdisplay;
++ height = mode->vdisplay;
++ base_offset = 0;
++
++ ret = qxl_bo_reserve(bo, false);
++ if (ret != 0)
++ return ret;
++ ret = qxl_bo_pin(bo, bo->type, NULL);
++ if (ret != 0) {
++ qxl_bo_unreserve(bo);
++ return -EINVAL;
++ }
++ qxl_bo_unreserve(bo);
++ if (recreate_primary) {
++ qxl_io_destroy_primary(qdev);
++ qxl_io_log(qdev,
++ "recreate primary: %dx%d (was %dx%d,%d,%d)\n",
++ width, height, bo->surf.width,
++ bo->surf.height, bo->surf.stride, bo->surf.format);
++ qxl_io_create_primary(qdev, width, height, base_offset, bo);
++ bo->is_primary = true;
++ }
++
++ if (old_bo && old_bo != bo) {
++ old_bo->is_primary = false;
++ ret = qxl_bo_reserve(old_bo, false);
++ qxl_bo_unpin(old_bo);
++ qxl_bo_unreserve(old_bo);
++ }
++
++ if (qdev->monitors_config->count == 0) {
++ qxl_monitors_config_set_single(qdev, x, y,
++ mode->hdisplay,
++ mode->vdisplay);
++ }
++ qdev->mode_set = true;
++ return 0;
++}
++
++static void qxl_crtc_prepare(struct drm_crtc *crtc)
++{
++ DRM_DEBUG("current: %dx%d+%d+%d (%d).\n",
++ crtc->mode.hdisplay, crtc->mode.vdisplay,
++ crtc->x, crtc->y, crtc->enabled);
++}
++
++static void qxl_crtc_commit(struct drm_crtc *crtc)
++{
++ DRM_DEBUG("\n");
++}
++
++void qxl_crtc_load_lut(struct drm_crtc *crtc)
++{
++ DRM_DEBUG("\n");
++}
++
++static const struct drm_crtc_helper_funcs qxl_crtc_helper_funcs = {
++ .dpms = qxl_crtc_dpms,
++ .mode_fixup = qxl_crtc_mode_fixup,
++ .mode_set = qxl_crtc_mode_set,
++ .prepare = qxl_crtc_prepare,
++ .commit = qxl_crtc_commit,
++ .load_lut = qxl_crtc_load_lut,
++};
++
++int qdev_crtc_init(struct drm_device *dev, int num_crtc)
++{
++ struct qxl_crtc *qxl_crtc;
++
++ qxl_crtc = kzalloc(sizeof(struct qxl_crtc), GFP_KERNEL);
++ if (!qxl_crtc)
++ return -ENOMEM;
++
++ drm_crtc_init(dev, &qxl_crtc->base, &qxl_crtc_funcs);
++
++ drm_mode_crtc_set_gamma_size(&qxl_crtc->base, 256);
++ drm_crtc_helper_add(&qxl_crtc->base, &qxl_crtc_helper_funcs);
++ return 0;
++}
++
++static void qxl_enc_dpms(struct drm_encoder *encoder, int mode)
++{
++ DRM_DEBUG("\n");
++}
++
++static bool qxl_enc_mode_fixup(struct drm_encoder *encoder,
++ const struct drm_display_mode *mode,
++ struct drm_display_mode *adjusted_mode)
++{
++ DRM_DEBUG("\n");
++ return true;
++}
++
++static void qxl_enc_prepare(struct drm_encoder *encoder)
++{
++ DRM_DEBUG("\n");
++}
++
++static void qxl_write_monitors_config_for_encoder(struct qxl_device *qdev,
++ struct drm_encoder *encoder)
++{
++ int i;
++ struct qxl_head *head;
++ struct drm_display_mode *mode;
++
++ BUG_ON(!encoder);
++ /* TODO: ugly, do better */
++ for (i = 0 ; (encoder->possible_crtcs != (1 << i)) && i < 32; ++i)
++ ;
++ if (encoder->possible_crtcs != (1 << i)) {
++ DRM_ERROR("encoder has wrong possible_crtcs: %x\n",
++ encoder->possible_crtcs);
++ return;
++ }
++ if (!qdev->monitors_config ||
++ qdev->monitors_config->max_allowed <= i) {
++ DRM_ERROR(
++ "head number too large or missing monitors config: %p, %d",
++ qdev->monitors_config,
++ qdev->monitors_config ?
++ qdev->monitors_config->max_allowed : -1);
++ return;
++ }
++ if (!encoder->crtc) {
++ DRM_ERROR("missing crtc on encoder %p\n", encoder);
++ return;
++ }
++ if (i != 0)
++ DRM_DEBUG("missing for multiple monitors: no head holes\n");
++ head = &qdev->monitors_config->heads[i];
++ head->id = i;
++ head->surface_id = 0;
++ if (encoder->crtc->enabled) {
++ mode = &encoder->crtc->mode;
++ head->width = mode->hdisplay;
++ head->height = mode->vdisplay;
++ head->x = encoder->crtc->x;
++ head->y = encoder->crtc->y;
++ if (qdev->monitors_config->count < i + 1)
++ qdev->monitors_config->count = i + 1;
++ } else {
++ head->width = 0;
++ head->height = 0;
++ head->x = 0;
++ head->y = 0;
++ }
++ DRM_DEBUG("setting head %d to +%d+%d %dx%d\n",
++ i, head->x, head->y, head->width, head->height);
++ head->flags = 0;
++ /* TODO - somewhere else to call this for multiple monitors
++ * (config_commit?) */
++ qxl_send_monitors_config(qdev);
++}
++
++static void qxl_enc_commit(struct drm_encoder *encoder)
++{
++ struct qxl_device *qdev = encoder->dev->dev_private;
++
++ qxl_write_monitors_config_for_encoder(qdev, encoder);
++ DRM_DEBUG("\n");
++}
++
++static void qxl_enc_mode_set(struct drm_encoder *encoder,
++ struct drm_display_mode *mode,
++ struct drm_display_mode *adjusted_mode)
++{
++ DRM_DEBUG("\n");
++}
++
++static int qxl_conn_get_modes(struct drm_connector *connector)
++{
++ int ret = 0;
++ struct qxl_device *qdev = connector->dev->dev_private;
++
++ DRM_DEBUG_KMS("monitors_config=%p\n", qdev->monitors_config);
++ /* TODO: what should we do here? only show the configured modes for the
++ * device, or allow the full list, or both? */
++ if (qdev->monitors_config && qdev->monitors_config->count) {
++ ret = qxl_add_monitors_config_modes(connector);
++ if (ret < 0)
++ return ret;
++ }
++ ret += qxl_add_common_modes(connector);
++ return ret;
++}
++
++static int qxl_conn_mode_valid(struct drm_connector *connector,
++ struct drm_display_mode *mode)
++{
++ /* TODO: is this called for user defined modes? (xrandr --add-mode)
++ * TODO: check that the mode fits in the framebuffer */
++ DRM_DEBUG("%s: %dx%d status=%d\n", mode->name, mode->hdisplay,
++ mode->vdisplay, mode->status);
++ return MODE_OK;
++}
++
++struct drm_encoder *qxl_best_encoder(struct drm_connector *connector)
++{
++ struct qxl_output *qxl_output =
++ drm_connector_to_qxl_output(connector);
++
++ DRM_DEBUG("\n");
++ return &qxl_output->enc;
++}
++
++
++static const struct drm_encoder_helper_funcs qxl_enc_helper_funcs = {
++ .dpms = qxl_enc_dpms,
++ .mode_fixup = qxl_enc_mode_fixup,
++ .prepare = qxl_enc_prepare,
++ .mode_set = qxl_enc_mode_set,
++ .commit = qxl_enc_commit,
++};
++
++static const struct drm_connector_helper_funcs qxl_connector_helper_funcs = {
++ .get_modes = qxl_conn_get_modes,
++ .mode_valid = qxl_conn_mode_valid,
++ .best_encoder = qxl_best_encoder,
++};
++
++static void qxl_conn_save(struct drm_connector *connector)
++{
++ DRM_DEBUG("\n");
++}
++
++static void qxl_conn_restore(struct drm_connector *connector)
++{
++ DRM_DEBUG("\n");
++}
++
++static enum drm_connector_status qxl_conn_detect(
++ struct drm_connector *connector,
++ bool force)
++{
++ struct qxl_output *output =
++ drm_connector_to_qxl_output(connector);
++ struct drm_device *ddev = connector->dev;
++ struct qxl_device *qdev = ddev->dev_private;
++ int connected;
++
++ /* The first monitor is always connected */
++ connected = (output->index == 0) ||
++ (qdev->monitors_config &&
++ qdev->monitors_config->count > output->index);
++
++ DRM_DEBUG("\n");
++ return connected ? connector_status_connected
++ : connector_status_disconnected;
++}
++
++static int qxl_conn_set_property(struct drm_connector *connector,
++ struct drm_property *property,
++ uint64_t value)
++{
++ DRM_DEBUG("\n");
++ return 0;
++}
++
++static void qxl_conn_destroy(struct drm_connector *connector)
++{
++ struct qxl_output *qxl_output =
++ drm_connector_to_qxl_output(connector);
++
++ drm_sysfs_connector_remove(connector);
++ drm_connector_cleanup(connector);
++ kfree(qxl_output);
++}
++
++static const struct drm_connector_funcs qxl_connector_funcs = {
++ .dpms = drm_helper_connector_dpms,
++ .save = qxl_conn_save,
++ .restore = qxl_conn_restore,
++ .detect = qxl_conn_detect,
++ .fill_modes = drm_helper_probe_single_connector_modes,
++ .set_property = qxl_conn_set_property,
++ .destroy = qxl_conn_destroy,
++};
++
++static void qxl_enc_destroy(struct drm_encoder *encoder)
++{
++ drm_encoder_cleanup(encoder);
++}
++
++static const struct drm_encoder_funcs qxl_enc_funcs = {
++ .destroy = qxl_enc_destroy,
++};
++
++int qdev_output_init(struct drm_device *dev, int num_output)
++{
++ struct qxl_output *qxl_output;
++ struct drm_connector *connector;
++ struct drm_encoder *encoder;
++
++ qxl_output = kzalloc(sizeof(struct qxl_output), GFP_KERNEL);
++ if (!qxl_output)
++ return -ENOMEM;
++
++ qxl_output->index = num_output;
++
++ connector = &qxl_output->base;
++ encoder = &qxl_output->enc;
++ drm_connector_init(dev, &qxl_output->base,
++ &qxl_connector_funcs, DRM_MODE_CONNECTOR_VIRTUAL);
++
++ drm_encoder_init(dev, &qxl_output->enc, &qxl_enc_funcs,
++ DRM_MODE_ENCODER_VIRTUAL);
++
++ encoder->possible_crtcs = 1 << num_output;
++ drm_mode_connector_attach_encoder(&qxl_output->base,
++ &qxl_output->enc);
++ drm_encoder_helper_add(encoder, &qxl_enc_helper_funcs);
++ drm_connector_helper_add(connector, &qxl_connector_helper_funcs);
++
++ drm_sysfs_connector_add(connector);
++ return 0;
++}
++
++static struct drm_framebuffer *
++qxl_user_framebuffer_create(struct drm_device *dev,
++ struct drm_file *file_priv,
++ struct drm_mode_fb_cmd2 *mode_cmd)
++{
++ struct drm_gem_object *obj;
++ struct qxl_framebuffer *qxl_fb;
++ struct qxl_device *qdev = dev->dev_private;
++ int ret;
++
++ obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
++
++ qxl_fb = kzalloc(sizeof(*qxl_fb), GFP_KERNEL);
++ if (qxl_fb == NULL)
++ return NULL;
++
++ ret = qxl_framebuffer_init(dev, qxl_fb, mode_cmd, obj);
++ if (ret) {
++ kfree(qxl_fb);
++ drm_gem_object_unreference_unlocked(obj);
++ return NULL;
++ }
++
++ if (qdev->active_user_framebuffer) {
++ DRM_INFO("%s: active_user_framebuffer %p -> %p\n",
++ __func__,
++ qdev->active_user_framebuffer, qxl_fb);
++ }
++ qdev->active_user_framebuffer = qxl_fb;
++
++ return &qxl_fb->base;
++}
++
++static const struct drm_mode_config_funcs qxl_mode_funcs = {
++ .fb_create = qxl_user_framebuffer_create,
++};
++
++int qxl_modeset_init(struct qxl_device *qdev)
++{
++ int i;
++ int ret;
++ struct drm_gem_object *gobj;
++ int max_allowed = QXL_NUM_OUTPUTS;
++ int monitors_config_size = sizeof(struct qxl_monitors_config) +
++ max_allowed * sizeof(struct qxl_head);
++
++ drm_mode_config_init(qdev->ddev);
++ ret = qxl_gem_object_create(qdev, monitors_config_size, 0,
++ QXL_GEM_DOMAIN_VRAM,
++ false, false, NULL, &gobj);
++ if (ret) {
++ DRM_ERROR("%s: failed to create gem ret=%d\n", __func__, ret);
++ return -ENOMEM;
++ }
++ qdev->monitors_config_bo = gem_to_qxl_bo(gobj);
++ qxl_bo_kmap(qdev->monitors_config_bo, NULL);
++ qdev->monitors_config = qdev->monitors_config_bo->kptr;
++ qdev->ram_header->monitors_config =
++ qxl_bo_physical_address(qdev, qdev->monitors_config_bo, 0);
++
++ memset(qdev->monitors_config, 0, monitors_config_size);
++ qdev->monitors_config->max_allowed = max_allowed;
++
++ qdev->ddev->mode_config.funcs = (void *)&qxl_mode_funcs;
++
++ /* modes will be validated against the framebuffer size */
++ qdev->ddev->mode_config.min_width = 320;
++ qdev->ddev->mode_config.min_height = 200;
++ qdev->ddev->mode_config.max_width = 8192;
++ qdev->ddev->mode_config.max_height = 8192;
++
++ qdev->ddev->mode_config.fb_base = qdev->vram_base;
++ for (i = 0 ; i < QXL_NUM_OUTPUTS; ++i) {
++ qdev_crtc_init(qdev->ddev, i);
++ qdev_output_init(qdev->ddev, i);
++ }
++
++ qdev->mode_info.mode_config_initialized = true;
++
++ /* primary surface must be created by this point, to allow
++ * issuing command queue commands and having them read by
++ * spice server. */
++ qxl_fbdev_init(qdev);
++ return 0;
++}
++
++void qxl_modeset_fini(struct qxl_device *qdev)
++{
++ qxl_fbdev_fini(qdev);
++ if (qdev->mode_info.mode_config_initialized) {
++ drm_mode_config_cleanup(qdev->ddev);
++ qdev->mode_info.mode_config_initialized = false;
++ }
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_draw.c b/drivers/gpu/drm/qxl/qxl_draw.c
+new file mode 100644
+index 0000000..7d5396d2
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_draw.c
+@@ -0,0 +1,384 @@
++/*
++ * Copyright 2011 Red Hat, Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * on the rights to use, copy, modify, merge, publish, distribute, sub
++ * license, and/or sell copies of the Software, and to permit persons to whom
++ * the Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
++ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++/* returns a pointer to the already allocated qxl_rect array inside
++ * the qxl_clip_rects. This is *not* the same as the memory allocated
++ * on the device, it is offset to qxl_clip_rects.chunk.data */
++static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev,
++ struct qxl_drawable *drawable,
++ unsigned num_clips,
++ struct qxl_bo **clips_bo,
++ struct qxl_release *release)
++{
++ struct qxl_clip_rects *dev_clips;
++ int ret;
++ int size = sizeof(*dev_clips) + sizeof(struct qxl_rect) * num_clips;
++ ret = qxl_alloc_bo_reserved(qdev, size, clips_bo);
++ if (ret)
++ return NULL;
++
++ ret = qxl_bo_kmap(*clips_bo, (void **)&dev_clips);
++ if (ret) {
++ qxl_bo_unref(clips_bo);
++ return NULL;
++ }
++ dev_clips->num_rects = num_clips;
++ dev_clips->chunk.next_chunk = 0;
++ dev_clips->chunk.prev_chunk = 0;
++ dev_clips->chunk.data_size = sizeof(struct qxl_rect) * num_clips;
++ return (struct qxl_rect *)dev_clips->chunk.data;
++}
++
++static int
++make_drawable(struct qxl_device *qdev, int surface, uint8_t type,
++ const struct qxl_rect *rect,
++ struct qxl_release **release)
++{
++ struct qxl_drawable *drawable;
++ int i, ret;
++
++ ret = qxl_alloc_release_reserved(qdev, sizeof(*drawable),
++ QXL_RELEASE_DRAWABLE, release,
++ NULL);
++ if (ret)
++ return ret;
++
++ drawable = (struct qxl_drawable *)qxl_release_map(qdev, *release);
++ drawable->type = type;
++
++ drawable->surface_id = surface; /* Only primary for now */
++ drawable->effect = QXL_EFFECT_OPAQUE;
++ drawable->self_bitmap = 0;
++ drawable->self_bitmap_area.top = 0;
++ drawable->self_bitmap_area.left = 0;
++ drawable->self_bitmap_area.bottom = 0;
++ drawable->self_bitmap_area.right = 0;
++ /* FIXME: add clipping */
++ drawable->clip.type = SPICE_CLIP_TYPE_NONE;
++
++ /*
++ * surfaces_dest[i] should apparently be filled out with the
++ * surfaces that we depend on, and surface_rects should be
++ * filled with the rectangles of those surfaces that we
++ * are going to use.
++ */
++ for (i = 0; i < 3; ++i)
++ drawable->surfaces_dest[i] = -1;
++
++ if (rect)
++ drawable->bbox = *rect;
++
++ drawable->mm_time = qdev->rom->mm_clock;
++ qxl_release_unmap(qdev, *release, &drawable->release_info);
++ return 0;
++}
++
++static int qxl_palette_create_1bit(struct qxl_bo **palette_bo,
++ const struct qxl_fb_image *qxl_fb_image)
++{
++ struct qxl_device *qdev = qxl_fb_image->qdev;
++ const struct fb_image *fb_image = &qxl_fb_image->fb_image;
++ uint32_t visual = qxl_fb_image->visual;
++ const uint32_t *pseudo_palette = qxl_fb_image->pseudo_palette;
++ struct qxl_palette *pal;
++ int ret;
++ uint32_t fgcolor, bgcolor;
++ static uint64_t unique; /* we make no attempt to actually set this
++ * correctly globaly, since that would require
++ * tracking all of our palettes. */
++
++ ret = qxl_alloc_bo_reserved(qdev,
++ sizeof(struct qxl_palette) + sizeof(uint32_t) * 2,
++ palette_bo);
++
++ ret = qxl_bo_kmap(*palette_bo, (void **)&pal);
++ pal->num_ents = 2;
++ pal->unique = unique++;
++ if (visual == FB_VISUAL_TRUECOLOR || visual == FB_VISUAL_DIRECTCOLOR) {
++ /* NB: this is the only used branch currently. */
++ fgcolor = pseudo_palette[fb_image->fg_color];
++ bgcolor = pseudo_palette[fb_image->bg_color];
++ } else {
++ fgcolor = fb_image->fg_color;
++ bgcolor = fb_image->bg_color;
++ }
++ pal->ents[0] = bgcolor;
++ pal->ents[1] = fgcolor;
++ qxl_bo_kunmap(*palette_bo);
++ return 0;
++}
++
++void qxl_draw_opaque_fb(const struct qxl_fb_image *qxl_fb_image,
++ int stride /* filled in if 0 */)
++{
++ struct qxl_device *qdev = qxl_fb_image->qdev;
++ struct qxl_drawable *drawable;
++ struct qxl_rect rect;
++ const struct fb_image *fb_image = &qxl_fb_image->fb_image;
++ int x = fb_image->dx;
++ int y = fb_image->dy;
++ int width = fb_image->width;
++ int height = fb_image->height;
++ const char *src = fb_image->data;
++ int depth = fb_image->depth;
++ struct qxl_release *release;
++ struct qxl_bo *image_bo;
++ struct qxl_image *image;
++ int ret;
++
++ if (stride == 0)
++ stride = depth * width / 8;
++
++ rect.left = x;
++ rect.right = x + width;
++ rect.top = y;
++ rect.bottom = y + height;
++
++ ret = make_drawable(qdev, 0, QXL_DRAW_COPY, &rect, &release);
++ if (ret)
++ return;
++
++ ret = qxl_image_create(qdev, release, &image_bo,
++ (const uint8_t *)src, 0, 0,
++ width, height, depth, stride);
++ QXL_INFO(qdev, "image_bo offset %llx\n",
++ image_bo->tbo.addr_space_offset - DRM_FILE_OFFSET);
++ if (depth == 1) {
++ struct qxl_bo *palette_bo;
++
++ ret = qxl_palette_create_1bit(&palette_bo, qxl_fb_image);
++ qxl_release_add_res(qdev, release, palette_bo);
++ ret = qxl_bo_kmap(image_bo, (void **)&image);
++ image->u.bitmap.palette =
++ qxl_bo_physical_address(qdev, palette_bo, 0);
++ qxl_bo_kunmap(image_bo);
++ qxl_bo_unreserve(palette_bo);
++ qxl_bo_unref(&palette_bo);
++ }
++
++ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release);
++
++ drawable->u.copy.src_area.top = 0;
++ drawable->u.copy.src_area.bottom = height;
++ drawable->u.copy.src_area.left = 0;
++ drawable->u.copy.src_area.right = width;
++
++ drawable->u.copy.rop_descriptor = SPICE_ROPD_OP_PUT;
++ drawable->u.copy.scale_mode = 0;
++ drawable->u.copy.mask.flags = 0;
++ drawable->u.copy.mask.pos.x = 0;
++ drawable->u.copy.mask.pos.y = 0;
++ drawable->u.copy.mask.bitmap = 0;
++
++ drawable->u.copy.src_bitmap =
++ qxl_bo_physical_address(qdev, image_bo, 0);
++ qxl_release_unmap(qdev, release, &drawable->release_info);
++
++ qxl_release_add_res(qdev, release, image_bo);
++ qxl_bo_unreserve(image_bo);
++ qxl_bo_unref(&image_bo);
++
++ qxl_fence_releaseable(qdev, release);
++ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false);
++ qxl_release_unreserve(qdev, release);
++}
++
++/* push a draw command using the given clipping rectangles as
++ * the sources from the shadow framebuffer.
++ *
++ * Right now implementing with a single draw and a clip list. Clip
++ * lists are known to be a problem performance wise, this can be solved
++ * by treating them differently in the server.
++ */
++void qxl_draw_dirty_fb(struct qxl_device *qdev,
++ struct qxl_framebuffer *qxl_fb,
++ struct qxl_bo *bo,
++ unsigned flags, unsigned color,
++ struct drm_clip_rect *clips,
++ unsigned num_clips, int inc)
++{
++ /*
++ * TODO: if flags & DRM_MODE_FB_DIRTY_ANNOTATE_FILL then we should
++ * send a fill command instead, much cheaper.
++ *
++ * See include/drm/drm_mode.h
++ */
++ struct drm_clip_rect *clips_ptr;
++ int i;
++ int left, right, top, bottom;
++ int width, height;
++ struct qxl_drawable *drawable;
++ struct qxl_rect drawable_rect;
++ struct qxl_rect *rects;
++ int stride = qxl_fb->base.pitches[0];
++ /* depth is not actually interesting, we don't mask with it */
++ int depth = qxl_fb->base.bits_per_pixel;
++ uint8_t *surface_base;
++ struct qxl_release *release;
++ struct qxl_bo *image_bo;
++ struct qxl_bo *clips_bo;
++ int ret;
++
++ left = clips->x1;
++ right = clips->x2;
++ top = clips->y1;
++ bottom = clips->y2;
++
++ /* skip the first clip rect */
++ for (i = 1, clips_ptr = clips + inc;
++ i < num_clips; i++, clips_ptr += inc) {
++ left = min_t(int, left, (int)clips_ptr->x1);
++ right = max_t(int, right, (int)clips_ptr->x2);
++ top = min_t(int, top, (int)clips_ptr->y1);
++ bottom = max_t(int, bottom, (int)clips_ptr->y2);
++ }
++
++ width = right - left;
++ height = bottom - top;
++ drawable_rect.left = left;
++ drawable_rect.right = right;
++ drawable_rect.top = top;
++ drawable_rect.bottom = bottom;
++ ret = make_drawable(qdev, 0, QXL_DRAW_COPY, &drawable_rect,
++ &release);
++ if (ret)
++ return;
++
++ ret = qxl_bo_kmap(bo, (void **)&surface_base);
++ if (ret)
++ return;
++
++ ret = qxl_image_create(qdev, release, &image_bo, surface_base,
++ left, top, width, height, depth, stride);
++ qxl_bo_kunmap(bo);
++ if (ret)
++ goto out_unref;
++
++ rects = drawable_set_clipping(qdev, drawable, num_clips, &clips_bo, release);
++ if (!rects) {
++ qxl_bo_unref(&image_bo);
++ goto out_unref;
++ }
++ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release);
++
++ drawable->clip.type = SPICE_CLIP_TYPE_RECTS;
++ drawable->clip.data = qxl_bo_physical_address(qdev,
++ clips_bo, 0);
++ qxl_release_add_res(qdev, release, clips_bo);
++
++ drawable->u.copy.src_area.top = 0;
++ drawable->u.copy.src_area.bottom = height;
++ drawable->u.copy.src_area.left = 0;
++ drawable->u.copy.src_area.right = width;
++
++ drawable->u.copy.rop_descriptor = SPICE_ROPD_OP_PUT;
++ drawable->u.copy.scale_mode = 0;
++ drawable->u.copy.mask.flags = 0;
++ drawable->u.copy.mask.pos.x = 0;
++ drawable->u.copy.mask.pos.y = 0;
++ drawable->u.copy.mask.bitmap = 0;
++
++ drawable->u.copy.src_bitmap = qxl_bo_physical_address(qdev, image_bo, 0);
++ qxl_release_unmap(qdev, release, &drawable->release_info);
++ qxl_release_add_res(qdev, release, image_bo);
++ qxl_bo_unreserve(image_bo);
++ qxl_bo_unref(&image_bo);
++ clips_ptr = clips;
++ for (i = 0; i < num_clips; i++, clips_ptr += inc) {
++ rects[i].left = clips_ptr->x1;
++ rects[i].right = clips_ptr->x2;
++ rects[i].top = clips_ptr->y1;
++ rects[i].bottom = clips_ptr->y2;
++ }
++ qxl_bo_kunmap(clips_bo);
++ qxl_bo_unreserve(clips_bo);
++ qxl_bo_unref(&clips_bo);
++
++ qxl_fence_releaseable(qdev, release);
++ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false);
++ qxl_release_unreserve(qdev, release);
++ return;
++
++out_unref:
++ qxl_release_unreserve(qdev, release);
++ qxl_release_free(qdev, release);
++}
++
++void qxl_draw_copyarea(struct qxl_device *qdev,
++ u32 width, u32 height,
++ u32 sx, u32 sy,
++ u32 dx, u32 dy)
++{
++ struct qxl_drawable *drawable;
++ struct qxl_rect rect;
++ struct qxl_release *release;
++ int ret;
++
++ rect.left = dx;
++ rect.top = dy;
++ rect.right = dx + width;
++ rect.bottom = dy + height;
++ ret = make_drawable(qdev, 0, QXL_COPY_BITS, &rect, &release);
++ if (ret)
++ return;
++
++ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release);
++ drawable->u.copy_bits.src_pos.x = sx;
++ drawable->u.copy_bits.src_pos.y = sy;
++
++ qxl_release_unmap(qdev, release, &drawable->release_info);
++ qxl_fence_releaseable(qdev, release);
++ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false);
++ qxl_release_unreserve(qdev, release);
++}
++
++void qxl_draw_fill(struct qxl_draw_fill *qxl_draw_fill_rec)
++{
++ struct qxl_device *qdev = qxl_draw_fill_rec->qdev;
++ struct qxl_rect rect = qxl_draw_fill_rec->rect;
++ uint32_t color = qxl_draw_fill_rec->color;
++ uint16_t rop = qxl_draw_fill_rec->rop;
++ struct qxl_drawable *drawable;
++ struct qxl_release *release;
++ int ret;
++
++ ret = make_drawable(qdev, 0, QXL_DRAW_FILL, &rect, &release);
++ if (ret)
++ return;
++
++ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release);
++ drawable->u.fill.brush.type = SPICE_BRUSH_TYPE_SOLID;
++ drawable->u.fill.brush.u.color = color;
++ drawable->u.fill.rop_descriptor = rop;
++ drawable->u.fill.mask.flags = 0;
++ drawable->u.fill.mask.pos.x = 0;
++ drawable->u.fill.mask.pos.y = 0;
++ drawable->u.fill.mask.bitmap = 0;
++
++ qxl_release_unmap(qdev, release, &drawable->release_info);
++ qxl_fence_releaseable(qdev, release);
++ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false);
++ qxl_release_unreserve(qdev, release);
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
+new file mode 100644
+index 0000000..d337da0
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_drv.c
+@@ -0,0 +1,145 @@
++/* vim: set ts=8 sw=8 tw=78 ai noexpandtab */
++/* qxl_drv.c -- QXL driver -*- linux-c -*-
++ *
++ * Copyright 2011 Red Hat, Inc.
++ * All Rights Reserved.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors:
++ * Dave Airlie <airlie@redhat.com>
++ * Alon Levy <alevy@redhat.com>
++ */
++
++#include <linux/module.h>
++#include <linux/console.h>
++
++#include "drmP.h"
++#include "drm/drm.h"
++
++#include "qxl_drv.h"
++
++extern int qxl_max_ioctls;
++static DEFINE_PCI_DEVICE_TABLE(pciidlist) = {
++ { 0x1b36, 0x100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8,
++ 0xffff00, 0 },
++ { 0x1b36, 0x100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_OTHER << 8,
++ 0xffff00, 0 },
++ { 0, 0, 0 },
++};
++MODULE_DEVICE_TABLE(pci, pciidlist);
++
++int qxl_modeset = -1;
++
++MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
++module_param_named(modeset, qxl_modeset, int, 0400);
++
++static struct drm_driver qxl_driver;
++static struct pci_driver qxl_pci_driver;
++
++static int
++qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
++{
++ if (pdev->revision < 4) {
++ DRM_ERROR("qxl too old, doesn't support client_monitors_config,"
++ " use xf86-video-qxl in user mode");
++ return -EINVAL; /* TODO: ENODEV ? */
++ }
++ return drm_get_pci_dev(pdev, ent, &qxl_driver);
++}
++
++static void
++qxl_pci_remove(struct pci_dev *pdev)
++{
++ struct drm_device *dev = pci_get_drvdata(pdev);
++
++ drm_put_dev(dev);
++}
++
++static struct pci_driver qxl_pci_driver = {
++ .name = DRIVER_NAME,
++ .id_table = pciidlist,
++ .probe = qxl_pci_probe,
++ .remove = qxl_pci_remove,
++};
++
++static const struct file_operations qxl_fops = {
++ .owner = THIS_MODULE,
++ .open = drm_open,
++ .release = drm_release,
++ .unlocked_ioctl = drm_ioctl,
++ .poll = drm_poll,
++ .fasync = drm_fasync,
++ .mmap = qxl_mmap,
++};
++
++static struct drm_driver qxl_driver = {
++ .driver_features = DRIVER_GEM | DRIVER_MODESET |
++ DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
++ .dev_priv_size = 0,
++ .load = qxl_driver_load,
++ .unload = qxl_driver_unload,
++
++ .dumb_create = qxl_mode_dumb_create,
++ .dumb_map_offset = qxl_mode_dumb_mmap,
++ .dumb_destroy = qxl_mode_dumb_destroy,
++#if defined(CONFIG_DEBUG_FS)
++ .debugfs_init = qxl_debugfs_init,
++ .debugfs_cleanup = qxl_debugfs_takedown,
++#endif
++ .gem_init_object = qxl_gem_object_init,
++ .gem_free_object = qxl_gem_object_free,
++ .gem_open_object = qxl_gem_object_open,
++ .gem_close_object = qxl_gem_object_close,
++ .fops = &qxl_fops,
++ .ioctls = qxl_ioctls,
++ .irq_handler = qxl_irq_handler,
++ .name = DRIVER_NAME,
++ .desc = DRIVER_DESC,
++ .date = DRIVER_DATE,
++ .major = 0,
++ .minor = 1,
++ .patchlevel = 0,
++};
++
++static int __init qxl_init(void)
++{
++#ifdef CONFIG_VGA_CONSOLE
++ if (vgacon_text_force() && qxl_modeset == -1)
++ return -EINVAL;
++#endif
++
++ if (qxl_modeset == 0)
++ return -EINVAL;
++ qxl_driver.num_ioctls = qxl_max_ioctls;
++ return drm_pci_init(&qxl_driver, &qxl_pci_driver);
++}
++
++static void __exit qxl_exit(void)
++{
++ drm_pci_exit(&qxl_driver, &qxl_pci_driver);
++}
++
++module_init(qxl_init);
++module_exit(qxl_exit);
++
++MODULE_AUTHOR(DRIVER_AUTHOR);
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL and additional rights");
+diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
+new file mode 100644
+index 0000000..52b582c
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_drv.h
+@@ -0,0 +1,566 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++
++#ifndef QXL_DRV_H
++#define QXL_DRV_H
++
++/*
++ * Definitions taken from spice-protocol, plus kernel driver specific bits.
++ */
++
++#include <linux/workqueue.h>
++#include <linux/firmware.h>
++#include <linux/platform_device.h>
++
++#include "drmP.h"
++#include "drm_crtc.h"
++#include <ttm/ttm_bo_api.h>
++#include <ttm/ttm_bo_driver.h>
++#include <ttm/ttm_placement.h>
++#include <ttm/ttm_module.h>
++
++#include <drm/qxl_drm.h>
++#include "qxl_dev.h"
++
++#define DRIVER_AUTHOR "Dave Airlie"
++
++#define DRIVER_NAME "qxl"
++#define DRIVER_DESC "RH QXL"
++#define DRIVER_DATE "20120117"
++
++#define DRIVER_MAJOR 0
++#define DRIVER_MINOR 1
++#define DRIVER_PATCHLEVEL 0
++
++#define QXL_NUM_OUTPUTS 1
++
++#define QXL_DEBUGFS_MAX_COMPONENTS 32
++
++extern int qxl_log_level;
++
++enum {
++ QXL_INFO_LEVEL = 1,
++ QXL_DEBUG_LEVEL = 2,
++};
++
++#define QXL_INFO(qdev, fmt, ...) do { \
++ if (qxl_log_level >= QXL_INFO_LEVEL) { \
++ qxl_io_log(qdev, fmt, __VA_ARGS__); \
++ } \
++ } while (0)
++#define QXL_DEBUG(qdev, fmt, ...) do { \
++ if (qxl_log_level >= QXL_DEBUG_LEVEL) { \
++ qxl_io_log(qdev, fmt, __VA_ARGS__); \
++ } \
++ } while (0)
++#define QXL_INFO_ONCE(qdev, fmt, ...) do { \
++ static int done; \
++ if (!done) { \
++ done = 1; \
++ QXL_INFO(qdev, fmt, __VA_ARGS__); \
++ } \
++ } while (0)
++
++#define DRM_FILE_OFFSET 0x100000000ULL
++#define DRM_FILE_PAGE_OFFSET (DRM_FILE_OFFSET >> PAGE_SHIFT)
++
++#define QXL_INTERRUPT_MASK (\
++ QXL_INTERRUPT_DISPLAY |\
++ QXL_INTERRUPT_CURSOR |\
++ QXL_INTERRUPT_IO_CMD |\
++ QXL_INTERRUPT_CLIENT_MONITORS_CONFIG)
++
++struct qxl_fence {
++ struct qxl_device *qdev;
++ uint32_t num_active_releases;
++ uint32_t *release_ids;
++ struct radix_tree_root tree;
++};
++
++struct qxl_bo {
++ /* Protected by gem.mutex */
++ struct list_head list;
++ /* Protected by tbo.reserved */
++ u32 placements[3];
++ struct ttm_placement placement;
++ struct ttm_buffer_object tbo;
++ struct ttm_bo_kmap_obj kmap;
++ unsigned pin_count;
++ void *kptr;
++ int type;
++ /* Constant after initialization */
++ struct drm_gem_object gem_base;
++ bool is_primary; /* is this now a primary surface */
++ bool hw_surf_alloc;
++ struct qxl_surface surf;
++ uint32_t surface_id;
++ struct qxl_fence fence; /* per bo fence - list of releases */
++ struct qxl_release *surf_create;
++ atomic_t reserve_count;
++};
++#define gem_to_qxl_bo(gobj) container_of((gobj), struct qxl_bo, gem_base)
++
++struct qxl_gem {
++ struct mutex mutex;
++ struct list_head objects;
++};
++
++struct qxl_bo_list {
++ struct list_head lhead;
++ struct qxl_bo *bo;
++};
++
++struct qxl_reloc_list {
++ struct list_head bos;
++};
++
++struct qxl_crtc {
++ struct drm_crtc base;
++ int cur_x;
++ int cur_y;
++};
++
++struct qxl_output {
++ int index;
++ struct drm_connector base;
++ struct drm_encoder enc;
++};
++
++struct qxl_framebuffer {
++ struct drm_framebuffer base;
++ struct drm_gem_object *obj;
++};
++
++#define to_qxl_crtc(x) container_of(x, struct qxl_crtc, base)
++#define drm_connector_to_qxl_output(x) container_of(x, struct qxl_output, base)
++#define drm_encoder_to_qxl_output(x) container_of(x, struct qxl_output, base)
++#define to_qxl_framebuffer(x) container_of(x, struct qxl_framebuffer, base)
++
++struct qxl_mman {
++ struct ttm_bo_global_ref bo_global_ref;
++ struct drm_global_reference mem_global_ref;
++ bool mem_global_referenced;
++ struct ttm_bo_device bdev;
++};
++
++struct qxl_mode_info {
++ int num_modes;
++ struct qxl_mode *modes;
++ bool mode_config_initialized;
++
++ /* pointer to fbdev info structure */
++ struct qxl_fbdev *qfbdev;
++};
++
++
++struct qxl_memslot {
++ uint8_t generation;
++ uint64_t start_phys_addr;
++ uint64_t end_phys_addr;
++ uint64_t high_bits;
++};
++
++enum {
++ QXL_RELEASE_DRAWABLE,
++ QXL_RELEASE_SURFACE_CMD,
++ QXL_RELEASE_CURSOR_CMD,
++};
++
++/* drm_ prefix to differentiate from qxl_release_info in
++ * spice-protocol/qxl_dev.h */
++#define QXL_MAX_RES 96
++struct qxl_release {
++ int id;
++ int type;
++ int bo_count;
++ uint32_t release_offset;
++ uint32_t surface_release_id;
++ struct qxl_bo *bos[QXL_MAX_RES];
++};
++
++struct qxl_fb_image {
++ struct qxl_device *qdev;
++ uint32_t pseudo_palette[16];
++ struct fb_image fb_image;
++ uint32_t visual;
++};
++
++struct qxl_draw_fill {
++ struct qxl_device *qdev;
++ struct qxl_rect rect;
++ uint32_t color;
++ uint16_t rop;
++};
++
++/*
++ * Debugfs
++ */
++struct qxl_debugfs {
++ struct drm_info_list *files;
++ unsigned num_files;
++};
++
++int qxl_debugfs_add_files(struct qxl_device *rdev,
++ struct drm_info_list *files,
++ unsigned nfiles);
++int qxl_debugfs_fence_init(struct qxl_device *rdev);
++void qxl_debugfs_remove_files(struct qxl_device *qdev);
++
++struct qxl_device;
++
++struct qxl_device {
++ struct device *dev;
++ struct drm_device *ddev;
++ struct pci_dev *pdev;
++ unsigned long flags;
++
++ resource_size_t vram_base, vram_size;
++ resource_size_t surfaceram_base, surfaceram_size;
++ resource_size_t rom_base, rom_size;
++ struct qxl_rom *rom;
++
++ struct qxl_mode *modes;
++ struct qxl_bo *monitors_config_bo;
++ struct qxl_monitors_config *monitors_config;
++
++ /* last received client_monitors_config */
++ struct qxl_monitors_config *client_monitors_config;
++
++ int io_base;
++ void *ram;
++ struct qxl_mman mman;
++ struct qxl_gem gem;
++ struct qxl_mode_info mode_info;
++
++ /*
++ * last created framebuffer with fb_create
++ * only used by debugfs dumbppm
++ */
++ struct qxl_framebuffer *active_user_framebuffer;
++
++ struct fb_info *fbdev_info;
++ struct qxl_framebuffer *fbdev_qfb;
++ void *ram_physical;
++
++ struct qxl_ring *release_ring;
++ struct qxl_ring *command_ring;
++ struct qxl_ring *cursor_ring;
++
++ struct qxl_ram_header *ram_header;
++ bool mode_set;
++
++ bool primary_created;
++
++ struct qxl_memslot *mem_slots;
++ uint8_t n_mem_slots;
++
++ uint8_t main_mem_slot;
++ uint8_t surfaces_mem_slot;
++ uint8_t slot_id_bits;
++ uint8_t slot_gen_bits;
++ uint64_t va_slot_mask;
++
++ struct idr release_idr;
++ spinlock_t release_idr_lock;
++ struct mutex async_io_mutex;
++ unsigned int last_sent_io_cmd;
++
++ /* interrupt handling */
++ atomic_t irq_received;
++ atomic_t irq_received_display;
++ atomic_t irq_received_cursor;
++ atomic_t irq_received_io_cmd;
++ unsigned irq_received_error;
++ wait_queue_head_t display_event;
++ wait_queue_head_t cursor_event;
++ wait_queue_head_t io_cmd_event;
++ struct work_struct client_monitors_config_work;
++
++ /* debugfs */
++ struct qxl_debugfs debugfs[QXL_DEBUGFS_MAX_COMPONENTS];
++ unsigned debugfs_count;
++
++ struct mutex update_area_mutex;
++
++ struct idr surf_id_idr;
++ spinlock_t surf_id_idr_lock;
++ int last_alloced_surf_id;
++
++ struct mutex surf_evict_mutex;
++ struct io_mapping *vram_mapping;
++ struct io_mapping *surface_mapping;
++
++ /* */
++ struct mutex release_mutex;
++ struct qxl_bo *current_release_bo[3];
++ int current_release_bo_offset[3];
++
++ struct workqueue_struct *gc_queue;
++ struct work_struct gc_work;
++
++};
++
++/* forward declaration for QXL_INFO_IO */
++void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...);
++
++extern struct drm_ioctl_desc qxl_ioctls[];
++extern int qxl_max_ioctl;
++
++int qxl_driver_load(struct drm_device *dev, unsigned long flags);
++int qxl_driver_unload(struct drm_device *dev);
++
++int qxl_modeset_init(struct qxl_device *qdev);
++void qxl_modeset_fini(struct qxl_device *qdev);
++
++int qxl_bo_init(struct qxl_device *qdev);
++void qxl_bo_fini(struct qxl_device *qdev);
++
++struct qxl_ring *qxl_ring_create(struct qxl_ring_header *header,
++ int element_size,
++ int n_elements,
++ int prod_notify,
++ bool set_prod_notify,
++ wait_queue_head_t *push_event);
++void qxl_ring_free(struct qxl_ring *ring);
++
++static inline void *
++qxl_fb_virtual_address(struct qxl_device *qdev, unsigned long physical)
++{
++ QXL_INFO(qdev, "not implemented (%lu)\n", physical);
++ return 0;
++}
++
++static inline uint64_t
++qxl_bo_physical_address(struct qxl_device *qdev, struct qxl_bo *bo,
++ unsigned long offset)
++{
++ int slot_id = bo->type == QXL_GEM_DOMAIN_VRAM ? qdev->main_mem_slot : qdev->surfaces_mem_slot;
++ struct qxl_memslot *slot = &(qdev->mem_slots[slot_id]);
++
++ /* TODO - need to hold one of the locks to read tbo.offset */
++ return slot->high_bits | (bo->tbo.offset + offset);
++}
++
++/* qxl_fb.c */
++#define QXLFB_CONN_LIMIT 1
++
++int qxl_fbdev_init(struct qxl_device *qdev);
++void qxl_fbdev_fini(struct qxl_device *qdev);
++int qxl_get_handle_for_primary_fb(struct qxl_device *qdev,
++ struct drm_file *file_priv,
++ uint32_t *handle);
++
++/* qxl_display.c */
++int
++qxl_framebuffer_init(struct drm_device *dev,
++ struct qxl_framebuffer *rfb,
++ struct drm_mode_fb_cmd2 *mode_cmd,
++ struct drm_gem_object *obj);
++void qxl_display_read_client_monitors_config(struct qxl_device *qdev);
++void qxl_send_monitors_config(struct qxl_device *qdev);
++
++/* used by qxl_debugfs only */
++void qxl_crtc_set_from_monitors_config(struct qxl_device *qdev);
++void qxl_alloc_client_monitors_config(struct qxl_device *qdev, unsigned count);
++
++/* qxl_gem.c */
++int qxl_gem_init(struct qxl_device *qdev);
++void qxl_gem_fini(struct qxl_device *qdev);
++int qxl_gem_object_create(struct qxl_device *qdev, int size,
++ int alignment, int initial_domain,
++ bool discardable, bool kernel,
++ struct qxl_surface *surf,
++ struct drm_gem_object **obj);
++int qxl_gem_object_pin(struct drm_gem_object *obj, uint32_t pin_domain,
++ uint64_t *gpu_addr);
++void qxl_gem_object_unpin(struct drm_gem_object *obj);
++int qxl_gem_object_create_with_handle(struct qxl_device *qdev,
++ struct drm_file *file_priv,
++ u32 domain,
++ size_t size,
++ struct qxl_surface *surf,
++ struct qxl_bo **qobj,
++ uint32_t *handle);
++int qxl_gem_object_init(struct drm_gem_object *obj);
++void qxl_gem_object_free(struct drm_gem_object *gobj);
++int qxl_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv);
++void qxl_gem_object_close(struct drm_gem_object *obj,
++ struct drm_file *file_priv);
++void qxl_bo_force_delete(struct qxl_device *qdev);
++int qxl_bo_kmap(struct qxl_bo *bo, void **ptr);
++
++/* qxl_dumb.c */
++int qxl_mode_dumb_create(struct drm_file *file_priv,
++ struct drm_device *dev,
++ struct drm_mode_create_dumb *args);
++int qxl_mode_dumb_destroy(struct drm_file *file_priv,
++ struct drm_device *dev,
++ uint32_t handle);
++int qxl_mode_dumb_mmap(struct drm_file *filp,
++ struct drm_device *dev,
++ uint32_t handle, uint64_t *offset_p);
++
++
++/* qxl ttm */
++int qxl_ttm_init(struct qxl_device *qdev);
++void qxl_ttm_fini(struct qxl_device *qdev);
++int qxl_mmap(struct file *filp, struct vm_area_struct *vma);
++
++/* qxl image */
++
++int qxl_image_create(struct qxl_device *qdev,
++ struct qxl_release *release,
++ struct qxl_bo **image_bo,
++ const uint8_t *data,
++ int x, int y, int width, int height,
++ int depth, int stride);
++void qxl_update_screen(struct qxl_device *qxl);
++
++/* qxl io operations (qxl_cmd.c) */
++
++void qxl_io_create_primary(struct qxl_device *qdev,
++ unsigned width, unsigned height, unsigned offset,
++ struct qxl_bo *bo);
++void qxl_io_destroy_primary(struct qxl_device *qdev);
++void qxl_io_memslot_add(struct qxl_device *qdev, uint8_t id);
++void qxl_io_notify_oom(struct qxl_device *qdev);
++
++int qxl_io_update_area(struct qxl_device *qdev, struct qxl_bo *surf,
++ const struct qxl_rect *area);
++
++void qxl_io_reset(struct qxl_device *qdev);
++void qxl_io_monitors_config(struct qxl_device *qdev);
++int qxl_ring_push(struct qxl_ring *ring, const void *new_elt, bool interruptible);
++void qxl_io_flush_release(struct qxl_device *qdev);
++void qxl_io_flush_surfaces(struct qxl_device *qdev);
++
++int qxl_release_reserve(struct qxl_device *qdev,
++ struct qxl_release *release, bool no_wait);
++void qxl_release_unreserve(struct qxl_device *qdev,
++ struct qxl_release *release);
++union qxl_release_info *qxl_release_map(struct qxl_device *qdev,
++ struct qxl_release *release);
++void qxl_release_unmap(struct qxl_device *qdev,
++ struct qxl_release *release,
++ union qxl_release_info *info);
++/*
++ * qxl_bo_add_resource.
++ *
++ */
++void qxl_bo_add_resource(struct qxl_bo *main_bo, struct qxl_bo *resource);
++
++int qxl_alloc_surface_release_reserved(struct qxl_device *qdev,
++ enum qxl_surface_cmd_type surface_cmd_type,
++ struct qxl_release *create_rel,
++ struct qxl_release **release);
++int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size,
++ int type, struct qxl_release **release,
++ struct qxl_bo **rbo);
++int qxl_fence_releaseable(struct qxl_device *qdev,
++ struct qxl_release *release);
++int
++qxl_push_command_ring_release(struct qxl_device *qdev, struct qxl_release *release,
++ uint32_t type, bool interruptible);
++int
++qxl_push_cursor_ring_release(struct qxl_device *qdev, struct qxl_release *release,
++ uint32_t type, bool interruptible);
++int qxl_alloc_bo_reserved(struct qxl_device *qdev, unsigned long size,
++ struct qxl_bo **_bo);
++/* qxl drawing commands */
++
++void qxl_draw_opaque_fb(const struct qxl_fb_image *qxl_fb_image,
++ int stride /* filled in if 0 */);
++
++void qxl_draw_dirty_fb(struct qxl_device *qdev,
++ struct qxl_framebuffer *qxl_fb,
++ struct qxl_bo *bo,
++ unsigned flags, unsigned color,
++ struct drm_clip_rect *clips,
++ unsigned num_clips, int inc);
++
++void qxl_draw_fill(struct qxl_draw_fill *qxl_draw_fill_rec);
++
++void qxl_draw_copyarea(struct qxl_device *qdev,
++ u32 width, u32 height,
++ u32 sx, u32 sy,
++ u32 dx, u32 dy);
++
++uint64_t
++qxl_release_alloc(struct qxl_device *qdev, int type,
++ struct qxl_release **ret);
++
++void qxl_release_free(struct qxl_device *qdev,
++ struct qxl_release *release);
++void qxl_release_add_res(struct qxl_device *qdev,
++ struct qxl_release *release,
++ struct qxl_bo *bo);
++/* used by qxl_debugfs_release */
++struct qxl_release *qxl_release_from_id_locked(struct qxl_device *qdev,
++ uint64_t id);
++
++bool qxl_queue_garbage_collect(struct qxl_device *qdev, bool flush);
++int qxl_garbage_collect(struct qxl_device *qdev);
++
++/* debugfs */
++
++int qxl_debugfs_init(struct drm_minor *minor);
++void qxl_debugfs_takedown(struct drm_minor *minor);
++
++/* qxl_irq.c */
++int qxl_irq_init(struct qxl_device *qdev);
++irqreturn_t qxl_irq_handler(DRM_IRQ_ARGS);
++
++/* qxl_fb.c */
++int qxl_fb_init(struct qxl_device *qdev);
++
++int qxl_debugfs_add_files(struct qxl_device *qdev,
++ struct drm_info_list *files,
++ unsigned nfiles);
++
++int qxl_surface_id_alloc(struct qxl_device *qdev,
++ struct qxl_bo *surf);
++void qxl_surface_id_dealloc(struct qxl_device *qdev,
++ uint32_t surface_id);
++int qxl_hw_surface_alloc(struct qxl_device *qdev,
++ struct qxl_bo *surf,
++ struct ttm_mem_reg *mem);
++int qxl_hw_surface_dealloc(struct qxl_device *qdev,
++ struct qxl_bo *surf);
++
++int qxl_bo_check_id(struct qxl_device *qdev, struct qxl_bo *bo);
++
++struct qxl_drv_surface *
++qxl_surface_lookup(struct drm_device *dev, int surface_id);
++void qxl_surface_evict(struct qxl_device *qdev, struct qxl_bo *surf, bool freeing);
++int qxl_update_surface(struct qxl_device *qdev, struct qxl_bo *surf);
++
++/* qxl_fence.c */
++int qxl_fence_add_release(struct qxl_fence *qfence, uint32_t rel_id);
++int qxl_fence_remove_release(struct qxl_fence *qfence, uint32_t rel_id);
++int qxl_fence_init(struct qxl_device *qdev, struct qxl_fence *qfence);
++void qxl_fence_fini(struct qxl_fence *qfence);
++
++#endif
+diff --git a/drivers/gpu/drm/qxl/qxl_dumb.c b/drivers/gpu/drm/qxl/qxl_dumb.c
+new file mode 100644
+index 0000000..847c4ee
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_dumb.c
+@@ -0,0 +1,93 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++/* dumb ioctls implementation */
++
++int qxl_mode_dumb_create(struct drm_file *file_priv,
++ struct drm_device *dev,
++ struct drm_mode_create_dumb *args)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct qxl_bo *qobj;
++ uint32_t handle;
++ int r;
++ struct qxl_surface surf;
++ uint32_t pitch, format;
++ pitch = args->width * ((args->bpp + 1) / 8);
++ args->size = pitch * args->height;
++ args->size = ALIGN(args->size, PAGE_SIZE);
++
++ switch (args->bpp) {
++ case 16:
++ format = SPICE_SURFACE_FMT_16_565;
++ break;
++ case 32:
++ format = SPICE_SURFACE_FMT_32_xRGB;
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ surf.width = args->width;
++ surf.height = args->height;
++ surf.stride = pitch;
++ surf.format = format;
++ r = qxl_gem_object_create_with_handle(qdev, file_priv,
++ QXL_GEM_DOMAIN_VRAM,
++ args->size, &surf, &qobj,
++ &handle);
++ if (r)
++ return r;
++ args->pitch = pitch;
++ args->handle = handle;
++ return 0;
++}
++
++int qxl_mode_dumb_destroy(struct drm_file *file_priv,
++ struct drm_device *dev,
++ uint32_t handle)
++{
++ return drm_gem_handle_delete(file_priv, handle);
++}
++
++int qxl_mode_dumb_mmap(struct drm_file *file_priv,
++ struct drm_device *dev,
++ uint32_t handle, uint64_t *offset_p)
++{
++ struct drm_gem_object *gobj;
++ struct qxl_bo *qobj;
++
++ BUG_ON(!offset_p);
++ gobj = drm_gem_object_lookup(dev, file_priv, handle);
++ if (gobj == NULL)
++ return -ENOENT;
++ qobj = gem_to_qxl_bo(gobj);
++ *offset_p = qxl_bo_mmap_offset(qobj);
++ drm_gem_object_unreference_unlocked(gobj);
++ return 0;
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_fb.c b/drivers/gpu/drm/qxl/qxl_fb.c
+new file mode 100644
+index 0000000..0c5067d
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_fb.c
+@@ -0,0 +1,567 @@
++/*
++ * Copyright © 2013 Red Hat
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Authors:
++ * David Airlie
++ */
++#include <linux/module.h>
++#include <linux/fb.h>
++
++#include "drmP.h"
++#include "drm/drm.h"
++#include "drm/drm_crtc.h"
++#include "drm/drm_crtc_helper.h"
++#include "qxl_drv.h"
++
++#include "qxl_object.h"
++#include "drm_fb_helper.h"
++
++#define QXL_DIRTY_DELAY (HZ / 30)
++
++struct qxl_fbdev {
++ struct drm_fb_helper helper;
++ struct qxl_framebuffer qfb;
++ struct list_head fbdev_list;
++ struct qxl_device *qdev;
++
++ void *shadow;
++ int size;
++
++ /* dirty memory logging */
++ struct {
++ spinlock_t lock;
++ bool active;
++ unsigned x1;
++ unsigned y1;
++ unsigned x2;
++ unsigned y2;
++ } dirty;
++};
++
++static void qxl_fb_image_init(struct qxl_fb_image *qxl_fb_image,
++ struct qxl_device *qdev, struct fb_info *info,
++ const struct fb_image *image)
++{
++ qxl_fb_image->qdev = qdev;
++ if (info) {
++ qxl_fb_image->visual = info->fix.visual;
++ if (qxl_fb_image->visual == FB_VISUAL_TRUECOLOR ||
++ qxl_fb_image->visual == FB_VISUAL_DIRECTCOLOR)
++ memcpy(&qxl_fb_image->pseudo_palette,
++ info->pseudo_palette,
++ sizeof(qxl_fb_image->pseudo_palette));
++ } else {
++ /* fallback */
++ if (image->depth == 1)
++ qxl_fb_image->visual = FB_VISUAL_MONO10;
++ else
++ qxl_fb_image->visual = FB_VISUAL_DIRECTCOLOR;
++ }
++ if (image) {
++ memcpy(&qxl_fb_image->fb_image, image,
++ sizeof(qxl_fb_image->fb_image));
++ }
++}
++
++static void qxl_fb_dirty_flush(struct fb_info *info)
++{
++ struct qxl_fbdev *qfbdev = info->par;
++ struct qxl_device *qdev = qfbdev->qdev;
++ struct qxl_fb_image qxl_fb_image;
++ struct fb_image *image = &qxl_fb_image.fb_image;
++ u32 x1, x2, y1, y2;
++
++ /* TODO: hard coding 32 bpp */
++ int stride = qfbdev->qfb.base.pitches[0] * 4;
++
++ x1 = qfbdev->dirty.x1;
++ x2 = qfbdev->dirty.x2;
++ y1 = qfbdev->dirty.y1;
++ y2 = qfbdev->dirty.y2;
++ /*
++ * we are using a shadow draw buffer, at qdev->surface0_shadow
++ */
++ qxl_io_log(qdev, "dirty x[%d, %d], y[%d, %d]", x1, x2, y1, y2);
++ image->dx = x1;
++ image->dy = y1;
++ image->width = x2 - x1;
++ image->height = y2 - y1;
++ image->fg_color = 0xffffffff; /* unused, just to avoid uninitialized
++ warnings */
++ image->bg_color = 0;
++ image->depth = 32; /* TODO: take from somewhere? */
++ image->cmap.start = 0;
++ image->cmap.len = 0;
++ image->cmap.red = NULL;
++ image->cmap.green = NULL;
++ image->cmap.blue = NULL;
++ image->cmap.transp = NULL;
++ image->data = qfbdev->shadow + (x1 * 4) + (stride * y1);
++
++ qxl_fb_image_init(&qxl_fb_image, qdev, info, NULL);
++ qxl_draw_opaque_fb(&qxl_fb_image, stride);
++ qfbdev->dirty.x1 = 0;
++ qfbdev->dirty.x2 = 0;
++ qfbdev->dirty.y1 = 0;
++ qfbdev->dirty.y2 = 0;
++}
++
++static void qxl_deferred_io(struct fb_info *info,
++ struct list_head *pagelist)
++{
++ struct qxl_fbdev *qfbdev = info->par;
++ unsigned long start, end, min, max;
++ struct page *page;
++ int y1, y2;
++
++ min = ULONG_MAX;
++ max = 0;
++ list_for_each_entry(page, pagelist, lru) {
++ start = page->index << PAGE_SHIFT;
++ end = start + PAGE_SIZE - 1;
++ min = min(min, start);
++ max = max(max, end);
++ }
++
++ if (min < max) {
++ y1 = min / info->fix.line_length;
++ y2 = (max / info->fix.line_length) + 1;
++
++ /* TODO: add spin lock? */
++ /* spin_lock_irqsave(&qfbdev->dirty.lock, flags); */
++ qfbdev->dirty.x1 = 0;
++ qfbdev->dirty.y1 = y1;
++ qfbdev->dirty.x2 = info->var.xres;
++ qfbdev->dirty.y2 = y2;
++ /* spin_unlock_irqrestore(&qfbdev->dirty.lock, flags); */
++ }
++
++ qxl_fb_dirty_flush(info);
++};
++
++
++struct fb_deferred_io qxl_defio = {
++ .delay = QXL_DIRTY_DELAY,
++ .deferred_io = qxl_deferred_io,
++};
++
++static void qxl_fb_fillrect(struct fb_info *info,
++ const struct fb_fillrect *fb_rect)
++{
++ struct qxl_fbdev *qfbdev = info->par;
++ struct qxl_device *qdev = qfbdev->qdev;
++ struct qxl_rect rect;
++ uint32_t color;
++ int x = fb_rect->dx;
++ int y = fb_rect->dy;
++ int width = fb_rect->width;
++ int height = fb_rect->height;
++ uint16_t rop;
++ struct qxl_draw_fill qxl_draw_fill_rec;
++
++ if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
++ info->fix.visual == FB_VISUAL_DIRECTCOLOR)
++ color = ((u32 *) (info->pseudo_palette))[fb_rect->color];
++ else
++ color = fb_rect->color;
++ rect.left = x;
++ rect.right = x + width;
++ rect.top = y;
++ rect.bottom = y + height;
++ switch (fb_rect->rop) {
++ case ROP_XOR:
++ rop = SPICE_ROPD_OP_XOR;
++ break;
++ case ROP_COPY:
++ rop = SPICE_ROPD_OP_PUT;
++ break;
++ default:
++ pr_err("qxl_fb_fillrect(): unknown rop, "
++ "defaulting to SPICE_ROPD_OP_PUT\n");
++ rop = SPICE_ROPD_OP_PUT;
++ }
++ qxl_draw_fill_rec.qdev = qdev;
++ qxl_draw_fill_rec.rect = rect;
++ qxl_draw_fill_rec.color = color;
++ qxl_draw_fill_rec.rop = rop;
++ if (!drm_can_sleep()) {
++ qxl_io_log(qdev,
++ "%s: TODO use RCU, mysterious locks with spin_lock\n",
++ __func__);
++ return;
++ }
++ qxl_draw_fill(&qxl_draw_fill_rec);
++}
++
++static void qxl_fb_copyarea(struct fb_info *info,
++ const struct fb_copyarea *region)
++{
++ struct qxl_fbdev *qfbdev = info->par;
++
++ qxl_draw_copyarea(qfbdev->qdev,
++ region->width, region->height,
++ region->sx, region->sy,
++ region->dx, region->dy);
++}
++
++static void qxl_fb_imageblit_safe(struct qxl_fb_image *qxl_fb_image)
++{
++ qxl_draw_opaque_fb(qxl_fb_image, 0);
++}
++
++static void qxl_fb_imageblit(struct fb_info *info,
++ const struct fb_image *image)
++{
++ struct qxl_fbdev *qfbdev = info->par;
++ struct qxl_device *qdev = qfbdev->qdev;
++ struct qxl_fb_image qxl_fb_image;
++
++ if (!drm_can_sleep()) {
++ /* we cannot do any ttm_bo allocation since that will fail on
++ * ioremap_wc..__get_vm_area_node, so queue the work item
++ * instead This can happen from printk inside an interrupt
++ * context, i.e.: smp_apic_timer_interrupt..check_cpu_stall */
++ qxl_io_log(qdev,
++ "%s: TODO use RCU, mysterious locks with spin_lock\n",
++ __func__);
++ return;
++ }
++
++ /* ensure proper order of rendering operations - TODO: must do this
++ * for everything. */
++ qxl_fb_image_init(&qxl_fb_image, qfbdev->qdev, info, image);
++ qxl_fb_imageblit_safe(&qxl_fb_image);
++}
++
++int qxl_fb_init(struct qxl_device *qdev)
++{
++ return 0;
++}
++
++static struct fb_ops qxlfb_ops = {
++ .owner = THIS_MODULE,
++ .fb_check_var = drm_fb_helper_check_var,
++ .fb_set_par = drm_fb_helper_set_par, /* TODO: copy vmwgfx */
++ .fb_fillrect = qxl_fb_fillrect,
++ .fb_copyarea = qxl_fb_copyarea,
++ .fb_imageblit = qxl_fb_imageblit,
++ .fb_pan_display = drm_fb_helper_pan_display,
++ .fb_blank = drm_fb_helper_blank,
++ .fb_setcmap = drm_fb_helper_setcmap,
++ .fb_debug_enter = drm_fb_helper_debug_enter,
++ .fb_debug_leave = drm_fb_helper_debug_leave,
++};
++
++static void qxlfb_destroy_pinned_object(struct drm_gem_object *gobj)
++{
++ struct qxl_bo *qbo = gem_to_qxl_bo(gobj);
++ int ret;
++
++ ret = qxl_bo_reserve(qbo, false);
++ if (likely(ret == 0)) {
++ qxl_bo_kunmap(qbo);
++ qxl_bo_unpin(qbo);
++ qxl_bo_unreserve(qbo);
++ }
++ drm_gem_object_unreference_unlocked(gobj);
++}
++
++int qxl_get_handle_for_primary_fb(struct qxl_device *qdev,
++ struct drm_file *file_priv,
++ uint32_t *handle)
++{
++ int r;
++ struct drm_gem_object *gobj = qdev->fbdev_qfb->obj;
++
++ BUG_ON(!gobj);
++ /* drm_get_handle_create adds a reference - good */
++ r = drm_gem_handle_create(file_priv, gobj, handle);
++ if (r)
++ return r;
++ return 0;
++}
++
++static int qxlfb_create_pinned_object(struct qxl_fbdev *qfbdev,
++ struct drm_mode_fb_cmd2 *mode_cmd,
++ struct drm_gem_object **gobj_p)
++{
++ struct qxl_device *qdev = qfbdev->qdev;
++ struct drm_gem_object *gobj = NULL;
++ struct qxl_bo *qbo = NULL;
++ int ret;
++ int aligned_size, size;
++ int height = mode_cmd->height;
++ int bpp;
++ int depth;
++
++ drm_fb_get_bpp_depth(mode_cmd->pixel_format, &bpp, &depth);
++
++ size = mode_cmd->pitches[0] * height;
++ aligned_size = ALIGN(size, PAGE_SIZE);
++ /* TODO: unallocate and reallocate surface0 for real. Hack to just
++ * have a large enough surface0 for 1024x768 Xorg 32bpp mode */
++ ret = qxl_gem_object_create(qdev, aligned_size, 0,
++ QXL_GEM_DOMAIN_SURFACE,
++ false, /* is discardable */
++ false, /* is kernel (false means device) */
++ NULL,
++ &gobj);
++ if (ret) {
++ pr_err("failed to allocate framebuffer (%d)\n",
++ aligned_size);
++ return -ENOMEM;
++ }
++ qbo = gem_to_qxl_bo(gobj);
++
++ qbo->surf.width = mode_cmd->width;
++ qbo->surf.height = mode_cmd->height;
++ qbo->surf.stride = mode_cmd->pitches[0];
++ qbo->surf.format = SPICE_SURFACE_FMT_32_xRGB;
++ ret = qxl_bo_reserve(qbo, false);
++ if (unlikely(ret != 0))
++ goto out_unref;
++ ret = qxl_bo_pin(qbo, QXL_GEM_DOMAIN_SURFACE, NULL);
++ if (ret) {
++ qxl_bo_unreserve(qbo);
++ goto out_unref;
++ }
++ ret = qxl_bo_kmap(qbo, NULL);
++ qxl_bo_unreserve(qbo); /* unreserve, will be mmaped */
++ if (ret)
++ goto out_unref;
++
++ *gobj_p = gobj;
++ return 0;
++out_unref:
++ qxlfb_destroy_pinned_object(gobj);
++ *gobj_p = NULL;
++ return ret;
++}
++
++static int qxlfb_create(struct qxl_fbdev *qfbdev,
++ struct drm_fb_helper_surface_size *sizes)
++{
++ struct qxl_device *qdev = qfbdev->qdev;
++ struct fb_info *info;
++ struct drm_framebuffer *fb = NULL;
++ struct drm_mode_fb_cmd2 mode_cmd;
++ struct drm_gem_object *gobj = NULL;
++ struct qxl_bo *qbo = NULL;
++ struct device *device = &qdev->pdev->dev;
++ int ret;
++ int size;
++ int bpp = sizes->surface_bpp;
++ int depth = sizes->surface_depth;
++ void *shadow;
++
++ mode_cmd.width = sizes->surface_width;
++ mode_cmd.height = sizes->surface_height;
++
++ mode_cmd.pitches[0] = ALIGN(mode_cmd.width * ((bpp + 1) / 8), 64);
++ mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth);
++
++ ret = qxlfb_create_pinned_object(qfbdev, &mode_cmd, &gobj);
++ qbo = gem_to_qxl_bo(gobj);
++ QXL_INFO(qdev, "%s: %dx%d %d\n", __func__, mode_cmd.width,
++ mode_cmd.height, mode_cmd.pitches[0]);
++
++ shadow = vmalloc(mode_cmd.pitches[0] * mode_cmd.height);
++ /* TODO: what's the usual response to memory allocation errors? */
++ BUG_ON(!shadow);
++ QXL_INFO(qdev,
++ "surface0 at gpu offset %lld, mmap_offset %lld (virt %p, shadow %p)\n",
++ qxl_bo_gpu_offset(qbo),
++ qxl_bo_mmap_offset(qbo),
++ qbo->kptr,
++ shadow);
++ size = mode_cmd.pitches[0] * mode_cmd.height;
++
++ info = framebuffer_alloc(0, device);
++ if (info == NULL) {
++ ret = -ENOMEM;
++ goto out_unref;
++ }
++
++ info->par = qfbdev;
++
++ qxl_framebuffer_init(qdev->ddev, &qfbdev->qfb, &mode_cmd, gobj);
++
++ fb = &qfbdev->qfb.base;
++
++ /* setup helper with fb data */
++ qfbdev->helper.fb = fb;
++ qfbdev->helper.fbdev = info;
++ qfbdev->shadow = shadow;
++ strcpy(info->fix.id, "qxldrmfb");
++
++ drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
++
++ info->flags = FBINFO_DEFAULT;
++ info->fbops = &qxlfb_ops;
++
++ /*
++ * TODO: using gobj->size in various places in this function. Not sure
++ * what the difference between the different sizes is.
++ */
++ info->fix.smem_start = qdev->vram_base; /* TODO - correct? */
++ info->fix.smem_len = gobj->size;
++ info->screen_base = qfbdev->shadow;
++ info->screen_size = gobj->size;
++
++ drm_fb_helper_fill_var(info, &qfbdev->helper, sizes->fb_width,
++ sizes->fb_height);
++
++ /* setup aperture base/size for vesafb takeover */
++ info->apertures = alloc_apertures(1);
++ if (!info->apertures) {
++ ret = -ENOMEM;
++ goto out_unref;
++ }
++ info->apertures->ranges[0].base = qdev->ddev->mode_config.fb_base;
++ info->apertures->ranges[0].size = qdev->vram_size;
++
++ info->fix.mmio_start = 0;
++ info->fix.mmio_len = 0;
++
++ if (info->screen_base == NULL) {
++ ret = -ENOSPC;
++ goto out_unref;
++ }
++
++ ret = fb_alloc_cmap(&info->cmap, 256, 0);
++ if (ret) {
++ ret = -ENOMEM;
++ goto out_unref;
++ }
++
++ info->fbdefio = &qxl_defio;
++ fb_deferred_io_init(info);
++
++ qdev->fbdev_info = info;
++ qdev->fbdev_qfb = &qfbdev->qfb;
++ DRM_INFO("fb mappable at 0x%lX, size %lu\n", info->fix.smem_start, (unsigned long)info->screen_size);
++ DRM_INFO("fb: depth %d, pitch %d, width %d, height %d\n", fb->depth, fb->pitches[0], fb->width, fb->height);
++ return 0;
++
++out_unref:
++ if (qbo) {
++ ret = qxl_bo_reserve(qbo, false);
++ if (likely(ret == 0)) {
++ qxl_bo_kunmap(qbo);
++ qxl_bo_unpin(qbo);
++ qxl_bo_unreserve(qbo);
++ }
++ }
++ if (fb && ret) {
++ drm_gem_object_unreference(gobj);
++ drm_framebuffer_cleanup(fb);
++ kfree(fb);
++ }
++ drm_gem_object_unreference(gobj);
++ return ret;
++}
++
++static int qxl_fb_find_or_create_single(
++ struct drm_fb_helper *helper,
++ struct drm_fb_helper_surface_size *sizes)
++{
++ struct qxl_fbdev *qfbdev = (struct qxl_fbdev *)helper;
++ int new_fb = 0;
++ int ret;
++
++ if (!helper->fb) {
++ ret = qxlfb_create(qfbdev, sizes);
++ if (ret)
++ return ret;
++ new_fb = 1;
++ }
++ return new_fb;
++}
++
++static int qxl_fbdev_destroy(struct drm_device *dev, struct qxl_fbdev *qfbdev)
++{
++ struct fb_info *info;
++ struct qxl_framebuffer *qfb = &qfbdev->qfb;
++
++ if (qfbdev->helper.fbdev) {
++ info = qfbdev->helper.fbdev;
++
++ unregister_framebuffer(info);
++ framebuffer_release(info);
++ }
++ if (qfb->obj) {
++ qxlfb_destroy_pinned_object(qfb->obj);
++ qfb->obj = NULL;
++ }
++ drm_fb_helper_fini(&qfbdev->helper);
++ vfree(qfbdev->shadow);
++ drm_framebuffer_cleanup(&qfb->base);
++
++ return 0;
++}
++
++static struct drm_fb_helper_funcs qxl_fb_helper_funcs = {
++ /* TODO
++ .gamma_set = qxl_crtc_fb_gamma_set,
++ .gamma_get = qxl_crtc_fb_gamma_get,
++ */
++ .fb_probe = qxl_fb_find_or_create_single,
++};
++
++int qxl_fbdev_init(struct qxl_device *qdev)
++{
++ struct qxl_fbdev *qfbdev;
++ int bpp_sel = 32; /* TODO: parameter from somewhere? */
++ int ret;
++
++ qfbdev = kzalloc(sizeof(struct qxl_fbdev), GFP_KERNEL);
++ if (!qfbdev)
++ return -ENOMEM;
++
++ qfbdev->qdev = qdev;
++ qdev->mode_info.qfbdev = qfbdev;
++ qfbdev->helper.funcs = &qxl_fb_helper_funcs;
++
++ ret = drm_fb_helper_init(qdev->ddev, &qfbdev->helper,
++ 1 /* num_crtc - QXL supports just 1 */,
++ QXLFB_CONN_LIMIT);
++ if (ret) {
++ kfree(qfbdev);
++ return ret;
++ }
++
++ drm_fb_helper_single_add_all_connectors(&qfbdev->helper);
++ drm_fb_helper_initial_config(&qfbdev->helper, bpp_sel);
++ return 0;
++}
++
++void qxl_fbdev_fini(struct qxl_device *qdev)
++{
++ if (!qdev->mode_info.qfbdev)
++ return;
++
++ qxl_fbdev_destroy(qdev->ddev, qdev->mode_info.qfbdev);
++ kfree(qdev->mode_info.qfbdev);
++ qdev->mode_info.qfbdev = NULL;
++}
++
++
+diff --git a/drivers/gpu/drm/qxl/qxl_fence.c b/drivers/gpu/drm/qxl/qxl_fence.c
+new file mode 100644
+index 0000000..63c6715
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_fence.c
+@@ -0,0 +1,97 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++
++#include "qxl_drv.h"
++
++/* QXL fencing-
++
++ When we submit operations to the GPU we pass a release reference to the GPU
++ with them, the release reference is then added to the release ring when
++ the GPU is finished with that particular operation and has removed it from
++ its tree.
++
++ So we have can have multiple outstanding non linear fences per object.
++
++ From a TTM POV we only care if the object has any outstanding releases on
++ it.
++
++ we wait until all outstanding releases are processeed.
++
++ sync object is just a list of release ids that represent that fence on
++ that buffer.
++
++ we just add new releases onto the sync object attached to the object.
++
++ This currently uses a radix tree to store the list of release ids.
++
++ For some reason every so often qxl hw fails to release, things go wrong.
++*/
++
++
++int qxl_fence_add_release(struct qxl_fence *qfence, uint32_t rel_id)
++{
++ struct qxl_bo *bo = container_of(qfence, struct qxl_bo, fence);
++
++ spin_lock(&bo->tbo.bdev->fence_lock);
++ radix_tree_insert(&qfence->tree, rel_id, qfence);
++ qfence->num_active_releases++;
++ spin_unlock(&bo->tbo.bdev->fence_lock);
++ return 0;
++}
++
++int qxl_fence_remove_release(struct qxl_fence *qfence, uint32_t rel_id)
++{
++ void *ret;
++ int retval = 0;
++ struct qxl_bo *bo = container_of(qfence, struct qxl_bo, fence);
++
++ spin_lock(&bo->tbo.bdev->fence_lock);
++
++ ret = radix_tree_delete(&qfence->tree, rel_id);
++ if (ret == qfence)
++ qfence->num_active_releases--;
++ else {
++ DRM_DEBUG("didn't find fence in radix tree for %d\n", rel_id);
++ retval = -ENOENT;
++ }
++ spin_unlock(&bo->tbo.bdev->fence_lock);
++ return retval;
++}
++
++
++int qxl_fence_init(struct qxl_device *qdev, struct qxl_fence *qfence)
++{
++ qfence->qdev = qdev;
++ qfence->num_active_releases = 0;
++ INIT_RADIX_TREE(&qfence->tree, GFP_ATOMIC);
++ return 0;
++}
++
++void qxl_fence_fini(struct qxl_fence *qfence)
++{
++ kfree(qfence->release_ids);
++ qfence->num_active_releases = 0;
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c
+new file mode 100644
+index 0000000..adc1ee2
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_gem.c
+@@ -0,0 +1,178 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include "drmP.h"
++#include "drm/drm.h"
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++int qxl_gem_object_init(struct drm_gem_object *obj)
++{
++ /* we do nothings here */
++ return 0;
++}
++
++void qxl_gem_object_free(struct drm_gem_object *gobj)
++{
++ struct qxl_bo *qobj = gem_to_qxl_bo(gobj);
++
++ if (qobj)
++ qxl_bo_unref(&qobj);
++}
++
++int qxl_gem_object_create(struct qxl_device *qdev, int size,
++ int alignment, int initial_domain,
++ bool discardable, bool kernel,
++ struct qxl_surface *surf,
++ struct drm_gem_object **obj)
++{
++ struct qxl_bo *qbo;
++ int r;
++
++ *obj = NULL;
++ /* At least align on page size */
++ if (alignment < PAGE_SIZE)
++ alignment = PAGE_SIZE;
++ r = qxl_bo_create(qdev, size, kernel, initial_domain, surf, &qbo);
++ if (r) {
++ if (r != -ERESTARTSYS)
++ DRM_ERROR(
++ "Failed to allocate GEM object (%d, %d, %u, %d)\n",
++ size, initial_domain, alignment, r);
++ return r;
++ }
++ *obj = &qbo->gem_base;
++
++ mutex_lock(&qdev->gem.mutex);
++ list_add_tail(&qbo->list, &qdev->gem.objects);
++ mutex_unlock(&qdev->gem.mutex);
++
++ return 0;
++}
++
++int qxl_gem_object_create_with_handle(struct qxl_device *qdev,
++ struct drm_file *file_priv,
++ u32 domain,
++ size_t size,
++ struct qxl_surface *surf,
++ struct qxl_bo **qobj,
++ uint32_t *handle)
++{
++ struct drm_gem_object *gobj;
++ int r;
++
++ BUG_ON(!qobj);
++ BUG_ON(!handle);
++
++ r = qxl_gem_object_create(qdev, size, 0,
++ domain,
++ false, false, surf,
++ &gobj);
++ if (r)
++ return -ENOMEM;
++ r = drm_gem_handle_create(file_priv, gobj, handle);
++ if (r)
++ return r;
++ /* drop reference from allocate - handle holds it now */
++ *qobj = gem_to_qxl_bo(gobj);
++ drm_gem_object_unreference_unlocked(gobj);
++ return 0;
++}
++
++int qxl_gem_object_pin(struct drm_gem_object *obj, uint32_t pin_domain,
++ uint64_t *gpu_addr)
++{
++ struct qxl_bo *qobj = obj->driver_private;
++ int r;
++
++ r = qxl_bo_reserve(qobj, false);
++ if (unlikely(r != 0))
++ return r;
++ r = qxl_bo_pin(qobj, pin_domain, gpu_addr);
++ qxl_bo_unreserve(qobj);
++ return r;
++}
++
++void qxl_gem_object_unpin(struct drm_gem_object *obj)
++{
++ struct qxl_bo *qobj = obj->driver_private;
++ int r;
++
++ r = qxl_bo_reserve(qobj, false);
++ if (likely(r == 0)) {
++ qxl_bo_unpin(qobj);
++ qxl_bo_unreserve(qobj);
++ }
++}
++
++int qxl_gem_set_domain(struct drm_gem_object *gobj,
++ uint32_t rdomain, uint32_t wdomain)
++{
++ struct qxl_bo *qobj;
++ uint32_t domain;
++ int r;
++
++ /* FIXME: reeimplement */
++ qobj = gobj->driver_private;
++ /* work out where to validate the buffer to */
++ domain = wdomain;
++ if (!domain)
++ domain = rdomain;
++ if (!domain) {
++ /* Do nothings */
++ pr_warn("Set domain withou domain !\n");
++ return 0;
++ }
++ if (domain == QXL_GEM_DOMAIN_CPU) {
++ /* Asking for cpu access wait for object idle */
++ r = qxl_bo_wait(qobj, NULL, false);
++ if (r) {
++ pr_err("Failed to wait for object !\n");
++ return r;
++ }
++ }
++ return 0;
++}
++
++int qxl_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv)
++{
++ return 0;
++}
++
++void qxl_gem_object_close(struct drm_gem_object *obj,
++ struct drm_file *file_priv)
++{
++}
++
++int qxl_gem_init(struct qxl_device *qdev)
++{
++ INIT_LIST_HEAD(&qdev->gem.objects);
++ return 0;
++}
++
++void qxl_gem_fini(struct qxl_device *qdev)
++{
++ qxl_bo_force_delete(qdev);
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_image.c b/drivers/gpu/drm/qxl/qxl_image.c
+new file mode 100644
+index 0000000..7fc7204
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_image.c
+@@ -0,0 +1,120 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include <linux/gfp.h>
++#include <linux/slab.h>
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++static int
++qxl_image_create_helper(struct qxl_device *qdev,
++ struct qxl_release *release,
++ struct qxl_bo **image_bo,
++ const uint8_t *data,
++ int width, int height,
++ int depth, unsigned int hash,
++ int stride)
++{
++ struct qxl_image *image;
++ struct qxl_data_chunk *chunk;
++ int i;
++ int chunk_stride;
++ int linesize = width * depth / 8;
++ struct qxl_bo *chunk_bo;
++ int ret;
++ /* Chunk */
++ /* FIXME: Check integer overflow */
++ /* TODO: variable number of chunks */
++ chunk_stride = stride; /* TODO: should use linesize, but it renders
++ wrong (check the bitmaps are sent correctly
++ first) */
++ ret = qxl_alloc_bo_reserved(qdev, sizeof(*chunk) + height * chunk_stride,
++ &chunk_bo);
++ ret = qxl_bo_kmap(chunk_bo, (void **)&chunk);
++ chunk->data_size = height * chunk_stride;
++ chunk->prev_chunk = 0;
++ chunk->next_chunk = 0;
++
++ if (stride == linesize && chunk_stride == stride)
++ memcpy(chunk->data, data, linesize * height);
++ else
++ for (i = 0 ; i < height ; ++i)
++ memcpy(chunk->data + i*chunk_stride, data + i*stride,
++ linesize);
++
++ qxl_bo_kunmap(chunk_bo);
++
++ /* Image */
++ ret = qxl_alloc_bo_reserved(qdev, sizeof(*image), image_bo);
++ qxl_bo_kmap(*image_bo, (void **)&image);
++
++ image->descriptor.id = 0;
++ image->descriptor.type = SPICE_IMAGE_TYPE_BITMAP;
++
++ image->descriptor.flags = 0;
++ image->descriptor.width = width;
++ image->descriptor.height = height;
++
++ switch (depth) {
++ case 1:
++ /* TODO: BE? check by arch? */
++ image->u.bitmap.format = SPICE_BITMAP_FMT_1BIT_BE;
++ break;
++ case 24:
++ image->u.bitmap.format = SPICE_BITMAP_FMT_24BIT;
++ break;
++ case 32:
++ image->u.bitmap.format = SPICE_BITMAP_FMT_32BIT;
++ break;
++ default:
++ DRM_ERROR("unsupported image bit depth\n");
++ return -EINVAL; /* TODO: cleanup */
++ }
++ image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN;
++ image->u.bitmap.x = width;
++ image->u.bitmap.y = height;
++ image->u.bitmap.stride = chunk_stride;
++ image->u.bitmap.palette = 0;
++ image->u.bitmap.data = qxl_bo_physical_address(qdev, chunk_bo, 0);
++ qxl_release_add_res(qdev, release, chunk_bo);
++ qxl_bo_unreserve(chunk_bo);
++ qxl_bo_unref(&chunk_bo);
++
++ qxl_bo_kunmap(*image_bo);
++ return 0;
++}
++
++int qxl_image_create(struct qxl_device *qdev,
++ struct qxl_release *release,
++ struct qxl_bo **image_bo,
++ const uint8_t *data,
++ int x, int y, int width, int height,
++ int depth, int stride)
++{
++ data += y * stride + x * (depth / 8);
++ return qxl_image_create_helper(qdev, release, image_bo, data,
++ width, height, depth, 0, stride);
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
+new file mode 100644
+index 0000000..83ca4f7
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
+@@ -0,0 +1,411 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++/*
++ * TODO: allocating a new gem(in qxl_bo) for each request.
++ * This is wasteful since bo's are page aligned.
++ */
++int qxl_alloc_ioctl(struct drm_device *dev, void *data,
++ struct drm_file *file_priv)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct drm_qxl_alloc *qxl_alloc = data;
++ int ret;
++ struct qxl_bo *qobj;
++ uint32_t handle;
++ u32 domain = QXL_GEM_DOMAIN_VRAM;
++
++ if (qxl_alloc->size == 0) {
++ DRM_ERROR("invalid size %d\n", qxl_alloc->size);
++ return -EINVAL;
++ }
++ ret = qxl_gem_object_create_with_handle(qdev, file_priv,
++ domain,
++ qxl_alloc->size,
++ NULL,
++ &qobj, &handle);
++ if (ret) {
++ DRM_ERROR("%s: failed to create gem ret=%d\n",
++ __func__, ret);
++ return -ENOMEM;
++ }
++ qxl_alloc->handle = handle;
++ return 0;
++}
++
++int qxl_map_ioctl(struct drm_device *dev, void *data,
++ struct drm_file *file_priv)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct drm_qxl_map *qxl_map = data;
++
++ return qxl_mode_dumb_mmap(file_priv, qdev->ddev, qxl_map->handle,
++ &qxl_map->offset);
++}
++
++/*
++ * dst must be validated, i.e. whole bo on vram/surfacesram (right now all bo's
++ * are on vram).
++ * *(dst + dst_off) = qxl_bo_physical_address(src, src_off)
++ */
++static void
++apply_reloc(struct qxl_device *qdev, struct qxl_bo *dst, uint64_t dst_off,
++ struct qxl_bo *src, uint64_t src_off)
++{
++ void *reloc_page;
++
++ reloc_page = qxl_bo_kmap_atomic_page(qdev, dst, dst_off & PAGE_MASK);
++ *(uint64_t *)(reloc_page + (dst_off & ~PAGE_MASK)) = qxl_bo_physical_address(qdev,
++ src, src_off);
++ qxl_bo_kunmap_atomic_page(qdev, dst, reloc_page);
++}
++
++static void
++apply_surf_reloc(struct qxl_device *qdev, struct qxl_bo *dst, uint64_t dst_off,
++ struct qxl_bo *src)
++{
++ uint32_t id = 0;
++ void *reloc_page;
++
++ if (src && !src->is_primary)
++ id = src->surface_id;
++
++ reloc_page = qxl_bo_kmap_atomic_page(qdev, dst, dst_off & PAGE_MASK);
++ *(uint32_t *)(reloc_page + (dst_off & ~PAGE_MASK)) = id;
++ qxl_bo_kunmap_atomic_page(qdev, dst, reloc_page);
++}
++
++/* return holding the reference to this object */
++struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev,
++ struct drm_file *file_priv, uint64_t handle,
++ struct qxl_reloc_list *reloc_list)
++{
++ struct drm_gem_object *gobj;
++ struct qxl_bo *qobj;
++ int ret;
++
++ gobj = drm_gem_object_lookup(qdev->ddev, file_priv, handle);
++ if (!gobj) {
++ DRM_ERROR("bad bo handle %lld\n", handle);
++ return NULL;
++ }
++ qobj = gem_to_qxl_bo(gobj);
++
++ ret = qxl_bo_list_add(reloc_list, qobj);
++ if (ret)
++ return NULL;
++
++ return qobj;
++}
++
++/*
++ * Usage of execbuffer:
++ * Relocations need to take into account the full QXLDrawable size.
++ * However, the command as passed from user space must *not* contain the initial
++ * QXLReleaseInfo struct (first XXX bytes)
++ */
++int qxl_execbuffer_ioctl(struct drm_device *dev, void *data,
++ struct drm_file *file_priv)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct drm_qxl_execbuffer *execbuffer = data;
++ struct drm_qxl_command user_cmd;
++ int cmd_num;
++ struct qxl_bo *reloc_src_bo;
++ struct qxl_bo *reloc_dst_bo;
++ struct drm_qxl_reloc reloc;
++ void *fb_cmd;
++ int i, ret;
++ struct qxl_reloc_list reloc_list;
++ int unwritten;
++ uint32_t reloc_dst_offset;
++ INIT_LIST_HEAD(&reloc_list.bos);
++
++ for (cmd_num = 0; cmd_num < execbuffer->commands_num; ++cmd_num) {
++ struct qxl_release *release;
++ struct qxl_bo *cmd_bo;
++ int release_type;
++ struct drm_qxl_command *commands =
++ (struct drm_qxl_command *)execbuffer->commands;
++
++ if (DRM_COPY_FROM_USER(&user_cmd, &commands[cmd_num],
++ sizeof(user_cmd)))
++ return -EFAULT;
++ switch (user_cmd.type) {
++ case QXL_CMD_DRAW:
++ release_type = QXL_RELEASE_DRAWABLE;
++ break;
++ case QXL_CMD_SURFACE:
++ case QXL_CMD_CURSOR:
++ default:
++ DRM_DEBUG("Only draw commands in execbuffers\n");
++ return -EINVAL;
++ break;
++ }
++
++ if (user_cmd.command_size > PAGE_SIZE - sizeof(union qxl_release_info))
++ return -EINVAL;
++
++ ret = qxl_alloc_release_reserved(qdev,
++ sizeof(union qxl_release_info) +
++ user_cmd.command_size,
++ release_type,
++ &release,
++ &cmd_bo);
++ if (ret)
++ return ret;
++
++ /* TODO copy slow path code from i915 */
++ fb_cmd = qxl_bo_kmap_atomic_page(qdev, cmd_bo, (release->release_offset & PAGE_SIZE));
++ unwritten = __copy_from_user_inatomic_nocache(fb_cmd + sizeof(union qxl_release_info) + (release->release_offset & ~PAGE_SIZE), (void *)(unsigned long)user_cmd.command, user_cmd.command_size);
++ qxl_bo_kunmap_atomic_page(qdev, cmd_bo, fb_cmd);
++ if (unwritten) {
++ DRM_ERROR("got unwritten %d\n", unwritten);
++ qxl_release_unreserve(qdev, release);
++ qxl_release_free(qdev, release);
++ return -EFAULT;
++ }
++
++ for (i = 0 ; i < user_cmd.relocs_num; ++i) {
++ if (DRM_COPY_FROM_USER(&reloc,
++ &((struct drm_qxl_reloc *)user_cmd.relocs)[i],
++ sizeof(reloc))) {
++ qxl_bo_list_unreserve(&reloc_list, true);
++ qxl_release_unreserve(qdev, release);
++ qxl_release_free(qdev, release);
++ return -EFAULT;
++ }
++
++ /* add the bos to the list of bos to validate -
++ need to validate first then process relocs? */
++ if (reloc.dst_handle) {
++ reloc_dst_bo = qxlhw_handle_to_bo(qdev, file_priv,
++ reloc.dst_handle, &reloc_list);
++ if (!reloc_dst_bo) {
++ qxl_bo_list_unreserve(&reloc_list, true);
++ qxl_release_unreserve(qdev, release);
++ qxl_release_free(qdev, release);
++ return -EINVAL;
++ }
++ reloc_dst_offset = 0;
++ } else {
++ reloc_dst_bo = cmd_bo;
++ reloc_dst_offset = release->release_offset;
++ }
++
++ /* reserve and validate the reloc dst bo */
++ if (reloc.reloc_type == QXL_RELOC_TYPE_BO || reloc.src_handle > 0) {
++ reloc_src_bo =
++ qxlhw_handle_to_bo(qdev, file_priv,
++ reloc.src_handle, &reloc_list);
++ if (!reloc_src_bo) {
++ if (reloc_dst_bo != cmd_bo)
++ drm_gem_object_unreference_unlocked(&reloc_dst_bo->gem_base);
++ qxl_bo_list_unreserve(&reloc_list, true);
++ qxl_release_unreserve(qdev, release);
++ qxl_release_free(qdev, release);
++ return -EINVAL;
++ }
++ } else
++ reloc_src_bo = NULL;
++ if (reloc.reloc_type == QXL_RELOC_TYPE_BO) {
++ apply_reloc(qdev, reloc_dst_bo, reloc_dst_offset + reloc.dst_offset,
++ reloc_src_bo, reloc.src_offset);
++ } else if (reloc.reloc_type == QXL_RELOC_TYPE_SURF) {
++ apply_surf_reloc(qdev, reloc_dst_bo, reloc_dst_offset + reloc.dst_offset, reloc_src_bo);
++ } else {
++ DRM_ERROR("unknown reloc type %d\n", reloc.reloc_type);
++ return -EINVAL;
++ }
++
++ if (reloc_src_bo && reloc_src_bo != cmd_bo) {
++ qxl_release_add_res(qdev, release, reloc_src_bo);
++ drm_gem_object_unreference_unlocked(&reloc_src_bo->gem_base);
++ }
++
++ if (reloc_dst_bo != cmd_bo)
++ drm_gem_object_unreference_unlocked(&reloc_dst_bo->gem_base);
++ }
++ qxl_fence_releaseable(qdev, release);
++
++ ret = qxl_push_command_ring_release(qdev, release, user_cmd.type, true);
++ if (ret == -ERESTARTSYS) {
++ qxl_release_unreserve(qdev, release);
++ qxl_release_free(qdev, release);
++ qxl_bo_list_unreserve(&reloc_list, true);
++ return ret;
++ }
++ qxl_release_unreserve(qdev, release);
++ }
++ qxl_bo_list_unreserve(&reloc_list, 0);
++ return 0;
++}
++
++int qxl_update_area_ioctl(struct drm_device *dev, void *data,
++ struct drm_file *file)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct drm_qxl_update_area *update_area = data;
++ struct qxl_rect area = {.left = update_area->left,
++ .top = update_area->top,
++ .right = update_area->right,
++ .bottom = update_area->bottom};
++ int ret;
++ struct drm_gem_object *gobj = NULL;
++ struct qxl_bo *qobj = NULL;
++
++ if (update_area->left >= update_area->right ||
++ update_area->top >= update_area->bottom)
++ return -EINVAL;
++
++ gobj = drm_gem_object_lookup(dev, file, update_area->handle);
++ if (gobj == NULL)
++ return -ENOENT;
++
++ qobj = gem_to_qxl_bo(gobj);
++
++ ret = qxl_bo_reserve(qobj, false);
++ if (ret)
++ goto out;
++
++ if (!qobj->pin_count) {
++ ret = ttm_bo_validate(&qobj->tbo, &qobj->placement,
++ true, false);
++ if (unlikely(ret))
++ goto out;
++ }
++
++ ret = qxl_bo_check_id(qdev, qobj);
++ if (ret)
++ goto out2;
++ if (!qobj->surface_id)
++ DRM_ERROR("got update area for surface with no id %d\n", update_area->handle);
++ ret = qxl_io_update_area(qdev, qobj, &area);
++
++out2:
++ qxl_bo_unreserve(qobj);
++
++out:
++ drm_gem_object_unreference_unlocked(gobj);
++ return ret;
++}
++
++static int qxl_getparam_ioctl(struct drm_device *dev, void *data,
++ struct drm_file *file_priv)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct drm_qxl_getparam *param = data;
++
++ switch (param->param) {
++ case QXL_PARAM_NUM_SURFACES:
++ param->value = qdev->rom->n_surfaces;
++ break;
++ case QXL_PARAM_MAX_RELOCS:
++ param->value = QXL_MAX_RES;
++ break;
++ default:
++ return -EINVAL;
++ }
++ return 0;
++}
++
++static int qxl_clientcap_ioctl(struct drm_device *dev, void *data,
++ struct drm_file *file_priv)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct drm_qxl_clientcap *param = data;
++ int byte, idx;
++
++ byte = param->index / 8;
++ idx = param->index % 8;
++
++ if (qdev->pdev->revision < 4)
++ return -ENOSYS;
++
++ if (byte > 58)
++ return -ENOSYS;
++
++ if (qdev->rom->client_capabilities[byte] & (1 << idx))
++ return 0;
++ return -ENOSYS;
++}
++
++static int qxl_alloc_surf_ioctl(struct drm_device *dev, void *data,
++ struct drm_file *file)
++{
++ struct qxl_device *qdev = dev->dev_private;
++ struct drm_qxl_alloc_surf *param = data;
++ struct qxl_bo *qobj;
++ int handle;
++ int ret;
++ int size, actual_stride;
++ struct qxl_surface surf;
++
++ /* work out size allocate bo with handle */
++ actual_stride = param->stride < 0 ? -param->stride : param->stride;
++ size = actual_stride * param->height + actual_stride;
++
++ surf.format = param->format;
++ surf.width = param->width;
++ surf.height = param->height;
++ surf.stride = param->stride;
++ surf.data = 0;
++
++ ret = qxl_gem_object_create_with_handle(qdev, file,
++ QXL_GEM_DOMAIN_SURFACE,
++ size,
++ &surf,
++ &qobj, &handle);
++ if (ret) {
++ DRM_ERROR("%s: failed to create gem ret=%d\n",
++ __func__, ret);
++ return -ENOMEM;
++ } else
++ param->handle = handle;
++ return ret;
++}
++
++struct drm_ioctl_desc qxl_ioctls[] = {
++ DRM_IOCTL_DEF_DRV(QXL_ALLOC, qxl_alloc_ioctl, DRM_AUTH|DRM_UNLOCKED),
++
++ DRM_IOCTL_DEF_DRV(QXL_MAP, qxl_map_ioctl, DRM_AUTH|DRM_UNLOCKED),
++
++ DRM_IOCTL_DEF_DRV(QXL_EXECBUFFER, qxl_execbuffer_ioctl,
++ DRM_AUTH|DRM_UNLOCKED),
++ DRM_IOCTL_DEF_DRV(QXL_UPDATE_AREA, qxl_update_area_ioctl,
++ DRM_AUTH|DRM_UNLOCKED),
++ DRM_IOCTL_DEF_DRV(QXL_GETPARAM, qxl_getparam_ioctl,
++ DRM_AUTH|DRM_UNLOCKED),
++ DRM_IOCTL_DEF_DRV(QXL_CLIENTCAP, qxl_clientcap_ioctl,
++ DRM_AUTH|DRM_UNLOCKED),
++
++ DRM_IOCTL_DEF_DRV(QXL_ALLOC_SURF, qxl_alloc_surf_ioctl,
++ DRM_AUTH|DRM_UNLOCKED),
++};
++
++int qxl_max_ioctls = DRM_ARRAY_SIZE(qxl_ioctls);
+diff --git a/drivers/gpu/drm/qxl/qxl_irq.c b/drivers/gpu/drm/qxl/qxl_irq.c
+new file mode 100644
+index 0000000..21393dc
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_irq.c
+@@ -0,0 +1,97 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include "qxl_drv.h"
++
++irqreturn_t qxl_irq_handler(DRM_IRQ_ARGS)
++{
++ struct drm_device *dev = (struct drm_device *) arg;
++ struct qxl_device *qdev = (struct qxl_device *)dev->dev_private;
++ uint32_t pending;
++
++ pending = xchg(&qdev->ram_header->int_pending, 0);
++
++ atomic_inc(&qdev->irq_received);
++
++ if (pending & QXL_INTERRUPT_DISPLAY) {
++ atomic_inc(&qdev->irq_received_display);
++ wake_up_all(&qdev->display_event);
++ qxl_queue_garbage_collect(qdev, false);
++ }
++ if (pending & QXL_INTERRUPT_CURSOR) {
++ atomic_inc(&qdev->irq_received_cursor);
++ wake_up_all(&qdev->cursor_event);
++ }
++ if (pending & QXL_INTERRUPT_IO_CMD) {
++ atomic_inc(&qdev->irq_received_io_cmd);
++ wake_up_all(&qdev->io_cmd_event);
++ }
++ if (pending & QXL_INTERRUPT_ERROR) {
++ /* TODO: log it, reset device (only way to exit this condition)
++ * (do it a certain number of times, afterwards admit defeat,
++ * to avoid endless loops).
++ */
++ qdev->irq_received_error++;
++ qxl_io_log(qdev, "%s: driver is in bug mode.\n", __func__);
++ }
++ if (pending & QXL_INTERRUPT_CLIENT_MONITORS_CONFIG) {
++ qxl_io_log(qdev, "QXL_INTERRUPT_CLIENT_MONITORS_CONFIG\n");
++ schedule_work(&qdev->client_monitors_config_work);
++ }
++ qdev->ram_header->int_mask = QXL_INTERRUPT_MASK;
++ outb(0, qdev->io_base + QXL_IO_UPDATE_IRQ);
++ return IRQ_HANDLED;
++}
++
++static void qxl_client_monitors_config_work_func(struct work_struct *work)
++{
++ struct qxl_device *qdev = container_of(work, struct qxl_device,
++ client_monitors_config_work);
++
++ qxl_display_read_client_monitors_config(qdev);
++}
++
++int qxl_irq_init(struct qxl_device *qdev)
++{
++ int ret;
++
++ init_waitqueue_head(&qdev->display_event);
++ init_waitqueue_head(&qdev->cursor_event);
++ init_waitqueue_head(&qdev->io_cmd_event);
++ INIT_WORK(&qdev->client_monitors_config_work,
++ qxl_client_monitors_config_work_func);
++ atomic_set(&qdev->irq_received, 0);
++ atomic_set(&qdev->irq_received_display, 0);
++ atomic_set(&qdev->irq_received_cursor, 0);
++ atomic_set(&qdev->irq_received_io_cmd, 0);
++ qdev->irq_received_error = 0;
++ ret = drm_irq_install(qdev->ddev);
++ qdev->ram_header->int_mask = QXL_INTERRUPT_MASK;
++ if (unlikely(ret != 0)) {
++ DRM_ERROR("Failed installing irq: %d\n", ret);
++ return 1;
++ }
++ return 0;
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c
+new file mode 100644
+index 0000000..036e0de
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_kms.c
+@@ -0,0 +1,302 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++#include <linux/io-mapping.h>
++
++int qxl_log_level;
++
++static void qxl_dump_mode(struct qxl_device *qdev, void *p)
++{
++ struct qxl_mode *m = p;
++ DRM_DEBUG_KMS("%d: %dx%d %d bits, stride %d, %dmm x %dmm, orientation %d\n",
++ m->id, m->x_res, m->y_res, m->bits, m->stride, m->x_mili,
++ m->y_mili, m->orientation);
++}
++
++static bool qxl_check_device(struct qxl_device *qdev)
++{
++ struct qxl_rom *rom = qdev->rom;
++ int mode_offset;
++ int i;
++
++ if (rom->magic != 0x4f525851) {
++ DRM_ERROR("bad rom signature %x\n", rom->magic);
++ return false;
++ }
++
++ DRM_INFO("Device Version %d.%d\n", rom->id, rom->update_id);
++ DRM_INFO("Compression level %d log level %d\n", rom->compression_level,
++ rom->log_level);
++ DRM_INFO("Currently using mode #%d, list at 0x%x\n",
++ rom->mode, rom->modes_offset);
++ DRM_INFO("%d io pages at offset 0x%x\n",
++ rom->num_io_pages, rom->pages_offset);
++ DRM_INFO("%d byte draw area at offset 0x%x\n",
++ rom->surface0_area_size, rom->draw_area_offset);
++
++ qdev->vram_size = rom->surface0_area_size;
++ DRM_INFO("RAM header offset: 0x%x\n", rom->ram_header_offset);
++
++ mode_offset = rom->modes_offset / 4;
++ qdev->mode_info.num_modes = ((u32 *)rom)[mode_offset];
++ DRM_INFO("rom modes offset 0x%x for %d modes\n", rom->modes_offset,
++ qdev->mode_info.num_modes);
++ qdev->mode_info.modes = (void *)((uint32_t *)rom + mode_offset + 1);
++ for (i = 0; i < qdev->mode_info.num_modes; i++)
++ qxl_dump_mode(qdev, qdev->mode_info.modes + i);
++ return true;
++}
++
++static uint8_t setup_slot(struct qxl_device *qdev, uint8_t slot_index_offset,
++ unsigned long start_phys_addr, unsigned long end_phys_addr)
++{
++ uint64_t high_bits;
++ struct qxl_memslot *slot;
++ uint8_t slot_index;
++ struct qxl_ram_header *ram_header = qdev->ram_header;
++
++ slot_index = qdev->rom->slots_start + slot_index_offset;
++ slot = &qdev->mem_slots[slot_index];
++ slot->start_phys_addr = start_phys_addr;
++ slot->end_phys_addr = end_phys_addr;
++ ram_header->mem_slot.mem_start = slot->start_phys_addr;
++ ram_header->mem_slot.mem_end = slot->end_phys_addr;
++ qxl_io_memslot_add(qdev, slot_index);
++ slot->generation = qdev->rom->slot_generation;
++ high_bits = slot_index << qdev->slot_gen_bits;
++ high_bits |= slot->generation;
++ high_bits <<= (64 - (qdev->slot_gen_bits + qdev->slot_id_bits));
++ slot->high_bits = high_bits;
++ return slot_index;
++}
++
++static void qxl_gc_work(struct work_struct *work)
++{
++ struct qxl_device *qdev = container_of(work, struct qxl_device, gc_work);
++ qxl_garbage_collect(qdev);
++}
++
++int qxl_device_init(struct qxl_device *qdev,
++ struct drm_device *ddev,
++ struct pci_dev *pdev,
++ unsigned long flags)
++{
++ int r;
++
++ qdev->dev = &pdev->dev;
++ qdev->ddev = ddev;
++ qdev->pdev = pdev;
++ qdev->flags = flags;
++
++ mutex_init(&qdev->gem.mutex);
++ mutex_init(&qdev->update_area_mutex);
++ mutex_init(&qdev->release_mutex);
++ mutex_init(&qdev->surf_evict_mutex);
++ INIT_LIST_HEAD(&qdev->gem.objects);
++
++ qdev->rom_base = pci_resource_start(pdev, 2);
++ qdev->rom_size = pci_resource_len(pdev, 2);
++ qdev->vram_base = pci_resource_start(pdev, 0);
++ qdev->surfaceram_base = pci_resource_start(pdev, 1);
++ qdev->surfaceram_size = pci_resource_len(pdev, 1);
++ qdev->io_base = pci_resource_start(pdev, 3);
++
++ qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));
++ qdev->surface_mapping = io_mapping_create_wc(qdev->surfaceram_base, qdev->surfaceram_size);
++ DRM_DEBUG_KMS("qxl: vram %p-%p(%dM %dk), surface %p-%p(%dM %dk)\n",
++ (void *)qdev->vram_base, (void *)pci_resource_end(pdev, 0),
++ (int)pci_resource_len(pdev, 0) / 1024 / 1024,
++ (int)pci_resource_len(pdev, 0) / 1024,
++ (void *)qdev->surfaceram_base,
++ (void *)pci_resource_end(pdev, 1),
++ (int)qdev->surfaceram_size / 1024 / 1024,
++ (int)qdev->surfaceram_size / 1024);
++
++ qdev->rom = ioremap(qdev->rom_base, qdev->rom_size);
++ if (!qdev->rom) {
++ pr_err("Unable to ioremap ROM\n");
++ return -ENOMEM;
++ }
++
++ qxl_check_device(qdev);
++
++ r = qxl_bo_init(qdev);
++ if (r) {
++ DRM_ERROR("bo init failed %d\n", r);
++ return r;
++ }
++
++ qdev->ram_header = ioremap(qdev->vram_base +
++ qdev->rom->ram_header_offset,
++ sizeof(*qdev->ram_header));
++
++ qdev->command_ring = qxl_ring_create(&(qdev->ram_header->cmd_ring_hdr),
++ sizeof(struct qxl_command),
++ QXL_COMMAND_RING_SIZE,
++ qdev->io_base + QXL_IO_NOTIFY_CMD,
++ false,
++ &qdev->display_event);
++
++ qdev->cursor_ring = qxl_ring_create(
++ &(qdev->ram_header->cursor_ring_hdr),
++ sizeof(struct qxl_command),
++ QXL_CURSOR_RING_SIZE,
++ qdev->io_base + QXL_IO_NOTIFY_CMD,
++ false,
++ &qdev->cursor_event);
++
++ qdev->release_ring = qxl_ring_create(
++ &(qdev->ram_header->release_ring_hdr),
++ sizeof(uint64_t),
++ QXL_RELEASE_RING_SIZE, 0, true,
++ NULL);
++
++ /* TODO - slot initialization should happen on reset. where is our
++ * reset handler? */
++ qdev->n_mem_slots = qdev->rom->slots_end;
++ qdev->slot_gen_bits = qdev->rom->slot_gen_bits;
++ qdev->slot_id_bits = qdev->rom->slot_id_bits;
++ qdev->va_slot_mask =
++ (~(uint64_t)0) >> (qdev->slot_id_bits + qdev->slot_gen_bits);
++
++ qdev->mem_slots =
++ kmalloc(qdev->n_mem_slots * sizeof(struct qxl_memslot),
++ GFP_KERNEL);
++
++ idr_init(&qdev->release_idr);
++ spin_lock_init(&qdev->release_idr_lock);
++
++ idr_init(&qdev->surf_id_idr);
++ spin_lock_init(&qdev->surf_id_idr_lock);
++
++ mutex_init(&qdev->async_io_mutex);
++
++ /* reset the device into a known state - no memslots, no primary
++ * created, no surfaces. */
++ qxl_io_reset(qdev);
++
++ /* must initialize irq before first async io - slot creation */
++ r = qxl_irq_init(qdev);
++ if (r)
++ return r;
++
++ /*
++ * Note that virtual is surface0. We rely on the single ioremap done
++ * before.
++ */
++ qdev->main_mem_slot = setup_slot(qdev, 0,
++ (unsigned long)qdev->vram_base,
++ (unsigned long)qdev->vram_base + qdev->rom->ram_header_offset);
++ qdev->surfaces_mem_slot = setup_slot(qdev, 1,
++ (unsigned long)qdev->surfaceram_base,
++ (unsigned long)qdev->surfaceram_base + qdev->surfaceram_size);
++ DRM_INFO("main mem slot %d [%lx,%x)\n",
++ qdev->main_mem_slot,
++ (unsigned long)qdev->vram_base, qdev->rom->ram_header_offset);
++
++
++ qdev->gc_queue = create_singlethread_workqueue("qxl_gc");
++ INIT_WORK(&qdev->gc_work, qxl_gc_work);
++
++ r = qxl_fb_init(qdev);
++ if (r)
++ return r;
++
++ return 0;
++}
++
++void qxl_device_fini(struct qxl_device *qdev)
++{
++ if (qdev->current_release_bo[0])
++ qxl_bo_unref(&qdev->current_release_bo[0]);
++ if (qdev->current_release_bo[1])
++ qxl_bo_unref(&qdev->current_release_bo[1]);
++ flush_workqueue(qdev->gc_queue);
++ destroy_workqueue(qdev->gc_queue);
++ qdev->gc_queue = NULL;
++
++ qxl_ring_free(qdev->command_ring);
++ qxl_ring_free(qdev->cursor_ring);
++ qxl_ring_free(qdev->release_ring);
++ qxl_bo_fini(qdev);
++ io_mapping_free(qdev->surface_mapping);
++ io_mapping_free(qdev->vram_mapping);
++ iounmap(qdev->ram_header);
++ iounmap(qdev->rom);
++ qdev->rom = NULL;
++ qdev->mode_info.modes = NULL;
++ qdev->mode_info.num_modes = 0;
++ qxl_debugfs_remove_files(qdev);
++}
++
++int qxl_driver_unload(struct drm_device *dev)
++{
++ struct qxl_device *qdev = dev->dev_private;
++
++ if (qdev == NULL)
++ return 0;
++ qxl_modeset_fini(qdev);
++ qxl_device_fini(qdev);
++
++ kfree(qdev);
++ dev->dev_private = NULL;
++ return 0;
++}
++
++int qxl_driver_load(struct drm_device *dev, unsigned long flags)
++{
++ struct qxl_device *qdev;
++ int r;
++
++ /* require kms */
++ if (!drm_core_check_feature(dev, DRIVER_MODESET))
++ return -ENODEV;
++
++ qdev = kzalloc(sizeof(struct qxl_device), GFP_KERNEL);
++ if (qdev == NULL)
++ return -ENOMEM;
++
++ dev->dev_private = qdev;
++
++ r = qxl_device_init(qdev, dev, dev->pdev, flags);
++ if (r)
++ goto out;
++
++ r = qxl_modeset_init(qdev);
++ if (r) {
++ qxl_driver_unload(dev);
++ goto out;
++ }
++
++ return 0;
++out:
++ kfree(qdev);
++ return r;
++}
++
++
+diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c
+new file mode 100644
+index 0000000..51efb94
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_object.c
+@@ -0,0 +1,365 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++#include <linux/io-mapping.h>
++static void qxl_ttm_bo_destroy(struct ttm_buffer_object *tbo)
++{
++ struct qxl_bo *bo;
++ struct qxl_device *qdev;
++
++ bo = container_of(tbo, struct qxl_bo, tbo);
++ qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
++
++ qxl_surface_evict(qdev, bo, false);
++ qxl_fence_fini(&bo->fence);
++ mutex_lock(&qdev->gem.mutex);
++ list_del_init(&bo->list);
++ mutex_unlock(&qdev->gem.mutex);
++ drm_gem_object_release(&bo->gem_base);
++ kfree(bo);
++}
++
++bool qxl_ttm_bo_is_qxl_bo(struct ttm_buffer_object *bo)
++{
++ if (bo->destroy == &qxl_ttm_bo_destroy)
++ return true;
++ return false;
++}
++
++void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain)
++{
++ u32 c = 0;
++
++ qbo->placement.fpfn = 0;
++ qbo->placement.lpfn = 0;
++ qbo->placement.placement = qbo->placements;
++ qbo->placement.busy_placement = qbo->placements;
++ if (domain & QXL_GEM_DOMAIN_VRAM)
++ qbo->placements[c++] = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_VRAM;
++ if (domain & QXL_GEM_DOMAIN_SURFACE)
++ qbo->placements[c++] = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_PRIV0;
++ if (domain & QXL_GEM_DOMAIN_CPU)
++ qbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
++ if (!c)
++ qbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
++ qbo->placement.num_placement = c;
++ qbo->placement.num_busy_placement = c;
++}
++
++
++int qxl_bo_create(struct qxl_device *qdev,
++ unsigned long size, bool kernel, u32 domain,
++ struct qxl_surface *surf,
++ struct qxl_bo **bo_ptr)
++{
++ struct qxl_bo *bo;
++ enum ttm_bo_type type;
++ int r;
++
++ if (unlikely(qdev->mman.bdev.dev_mapping == NULL))
++ qdev->mman.bdev.dev_mapping = qdev->ddev->dev_mapping;
++ if (kernel)
++ type = ttm_bo_type_kernel;
++ else
++ type = ttm_bo_type_device;
++ *bo_ptr = NULL;
++ bo = kzalloc(sizeof(struct qxl_bo), GFP_KERNEL);
++ if (bo == NULL)
++ return -ENOMEM;
++ size = roundup(size, PAGE_SIZE);
++ r = drm_gem_object_init(qdev->ddev, &bo->gem_base, size);
++ if (unlikely(r)) {
++ kfree(bo);
++ return r;
++ }
++ bo->gem_base.driver_private = NULL;
++ bo->type = domain;
++ bo->pin_count = 0;
++ bo->surface_id = 0;
++ qxl_fence_init(qdev, &bo->fence);
++ INIT_LIST_HEAD(&bo->list);
++ atomic_set(&bo->reserve_count, 0);
++ if (surf)
++ bo->surf = *surf;
++
++ qxl_ttm_placement_from_domain(bo, domain);
++
++ r = ttm_bo_init(&qdev->mman.bdev, &bo->tbo, size, type,
++ &bo->placement, 0, !kernel, NULL, size,
++ NULL, &qxl_ttm_bo_destroy);
++ if (unlikely(r != 0)) {
++ if (r != -ERESTARTSYS)
++ dev_err(qdev->dev,
++ "object_init failed for (%lu, 0x%08X)\n",
++ size, domain);
++ return r;
++ }
++ *bo_ptr = bo;
++ return 0;
++}
++
++int qxl_bo_kmap(struct qxl_bo *bo, void **ptr)
++{
++ bool is_iomem;
++ int r;
++
++ if (bo->kptr) {
++ if (ptr)
++ *ptr = bo->kptr;
++ return 0;
++ }
++ r = ttm_bo_kmap(&bo->tbo, 0, bo->tbo.num_pages, &bo->kmap);
++ if (r)
++ return r;
++ bo->kptr = ttm_kmap_obj_virtual(&bo->kmap, &is_iomem);
++ if (ptr)
++ *ptr = bo->kptr;
++ return 0;
++}
++
++void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev,
++ struct qxl_bo *bo, int page_offset)
++{
++ struct ttm_mem_type_manager *man = &bo->tbo.bdev->man[bo->tbo.mem.mem_type];
++ void *rptr;
++ int ret;
++ struct io_mapping *map;
++
++ if (bo->tbo.mem.mem_type == TTM_PL_VRAM)
++ map = qdev->vram_mapping;
++ else if (bo->tbo.mem.mem_type == TTM_PL_PRIV0)
++ map = qdev->surface_mapping;
++ else
++ goto fallback;
++
++ (void) ttm_mem_io_lock(man, false);
++ ret = ttm_mem_io_reserve(bo->tbo.bdev, &bo->tbo.mem);
++ ttm_mem_io_unlock(man);
++
++ return io_mapping_map_atomic_wc(map, bo->tbo.mem.bus.offset + page_offset);
++fallback:
++ if (bo->kptr) {
++ rptr = bo->kptr + (page_offset * PAGE_SIZE);
++ return rptr;
++ }
++
++ ret = qxl_bo_kmap(bo, &rptr);
++ if (ret)
++ return NULL;
++
++ rptr += page_offset * PAGE_SIZE;
++ return rptr;
++}
++
++void qxl_bo_kunmap(struct qxl_bo *bo)
++{
++ if (bo->kptr == NULL)
++ return;
++ bo->kptr = NULL;
++ ttm_bo_kunmap(&bo->kmap);
++}
++
++void qxl_bo_kunmap_atomic_page(struct qxl_device *qdev,
++ struct qxl_bo *bo, void *pmap)
++{
++ struct ttm_mem_type_manager *man = &bo->tbo.bdev->man[bo->tbo.mem.mem_type];
++ struct io_mapping *map;
++
++ if (bo->tbo.mem.mem_type == TTM_PL_VRAM)
++ map = qdev->vram_mapping;
++ else if (bo->tbo.mem.mem_type == TTM_PL_PRIV0)
++ map = qdev->surface_mapping;
++ else
++ goto fallback;
++
++ io_mapping_unmap_atomic(pmap);
++
++ (void) ttm_mem_io_lock(man, false);
++ ttm_mem_io_free(bo->tbo.bdev, &bo->tbo.mem);
++ ttm_mem_io_unlock(man);
++ return ;
++ fallback:
++ qxl_bo_kunmap(bo);
++}
++
++void qxl_bo_unref(struct qxl_bo **bo)
++{
++ struct ttm_buffer_object *tbo;
++
++ if ((*bo) == NULL)
++ return;
++ tbo = &((*bo)->tbo);
++ ttm_bo_unref(&tbo);
++ if (tbo == NULL)
++ *bo = NULL;
++}
++
++struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo)
++{
++ ttm_bo_reference(&bo->tbo);
++ return bo;
++}
++
++int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr)
++{
++ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
++ int r, i;
++
++ if (bo->pin_count) {
++ bo->pin_count++;
++ if (gpu_addr)
++ *gpu_addr = qxl_bo_gpu_offset(bo);
++ return 0;
++ }
++ qxl_ttm_placement_from_domain(bo, domain);
++ for (i = 0; i < bo->placement.num_placement; i++)
++ bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
++ r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
++ if (likely(r == 0)) {
++ bo->pin_count = 1;
++ if (gpu_addr != NULL)
++ *gpu_addr = qxl_bo_gpu_offset(bo);
++ }
++ if (unlikely(r != 0))
++ dev_err(qdev->dev, "%p pin failed\n", bo);
++ return r;
++}
++
++int qxl_bo_unpin(struct qxl_bo *bo)
++{
++ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
++ int r, i;
++
++ if (!bo->pin_count) {
++ dev_warn(qdev->dev, "%p unpin not necessary\n", bo);
++ return 0;
++ }
++ bo->pin_count--;
++ if (bo->pin_count)
++ return 0;
++ for (i = 0; i < bo->placement.num_placement; i++)
++ bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
++ r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
++ if (unlikely(r != 0))
++ dev_err(qdev->dev, "%p validate failed for unpin\n", bo);
++ return r;
++}
++
++void qxl_bo_force_delete(struct qxl_device *qdev)
++{
++ struct qxl_bo *bo, *n;
++
++ if (list_empty(&qdev->gem.objects))
++ return;
++ dev_err(qdev->dev, "Userspace still has active objects !\n");
++ list_for_each_entry_safe(bo, n, &qdev->gem.objects, list) {
++ mutex_lock(&qdev->ddev->struct_mutex);
++ dev_err(qdev->dev, "%p %p %lu %lu force free\n",
++ &bo->gem_base, bo, (unsigned long)bo->gem_base.size,
++ *((unsigned long *)&bo->gem_base.refcount));
++ mutex_lock(&qdev->gem.mutex);
++ list_del_init(&bo->list);
++ mutex_unlock(&qdev->gem.mutex);
++ /* this should unref the ttm bo */
++ drm_gem_object_unreference(&bo->gem_base);
++ mutex_unlock(&qdev->ddev->struct_mutex);
++ }
++}
++
++int qxl_bo_init(struct qxl_device *qdev)
++{
++ return qxl_ttm_init(qdev);
++}
++
++void qxl_bo_fini(struct qxl_device *qdev)
++{
++ qxl_ttm_fini(qdev);
++}
++
++int qxl_bo_check_id(struct qxl_device *qdev, struct qxl_bo *bo)
++{
++ int ret;
++ if (bo->type == QXL_GEM_DOMAIN_SURFACE && bo->surface_id == 0) {
++ /* allocate a surface id for this surface now */
++ ret = qxl_surface_id_alloc(qdev, bo);
++ if (ret)
++ return ret;
++
++ ret = qxl_hw_surface_alloc(qdev, bo, NULL);
++ if (ret)
++ return ret;
++ }
++ return 0;
++}
++
++void qxl_bo_list_unreserve(struct qxl_reloc_list *reloc_list, bool failed)
++{
++ struct qxl_bo_list *entry, *sf;
++
++ list_for_each_entry_safe(entry, sf, &reloc_list->bos, lhead) {
++ qxl_bo_unreserve(entry->bo);
++ list_del(&entry->lhead);
++ kfree(entry);
++ }
++}
++
++int qxl_bo_list_add(struct qxl_reloc_list *reloc_list, struct qxl_bo *bo)
++{
++ struct qxl_bo_list *entry;
++ int ret;
++
++ list_for_each_entry(entry, &reloc_list->bos, lhead) {
++ if (entry->bo == bo)
++ return 0;
++ }
++
++ entry = kmalloc(sizeof(struct qxl_bo_list), GFP_KERNEL);
++ if (!entry)
++ return -ENOMEM;
++
++ entry->bo = bo;
++ list_add(&entry->lhead, &reloc_list->bos);
++
++ ret = qxl_bo_reserve(bo, false);
++ if (ret)
++ return ret;
++
++ if (!bo->pin_count) {
++ qxl_ttm_placement_from_domain(bo, bo->type);
++ ret = ttm_bo_validate(&bo->tbo, &bo->placement,
++ true, false);
++ if (ret)
++ return ret;
++ }
++
++ /* allocate a surface for reserved + validated buffers */
++ ret = qxl_bo_check_id(bo->gem_base.dev->dev_private, bo);
++ if (ret)
++ return ret;
++ return 0;
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_object.h b/drivers/gpu/drm/qxl/qxl_object.h
+new file mode 100644
+index 0000000..b4fd89f
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_object.h
+@@ -0,0 +1,112 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++#ifndef QXL_OBJECT_H
++#define QXL_OBJECT_H
++
++#include "qxl_drv.h"
++
++static inline int qxl_bo_reserve(struct qxl_bo *bo, bool no_wait)
++{
++ int r;
++
++ r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0);
++ if (unlikely(r != 0)) {
++ if (r != -ERESTARTSYS) {
++ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
++ dev_err(qdev->dev, "%p reserve failed\n", bo);
++ }
++ return r;
++ }
++ return 0;
++}
++
++static inline void qxl_bo_unreserve(struct qxl_bo *bo)
++{
++ ttm_bo_unreserve(&bo->tbo);
++}
++
++static inline u64 qxl_bo_gpu_offset(struct qxl_bo *bo)
++{
++ return bo->tbo.offset;
++}
++
++static inline unsigned long qxl_bo_size(struct qxl_bo *bo)
++{
++ return bo->tbo.num_pages << PAGE_SHIFT;
++}
++
++static inline bool qxl_bo_is_reserved(struct qxl_bo *bo)
++{
++ return !!atomic_read(&bo->tbo.reserved);
++}
++
++static inline u64 qxl_bo_mmap_offset(struct qxl_bo *bo)
++{
++ return bo->tbo.addr_space_offset;
++}
++
++static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type,
++ bool no_wait)
++{
++ int r;
++
++ r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0);
++ if (unlikely(r != 0)) {
++ if (r != -ERESTARTSYS) {
++ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
++ dev_err(qdev->dev, "%p reserve failed for wait\n",
++ bo);
++ }
++ return r;
++ }
++ spin_lock(&bo->tbo.bdev->fence_lock);
++ if (mem_type)
++ *mem_type = bo->tbo.mem.mem_type;
++ if (bo->tbo.sync_obj)
++ r = ttm_bo_wait(&bo->tbo, true, true, no_wait);
++ spin_unlock(&bo->tbo.bdev->fence_lock);
++ ttm_bo_unreserve(&bo->tbo);
++ return r;
++}
++
++extern int qxl_bo_create(struct qxl_device *qdev,
++ unsigned long size,
++ bool kernel, u32 domain,
++ struct qxl_surface *surf,
++ struct qxl_bo **bo_ptr);
++extern int qxl_bo_kmap(struct qxl_bo *bo, void **ptr);
++extern void qxl_bo_kunmap(struct qxl_bo *bo);
++void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev, struct qxl_bo *bo, int page_offset);
++void qxl_bo_kunmap_atomic_page(struct qxl_device *qdev, struct qxl_bo *bo, void *map);
++extern struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo);
++extern void qxl_bo_unref(struct qxl_bo **bo);
++extern int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr);
++extern int qxl_bo_unpin(struct qxl_bo *bo);
++extern void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain);
++extern bool qxl_ttm_bo_is_qxl_bo(struct ttm_buffer_object *bo);
++
++extern int qxl_bo_list_add(struct qxl_reloc_list *reloc_list, struct qxl_bo *bo);
++extern void qxl_bo_list_unreserve(struct qxl_reloc_list *reloc_list, bool failed);
++#endif
+diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c
+new file mode 100644
+index 0000000..1600781
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_release.c
+@@ -0,0 +1,307 @@
++/*
++ * Copyright 2011 Red Hat, Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * on the rights to use, copy, modify, merge, publish, distribute, sub
++ * license, and/or sell copies of the Software, and to permit persons to whom
++ * the Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
++ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++/*
++ * drawable cmd cache - allocate a bunch of VRAM pages, suballocate
++ * into 256 byte chunks for now - gives 16 cmds per page.
++ *
++ * use an ida to index into the chunks?
++ */
++/* manage releaseables */
++/* stack them 16 high for now -drawable object is 191 */
++#define RELEASE_SIZE 256
++#define RELEASES_PER_BO (4096 / RELEASE_SIZE)
++/* put an alloc/dealloc surface cmd into one bo and round up to 128 */
++#define SURFACE_RELEASE_SIZE 128
++#define SURFACE_RELEASES_PER_BO (4096 / SURFACE_RELEASE_SIZE)
++
++static const int release_size_per_bo[] = { RELEASE_SIZE, SURFACE_RELEASE_SIZE, RELEASE_SIZE };
++static const int releases_per_bo[] = { RELEASES_PER_BO, SURFACE_RELEASES_PER_BO, RELEASES_PER_BO };
++uint64_t
++qxl_release_alloc(struct qxl_device *qdev, int type,
++ struct qxl_release **ret)
++{
++ struct qxl_release *release;
++ int handle = 0;
++ size_t size = sizeof(*release);
++ int idr_ret;
++
++ release = kmalloc(size, GFP_KERNEL);
++ if (!release) {
++ DRM_ERROR("Out of memory\n");
++ return 0;
++ }
++ release->type = type;
++ release->bo_count = 0;
++ release->release_offset = 0;
++ release->surface_release_id = 0;
++again:
++ if (idr_pre_get(&qdev->release_idr, GFP_KERNEL) == 0) {
++ DRM_ERROR("Out of memory for release idr\n");
++ kfree(release);
++ goto release_fail;
++ }
++ spin_lock(&qdev->release_idr_lock);
++ idr_ret = idr_get_new_above(&qdev->release_idr, release, 1, &handle);
++ spin_unlock(&qdev->release_idr_lock);
++ if (idr_ret == -EAGAIN)
++ goto again;
++ if (ret)
++ *ret = release;
++ QXL_INFO(qdev, "allocated release %lld\n", handle);
++ release->id = handle;
++release_fail:
++
++ return handle;
++}
++
++void
++qxl_release_free(struct qxl_device *qdev,
++ struct qxl_release *release)
++{
++ int i;
++
++ QXL_INFO(qdev, "release %d, type %d, %d bos\n", release->id,
++ release->type, release->bo_count);
++
++ if (release->surface_release_id)
++ qxl_surface_id_dealloc(qdev, release->surface_release_id);
++
++ for (i = 0 ; i < release->bo_count; ++i) {
++ QXL_INFO(qdev, "release %llx\n",
++ release->bos[i]->tbo.addr_space_offset
++ - DRM_FILE_OFFSET);
++ qxl_fence_remove_release(&release->bos[i]->fence, release->id);
++ qxl_bo_unref(&release->bos[i]);
++ }
++ spin_lock(&qdev->release_idr_lock);
++ idr_remove(&qdev->release_idr, release->id);
++ spin_unlock(&qdev->release_idr_lock);
++ kfree(release);
++}
++
++void
++qxl_release_add_res(struct qxl_device *qdev, struct qxl_release *release,
++ struct qxl_bo *bo)
++{
++ int i;
++ for (i = 0; i < release->bo_count; i++)
++ if (release->bos[i] == bo)
++ return;
++
++ if (release->bo_count >= QXL_MAX_RES) {
++ DRM_ERROR("exceeded max resource on a qxl_release item\n");
++ return;
++ }
++ release->bos[release->bo_count++] = qxl_bo_ref(bo);
++}
++
++int qxl_release_bo_alloc(struct qxl_device *qdev,
++ struct qxl_bo **bo)
++{
++ int ret;
++ ret = qxl_bo_create(qdev, PAGE_SIZE, false, QXL_GEM_DOMAIN_VRAM, NULL,
++ bo);
++ return ret;
++}
++
++int qxl_release_reserve(struct qxl_device *qdev,
++ struct qxl_release *release, bool no_wait)
++{
++ int ret;
++ if (atomic_inc_return(&release->bos[0]->reserve_count) == 1) {
++ ret = qxl_bo_reserve(release->bos[0], no_wait);
++ if (ret)
++ return ret;
++ }
++ return 0;
++}
++
++void qxl_release_unreserve(struct qxl_device *qdev,
++ struct qxl_release *release)
++{
++ if (atomic_dec_and_test(&release->bos[0]->reserve_count))
++ qxl_bo_unreserve(release->bos[0]);
++}
++
++int qxl_alloc_surface_release_reserved(struct qxl_device *qdev,
++ enum qxl_surface_cmd_type surface_cmd_type,
++ struct qxl_release *create_rel,
++ struct qxl_release **release)
++{
++ int ret;
++
++ if (surface_cmd_type == QXL_SURFACE_CMD_DESTROY && create_rel) {
++ int idr_ret;
++ struct qxl_bo *bo;
++ union qxl_release_info *info;
++
++ /* stash the release after the create command */
++ idr_ret = qxl_release_alloc(qdev, QXL_RELEASE_SURFACE_CMD, release);
++ bo = qxl_bo_ref(create_rel->bos[0]);
++
++ (*release)->release_offset = create_rel->release_offset + 64;
++
++ qxl_release_add_res(qdev, *release, bo);
++
++ ret = qxl_release_reserve(qdev, *release, false);
++ if (ret) {
++ DRM_ERROR("release reserve failed\n");
++ goto out_unref;
++ }
++ info = qxl_release_map(qdev, *release);
++ info->id = idr_ret;
++ qxl_release_unmap(qdev, *release, info);
++
++
++out_unref:
++ qxl_bo_unref(&bo);
++ return ret;
++ }
++
++ return qxl_alloc_release_reserved(qdev, sizeof(struct qxl_surface_cmd),
++ QXL_RELEASE_SURFACE_CMD, release, NULL);
++}
++
++int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size,
++ int type, struct qxl_release **release,
++ struct qxl_bo **rbo)
++{
++ struct qxl_bo *bo;
++ int idr_ret;
++ int ret;
++ union qxl_release_info *info;
++ int cur_idx;
++
++ if (type == QXL_RELEASE_DRAWABLE)
++ cur_idx = 0;
++ else if (type == QXL_RELEASE_SURFACE_CMD)
++ cur_idx = 1;
++ else if (type == QXL_RELEASE_CURSOR_CMD)
++ cur_idx = 2;
++ else {
++ DRM_ERROR("got illegal type: %d\n", type);
++ return -EINVAL;
++ }
++
++ idr_ret = qxl_release_alloc(qdev, type, release);
++
++ mutex_lock(&qdev->release_mutex);
++ if (qdev->current_release_bo_offset[cur_idx] + 1 >= releases_per_bo[cur_idx]) {
++ qxl_bo_unref(&qdev->current_release_bo[cur_idx]);
++ qdev->current_release_bo_offset[cur_idx] = 0;
++ qdev->current_release_bo[cur_idx] = NULL;
++ }
++ if (!qdev->current_release_bo[cur_idx]) {
++ ret = qxl_release_bo_alloc(qdev, &qdev->current_release_bo[cur_idx]);
++ if (ret) {
++ mutex_unlock(&qdev->release_mutex);
++ return ret;
++ }
++
++ /* pin releases bo's they are too messy to evict */
++ ret = qxl_bo_reserve(qdev->current_release_bo[cur_idx], false);
++ qxl_bo_pin(qdev->current_release_bo[cur_idx], QXL_GEM_DOMAIN_VRAM, NULL);
++ qxl_bo_unreserve(qdev->current_release_bo[cur_idx]);
++ }
++
++ bo = qxl_bo_ref(qdev->current_release_bo[cur_idx]);
++
++ (*release)->release_offset = qdev->current_release_bo_offset[cur_idx] * release_size_per_bo[cur_idx];
++ qdev->current_release_bo_offset[cur_idx]++;
++
++ if (rbo)
++ *rbo = bo;
++
++ qxl_release_add_res(qdev, *release, bo);
++
++ ret = qxl_release_reserve(qdev, *release, false);
++ mutex_unlock(&qdev->release_mutex);
++ if (ret)
++ goto out_unref;
++
++ info = qxl_release_map(qdev, *release);
++ info->id = idr_ret;
++ qxl_release_unmap(qdev, *release, info);
++
++out_unref:
++ qxl_bo_unref(&bo);
++ return ret;
++}
++
++int qxl_fence_releaseable(struct qxl_device *qdev,
++ struct qxl_release *release)
++{
++ int i, ret;
++ for (i = 0; i < release->bo_count; i++) {
++ if (!release->bos[i]->tbo.sync_obj)
++ release->bos[i]->tbo.sync_obj = &release->bos[i]->fence;
++ ret = qxl_fence_add_release(&release->bos[i]->fence, release->id);
++ if (ret)
++ return ret;
++ }
++ return 0;
++}
++
++struct qxl_release *qxl_release_from_id_locked(struct qxl_device *qdev,
++ uint64_t id)
++{
++ struct qxl_release *release;
++
++ spin_lock(&qdev->release_idr_lock);
++ release = idr_find(&qdev->release_idr, id);
++ spin_unlock(&qdev->release_idr_lock);
++ if (!release) {
++ DRM_ERROR("failed to find id in release_idr\n");
++ return NULL;
++ }
++ if (release->bo_count < 1) {
++ DRM_ERROR("read a released resource with 0 bos\n");
++ return NULL;
++ }
++ return release;
++}
++
++union qxl_release_info *qxl_release_map(struct qxl_device *qdev,
++ struct qxl_release *release)
++{
++ void *ptr;
++ union qxl_release_info *info;
++ struct qxl_bo *bo = release->bos[0];
++
++ ptr = qxl_bo_kmap_atomic_page(qdev, bo, release->release_offset & PAGE_SIZE);
++ info = ptr + (release->release_offset & ~PAGE_SIZE);
++ return info;
++}
++
++void qxl_release_unmap(struct qxl_device *qdev,
++ struct qxl_release *release,
++ union qxl_release_info *info)
++{
++ struct qxl_bo *bo = release->bos[0];
++ void *ptr;
++
++ ptr = ((void *)info) - (release->release_offset & ~PAGE_SIZE);
++ qxl_bo_kunmap_atomic_page(qdev, bo, ptr);
++}
+diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
+new file mode 100644
+index 0000000..aa9fb9a
+--- /dev/null
++++ b/drivers/gpu/drm/qxl/qxl_ttm.c
+@@ -0,0 +1,577 @@
++/*
++ * Copyright 2013 Red Hat Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ *
++ * Authors: Dave Airlie
++ * Alon Levy
++ */
++
++#include <ttm/ttm_bo_api.h>
++#include <ttm/ttm_bo_driver.h>
++#include <ttm/ttm_placement.h>
++#include <ttm/ttm_page_alloc.h>
++#include <ttm/ttm_module.h>
++#include <drm/drmP.h>
++#include <drm/drm.h>
++#include <drm/qxl_drm.h>
++#include "qxl_drv.h"
++#include "qxl_object.h"
++
++#include <linux/delay.h>
++static int qxl_ttm_debugfs_init(struct qxl_device *qdev);
++
++static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev)
++{
++ struct qxl_mman *mman;
++ struct qxl_device *qdev;
++
++ mman = container_of(bdev, struct qxl_mman, bdev);
++ qdev = container_of(mman, struct qxl_device, mman);
++ return qdev;
++}
++
++static int qxl_ttm_mem_global_init(struct drm_global_reference *ref)
++{
++ return ttm_mem_global_init(ref->object);
++}
++
++static void qxl_ttm_mem_global_release(struct drm_global_reference *ref)
++{
++ ttm_mem_global_release(ref->object);
++}
++
++static int qxl_ttm_global_init(struct qxl_device *qdev)
++{
++ struct drm_global_reference *global_ref;
++ int r;
++
++ qdev->mman.mem_global_referenced = false;
++ global_ref = &qdev->mman.mem_global_ref;
++ global_ref->global_type = DRM_GLOBAL_TTM_MEM;
++ global_ref->size = sizeof(struct ttm_mem_global);
++ global_ref->init = &qxl_ttm_mem_global_init;
++ global_ref->release = &qxl_ttm_mem_global_release;
++
++ r = drm_global_item_ref(global_ref);
++ if (r != 0) {
++ DRM_ERROR("Failed setting up TTM memory accounting "
++ "subsystem.\n");
++ return r;
++ }
++
++ qdev->mman.bo_global_ref.mem_glob =
++ qdev->mman.mem_global_ref.object;
++ global_ref = &qdev->mman.bo_global_ref.ref;
++ global_ref->global_type = DRM_GLOBAL_TTM_BO;
++ global_ref->size = sizeof(struct ttm_bo_global);
++ global_ref->init = &ttm_bo_global_init;
++ global_ref->release = &ttm_bo_global_release;
++ r = drm_global_item_ref(global_ref);
++ if (r != 0) {
++ DRM_ERROR("Failed setting up TTM BO subsystem.\n");
++ drm_global_item_unref(&qdev->mman.mem_global_ref);
++ return r;
++ }
++
++ qdev->mman.mem_global_referenced = true;
++ return 0;
++}
++
++static void qxl_ttm_global_fini(struct qxl_device *qdev)
++{
++ if (qdev->mman.mem_global_referenced) {
++ drm_global_item_unref(&qdev->mman.bo_global_ref.ref);
++ drm_global_item_unref(&qdev->mman.mem_global_ref);
++ qdev->mman.mem_global_referenced = false;
++ }
++}
++
++static struct vm_operations_struct qxl_ttm_vm_ops;
++static const struct vm_operations_struct *ttm_vm_ops;
++
++static int qxl_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
++{
++ struct ttm_buffer_object *bo;
++ struct qxl_device *qdev;
++ int r;
++
++ bo = (struct ttm_buffer_object *)vma->vm_private_data;
++ if (bo == NULL)
++ return VM_FAULT_NOPAGE;
++ qdev = qxl_get_qdev(bo->bdev);
++ r = ttm_vm_ops->fault(vma, vmf);
++ return r;
++}
++
++int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
++{
++ struct drm_file *file_priv;
++ struct qxl_device *qdev;
++ int r;
++
++ if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
++ pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
++ __func__, vma->vm_pgoff);
++ return drm_mmap(filp, vma);
++ }
++
++ file_priv = filp->private_data;
++ qdev = file_priv->minor->dev->dev_private;
++ if (qdev == NULL) {
++ DRM_ERROR(
++ "filp->private_data->minor->dev->dev_private == NULL\n");
++ return -EINVAL;
++ }
++ QXL_INFO(qdev, "%s: filp->private_data = 0x%p, vma->vm_pgoff = %lx\n",
++ __func__, filp->private_data, vma->vm_pgoff);
++
++ r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev);
++ if (unlikely(r != 0))
++ return r;
++ if (unlikely(ttm_vm_ops == NULL)) {
++ ttm_vm_ops = vma->vm_ops;
++ qxl_ttm_vm_ops = *ttm_vm_ops;
++ qxl_ttm_vm_ops.fault = &qxl_ttm_fault;
++ }
++ vma->vm_ops = &qxl_ttm_vm_ops;
++ return 0;
++}
++
++static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
++{
++ return 0;
++}
++
++static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
++ struct ttm_mem_type_manager *man)
++{
++ struct qxl_device *qdev;
++
++ qdev = qxl_get_qdev(bdev);
++
++ switch (type) {
++ case TTM_PL_SYSTEM:
++ /* System memory */
++ man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
++ man->available_caching = TTM_PL_MASK_CACHING;
++ man->default_caching = TTM_PL_FLAG_CACHED;
++ break;
++ case TTM_PL_VRAM:
++ case TTM_PL_PRIV0:
++ /* "On-card" video ram */
++ man->func = &ttm_bo_manager_func;
++ man->gpu_offset = 0;
++ man->flags = TTM_MEMTYPE_FLAG_FIXED |
++ TTM_MEMTYPE_FLAG_MAPPABLE;
++ man->available_caching = TTM_PL_MASK_CACHING;
++ man->default_caching = TTM_PL_FLAG_CACHED;
++ break;
++ default:
++ DRM_ERROR("Unsupported memory type %u\n", (unsigned)type);
++ return -EINVAL;
++ }
++ return 0;
++}
++
++static void qxl_evict_flags(struct ttm_buffer_object *bo,
++ struct ttm_placement *placement)
++{
++ struct qxl_bo *qbo;
++ static u32 placements = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
++
++ if (!qxl_ttm_bo_is_qxl_bo(bo)) {
++ placement->fpfn = 0;
++ placement->lpfn = 0;
++ placement->placement = &placements;
++ placement->busy_placement = &placements;
++ placement->num_placement = 1;
++ placement->num_busy_placement = 1;
++ return;
++ }
++ qbo = container_of(bo, struct qxl_bo, tbo);
++ qxl_ttm_placement_from_domain(qbo, QXL_GEM_DOMAIN_CPU);
++ *placement = qbo->placement;
++}
++
++static int qxl_verify_access(struct ttm_buffer_object *bo, struct file *filp)
++{
++ return 0;
++}
++
++static int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
++ struct ttm_mem_reg *mem)
++{
++ struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
++ struct qxl_device *qdev = qxl_get_qdev(bdev);
++
++ mem->bus.addr = NULL;
++ mem->bus.offset = 0;
++ mem->bus.size = mem->num_pages << PAGE_SHIFT;
++ mem->bus.base = 0;
++ mem->bus.is_iomem = false;
++ if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE))
++ return -EINVAL;
++ switch (mem->mem_type) {
++ case TTM_PL_SYSTEM:
++ /* system memory */
++ return 0;
++ case TTM_PL_VRAM:
++ mem->bus.is_iomem = true;
++ mem->bus.base = qdev->vram_base;
++ mem->bus.offset = mem->start << PAGE_SHIFT;
++ break;
++ case TTM_PL_PRIV0:
++ mem->bus.is_iomem = true;
++ mem->bus.base = qdev->surfaceram_base;
++ mem->bus.offset = mem->start << PAGE_SHIFT;
++ break;
++ default:
++ return -EINVAL;
++ }
++ return 0;
++}
++
++static void qxl_ttm_io_mem_free(struct ttm_bo_device *bdev,
++ struct ttm_mem_reg *mem)
++{
++}
++
++/*
++ * TTM backend functions.
++ */
++struct qxl_ttm_tt {
++ struct ttm_dma_tt ttm;
++ struct qxl_device *qdev;
++ u64 offset;
++};
++
++static int qxl_ttm_backend_bind(struct ttm_tt *ttm,
++ struct ttm_mem_reg *bo_mem)
++{
++ struct qxl_ttm_tt *gtt = (void *)ttm;
++
++ gtt->offset = (unsigned long)(bo_mem->start << PAGE_SHIFT);
++ if (!ttm->num_pages) {
++ WARN(1, "nothing to bind %lu pages for mreg %p back %p!\n",
++ ttm->num_pages, bo_mem, ttm);
++ }
++ /* Not implemented */
++ return -1;
++}
++
++static int qxl_ttm_backend_unbind(struct ttm_tt *ttm)
++{
++ /* Not implemented */
++ return -1;
++}
++
++static void qxl_ttm_backend_destroy(struct ttm_tt *ttm)
++{
++ struct qxl_ttm_tt *gtt = (void *)ttm;
++
++ ttm_dma_tt_fini(&gtt->ttm);
++ kfree(gtt);
++}
++
++static struct ttm_backend_func qxl_backend_func = {
++ .bind = &qxl_ttm_backend_bind,
++ .unbind = &qxl_ttm_backend_unbind,
++ .destroy = &qxl_ttm_backend_destroy,
++};
++
++static int qxl_ttm_tt_populate(struct ttm_tt *ttm)
++{
++ int r;
++
++ if (ttm->state != tt_unpopulated)
++ return 0;
++
++ r = ttm_pool_populate(ttm);
++ if (r)
++ return r;
++
++ return 0;
++}
++
++static void qxl_ttm_tt_unpopulate(struct ttm_tt *ttm)
++{
++ ttm_pool_unpopulate(ttm);
++}
++
++struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev,
++ unsigned long size, uint32_t page_flags,
++ struct page *dummy_read_page)
++{
++ struct qxl_device *qdev;
++ struct qxl_ttm_tt *gtt;
++
++ qdev = qxl_get_qdev(bdev);
++ gtt = kzalloc(sizeof(struct qxl_ttm_tt), GFP_KERNEL);
++ if (gtt == NULL)
++ return NULL;
++ gtt->ttm.ttm.func = &qxl_backend_func;
++ gtt->qdev = qdev;
++ if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags,
++ dummy_read_page)) {
++ kfree(gtt);
++ return NULL;
++ }
++ return &gtt->ttm.ttm;
++}
++
++static void qxl_move_null(struct ttm_buffer_object *bo,
++ struct ttm_mem_reg *new_mem)
++{
++ struct ttm_mem_reg *old_mem = &bo->mem;
++
++ BUG_ON(old_mem->mm_node != NULL);
++ *old_mem = *new_mem;
++ new_mem->mm_node = NULL;
++}
++
++static int qxl_bo_move(struct ttm_buffer_object *bo,
++ bool evict, bool interruptible,
++ bool no_wait_gpu,
++ struct ttm_mem_reg *new_mem)
++{
++ struct ttm_mem_reg *old_mem = &bo->mem;
++ if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) {
++ qxl_move_null(bo, new_mem);
++ return 0;
++ }
++ return ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem);
++}
++
++
++static int qxl_sync_obj_wait(void *sync_obj,
++ bool lazy, bool interruptible)
++{
++ struct qxl_fence *qfence = (struct qxl_fence *)sync_obj;
++ int count = 0, sc = 0;
++ struct qxl_bo *bo = container_of(qfence, struct qxl_bo, fence);
++
++ if (qfence->num_active_releases == 0)
++ return 0;
++
++retry:
++ if (sc == 0) {
++ if (bo->type == QXL_GEM_DOMAIN_SURFACE)
++ qxl_update_surface(qfence->qdev, bo);
++ } else if (sc >= 1) {
++ qxl_io_notify_oom(qfence->qdev);
++ }
++
++ sc++;
++
++ for (count = 0; count < 10; count++) {
++ bool ret;
++ ret = qxl_queue_garbage_collect(qfence->qdev, true);
++ if (ret == false)
++ break;
++
++ if (qfence->num_active_releases == 0)
++ return 0;
++ }
++
++ if (qfence->num_active_releases) {
++ bool have_drawable_releases = false;
++ void **slot;
++ struct radix_tree_iter iter;
++ int release_id;
++
++ radix_tree_for_each_slot(slot, &qfence->tree, &iter, 0) {
++ struct qxl_release *release;
++
++ release_id = iter.index;
++ release = qxl_release_from_id_locked(qfence->qdev, release_id);
++ if (release == NULL)
++ continue;
++
++ if (release->type == QXL_RELEASE_DRAWABLE)
++ have_drawable_releases = true;
++ }
++
++ qxl_queue_garbage_collect(qfence->qdev, true);
++
++ if (have_drawable_releases || sc < 4) {
++ if (sc > 2)
++ /* back off */
++ usleep_range(500, 1000);
++ if (have_drawable_releases && sc > 300) {
++ WARN(1, "sync obj %d still has outstanding releases %d %d %d %ld %d\n", sc, bo->surface_id, bo->is_primary, bo->pin_count, (unsigned long)bo->gem_base.size, qfence->num_active_releases);
++ return -EBUSY;
++ }
++ goto retry;
++ }
++ }
++ return 0;
++}
++
++static int qxl_sync_obj_flush(void *sync_obj)
++{
++ return 0;
++}
++
++static void qxl_sync_obj_unref(void **sync_obj)
++{
++}
++
++static void *qxl_sync_obj_ref(void *sync_obj)
++{
++ return sync_obj;
++}
++
++static bool qxl_sync_obj_signaled(void *sync_obj)
++{
++ struct qxl_fence *qfence = (struct qxl_fence *)sync_obj;
++ return (qfence->num_active_releases == 0);
++}
++
++static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
++ struct ttm_mem_reg *new_mem)
++{
++ struct qxl_bo *qbo;
++ struct qxl_device *qdev;
++
++ if (!qxl_ttm_bo_is_qxl_bo(bo))
++ return;
++ qbo = container_of(bo, struct qxl_bo, tbo);
++ qdev = qbo->gem_base.dev->dev_private;
++
++ if (bo->mem.mem_type == TTM_PL_PRIV0 && qbo->surface_id)
++ qxl_surface_evict(qdev, qbo, new_mem ? true : false);
++}
++
++static struct ttm_bo_driver qxl_bo_driver = {
++ .ttm_tt_create = &qxl_ttm_tt_create,
++ .ttm_tt_populate = &qxl_ttm_tt_populate,
++ .ttm_tt_unpopulate = &qxl_ttm_tt_unpopulate,
++ .invalidate_caches = &qxl_invalidate_caches,
++ .init_mem_type = &qxl_init_mem_type,
++ .evict_flags = &qxl_evict_flags,
++ .move = &qxl_bo_move,
++ .verify_access = &qxl_verify_access,
++ .io_mem_reserve = &qxl_ttm_io_mem_reserve,
++ .io_mem_free = &qxl_ttm_io_mem_free,
++ .sync_obj_signaled = &qxl_sync_obj_signaled,
++ .sync_obj_wait = &qxl_sync_obj_wait,
++ .sync_obj_flush = &qxl_sync_obj_flush,
++ .sync_obj_unref = &qxl_sync_obj_unref,
++ .sync_obj_ref = &qxl_sync_obj_ref,
++ .move_notify = &qxl_bo_move_notify,
++};
++
++
++
++int qxl_ttm_init(struct qxl_device *qdev)
++{
++ int r;
++ int num_io_pages; /* != rom->num_io_pages, we include surface0 */
++
++ r = qxl_ttm_global_init(qdev);
++ if (r)
++ return r;
++ /* No others user of address space so set it to 0 */
++ r = ttm_bo_device_init(&qdev->mman.bdev,
++ qdev->mman.bo_global_ref.ref.object,
++ &qxl_bo_driver, DRM_FILE_PAGE_OFFSET, 0);
++ if (r) {
++ DRM_ERROR("failed initializing buffer object driver(%d).\n", r);
++ return r;
++ }
++ /* NOTE: this includes the framebuffer (aka surface 0) */
++ num_io_pages = qdev->rom->ram_header_offset / PAGE_SIZE;
++ r = ttm_bo_init_mm(&qdev->mman.bdev, TTM_PL_VRAM,
++ num_io_pages);
++ if (r) {
++ DRM_ERROR("Failed initializing VRAM heap.\n");
++ return r;
++ }
++ r = ttm_bo_init_mm(&qdev->mman.bdev, TTM_PL_PRIV0,
++ qdev->surfaceram_size / PAGE_SIZE);
++ if (r) {
++ DRM_ERROR("Failed initializing Surfaces heap.\n");
++ return r;
++ }
++ DRM_INFO("qxl: %uM of VRAM memory size\n",
++ (unsigned)qdev->vram_size / (1024 * 1024));
++ DRM_INFO("qxl: %luM of IO pages memory ready (VRAM domain)\n",
++ ((unsigned)num_io_pages * PAGE_SIZE) / (1024 * 1024));
++ if (unlikely(qdev->mman.bdev.dev_mapping == NULL))
++ qdev->mman.bdev.dev_mapping = qdev->ddev->dev_mapping;
++ r = qxl_ttm_debugfs_init(qdev);
++ if (r) {
++ DRM_ERROR("Failed to init debugfs\n");
++ return r;
++ }
++ return 0;
++}
++
++void qxl_ttm_fini(struct qxl_device *qdev)
++{
++ ttm_bo_clean_mm(&qdev->mman.bdev, TTM_PL_VRAM);
++ ttm_bo_clean_mm(&qdev->mman.bdev, TTM_PL_PRIV0);
++ ttm_bo_device_release(&qdev->mman.bdev);
++ qxl_ttm_global_fini(qdev);
++ DRM_INFO("qxl: ttm finalized\n");
++}
++
++
++#define QXL_DEBUGFS_MEM_TYPES 2
++
++#if defined(CONFIG_DEBUG_FS)
++static int qxl_mm_dump_table(struct seq_file *m, void *data)
++{
++ struct drm_info_node *node = (struct drm_info_node *)m->private;
++ struct drm_mm *mm = (struct drm_mm *)node->info_ent->data;
++ struct drm_device *dev = node->minor->dev;
++ struct qxl_device *rdev = dev->dev_private;
++ int ret;
++ struct ttm_bo_global *glob = rdev->mman.bdev.glob;
++
++ spin_lock(&glob->lru_lock);
++ ret = drm_mm_dump_table(m, mm);
++ spin_unlock(&glob->lru_lock);
++ return ret;
++}
++#endif
++
++static int qxl_ttm_debugfs_init(struct qxl_device *qdev)
++{
++ static struct drm_info_list qxl_mem_types_list[QXL_DEBUGFS_MEM_TYPES];
++ static char qxl_mem_types_names[QXL_DEBUGFS_MEM_TYPES][32];
++ unsigned i;
++
++ for (i = 0; i < QXL_DEBUGFS_MEM_TYPES; i++) {
++ if (i == 0)
++ sprintf(qxl_mem_types_names[i], "qxl_mem_mm");
++ else
++ sprintf(qxl_mem_types_names[i], "qxl_surf_mm");
++ qxl_mem_types_list[i].name = qxl_mem_types_names[i];
++ qxl_mem_types_list[i].show = &qxl_mm_dump_table;
++ qxl_mem_types_list[i].driver_features = 0;
++ if (i == 0)
++ qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv;
++ else
++ qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV0].priv;
++
++ }
++ return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i);
++}
+diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild
+index ba99ce3..a042a95 100644
+--- a/include/uapi/drm/Kbuild
++++ b/include/uapi/drm/Kbuild
+@@ -8,6 +8,7 @@ header-y += i810_drm.h
+ header-y += i915_drm.h
+ header-y += mga_drm.h
+ header-y += nouveau_drm.h
++header-y += qxl_drm.h
+ header-y += r128_drm.h
+ header-y += radeon_drm.h
+ header-y += savage_drm.h
+diff --git a/include/uapi/drm/qxl_drm.h b/include/uapi/drm/qxl_drm.h
+new file mode 100644
+index 0000000..ebebd36
+--- /dev/null
++++ b/include/uapi/drm/qxl_drm.h
+@@ -0,0 +1,152 @@
++/*
++ * Copyright 2013 Red Hat
++ * All Rights Reserved.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ * OTHER DEALINGS IN THE SOFTWARE.
++ */
++#ifndef QXL_DRM_H
++#define QXL_DRM_H
++
++#include <stddef.h>
++#include "drm/drm.h"
++
++/* Please note that modifications to all structs defined here are
++ * subject to backwards-compatibility constraints.
++ *
++ * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel
++ * compatibility Keep fields aligned to their size
++ */
++
++#define QXL_GEM_DOMAIN_CPU 0
++#define QXL_GEM_DOMAIN_VRAM 1
++#define QXL_GEM_DOMAIN_SURFACE 2
++
++#define DRM_QXL_ALLOC 0x00
++#define DRM_QXL_MAP 0x01
++#define DRM_QXL_EXECBUFFER 0x02
++#define DRM_QXL_UPDATE_AREA 0x03
++#define DRM_QXL_GETPARAM 0x04
++#define DRM_QXL_CLIENTCAP 0x05
++
++#define DRM_QXL_ALLOC_SURF 0x06
++
++struct drm_qxl_alloc {
++ uint32_t size;
++ uint32_t handle; /* 0 is an invalid handle */
++};
++
++struct drm_qxl_map {
++ uint64_t offset; /* use for mmap system call */
++ uint32_t handle;
++ uint32_t pad;
++};
++
++/*
++ * dest is the bo we are writing the relocation into
++ * src is bo we are relocating.
++ * *(dest_handle.base_addr + dest_offset) = physical_address(src_handle.addr +
++ * src_offset)
++ */
++#define QXL_RELOC_TYPE_BO 1
++#define QXL_RELOC_TYPE_SURF 2
++
++struct drm_qxl_reloc {
++ uint64_t src_offset; /* offset into src_handle or src buffer */
++ uint64_t dst_offset; /* offset in dest handle */
++ uint32_t src_handle; /* dest handle to compute address from */
++ uint32_t dst_handle; /* 0 if to command buffer */
++ uint32_t reloc_type;
++ uint32_t pad;
++};
++
++struct drm_qxl_command {
++ uint64_t __user command; /* void* */
++ uint64_t __user relocs; /* struct drm_qxl_reloc* */
++ uint32_t type;
++ uint32_t command_size;
++ uint32_t relocs_num;
++ uint32_t pad;
++};
++
++/* XXX: call it drm_qxl_commands? */
++struct drm_qxl_execbuffer {
++ uint32_t flags; /* for future use */
++ uint32_t commands_num;
++ uint64_t __user commands; /* struct drm_qxl_command* */
++};
++
++struct drm_qxl_update_area {
++ uint32_t handle;
++ uint32_t top;
++ uint32_t left;
++ uint32_t bottom;
++ uint32_t right;
++ uint32_t pad;
++};
++
++#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */
++#define QXL_PARAM_MAX_RELOCS 2
++struct drm_qxl_getparam {
++ uint64_t param;
++ uint64_t value;
++};
++
++/* these are one bit values */
++struct drm_qxl_clientcap {
++ uint32_t index;
++ uint32_t pad;
++};
++
++struct drm_qxl_alloc_surf {
++ uint32_t format;
++ uint32_t width;
++ uint32_t height;
++ int32_t stride;
++ uint32_t handle;
++ uint32_t pad;
++};
++
++#define DRM_IOCTL_QXL_ALLOC \
++ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC, struct drm_qxl_alloc)
++
++#define DRM_IOCTL_QXL_MAP \
++ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_MAP, struct drm_qxl_map)
++
++#define DRM_IOCTL_QXL_EXECBUFFER \
++ DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_EXECBUFFER,\
++ struct drm_qxl_execbuffer)
++
++#define DRM_IOCTL_QXL_UPDATE_AREA \
++ DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_UPDATE_AREA,\
++ struct drm_qxl_update_area)
++
++#define DRM_IOCTL_QXL_GETPARAM \
++ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_GETPARAM,\
++ struct drm_qxl_getparam)
++
++#define DRM_IOCTL_QXL_CLIENTCAP \
++ DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_CLIENTCAP,\
++ struct drm_qxl_clientcap)
++
++#define DRM_IOCTL_QXL_ALLOC_SURF \
++ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\
++ struct drm_qxl_alloc_surf)
++
++#endif
+--
+1.8.1.4
+
diff --git a/freed-ora/current/master/drm-ttm-exports-for-qxl.patch b/freed-ora/current/master/drm-ttm-exports-for-qxl.patch
new file mode 100644
index 000000000..6134b5119
--- /dev/null
+++ b/freed-ora/current/master/drm-ttm-exports-for-qxl.patch
@@ -0,0 +1,86 @@
+From b538d2921b8aaaa1d7abf1bf0ba3ab9330b0b0c8 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@gmail.com>
+Date: Tue, 22 Jan 2013 13:56:04 +1000
+Subject: [PATCH 1/2] ttm: export functions to allow qxl do its own iomapping
+
+qxl wants to use io mapping like i915 gem does, for now
+just export the symbols so the driver can implement atomic
+page maps using io mapping.
+
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+---
+ drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +++++++++----
+ include/drm/ttm/ttm_bo_driver.h | 4 ++++
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
+index 44420fc..aaf6f47 100644
+--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
++++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
+@@ -86,6 +86,7 @@ int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible)
+ mutex_lock(&man->io_reserve_mutex);
+ return 0;
+ }
++EXPORT_SYMBOL(ttm_mem_io_lock);
+
+ void ttm_mem_io_unlock(struct ttm_mem_type_manager *man)
+ {
+@@ -94,6 +95,7 @@ void ttm_mem_io_unlock(struct ttm_mem_type_manager *man)
+
+ mutex_unlock(&man->io_reserve_mutex);
+ }
++EXPORT_SYMBOL(ttm_mem_io_unlock);
+
+ static int ttm_mem_io_evict(struct ttm_mem_type_manager *man)
+ {
+@@ -111,8 +113,9 @@ static int ttm_mem_io_evict(struct ttm_mem_type_manager *man)
+ return 0;
+ }
+
+-static int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
+- struct ttm_mem_reg *mem)
++
++int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
++ struct ttm_mem_reg *mem)
+ {
+ struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
+ int ret = 0;
+@@ -134,9 +137,10 @@ retry:
+ }
+ return ret;
+ }
++EXPORT_SYMBOL(ttm_mem_io_reserve);
+
+-static void ttm_mem_io_free(struct ttm_bo_device *bdev,
+- struct ttm_mem_reg *mem)
++void ttm_mem_io_free(struct ttm_bo_device *bdev,
++ struct ttm_mem_reg *mem)
+ {
+ struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
+
+@@ -149,6 +153,7 @@ static void ttm_mem_io_free(struct ttm_bo_device *bdev,
+ bdev->driver->io_mem_free(bdev, mem);
+
+ }
++EXPORT_SYMBOL(ttm_mem_io_free);
+
+ int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo)
+ {
+diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
+index 0fbd046..9c8dca7 100644
+--- a/include/drm/ttm/ttm_bo_driver.h
++++ b/include/drm/ttm/ttm_bo_driver.h
+@@ -902,6 +902,10 @@ extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo);
+ * ttm_bo_util.c
+ */
+
++int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
++ struct ttm_mem_reg *mem);
++void ttm_mem_io_free(struct ttm_bo_device *bdev,
++ struct ttm_mem_reg *mem);
+ /**
+ * ttm_bo_move_ttm
+ *
+--
+1.8.1.4
+
diff --git a/freed-ora/current/master/fix-child-thread-introspection.patch b/freed-ora/current/master/fix-child-thread-introspection.patch
new file mode 100644
index 000000000..4c0bad1a6
--- /dev/null
+++ b/freed-ora/current/master/fix-child-thread-introspection.patch
@@ -0,0 +1,76 @@
+Allow threads other than the main thread to do introspection of files in
+proc without relying on read permissions. proc_pid_follow_link() calls
+proc_fd_access_allowed() which ultimately calls __ptrace_may_access().
+
+Though this allows additional access to some proc files, we do not
+believe that this has any unintended security implications. However it
+probably needs to be looked at carefully.
+
+The original problem was a thread of a process whose permissions were
+111 couldn't open its own /proc/self/exe This was interfering with a
+special purpose debugging tool. A simple reproducer is below.:
+
+#include <pthread.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+#define BUFSIZE 2048
+
+void *thread_main(void *arg){
+ char *str=(char*)arg;
+ char buf[BUFSIZE];
+ ssize_t len=readlink("/proc/self/exe", buf, BUFSIZE);
+ if(len==-1)
+ printf("/proc/self/exe in %s: %s\n", str,sys_errlist[errno]);
+ else
+ printf("/proc/self/exe in %s: OK\n", str);
+
+ return 0;
+}
+
+int main(){
+ pthread_t thread;
+
+ int retval=pthread_create( &thread, NULL, thread_main, "thread");
+ if(retval!=0)
+ exit(1);
+
+ thread_main("main");
+ pthread_join(thread, NULL);
+
+ exit(0);
+}
+
+Signed-off-by: Ben Woodard <woodard@redhat.com>
+Signed-off-by: Mark Grondona <mgrondona@llnl.gov>
+---
+ kernel/ptrace.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/ptrace.c b/kernel/ptrace.c
+index acbd284..347c4c7 100644
+--- a/kernel/ptrace.c
++++ b/kernel/ptrace.c
+diff -ruNp linux-3.8.4-103.fc17.noarch/kernel/ptrace.c linux-3.8.4-103.fc17.ptrace/kernel/ptrace.c
+--- linux-3.8.4-103.fc17.noarch/kernel/ptrace.c 2013-02-18 17:58:34.000000000 -0600
++++ linux-3.8.4-103.fc17.ptrace/kernel/ptrace.c 2013-03-26 14:59:01.939396346 -0500
+@@ -234,7 +234,7 @@ static int __ptrace_may_access(struct ta
+ */
+ int dumpable = 0;
+ /* Don't let security modules deny introspection */
+- if (task == current)
++ if (same_thread_group(task, current))
+ return 0;
+ rcu_read_lock();
+ tcred = __task_cred(task);
+--
+1.8.1.4
+
+--
+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/freed-ora/current/master/forcedeth-dma-error-check.patch b/freed-ora/current/master/forcedeth-dma-error-check.patch
new file mode 100644
index 000000000..0baee2a61
--- /dev/null
+++ b/freed-ora/current/master/forcedeth-dma-error-check.patch
@@ -0,0 +1,132 @@
+This backtrace was recently reported on a 3.9 kernel:
+
+Actual results: from syslog /var/log/messsages:
+kernel: [17539.340285] ------------[ cut here ]------------
+kernel: [17539.341012] WARNING: at lib/dma-debug.c:937 check_unmap+0x493/0x960()
+kernel: [17539.341012] Hardware name: MS-7125
+kernel: [17539.341012] forcedeth 0000:00:0a.0: DMA-API: device driver failed to
+check map error[device address=0x0000000013c88000] [size=544 bytes] [mapped as
+page]
+kernel: [17539.341012] Modules linked in: fuse ebtable_nat ipt_MASQUERADE
+nf_conntrack_netbios_ns nf_conntrack_broadcast ip6table_nat nf_nat_ipv6
+ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat
+nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack
+nf_conntrack bnep bluetooth rfkill ebtable_filter ebtables ip6table_filter
+ip6_tables snd_hda_codec_hdmi snd_cmipci snd_mpu401_uart snd_hda_intel
+snd_intel8x0 snd_opl3_lib snd_ac97_codec gameport snd_hda_codec snd_rawmidi
+ac97_bus snd_hwdep snd_seq snd_seq_device snd_pcm snd_page_alloc snd_timer snd
+k8temp soundcore serio_raw i2c_nforce2 forcedeth ata_generic pata_acpi nouveau
+video mxm_wmi wmi i2c_algo_bit drm_kms_helper ttm drm i2c_core sata_sil pata_amd
+sata_nv uinput
+kernel: [17539.341012] Pid: 17340, comm: sshd Not tainted
+3.9.0-0.rc4.git0.1.fc19.i686.PAE #1
+kernel: [17539.341012] Call Trace:
+kernel: [17539.341012] [<c045573c>] warn_slowpath_common+0x6c/0xa0
+kernel: [17539.341012] [<c0701953>] ? check_unmap+0x493/0x960
+kernel: [17539.341012] [<c0701953>] ? check_unmap+0x493/0x960
+kernel: [17539.341012] [<c04557a3>] warn_slowpath_fmt+0x33/0x40
+kernel: [17539.341012] [<c0701953>] check_unmap+0x493/0x960
+kernel: [17539.341012] [<c049238f>] ? sched_clock_cpu+0xdf/0x150
+kernel: [17539.341012] [<c0701e87>] debug_dma_unmap_page+0x67/0x70
+kernel: [17539.341012] [<f7eae8f2>] nv_unmap_txskb.isra.32+0x92/0x100
+
+Its pretty plainly the result of an skb fragment getting unmapped without having
+its initial mapping operation checked for errors. This patch corrects that.
+
+Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
+CC: "David S. Miller" <davem@davemloft.net>
+---
+ drivers/net/ethernet/nvidia/forcedeth.c | 41 ++++++++++++++++++++++++++++++++-
+ 1 file changed, 40 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
+index b62262c..5ae1247 100644
+--- a/drivers/net/ethernet/nvidia/forcedeth.c
++++ b/drivers/net/ethernet/nvidia/forcedeth.c
+@@ -2200,6 +2200,7 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ struct ring_desc *start_tx;
+ struct ring_desc *prev_tx;
+ struct nv_skb_map *prev_tx_ctx;
++ struct nv_skb_map *tmp_tx_ctx = NULL, *start_tx_ctx = NULL;
+ unsigned long flags;
+
+ /* add fragments to entries count */
+@@ -2261,12 +2262,31 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ do {
+ prev_tx = put_tx;
+ prev_tx_ctx = np->put_tx_ctx;
++ if (!start_tx_ctx)
++ start_tx_ctx = tmp_tx_ctx = np->put_tx_ctx;
++
+ bcnt = (frag_size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : frag_size;
+ np->put_tx_ctx->dma = skb_frag_dma_map(
+ &np->pci_dev->dev,
+ frag, offset,
+ bcnt,
+ DMA_TO_DEVICE);
++ if (dma_mapping_error(&np->pci_dev->dev, np->put_tx_ctx->dma)) {
++
++ /* Unwind the mapped fragments */
++ do {
++ nv_unmap_txskb(np, start_tx_ctx);
++ if (unlikely(tmp_tx_ctx++ == np->last_tx_ctx))
++ tmp_tx_ctx = np->first_tx_ctx;
++ } while (tmp_tx_ctx != np->put_tx_ctx);
++ kfree_skb(skb);
++ np->put_tx_ctx = start_tx_ctx;
++ u64_stats_update_begin(&np->swstats_tx_syncp);
++ np->stat_tx_dropped++;
++ u64_stats_update_end(&np->swstats_tx_syncp);
++ return NETDEV_TX_OK;
++ }
++
+ np->put_tx_ctx->dma_len = bcnt;
+ np->put_tx_ctx->dma_single = 0;
+ put_tx->buf = cpu_to_le32(np->put_tx_ctx->dma);
+@@ -2327,7 +2347,8 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
+ struct ring_desc_ex *start_tx;
+ struct ring_desc_ex *prev_tx;
+ struct nv_skb_map *prev_tx_ctx;
+- struct nv_skb_map *start_tx_ctx;
++ struct nv_skb_map *start_tx_ctx = NULL;
++ struct nv_skb_map *tmp_tx_ctx = NULL;
+ unsigned long flags;
+
+ /* add fragments to entries count */
+@@ -2392,11 +2413,29 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
+ prev_tx = put_tx;
+ prev_tx_ctx = np->put_tx_ctx;
+ bcnt = (frag_size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : frag_size;
++ if (!start_tx_ctx)
++ start_tx_ctx = tmp_tx_ctx = np->put_tx_ctx;
+ np->put_tx_ctx->dma = skb_frag_dma_map(
+ &np->pci_dev->dev,
+ frag, offset,
+ bcnt,
+ DMA_TO_DEVICE);
++
++ if (dma_mapping_error(&np->pci_dev->dev, np->put_tx_ctx->dma)) {
++
++ /* Unwind the mapped fragments */
++ do {
++ nv_unmap_txskb(np, start_tx_ctx);
++ if (unlikely(tmp_tx_ctx++ == np->last_tx_ctx))
++ tmp_tx_ctx = np->first_tx_ctx;
++ } while (tmp_tx_ctx != np->put_tx_ctx);
++ kfree_skb(skb);
++ np->put_tx_ctx = start_tx_ctx;
++ u64_stats_update_begin(&np->swstats_tx_syncp);
++ np->stat_tx_dropped++;
++ u64_stats_update_end(&np->swstats_tx_syncp);
++ return NETDEV_TX_OK;
++ }
+ np->put_tx_ctx->dma_len = bcnt;
+ np->put_tx_ctx->dma_single = 0;
+ put_tx->bufhigh = cpu_to_le32(dma_high(np->put_tx_ctx->dma));
+--
+1.7.11.7
+
+--
+To unsubscribe from this list: send the line "unsubscribe netdev" 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/freed-ora/current/master/iwlegacy-add-flush-callback.patch b/freed-ora/current/master/iwlegacy-add-flush-callback.patch
deleted file mode 100644
index b8b656795..000000000
--- a/freed-ora/current/master/iwlegacy-add-flush-callback.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 70277f47b58b174a6b0b891dcd06ae5125afb73b Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka@redhat.com>
-Date: Thu, 20 Dec 2012 14:31:51 +0100
-Subject: [PATCH] iwlegacy: add flush callback
-
-Dump implementation of flush, which just wait until all TX queues
-become empty.
-
-Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
-Signed-off-by: John W. Linville <linville@tuxdriver.com>
----
- drivers/net/wireless/iwlegacy/3945-mac.c | 1 +
- drivers/net/wireless/iwlegacy/4965-mac.c | 1 +
- drivers/net/wireless/iwlegacy/common.c | 36 ++++++++++++++++++++++++++++++
- drivers/net/wireless/iwlegacy/common.h | 1 +
- 4 files changed, 39 insertions(+), 0 deletions(-)
-
-diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
-index d604b40..962400a 100644
---- a/drivers/net/wireless/iwlegacy/3945-mac.c
-+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
-@@ -3474,6 +3474,7 @@ struct ieee80211_ops il3945_mac_ops = {
- .sta_add = il3945_mac_sta_add,
- .sta_remove = il_mac_sta_remove,
- .tx_last_beacon = il_mac_tx_last_beacon,
-+ .flush = il_mac_flush,
- };
-
- static int
-diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
-index 6a86ed4..c40020c 100644
---- a/drivers/net/wireless/iwlegacy/4965-mac.c
-+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
-@@ -6308,6 +6308,7 @@ const struct ieee80211_ops il4965_mac_ops = {
- .sta_remove = il_mac_sta_remove,
- .channel_switch = il4965_mac_channel_switch,
- .tx_last_beacon = il_mac_tx_last_beacon,
-+ .flush = il_mac_flush,
- };
-
- static int
-diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
-index 7e16d10..56b8021 100644
---- a/drivers/net/wireless/iwlegacy/common.c
-+++ b/drivers/net/wireless/iwlegacy/common.c
-@@ -4707,6 +4707,42 @@ out:
- }
- EXPORT_SYMBOL(il_mac_change_interface);
-
-+void
-+il_mac_flush(struct ieee80211_hw *hw, bool drop)
-+{
-+ struct il_priv *il = hw->priv;
-+ unsigned long timeout = jiffies + msecs_to_jiffies(500);
-+ int i;
-+
-+ mutex_lock(&il->mutex);
-+ D_MAC80211("enter\n");
-+
-+ if (il->txq == NULL)
-+ goto out;
-+
-+ for (i = 0; i < il->hw_params.max_txq_num; i++) {
-+ struct il_queue *q;
-+
-+ if (i == il->cmd_queue)
-+ continue;
-+
-+ q = &il->txq[i].q;
-+ if (q->read_ptr == q->write_ptr)
-+ continue;
-+
-+ if (time_after(jiffies, timeout)) {
-+ IL_ERR("Failed to flush queue %d\n", q->id);
-+ break;
-+ }
-+
-+ msleep(20);
-+ }
-+out:
-+ D_MAC80211("leave\n");
-+ mutex_unlock(&il->mutex);
-+}
-+EXPORT_SYMBOL(il_mac_flush);
-+
- /*
- * On every watchdog tick we check (latest) time stamp. If it does not
- * change during timeout period and queue is not empty we reset firmware.
-diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
-index a9a569f..37fe553 100644
---- a/drivers/net/wireless/iwlegacy/common.h
-+++ b/drivers/net/wireless/iwlegacy/common.h
-@@ -1723,6 +1723,7 @@ void il_mac_remove_interface(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif);
- int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- enum nl80211_iftype newtype, bool newp2p);
-+void il_mac_flush(struct ieee80211_hw *hw, bool drop);
- int il_alloc_txq_mem(struct il_priv *il);
- void il_free_txq_mem(struct il_priv *il);
-
---
-1.7.7.6
-
diff --git a/freed-ora/current/master/iwlwifi-fix-freeing-uninitialized-pointer.patch b/freed-ora/current/master/iwlwifi-fix-freeing-uninitialized-pointer.patch
new file mode 100644
index 000000000..90e6b6f64
--- /dev/null
+++ b/freed-ora/current/master/iwlwifi-fix-freeing-uninitialized-pointer.patch
@@ -0,0 +1,51 @@
+If on iwl_dump_nic_event_log() error occurs before that function
+initialize buf, we process uninitiated pointer in
+iwl_dbgfs_log_event_read() and can hit "BUG at mm/slub.c:3409"
+
+Resolves:
+https://bugzilla.redhat.com/show_bug.cgi?id=951241
+
+Reported-by: ian.odette@eprize.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+---
+Patch is only compile tested, but I'm sure it fixes the problem.
+
+ drivers/net/wireless/iwlwifi/dvm/debugfs.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+index 7b8178b..cb6dd58 100644
+--- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
++++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+@@ -2237,15 +2237,15 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file,
+ size_t count, loff_t *ppos)
+ {
+ struct iwl_priv *priv = file->private_data;
+- char *buf;
+- int pos = 0;
+- ssize_t ret = -ENOMEM;
++ char *buf = NULL;
++ ssize_t ret;
+
+- ret = pos = iwl_dump_nic_event_log(priv, true, &buf, true);
+- if (buf) {
+- ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
+- kfree(buf);
+- }
++ ret = iwl_dump_nic_event_log(priv, true, &buf, true);
++ if (ret < 0)
++ goto err;
++ ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
++err:
++ kfree(buf);
+ return ret;
+ }
+
+--
+1.7.11.7
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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/freed-ora/current/master/kernel.spec b/freed-ora/current/master/kernel.spec
index 196e683ef..113805413 100644
--- a/freed-ora/current/master/kernel.spec
+++ b/freed-ora/current/master/kernel.spec
@@ -62,13 +62,13 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
-%global baserelease 2
+%global baserelease 1
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
# on top of -- for example, 3.1-rc7-git1 starts with a 3.0 base,
# which yields a base_sublevel of 0.
-%define base_sublevel 8
+%define base_sublevel 9
# librev starts empty, then 1, etc, as the linux-libre tarball
# changes. This is only used to determine which tarball to use.
@@ -78,9 +78,9 @@ Summary: The Linux kernel
%define basegnu -gnu%{?librev}
# To be inserted between "patch" and "-2.6.".
-#define stablelibre -3.8%{?stablegnux}
-#define rcrevlibre -3.8%{?rcrevgnux}
-#define gitrevlibre -3.8%{?gitrevgnux}
+#define stablelibre -3.9%{?stablegnux}
+#define rcrevlibre -3.9%{?rcrevgnux}
+#define gitrevlibre -3.9%{?gitrevgnux}
%if 0%{?stablelibre:1}
%define stablegnu -gnu%{?librev}
@@ -131,7 +131,7 @@ 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 8
# The git snapshot level
%define gitrev 0
# Set rpm version accordingly
@@ -172,12 +172,10 @@ Summary: The Linux kernel
%define with_bootwrapper %{?_without_bootwrapper: 0} %{?!_without_bootwrapper: 1}
# Want to build a the vsdo directories installed
%define with_vdso_install %{?_without_vdso_install: 0} %{?!_without_vdso_install: 1}
-# ARM OMAP (Beagle/Panda Board)
-%define with_omap %{?_without_omap: 0} %{?!_without_omap: 1}
+# ARM Cortex-A15 support with LPAE and HW Virtualisation
+%define with_lpae %{?_without_lpae: 0} %{?!_without_lpae: 1}
# kernel-tegra (only valid for arm)
%define with_tegra %{?_without_tegra: 0} %{?!_without_tegra: 1}
-# kernel-kirkwood (only valid for arm)
-%define with_kirkwood %{?_without_kirkwood: 0} %{?!_without_kirkwood: 1}
#
# Additional options for user-friendly one-off kernel building:
#
@@ -292,17 +290,12 @@ Summary: The Linux kernel
%define with_pae 0
%endif
-# kernel up (unified kernel target), tegra and omap are only built on armv7 hfp/sfp
-%ifnarch armv7hl armv7l
-%define with_omap 0
+# kernel up (unified kernel target), unified LPAE, tegra are only built on armv7 hfp
+%ifnarch armv7hl
+%define with_lpae 0
%define with_tegra 0
%endif
-# kernel-kirkwood is only built for armv5
-%ifnarch armv5tel
-%define with_kirkwood 0
-%endif
-
# if requested, only build base kernel
%if %{with_baseonly}
%define with_smp 0
@@ -436,10 +429,7 @@ Summary: The Linux kernel
%define kernel_image arch/arm/boot/zImage
# we only build headers/perf/tools on the base arm arches
# just like we used to only build them on i386 for x86
-%ifarch armv5tel
-%define with_up 0
-%endif
-%ifnarch armv5tel armv7hl
+%ifnarch armv7hl
%define with_headers 0
%define with_perf 0
%define with_tools 0
@@ -530,6 +520,14 @@ Provides: kernel-modeset = 1\
Provides: kernel-libre-modeset = 1\
Provides: kernel-uname-r = %{KVERREL}%{?1:.%{1}}\
Provides: kernel-libre-uname-r = %{KVERREL}%{?1:.%{1}}\
+Provides: kernel-highbank\
+Provides: kernel-libre-highbank\
+Provides: kernel-highbank-uname-r = %{KVERREL}%{?1:.%{1}}\
+Provides: kernel-libre-highbank-uname-r = %{KVERREL}%{?1:.%{1}}\
+Provides: kernel-omap\
+Provides: kernel-libre-nomap\
+Provides: kernel-omap-uname-r = %{KVERREL}%{?1:.%{1}}\
+Provides: kernel-libre-omap-uname-r = %{KVERREL}%{?1:.%{1}}\
Requires(pre): %{kernel_prereq}\
Requires(pre): %{initrd_prereq}\
%if %{with_firmware}\
@@ -566,9 +564,9 @@ ExclusiveOS: Linux
# List the packages used during the kernel build
#
BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
-BuildRequires: bzip2, xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
+BuildRequires: bzip2, xz, findutils, gzip, m4, perl, perl-Carp, make >= 3.78, diffutils, gawk
BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config, hmaccalc
-BuildRequires: net-tools, hostname
+BuildRequires: net-tools, hostname, bc
BuildRequires: xmlto, asciidoc
%if %{with_sparse}
BuildRequires: sparse >= 0.4.1
@@ -634,13 +632,10 @@ Source54: config-powerpc64p7
Source70: config-s390x
# Unified ARM kernels
-Source100: config-armv7
-
-# Legacy ARM kernels
-Source105: config-arm-generic
-Source110: config-arm-omap
-Source111: config-arm-tegra
-Source112: config-arm-kirkwood
+Source100: config-armv7-generic
+Source101: config-armv7
+Source102: config-armv7-lpae
+Source103: config-armv7-tegra
# This file is intentionally left empty in the stock kernel. Its a nicety
# added for those wanting to do custom rebuilds with altered config opts.
@@ -705,9 +700,11 @@ Patch100: taint-vbox.patch
Patch110: vmbugon-warnon.patch
+Patch200: debug-bad-pte-dmi.patch
+Patch201: debug-bad-pte-modules.patch
+
Patch390: defaults-acpi-video.patch
Patch391: acpi-video-dos.patch
-Patch394: acpi-debug-infinite-loop.patch
Patch396: acpi-sony-nonvs-blacklist.patch
Patch450: input-kill-stupid-messages.patch
@@ -718,23 +715,22 @@ Patch460: serial-460800.patch
Patch470: die-floppy-die.patch
Patch510: silence-noise.patch
-Patch520: quiet-apm.patch
Patch530: silence-fbcon-logo.patch
-Patch540: silence-empty-ipi-mask-warning.patch
Patch800: crash-driver.patch
# crypto/
# secure boot
-Patch1000: devel-pekey-secure-boot-20130219.patch
+Patch1000: devel-pekey-secure-boot-20130306.patch
# virt + ksm patches
# DRM
#atch1700: drm-edid-try-harder-to-fix-up-broken-headers.patch
#Patch1800: drm-vgem.patch
-
+Patch1700: drm-ttm-exports-for-qxl.patch
+Patch1701: drm-qxl-driver.patch
# nouveau + drm fixes
# intel drm is all merged upstream
Patch1824: drm-intel-next.patch
@@ -758,8 +754,6 @@ Patch10000: fs-proc-devtree-remove_proc_entry.patch
Patch12016: disable-i8042-check-on-apple-mac.patch
-Patch12303: dmar-disable-when-ricoh-multifunction.patch
-
Patch13003: efi-dont-map-boot-services-on-32bit.patch
Patch14000: hibernate-freeze-filesystems.patch
@@ -769,16 +763,18 @@ Patch14010: lis3-improve-handling-of-null-rate.patch
# ARM
Patch21000: arm-export-read_current_timer.patch
-Patch21001: arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch
+# https://lists.ozlabs.org/pipermail/devicetree-discuss/2013-March/029029.html
+Patch21001: arm-of-dma.patch
-# IMX
-Patch21003: arm-imx-fixdrm.patch
+# lpae
+Patch21002: arm-lpae-ax88796.patch
+
+# ARM omap
+Patch21003: arm-omap-ehci-fix.patch
# ARM tegra
-Patch21004: arm-tegra-nvec-kconfig.patch
Patch21005: arm-tegra-usb-no-reset-linux33.patch
-
-# versatile
+Patch21006: arm-tegra-fixclk.patch
#rhbz 754518
Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
@@ -786,37 +782,41 @@ Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
#rhbz 859485
Patch21226: vt-Drop-K_OFF-for-VC_MUTE.patch
-#rhbz 799564
-Patch21240: Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch
-Patch21241: Input-add-support-for-Cypress-PS2-Trackpads.patch
-
# https://fedoraproject.org/wiki/Features/Checkpoint_Restore
Patch21242: criu-no-expert.patch
-#rhbz 830151
-Patch21243: mac80211-improve-latency-and-throughput-while-software.patch
-Patch21244: iwlegacy-add-flush-callback.patch
-
#rhbz 892811
Patch21247: ath9k_rx_dma_stop_check.patch
-#rhbz 910126
-Patch21249: pstore-Create-a-convenient-mount-point-for-pstore.patch
-
-#rhbz 844750
-Patch21250: 0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch
+#rhbz 903192
+Patch21261: 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch
-#rhbz 909591
-Patch21255: usb-cypress-supertop.patch
+#rhbz 856863 892599
+Patch21273: cfg80211-mac80211-disconnect-on-suspend.patch
+Patch21274: mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch
-#rhbz 812111
-Patch21260: alps-v2.patch
+#rhbz 859282
+Patch21275: VMX-x86-handle-host-TSC-calibration-failure.patch
Patch22000: weird-root-dentry-name-debug.patch
#selinux ptrace child permissions
Patch22001: selinux-apply-different-permission-to-ptrace-child.patch
+#rhbz 927469
+Patch23006: fix-child-thread-introspection.patch
+
+#rhbz 928024
+Patch23008: forcedeth-dma-error-check.patch
+
+#rhbz 919176
+Patch25010: wireless-regulatory-fix-channel-disabling-race-condition.patch
+
+#rhbz 951241
+Patch25011: iwlwifi-fix-freeing-uninitialized-pointer.patch
+
+Patch25014: blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -987,7 +987,7 @@ This package provides debug information for package kernel-libre-tools.
# symlinks because of the trailing nonmatching alternation and
# the leading .*, because of find-debuginfo.sh's buggy handling
# of matching the pattern against the symlinks file.
-%{expand:%%global debuginfo_args %{?debuginfo_args} -p '.*%%{_bindir}/centrino-decode(\.debug)?|.*%%{_bindir}/powernow-k8-decode(\.debug)?|.*%%{_bindir}/cpupower(\.debug)?|.*%%{_libdir}/libcpupower.*|XXX' -o kernel-tools-debuginfo.list}
+%{expand:%%global debuginfo_args %{?debuginfo_args} -p '.*%%{_bindir}/centrino-decode(\.debug)?|.*%%{_bindir}/powernow-k8-decode(\.debug)?|.*%%{_bindir}/cpupower(\.debug)?|.*%%{_libdir}/libcpupower.*|.*%%{_bindir}/turbostat(\.debug)?|.*%%{_bindir}/x86_energy_perf_policy(\.debug)?|XXX' -o kernel-tools-debuginfo.list}
%endif # with_tools
@@ -1140,17 +1140,11 @@ on kernel bugs, as some of these options impact performance noticably.
The kernel-libre-debug package is the upstream kernel without the
non-Free blobs it includes by default.
-%define variant_summary The Linux kernel compiled for marvell kirkwood boards
-%kernel_variant_package kirkwood
-%description kirkwood
+%define variant_summary The Linux kernel compiled for Cortex-A15
+%kernel_variant_package lpae
+%description lpae
This package includes a version of the Linux kernel with support for
-marvell kirkwood based systems, i.e., guruplug, sheevaplug
-
-%define variant_summary The Linux kernel compiled for TI-OMAP boards
-%kernel_variant_package omap
-%description omap
-This package includes a version of the Linux kernel with support for
-TI-OMAP based systems, i.e., BeagleBoard-xM.
+Cortex-A15 devices with LPAE and HW virtualisation support
%define variant_summary The Linux kernel compiled for tegra boards
%kernel_variant_package tegra
@@ -1432,6 +1426,9 @@ ApplyPatch taint-vbox.patch
ApplyPatch vmbugon-warnon.patch
+ApplyPatch debug-bad-pte-dmi.patch
+ApplyPatch debug-bad-pte-modules.patch
+
# Architecture patches
# x86(-64)
@@ -1439,10 +1436,11 @@ ApplyPatch vmbugon-warnon.patch
# ARM
#
ApplyPatch arm-export-read_current_timer.patch
-ApplyPatch arm-allnoconfig-error-__LINUX_ARM_ARCH__-undeclared.patch
-# ApplyPatch arm-tegra-nvec-kconfig.patch
+ApplyPatch arm-of-dma.patch
+ApplyPatch arm-lpae-ax88796.patch
+ApplyPatch arm-omap-ehci-fix.patch
ApplyPatch arm-tegra-usb-no-reset-linux33.patch
-ApplyPatch arm-imx-fixdrm.patch
+ApplyPatch arm-tegra-fixclk.patch
#
# bugfixes to drivers and filesystems
@@ -1465,7 +1463,6 @@ ApplyPatch arm-imx-fixdrm.patch
# ACPI
ApplyPatch defaults-acpi-video.patch
ApplyPatch acpi-video-dos.patch
-ApplyPatch acpi-debug-infinite-loop.patch
ApplyPatch acpi-sony-nonvs-blacklist.patch
#
@@ -1500,9 +1497,6 @@ ApplyPatch silence-noise.patch
# Make fbcon not show the penguins with 'quiet'
ApplyPatch silence-fbcon-logo.patch
-# no-one cares about these warnings.
-ApplyPatch silence-empty-ipi-mask-warning.patch
-
# Changes to upstream defaults.
@@ -1512,11 +1506,13 @@ ApplyPatch crash-driver.patch
# crypto/
# secure boot
-ApplyPatch devel-pekey-secure-boot-20130219.patch
+ApplyPatch devel-pekey-secure-boot-20130306.patch
# Assorted Virt Fixes
# DRM core
+ApplyPatch drm-ttm-exports-for-qxl.patch
+ApplyPatch drm-qxl-driver.patch
#ApplyPatch drm-edid-try-harder-to-fix-up-broken-headers.patch
#ApplyPatch drm-vgem.patch
@@ -1528,7 +1524,6 @@ ApplyPatch drm-i915-dp-stfu.patch
# silence the ACPI blacklist code
ApplyPatch silence-acpi-blacklist.patch
-ApplyPatch quiet-apm.patch
# V4L/DVB updates/fixes/experimental drivers
# apply if non-empty
@@ -1541,9 +1536,6 @@ ApplyPatch fs-proc-devtree-remove_proc_entry.patch
ApplyPatch disable-i8042-check-on-apple-mac.patch
-# rhbz#605888
-ApplyPatch dmar-disable-when-ricoh-multifunction.patch
-
ApplyPatch efi-dont-map-boot-services-on-32bit.patch
# FIXME: REBASE
@@ -1562,31 +1554,35 @@ ApplyPatch selinux-apply-different-permission-to-ptrace-child.patch
#rhbz 859485
ApplyPatch vt-Drop-K_OFF-for-VC_MUTE.patch
-#rhbz 799564
-ApplyPatch Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch
-ApplyPatch Input-add-support-for-Cypress-PS2-Trackpads.patch
-
# https://fedoraproject.org/wiki/Features/Checkpoint_Restore
ApplyPatch criu-no-expert.patch
-#rhbz 830151
-ApplyPatch mac80211-improve-latency-and-throughput-while-software.patch
-ApplyPatch iwlegacy-add-flush-callback.patch
-
#rhbz 892811
ApplyPatch ath9k_rx_dma_stop_check.patch
-#rhbz 910126
-ApplyPatch pstore-Create-a-convenient-mount-point-for-pstore.patch
+#rhbz 903192
+ApplyPatch 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch
+
+#rhbz 856863 892599
+ApplyPatch cfg80211-mac80211-disconnect-on-suspend.patch
+ApplyPatch mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch
+
+#rhbz 859282
+ApplyPatch VMX-x86-handle-host-TSC-calibration-failure.patch
+
+#rhbz 927469
+ApplyPatch fix-child-thread-introspection.patch
-#rhbz 909591
-ApplyPatch usb-cypress-supertop.patch
+#rhbz 928024
+ApplyPatch forcedeth-dma-error-check.patch
-#rhbz 844750
-ApplyPatch 0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch
+#rhbz 919176
+ApplyPatch wireless-regulatory-fix-channel-disabling-race-condition.patch
-#rhbz 812111
-ApplyPatch alps-v2.patch
+#rhbz 951241
+ApplyPatch iwlwifi-fix-freeing-uninitialized-pointer.patch
+
+ApplyPatch blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch
# END OF PATCH APPLICATIONS
@@ -1604,13 +1600,6 @@ touch .scmversion
mkdir configs
-# Remove configs not for the buildarch
-for cfg in kernel-%{version}-*.config; do
- if [ `echo %{all_arch_configs} | grep -c $cfg` -eq 0 ]; then
- rm -f $cfg
- fi
-done
-
%if !%{debugbuildsenabled}
rm -f kernel-%{version}-*debug.config
%endif
@@ -1728,6 +1717,7 @@ BuildKernel() {
make -s ARCH=$Arch V=1 dtbs
mkdir -p $RPM_BUILD_ROOT/%{image_install_path}/dtb-$KernelVer
install -m 644 arch/arm/boot/dts/*.dtb $RPM_BUILD_ROOT/boot/dtb-$KernelVer/
+ rm -f arch/arm/boot/dts/*.dtb
%else
make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags}
%endif
@@ -1866,9 +1856,9 @@ BuildKernel() {
}
collect_modules_list networking \
- 'register_netdev|ieee80211_register_hw|usbnet_probe|phy_driver_register|rt(l_|2x00)(pci|usb)_probe'
+ 'register_netdev|ieee80211_register_hw|usbnet_probe|phy_driver_register|rt(l_|2x00)(pci|usb)_probe|register_netdevice'
collect_modules_list block \
- 'ata_scsi_ioctl|scsi_add_host|scsi_add_host_with_dma|blk_init_queue|register_mtd_blktrans|scsi_esp_register|scsi_register_device_handler'
+ 'ata_scsi_ioctl|scsi_add_host|scsi_add_host_with_dma|blk_init_queue|register_mtd_blktrans|scsi_esp_register|scsi_register_device_handler|blk_queue_physical_block_size'
collect_modules_list drm \
'drm_open|drm_init'
collect_modules_list modesetting \
@@ -1940,12 +1930,8 @@ BuildKernel %make_target %kernel_image PAEdebug
BuildKernel %make_target %kernel_image PAE
%endif
-%if %{with_kirkwood}
-BuildKernel %make_target %kernel_image kirkwood
-%endif
-
-%if %{with_omap}
-BuildKernel %make_target %kernel_image omap
+%if %{with_lpae}
+BuildKernel %make_target %kernel_image lpae
%endif
%if %{with_tegra}
@@ -1961,7 +1947,7 @@ BuildKernel %make_target %kernel_image smp
%endif
%global perf_make \
- make %{?_smp_mflags} -C tools/perf -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix}
+ make %{?_smp_mflags} -C tools/perf -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix}
%if %{with_perf}
# perf
%{perf_make} all
@@ -2016,26 +2002,18 @@ find Documentation -type d | xargs chmod u+w
# that will strip the signature off of the modules.
%define __modsign_install_post \
- if [ "%{signmodules}" == "1" ]; then \
- if [ "%{with_pae}" != "0" ]; then \
- mv signing_key.priv.sign.PAE signing_key.priv \
- mv signing_key.x509.sign.PAE signing_key.x509 \
- %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAE/ \
+ if [ "%{signmodules}" -eq "1" ]; then \
+ if [ "%{with_pae}" -ne "0" ]; then \
+ %{modsign_cmd} signing_key.priv.sign.PAE signing_key.x509.sign.PAE $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAE/ \
fi \
- if [ "%{with_debug}" != "0" ]; then \
- mv signing_key.priv.sign.debug signing_key.priv \
- mv signing_key.x509.sign.debug signing_key.x509 \
- %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.debug/ \
+ if [ "%{with_debug}" -ne "0" ]; then \
+ %{modsign_cmd} signing_key.priv.sign.debug signing_key.x509.sign.debug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.debug/ \
fi \
- if [ "%{with_pae_debug}" != "0" ]; then \
- mv signing_key.priv.sign.PAEdebug signing_key.priv \
- mv signing_key.x509.sign.PAEdebug signing_key.x509 \
- %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAEdebug/ \
+ if [ "%{with_pae_debug}" -ne "0" ]; then \
+ %{modsign_cmd} signing_key.priv.sign.PAEdebug signing_key.x509.sign.PAEdebug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAEdebug/ \
fi \
- if [ "%{with_up}" != "0" ]; then \
- mv signing_key.priv.sign signing_key.priv \
- mv signing_key.x509.sign signing_key.x509 \
- %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \
+ if [ "%{with_up}" -ne "0" ]; then \
+ %{modsign_cmd} signing_key.priv.sign signing_key.x509.sign $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \
fi \
fi \
%{nil}
@@ -2278,11 +2256,8 @@ fi}\
%kernel_variant_post -v PAEdebug -r (kernel|kernel-smp)
%kernel_variant_preun PAEdebug
-%kernel_variant_preun kirkwood
-%kernel_variant_post -v kirkwood
-
-%kernel_variant_preun omap
-%kernel_variant_post -v omap
+%kernel_variant_preun lpae
+%kernel_variant_post -v lpae
%kernel_variant_preun tegra
%kernel_variant_post -v tegra
@@ -2437,16 +2412,15 @@ fi
%kernel_variant_files %{with_debug} debug
%kernel_variant_files %{with_pae} PAE
%kernel_variant_files %{with_pae_debug} PAEdebug
-%kernel_variant_files %{with_kirkwood} kirkwood
-%kernel_variant_files %{with_omap} omap
+%kernel_variant_files %{with_lpae} lpae
%kernel_variant_files %{with_tegra} tegra
# plz don't put in a version string unless you're going to tag
# and build.
# ___________________________________________________________
-# / This branch is for Fedora 19. You probably want to commit \
-# \ to the F-18 branch instead, or in addition to this one. /
+# / This branch is for Fedora 20. You probably want to commit \
+# \ to the F-19 branch instead, or in addition to this one. /
# -----------------------------------------------------------
# \ ^__^
# \ (@@)\_______
@@ -2454,6 +2428,342 @@ fi
# ||----w |
# || ||
%changelog
+* Mon Apr 29 2013 Alexandre Oliva <lxoliva@fsfla.org> -libre
+- GNU Linux-libre 3.9-gnu.
+
+* Mon Apr 29 2013 Josh Boyer <jwboyer@redhat.com>
+- Linux v3.9
+
+* Fri Apr 26 2013 Josh Boyer <jwboyer@redhat.com>
+- Add patch to prevent scheduling while atomic error in blkcg
+
+* Wed Apr 24 2013 Josh Boyer <jwboyer@redhat.com>
+- Add patch to fix EFI boot on Macs (rhbz 953447)
+
+* Mon Apr 22 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc8.git0.1
+- Linux v3.9-rc8
+- Disable debugging options.
+
+* Mon Apr 22 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Minor ARM updates
+
+* Fri Apr 19 2013 Josh Boyer <jwboyer@redhat.com>
+- Add patch to fix RCU splat from perf events
+
+* Fri Apr 19 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Temporaily disable cpu idle on ARM as it appears to be causing stability issues
+
+* Fri Apr 19 2013 Josh Boyer <jwboyer@redhat.com>
+- Disable Intel HDA and enable RSXX block dev on ppc64/ppc64p7
+
+* Thu Apr 18 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc7.git3.1
+- Linux v3.9-rc7-70-gd202f05
+
+* Wed Apr 17 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc7.git2.1
+- Linux v3.9-rc7-24-g542a672
+
+* Wed Apr 17 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Minor ARM config updates
+- Add patch for DT DMA issues that affect at least highbank/tegra ARM devices
+
+* Tue Apr 16 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc7.git1.1
+- Linux v3.9-rc7-4-gbb33db7
+- Reenable debugging options.
+
+* Tue Apr 16 2013 Josh Boyer <jwboyer@redhat.com>
+- Fix uninitialized variable free in iwlwifi (rhbz 951241)
+- Fix race in regulatory code (rhbz 919176)
+
+* Mon Apr 15 2013 Josh Boyer <jwboyer@redhat.com>
+- Fix debug patches to build on s390x/ppc
+
+* Mon Apr 15 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc7.git0.1
+- Linux v3.9-rc7
+- Disable debugging options.
+
+* Fri Apr 12 2013 Josh Boyer <jwboyer@redhat.com>
+- Enable CONFIG_LDM_PARTITION (rhbz 948636)
+
+* Fri Apr 12 2013 Justin M. Forbes <jforbes@redhat.com>
+- Fix forcedeth DMA check error (rhbz 928024)
+
+* Thu Apr 11 2013 Dave Jones <davej@redhat.com>
+- Print out some extra debug information when we hit bad page tables.
+
+* Thu Apr 11 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc6.git2.1
+- Linux v3.9-rc6-115-g7ee32a6
+- libsas: use right function to alloc smp response (rhbz 949875)
+
+* Tue Apr 09 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc6.git1.1
+- Linux v3.9-rc6-36-ge8f2b54
+- Reenable debugging options.
+
+* Tue Apr 9 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Add patch to fix building some ARM tegra modules
+- Some minor ARM OMAP updates
+
+* Mon Apr 08 2013 Neil Horman <nhorman@redhat.com>
+- Fix dma unmap error in e100 (rhbz 907694)
+
+* Mon Apr 08 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc6.git0.1
+- Disable debugging options.
+- Linux-3.9-rc6
+
+* Thu Apr 04 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc5.git3.1
+- Linux v3.9-rc5-183-g22d1e6f
+
+* Wed Apr 03 2013 Dave Jones <davej@redhat.com>
+- Enable MTD_CHAR/MTD_BLOCK (Needed for SFC)
+ Enable 10gigE on 64-bit only.
+
+* Wed Apr 03 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc5.git2.1
+- Linux v3.9-rc5-146-gda241ef
+
+* Wed Apr 3 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Add upstream usb-next OMAP patch to fix usb on omap/mvebu
+
+* Tue Apr 02 2013 Josh Boyer <jwboyer@redhat.com>
+- Enable CONFIG_FB_MATROX_G on powerpc
+
+* Tue Apr 02 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc5.git1.1
+- Linux v3.9-rc5-108-g118c9a4
+- Reenable debugging options.
+
+* Tue Apr 02 2013 Josh Boyer <jwboyer@redhat.com>
+- Enable CONFIG_SCSI_DMX3191D (rhbz 919874)
+
+* Mon Apr 01 2013 Josh Boyer <jwboyer@redhat.com>
+- Enable CONFIG_MCE_INJECT (rhbz 927353)
+
+* Mon Apr 01 2013 Justin M. Forbes <jforbes@redhat.com> - 3.9.0-0.rc5.git0.1
+- Disable debugging options.
+- Linux v3.9-rc5
+- fix htmldoc build for 8250 rename. Patch from Kyle McMartin
+
+* Mon Apr 1 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Minor ARM LPAE updates
+
+* Sun Mar 31 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Make tegra inherit armv7-generic, fix and re-enable tegra
+- Enable SPI on ARM
+- Drop config-arm-generic
+- ARM config updates
+
+* Thu Mar 28 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Update ARM unified config for OMAP
+
+* Tue Mar 26 2013 Justin M. Forbes <jforbes@redhat.com>
+- Fix child thread introspection of of /proc/self/exe (rhbz 927469)
+
+* Tue Mar 26 2013 Dave Jones <davej@redhat.com>
+- Enable CONFIG_DM_CACHE (rhbz 924325)
+
+* Tue Mar 26 2013 Josh Boyer <jwboyer@redhat.com>
+- Add quirk for Realtek card reader to avoid 10 sec boot delay (rhbz 806587)
+- Add quirk for MSI keyboard backlight to avoid 10 sec boot delay (rhbz 907221)
+
+* Mon Mar 25 2013 Justin M. Forbes <jforbes@redhat.com>
+- disable whci-hcd since it doesnt seem to have users (rhbz 919289)
+
+* Sun Mar 24 2013 Dave Jones <davej@redhat.com> -3.9.0-0.rc4.git0.1
+- Linux 3.9-rc4
+ merged: drm-i915-bounds-check-execbuffer-relocation-count.patch
+
+* Sun Mar 24 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Update ARM config for OMAP/mvebu/lpae
+
+* Fri Mar 22 2013 Dave Jones <davej@redhat.com>
+- Fix calculation of current frequency in intel_pstate driver. (rhbz 923942)
+- Add missing build-req for perl-Carp
+
+* Thu Mar 21 2013 Josh Boyer <jwboyer@redhat.com>
+- Fix workqueue crash in mac80211 (rhbz 920218)
+
+* Thu Mar 21 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc3.git1.1
+- Linux v3.9-rc3-148-g2ffdd7e
+- Fixes CVE-2013-1796, CVE-2013-1797, CVE-2013-1798 in kvm.
+
+* Wed Mar 20 2013 Dave Jones <davej@redhat.com>
+- Enable CONFIG_DM_DELAY (rhbz 923721)
+
+* Tue Mar 19 2013 Dave Jones <davej@redhat.com> - 3.9.0-0.rc3.git0.5
+- Reenable debugging options.
+
+* Tue Mar 19 2013 Dave Jones <davej@redhat.com>
+- cpufreq/intel_pstate: Add function to check that all MSR's are valid (rhbz 922923)
+
+* Mon Mar 18 2013 Dave Jones <davej@redhat.com> - 3.9.0-0.rc3.git0.4
+- s390x config option changes from Dan HorĂ¡k <dan@danny.cz>
+ - enable PCI
+ - disable few useless drivers
+ - disable drivers conflicting with s390x
+
+* Mon Mar 18 2013 Dave Jones <davej@redhat.com> - 3.9.0-0.rc3.git0.3
+- Linux v3.9-rc3
+ merged: w1-fix-oops-when-w1_search-is-called-from.patch
+- Disable debugging options.
+
+* Sun Mar 17 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Merge OMAP support into ARM unified kernel
+- Add ARM LPAE kernel for Cortex A-15 devices that support LPAE and HW virtualisation
+- Unified ARM kernel provides highbank and OMAP support
+- Drop remantents of ARM softfp kernels
+
+* Fri Mar 15 2013 Josh Boyer <jwboyer@redhat.com>
+- Fix divide by zero on host TSC calibration failure (rhbz 859282)
+
+* Fri Mar 15 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc2.git1.1
+- Linux v3.9-rc2-292-ga2362d2
+- Fixes CVE-2013-1860 kernel: usb: cdc-wdm buffer overflow triggered by device
+
+* Thu Mar 14 2013 Dave Jones <davej@redhat.com>
+- Move cpufreq drivers to be modular (rhbz 746372)
+
+* Wed Mar 13 2013 Dave Jones <davej@redhat.com> - 3.9.0-0.rc2.git0.3
+- Reenable debugging options.
+
+* Tue Mar 12 2013 Josh Boyer <jwboyer@redhat.com>
+- Add patch to fix ieee80211_do_stop (rhbz 892599)
+- Add patches to fix cfg80211 issues with suspend (rhbz 856863)
+- CVE-2013-0913 drm/i915: head writing overflow (rhbz 920471 920529)
+- CVE-2013-0914 sa_restorer information leak (rhbz 920499 920510)
+
+* Tue Mar 12 2013 Dave Airlie <airlied@redhat.com>
+- add QXL driver (f19 only)
+
+* Mon Mar 11 2013 Dave Jones <davej@redhat.com> - 3.9.0-0.rc2.git0.2
+- Disable debugging options.
+
+* Mon Mar 11 2013 Dave Jones <davej@redhat.com>
+- Linux 3.9-rc2
+
+* Mon Mar 11 2013 Josh Boyer <jwboyer@redhat.com>
+- Add patch to allow "8250." prefix to keep working (rhbz 911771)
+- Add patch to fix w1_search oops (rhbz 857954)
+
+* Sun Mar 10 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc1.git2.1
+- Linux v3.9-rc1-278-g8343bce
+
+* Sun Mar 10 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Enable Xilinx Zynq
+- Enable highbank cpufreq driver
+
+* Fri Mar 08 2013 Josh Boyer <jwboyer@redhat.com>
+- Add turbostat and x86_engery_perf_policy debuginfo to kernel-tools-debuginfo
+
+* Fri Mar 08 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc1.git1.1
+- Linux v3.9-rc1-211-g47b3bc9
+- Reenable debugging options.
+- CVE-2013-1828 sctp: SCTP_GET_ASSOC_STATS stack buffer overflow (rhbz 919315 919316)
+
+* Thu Mar 07 2013 Josh Boyer <jwboyer@redhat.com>
+- CVE-2013-1792 keys: race condition in install_user_keyrings (rhbz 916646 919021)
+
+* Wed Mar 06 2013 Josh Boyer <jwboyer@redhat.com>
+- Adjust secure-boot patchset to work with boot_params sanitizing
+- Don't clear efi_info in boot_params (rhbz 918408)
+
+* Wed Mar 06 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Update ARM mvebu config
+
+* Wed Mar 06 2013 Dave Jones <davej@redhat.com>
+- drop acpi debugging patch.
+
+* Wed Mar 06 2013 Justin M. Forbes <jforbes@redhat.com>
+- Remove Ricoh multifunction DMAR patch as it's no longer needed (rhbz 880051)
+
+* Tue Mar 05 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc1.git0.3
+- Fix intel_pstate init error path (rhbz 916833)
+
+* Tue Mar 5 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Temporarily disable tegra until we get a fix from upstream
+
+* Tue Mar 05 2013 Josh Boyer <jwboyer@redhat.com>
+- Add 3 fixes for efi issues (rhbz 917984)
+- Enable CONFIG_IP6_NF_TARGET_MASQUERADE
+
+* Mon Mar 04 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc1.git0.1
+- Linux v3.9-rc1
+- Add patch from Dirk Brandewie to fix intel pstate divide error (rhbz 916833)
+- Disable debugging options.
+
+* Mon Mar 4 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Update vexpress and omap options (fix MMC on qemu, hopefully fix OMAP3)
+
+* Sun Mar 03 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git15.1
+- Linux v3.8-10734-ga7c1120
+
+* Fri Mar 01 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git14.1
+- Linux v3.8-10206-gb0af9cd
+
+* Fri Mar 01 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git13.1
+- Linux v3.8-9761-gde1a226
+
+* Thu Feb 28 2013 Kyle McMartin <kmcmarti@redhat.com>
+- Make iso9660 a module.
+
+* Thu Feb 28 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git12.1
+- Linux v3.8-9633-g2a7d2b9
+
+* Wed Feb 27 2013 Peter Robinson <pbrobinson@fedoraproject.org>
+- Drop ARM kirkwood kernel
+- Enable SPI on ARM
+- General 3.9 updates
+
+* Wed Feb 27 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git11.1
+- Linux v3.8-9456-g309667e
+
+* Wed Feb 27 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git10.1
+- Linux v3.8-9405-gd895cb1
+
+* Tue Feb 26 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git9.1
+- Linux v3.8-9165-g1cef935
+
+* Tue Feb 26 2013 Kyle McMartin <kmcmarti@redhat.com>
+- Move VMXNET3 to config-x86-generic from config-generic, it's VMware
+ virtual ethernet.
+
+* Tue Feb 26 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git8.1
+- Linux v3.8-8664-gc41b381
+
+* Tue Feb 26 2013 Kyle McMartin <kmcmarti@redhat.com>
+- Add blk_queue_physical_block_size and register_netdevice to the symbols
+ used for initrd generation (synched from .el6)
+- ipr.ko driven SAS VRAID cards found on x86_64 machines these days, and not
+ just on ppc64
+
+* Tue Feb 26 2013 Josh Boyer <jwboyer@redhat.com>
+- Fix vmalloc_fault oops during lazy MMU (rhbz 914737)
+
+* Mon Feb 25 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git7.1
+- Honor dmesg_restrict for /dev/kmsg (rhbz 903192)
+- Linux v3.8-7888-gab78265
+
+* Sun Feb 24 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git6.1
+- Linux v3.8-6988-g9e2d59a
+
+* Sun Feb 24 2013 Josh Boyer <jwboyer@redhat.com>
+- CVE-2013-1763 sock_diag: out-of-bounds access to sock_diag_handlers (rhbz 915052,915057)
+
+* Fri Feb 22 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git5.1
+- Linux v3.8-6071-g8b5628a
+
+* Fri Feb 22 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git4.1
+- Linux v3.8-6071-g8b5628a
+- Enable the rtl8192e driver (rhbz 913753)
+
+* Thu Feb 21 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git3.1
+- Linux v3.8-3195-g024e4ec
+- Shut up perf about missing build things we don't care about
+- Drop the old aic7xxx driver, from Paul Bolle
+
+* Thu Feb 21 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git2.1
+- Linux v3.8-3040-ga0b1c42
+
+* Thu Feb 21 2013 Josh Boyer <jwboyer@redhat.com> - 3.9.0-0.rc0.git1.1
+- Linux v3.8-523-gece8e0b
+- Reenable debugging options.
+
* Tue Feb 19 2013 Josh Boyer <jwboyer@redhat.com> - 3.8.0-2
- Add pekey support from David Howells and rework secure-boot patchset on top
- Add support for Atheros 04ca:3004 bluetooth devices (rhbz 844750)
diff --git a/freed-ora/current/master/linux-libre-3.8-gnu.tar.xz.sign b/freed-ora/current/master/linux-libre-3.8-gnu.tar.xz.sign
deleted file mode 100644
index 753ef9cf1..000000000
--- a/freed-ora/current/master/linux-libre-3.8-gnu.tar.xz.sign
+++ /dev/null
@@ -1,7 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.19 (GNU/Linux)
-
-iEYEABECAAYFAlEjLMYACgkQvLfPh359R6ffmgCcDZpvPTimpapmVA+xdWhvxMK5
-voMAoKEyhPHcSLaQ4i9EkBCFP7Sx4bbG
-=DHJB
------END PGP SIGNATURE-----
diff --git a/freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xz b/freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xz
deleted file mode 100644
index aeef10085..000000000
--- a/freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xz
+++ /dev/null
Binary files differ
diff --git a/freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xz.sign b/freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xz.sign
deleted file mode 100644
index 31a3959c5..000000000
--- a/freed-ora/current/master/linux-libre-3.8-gnu.xdelta.xz.sign
+++ /dev/null
@@ -1,7 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.19 (GNU/Linux)
-
-iEYEABECAAYFAlEjLMgACgkQvLfPh359R6eF0gCfco+hIPIuv0P6gUm6GyIYWCHe
-IzQAnjz7Wk0CjItrSdKNHok5oy6WgII6
-=AjHg
------END PGP SIGNATURE-----
diff --git a/freed-ora/current/master/linux-libre-3.9-gnu.tar.xz.sign b/freed-ora/current/master/linux-libre-3.9-gnu.tar.xz.sign
new file mode 100644
index 000000000..66420e941
--- /dev/null
+++ b/freed-ora/current/master/linux-libre-3.9-gnu.tar.xz.sign
@@ -0,0 +1,7 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.19 (GNU/Linux)
+
+iEYEABECAAYFAlF96RIACgkQvLfPh359R6eCvQCfTMCIiwhjO0zVWUN7BFq4iXTN
+XnAAnj5wlMRZ/WlRj6KvpbryCoJzI5t8
+=Hh7s
+-----END PGP SIGNATURE-----
diff --git a/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz b/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz
new file mode 100644
index 000000000..076d0507b
--- /dev/null
+++ b/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz
Binary files differ
diff --git a/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz.sign b/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz.sign
new file mode 100644
index 000000000..b8bfcb535
--- /dev/null
+++ b/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz.sign
@@ -0,0 +1,7 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.19 (GNU/Linux)
+
+iEYEABECAAYFAlF96RYACgkQvLfPh359R6eeBQCgpW5JbSHUrYM4pPQl74uQeptO
+j1kAnRDwCU4LQwlJW9CKzUGjXjp8X2Kg
+=lmjv
+-----END PGP SIGNATURE-----
diff --git a/freed-ora/current/master/mac80211-improve-latency-and-throughput-while-software.patch b/freed-ora/current/master/mac80211-improve-latency-and-throughput-while-software.patch
deleted file mode 100644
index 16f839418..000000000
--- a/freed-ora/current/master/mac80211-improve-latency-and-throughput-while-software.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-From c790794fcb461842e6ae1d764b7f68e9a789d149 Mon Sep 17 00:00:00 2001
-From: Stanislaw Gruszka <sgruszka@redhat.com>
-Date: Wed, 23 Jan 2013 12:32:45 +0100
-Subject: [PATCH] mac80211: improve latency and throughput while software
- scanning
-
-Patch vastly improve latency while scanning. Slight throughput
-improvements were observed as well. Is intended for improve performance
-of voice and video applications, when scan is periodically requested by
-user space (i.e. default NetworkManager behaviour).
-
-Patch remove latency requirement based on PM_QOS_NETWORK_LATENCY,
-this value is 2000 seconds by default (i.e. approximately 0.5 hour !?!).
-
-Also remove listen interval requirement, which based on beaconing and
-depending on BSS parameters. It can make we stay off-channel for a
-second or more.
-
-Instead try to offer the best latency that we could, i.e. be off-channel
-no longer than PASSIVE channel scan time: 125 ms. That mean we will
-scan two ACTIVE channels and go back to on-channel, and one PASSIVE
-channel, and go back to on-channel.
-
-Patch also decrease PASSIVE channel scan time to about 110 ms.
-
-As drawback patch increase overall scan time. On my tests, when scanning
-both 2GHz and 5GHz bands, scanning time increase from 5 seconds up to 10
-seconds. Since that increase happen only when we are associated, I think
-it can be acceptable. If eventually better scan time is needed for
-situations when we lose signal and quickly need to decide to which AP
-roam, additional scan flag or parameter can be introduced.
-
-I tested patch by doing:
-
-while true; do iw dev wlan0 scan; sleep 3; done > /dev/null
-
-and
-
-ping -i0.2 -c 1000 HOST
-
-on remote and local machine, results are as below:
-
-* Ping from local periodically scanning machine to AP:
-Unpatched: rtt min/avg/max/mdev = 0.928/24.946/182.135/36.873 ms
-Patched: rtt min/avg/max/mdev = 0.928/19.678/150.845/33.130 ms
-
-* Ping from remote machine to periodically scanning machine:
-Unpatched: rtt min/avg/max/mdev = 1.637/120.683/709.139/164.337 ms
-Patched: rtt min/avg/max/mdev = 1.807/26.893/201.435/40.284 ms
-
-Throughput measured by scp show following results.
-
-* Upload to periodically scanning machine:
-Unpatched: 3.9MB/s 03:15
-Patched: 4.3MB/s 02:58
-
-* Download from periodically scanning machine:
-Unpatched: 5.5MB/s 02:17
-Patched: 6.2MB/s 02:02
-
-Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
- net/mac80211/scan.c | 32 +++++---------------------------
- 1 file changed, 5 insertions(+), 27 deletions(-)
-
-diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
-index bf82e69..e6b2ebc 100644
---- a/net/mac80211/scan.c
-+++ b/net/mac80211/scan.c
-@@ -27,7 +27,7 @@
-
- #define IEEE80211_PROBE_DELAY (HZ / 33)
- #define IEEE80211_CHANNEL_TIME (HZ / 33)
--#define IEEE80211_PASSIVE_CHANNEL_TIME (HZ / 8)
-+#define IEEE80211_PASSIVE_CHANNEL_TIME (HZ / 9)
-
- static void ieee80211_rx_bss_free(struct cfg80211_bss *cbss)
- {
-@@ -547,8 +547,6 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
- bool associated = false;
- bool tx_empty = true;
- bool bad_latency;
-- bool listen_int_exceeded;
-- unsigned long min_beacon_int = 0;
- struct ieee80211_sub_if_data *sdata;
- struct ieee80211_channel *next_chan;
- enum mac80211_scan_state next_scan_state;
-@@ -567,11 +565,6 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
- if (sdata->u.mgd.associated) {
- associated = true;
-
-- if (sdata->vif.bss_conf.beacon_int <
-- min_beacon_int || min_beacon_int == 0)
-- min_beacon_int =
-- sdata->vif.bss_conf.beacon_int;
--
- if (!qdisc_all_tx_empty(sdata->dev)) {
- tx_empty = false;
- break;
-@@ -588,34 +581,19 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local,
- * see if we can scan another channel without interfering
- * with the current traffic situation.
- *
-- * Since we don't know if the AP has pending frames for us
-- * we can only check for our tx queues and use the current
-- * pm_qos requirements for rx. Hence, if no tx traffic occurs
-- * at all we will scan as many channels in a row as the pm_qos
-- * latency allows us to. Additionally we also check for the
-- * currently negotiated listen interval to prevent losing
-- * frames unnecessarily.
-- *
-- * Otherwise switch back to the operating channel.
-+ * Keep good latency, do not stay off-channel more than 125 ms.
- */
-
- bad_latency = time_after(jiffies +
-- ieee80211_scan_get_channel_time(next_chan),
-- local->leave_oper_channel_time +
-- usecs_to_jiffies(pm_qos_request(PM_QOS_NETWORK_LATENCY)));
--
-- listen_int_exceeded = time_after(jiffies +
-- ieee80211_scan_get_channel_time(next_chan),
-- local->leave_oper_channel_time +
-- usecs_to_jiffies(min_beacon_int * 1024) *
-- local->hw.conf.listen_interval);
-+ ieee80211_scan_get_channel_time(next_chan),
-+ local->leave_oper_channel_time + HZ / 8);
-
- if (associated && !tx_empty) {
- if (local->scan_req->flags & NL80211_SCAN_FLAG_LOW_PRIORITY)
- next_scan_state = SCAN_ABORT;
- else
- next_scan_state = SCAN_SUSPEND;
-- } else if (associated && (bad_latency || listen_int_exceeded)) {
-+ } else if (associated && bad_latency) {
- next_scan_state = SCAN_SUSPEND;
- } else {
- next_scan_state = SCAN_SET_CHANNEL;
---
-1.8.1
-
diff --git a/freed-ora/current/master/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch b/freed-ora/current/master/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch
new file mode 100644
index 000000000..7d49d9834
--- /dev/null
+++ b/freed-ora/current/master/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch
@@ -0,0 +1,73 @@
+diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
+index baaa860..7a3d675 100644
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -748,8 +748,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+ sdata->dev->addr_len);
+ spin_unlock_bh(&local->filter_lock);
+ netif_addr_unlock_bh(sdata->dev);
+-
+- ieee80211_configure_filter(local);
++ /* configure filter latter (if not suspended) */
+ }
+
+ del_timer_sync(&local->dynamic_ps_timer);
+@@ -814,10 +813,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+ }
+
+ ieee80211_adjust_monitor_flags(sdata, -1);
+- ieee80211_configure_filter(local);
+- mutex_lock(&local->mtx);
+- ieee80211_recalc_idle(local);
+- mutex_unlock(&local->mtx);
++ /* tell driver latter (if not suspended) */
+ break;
+ case NL80211_IFTYPE_P2P_DEVICE:
+ /* relies on synchronize_rcu() below */
+@@ -848,28 +844,31 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
+
+ drv_remove_interface_debugfs(local, sdata);
+
+- if (going_down)
++ if (going_down && !local->suspended)
+ drv_remove_interface(local, sdata);
+ }
+
+ sdata->bss = NULL;
+
+- ieee80211_recalc_ps(local, -1);
+-
+- if (local->open_count == 0) {
+- if (local->ops->napi_poll)
+- napi_disable(&local->napi);
+- ieee80211_clear_tx_pending(local);
+- ieee80211_stop_device(local);
+-
+- /* no reconfiguring after stop! */
+- hw_reconf_flags = 0;
++ if (!local->suspended) {
++ if (local->open_count == 0) {
++ if (local->ops->napi_poll)
++ napi_disable(&local->napi);
++ ieee80211_clear_tx_pending(local);
++ ieee80211_stop_device(local);
++ } else {
++ ieee80211_configure_filter(local);
++ ieee80211_recalc_ps(local, -1);
++
++ mutex_lock(&local->mtx);
++ ieee80211_recalc_idle(local);
++ mutex_unlock(&local->mtx);
++
++ if (hw_reconf_flags)
++ ieee80211_hw_config(local, hw_reconf_flags);
++ }
+ }
+
+- /* do after stop to avoid reconfiguring when we stop anyway */
+- if (hw_reconf_flags)
+- ieee80211_hw_config(local, hw_reconf_flags);
+-
+ spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
+ for (i = 0; i < IEEE80211_MAX_QUEUES; i++) {
+ skb_queue_walk_safe(&local->pending[i], skb, tmp) {
diff --git a/freed-ora/current/master/mod-sign.sh b/freed-ora/current/master/mod-sign.sh
index cae259298..5081e77dc 100755
--- a/freed-ora/current/master/mod-sign.sh
+++ b/freed-ora/current/master/mod-sign.sh
@@ -9,20 +9,28 @@
# This essentially duplicates the 'modules_sign' Kbuild target and runs the
# same commands for those modules.
-moddir=$1
+MODSECKEY=$1
+MODPUBKEY=$2
-modules=`find $moddir -name *.ko`
+moddir=$3
-MODSECKEY="./signing_key.priv"
-MODPUBKEY="./signing_key.x509"
+modules=`find $moddir -name *.ko`
for mod in $modules
do
dir=`dirname $mod`
file=`basename $mod`
- ./scripts/sign-file ${MODSECKEY} ${MODPUBKEY} ${dir}/${file} \
- ${dir}/${file}.signed
- mv ${dir}/${file}.signed ${dir}/${file}
+ ./scripts/sign-file sha256 ${MODSECKEY} ${MODPUBKEY} ${dir}/${file}
rm -f ${dir}/${file}.{sig,dig}
done
+
+RANDOMMOD=$(find $moddir -type f -name '*.ko' | sort -R | head -n 1)
+if [ "~Module signature appended~" != "$(tail -c 28 $RANDOMMOD)" ]; then
+ echo "*****************************"
+ echo "*** Modules are unsigned! ***"
+ echo "*****************************"
+ exit 1
+fi
+
+exit 0
diff --git a/freed-ora/current/master/pstore-Create-a-convenient-mount-point-for-pstore.patch b/freed-ora/current/master/pstore-Create-a-convenient-mount-point-for-pstore.patch
deleted file mode 100644
index 15a1db2ec..000000000
--- a/freed-ora/current/master/pstore-Create-a-convenient-mount-point-for-pstore.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 575f0918313d593d24c40cf1839b97d7fcfebd0f Mon Sep 17 00:00:00 2001
-From: Josh Boyer <jwboyer@redhat.com>
-Date: Mon, 11 Feb 2013 18:07:48 -0500
-Subject: [PATCH] pstore: Create a convenient mount point for pstore
-
-Using /dev/pstore as a mount point for the pstore filesystem is slightly
-awkward. We don't normally mount filesystems in /dev/ and the /dev/pstore
-file isn't created automatically by anything. While this method will
-still work, we can create a persistent mount point in sysfs. This will
-put pstore on par with things like cgroups and efivarfs.
-
-Signed-off-by: Josh Boyer <jwboyer@redhat.com>
----
- Documentation/ABI/testing/pstore | 10 +++++-----
- fs/pstore/inode.c | 18 +++++++++++++++++-
- 2 files changed, 22 insertions(+), 6 deletions(-)
-
-diff --git a/Documentation/ABI/testing/pstore b/Documentation/ABI/testing/pstore
-index ff1df4e..5fca9f5 100644
---- a/Documentation/ABI/testing/pstore
-+++ b/Documentation/ABI/testing/pstore
-@@ -1,4 +1,4 @@
--Where: /dev/pstore/...
-+Where: /sys/fs/pstore/... (or /dev/pstore/...)
- Date: March 2011
- Kernel Version: 2.6.39
- Contact: tony.luck@intel.com
-@@ -11,9 +11,9 @@ Description: Generic interface to platform dependent persistent storage.
- of the console log is captured, but other interesting
- data can also be saved.
-
-- # mount -t pstore -o kmsg_bytes=8000 - /dev/pstore
-+ # mount -t pstore -o kmsg_bytes=8000 - /sys/fs/pstore
-
-- $ ls -l /dev/pstore
-+ $ ls -l /sys/fs/pstore/
- total 0
- -r--r--r-- 1 root root 7896 Nov 30 15:38 dmesg-erst-1
-
-@@ -27,9 +27,9 @@ Description: Generic interface to platform dependent persistent storage.
- the file will signal to the underlying persistent storage
- device that it can reclaim the space for later re-use.
-
-- $ rm /dev/pstore/dmesg-erst-1
-+ $ rm /sys/fs/pstore/dmesg-erst-1
-
-- The expectation is that all files in /dev/pstore
-+ The expectation is that all files in /sys/fs/pstore/
- will be saved elsewhere and erased from persistent store
- soon after boot to free up space ready for the next
- catastrophe.
-diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
-index 67de74c..e4bcb2c 100644
---- a/fs/pstore/inode.c
-+++ b/fs/pstore/inode.c
-@@ -418,9 +418,25 @@ static struct file_system_type pstore_fs_type = {
- .kill_sb = pstore_kill_sb,
- };
-
-+static struct kobject *pstore_kobj;
-+
- static int __init init_pstore_fs(void)
- {
-- return register_filesystem(&pstore_fs_type);
-+ int err = 0;
-+
-+ /* Create a convenient mount point for people to access pstore */
-+ pstore_kobj = kobject_create_and_add("pstore", fs_kobj);
-+ if (!pstore_kobj) {
-+ err = -ENOMEM;
-+ goto out;
-+ }
-+
-+ err = register_filesystem(&pstore_fs_type);
-+ if (err < 0)
-+ kobject_put(pstore_kobj);
-+
-+out:
-+ return err;
- }
- module_init(init_pstore_fs)
-
---
-1.8.1.2
-
diff --git a/freed-ora/current/master/quiet-apm.patch b/freed-ora/current/master/quiet-apm.patch
deleted file mode 100644
index c38511c41..000000000
--- a/freed-ora/current/master/quiet-apm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
-index a46bd38..416dd12 100644
---- a/arch/x86/kernel/apm_32.c
-+++ b/arch/x86/kernel/apm_32.c
-@@ -903,7 +903,7 @@ static void apm_cpu_idle(void)
- unsigned int jiffies_since_last_check = jiffies - last_jiffies;
- unsigned int bucket;
-
-- WARN_ONCE(1, "deprecated apm_cpu_idle will be deleted in 2012");
-+ printk_once(KERN_INFO "deprecated apm_cpu_idle will be deleted in 2012");
- recalc:
- if (jiffies_since_last_check > IDLE_CALC_LIMIT) {
- use_apm_idle = 0;
diff --git a/freed-ora/current/master/serial-460800.patch b/freed-ora/current/master/serial-460800.patch
index 0e68378e7..bdae70e31 100644
--- a/freed-ora/current/master/serial-460800.patch
+++ b/freed-ora/current/master/serial-460800.patch
@@ -1,7 +1,7 @@
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 2209620..659c1bb 100644
---- a/drivers/tty/serial/8250/8250.c
-+++ b/drivers/tty/serial/8250/8250.c
+--- a/drivers/tty/serial/8250/8250_core.c
++++ b/drivers/tty/serial/8250/8250_core.c
@@ -7,6 +7,9 @@
*
* Copyright (C) 2001 Russell King.
diff --git a/freed-ora/current/master/silence-empty-ipi-mask-warning.patch b/freed-ora/current/master/silence-empty-ipi-mask-warning.patch
deleted file mode 100644
index 65a637c06..000000000
--- a/freed-ora/current/master/silence-empty-ipi-mask-warning.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- linux-3.6.noarch/arch/x86/kernel/apic/ipi.c~ 2013-01-23 10:48:14.716069615 -0500
-+++ linux-3.6.noarch/arch/x86/kernel/apic/ipi.c 2013-01-23 10:48:26.217046545 -0500
-@@ -106,7 +106,7 @@ void default_send_IPI_mask_logical(const
- unsigned long mask = cpumask_bits(cpumask)[0];
- unsigned long flags;
-
-- if (WARN_ONCE(!mask, "empty IPI mask"))
-+ if (!mask)
- return;
-
- local_irq_save(flags);
diff --git a/freed-ora/current/master/sources b/freed-ora/current/master/sources
index 0af6647d8..993cd6ddc 100644
--- a/freed-ora/current/master/sources
+++ b/freed-ora/current/master/sources
@@ -1 +1 @@
-84c2a77910932ffc7d958744ac9cf2f5 linux-libre-3.8-gnu.tar.xz
+120df29f88622dabf7015a22c7cc8e25 linux-libre-3.9-gnu.tar.xz
diff --git a/freed-ora/current/master/taint-vbox.patch b/freed-ora/current/master/taint-vbox.patch
index 5cb3e47c9..b0ab4f6e6 100644
--- a/freed-ora/current/master/taint-vbox.patch
+++ b/freed-ora/current/master/taint-vbox.patch
@@ -1,15 +1,15 @@
diff --git a/kernel/module.c b/kernel/module.c
-index 04379f92..d26c9a3 100644
+index 921bed4..382414e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
-@@ -2653,6 +2653,10 @@ static int check_module_license_and_versions(struct module *mod)
+@@ -2873,6 +2873,10 @@ static int check_module_license_and_versions(struct module *mod)
if (strcmp(mod->name, "ndiswrapper") == 0)
- add_taint(TAINT_PROPRIETARY_MODULE);
+ add_taint(TAINT_PROPRIETARY_MODULE, LOCKDEP_NOW_UNRELIABLE);
+ /* vbox is garbage. */
+ if (strcmp(mod->name, "vboxdrv") == 0)
-+ add_taint(TAINT_CRAP);
++ add_taint(TAINT_CRAP, LOCKDEP_NOW_UNRELIABLE);
+
/* driverloader was caught wrongly pretending to be under GPL */
if (strcmp(mod->name, "driverloader") == 0)
- add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
+ add_taint_module(mod, TAINT_PROPRIETARY_MODULE,
diff --git a/freed-ora/current/master/usb-cypress-supertop.patch b/freed-ora/current/master/usb-cypress-supertop.patch
deleted file mode 100644
index 3887dc59c..000000000
--- a/freed-ora/current/master/usb-cypress-supertop.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 1cd59b0d0b82c66135bf10ed3a87213a87e318ab Mon Sep 17 00:00:00 2001
-From: Josh Boyer <jwboyer@redhat.com>
-Date: Thu, 14 Feb 2013 09:29:55 -0500
-Subject: [PATCH] USB: usb-storage: unusual_devs update for Super TOP SATA
- bridge
-
-The current entry in unusual_cypress.h for the Super TOP SATA bridge devices
-seems to be causing corruption on newer revisions of this device. This has
-been reported in Arch Linux and Fedora. The original patch was tested on
-devices with bcdDevice of 1.60, whereas the newer devices report bcdDevice
-as 2.20. Limit the UNUSUAL_DEV entry to devices less than 2.20.
-
-This fixes https://bugzilla.redhat.com/show_bug.cgi?id=909591
-
-Reported-by: Carsten S. <carsteniq@yahoo.com>
-Tested-by: Carsten S. <carsteniq@yahoo.com>
-CC: <stable@vger.kernel.org>
-Signed-off-by: Josh Boyer <jwboyer@redhat.com>
----
- drivers/usb/storage/unusual_cypress.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/usb/storage/unusual_cypress.h b/drivers/usb/storage/unusual_cypress.h
-index 2c85530..65a6a75 100644
---- a/drivers/usb/storage/unusual_cypress.h
-+++ b/drivers/usb/storage/unusual_cypress.h
-@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999,
- "Cypress ISD-300LP",
- USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
-
--UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x9999,
-+UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x0219,
- "Super Top",
- "USB 2.0 SATA BRIDGE",
- USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
---
-1.8.1.2
-
diff --git a/freed-ora/current/master/wireless-regulatory-fix-channel-disabling-race-condition.patch b/freed-ora/current/master/wireless-regulatory-fix-channel-disabling-race-condition.patch
new file mode 100644
index 000000000..313735377
--- /dev/null
+++ b/freed-ora/current/master/wireless-regulatory-fix-channel-disabling-race-condition.patch
@@ -0,0 +1,40 @@
+From: Johannes Berg <johannes.berg@intel.com>
+
+When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz
+part of the scan disables a 5.2 GHz channel due to, e.g. receiving
+country or frequency information, that 5.2 GHz channel might already
+be in the list of channels to scan next. Then, when the driver checks
+if it should do a passive scan, that will return false and attempt an
+active scan. This is not only wrong but can also lead to the iwlwifi
+device firmware crashing since it checks regulatory as well.
+
+Fix this by not setting the channel flags to just disabled but rather
+OR'ing in the disabled flag. That way, even if the race happens, the
+channel will be scanned passively which is still (mostly) correct.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ net/wireless/reg.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/net/wireless/reg.c b/net/wireless/reg.c
+index 93ab840..507c28e 100644
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -855,7 +855,7 @@ static void handle_channel(struct wiphy *wiphy,
+ return;
+
+ REG_DBG_PRINT("Disabling freq %d MHz\n", chan->center_freq);
+- chan->flags = IEEE80211_CHAN_DISABLED;
++ chan->flags |= IEEE80211_CHAN_DISABLED;
+ return;
+ }
+
+--
+1.8.0
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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
OpenPOWER on IntegriCloud