From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Limonciello Date: Mon, 27 Jul 2009 21:19:59 +0000 Subject: [PATCH 2/2] hid2hci: when recovering from S3 use parent devpath Message-Id: <4A6E19FF.5070207@dell.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------enigBCBA93E9E88CE33C86F95B80" List-Id: To: linux-hotplug@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBCBA93E9E88CE33C86F95B80 Content-Type: multipart/mixed; boundary="------------010304020102030506020907" This is a multi-part message in MIME format. --------------010304020102030506020907 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 --=20 Mario Limonciello *Dell | Linux Engineering* mario_limonciello@dell.com --------------010304020102030506020907 Content-Type: text/x-patch; name="s3_again.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="s3_again.diff" 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. =3D=3D=3D 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 th= e mouse # device needs to be chased down on the USB bus. ATTR{bDeviceClass}=3D=3D"e0", ATTR{bDeviceSubClass}=3D=3D"01", ATTR{bDev= iceProtocol}=3D=3D"01", \ - ATTR{idVendor}=3D=3D"413c", ATTR{bmAttributes}=3D=3D"e0", \ - ENV{REMOVE_CMD}=3D"hid2hci --method=3Ddell --devpath=3D%p --find-sibli= ng-intf=3D03:01:02" + ATTR{idVendor}=3D=3D"413c", ATTR{bmAttributes}=3D=3D"e0", IMPORT{paren= t}=3D"DEVPATH", \ + ENV{REMOVE_CMD}=3D"hid2hci --method=3Ddell --devpath=3D$env{DEVPATH} -= -find-sibling-intf=3D03:01:02" =20 # CSR devices ATTR{idVendor}=3D=3D"0a12|0458|05ac", ATTR{idProduct}=3D=3D"1000", RUN+=3D= "hid2hci --method=3Dcsr --devpath=3D%p" =3D=3D=3D 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); } =20 - /* find matching sibling of the current usb_device, they share the same= hub */ - udev_parent =3D udev_device_get_parent_with_subsystem_devtype(udev_dev,= "usb", "usb_device"); - if (udev_parent =3D=3D NULL) - return NULL; - enumerate =3D udev_enumerate_new(udev); if (enumerate =3D=3D NULL) return NULL; @@ -222,7 +217,7 @@ udev_enumerate_add_match_subsystem(enumerate, "usb"); =20 /* 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); =20 /* match the specified interface */ --------------010304020102030506020907-- --------------enigBCBA93E9E88CE33C86F95B80 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpuGf8ACgkQ2CrZjkA73YtFnACgjzcOBEY1RP+abYsbfzacoNHQ en8Aniaejtod13EqCKSkQ2hq+cXiOWk6 =WXf8 -----END PGP SIGNATURE----- --------------enigBCBA93E9E88CE33C86F95B80--