iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/dma: Fix a typo in a comment
@ 2021-03-18  3:21 chenxiang
  2021-03-18  9:34 ` Will Deacon
  0 siblings, 1 reply; 7+ messages in thread
From: chenxiang @ 2021-03-18  3:21 UTC (permalink / raw)
  To: robin.murphy, will; +Cc: iommu

From: Xiang Chen <chenxiang66@hisilicon.com>

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

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
 drivers/iommu/dma-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index af765c8..3bc17ee 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -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);
-- 
2.8.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] iommu/dma: Fix a typo in a comment
  2021-03-18  3:21 [PATCH] iommu/dma: Fix a typo in a comment chenxiang
@ 2021-03-18  9:34 ` Will Deacon
  2021-03-18  9:55   ` chenxiang (M)
  0 siblings, 1 reply; 7+ messages in thread
From: Will Deacon @ 2021-03-18  9:34 UTC (permalink / raw)
  To: chenxiang; +Cc: iommu, robin.murphy

On Thu, Mar 18, 2021 at 11:21:24AM +0800, chenxiang wrote:
> From: Xiang Chen <chenxiang66@hisilicon.com>
> 
> Fix a type "SAC" to "DAC" in the comment of function
> iommu_dma_alloc_iova().
> 
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> ---
>  drivers/iommu/dma-iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
> index af765c8..3bc17ee 100644
> --- a/drivers/iommu/dma-iommu.c
> +++ b/drivers/iommu/dma-iommu.c
> @@ -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
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] iommu/dma: Fix a typo in a comment
  2021-03-18  9:34 ` Will Deacon
@ 2021-03-18  9:55   ` chenxiang (M)
  2021-03-18 11:01     ` Robin Murphy
  0 siblings, 1 reply; 7+ messages in thread
From: chenxiang (M) @ 2021-03-18  9:55 UTC (permalink / raw)
  To: Will Deacon; +Cc: iommu, robin.murphy

Hi will,


在 2021/3/18 17:34, Will Deacon 写道:
> On Thu, Mar 18, 2021 at 11:21:24AM +0800, chenxiang wrote:
>> From: Xiang Chen <chenxiang66@hisilicon.com>
>>
>> Fix a type "SAC" to "DAC" in the comment of function
>> iommu_dma_alloc_iova().
>>
>> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
>> ---
>>   drivers/iommu/dma-iommu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
>> index af765c8..3bc17ee 100644
>> --- a/drivers/iommu/dma-iommu.c
>> +++ b/drivers/iommu/dma-iommu.c
>> @@ -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.

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

>
> Will
>
> .
>


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] iommu/dma: Fix a typo in a comment
  2021-03-18  9:55   ` chenxiang (M)
@ 2021-03-18 11:01     ` Robin Murphy
  2021-03-19  1:02       ` chenxiang (M)
  0 siblings, 1 reply; 7+ messages in thread
From: Robin Murphy @ 2021-03-18 11:01 UTC (permalink / raw)
  To: chenxiang (M), Will Deacon; +Cc: iommu

On 2021-03-18 09:55, chenxiang (M) wrote:
> Hi will,
> 
> 
> 在 2021/3/18 17:34, Will Deacon 写道:
>> On Thu, Mar 18, 2021 at 11:21:24AM +0800, chenxiang wrote:
>>> From: Xiang Chen <chenxiang66@hisilicon.com>
>>>
>>> Fix a type "SAC" to "DAC" in the comment of function
>>> iommu_dma_alloc_iova().
>>>
>>> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
>>> ---
>>>   drivers/iommu/dma-iommu.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
>>> index af765c8..3bc17ee 100644
>>> --- a/drivers/iommu/dma-iommu.c
>>> +++ b/drivers/iommu/dma-iommu.c
>>> @@ -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.

> 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
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] iommu/dma: Fix a typo in a comment
  2021-03-18 11:01     ` Robin Murphy
@ 2021-03-19  1:02       ` chenxiang (M)
  2021-03-19 11:02         ` Robin Murphy
  0 siblings, 1 reply; 7+ messages in thread
From: chenxiang (M) @ 2021-03-19  1:02 UTC (permalink / raw)
  To: Robin Murphy, Will Deacon; +Cc: iommu

Hi,


在 2021/3/18 19:01, Robin Murphy 写道:
> On 2021-03-18 09:55, chenxiang (M) wrote:
>> Hi will,
>>
>>
>> 在 2021/3/18 17:34, Will Deacon 写道:
>>> On Thu, Mar 18, 2021 at 11:21:24AM +0800, chenxiang wrote:
>>>> From: Xiang Chen <chenxiang66@hisilicon.com>
>>>>
>>>> Fix a type "SAC" to "DAC" in the comment of function
>>>> iommu_dma_alloc_iova().
>>>>
>>>> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
>>>> ---
>>>>   drivers/iommu/dma-iommu.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
>>>> index af765c8..3bc17ee 100644
>>>> --- a/drivers/iommu/dma-iommu.c
>>>> +++ b/drivers/iommu/dma-iommu.c
>>>> @@ -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.

What's the short for SAC?

>
>> 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
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] iommu/dma: Fix a typo in a comment
  2021-03-19  1:02       ` chenxiang (M)
@ 2021-03-19 11:02         ` Robin Murphy
  2021-03-22  1:01           ` chenxiang (M)
  0 siblings, 1 reply; 7+ messages in thread
From: Robin Murphy @ 2021-03-19 11:02 UTC (permalink / raw)
  To: chenxiang (M), Will Deacon; +Cc: iommu

On 2021-03-19 01:02, chenxiang (M) wrote:
> Hi,
> 
> 
> 在 2021/3/18 19:01, Robin Murphy 写道:
>> On 2021-03-18 09:55, chenxiang (M) wrote:
>>> Hi will,
>>>
>>>
>>> 在 2021/3/18 17:34, Will Deacon 写道:
>>>> On Thu, Mar 18, 2021 at 11:21:24AM +0800, chenxiang wrote:
>>>>> From: Xiang Chen <chenxiang66@hisilicon.com>
>>>>>
>>>>> Fix a type "SAC" to "DAC" in the comment of function
>>>>> iommu_dma_alloc_iova().
>>>>>
>>>>> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
>>>>> ---
>>>>>   drivers/iommu/dma-iommu.c | 2 +-
>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
>>>>> index af765c8..3bc17ee 100644
>>>>> --- a/drivers/iommu/dma-iommu.c
>>>>> +++ b/drivers/iommu/dma-iommu.c
>>>>> @@ -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.
> 
> What's the short for SAC?

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

Robin.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] iommu/dma: Fix a typo in a comment
  2021-03-19 11:02         ` Robin Murphy
@ 2021-03-22  1:01           ` chenxiang (M)
  0 siblings, 0 replies; 7+ messages in thread
From: chenxiang (M) @ 2021-03-22  1:01 UTC (permalink / raw)
  To: Robin Murphy, Will Deacon; +Cc: iommu



在 2021/3/19 19:02, Robin Murphy 写道:
> On 2021-03-19 01:02, chenxiang (M) wrote:
>> Hi,
>>
>>
>> 在 2021/3/18 19:01, Robin Murphy 写道:
>>> On 2021-03-18 09:55, chenxiang (M) wrote:
>>>> Hi will,
>>>>
>>>>
>>>> 在 2021/3/18 17:34, Will Deacon 写道:
>>>>> On Thu, Mar 18, 2021 at 11:21:24AM +0800, chenxiang wrote:
>>>>>> From: Xiang Chen <chenxiang66@hisilicon.com>
>>>>>>
>>>>>> Fix a type "SAC" to "DAC" in the comment of function
>>>>>> iommu_dma_alloc_iova().
>>>>>>
>>>>>> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
>>>>>> ---
>>>>>>   drivers/iommu/dma-iommu.c | 2 +-
>>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
>>>>>> index af765c8..3bc17ee 100644
>>>>>> --- a/drivers/iommu/dma-iommu.c
>>>>>> +++ b/drivers/iommu/dma-iommu.c
>>>>>> @@ -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.
>>
>> What's the short for SAC?
>
> Single Address Cycle - this is standard terminology from the PCI spec.

Got it, thanks.

>
> Robin.
>
> .
>


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-22  1:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18  3:21 [PATCH] iommu/dma: Fix a typo in a comment chenxiang
2021-03-18  9:34 ` Will Deacon
2021-03-18  9:55   ` chenxiang (M)
2021-03-18 11:01     ` Robin Murphy
2021-03-19  1:02       ` chenxiang (M)
2021-03-19 11:02         ` Robin Murphy
2021-03-22  1:01           ` chenxiang (M)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).