iommu/arm-smmu-v3: Increase maximum size of queues
authorWill Deacon <will.deacon@arm.com>
Thu, 16 May 2019 15:08:47 +0000 (16:08 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 18 Jun 2019 17:11:20 +0000 (18:11 +0100)
commitd25f6ead162eab3f51b6616be23691ac42e141b5
treeedd6e16de5faff7c5190378bded091d26910cc4c
parentcd6c84d8f0cdc911df435bb075ba22ce3c605b07
iommu/arm-smmu-v3: Increase maximum size of queues

We've been artificially limiting the size of our queues to 4k so that we
don't end up allocating huge amounts of physically-contiguous memory at
probe time. However, 4k is only enough for 256 commands in the command
queue, so instead let's try to allocate the largest queue that the SMMU
supports, retrying with a smaller size if the allocation fails.

The caveat here is that we have to limit our upper bound based on
CONFIG_CMA_ALIGNMENT to ensure that our queue allocations remain
natually aligned, which is required by the SMMU architecture.

Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c