On Wed, 25 Mar 2026 23:12:16 +0530 Ritesh Harjani (IBM) <[email protected]> wrote:
> Gaurav Batra <[email protected]> writes: > > > Hello Ritesh > > > > I think, what you are proposing to add dev->bus_dma_limit in the check > > might work. In the case of PowerNV, this is not set, but > > dev->dma_ops_bypass is set. So, for PowerNV, it will fall back to how it > > was before. > > > > Also, since these both are set in LPAR mode, the current patch as-is > > will work. > > > > Dan, can you please try Ritesh proposed fix on your PowerNV box? I am > > not able to lay my hands on a PowerNV box yet. > > > > It would be this diff then. Note, I have only compile tested it. > > diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c > index 73e10bd4d56d..8b4de508d2eb 100644 > --- a/arch/powerpc/kernel/dma-iommu.c > +++ b/arch/powerpc/kernel/dma-iommu.c > @@ -67,7 +67,7 @@ bool arch_dma_unmap_sg_direct(struct device *dev, struct > scatterlist *sg, > } > bool arch_dma_alloc_direct(struct device *dev) > { > - if (dev->dma_ops_bypass) > + if (dev->dma_ops_bypass && dev->bus_dma_limit) > return true; > > return false; > @@ -75,7 +75,7 @@ bool arch_dma_alloc_direct(struct device *dev) > > bool arch_dma_free_direct(struct device *dev, dma_addr_t dma_handle) > { > - if (!dev->dma_ops_bypass) > + if (!dev->dma_ops_bypass || !dev->bus_dma_limit) > return false; > > return is_direct_handle(dev, dma_handle); yup, I will give it a try in the morning and report back Dan
