linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhong <zhong@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: PowerPC email list <linuxppc-dev@lists.ozlabs.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Paul Mackerras <paulus@samba.org>
Subject: [PATCH powerpc] Revert c6102609 and replace it with the correct fix for vio dma mask setting
Date: Thu, 28 Nov 2013 17:22:25 +0800	[thread overview]
Message-ID: <1385630545.2439.11.camel@ThinkPad-T5421> (raw)
In-Reply-To: <1384993347.26969.124.camel@pasglop>

This patch reverts my previous "fix", and replace it with the correct
fix from Russell. 

And as Russell pointed out -- dma_set_mask_and_coherent() (and the other
dma_set_mask() functions) are really supposed to be used by drivers
only.

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/vio.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 76a6482..d771778 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1419,7 +1419,8 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
 
 		/* needed to ensure proper operation of coherent allocations
 		 * later, in case driver doesn't set it explicitly */
-		dma_coerce_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64));
+		viodev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
+		viodev->dev.dma_mask = &viodev->dev.coherent_dma_mask;
 	}
 
 	/* register with generic device framework */

      parent reply	other threads:[~2013-11-27  9:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19  8:11 [RFC PATCH powerpc] Fix a dma_mask issue of vio Li Zhong
2013-11-20  1:28 ` Benjamin Herrenschmidt
2013-11-20  2:04   ` Li Zhong
2013-11-20 23:23   ` Russell King - ARM Linux
2013-11-21  0:01     ` Benjamin Herrenschmidt
2013-11-21  0:08       ` Russell King - ARM Linux
2013-11-21  0:22         ` Benjamin Herrenschmidt
2013-11-21  1:56           ` Li Zhong
2013-11-28  9:22           ` Li Zhong [this message]

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=1385630545.2439.11.camel@ThinkPad-T5421 \
    --to=zhong@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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).