From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [RFC PATCH v2] Utilize the PCI API in the TTM framework. Date: Mon, 21 Mar 2011 19:18:35 -0400 Message-ID: <20110321231835.GA20159@dumpdata.com> References: <1294420304-24811-1-git-send-email-konrad.wilk@oracle.com> <1300713067.8042.13.camel@thor.local> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from rcsinet10.oracle.com (rcsinet10.oracle.com [148.87.113.121]) by gabe.freedesktop.org (Postfix) with ESMTP id EBD029E73D for ; Mon, 21 Mar 2011 16:19:45 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1300713067.8042.13.camel@thor.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Michel =?iso-8859-1?Q?D=E4nzer?= Cc: konrad@darnok.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mon, Mar 21, 2011 at 02:11:07PM +0100, Michel D=E4nzer wrote: > On Fre, 2011-01-07 at 12:11 -0500, Konrad Rzeszutek Wilk wrote: = > > = > > 1) The 'NULL' when doing dma_alloc_coherent is unsightly. I was toying > > with modifying the TTM API to pass in 'struct device' or 'struct pci_de= vice' > > but figured it would make first sense to get your guys input before hea= ding that route. > = > It's worse than unsightly: It breaks TTM on PPC. See > arch/powerpc/include/asm/dma-mapping.h: get_dma_ops() returns NULL if > NULL is passed in for the device, and most of its callers BUG in that > case. The exception being dma_supported(), so a possible solution might > be to use that for checking if dma_alloc_coherent can be used. > = > Dave, please prevent this change from entering mainline before there's a > solution for this. We do have a fix for it: = git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git devel/ttm.pci-= api.v5 Can you tell me if that works for you?