Re: [PATCH 08/11] usb: Add USB subsystem notifications [ver #7]

From
David Howells <dhowells@redhat.com>
Date
2019-09-04 15:17:57
Also in
keyrings, linux-api, linux-block, linux-fsdevel, linux-usb, lkml
Reply to
Alan Stern, 2019-09-03
Alan Stern [off-list ref] wrote:
quoted
quoted
Unfortunately, I don't know how to fix it and don't have much time to
investigate it right now - and it's something that can be added back later.
The cause of your problem is quite simple:

 static int usbdev_notify(struct notifier_block *self,
 			       unsigned long action, void *dev)
 {
 	switch (action) {
 	case USB_DEVICE_ADD:
+		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_ADD, 0);
 		break;
 	case USB_DEVICE_REMOVE:
+		post_usb_device_notification(dev, NOTIFY_USB_DEVICE_REMOVE, 0);
+		usbdev_remove(dev);
+		break;
+	case USB_BUS_ADD:
+		post_usb_bus_notification(dev, NOTIFY_USB_BUS_ADD, 0);
+		break;
+	case USB_BUS_REMOVE:
+		post_usb_bus_notification(dev, NOTIFY_USB_BUS_REMOVE, 0);
 		usbdev_remove(dev);
 		break;
 	}

The original code had usbdev_remove(dev) under the USB_DEVICE_REMOVE
case.  The patch mistakenly moves it, putting it under the
------------------------------^^^^^

Sorry, I should have said "duplicates" it.
Ah, thanks.  I'd already removed the USB bus notifications, so I'll leave them
out for now.

David
Thread (42 messages) 42 messages, 7 authors, last reply 2019-09-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help