Skip to contentSkip to conversation

Documentation: PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()

PATCH Superseded Tadeusz Struk 4 participants 7 messages Nov 11, 2023 – Nov 20, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()

From: Tadeusz Struk <[email protected]>

Update Documentation/driver-api/pci/p2pdma.rst doc to remove references to the obsolete pci_p2pdma_map_sg() function.

Fixes 0d06132fc84b ("PCI/P2PDMA: Remove pci_p2pdma_[un]map_sg()")
Cc stable <[email protected]>
---
 Documentation/driver-api/pci/p2pdma.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/driver-api/pci/p2pdma.rst +3 -4
index 44deb52beeb4..9e54ee711b5c 100644
@@ -83,10 +83,9 @@ this to include other types of resources like doorbells.
 Client Drivers
 --------------
 
-A client driver typically only has to conditionally change its DMA map
-routine to use the mapping function :c:func:`pci_p2pdma_map_sg()` instead
-of the usual :c:func:`dma_map_sg()` function. Memory mapped in this
-way does not need to be unmapped.
+A client driver only has to use the mapping api :c:func:`dma_map_sg()`
+and :c:func:`dma_unmap_sg()` functions, as usual, and the implementation
+will do the right thing for the P2P capable memory.
 
 The client may also, optionally, make use of
 :c:func:`is_pci_p2pdma_page()` to determine when to use the P2P mapping
Signature · 1 line
2.41.0
maintainer
#1 lore raw
Quoted 21 lines · Tadeusz Struk

From: Tadeusz Struk <[email protected]>

Update Documentation/driver-api/pci/p2pdma.rst doc to remove references to the obsolete pci_p2pdma_map_sg() function.

Fixes 0d06132fc84b ("PCI/P2PDMA: Remove pci_p2pdma_[un]map_sg()")
Cc stable <[email protected]>
---
 Documentation/driver-api/pci/p2pdma.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/driver-api/pci/p2pdma.rst +0 -0
index 44deb52beeb4..9e54ee711b5c 100644
@@ -83,10 +83,9 @@ this to include other types of resources like doorbells.
 Client Drivers
 --------------
 

Documentation/driver-api/pci/p2pdma.rst this to include other types of resources like doorbells. · line 91

Quoted 10 lines
Documentation/driver-api/pci/p2pdma.rst +3 -4
-A client driver typically only has to conditionally change its DMA map
-routine to use the mapping function :c:func:`pci_p2pdma_map_sg()` instead
-of the usual :c:func:`dma_map_sg()` function. Memory mapped in this
-way does not need to be unmapped.
+A client driver only has to use the mapping api :c:func:`dma_map_sg()`
+and :c:func:`dma_unmap_sg()` functions, as usual, and the implementation
+will do the right thing for the P2P capable memory.
 
 The client may also, optionally, make use of
 :c:func:`is_pci_p2pdma_page()` to determine when to use the P2P mapping

Might make sense to rework this next paragraph as well seeing it references the P2P mapping functions that no longer exist.

Thanks for cleaning up the documentation I forgot about!

Logan

#2 lore raw
Quoted 4 lines · Logan Gunthorpe

Might make sense to rework this next paragraph as well seeing it references the P2P mapping functions that no longer exist.

Thanks for cleaning up the documentation I forgot about!

Ok, I will need to check exactly what was removed when. Currently I'm working with v6.1, and all the other functions are still there in this version.
The pci_p2pdma_[un]map_sg() functions are gone since v6.0. If you want to take this one, I will follow up with updates that apply to more recent versions.

--
Thanks,
Tadeusz

maintainer
#3 lore raw
Quoted 9 lines · Tadeusz Struk
Quoted 4 lines · Logan Gunthorpe

Might make sense to rework this next paragraph as well seeing it references the P2P mapping functions that no longer exist.

Thanks for cleaning up the documentation I forgot about!

Ok, I will need to check exactly what was removed when. Currently I'm working with v6.1, and all the other functions are still there in this version.

The function still exists, but it's talking about using it to decide when to use the map functions that are gone. Could probably just drop the paragraph.

Quoted 3 lines

The pci_p2pdma_[un]map_sg() functions are gone since v6.0. If you want to take this one, I will follow up with updates that apply to more recent versions.

Unfortunately I don't have the time at the moment to look at it.

Logan

#4 lore raw

PATCH v2 1/1 Documentation: PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()

From: Tadeusz Struk <[email protected]>

Update Documentation/driver-api/pci/p2pdma.rst doc and remove references to obsolete p2pdma mapping functions.

Fixes 0d06132fc84b ("PCI/P2PDMA: Remove pci_p2pdma_[un]map_sg()")
Cc stable <[email protected]>

----

v2: Dropped a section that talks about using is_pci_p2pdma_page()
function by the client. Suggested by Logan.

---
 Documentation/driver-api/pci/p2pdma.rst | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
Documentation/driver-api/pci/p2pdma.rst +3 -13
index 44deb52beeb4..44efed79d908 100644
@@ -83,19 +83,9 @@ this to include other types of resources like doorbells.
 Client Drivers
 --------------
 
-A client driver typically only has to conditionally change its DMA map
-routine to use the mapping function :c:func:`pci_p2pdma_map_sg()` instead
-of the usual :c:func:`dma_map_sg()` function. Memory mapped in this
-way does not need to be unmapped.
-
-The client may also, optionally, make use of
-:c:func:`is_pci_p2pdma_page()` to determine when to use the P2P mapping
-functions and when to use the regular mapping functions. In some
-situations, it may be more appropriate to use a flag to indicate a
-given request is P2P memory and map appropriately. It is important to
-ensure that struct pages that back P2P memory stay out of code that
-does not have support for them as other code may treat the pages as
-regular memory which may not be appropriate.
+A client driver only has to use the mapping API :c:func:`dma_map_sg()`
+and :c:func:`dma_unmap_sg()` functions, as usual, and the implementaion
+will do the right thing for the P2P capable memory.
 
 
 Orchestrator Drivers
Signature · 1 line
2.41.0
#6 lore raw
In reply to Tadeusz Struk

From: Bjorn Helgaas <[email protected]>

Quoted 9 lines · Tadeusz Struk

Update Documentation/driver-api/pci/p2pdma.rst doc and remove references to obsolete p2pdma mapping functions.

Fixes 0d06132fc84b ("PCI/P2PDMA: Remove pci_p2pdma_[un]map_sg()")
Cc stable <[email protected]>

----

[...]

Applied to "p2pdma" for v6.8, thanks!

[1/1] Documentation: PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()

      commit: 9a000a72af75886e5de13f4edef7f0d788622e7d

Best regards,

Signature · 1 line
Bjorn Helgaas <[email protected]>