From: eric.y.miao@gmail.com (Eric Miao)
To: linux-arm-kernel@lists.infradead.org
Subject: Revert "[ARM] pxa: remove now unnecessary dma_needs_bounce()"
Date: Mon, 21 Mar 2011 15:21:24 +0800 [thread overview]
Message-ID: <AANLkTimGBGNdBa2NzYDTOXxNF-1MgOOC502a-ATfNoBA@mail.gmail.com> (raw)
In-Reply-To: <AANLkTin0hVKnicRtxLwxwPJZU6tYiuTZnbGUfxt9bLYe@mail.gmail.com>
Hrm... checked again. The IXP4xx build regression seems to have been fixed
by the below commits:
88a5810 ARM: fix IXP4xx build failure
710224f arm: fix "arm: fix pci_set_consistent_dma_mask for dmabounce devices"
Yet the simple introduction of dma_set_coherent_mask() doesn't look
like to be a correct fix to this particular issue.
Barry,
You may want to follow the lead more and help come up with a proper fix.
- eric
On Mon, Mar 21, 2011 at 2:12 PM, Barry Song <21cnbao@gmail.com> wrote:
> Hi Eric/Fujita/Russell,
> As i checked the "remove now unnecessary dma_needs_bounce()" patches
> of Eric, I found you were all involved. Due to compiling error of
> IXP4xx platforms, the patch was reverted by Russell in
> http://ftp.arm.linux.org.uk/git/gitweb.cgi?p=linux-2.6-arm.git;a=commit;h=0485e18bc4112a3b548baa314c24bfbece4d156b
>
> But I think Eric's patch made much sense. dma_needs_bounce() is very
> ambiguous in the whole arm arch, if devices use dma_mask right,
> map_single() will decide whether it needs DMA bounce by the following
> logic:
> ? ? ? ?if (dev->dma_mask) {
> ? ? ? ? ? ? ? ?unsigned long mask = *dev->dma_mask;
> ? ? ? ? ? ? ? ?unsigned long limit;
>
> ? ? ? ? ? ? ? ?limit = (mask + 1) & ~mask;
> ? ? ? ? ? ? ? ?if (limit && size > limit) {
> ? ? ? ? ? ? ? ? ? ? ? ?dev_err(dev, "DMA mapping too big (requested %#x "
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"mask %#Lx)\n", size, *dev->dma_mask);
> ? ? ? ? ? ? ? ? ? ? ? ?return ~0;
> ? ? ? ? ? ? ? ?}
>
> ? ? ? ? ? ? ? ?/*
> ? ? ? ? ? ? ? ? * Figure out if we need to bounce from the DMA mask.
> ? ? ? ? ? ? ? ? */
> ? ? ? ? ? ? ? ?needs_bounce = (dma_addr | (dma_addr + size - 1)) & ~mask;
> ? ? ? ?}
>
> Basically, we don't need dma_needs_bounce() for all chips at all. For
> saa1111, it is needed only because a bug in the SoC.
> For ?assabet and pfs168 machines, it gave a workaound by self-defined
> a dma_needs_bounce function.
> return ((machine_is_assabet() || machine_is_pfs168()) &&
> ? ? ? ? ? ? ? ?(addr >= 0xc8000000 || (addr + size) >= 0xc8000000));
>
> I think the right workaround for saa1111 should be setting dma_mask of
> related devices to 0xc8000000 for the assabet and pfs168 machines but
> not add a unnecessary APIs, ?which will cause other SoCs need to
> finish the function if they use dma bounce too.
>
> Eric's path make much sense, we should delete the unnecessary
> dma_needs_bounce() from the whole arm arch at all. If all related
> people agree, we need another patch to fix it.
>
> Thanks
> Barry
>
next prev parent reply other threads:[~2011-03-21 7:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 6:12 Revert "[ARM] pxa: remove now unnecessary dma_needs_bounce()" Barry Song
2011-03-21 7:21 ` Eric Miao [this message]
2011-03-21 14:54 ` Russell King - ARM Linux
2011-03-21 14:58 ` Eric Miao
2011-03-21 15:03 ` Russell King - ARM Linux
2011-03-22 2:00 ` Barry Song
2011-03-22 8:17 ` Russell King - ARM Linux
2011-03-23 3:15 ` Barry Song
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=AANLkTimGBGNdBa2NzYDTOXxNF-1MgOOC502a-ATfNoBA@mail.gmail.com \
--to=eric.y.miao@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).