From: Darren Stevens <darren@stevens-zone.net>
To: linuxppc-dev@lists.ozlabs.org,
Christian Zigotzky <chzigotzky@xenosoft.de>,
Julian Margetson <runaway@candw.ms>,
Scott Wood <oss@buserror.net>
Subject: [PATCH RFC] powerpc/kernel: Don't check for dev->dma_mask in fsl_set_dma_mask
Date: Sun, 02 Sep 2018 12:30:34 +0100 (BST) [thread overview]
Message-ID: <4c7f98c86ad.343ea8c1@auth.smtp.1and1.co.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 178 bytes --]
AmigaOS...........: http://yam.ch/
Unix/MacOS/Windows: http://www.mozilla.com/thunderbird/
General information about MIME can be found at:
http://en.wikipedia.org/wiki/MIME
[-- Attachment #2: Type: text/plain, Size: 1037 bytes --]
To enable use of dma to all ram on a corenet generic system, we add the
function fsl_pci_dma_set_mask, and link it into the ppc.md structure.
But this function checks for the presence of dev->dma_mask and dma_ops
at entry, and fails if one or other are missing. Powerpc's dma_set_mask
(which it is called from) doesn't check this until after it has set the
dma_mask for pci devs, this difference shows up on a Cyrus (AmigaOne X5000)
- a soundblaster live pci card, will works properly if memory is limited
to <4G, but fail on probe with the following message if the memory is >=4G
[ 4.646531] snd_emu10k1 1000:04:04.0: architecture does not support PCI
busmaster DMA with mask 0x7fffffff
Remove the dev->mask tests to make the routines behave similarly.
Signed-off-by: Darren Stevens <darren@stevens-zone.net>
---
This fix looks wrong to me, although it works. The test needs to be removed,
moving it to the end of the function doesn't work either. This needs someone
with more knowledge of what's going on to take a look.
[-- Attachment #3: dma.patch --]
[-- Type: text/plain, Size: 551 bytes --]
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 918be81..36b3c86 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -127,9 +127,6 @@ static inline void setup_swiotlb_ops(struct pci_controller *hose) {}
static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
{
- if (!dev->dma_mask || !dma_supported(dev, dma_mask))
- return -EIO;
-
/*
* Fix up PCI devices that are able to DMA to the large inbound
* mapping that allows addressing any RAM address from across PCI.
next reply other threads:[~2018-09-02 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-02 11:30 Darren Stevens [this message]
2018-09-03 7:04 ` [PATCH RFC] powerpc/kernel: Don't check for dev->dma_mask in fsl_set_dma_mask Christophe LEROY
2018-10-20 23:19 ` Scott Wood
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=4c7f98c86ad.343ea8c1@auth.smtp.1and1.co.uk \
--to=darren@stevens-zone.net \
--cc=chzigotzky@xenosoft.de \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oss@buserror.net \
--cc=runaway@candw.ms \
/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).