public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: khc@pm.waw.pl (Krzysztof Halasa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: fix pci_set_consistent_dma_mask for dmabounce devices
Date: Sat, 28 Aug 2010 19:58:11 +0200	[thread overview]
Message-ID: <m3sk1yzkjw.fsf@intrepid.localdomain> (raw)
In-Reply-To: <20100819174426O.fujita.tomonori@lab.ntt.co.jp> (FUJITA Tomonori's message of "Thu, 19 Aug 2010 17:51:48 +0900")

What's the outcome of the following?

Russell, are you going to apply it as is, or is a better (short-term)
fix being made?

FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> writes:

> This fixes the regression of the
> 6fee48cd330c68332f9712bc968d934a1a84a32a commit.
>
> After the above commit, pci_set_consistent_dma_mask doesn't work for
> dmabounce devices. It converts ARM to use the generic implementation
> of pci_set_consistent_dma_mask.
>
> The root cause that ARM's CONFIG_DMABOUNCE uses dev->coherent_dma_mask
> for the dma mask of a device _AND_ a bus. dev->coherent_dma_mask is
> supposed to represent the dma mask of a device.
>
> The proper solution is that device and bus has the own dma mask
> respectively (POWERPC does the similar). But the fix must go to stable
> trees so this simple (and hacky a bit) patch works better for now.
>
> For further information: http://lkml.org/lkml/2010/8/10/272
>
> Reported-by: Krzysztof Halasa <khc@pm.waw.pl>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Tested-by: Krzysztof Halasa <khc@pm.waw.pl>
> Cc: stable at kernel.org
> ---
>  arch/arm/mm/dma-mapping.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index c704eed..2a3fc2e 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -77,6 +77,11 @@ static struct page *__dma_alloc_buffer(struct device *dev, size_t size, gfp_t gf
>  	if (mask < 0xffffffffULL)
>  		gfp |= GFP_DMA;
>  
> +#ifdef CONFIG_DMABOUNCE
> +	if (dev->archdata.dmabounce)
> +		gfp |= GFP_DMA;
> +#endif
> +
>  	page = alloc_pages(gfp, order);
>  	if (!page)
>  		return NULL;

-- 
Krzysztof Halasa

  reply	other threads:[~2010-08-28 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19  8:51 [PATCH] arm: fix pci_set_consistent_dma_mask for dmabounce devices FUJITA Tomonori
2010-08-28 17:58 ` Krzysztof Halasa [this message]
2010-09-01  8:57   ` Russell King - ARM Linux
2010-09-02  2:50     ` FUJITA Tomonori
2010-09-02  5:59       ` Richard Cochran
2010-09-05 10:50         ` Eric Miao
2010-09-05 11:21           ` Russell King - ARM Linux
2010-09-05 11:58             ` Eric Miao
2010-09-05 11:25       ` Russell King - ARM Linux
2010-09-05 23:32         ` FUJITA Tomonori
2010-09-14 21:23           ` Krzysztof Halasa

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=m3sk1yzkjw.fsf@intrepid.localdomain \
    --to=khc@pm.waw.pl \
    --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