Re: [PATCH] i2c: core: Prevent race condition when removing i2c devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux