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

From
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date
2019-09-04 01:53:07
Also in
keyrings, linux-block, linux-fsdevel, linux-security-module, linux-usb, lkml
Reply to
Greg Kroah-Hartman, 2019-09-03
Hi Greg,
From: Greg Kroah-Hartman, Sent: Tuesday, September 3, 2019 6:37 PM
<snip>
quoted
quoted
+void post_usb_bus_notification(const struct usb_bus *ubus,
This function's argument is struct usb_bus *, but ...
quoted
+			       enum usb_notification_type subtype, u32 error)
+{
+	post_usb_notification(ubus->bus_name, subtype, error);
+}
+#endif
+
 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);
this function calls usbdev_remove() with incorrect argument if the action
is USB_BUS_REMOVE. So, this seems to cause the following issue [1] on
my environment (R-Car H3 / r8a7795 on next-20190902) [2]. However, I have
no idea how to fix the issue, so I report this issue at the first step.
As a few of us just discussed this on IRC, these bus notifiers should
probably be dropped as these are the incorrect structure type as you
found out.  Thanks for the report.
Thank you for the discussion. I got it.

Best regards,
Yoshihiro Shimoda
greg k-h
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