From patchwork Tue Oct 19 20:44:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 266441 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9JKldhB018311 for ; Tue, 19 Oct 2010 20:47:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757456Ab0JSUqz (ORCPT ); Tue, 19 Oct 2010 16:46:55 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:55727 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757145Ab0JSUqx (ORCPT ); Tue, 19 Oct 2010 16:46:53 -0400 Received: from wuerfel.localnet (port-92-200-255-145.dynamic.qsc.de [92.200.255.145]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Mcgsb-1PQFRL2thB-00HlFo; Tue, 19 Oct 2010 22:44:42 +0200 From: Arnd Bergmann To: Greg KH Subject: Re: [Ksummit-2010-discuss] [v2] Remaining BKL users, what to do Date: Tue, 19 Oct 2010 22:44:41 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.36-rc7-next-20101015+; KDE/4.5.1; x86_64; ; ) Cc: Oliver Neukum , Valdis.Kletnieks@vt.edu, Dave Airlie , codalist@telemann.coda.cs.cmu.edu, ksummit-2010-discuss@lists.linux-foundation.org, autofs@linux.kernel.org, Jan Harkes , Samuel Ortiz , Jan Kara , Arnaldo Carvalho de Melo , netdev@vger.kernel.org, Anders Larsen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Bryan Schumaker , Christoph Hellwig , Petr Vandrovec , Mikulas Patocka , linux-fsdevel@vger.kernel.org, Evgeniy Dushistov , Ingo Molnar , Andrew Hendry , linux-media@vger.kernel.org References: <201009161632.59210.arnd@arndb.de> <201010192140.47433.oliver@neukum.org> <20101019202912.GA30133@kroah.com> In-Reply-To: <20101019202912.GA30133@kroah.com> MIME-Version: 1.0 Message-Id: <201010192244.41913.arnd@arndb.de> X-Provags-ID: V02:K0:BTEgMGoS9cnbpK95avsETaNSljOwXsMOeiOW9oUL3Vc e8Q2vo9pYpq1STKKrn+kPjK6bY9AzI+6lbzDExSJieH8c5aOhu ibihMV0sAgu3ypBUm8tTQJT4Ktyj4v+Zq3zYGEoNsIxZPoGfZi xBaVCzDt6gX6LitX7bYNH5m1eXe5UGNGJcTKKbqXNO2O5xtpI1 wChTTM/EL1K+poaePFjcA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Oct 2010 20:47:40 +0000 (UTC) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index b755301..e071bc8 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -73,8 +73,8 @@ source "drivers/gpu/drm/radeon/Kconfig" config DRM_I810 tristate "Intel I810" - # BKL usage in order to avoid AB-BA deadlocks, may become BROKEN_ON_SMP - depends on DRM && AGP && AGP_INTEL && BKL + # PREEMPT requires BKL support here, which was removed + depends on DRM && AGP && AGP_INTEL && !PREEMPT help Choose this option if you have an Intel I810 graphics card. If M is selected, the module will be called i810. AGP support is required diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c index ff33e53..8f371e8 100644 --- a/drivers/gpu/drm/i810/i810_dma.c +++ b/drivers/gpu/drm/i810/i810_dma.c @@ -37,7 +37,6 @@ #include /* For task queue support */ #include #include -#include #include #define I810_BUF_FREE 2 @@ -94,7 +93,6 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) struct drm_buf *buf; drm_i810_buf_priv_t *buf_priv; - lock_kernel(); dev = priv->minor->dev; dev_priv = dev->dev_private; buf = dev_priv->mmap_buffer; @@ -104,7 +102,6 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) vma->vm_file = filp; buf_priv->currently_mapped = I810_BUF_MAPPED; - unlock_kernel(); if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, @@ -116,7 +113,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) static const struct file_operations i810_buffer_fops = { .open = drm_open, .release = drm_release, - .unlocked_ioctl = i810_ioctl, + .unlocked_ioctl = drm_ioctl, .mmap = i810_mmap_buffers, .fasync = drm_fasync, .llseek = noop_llseek, @@ -1242,19 +1239,6 @@ int i810_driver_dma_quiescent(struct drm_device *dev) return 0; } -/* - * call the drm_ioctl under the big kernel lock because - * to lock against the i810_mmap_buffers function. - */ -long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - int ret; - lock_kernel(); - ret = drm_ioctl(file, cmd, arg); - unlock_kernel(); - return ret; -} - struct drm_ioctl_desc i810_ioctls[] = { DRM_IOCTL_DEF_DRV(I810_INIT, i810_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY|DRM_UNLOCKED), DRM_IOCTL_DEF_DRV(I810_VERTEX, i810_dma_vertex, DRM_AUTH|DRM_UNLOCKED), diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c index 88bcd33..9642d3c 100644 --- a/drivers/gpu/drm/i810/i810_drv.c +++ b/drivers/gpu/drm/i810/i810_drv.c @@ -57,7 +57,7 @@ static struct drm_driver driver = { .owner = THIS_MODULE, .open = drm_open, .release = drm_release, - .unlocked_ioctl = i810_ioctl, + .unlocked_ioctl = drm_ioctl, .mmap = drm_mmap, .poll = drm_poll, .fasync = drm_fasync, @@ -79,6 +79,10 @@ static struct drm_driver driver = { static int __init i810_init(void) { + if (num_present_cpus() > 1) { + pr_err("drm/i810 does not support SMP\n"); + return -EINVAL; + } driver.num_ioctls = i810_max_ioctl; return drm_init(&driver); }