From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Anthony L. Awtrey" Date: Sat, 29 Dec 2007 15:54:38 +0000 Subject: Re: udev no longer passes USB device remove events Message-Id: <47766DBE.90909@awtrey.com> List-Id: References: <4772D1C3.3070309@awtrey.com> In-Reply-To: <4772D1C3.3070309@awtrey.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Hello again, I fixed my problem, but not the right way. One thing that tripped me when I was investigating this issue was that when you issue a "udevcontrol log_priority=DEbug" you don't actually get dbg() messages in the syslog. Therefore my log dump looked like silent failure to me. Once I found the function I suspected to cause the trouble, I changed the dgb() functions to info() and could see this: udev_node_remove: device node '/dev/bus/usb/004/007' not found It looks like udev is failing to remove a non-existant device node and returning -1. Raw USB devices don't necessarily have device nodes to remove, so the perfectly reasonable "remove usb" events are failing for no good reason that I can tell. I fixed my problem by allowing the function udev_node_remove() to return 0 on device node remove failures: ... int udev_node_remove(struct udevice *udev) { char filename[PATH_SIZE]; char partitionname[PATH_SIZE]; struct stat stats; int retval =3D 0; int num; strlcpy(filename, udev_root, sizeof(filename)); strlcat(filename, "/", sizeof(filename)); strlcat(filename, udev->name, sizeof(filename)); if (stat(filename, &stats) !=3D 0) { dbg("device node '%s' not found", filename); return 0; /* <--- LOOK */ } ... I don't know the other implications, but it appears to work and does not cause any other obvious problems in my limited testing. Can anyone suggest a more appropriate fix? Tony ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel