Re: [PATCH 1/2] dma-mapping: introduce dma_get_seg_boundary_nr_pages()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Nicolin Chen <nicoleotsuka@xxxxxxxxx>, hch@xxxxxx
- Subject: Re: [PATCH 1/2] dma-mapping: introduce dma_get_seg_boundary_nr_pages()
- From: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
- Date: Thu, 03 Sep 2020 13:47:43 +1000
- Cc: sfr@xxxxxxxxxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, rth@xxxxxxxxxxx, ink@xxxxxxxxxxxxxxxxxxxx, mattst88@xxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, tony.luck@xxxxxxxxx, fenghua.yu@xxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, schnelle@xxxxxxxxxxxxx, gerald.schaefer@xxxxxxxxxxxxx, hca@xxxxxxxxxxxxx, gor@xxxxxxxxxxxxx, borntraeger@xxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, deller@xxxxxx, linux-parisc@xxxxxxxxxxxxxxx
- In-reply-to: <20200901221646.26491-2-nicoleotsuka@gmail.com>
- References: <20200901221646.26491-1-nicoleotsuka@gmail.com> <20200901221646.26491-2-nicoleotsuka@gmail.com>
Nicolin Chen <nicoleotsuka@xxxxxxxxx> 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@xxxxxxxxxxxxxx> (powerpc)
cheers
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]