Re: [net-next PATCH v3 01/14] net: dsa: qca8k: cache match data to speed up access

From: Christian Marangi
Date: Sun Jul 24 2022 - 19:21:04 EST


On Mon, Jul 25, 2022 at 02:18:43AM +0300, Vladimir Oltean wrote:
> On Sun, Jul 24, 2022 at 10:42:20PM +0200, Christian Marangi wrote:
> > Sure, it was just a stupid idea to set everything not strictly neeeded
> > only after verifying that we have a correct switch... But it doesn't
> > make sense as qca8k_priv is freed anyway if that's the case.
>
> I don't understand what you're saying. With your proposed logic,
> of_device_get_match_data() will be called anyway in qca8k_read_switch_id(),
> and if the switch id is valid, it will be called once more in qca8k_sw_probe().
> With my proposed logic, of_device_get_match_data() will be called exactly
> once, to populate priv->info *before* the first instance of when it's
> going to be needed.

Just ignore... it's me trying to give a reason for my broken logic.

--
Ansuel