Commit ec56016
iommu/qcom: Index contexts by asid number to allow asid 0
This driver was indexing the contexts by asid-1, which is probably
done under the assumption that the first ASID is always 1.
Unfortunately this is not always true: at least for MSM8956 and
MSM8976's GPU IOMMU, the gpu_user context's ASID number is zero.
To allow using a zero asid number, index the contexts by `asid`
instead of by `asid - 1`.
While at it, also enhance human readability by renaming the
`num_ctxs` member of struct qcom_iommu_dev to `max_asid`.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230622092742.74819-5-angelogioacchino.delregno@collabora.com
Signed-off-by: Will Deacon <will@kernel.org>1 parent 9f3fef2 commit ec56016
1 file changed
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | | - | |
538 | | - | |
| 537 | + | |
539 | 538 | | |
540 | | - | |
541 | | - | |
542 | | - | |
| 539 | + | |
| 540 | + | |
543 | 541 | | |
544 | 542 | | |
545 | 543 | | |
| |||
694 | 692 | | |
695 | 693 | | |
696 | 694 | | |
697 | | - | |
| 695 | + | |
698 | 696 | | |
699 | 697 | | |
700 | 698 | | |
| |||
706 | 704 | | |
707 | 705 | | |
708 | 706 | | |
709 | | - | |
| 707 | + | |
710 | 708 | | |
711 | 709 | | |
712 | 710 | | |
| |||
753 | 751 | | |
754 | 752 | | |
755 | 753 | | |
756 | | - | |
| 754 | + | |
757 | 755 | | |
758 | 756 | | |
759 | 757 | | |
760 | | - | |
| 758 | + | |
761 | 759 | | |
762 | 760 | | |
763 | 761 | | |
| |||
0 commit comments