linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: benh@kernel.crashing.org
Cc: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <htejun@gmail.com>,
	Alan Cox <alan@redhat.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: Re: libata .sg_tablesize: why always dividing by 2 ?
Date: Tue, 26 Feb 2008 11:51:42 -0500	[thread overview]
Message-ID: <47C4439E.2000606@rtr.ca> (raw)
In-Reply-To: <47C43D7F.3010005@rtr.ca>

Mark Lord wrote:
> Benjamin Herrenschmidt wrote:
>> On Tue, 2008-02-26 at 00:43 -0500, Mark Lord wrote:
>>>> I suppose so. I don't remember all of the details, but iirc, it has to
>>>> do with crossing 64K boundaries. Some controllers can't handle it.
>>>>
>>>> It's not only the _size_ of the segments, it's their alignment.
>>>>
>>>> The iommu will not keep alignement beyond the page size (and even
>>>> then... on powerpc with a 64k base page size, you may still end up with
>>>> a 4k aligned result, but let's not go there now).
>>> ..
>>>
>>> That's just not possible, unless the IOMMU *splits* segments.
>>> And the IOMMU experts here say that it never does that.
>>
>> It is totally possible, and I know as wrote part of the powerpc iommu
>> code :-)
>>
>> The iommu code makes no guarantee vs. preserving the alignment of a
>> segment, at least not below PAGE_SIZE.
>>
>> Thus if you pass to dma_map_sg() a 64K aligned 64K segment, you may well
>> get back a 4K aligned 64K segment.
>>
>> Enforcing natural alignment in the iommu code only happens for
>> dma_alloc_coherent (it uses order-N allocations anyway), it doesn't
>> happen for map_sg. If we were to do that, we would make it very likely
>> for iommu allocations to fail on machine with small DMA windows.
>>
>> Ben.
> ..
> 
> That's interesting.  Can you point us to the exact file::lines where
> this happens?  It would be good to ensure that this gets fixed.
> 
> I'm copying Fujita Tomonori on this thread now -- he's the dude who's
> trying to sort out the IOMMU mess.
..

Mmm.. looks like ppc is already fixed in mainline,
commit 740c3ce66700640a6e6136ff679b067e92125794

Ben?

  reply	other threads:[~2008-02-26 16:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26  0:02 libata .sg_tablesize: why always dividing by 2 ? Mark Lord
2008-02-26  0:15 ` Jeff Garzik
2008-02-26  0:27   ` Mark Lord
2008-02-26  0:54   ` Benjamin Herrenschmidt
2008-02-26  1:37     ` Mark Lord
2008-02-26  1:43       ` Mark Lord
2008-02-26  2:54         ` Benjamin Herrenschmidt
2008-02-26  4:38           ` Mark Lord
2008-02-26  5:30             ` Benjamin Herrenschmidt
2008-02-26  5:43               ` Mark Lord
2008-02-26  5:47                 ` Benjamin Herrenschmidt
2008-02-26 16:09                   ` James Bottomley
2008-02-26 21:43                     ` Benjamin Herrenschmidt
2008-02-26 16:25                   ` Mark Lord
2008-02-26 16:51                     ` Mark Lord [this message]
2008-02-26 21:50                       ` Benjamin Herrenschmidt
2008-02-26 21:56                         ` James Bottomley
2008-02-26 22:30                           ` Benjamin Herrenschmidt
2008-02-26 23:16                             ` Benjamin Herrenschmidt
2008-02-26 21:43                     ` Benjamin Herrenschmidt
2008-02-26 23:07                       ` Alan Cox
2008-02-26 23:19                         ` Benjamin Herrenschmidt
2008-02-28  7:36                           ` FUJITA Tomonori
2008-02-28  7:44                             ` Benjamin Herrenschmidt
2008-02-26  2:52       ` Benjamin Herrenschmidt
2008-02-26  0:22 ` Jeff Garzik
2008-02-26  0:28   ` Mark Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47C4439E.2000606@rtr.ca \
    --to=liml@rtr.ca \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alan@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).