On 2021-03-12 7:36 p.m., Ira Weiny wrote: > On Thu, Mar 11, 2021 at 04:31:37PM -0700, Logan Gunthorpe wrote: > >> +int dma_pci_p2pdma_supported(struct device *dev) > ^^^ > bool? Sure. > >> +{ >> + const struct dma_map_ops *ops = get_dma_ops(dev); >> + >> + return !ops || ops->flags & DMA_F_PCI_P2PDMA_SUPPORTED; > > Is this logic correct? I would have expected. > > return (ops && ops->flags & DMA_F_PCI_P2PDMA_SUPPORTED); If ops is NULL then the operations in kernel/dma/direct.c are used and support is added to those in patch 6. So it is correct as written. Logan _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
- Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_... Ira Weiny
- Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce ... Logan Gunthorpe
- Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_... Ira Weiny
- Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce ... Logan Gunthorpe
- Re: [RFC PATCH v2 04/11] PCI/P2PDMA: Introduce pci_... Christoph Hellwig
- [RFC PATCH v2 02/11] PCI/P2PDMA: Avoid pci_get_slot() wh... Logan Gunthorpe
- Re: [RFC PATCH v2 02/11] PCI/P2PDMA: Avoid pci_get_... Bjorn Helgaas
- Re: [RFC PATCH v2 02/11] PCI/P2PDMA: Avoid pci_... Logan Gunthorpe
- [RFC PATCH v2 07/11] dma-mapping: Add flags to dma_map_o... Logan Gunthorpe
- Re: [RFC PATCH v2 07/11] dma-mapping: Add flags to ... Ira Weiny
- Re: [RFC PATCH v2 07/11] dma-mapping: Add flags... Logan Gunthorpe
- Re: [RFC PATCH v2 07/11] dma-mapping: Add f... Christoph Hellwig
- Re: [RFC PATCH v2 07/11] dma-mapping: Add flags to ... Christoph Hellwig
- [RFC PATCH v2 05/11] lib/scatterlist: Add flag for indic... Logan Gunthorpe
- [RFC PATCH v2 10/11] nvme-pci: Check DMA ops when indica... Logan Gunthorpe
- [RFC PATCH v2 08/11] iommu/dma: Support PCI P2PDMA pages... Logan Gunthorpe
- Re: [RFC PATCH v2 08/11] iommu/dma: Support PCI P2P... Robin Murphy
- Re: [RFC PATCH v2 08/11] iommu/dma: Support PCI... Logan Gunthorpe
- Re: [RFC PATCH v2 08/11] iommu/dma: Support... Robin Murphy
- Re: [RFC PATCH v2 08/11] iommu/dma: Sup... Logan Gunthorpe
- [RFC PATCH v2 09/11] block: Add BLK_STS_P2PDMA Logan Gunthorpe