From: Sven Schnelle <svens@stackframe.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Helge Deller <deller@gmx.de>,
linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: allow larger than require DMA masks
Date: Mon, 23 Sep 2019 23:14:15 +0200 [thread overview]
Message-ID: <20190923211415.GA1875@stackframe.org> (raw)
In-Reply-To: <20190215144559.8777-1-hch@lst.de>
Hi,
On Fri, Feb 15, 2019 at 03:45:54PM +0100, Christoph Hellwig wrote:
> Hi all,
>
> this series finishes off converting our dma mask model to split between
> device capabilities (dev->dma_mask and dev->coherent_dma_mask) and system
> limitations (dev->bus_dma_mask). We already accept larger than required
> masks in most dma_map_ops implementation, in case of x86 and
> implementations based on it since the dawn of time. Only one parisc
> and two sparc64 instances failed larger than required DMA masks, and
> this series fixes that up and updates the documentation that devices
> don't need to handle DMA mask fallbacks.
>
I just tried latest linux-5.4 git on my hp c8000 (parisc), and got the following
error:
[ 27.246866] sata_sil24 0000:00:01.0: Applying completion IRQ loss on PCI-X errata fix
[ 27.336968] sata_sil24 0000:00:01.0: DMA enable failed
[ 27.476922] sata_sil24: probe of 0000:00:01.0 failed with error -5
This is caused by commit dcc02c19cc06bd7bc1b6db0aa0087a2b6eb05b94:
Author: Christoph Hellwig <hch@lst.de>
Date: Mon Aug 26 12:57:24 2019 +0200
sata_sil24: use dma_set_mask_and_coherent
Use the dma_set_mask_and_coherent helper to set the DMA mask. Rely
on the relatively recent change that setting a larger than required
mask will never fail to avoid the need for the boilerplate 32-bit
fallback code.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
However, the real problem seems to be in sba_dma_supported():
» /* Documentation/DMA-API-HOWTO.txt tells drivers to try 64-bit
» * first, then fall back to 32-bit if that fails.
» * We are just "encouraging" 32-bit DMA masks here since we can
» * never allow IOMMU bypass unless we add special support for ZX1.
» */
if (mask > ~0U)
» » return 0;
Removing the if() makes the DMA mapping work. It's almost midnight here,
so i won't look into that any further today. Does anyone have an opinion
on this behaviour? Otherwise i will look a bit more into this in the
next days.
Regards
Sven
next prev parent reply other threads:[~2019-09-23 21:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-15 14:45 allow larger than require DMA masks Christoph Hellwig
2019-02-15 14:45 ` [PATCH 1/5] ccio: allow large " Christoph Hellwig
2019-02-15 14:45 ` [PATCH 2/5] sparc64: refactor the ali DMA quirk Christoph Hellwig
2019-02-15 18:34 ` David Miller
2019-02-15 14:45 ` [PATCH 3/5] sparc64/iommu: allow large DMA masks Christoph Hellwig
2019-02-15 18:34 ` David Miller
2019-02-15 14:45 ` [PATCH 4/5] sparc64/pci_sun4v: " Christoph Hellwig
2019-02-15 18:35 ` David Miller
2019-02-15 14:45 ` [PATCH 5/5] Documentation/DMA-API-HOWTO: update dma_mask sections Christoph Hellwig
2019-02-18 1:26 ` Yang, Shunyong
2019-09-23 21:14 ` Sven Schnelle [this message]
2019-09-24 0:59 ` allow larger than require DMA masks James Bottomley
2019-09-24 21:25 ` Christoph Hellwig
2019-09-24 21:59 ` James Bottomley
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=20190923211415.GA1875@stackframe.org \
--to=svens@stackframe.org \
--cc=deller@gmx.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.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).