Re: [PATCH 2/2] gpio: rcar: Add R-Car X5H (R8A78000) support

Marek Vasut <[email protected]>
Newsgroups org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 7/7/26 8:52 AM, Geert Uytterhoeven wrote:

Hello Geert,

>> On 7/6/26 11:19 AM, Bartosz Golaszewski wrote:
>>>> +static inline int gpio_rcar_remap_offset(struct gpio_rcar_priv *p, int *offs)
>>>> +{
>>
>> I am hoping to get some input on this remap function.
> 
> I haven't looked at your patch in detail yet, but the remap function
> was the first thing that struck my eyes.  This might impact performance
> of bit-banging and of the sloppy logic analyzer.

Regarding the performance impact -- yes, this will impact performance. 
Both the remap function and register table look up will, but at least 
the remap function is small and (subset of it) ends up inlined, the 
indirect look up table is bigger and unlikely to be inlined. That is why 
I opted for this over a table look up.

> Have you looked at the code generated by the compiler?

I did, but there is a lot of inlining going on.

> Perhaps it would be better to use a table, like sci_port_params.regs[]
> in the sh-sci driver, and riic_of_data.regs in the riic driver?

Please see above.

[...]

-- 
Best regards,
Marek Vasut
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.