From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id B45FAB7BC0 for ; Sat, 1 Aug 2009 19:00:27 +1000 (EST) Subject: Re: [PATCH] Stop pci_set_dma_mask() from failing when RAM doesn't exceed the mask anyway From: David Woodhouse To: Benjamin Herrenschmidt In-Reply-To: <1249113656.1509.125.camel@pasglop> References: <1249069310.20192.220.camel@macbook.infradead.org> <1249079105.1509.95.camel@pasglop> <1249113285.20192.961.camel@macbook.infradead.org> <1249113656.1509.125.camel@pasglop> Content-Type: text/plain Date: Sat, 01 Aug 2009 10:00:20 +0100 Message-Id: <1249117220.20192.1083.camel@macbook.infradead.org> Mime-Version: 1.0 Cc: linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sat, 2009-08-01 at 18:00 +1000, Benjamin Herrenschmidt wrote: > On Sat, 2009-08-01 at 08:54 +0100, David Woodhouse wrote: > > On Sat, 2009-08-01 at 08:25 +1000, Benjamin Herrenschmidt wrote: > > > On Fri, 2009-07-31 at 20:41 +0100, David Woodhouse wrote: > > > > On an iMac G5, the b43 driver is failing to initialise because trying to > > > > set the dma mask to 30-bit fails. Even though there's only 512MiB of RAM > > > > in the machine anyway: > > > > https://bugzilla.redhat.com/show_bug.cgi?id=514787 > > > > > > > > We should probably let it succeed if the available RAM in the system > > > > doesn't exceed the requested limit. > > > > > > > > Signed-off-by: David Woodhouse > > > > > > Also, isn't our iommu code smart enough to clamp allocations to the DMA > > > mask nowadays ? In that case, we could probably just force iommu on > > > always... > > > > We're not using the IOMMU on this box: > > > > PowerMac motherboard: iMac G5 > > DART: table not allocated, using direct DMA > > I know, I was suggesting we do :-) I'm not sure. Losing 16MiB on a machine which only has 512MiB anyway doesn't seem ideal, and we'll want to make the no-iommu code DTRT _anyway_, surely? So we might as well let the DART keep its existing logic (which is only to bother if we have more than 1GiB of RAM; a limit chosen specifically because of the Broadcom brokenness). -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation