diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 13:34:16 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:48 -0400 |
commit | 70ffa16e604bab22b12bf72cb7796f1dd01ec335 (patch) | |
tree | bd07484ca841d370fb2edb338ad90453431c3b93 /drivers/char/drm/drm_fops.c | |
parent | abedd296e97a5d943e76999de97253f1b62a4846 (diff) |
drm: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/char/drm/drm_fops.c')
-rw-r--r-- | drivers/char/drm/drm_fops.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c index 68f0da801ed8..7a25726f07f7 100644 --- a/drivers/char/drm/drm_fops.c +++ b/drivers/char/drm/drm_fops.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "drmP.h" | 37 | #include "drmP.h" |
38 | #include "drm_sarea.h" | 38 | #include "drm_sarea.h" |
39 | #include <linux/poll.h> | 39 | #include <linux/poll.h> |
40 | #include <linux/smp_lock.h> | ||
40 | 41 | ||
41 | static int drm_open_helper(struct inode *inode, struct file *filp, | 42 | static int drm_open_helper(struct inode *inode, struct file *filp, |
42 | struct drm_device * dev); | 43 | struct drm_device * dev); |
@@ -174,12 +175,14 @@ int drm_stub_open(struct inode *inode, struct file *filp) | |||
174 | 175 | ||
175 | DRM_DEBUG("\n"); | 176 | DRM_DEBUG("\n"); |
176 | 177 | ||
178 | /* BKL pushdown: note that nothing else serializes idr_find() */ | ||
179 | lock_kernel(); | ||
177 | minor = idr_find(&drm_minors_idr, minor_id); | 180 | minor = idr_find(&drm_minors_idr, minor_id); |
178 | if (!minor) | 181 | if (!minor) |
179 | return -ENODEV; | 182 | goto out; |
180 | 183 | ||
181 | if (!(dev = minor->dev)) | 184 | if (!(dev = minor->dev)) |
182 | return -ENODEV; | 185 | goto out; |
183 | 186 | ||
184 | old_fops = filp->f_op; | 187 | old_fops = filp->f_op; |
185 | filp->f_op = fops_get(&dev->driver->fops); | 188 | filp->f_op = fops_get(&dev->driver->fops); |
@@ -189,6 +192,8 @@ int drm_stub_open(struct inode *inode, struct file *filp) | |||
189 | } | 192 | } |
190 | fops_put(old_fops); | 193 | fops_put(old_fops); |
191 | 194 | ||
195 | out: | ||
196 | unlock_kernel(); | ||
192 | return err; | 197 | return err; |
193 | } | 198 | } |
194 | 199 | ||