All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Fomichev <fomichev.ru@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: linux@yadro.com
Subject: [RFC PATCH] powerpc: fix get_arch_dma_ops() for NTB devices
Date: Mon, 28 Jan 2019 16:32:05 +0300	[thread overview]
Message-ID: <20190128133203.mon4a3nkrzijn43g@alfbook-pro.local> (raw)

get_dma_ops() falls into arch-dependant get_arch_dma_ops(), which
historically returns NULL on PowerPC. Therefore dma_set_mask() fails.
This affects Switchtec (and probably other) NTB devices, that they fail
to initialize.
The proposed patch should fix the issue.

---
 arch/powerpc/include/asm/dma-mapping.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index ebf6680..cb6ac96 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -70,14 +70,11 @@ extern struct dma_map_ops dma_iommu_ops;
 #endif
 extern const struct dma_map_ops dma_nommu_ops;
 
+extern const struct dma_map_ops *get_pci_dma_ops(void);
+
 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 {
-	/* We don't handle the NULL dev case for ISA for now. We could
-	 * do it via an out of line call but it is not needed for now. The
-	 * only ISA DMA device we support is the floppy and we have a hack
-	 * in the floppy driver directly to get a device for us.
-	 */
-	return NULL;
+	return get_pci_dma_ops();
 }
 
 /*
-- 
2.7.4

             reply	other threads:[~2019-01-28 20:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 13:32 Alexander Fomichev [this message]
2019-01-30 12:58 ` [RFC PATCH] powerpc: fix get_arch_dma_ops() for NTB devices Michael Ellerman
2019-02-04  8:17   ` Christoph Hellwig
2019-02-05 11:20     ` Michael Ellerman
2019-02-05 16:13       ` Christoph Hellwig

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=20190128133203.mon4a3nkrzijn43g@alfbook-pro.local \
    --to=fomichev.ru@gmail.com \
    --cc=linux@yadro.com \
    --cc=linuxppc-dev@lists.ozlabs.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 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.