Re: [PATCH v3 3/6] iommu: Improve iommu_iotlb_gather helpers

From: Nadav Amit
Date: Tue Jun 15 2021 - 15:08:07 EST




> On Jun 15, 2021, at 12:05 PM, Nadav Amit <nadav.amit@xxxxxxxxx> wrote:
>
>
>
>> On Jun 15, 2021, at 3:42 AM, Robin Murphy <robin.murphy@xxxxxxx> wrote:
>>
>> On 2021-06-07 19:25, Nadav Amit wrote:
>>> From: Robin Murphy <robin.murphy@xxxxxxx>
>>> The Mediatek driver is not the only one which might want a basic
>>> address-based gathering behaviour, so although it's arguably simple
>>> enough to open-code, let's factor it out for the sake of cleanliness.
>>> Let's also take this opportunity to document the intent of these
>>> helpers for clarity.
>>> Cc: Joerg Roedel <joro@xxxxxxxxxx>
>>> Cc: Will Deacon <will@xxxxxxxxxx>
>>> Cc: Jiajun Cao <caojiajun@xxxxxxxxxx>
>>> Cc: Robin Murphy <robin.murphy@xxxxxxx>
>>> Cc: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
>>> Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
>>> Cc: linux-kernel@xxxxxxxxxxxxxxx
>>> Signed-off-by: Robin Murphy <robin.murphy@xxxxxxx>
>>
>> Nit: missing your signoff.
>>
>>> ---
>>> Changes from Robin's version:
>>> * Added iommu_iotlb_gather_add_range() stub !CONFIG_IOMMU_API
>>
>> Out of curiosity, is there any config in which a stub is actually needed? Unlike iommu_iotlb_gather_init(), I would have thought that these helpers should only ever be called by driver code which already depends on IOMMU_API.
>
> Indeed, this was only done as a defensive step.
>
> I will remove it. I see no reason for it. Sorry for ruining your patch.

And remove the stub for iommu_iotlb_gather_is_disjoint() as well.