Re: remove the ->mapping_error method from dma_map_ops V2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Christoph Hellwig <hch@xxxxxx>
- Subject: Re: remove the ->mapping_error method from dma_map_ops V2
- From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 29 Nov 2018 09:44:05 -0800
- Cc: Russell King - ARM Linux <linux@xxxxxxxxxxxxxxx>, linux-arch@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, robin.murphy@xxxxxxx, "the arch/x86 maintainers" <x86@xxxxxxxxxx>, Linux List Kernel Mailing <linux-kernel@xxxxxxxxxxxxxxx>, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, David Woodhouse <dwmw2@xxxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
- In-reply-to: <20181129162323.GA27068@lst.de>
- References: <CAHk-=wgfGzXuDAKFQPdzMib3QCRHfSTsy5=gLU-WCoya+Ym+1A@mail.gmail.com> <11829e3c-7302-f821-cf5c-863e5267a17b@arm.com> <CAHk-=whxf0zqutExPr_j1A625Z3gcL6k_ABzKo1BtzN4F93hkA@mail.gmail.com> <20181123065511.GA17856@lst.de> <20181128074117.GA21126@lst.de> <CAHk-=wg5+rXK8dpjkSmK7tuz29VfxVWNEwmTVYB409mmyLkeew@mail.gmail.com> <20181128174545.GJ30658@n2100.armlinux.org.uk> <CAHk-=whnz4Kty6cas11bc2Gh=9zTzeeRS2k=dV9Hfc4B=xnHkQ@mail.gmail.com> <20181128180841.GM30658@n2100.armlinux.org.uk> <CAHk-=whcbiSxSUprsKjVPEdN5-+o8WnTGiKxEV-+HbKNDs=iNA@mail.gmail.com> <20181129162323.GA27068@lst.de>
On Thu, Nov 29, 2018 at 8:23 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> We can. At least in theory. The problem is that depending on the
> crazy mapping from physical and kernel virtual address to dma addresses
> these might be pages at pretty random places. Look at fun like
> arch/x86/pci/sta2x11-fixup.c for how ugly these mappings could look.
>
> It also means that we might have setup swiotlb on just about every
> 32-bit architecture, even if it has no real addressing limit except for
> the one we imposed.
No. Really. If there's no iotlb, then you just mark that one page
reserved. It simply doesn't get used. It doesn't mean you suddenly
need a swiotlb.
If there *is* a iotlb, none of this should matter, because you'd just
never map anything into that page.
But whatever. It's independent from the patch series under discussion.
Make dma_mapping_error() at least return a real error (eg -EINVAL, or
whatever is the common error), and we can maybe do this later.
Or, better yet, plan on removing the single-page dma mappign entirely
at a later date, and make the issue moot.
Linus
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]