From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] iommu: arm-smmu: set a more appropriate DMA mask
Date: Mon, 09 Mar 2015 22:27:02 +0100 [thread overview]
Message-ID: <2824241.CYpYodyNAY@wuerfel> (raw)
In-Reply-To: <2ad6f0a7d198d607e252c420fef52d95dbe048c6.1425581413.git.robin.murphy@arm.com>
On Thursday 05 March 2015 18:56:36 Robin Murphy wrote:
> @@ -1630,6 +1630,13 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
> size = arm_smmu_id_size_to_bits((id >> ID2_OAS_SHIFT) & ID2_OAS_MASK);
> smmu->pa_size = size;
>
> + /*
> + * What the page table walker can address actually depends on which
> + * descriptor format is in use, but since a) we don't know that yet,
> + * and b) it can vary per context bank, this will have to do...
> + */
> + dma_set_mask_and_coherent(smmu->dev, DMA_BIT_MASK(size));
> +
> if (smmu->version == ARM_SMMU_V1) {
> smmu->va_size = smmu->ipa_size;
> size = SZ_4K | SZ_2M | SZ_1G;
>
dma_set_mask_and_coherent() can fail if the parent bus cannot access all
of RAM. While that would be serious misdesign for an IOMMU, you should not
just ignore that failure and at least print a message once.
Why not just attempt to set a 64-bit mask?
Arnd
prev parent reply other threads:[~2015-03-09 21:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-05 18:56 [PATCH] iommu: arm-smmu: set a more appropriate DMA mask Robin Murphy
2015-03-05 21:20 ` Mitchel Humpherys
2015-03-09 21:27 ` Arnd Bergmann [this message]
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=2824241.CYpYodyNAY@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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