[PATCH 2/2] ath79: mikrotik: Change the moment of routerboot partition parser init

Thibaut hacks at slashdirt.org
Tue Nov 16 02:20:08 PST 2021


> Le 16 nov. 2021 à 10:46, Denis K <denis281089 at gmail.com> a écrit :
> I got it! _exit macro of rb_hardconfig_init seems to cause this kernel
> panic. Here is a patch.

Thanks; indeed that’s logical: functions marked as __exit are discarded when the module is built into the kernel: they’re no longer available when the mtd_notifier executes the remove() callback. I missed that. Since these are very small, I agree it’s ok to remove the __exit qualifier.

I see the same rationale for removing the __init qualifier from the init functions since the mtd notifier could be called at any point during kernel execution, but that bothers me a bit more because these are somewhat large functions. Then again it’s a tradeoff between doing the right thing (using a notifier) vs using a workaround (late_initcall()). I think it’s acceptable.

Anyway, I’ve refactored the patch with your changes and I added a note and edited the commit message about the point above; see attachment below. Hopefully this one is good to go :)

You are the author of this patch and you did all the heavy lifting (thanks again for that), so if you have no further changes/comments I’d suggest you submit this as a v2. I’ll ACK it then (please CC-me - this should be automatic with my SoB-line added).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-generic-platform-mikrotik-use-MTD-notifier.patch
Type: application/octet-stream
Size: 7673 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20211116/53c684ec/attachment.obj>

More information about the openwrt-devel mailing list