(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: sh_mobile: request IRQs after mapping registers

The managed IRQ handlers are acquired before the managed register mapping, so devres unmaps the registers before freeing the IRQs. A transfer wakes its waiter before the ISR's final register read, and unregistering the adapter does not synchronize these IRQs. An in-flight handler can therefore still access the mapping when it is released during driver detach. With forced-threaded IRQs, the handler can be preempted after waking the transfer waiter and before its final ICSR read. Map the registers before requesting the IRQs so that managed cleanup frees and synchronizes all handlers before unmapping their registers. Keep IRQs available while unregistering the adapter because client removal may perform transfers. This issue was identified as part of our ongoing research while reviewing kernel code. Co-developed-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Myeonghun Pak <mhun512@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://patch.msgid.link/20261017233416.47b09ffff48f.i2c-sh-mobile@gmail.com


Author Myeonghun Pak Committer Andi Shyti Date Commit Parent f0e53c16
+4 -4
1 changed file
+4 -4
1 changed file