devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Russell King <linux@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Cc: stefano.stabellini@eu.citrix.com,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>
Subject: [PATCH] of: set dma_mask to point to coherent_dma_mask
Date: Wed, 30 Oct 2013 00:05:22 -0500	[thread overview]
Message-ID: <1383109522-6879-1-git-send-email-robherring2@gmail.com> (raw)

From: Rob Herring <rob.herring@calxeda.com>

Platform devices created by DT code don't initialize dma_mask pointer to
anything. Set it to coherent_dma_mask by default if the architecture
code has not set it.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
I think this is at least part of what is needed to fix dma_mask issue
raised by Stefano [1]. Things should work AFAICT with just this, but
I suppose the xgmac driver needs to set the mask as well (not relying
on the default), but some pointing the dma_mask to a valid value is
needed first.

Rob

[1] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg528236.html

 drivers/of/platform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index f6dcde2..fce088e 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -215,6 +215,8 @@ static struct platform_device *of_platform_device_create_pdata(
 	dev->archdata.dma_mask = 0xffffffffUL;
 #endif
 	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!dev->dev.dma_mask)
+		dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
 	dev->dev.bus = &platform_bus_type;
 	dev->dev.platform_data = platform_data;
 
-- 
1.8.1.2

             reply	other threads:[~2013-10-30  5:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30  5:05 Rob Herring [this message]
2013-11-02 18:07 ` [PATCH] of: set dma_mask to point to coherent_dma_mask Grant Likely
     [not found]   ` <20131102180724.D8FC5C40F02-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-11-06 16:46     ` Stefano Stabellini
     [not found]       ` <alpine.DEB.2.02.1311061642270.26077-7Z66fg9igcxYtxbxJUhB2Dgeux46jI+i@public.gmane.org>
2013-11-11 16:59         ` Stefano Stabellini
     [not found]           ` <alpine.DEB.2.02.1311111658100.26077-7Z66fg9igcxYtxbxJUhB2Dgeux46jI+i@public.gmane.org>
2013-11-12  7:01             ` Grant Likely
2013-11-12 10:19             ` Russell King - ARM Linux
     [not found]               ` <20131112101955.GF16735-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-11-12 13:21                 ` Stefano Stabellini

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=1383109522-6879-1-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rob.herring@calxeda.com \
    --cc=stefano.stabellini@eu.citrix.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 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).