lkml.org 
[lkml]   [2023]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/7] iommu: dart: Support >64 stream IDs
Hi,

On Thu, Jan 5, 2023, at 05:43, Hector Martin wrote:
> On 2023/01/04 22:37, Sven Peter wrote:
>>> #include "dma-iommu.h"
>>>
>>> -#define DART_MAX_STREAMS 16
>>> +#define DART_MAX_STREAMS 256
>>
>> Feels a bit wasteful to allocate 256-wide sid2group and save_{tcr,ttbr}
>> arrays even for the M1 where 16 are enough. But then again, that's still <100 KiB
>> for all DARTs combined and these machine have >8 GiB of RAM so it probably won't
>> make a difference
>
> Yeah, I don't think this is worth the extra fumbling around with dynamic
> allocation.
>
>>> /* enable all streams globally since TCR is used to control isolation */
>>> - writel(DART_STREAM_ALL, dart->regs + DART_STREAMS_ENABLE);
>>> + for (i = 0; i < BITS_TO_U32(dart->num_streams); i++)
>>> + writel(U32_MAX, dart->regs + DART_STREAMS_ENABLE);
>>
>> This seems weird: this code writes U32_MAX to the same register
>> again and again.
>
> Whoops, that was supposed to have a `+ 4 * i` in there. Fixed for v2.

Great! Feel free to also add

Reviewed-by: Sven Peter <sven@svenpeter.dev>

then.


Best,

Sven

\
 
 \ /
  Last update: 2023-03-26 23:28    [W:0.041 / U:23.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site