Commit 6e8b584
NVIDIA: VR: SAUCE: iommu/arm-smmu-v3: Allow ATS to be always on
When a device's default substream attaches to an identity domain, the SMMU
driver currently sets the device's STE between two modes:
Mode 1: Cfg=Translate, S1DSS=Bypass, EATS=1
Mode 2: Cfg=bypass (EATS is ignored by HW)
When there is an active PASID (non-default substream), mode 1 is used. And
when there is no PASID support or no active PASID, mode 2 is used.
The driver will also downgrade an STE from mode 1 to mode 2, when the last
active substream becomes inactive.
However, there are PCIe devices that demand ATS to be always on. For these
devices, their STEs have to use the mode 1 as HW ignores EATS with mode 2.
Change the driver accordingly:
- always use the mode 1
- never downgrade to mode 2
- allocate and retain a CD table (see note below)
Note that these devices might not support PASID, i.e. doing non-PASID ATS.
In such a case, the ssid_bits is set to 0. However, s1cdmax must be set to
a !0 value in order to keep the S1DSS field effective. Thus, when a master
requires ats_always_on, set its s1cdmax to minimal 1, meaning the CD table
will have a dummy entry (SSID=1) that will be never used.
Now, for these device, arm_smmu_cdtab_allocated() will always return true,
v.s. false prior to this change. When its default substream is attached to
an IDENTITY domain, its first CD is NULL in the table, which is a totally
valid case. Thus, drop the WARN_ON().
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
(backported from https://lore.kernel.org/linux-iommu/cover.1768624180.git.nicolinc@nvidia.com)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>1 parent 54cab94 commit 6e8b584
2 files changed
+64
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | | - | |
| 1426 | + | |
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
| |||
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1440 | 1456 | | |
1441 | 1457 | | |
1442 | 1458 | | |
| |||
3189 | 3205 | | |
3190 | 3206 | | |
3191 | 3207 | | |
3192 | | - | |
| 3208 | + | |
| 3209 | + | |
3193 | 3210 | | |
3194 | 3211 | | |
3195 | 3212 | | |
| |||
3203 | 3220 | | |
3204 | 3221 | | |
3205 | 3222 | | |
3206 | | - | |
| 3223 | + | |
3207 | 3224 | | |
3208 | 3225 | | |
3209 | 3226 | | |
| |||
3222 | 3239 | | |
3223 | 3240 | | |
3224 | 3241 | | |
3225 | | - | |
| 3242 | + | |
3226 | 3243 | | |
3227 | 3244 | | |
3228 | 3245 | | |
| |||
3256 | 3273 | | |
3257 | 3274 | | |
3258 | 3275 | | |
3259 | | - | |
| 3276 | + | |
| 3277 | + | |
3260 | 3278 | | |
3261 | 3279 | | |
3262 | 3280 | | |
| |||
3278 | 3296 | | |
3279 | 3297 | | |
3280 | 3298 | | |
3281 | | - | |
| 3299 | + | |
3282 | 3300 | | |
3283 | 3301 | | |
3284 | 3302 | | |
| |||
3516 | 3534 | | |
3517 | 3535 | | |
3518 | 3536 | | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
3519 | 3571 | | |
3520 | 3572 | | |
3521 | 3573 | | |
| |||
3564 | 3616 | | |
3565 | 3617 | | |
3566 | 3618 | | |
3567 | | - | |
3568 | | - | |
3569 | | - | |
3570 | | - | |
3571 | | - | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
3572 | 3622 | | |
3573 | 3623 | | |
3574 | 3624 | | |
| 3625 | + | |
| 3626 | + | |
3575 | 3627 | | |
3576 | 3628 | | |
3577 | 3629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
| 864 | + | |
864 | 865 | | |
865 | 866 | | |
866 | 867 | | |
| |||
0 commit comments