Re: [PATCH net v3 2/2] net: ethernet: ti: am65-cpsw: avoid devm_alloc_etherdev, fix module removal
From: Roger Quadros
Date: Mon Oct 07 2024 - 07:37:36 EST
On 05/10/2024 23:26, Nicolas Pitre wrote:
> On Fri, 4 Oct 2024, Roger Quadros wrote:
>
>>> If you know of a way to do this differently I'm all ears.
>>
>> I sent another approach already. please check.
>> https://lore.kernel.org/all/67c9ede4-9751-4255-b752-27dd60495ff3@xxxxxxxxxx/
>
> Seems to work correctly.
>
> Still... given this paragraph found in Documentation/process/maintainer-netdev.rst:
>
> |Netdev remains skeptical about promises of all "auto-cleanup" APIs,
> |including even ``devm_`` helpers, historically. They are not the preferred
> |style of implementation, merely an acceptable one.
>
> and given my solution is way simpler, I tend to also prefer it over yours.
OK. Let's go with yours as it makes the driver more compliant to netdev
guidelines.
>
> But I'm not the maintainer nor even a significant contributor here so as
> long as the issue is fixed I won't mind.
>
>>> About the many error cases needing the freeing of net devices, as far as
>>> I know they're all covered with this patch.
>>
>> No they are not.
>
> As I said yesterday, I do still stand by my affirmation that they are.
> Please look at the entire return path and you'll see that everything is
> covered.
Indeed, my bad. It wasn't obvious by just looking at the patch but when looking at
the code it is called via am65_cpsw_nuss_cleanup_ndev().
>
>
> Nicolas
--
cheers,
-roger