Hi Peter Thanks for your reply. Unfortunately we cannot reproduce the issue on a newer kernel as it requires userspace applications (for processing the hotswap) that rely on our (many) changes to the kernel. I appreciate you taking the time to consider the issue. Thanks David ________________________________________ From: Peter Rosin <peda@xxxxxxxxxx> Sent: Tuesday, 20 June 2017 7:30 a.m. To: Wolfram Sang; David Thomson Cc: linux-i2c@xxxxxxxxxxxxxxx Subject: Re: [PATCH] i2c: core: Prevent race condition when removing i2c devices On 2017-06-19 18:34, Peter Rosin wrote: > It would certainly be nice to know why .owner is clobbered, because I > don't see it. But then again, I don't know what sources I should be > reading... BTW, one thing I noticed when reading the current code is that I see this at the end of i2c_del_adapter: /* Clear the device structure in case this adapter is ever going to be added again */ memset(&adap->dev, 0, sizeof(adap->dev)); } EXPORT_SYMBOL(i2c_del_adapter); which is not very compatible with this part of the device_add() docs: * Do not call this routine or device_register() more than once for * any device structure. The driver model core is not designed to work * with devices that get unregistered and then spring back to life. * (Among other things, it's very hard to guarantee that all references * to the previous incarnation of @dev have been dropped.) Allocate * and register a fresh new struct device instead. That, of course, probably have no bearing on the problem/patch in this thread... Or maybe struct device reuse is exactly what is going on??? Cheers, peda