From owner-freebsd-current@FreeBSD.ORG Fri Jul 6 10:17:56 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EF0916A41F for ; Fri, 6 Jul 2007 10:17:56 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.freebsd.org (Postfix) with ESMTP id 2925413C480 for ; Fri, 6 Jul 2007 10:17:55 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from [202.179.0.164] (helo=daemon.micom.mng.net) by publicd.ub.mng.net with esmtpa (Exim 4.67 (FreeBSD)) (envelope-from ) id 1I6ksn-0008hC-8N; Fri, 06 Jul 2007 18:17:50 +0800 Message-ID: <468E16CC.4040704@micom.mng.net> Date: Fri, 06 Jul 2007 18:17:48 +0800 From: Ganbold User-Agent: Thunderbird 2.0.0.0 (X11/20070425) MIME-Version: 1.0 To: Kostik Belousov References: <468DC8BB.307@micom.mng.net> <20070706095113.GD2200@deviant.kiev.zoral.com.ua> In-Reply-To: <20070706095113.GD2200@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-current@freebsd.org Subject: Re: xorg 7.2 locks system in current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2007 10:17:56 -0000 Kostik Belousov wrote: > [Redirecting to x11@ as more appropriate] > > On Fri, Jul 06, 2007 at 12:44:43PM +0800, Ganbold wrote: > >> Hi, >> >> I have todays CURRENT. My machine is Dell Latitude D620 with 945GM >> graphics card. >> When I try to run xorg 7.2, my machine hangs and on serial console it >> showed: >> >> uma_zalloc_arg: zone "64" with the following non-sleepable locks held: >> exclusive sleep mutex drm device r = 0 (0xc3c06cd8) locked @ >> /usr/src/sys/modules/drm/drm/../../../dev/drm/drm_drv.c:907 >> KDB: enter: witness_warn >> [thread pid 739 tid 100092 ] >> Stopped at kdb_enter+0x32: leave >> db> bt >> Tracing pid 739 tid 100092 td 0xc3fe2220 >> kdb_enter(c086100b,e63ea9fc,4,1,0,...) at kdb_enter+0x32 >> witness_warn(5,0,c08bd9fe,c08a71b1,66666666,...) at witness_warn+0x1b9 >> uma_zalloc_arg(c1072d20,0,102,2,c09d9d64,...) at uma_zalloc_arg+0x34 >> malloc(2c,c093d0c0,102,12,c4325db0,...) at malloc+0xd2 >> sysctl_add_oid(c4325dcc,c09d9d64,ffffffff,c4325db0,80000001,...) at >> sysctl_add_oid+0x95 >> alloc_bounce_zone(44,c09399e0,101,1000,c3c8ec80,...) at >> alloc_bounce_zone+0x16d >> bus_dma_tag_create(0,1000,0,ffffffff,ffffffff,...) at >> bus_dma_tag_create+0x1a9 >> drm_pci_alloc(c3c06c00,1000,1000,ffffffff,20000,...) at drm_pci_alloc+0xe1 >> i915_dma_init(c3bf3800,80446440,c4325e80,3,c3fe2220,...) at >> i915_dma_init+0x2b8 >> drm_ioctl(c3bf3800,80446440,c4325e80,3,c3fe2220,...) at drm_ioctl+0x357 >> giant_ioctl(c3bf3800,80446440,c4325e80,3,c3fe2220,...) at giant_ioctl+0x56 >> devfs_ioctl_f(c3e70048,80446440,c4325e80,c405c500,c3fe2220,...) at >> devfs_ioctl_f+0xc9 >> kern_ioctl(c3fe2220,8,80446440,c4325e80,0,...) at kern_ioctl+0x243 >> ioctl(c3fe2220,e63eacfc,c,c089e511,c0935830,...) at ioctl+0x134 >> syscall(e63ead38) at syscall+0x2b3 >> Xint0x80_syscall() at Xint0x80_syscall+0x20 >> --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x483decc3, esp = >> 0xbfbfea5c, ebp = 0xbfbfea78 --- >> db> >> db> c >> uma_zalloc_arg: zone "16" with the following non-sleepable locks held: >> exclusive sleep mutex drm device r = 0 (0xc3c06cd8) locked @ >> /usr/src/sys/modules/drm/drm/../../../dev/drm/drm_drv.c:907 >> KDB: enter: witness_warn >> [thread pid 739 tid 100092 ] >> Stopped at kdb_enter+0x32: leave >> db> >> >> thanks, >> >> Ganbold >> > > Man page states explicitely that bus_dma_tag_create() (as well as > bus_dmamem_alloc()) shall not be called with non-sleepable lock held. > I am not completely sure, but it seems to be safe to drop the drm > lock around drm_pci_alloc() when the later moved to the start of the > i915_initialize(). > > Could you, please, test the patch below ? > > diff --git a/sys/dev/drm/i915_dma.c b/sys/dev/drm/i915_dma.c > index 1d1877b..118d160 100644 > --- a/sys/dev/drm/i915_dma.c > +++ b/sys/dev/drm/i915_dma.c > @@ -122,7 +122,22 @@ static int i915_initialize(drm_device_t * dev, > drm_i915_private_t * dev_priv, > drm_i915_init_t * init) > { > + drm_dma_handle_t *dmah; > + > + DRM_UNLOCK(); > + dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, > + 0xffffffff); > + if (!dmah) { > + dev->dev_private = (void *)dev_priv; > + i915_dma_cleanup(dev); > + DRM_ERROR("Can not allocate hardware status page\n"); > + DRM_LOCK(); > + return DRM_ERR(ENOMEM); > + } > + DRM_LOCK(); > + > memset(dev_priv, 0, sizeof(drm_i915_private_t)); > + dev_priv->status_page_dmah = dmah; > > DRM_GETSAREA(); > if (!dev_priv->sarea) { > @@ -181,15 +196,6 @@ static int i915_initialize(drm_device_t * dev, > dev_priv->allow_batchbuffer = 1; > > /* Program Hardware Status Page */ > - dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, > - 0xffffffff); > - > - if (!dev_priv->status_page_dmah) { > - dev->dev_private = (void *)dev_priv; > - i915_dma_cleanup(dev); > - DRM_ERROR("Can not allocate hardware status page\n"); > - return DRM_ERR(ENOMEM); > - } > dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; > dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; > > Thanks a lot, Xorg 7.2 works here with above patch with WITNESS enabled kernel. Ganbold -- What the world *really* needs is a good Automatic Bicycle Sharpener.