Re: [PATCH v7 0/3] Add HDMI audio on the rk3588 SoC

Kuninori Morimoto
2025-02-26T01:14:19Z

Hi Detlev

Thank you for the testing.

> I got same report from our test team. I'm now tring to solve it.

It seems our test team and your team are encounter same issues by different
way, and it seems it happen if some kind of deffer issue happen (?).

> That being said, I'm not sure I completely understand why that extra line fixes
> the issue. Is the __free() attribute smart enough to know that the pointer has
> been copied and not free it at the end of scope ?

__free(device_node) attribute will automatically calls of_node_put() when it
lost the scope. By below patch, graph_util_parse_dai() will use
__free(device_node) and thus dlc->of_node counter was not increased.

419d1918105e5d9926ab02f1f834bb416dc76f65
("ASoC: simple-card-utils: use __free(device_node) for device node")

In such situation, if some kind of deffer issue happened, xxx-card probe()
will failed and calls simple_util_clean_reference(). It calls of_node_put()
for each dlc->of_node, but above one was already called of_node_put() via
__free(device_node). So you encounter the error.

I'm not 100% sure why dabbd325b2 commit removed the issue, but I think
it is just luck, I think.

Thank you for your test !!
I will post the patch with below tag if our test team could confirm it.

Tested-by: Detlev Casanova <detlev.casanova@collabora.com>

Best regards
---
Kuninori Morimoto