Re: [PATCH] iommu/sun50i: Allow page sizes between 4K and 1M

Robin Murphy
2023-09-11T22:00:59Z

On 2023-09-11 20:29, Jernej Škrabec wrote:
> On Monday, September 11, 2023 9:06:12 PM CEST Robin Murphy wrote:
>> On 2023-09-11 20:02, Jernej Skrabec wrote:
>>> While peripheral supports only 4K page sizes, we can easily emulate
>>> support for bigger page sizes, up to 1M. This is done by making multiple
>>> entries in map function or clearing multiple entries in unmap.
>>
>> No, it's done by converting over to the {map,unmap}_pages ops. There's
>> no need to resurrect this horrible bodge.
>
> Missed those, thanks! In any case, logic to implement those isn't that
> different than here.

Indeed, if anything it should be even simpler since you don't need to
worry about specific sizes at all - any tricky boundary you don't want
to iterate through, just return short at that point and let the core
call you back again with the remainder.

(In fact this reminds me one of the low-priority cleanup jobs
outstanding was to trivially convert all the remaining drivers and
retire the old interfaces altogether)

Cheers,
Robin.