linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] hid2hci: when recovering from S3 use parent devpath
@ 2009-07-27 21:19 Mario Limonciello
  2009-07-27 21:35 ` Marcel Holtmann
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Mario Limonciello @ 2009-07-27 21:19 UTC (permalink / raw)
  To: linux-hotplug


[-- Attachment #1.1: Type: text/plain, Size: 616 bytes --]

Hi:

After the previous cleanup submitted to hid2hci, the code for finding
the sibling device changed significantly.  Although this works perfectly
fine when all the devices are on the bus, it doesn't for the recovery
from S3 situation.  The device is already off the bus by the time
hid2hci is called so the devpath is not found in the udev database.  The
easiest way to solve this is to use the parent's devpath instead, but
this does introduce a dependency on importing the env variable DEVPATH
from the parent.

Regards
-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: s3_again.diff --]
[-- Type: text/x-patch; name="s3_again.diff", Size: 1967 bytes --]

Since the BT device is off the bus, trying to query it from the udev
database fails.  We need to send the parent's DEVPATH (unfortunately
by pulling in from the $env) and then go from there.

=== modified file 'extras/hid2hci/70-hid2hci.rules'
--- extras/hid2hci/70-hid2hci.rules	2009-07-24 16:06:22 +0000
+++ extras/hid2hci/70-hid2hci.rules	2009-07-27 21:03:40 +0000
@@ -20,8 +20,8 @@
 # Unfortunately the only event seen is the BT device disappearing, so the mouse
 # device needs to be chased down on the USB bus.
 ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", \
-  ATTR{idVendor}=="413c", ATTR{bmAttributes}=="e0", \
-  ENV{REMOVE_CMD}="hid2hci --method=dell --devpath=%p --find-sibling-intf=03:01:02"
+  ATTR{idVendor}=="413c", ATTR{bmAttributes}=="e0", IMPORT{parent}="DEVPATH", \
+  ENV{REMOVE_CMD}="hid2hci --method=dell --devpath=$env{DEVPATH} --find-sibling-intf=03:01:02"
 
 # CSR devices
 ATTR{idVendor}=="0a12|0458|05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method=csr --devpath=%p"

=== modified file 'extras/hid2hci/hid2hci.c'
--- extras/hid2hci/hid2hci.c	2009-07-27 20:45:34 +0000
+++ extras/hid2hci/hid2hci.c	2009-07-27 21:03:40 +0000
@@ -210,11 +210,6 @@
 		return usb_open(dev);
 	}
 
-	/* find matching sibling of the current usb_device, they share the same hub */
-	udev_parent = udev_device_get_parent_with_subsystem_devtype(udev_dev, "usb", "usb_device");
-	if (udev_parent == NULL)
-		return NULL;
-
 	enumerate = udev_enumerate_new(udev);
 	if (enumerate == NULL)
 		return NULL;
@@ -222,7 +217,7 @@
 	udev_enumerate_add_match_subsystem(enumerate, "usb");
 
 	/* match all childs of the parent */
-	util_strscpyl(str, sizeof(str), udev_device_get_sysname(udev_parent), "*", NULL);
+	util_strscpyl(str, sizeof(str), udev_device_get_sysname(udev_dev), "*", NULL);
 	udev_enumerate_add_match_sysname(enumerate, str);
 
 	/* match the specified interface */


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-08-11 22:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 21:19 [PATCH 2/2] hid2hci: when recovering from S3 use parent devpath Mario Limonciello
2009-07-27 21:35 ` Marcel Holtmann
2009-07-27 22:36 ` Mario Limonciello
2009-07-27 22:42 ` Marcel Holtmann
2009-07-28  0:04 ` Kay Sievers
2009-07-28 18:10 ` Mario Limonciello
2009-07-31 18:53 ` Kay Sievers
2009-07-31 19:35 ` Mario Limonciello
2009-08-05  7:47 ` Kay Sievers
2009-08-06 22:03 ` Mario Limonciello
2009-08-07  0:27 ` Kay Sievers
2009-08-07  0:44 ` Marcel Holtmann
2009-08-07  0:57 ` Kay Sievers
2009-08-07  1:28 ` Marco d'Itri
2009-08-07  1:47 ` Kay Sievers
2009-08-07  3:48 ` Marco d'Itri
2009-08-11 17:49 ` Karl O. Pinc
2009-08-11 22:22 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).