~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/features/all/drm-i810-remove-the-BKL.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Arnd Bergmann <arnd@arndb.de>
2
 
Date: Tue, 25 Jan 2011 23:17:15 +0100
3
 
Subject: [PATCH] drm/i810: remove the BKL
4
 
 
5
 
commit 1f692a14cbfbeb11f9a9c16f25c8ecb8ab50d3d5 upstream.
6
 
 
7
 
SMP i810 systems were practically nonexistent and the configuration
8
 
was not officially supported by Intel at the time when Pentium-III
9
 
was common.
10
 
 
11
 
With this change, it is still possible to build a distribution kernel
12
 
that has support for SMP and includes the i810 driver without the BKL.
13
 
As a precaution, check for the theoretical SMP case at run time and
14
 
refuse to load the driver.
15
 
 
16
 
We also need to disable CONFIG_PREEMPT builds for this driver.
17
 
 
18
 
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
19
 
Cc: dri-devel@lists.freedesktop.org
20
 
Signed-off-by: Dave Airlie <airlied@redhat.com>
21
 
---
22
 
 drivers/gpu/drm/Kconfig         |    4 ++--
23
 
 drivers/gpu/drm/i810/i810_dma.c |   18 +-----------------
24
 
 drivers/gpu/drm/i810/i810_drv.c |    6 +++++-
25
 
 3 files changed, 8 insertions(+), 20 deletions(-)
26
 
 
27
 
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
28
 
index 4458876..a6feb78c 100644
29
 
--- a/drivers/gpu/drm/Kconfig
30
 
+++ b/drivers/gpu/drm/Kconfig
31
 
@@ -73,8 +73,8 @@ source "drivers/gpu/drm/radeon/Kconfig"
32
 
 
33
 
 config DRM_I810
34
 
        tristate "Intel I810"
35
 
-       # BKL usage in order to avoid AB-BA deadlocks, may become BROKEN_ON_SMP
36
 
-       depends on DRM && AGP && AGP_INTEL && BKL
37
 
+       # !PREEMPT because of missing ioctl locking
38
 
+       depends on DRM && AGP && AGP_INTEL && (!PREEMPT || BROKEN)
39
 
        help
40
 
          Choose this option if you have an Intel I810 graphics card.  If M is
41
 
          selected, the module will be called i810.  AGP support is required
42
 
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
43
 
index ff33e53..8f371e8 100644
44
 
--- a/drivers/gpu/drm/i810/i810_dma.c
45
 
+++ b/drivers/gpu/drm/i810/i810_dma.c
46
 
@@ -37,7 +37,6 @@
47
 
 #include <linux/interrupt.h>   /* For task queue support */
48
 
 #include <linux/delay.h>
49
 
 #include <linux/slab.h>
50
 
-#include <linux/smp_lock.h>
51
 
 #include <linux/pagemap.h>
52
 
 
53
 
 #define I810_BUF_FREE          2
54
 
@@ -94,7 +93,6 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
55
 
        struct drm_buf *buf;
56
 
        drm_i810_buf_priv_t *buf_priv;
57
 
 
58
 
-       lock_kernel();
59
 
        dev = priv->minor->dev;
60
 
        dev_priv = dev->dev_private;
61
 
        buf = dev_priv->mmap_buffer;
62
 
@@ -104,7 +102,6 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
63
 
        vma->vm_file = filp;
64
 
 
65
 
        buf_priv->currently_mapped = I810_BUF_MAPPED;
66
 
-       unlock_kernel();
67
 
 
68
 
        if (io_remap_pfn_range(vma, vma->vm_start,
69
 
                               vma->vm_pgoff,
70
 
@@ -116,7 +113,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
71
 
 static const struct file_operations i810_buffer_fops = {
72
 
        .open = drm_open,
73
 
        .release = drm_release,
74
 
-       .unlocked_ioctl = i810_ioctl,
75
 
+       .unlocked_ioctl = drm_ioctl,
76
 
        .mmap = i810_mmap_buffers,
77
 
        .fasync = drm_fasync,
78
 
        .llseek = noop_llseek,
79
 
@@ -1242,19 +1239,6 @@ int i810_driver_dma_quiescent(struct drm_device *dev)
80
 
        return 0;
81
 
 }
82
 
 
83
 
-/*
84
 
- * call the drm_ioctl under the big kernel lock because
85
 
- * to lock against the i810_mmap_buffers function.
86
 
- */
87
 
-long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
88
 
-{
89
 
-       int ret;
90
 
-       lock_kernel();
91
 
-       ret = drm_ioctl(file, cmd, arg);
92
 
-       unlock_kernel();
93
 
-       return ret;
94
 
-}
95
 
-
96
 
 struct drm_ioctl_desc i810_ioctls[] = {
97
 
        DRM_IOCTL_DEF_DRV(I810_INIT, i810_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY|DRM_UNLOCKED),
98
 
        DRM_IOCTL_DEF_DRV(I810_VERTEX, i810_dma_vertex, DRM_AUTH|DRM_UNLOCKED),
99
 
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
100
 
index 88bcd33..0152fa2 100644
101
 
--- a/drivers/gpu/drm/i810/i810_drv.c
102
 
+++ b/drivers/gpu/drm/i810/i810_drv.c
103
 
@@ -57,7 +57,7 @@ static struct drm_driver driver = {
104
 
                 .owner = THIS_MODULE,
105
 
                 .open = drm_open,
106
 
                 .release = drm_release,
107
 
-                .unlocked_ioctl = i810_ioctl,
108
 
+                .unlocked_ioctl = drm_ioctl,
109
 
                 .mmap = drm_mmap,
110
 
                 .poll = drm_poll,
111
 
                 .fasync = drm_fasync,
112
 
@@ -79,6 +79,10 @@ static struct drm_driver driver = {
113
 
 
114
 
 static int __init i810_init(void)
115
 
 {
116
 
+       if (num_possible_cpus() > 1) {
117
 
+               pr_err("drm/i810 does not support SMP\n");
118
 
+               return -EINVAL;
119
 
+       }
120
 
        driver.num_ioctls = i810_max_ioctl;
121
 
        return drm_init(&driver);
122
 
 }
123
 
1.7.4.1
124