Commit 9e249c4
iommu/amd: serialize sequence allocation under concurrent TLB invalidations
With concurrent TLB invalidations, completion wait randomly gets timed out
because cmd_sem_val was incremented outside the IOMMU spinlock, allowing
CMD_COMPL_WAIT commands to be queued out of sequence and breaking the
ordering assumption in wait_on_sem().
Move the cmd_sem_val increment under iommu->lock so completion sequence
allocation is serialized with command queuing.
And remove the unnecessary return.
Fixes: d2a0cac ("iommu/amd: move wait_on_sem() out of spinlock")
Tested-by: Srikanth Aithal <sraithal@amd.com>
Reported-by: Srikanth Aithal <sraithal@amd.com>
Signed-off-by: Ankit Soni <Ankit.Soni@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>1 parent 5b0530b commit 9e249c4
3 files changed
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1885 | 1885 | | |
1886 | 1886 | | |
1887 | 1887 | | |
1888 | | - | |
| 1888 | + | |
1889 | 1889 | | |
1890 | 1890 | | |
1891 | 1891 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1439 | 1439 | | |
1440 | 1440 | | |
1441 | 1441 | | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
1442 | 1448 | | |
1443 | 1449 | | |
1444 | 1450 | | |
| |||
1453 | 1459 | | |
1454 | 1460 | | |
1455 | 1461 | | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | 1462 | | |
1460 | 1463 | | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1461 | 1467 | | |
1462 | 1468 | | |
1463 | 1469 | | |
| |||
3177 | 3183 | | |
3178 | 3184 | | |
3179 | 3185 | | |
3180 | | - | |
3181 | | - | |
3182 | 3186 | | |
3183 | 3187 | | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
3184 | 3191 | | |
3185 | 3192 | | |
3186 | 3193 | | |
| |||
3194 | 3201 | | |
3195 | 3202 | | |
3196 | 3203 | | |
3197 | | - | |
3198 | 3204 | | |
3199 | 3205 | | |
3200 | 3206 | | |
| |||
0 commit comments