[PATCH v2 0/6] Add DMA attributes tracking

Leon Romanovsky posted 6 patches 1 month, 1 week ago
drivers/ntb/ntb_transport.c | 10 +++---
kernel/dma/debug.c          | 87 +++++++++++++++++++++++++++++++--------------
kernel/dma/debug.h          | 25 ++++++-------
kernel/dma/mapping.c        | 10 +++---
4 files changed, 85 insertions(+), 47 deletions(-)
[PATCH v2 0/6] Add DMA attributes tracking
Posted by Leon Romanovsky 1 month, 1 week ago
The DMA API expects that callers use the same attributes when mapping
and unmapping. Add tracking to verify this and catch mismatches.

Thanks

---
Changes in v2:
- Split original patch to be a series
- Added all unmap flows
- Skipped DMA attributes which exist only in map path
- Added ntb patch
- Link to v1: https://patch.msgid.link/20260323-dma-attrs-debug-v1-1-6275228ca300@nvidia.com

---
Leon Romanovsky (6):
      ntb: Store original DMA address for future release
      ntb: Use consistent DMA attributes when freeing DMA mappings
      dma-debug: Remove unused DMA attribute parameter
      dma-debug: Record DMA attributes in debug entry
      dma-debug: Feed DMA attribute for unmapping flows too
      dma-debug: Ensure mappings are created and released with matching attributes

 drivers/ntb/ntb_transport.c | 10 +++---
 kernel/dma/debug.c          | 87 +++++++++++++++++++++++++++++++--------------
 kernel/dma/debug.h          | 25 ++++++-------
 kernel/dma/mapping.c        | 10 +++---
 4 files changed, 85 insertions(+), 47 deletions(-)
---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260323-dma-attrs-debug-85e282d6f3bb

Best regards,
--  
Leon Romanovsky <leonro@nvidia.com>
Re: [PATCH v2 0/6] Add DMA attributes tracking
Posted by Marek Szyprowski 1 month ago
On 01.05.2026 08:35, Leon Romanovsky wrote:
> The DMA API expects that callers use the same attributes when mapping
> and unmapping. Add tracking to verify this and catch mismatches.

I would like to merge this to dma-mapping-for-next, but I have a question about ntb
patches - Jon, Dave, Allen: do You plan to take them (either to the fixes or to the
-next) or do You want me to take them together with dma patches?


> Thanks
>
> ---
> Changes in v2:
> - Split original patch to be a series
> - Added all unmap flows
> - Skipped DMA attributes which exist only in map path
> - Added ntb patch
> - Link to v1: https://protect2.fireeye.com/v1/url?k=70e722e7-116c37d7-70e6a9a8-000babffaa23-c39f7f9efe32c6a2&q=1&e=c79241ff-9ff4-40ae-8e29-753dd9d59f23&u=https%3A%2F%2Fpatch.msgid.link%2F20260323-dma-attrs-debug-v1-1-6275228ca300%40nvidia.com
>
> ---
> Leon Romanovsky (6):
>       ntb: Store original DMA address for future release
>       ntb: Use consistent DMA attributes when freeing DMA mappings
>       dma-debug: Remove unused DMA attribute parameter
>       dma-debug: Record DMA attributes in debug entry
>       dma-debug: Feed DMA attribute for unmapping flows too
>       dma-debug: Ensure mappings are created and released with matching attributes
>
>  drivers/ntb/ntb_transport.c | 10 +++---
>  kernel/dma/debug.c          | 87 +++++++++++++++++++++++++++++++--------------
>  kernel/dma/debug.h          | 25 ++++++-------
>  kernel/dma/mapping.c        | 10 +++---
>  4 files changed, 85 insertions(+), 47 deletions(-)
> ---
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
> change-id: 20260323-dma-attrs-debug-85e282d6f3bb
>
> Best regards,
> --  
> Leon Romanovsky <leonro@nvidia.com>
>
>
Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Re: [PATCH v2 0/6] Add DMA attributes tracking
Posted by Dave Jiang 1 month ago

On 5/8/26 1:50 AM, Marek Szyprowski wrote:
> On 01.05.2026 08:35, Leon Romanovsky wrote:
>> The DMA API expects that callers use the same attributes when mapping
>> and unmapping. Add tracking to verify this and catch mismatches.
> 
> I would like to merge this to dma-mapping-for-next, but I have a question about ntb
> patches - Jon, Dave, Allen: do You plan to take them (either to the fixes or to the
> -next) or do You want me to take them together with dma patches?

Please go ahead and take them together. Thanks!

> 
> 
>> Thanks
>>
>> ---
>> Changes in v2:
>> - Split original patch to be a series
>> - Added all unmap flows
>> - Skipped DMA attributes which exist only in map path
>> - Added ntb patch
>> - Link to v1: https://protect2.fireeye.com/v1/url?k=70e722e7-116c37d7-70e6a9a8-000babffaa23-c39f7f9efe32c6a2&q=1&e=c79241ff-9ff4-40ae-8e29-753dd9d59f23&u=https%3A%2F%2Fpatch.msgid.link%2F20260323-dma-attrs-debug-v1-1-6275228ca300%40nvidia.com
>>
>> ---
>> Leon Romanovsky (6):
>>       ntb: Store original DMA address for future release
>>       ntb: Use consistent DMA attributes when freeing DMA mappings
>>       dma-debug: Remove unused DMA attribute parameter
>>       dma-debug: Record DMA attributes in debug entry
>>       dma-debug: Feed DMA attribute for unmapping flows too
>>       dma-debug: Ensure mappings are created and released with matching attributes
>>
>>  drivers/ntb/ntb_transport.c | 10 +++---
>>  kernel/dma/debug.c          | 87 +++++++++++++++++++++++++++++++--------------
>>  kernel/dma/debug.h          | 25 ++++++-------
>>  kernel/dma/mapping.c        | 10 +++---
>>  4 files changed, 85 insertions(+), 47 deletions(-)
>> ---
>> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
>> change-id: 20260323-dma-attrs-debug-85e282d6f3bb
>>
>> Best regards,
>> --  
>> Leon Romanovsky <leonro@nvidia.com>
>>
>>
> Best regards

Re: [PATCH v2 0/6] Add DMA attributes tracking
Posted by Marek Szyprowski 1 month ago
On 08.05.2026 18:20, Dave Jiang wrote:
> On 5/8/26 1:50 AM, Marek Szyprowski wrote:
>> On 01.05.2026 08:35, Leon Romanovsky wrote:
>>> The DMA API expects that callers use the same attributes when mapping
>>> and unmapping. Add tracking to verify this and catch mismatches.
>> I would like to merge this to dma-mapping-for-next, but I have a question about ntb
>> patches - Jon, Dave, Allen: do You plan to take them (either to the fixes or to the
>> -next) or do You want me to take them together with dma patches?
> Please go ahead and take them together. Thanks!

Applied all patches to dma-mapping-for-next. Thanks!

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland