From owner-freebsd-current@FreeBSD.ORG Fri Jul 6 09:51:38 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 DA18016A41F for ; Fri, 6 Jul 2007 09:51:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 7418113C4AE for ; Fri, 6 Jul 2007 09:51:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [89.162.146.170] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1I6kTI-00076n-0D for freebsd-current@freebsd.org; Fri, 06 Jul 2007 12:51:37 +0300 Received: from deviant.kiev.zoral.com.ua (root@[10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id l669pFL2046843 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Jul 2007 12:51:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id l669pFCc063332; Fri, 6 Jul 2007 12:51:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1/Submit) id l669pDbb063331; Fri, 6 Jul 2007 12:51:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 6 Jul 2007 12:51:13 +0300 From: Kostik Belousov To: Ganbold Message-ID: <20070706095113.GD2200@deviant.kiev.zoral.com.ua> References: <468DC8BB.307@micom.mng.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8p/3hdGJBHAENZPK" Content-Disposition: inline In-Reply-To: <468DC8BB.307@micom.mng.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.90.2, clamav-milter version 0.90.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 88b69d8ab6077836b90bc526c77e14c8 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 1189 [July 05 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release 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 09:51:38 -0000 --8p/3hdGJBHAENZPK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [Redirecting to x11@ as more appropriate] On Fri, Jul 06, 2007 at 12:44:43PM +0800, Ganbold wrote: > Hi, >=20 > I have todays CURRENT. My machine is Dell Latitude D620 with 945GM=20 > graphics card. > When I try to run xorg 7.2, my machine hangs and on serial console it=20 > showed: >=20 > uma_zalloc_arg: zone "64" with the following non-sleepable locks held: > exclusive sleep mutex drm device r =3D 0 (0xc3c06cd8) locked @=20 > /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=20 > sysctl_add_oid+0x95 > alloc_bounce_zone(44,c09399e0,101,1000,c3c8ec80,...) at=20 > alloc_bounce_zone+0x16d > bus_dma_tag_create(0,1000,0,ffffffff,ffffffff,...) at=20 > 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=20 > 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=20 > 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 =3D 0x483decc3, esp =3D=20 > 0xbfbfea5c, ebp =3D 0xbfbfea78 --- > db> > db> c > uma_zalloc_arg: zone "16" with the following non-sleepable locks held: > exclusive sleep mutex drm device r =3D 0 (0xc3c06cd8) locked @=20 > /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> >=20 > thanks, >=20 > 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 =3D drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE,=20 + 0xffffffff); + if (!dmah) { + dev->dev_private =3D (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 =3D dmah; =20 DRM_GETSAREA(); if (!dev_priv->sarea) { @@ -181,15 +196,6 @@ static int i915_initialize(drm_device_t * dev, dev_priv->allow_batchbuffer =3D 1; =20 /* Program Hardware Status Page */ - dev_priv->status_page_dmah =3D drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE,= =20 - 0xffffffff); - - if (!dev_priv->status_page_dmah) { - dev->dev_private =3D (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 =3D dev_priv->status_page_dmah->vaddr; dev_priv->dma_status_page =3D dev_priv->status_page_dmah->busaddr; =09 --8p/3hdGJBHAENZPK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGjhCQC3+MBN1Mb4gRAu1lAKCeLLHpsIpz2oIqeaMJxj3mpV29FgCg6+Hf EXC1PoCuIv6K59Y7CVB74cY= =Fm4F -----END PGP SIGNATURE----- --8p/3hdGJBHAENZPK--