From owner-freebsd-x11@FreeBSD.ORG Fri Jul 6 15:13:11 2007 Return-Path: X-Original-To: x11@freebsd.org Delivered-To: freebsd-x11@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3703216A469 for ; Fri, 6 Jul 2007 15:13:11 +0000 (UTC) (envelope-from imb@protected-networks.net) Received: from aaron.protected-networks.net (aaron.protected-networks.net [202.12.127.66]) by mx1.freebsd.org (Postfix) with ESMTP id D550613C4AE for ; Fri, 6 Jul 2007 15:13:10 +0000 (UTC) (envelope-from imb@protected-networks.net) Received: from localhost (localhost [127.0.0.1]) by aaron.protected-networks.net (Postfix) with ESMTP id 576C8C551; Fri, 6 Jul 2007 10:55:37 -0400 (EDT) Received: from toshi.auburn.protected-networks.net (toshi.auburn.protected-networks.net [202.12.127.84]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Iain Michael Butler", Issuer "Protected Networks Certificate Authority" (verified OK)) (Authenticated sender: imb@protected-networks.net) by aaron.protected-networks.net (Postfix) with ESMTP id 5E314C448; Fri, 6 Jul 2007 10:55:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=protected-networks.net; s=200705; t=1183733723; bh=VhAdHb6NsdowRc LmUZkxD82nyLNae+d1mqmKULLRxnw=; h=DomainKey-Signature:Message-ID: Date:From:User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:X-Enigmail-Version:OpenPGP:Content-Type: Content-Transfer-Encoding; b=IFm9WJhvr85n57idgoHqzyoxUGqhKURRCUXf8 OpJ0HQvKRsrTIELMV1OmyjLucAGg4Aj7n8MeP2yi+t3sgwgyPWi3Apj2W7Um5AusmDv VKFjtdzqFv1NjEy/B4AJIcNF DomainKey-Signature: a=rsa-sha1; s=200509; d=protected-networks.net; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:cc:subject: references:in-reply-to:x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=A1aKh/SCl17q3d4rcTnBe4IuqFx1e4sdNU9kI2r2JcTjIUcUO5+Xcoh6cC/H5wSio Rl+/k+wSDTYWWMFrhWoS4HoY0yB5eHhNtookgDPx1hPRChCAPXC+Gr+YNfZkdxE Message-ID: <468E57D9.20406@protected-networks.net> Date: Fri, 06 Jul 2007 10:55:21 -0400 From: Michael Butler User-Agent: Thunderbird 2.0.0.4 (X11/20070615) 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> X-Enigmail-Version: 0.95.2 OpenPGP: id=0442D492 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org, freebsd-current@freebsd.org, x11@freebsd.org Subject: Re: xorg 7.2 locks system in current X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2007 15:13:11 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kostik Belousov wrote: > [Redirecting to x11@ as more appropriate] > > 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 ? This appears to be equally applicable to 6-stable. I've had random lock-ups with an i945GM and which, on initial and brief testing, appear to be gone using this patch, Michael > 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; > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD4DBQFGjlfZQv9rrgRC1JIRAnKKAJjho4IxKKbkckbFHJWXkU0eXB48AJ9pcxI/ fCAdV0vMyddsC2WfFKN9Vg== =5hrb -----END PGP SIGNATURE-----