[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87363z1py8.fsf@mpe.ellerman.id.au>
Date: Thu, 03 Sep 2020 13:47:43 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Nicolin Chen <nicoleotsuka@...il.com>, hch@....de
Cc: sfr@...b.auug.org.au, benh@...nel.crashing.org, paulus@...ba.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
rth@...ddle.net, ink@...assic.park.msu.ru, mattst88@...il.com,
linux-alpha@...r.kernel.org, tony.luck@...el.com,
fenghua.yu@...el.com, linux-ia64@...r.kernel.org,
schnelle@...ux.ibm.com, gerald.schaefer@...ux.ibm.com,
hca@...ux.ibm.com, gor@...ux.ibm.com, borntraeger@...ibm.com,
linux-s390@...r.kernel.org, davem@...emloft.net,
sparclinux@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com,
James.Bottomley@...senPartnership.com, deller@....de,
linux-parisc@...r.kernel.org
Subject: Re: [PATCH 1/2] dma-mapping: introduce dma_get_seg_boundary_nr_pages()
Nicolin Chen <nicoleotsuka@...il.com> writes:
> diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
> index 9704f3f76e63..cbc2e62db597 100644
> --- a/arch/powerpc/kernel/iommu.c
> +++ b/arch/powerpc/kernel/iommu.c
> @@ -236,15 +236,10 @@ static unsigned long iommu_range_alloc(struct device *dev,
> }
> }
>
> - if (dev)
> - boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
> - 1 << tbl->it_page_shift);
> - else
> - boundary_size = ALIGN(1UL << 32, 1 << tbl->it_page_shift);
> - /* 4GB boundary for iseries_hv_alloc and iseries_hv_map */
> + boundary_size = dma_get_seg_boundary_nr_pages(dev, tbl->it_page_shift);
>
> n = iommu_area_alloc(tbl->it_map, limit, start, npages, tbl->it_offset,
> - boundary_size >> tbl->it_page_shift, align_mask);
> + boundary_size, align_mask);
This has changed the units of boundary_size, but it's unused elsewhere
in the function so that's OK.
If you need to do a v2 for any other reason, then I'd just drop
boundary_size and call dma_get_seg_boundary_nr_pages() directly in the
function call.
Acked-by: Michael Ellerman <mpe@...erman.id.au> (powerpc)
cheers
Powered by blists - more mailing lists