From: Robin Murphy <robin.murphy@arm.com>
To: hch@lst.de, m.szyprowski@samsung.com, iommu@lists.linux-foundation.org
Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org,
sudeep.holla@arm.com, robh+dt@kernel.org, frowand.list@gmail.com,
gregkh@linuxfoundation.org, joro@8bytes.org, x86@kernel.org
Subject: [RFC PATCH 3/4] of/device: Set bus DMA mask as appropriate
Date: Tue, 10 Jul 2018 18:17:18 +0100 [thread overview]
Message-ID: <346c004b599fb77a2006a4eeb992b30feb06fce5.1531239284.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1531239284.git.robin.murphy@arm.com>
When an explicit DMA limit is described by firmware, we need to remember
it regardless of how drivers might subsequently update their devices'
masks. The new bus_dma_mask field does that.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
drivers/of/device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 33d85511d790..0d39633e8545 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -149,6 +149,7 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
* set by the driver.
*/
mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1);
+ dev->bus_dma_mask = mask;
dev->coherent_dma_mask &= mask;
*dev->dma_mask &= mask;
--
2.17.1.dirty
next prev parent reply other threads:[~2018-07-10 18:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 17:17 [RFC PATCH 0/4] Stop losing firmware-set DMA masks Robin Murphy
2018-07-10 17:17 ` [RFC PATCH 1/4] dma-mapping: Generalise dma_32bit_limit flag Robin Murphy
2018-07-10 18:04 ` Christoph Hellwig
2018-07-11 16:56 ` Robin Murphy
2018-07-12 7:20 ` Christoph Hellwig
2018-07-10 17:17 ` [RFC PATCH 2/4] ACPI/IORT: Set bus DMA mask as appropriate Robin Murphy
2018-07-10 18:04 ` Christoph Hellwig
2018-07-11 18:03 ` Robin Murphy
2018-07-10 17:17 ` Robin Murphy [this message]
2018-07-10 17:17 ` [RFC PATCH 4/4] iommu/dma: Respect bus DMA limit for IOVAs Robin Murphy
2018-07-10 18:02 ` [RFC PATCH 0/4] Stop losing firmware-set DMA masks Christoph Hellwig
2018-07-10 18:11 ` Robin Murphy
2018-07-10 18:12 ` Atish Patra
2018-07-11 14:40 ` Rob Herring
2018-07-11 16:03 ` Robin Murphy
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=346c004b599fb77a2006a4eeb992b30feb06fce5.1531239284.git.robin.murphy@arm.com \
--to=robin.murphy@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hanjun.guo@linaro.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=m.szyprowski@samsung.com \
--cc=robh+dt@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=x86@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).