Thread (40 messages) 40 messages, 3 authors, 2021-12-22

Re: [PATCH v4 03/23] PCI/P2PDMA: Attempt to set map_type if it has not been set

From: Chaitanya Kulkarni <hidden>
Date: 2021-12-13 22:00:35
Also in: linux-iommu, linux-mm, linux-nvme, linux-pci, lkml

On 11/17/21 1:53 PM, Logan Gunthorpe wrote:
Attempt to find the mapping type for P2PDMA pages on the first
DMA map attempt if it has not been done ahead of time.

Previously, the mapping type was expected to be calculated ahead of
time, but if pages are to come from userspace then there's no
way to ensure the path was checked ahead of time.

This change will calculate the mapping type if it hasn't pre-calculated
so it is no longer invalid to call pci_p2pdma_map_sg() before the mapping
type is calculated, so drop the WARN_ON when that is he case.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
Perhaps a comment would be nice in the default case in
pci_p2pdma_map_sg_attrs() where you have removed the WARN_ON_ONCE().

Either way, looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help