iommu/arm-smmu-v3: Increase CMDQ drain timeout value
authorSunil Goutham <sgoutham@cavium.com>
Fri, 5 May 2017 11:17:46 +0000 (16:47 +0530)
committerWill Deacon <will.deacon@arm.com>
Fri, 23 Jun 2017 16:57:56 +0000 (17:57 +0100)
commitb847de4e5087fc8577c38a697d14fd2a5ce93352
treebc37e0ec58a5e42cb4632308b23816730a5c726f
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6
iommu/arm-smmu-v3: Increase CMDQ drain timeout value

Waiting for a CMD_SYNC to be processed involves waiting for the command
queue to drain, which can take an awful lot longer than waiting for a
single entry to become available. Consequently, the common timeout value
of 100us has been observed to be too short on some platforms when a
CMD_SYNC is issued into a queued full of TLBI commands.

This patch resolves the issue by using a different (1s) timeout when
waiting for the CMDQ to drain and using a simple back-off mechanism
when polling the cons pointer in the absence of WFE support.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
[will: rewrote commit message and cosmetic changes]
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c