hal: Branch 'master'
Richard Hughes
hughsient at kemper.freedesktop.org
Wed Jun 6 08:48:25 PDT 2007
hald/linux/osspec.c | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
New commits:
diff-tree 3734b53bafd98672db52ce55678f80136a5af84c (from 3455b5104bddca13e7ed5e7ec04e6fc4e8b5ac2e)
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Jun 6 16:48:45 2007 +0100
fix matching devices against dmi properties on the computer device
I've been tracing this, and it appears that when we do the match against
smbios.system.manufacturer then the following properties are on computer
are as follows:
device udi = /org/freedesktop/Hal/devices/computer
system.kernel.name = 'Linux' (string)
system.kernel.machine = 'i686' (string)
info.bus = 'unknown' (string)
info.udi = '/org/freedesktop/Hal/devices/computer' (string)
info.subsystem = 'unknown' (string)
info.product = 'Computer' (string)
system.kernel.version = '2.6.21-1.3194.fc7' (string)
This leads me to think that we are not actually waiting for the dmi
prober to finish before we do the fdi scanning, and are thus not
matching.
1. We create computer with:
device udi = /org/freedesktop/Hal/devices/computer
system.kernel.name = 'Linux' (string)
system.kernel.machine = 'i686' (string)
info.bus = 'unknown' (string)
info.udi = '/org/freedesktop/Hal/devices/computer' (string)
info.subsystem = 'unknown' (string)
info.product = 'Computer' (string)
system.kernel.version = '2.6.21-1.3194.fc7' (string)
2. We then add devices using coldplug_synthesize_events, doing
di_search_and_merge on each one as they are added.
3. We then run the probers and wait until they finish.
4. We then run di_search_and_merge on the computer device in
computer_probing_helper_done.
Now, the display matching quirks work because the device they are added
to is not a device added by coldplug (but computer itself), and thus
step 4 matches them and merges them. The laptop_panel quirks do not work
as the new device is added and di_search_and_merge'd before the probers
have finished, and we do not rescan devices doing absolute references
after step 4.
Let me do some more testing to verify, and see if I can come up with a
fix that doesn't break lots of other stuff.
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index afecfeb..f70f056 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -403,6 +403,26 @@ computer_probing_helper_done (HalDevice
if (!hal_device_has_property (d, "system.formfactor")) {
hal_device_property_set_string (d, "system.formfactor", "unknown");
}
+
+ /* will enqueue hotplug events for entire system */
+ HAL_INFO (("Synthesizing sysfs events..."));
+ coldplug_synthesize_events ();
+
+ HAL_INFO (("Synthesizing powermgmt events..."));
+ if (acpi_synthesize_hotplug_events ()) {
+ HAL_INFO (("ACPI capabilities found"));
+ } else if (pmu_synthesize_hotplug_events ()) {
+ HAL_INFO (("PMU capabilities found"));
+ } else if (apm_synthesize_hotplug_events ()) {
+ HAL_INFO (("APM capabilities found"));
+ } else {
+ HAL_INFO (("No powermgmt capabilities"));
+ }
+ HAL_INFO (("Done synthesizing events"));
+
+ /* we try again to match again on computer, now we have done coldplug
+ * and completed probing. In an ideal world, we would do this before
+ * _and_ after the coldplug, but this seems to work well. */
di_search_and_merge (d, DEVICE_INFO_TYPE_INFORMATION);
di_search_and_merge (d, DEVICE_INFO_TYPE_POLICY);
@@ -668,22 +688,6 @@ osspec_probe (void)
/* Let computer be in TDL while synthesizing all other events because some may write to the object */
hal_device_store_add (hald_get_tdl (), root);
- /* will enqueue hotplug events for entire system */
- HAL_INFO (("Synthesizing sysfs events..."));
- coldplug_synthesize_events ();
-
- HAL_INFO (("Synthesizing powermgmt events..."));
- if (acpi_synthesize_hotplug_events ()) {
- HAL_INFO (("ACPI capabilities found"));
- } else if (pmu_synthesize_hotplug_events ()) {
- HAL_INFO (("PMU capabilities found"));
- } else if (apm_synthesize_hotplug_events ()) {
- HAL_INFO (("APM capabilities found"));
- } else {
- HAL_INFO (("No powermgmt capabilities"));
- }
- HAL_INFO (("Done synthesizing events"));
-
/*
* Populate the powermgmt keys according to the kernel options.
* NOTE: This may not mean the machine is able to suspend
More information about the hal-commit
mailing list