mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@linux-m68k.org>
To: Finn Thain <fthain@telegraphics.com.au>,
	linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>
Subject: Re: [RFC] m68k: Set up dma mask for platform devices
Date: Tue, 15 May 2018 00:10:15 +1000	[thread overview]
Message-ID: <75ea772a-75d8-d24b-880c-2cd64706db9b@linux-m68k.org> (raw)
In-Reply-To: <S1751284AbeEMBAx/20180513010053Z+394@vger.kernel.org>

Hi Finn,

On 13/05/18 11:00, Finn Thain wrote:
> This avoids a WARNING splat when loading the macsonic or macmace driver.
> Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is no
> coherent_dma_mask").
> 
> This implementation of arch_setup_pdev_archdata() differs from the one
> in arch/powerpc in that this one avoids clobbering an existing dma mask.
> For example, this approach preserves the mask set by the initializer for
> struct platform_device mcf_fec0.
> 
> Note that either approach would make that initializer redundant and
> commit f61e64310b75 ("m68k: set dma and coherent masks for platform
> FEC ethernets") could be reverted.

Seems reasonable to me. I would be happy to do this and the back out
commit f61e64310b75 ("m68k: set dma and coherent masks for platform
FEC ethernets").

Regards
Greg


> ---
>   arch/m68k/kernel/dma.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c
> index c01b9b8f97bf..463572c4943f 100644
> --- a/arch/m68k/kernel/dma.c
> +++ b/arch/m68k/kernel/dma.c
> @@ -9,6 +9,7 @@
>   #include <linux/dma-mapping.h>
>   #include <linux/device.h>
>   #include <linux/kernel.h>
> +#include <linux/platform_device.h>
>   #include <linux/scatterlist.h>
>   #include <linux/slab.h>
>   #include <linux/vmalloc.h>
> @@ -165,3 +166,12 @@ const struct dma_map_ops m68k_dma_ops = {
>   	.sync_sg_for_device	= m68k_dma_sync_sg_for_device,
>   };
>   EXPORT_SYMBOL(m68k_dma_ops);
> +
> +void arch_setup_pdev_archdata(struct platform_device *pdev)
> +{
> +	if (pdev->dev.coherent_dma_mask == DMA_MASK_NONE &&
> +	    pdev->dev.dma_mask == NULL) {
> +		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> +		pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
> +	}
> +}
> 

       reply	other threads:[~2018-05-14 14:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <S1751284AbeEMBAx/20180513010053Z+394@vger.kernel.org>
2018-05-14 14:10 ` Greg Ungerer [this message]
2018-05-13  1:00 Finn Thain

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=75ea772a-75d8-d24b-880c-2cd64706db9b@linux-m68k.org \
    --to=gerg@linux-m68k.org \
    --cc=fthain@telegraphics.com.au \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@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

all inboxes | Powered by JetHome®