Skip to contentSkip to conversation

iommu/dma: Fix a typo in a comment

PATCH In review chenxiang 3 participants 7 messages Mar 18, 2021 – Mar 22, 2021

Subsystems (2)
lore
Share & tools
lore

chenxiang

author
#0 lore raw

PATCH 1/1 iommu/dma: Fix a typo in a comment

From: Xiang Chen <[email protected]>

Fix a type "SAC" to "DAC" in the comment of function iommu_dma_alloc_iova().

---
 drivers/iommu/dma-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +1 -1
index af765c8..3bc17ee 100644
@@ -443,7 +443,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain,
 	if (domain->geometry.force_aperture)
 		dma_limit = min(dma_limit, (u64)domain->geometry.aperture_end);
 
-	/* Try to get PCI devices a SAC address */
+	/* Try to get PCI devices a DAC address */
 	if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
 		iova = alloc_iova_fast(iovad, iova_len,
 				       DMA_BIT_MASK(32) >> shift, false);
Signature · 6 lines
2.8.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
maintainer
#1 lore raw
Quoted 15 lines · chenxiang

From: Xiang Chen <[email protected]>

Fix a type "SAC" to "DAC" in the comment of function iommu_dma_alloc_iova().

---
 drivers/iommu/dma-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +0 -0
index af765c8..3bc17ee 100644

drivers/iommu/dma-iommu.c static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain, · line 449

Quoted 8 lines
drivers/iommu/dma-iommu.c +1 -1
@@ -443,7 +443,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain,
 	if (domain->geometry.force_aperture)
 		dma_limit = min(dma_limit, (u64)domain->geometry.aperture_end);
 
-	/* Try to get PCI devices a SAC address */
+	/* Try to get PCI devices a DAC address */
 	if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
 		iova = alloc_iova_fast(iovad, iova_len,
 				       DMA_BIT_MASK(32) >> shift, false);

This doesn't look like a typo to me... Please explain.

Will
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

#2 lore raw

Hi will,

Quoted 19 lines · Will Deacon
Quoted 18 lines · chenxiang

From: Xiang Chen <[email protected]>

Fix a type "SAC" to "DAC" in the comment of function iommu_dma_alloc_iova().

---
  drivers/iommu/dma-iommu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +0 -0
index af765c8..3bc17ee 100644
@@ -443,7 +443,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain,
  	if (domain->geometry.force_aperture)
  		dma_limit = min(dma_limit, (u64)domain->geometry.aperture_end);
 
Quoted 6 lines

drivers/iommu/dma-iommu.c static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain, · line 449

Quoted 5 lines
drivers/iommu/dma-iommu.c +1 -1
-	/* Try to get PCI devices a SAC address */
+	/* Try to get PCI devices a DAC address */
  	if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
  		iova = alloc_iova_fast(iovad, iova_len,
  				       DMA_BIT_MASK(32) >> shift, false);

This doesn't look like a typo to me... Please explain.

I think it means double-address cycle(DAC), and in LLD3 452 page, there is a description about it "PCI double-address cycle mappings Normally,
the DMA support layer works with 32-bit bus addresses, possibly restricted by a specific device’s DMA mask. The PCI bus, however, also supports a 64-bit addressing mode, the double-address cycle (DAC)." Please point it out if i am wrong :)

Best Regards,
chenxiang

Quoted 5 lines

Will

.

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

maintainer
#3 lore raw
Quoted 29 lines · chenxiang (M)

Hi will,

Quoted 25 lines · Will Deacon
Quoted 15 lines · chenxiang

From: Xiang Chen <[email protected]>

Fix a type "SAC" to "DAC" in the comment of function iommu_dma_alloc_iova().

---
  drivers/iommu/dma-iommu.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +0 -0
index af765c8..3bc17ee 100644

drivers/iommu/dma-iommu.c static dma_addr_t iommu_dma_alloc_iova(struct · line 449

Quoted 8 lines
drivers/iommu/dma-iommu.c +1 -1
@@ -443,7 +443,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct 
 iommu_domain *domain,
       if (domain->geometry.force_aperture)
           dma_limit = min(dma_limit, (u64)domain->geometry.aperture_end);
-    /* Try to get PCI devices a SAC address */
+    /* Try to get PCI devices a DAC address */
       if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
           iova = alloc_iova_fast(iovad, iova_len,
                          DMA_BIT_MASK(32) >> shift, false);

This doesn't look like a typo to me... Please explain.

As the author of said comment, it is definitely not a typo.

Quoted 3 lines

I think it means double-address cycle(DAC), and in LLD3 452 page, there is a description about it "PCI double-address cycle mappings Normally,
the DMA support layer works with 32-bit bus addresses, possibly restricted by a specific device’s DMA mask. The PCI bus, however, also supports a 64-bit addressing mode, the double-address cycle (DAC)." Please point it out if i am wrong :)

Yes, now look at what the code above does: *if* a PCI device has a DMA mask greater than 32 bits (i.e. can support dual address cycles), we first try an IOVA allocation with an explicit 32-bit limit (i.e. that can be expressed in a single address cycle), in the hope that we don't have to fall back to allocating from the upper range and forcing the device to actually use DAC (and suffer the potential performance impact).

Robin.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

#4 lore raw

Hi,

Quoted 32 lines · Robin Murphy
Quoted 30 lines · chenxiang (M)

Hi will,

Quoted 26 lines · Will Deacon
Quoted 23 lines · chenxiang

From: Xiang Chen <[email protected]>

Fix a type "SAC" to "DAC" in the comment of function iommu_dma_alloc_iova().

---
  drivers/iommu/dma-iommu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +1 -1
index af765c8..3bc17ee 100644
@@ -443,7 +443,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct 
 iommu_domain *domain,
      if (domain->geometry.force_aperture)
          dma_limit = min(dma_limit, 
 (u64)domain->geometry.aperture_end);
-    /* Try to get PCI devices a SAC address */
+    /* Try to get PCI devices a DAC address */
      if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
          iova = alloc_iova_fast(iovad, iova_len,
Quoted 1 line
                         DMA_BIT_MASK(32) >> shift, false);

This doesn't look like a typo to me... Please explain.

Quoted 1 line

As the author of said comment, it is definitely not a typo.

What's the short for SAC?

Quoted 11 lines
Quoted 4 lines

I think it means double-address cycle(DAC), and in LLD3 452 page, there is a description about it "PCI double-address cycle mappings Normally,
the DMA support layer works with 32-bit bus addresses, possibly restricted by a specific device’s DMA mask. The PCI bus, however, also supports a 64-bit addressing mode, the double-address cycle (DAC)." Please point it out if i am wrong :)

Yes, now look at what the code above does: *if* a PCI device has a DMA mask greater than 32 bits (i.e. can support dual address cycles), we first try an IOVA allocation with an explicit 32-bit limit (i.e. that can be expressed in a single address cycle), in the hope that we don't have to fall back to allocating from the upper range and forcing the device to actually use DAC (and suffer the potential performance impact).

Robin.

.

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

maintainer
#5 lore raw
Quoted 35 lines · chenxiang (M)

Hi,

Quoted 31 lines · Robin Murphy
Quoted 29 lines · chenxiang (M)

Hi will,

Quoted 25 lines · Will Deacon
Quoted 15 lines · chenxiang

From: Xiang Chen <[email protected]>

Fix a type "SAC" to "DAC" in the comment of function iommu_dma_alloc_iova().

---
  drivers/iommu/dma-iommu.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +0 -0
index af765c8..3bc17ee 100644

drivers/iommu/dma-iommu.c static dma_addr_t iommu_dma_alloc_iova(struct · line 449

Quoted 8 lines
drivers/iommu/dma-iommu.c +1 -1
@@ -443,7 +443,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct 
 iommu_domain *domain,
       if (domain->geometry.force_aperture)
           dma_limit = min(dma_limit, (u64)domain->geometry.aperture_end);
-    /* Try to get PCI devices a SAC address */
+    /* Try to get PCI devices a DAC address */
       if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
           iova = alloc_iova_fast(iovad, iova_len,
                          DMA_BIT_MASK(32) >> shift, false);

This doesn't look like a typo to me... Please explain.

Quoted 3 lines
Quoted 1 line

As the author of said comment, it is definitely not a typo.

What's the short for SAC?

Single Address Cycle - this is standard terminology from the PCI spec.

Robin.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

#6 lore raw
Quoted 37 lines · Robin Murphy
Quoted 36 lines · chenxiang (M)

Hi,

Quoted 32 lines · Robin Murphy
Quoted 30 lines · chenxiang (M)

Hi will,

Quoted 26 lines · Will Deacon
Quoted 23 lines · chenxiang

From: Xiang Chen <[email protected]>

Fix a type "SAC" to "DAC" in the comment of function iommu_dma_alloc_iova().

---
  drivers/iommu/dma-iommu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +1 -1
index af765c8..3bc17ee 100644
@@ -443,7 +443,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct 
 iommu_domain *domain,
      if (domain->geometry.force_aperture)
          dma_limit = min(dma_limit, 
 (u64)domain->geometry.aperture_end);
-    /* Try to get PCI devices a SAC address */
+    /* Try to get PCI devices a DAC address */
      if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
          iova = alloc_iova_fast(iovad, iova_len,
Quoted 1 line
                         DMA_BIT_MASK(32) >> shift, false);

This doesn't look like a typo to me... Please explain.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

As the author of said comment, it is definitely not a typo.

What's the short for SAC?

Single Address Cycle - this is standard terminology from the PCI spec.

Got it, thanks.

Quoted 5 lines

Robin.

.

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu