Re: [PATCH] iommu: Always fill in gather when unmapping

Jon Hunter
2026-04-08T08:43:31Z

Hi Robin, Jason,

On 02/04/2026 23:51, Jason Gunthorpe wrote:
> On Thu, Apr 02, 2026 at 07:11:13PM +0100, Robin Murphy wrote:
>>>> @@ -2714,6 +2714,10 @@ static size_t __iommu_unmap(struct iommu_domain *domain,
>>>> pr_debug("unmapped: iova 0x%lx size 0x%zx\n",
>>>> iova, unmapped_page);
>>>> + /* If the driver itself isn't using the gather, mark it used */
>>>> + if (iotlb_gather->end <= iotlb_gather->start)
>>>> + iommu_iotlb_gather_add_range(&iotlb_gather, iova, unmapped_page);
>>>
>>> The gathers can be joined across unmaps and now we are inviting subtly
>>> ill-formed gathers as only the first unmap will get included.
>
>>> We do have error cases where the gather is legitimately empty, and
>>> this would squash that, it probably needs to check unmapped_page for 0
>>> too, at least.
>>
>> Maybe try looking at the rest of the code around these lines...
>
> Okay, well lets do this one, do you want to send it since it is your
> idea?

Any update on this? Boot is still broken on a couple of our boards.

Thanks
Jon

--
nvpublic