On Wed, Dec 05, 2018 at 08:49:16PM +0100, Greg Kroah-Hartman wrote: > On Wed, Dec 05, 2018 at 09:40:51PM +0200, Ville Syrjälä wrote: > > On Wed, Dec 05, 2018 at 08:20:36PM +0100, Greg Kroah-Hartman wrote: > > > On Wed, Dec 05, 2018 at 05:40:32PM +0200, Ville Syrjälä wrote: > > > > On Wed, Dec 05, 2018 at 08:06:21AM +0100, Greg Kroah-Hartman wrote: > > > > > On Tue, Dec 04, 2018 at 10:41:17PM +0200, Ville Syrjala wrote: > > > > > > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > > > > > > > > > > > Since commit 1455cf8dbfd0 ("driver core: emit uevents when > > > > > > device is bound to a driver") the kernel started emitting > > > > > > "bind" and "unbind" uevents which confuse the hid2hci > > > > > > udev rules. > > > > > > > > > > > > The symptoms on an affected machine (Dell E5400 in my case) > > > > > > include bluetooth devices not appearing and udev hogging > > > > > > the cpu as it's busy processing a constant stream of these > > > > > > "bind"+"unbind" uevents. > > > > > > > > > > What is causing a "stream" of bind and unbind events? This only happens > > > > > when a device is attached to a driver or removed from a driver, which is > > > > > caused by something else happening. > > > > > > > > Not sure if it's just due to this thing causing devices to > > > > appear/disappear during bind/unbind events or what. > > > > > > Someone has to be telling the kernel to bind/unbind from a driver to > > > a device, it doesn't do it on its own. Look at your other rules/scripts > > > for that. > > > > > > Also note that the kernel has been doing this for over a year now (since > > > 4.l4), what just happened in 4.19 to cause this to be an issue? > > > > It became an issue for me after I got a machine that suffers from > > this. The regression has been present ever since commit 1455cf8dbfd0 > > ("driver core: emit uevents when device is bound to a driver"). > > > > You need a Dell E5400 or something similar to see it since those > > have these magic bluetooth devices or whatever. > > What does the kernel log say is going on? Is the device "bouncing" from > being added/removed from the system all the time? I totally forgot about this until another bluez update happened and the CPU hog came back. I had another look at this and I suppose the problem is caused by USBFS_IOCTL_DISCONNECT being called for every bind/unbind event. So I think this patch is still the right way to go. I did find a few more bugs in hid2hci but those don't actually make any real difference here. I'll send separate patches for those anyway. -- Ville Syrjälä Intel