lkml.org 
[lkml]   [2008]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] pci: print out DMA mask info
From
On Thu, 9 Oct 2008 21:56:33 -0700
"Yinghai Lu" <yinghai@kernel.org> wrote:

> On Thu, Oct 9, 2008 at 7:40 PM, FUJITA Tomonori
> <fujita.tomonori@lab.ntt.co.jp> wrote:
> > On Thu, 09 Oct 2008 16:05:57 -0700
> > Yinghai Lu <yinghai@kernel.org> wrote:
> >
> >> Grant Grundler wrote:
> >> > On Thu, Oct 09, 2008 at 02:51:32PM -0700, Yinghai Lu wrote:
> >> >> On Thu, Oct 9, 2008 at 2:35 PM, Matthew Wilcox <matthew@wil.cx> wrote:
> >> >>> Why's that interesting to the sysadmin of the machine? To the driver
> >> >>> writer, certainly. But what's the use of it to the people using the
> >> >>> machine?
> >> > ...
> >> >> make linux kernel act like black box as other os?
> >> >
> >> > I don't understand your reply.
> >> > If someone thinks linux is a black box, printing this message won't help them.
> >> >
> >> could find out easily why some driver doesn't set dma mask correctly.
> >> like why
> >> qlogic qla2xxx only set consistent to 64bit,
> >> emulex lpfc not set consistent to 64bit
> >
> > IIRC, except for one SGI architecture, coherent_dma_mask is
> > meaningless, dma_mask is always equal to coherent_dma_mask. Lots of
> > IOMMU implementations ignore coherent_dma_mask and use dma_mask for
> > alloc_coherent(). Some drivers doesn't set up coherent_dma_mask.
>
> ehci_hcd 0000:00:02.1: using 31bit consistent DMA mask
> ==> ck804 ehci, is using 31bit for consistent dma mask, at still use
> 32 bit for dma mask.

ehci_hcd needs to set 31bit to dma_mask, I guess.


> qlogic qla2xxx and emulex lpfc dma mask and consistent_dma_mask is different...
> could have some story for them

Check out qla2xxx again. I think that it uses dma_set_mask() to set
dma_mask. qla2xxx uses the same value for both dma_mask and
consistent_dma_mask.

lpfc had better set 64bit to consistent_dma_mask but as I said in the
previous mail, not setting consistent_dma_mask doesn't cause any
problem. It means that some IOMMUs (uses consistent_dma_mask properly)
allocates an address < 4GB in alloc_coherent() and some IOMMUs alloc
address > 4GB. lpfc can handle both anyway.


> at least gart iommu is honoring the consistent dma mask.
> by calling dma_alloc_coherent_mask(dev, flag)

Well, that's because I wrote gart's alloc_coherent and introduced
dma_alloc_coherent_mask. ;)


> if device could use 64 bit coherent dma mask, that is driver problem...

Can you be more specific? As I wrote above, if 64bit-dma-capable
devices don't set consistent_dma_mask, we don't have any problem.

Yes, drivers that have dma_mask < 32bit need to set up
consistent_dma_mask. But few devices have dma_mask < 32bit and we can
fix them without the information at boot time, I think.


> print it out could put them in focus.


\
 
 \ /
  Last update: 2008-10-10 08:11    [W:0.087 / U:3.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site