All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>,
	<linux-mips@linux-mips.org>, <nbd@openwrt.org>, <yanh@lemote.com>,
	<linux-kernel@vger.kernel.org>, <ralf@linux-mips.org>,
	<alex.smith@imgtec.com>, <taohl@lemote.com>, <chenhc@lemote.com>,
	<blogic@openwrt.org>
Subject: Re: [PATCH] MIPS: DMA: fix coherent alloc in non-coherent systems
Date: Thu, 30 Oct 2014 10:07:32 +0000	[thread overview]
Message-ID: <54520DE4.9090008@imgtec.com> (raw)
In-Reply-To: <20141030014753.13189.48344.stgit@linux-yegoshin>

Hi Leonid,

On 30/10/14 01:48, Leonid Yegoshin wrote:
> A default dma_alloc_coherent() fails to alloc a coherent memory on non-coherent
> systems in case of device->coherent_dma_mask covering the whole memory space.
> 
> In case of non-coherent systems the coherent memory on MIPS is restricted by
> size of un-cachable segment and should be located in ZONE_DMA.

Has this pretty much always been broken?

> @@ -81,6 +81,11 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
>  		dma_flag = __GFP_DMA;
>  	else
>  #endif
> +#ifdef CONFIG_ZONE_DMA
> +	     if (coherent && !plat_device_is_coherent(dev))

Broken indentation. Please fix to use tabs.

> +			dma_flag = __GFP_DMA;
> +	else
> +#endif
>  #if defined(CONFIG_ZONE_DMA32) && defined(CONFIG_ZONE_DMA)
>  	     if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
>  			dma_flag = __GFP_DMA;

Other than that, this patch looks okay to me (but those with more
experience with MIPS DMA than me may know better).

Reviewed-by: James Hogan <james.hogan@imgtec.com>

Thanks
James

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>,
	linux-mips@linux-mips.org, nbd@openwrt.org, yanh@lemote.com,
	linux-kernel@vger.kernel.org, ralf@linux-mips.org,
	alex.smith@imgtec.com, taohl@lemote.com, chenhc@lemote.com,
	blogic@openwrt.org
Subject: Re: [PATCH] MIPS: DMA: fix coherent alloc in non-coherent systems
Date: Thu, 30 Oct 2014 10:07:32 +0000	[thread overview]
Message-ID: <54520DE4.9090008@imgtec.com> (raw)
Message-ID: <20141030100732.COxH0vuaPaN17hBcLPdptsGdTMMUkdqmFhDoD2UOGPU@z> (raw)
In-Reply-To: <20141030014753.13189.48344.stgit@linux-yegoshin>

Hi Leonid,

On 30/10/14 01:48, Leonid Yegoshin wrote:
> A default dma_alloc_coherent() fails to alloc a coherent memory on non-coherent
> systems in case of device->coherent_dma_mask covering the whole memory space.
> 
> In case of non-coherent systems the coherent memory on MIPS is restricted by
> size of un-cachable segment and should be located in ZONE_DMA.

Has this pretty much always been broken?

> @@ -81,6 +81,11 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
>  		dma_flag = __GFP_DMA;
>  	else
>  #endif
> +#ifdef CONFIG_ZONE_DMA
> +	     if (coherent && !plat_device_is_coherent(dev))

Broken indentation. Please fix to use tabs.

> +			dma_flag = __GFP_DMA;
> +	else
> +#endif
>  #if defined(CONFIG_ZONE_DMA32) && defined(CONFIG_ZONE_DMA)
>  	     if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
>  			dma_flag = __GFP_DMA;

Other than that, this patch looks okay to me (but those with more
experience with MIPS DMA than me may know better).

Reviewed-by: James Hogan <james.hogan@imgtec.com>

Thanks
James

  parent reply	other threads:[~2014-10-30 10:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30  1:48 [PATCH] MIPS: DMA: fix coherent alloc in non-coherent systems Leonid Yegoshin
2014-10-30  1:48 ` Leonid Yegoshin
2014-10-30  9:48 ` Markos Chandras
2014-10-30  9:48   ` Markos Chandras
2014-10-30  9:51   ` James Hogan
2014-10-30  9:51     ` James Hogan
2014-10-30  9:54     ` Markos Chandras
2014-10-30  9:54       ` Markos Chandras
2014-10-30 10:07 ` James Hogan [this message]
2014-10-30 10:07   ` James Hogan
2014-10-30 18:38   ` Leonid Yegoshin
2014-10-30 18:38     ` Leonid Yegoshin

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=54520DE4.9090008@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=alex.smith@imgtec.com \
    --cc=blogic@openwrt.org \
    --cc=chenhc@lemote.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=nbd@openwrt.org \
    --cc=ralf@linux-mips.org \
    --cc=taohl@lemote.com \
    --cc=yanh@lemote.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.