[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151117122250.GH6556@e104818-lin.cambridge.arm.com>
Date: Tue, 17 Nov 2015 12:22:51 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Arnd Bergmann <arnd@...db.de>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Will Deacon <will.deacon@....com>,
linux-kernel@...r.kernel.org,
Suravee Suthikulpanit <Suravee.Suthikulpanit@....com>,
Mark Salter <msalter@...hat.com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC] ARM64: simplify dma_get_ops
On Mon, Nov 16, 2015 at 08:57:41PM +0100, Arnd Bergmann wrote:
> On Monday 16 November 2015 18:39:41 Catalin Marinas wrote:
> > On Mon, Nov 16, 2015 at 05:25:48PM +0100, Arnd Bergmann wrote:
> > > @@ -985,7 +977,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
> > > struct iommu_ops *iommu, bool coherent)
> > > {
> > > if (!acpi_disabled && !dev->archdata.dma_ops)
> > > - dev->archdata.dma_ops = dma_ops;
> > > + dev->archdata.dma_ops = &swiotlb_dma_ops;
> >
> > Why do we still keep the !acpi_disabled check here? If I remove it, the
> > WARN_ON() above disappears.
>
> Ah, good. That must be my mistake then. This looks much better.
I merged this patch with the above change. Thanks.
> On a related note, we should also urgently fix the
> arch_setup_dma_ops() function to no longer ignore the base and size
> arguments. For dma_base, we can simply WARN_ON(dma_base != 0), so we
> can implement support for that whenever we need it,
I think we should, at least until we implement support for
dev->dma_pfn_offset. I'm not sure about iommu though, maybe there are
working configurations with dma_base != 0.
> but for the size we need to prevent drivers from calling
> dma_set_mask() with an argument larger than the size we pass in here,
> unless the size is also larger than max_pfn.
We have a default mask set up in of_dma_configure() based on size and
dma_base. Can we check the new mask against the default one?
--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists