From: Catalin Marinas <catalin.marinas@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
Mark Salter <msalter@redhat.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC] ARM64: simplify dma_get_ops
Date: Tue, 17 Nov 2015 12:22:51 +0000 [thread overview]
Message-ID: <20151117122250.GH6556@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <5118146.8KqrJiJrDe@wuerfel>
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
next prev parent reply other threads:[~2015-11-17 12:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 16:25 Arnd Bergmann
2015-11-16 18:39 ` Catalin Marinas
2015-11-16 19:57 ` Arnd Bergmann
2015-11-17 12:22 ` Catalin Marinas [this message]
2015-11-17 12:50 ` Arnd Bergmann
2015-11-27 16:57 ` Catalin Marinas
2015-11-27 20:46 ` Arnd Bergmann
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=20151117122250.GH6556@e104818-lin.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=msalter@redhat.com \
--cc=rafael.j.wysocki@intel.com \
--cc=will.deacon@arm.com \
/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
all inboxes | Powered by JetHome®