Re: Complicated problem with ACPI probe / enumeration ordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 29-01-19 23:41, Rafael J. Wysocki wrote:
On Fri, Jan 25, 2019 at 11:47 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:

<big snip>

I wonder if we could just defer the enumeration of devices with _DEP
underneath.  That is, evaluate _DEP before calling
acpi_bus_type_and_status() in acpi_bus_check_add() and, if present and
non-empty, put the handle onto a "to be inspected later" list, skip it
along with everything below it and only get back to it when we have
enumerated all stuff without _DEP.  [And don't do that for devices on
the PCI bus.]

I agree with you that ideally we would honor _DEP during enumeration
and skip enumeration of devices (and their children) with a _DEP which
lists unmet dependencies.

This is not exactly what I'm talking about, however.

The idea is to defer the enumeration of devices with non-empty _DEP
(that is, non-empty after taking some known pathological cases into
account) and their children until all of the devices without _DEP have
been enumerated.

Nitpick, I assume that enumerated above includes having acpi_bus_attach()
called on them.

Ah, rereading your original proposal I understand what you want to do now.
Yes I think that will work for the problematic cases I am aware of
(which is mostly the one from this thread).

But I think if we're going to do this, it would be better to have
something like this:

	walk-tree, adding devices where all _DEP dependencies are met (or there are none),
		   add devices with missing deps to a to-be-enumerated list.
	acpi_bus_attach(acpi_root)

	while (1) {
		number_of_enumerated_devices = 0;
		for-each-handle-on-to-be-enumerated-list {
			dep_ok = check_DEP()
			if (dep_ok) {
				add-device()
				number_of_enumerated_devices++
			}
		}
		if (number_of_enumerated_devices == 0)
			break;
		acpi_bus_attach(acpi_root)
	}

	number_of_enumerated_devices = 0;
	for-each-handle-on-to-be-enumerated-list {
		add-device()
		number_of_enumerated_devices++
	}

	if (number_of_enumerated_devices)
		acpi_bus_attach(acpi_root)

I believe that this is pretty close to your proposal, except that
it tries to also honor nested _DEP-s, while still adding all
devices independent of _DEP at the end.

But this is a huge change. The only way I can see this happening is if
we initially keep both the old and new methods, with some kernel commandline
to switch and then blog, etc. about this and ask people to test the new
way as soon as a kernel with the new way is actually available in distros
(Fedora gets new kernel releases in a month or so from the .0 release).

If you feel this is the way to go and you can make some time to actually
implement this this year, then I will happily help with patch-review and
trying the new option on all my hardware. I'm afraid I don't have time
to do such an overhaul myself, but I'm willing to commit to reviewing
the patches (and testing).

Fair enough.

I may be able to find some time to do that, so we'll see.

Ok.

Regards,

Hans



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux