From: Yuanquan Chen <B41889@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: r61911@freescale.com, Yuanquan Chen <B41889@freescale.com>
Subject: [PATCH] powerpc/pci-hotplug: fix the rescanned pci device's dma_set_mask issue
Date: Fri, 23 Nov 2012 12:29:28 +0800 [thread overview]
Message-ID: <1353644968-29469-1-git-send-email-B41889@freescale.com> (raw)
On powerpc arch, dma_ops of rescanned pci device after system's booting up won't be
initialized by system, so it will fail to execute the dma_set_mask in the device's
driver. Initialize it to solve this issue.
Signed-off-by: Yuanquan Chen <B41889@freescale.com>
---
arch/powerpc/include/asm/dma-mapping.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 7816087..22eae53 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -126,8 +126,11 @@ static inline int dma_supported(struct device *dev, u64 mask)
{
struct dma_map_ops *dma_ops = get_dma_ops(dev);
- if (unlikely(dma_ops == NULL))
- return 0;
+ if (unlikely(dma_ops == NULL)) {
+ set_dma_ops(dev, &dma_direct_ops);
+ set_dma_offset(dev, PCI_DRAM_OFFSET);
+ dma_ops = &dma_direct_ops;
+ }
if (dma_ops->dma_supported == NULL)
return 1;
return dma_ops->dma_supported(dev, mask);
--
1.7.9.5
next reply other threads:[~2012-11-23 4:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-23 4:29 Yuanquan Chen [this message]
2012-11-25 12:41 ` [PATCH] powerpc/pci-hotplug: fix the rescanned pci device's dma_set_mask issue Kumar Gala
2012-11-26 5:29 ` Chen Yuanquan-B41889
2012-11-28 2:34 ` Chen Yuanquan-B41889
2012-11-28 17:34 ` Kumar Gala
2012-12-04 14:32 ` Kumar Gala
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=1353644968-29469-1-git-send-email-B41889@freescale.com \
--to=b41889@freescale.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=r61911@freescale.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).