Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Arjan van de Ven <arjan@...>
Cc: <linux-kernel@...>, <mingo@...>, Pavel Machek <pavel@...>, Rafael J. Wysocki <rjw@...>, Paul Diefenbaugh <paul.s.diefenbaugh@...>, Andy Grover <andrew.grover@...>, Len Brown <lenb@...>
Date: Sunday, July 20, 2008 - 10:20 am

On 20-07-08 13:10, Arjan van de Ven wrote:


May have found an issue with 3/3 for this same reason. You make the ACPI 
button driver async but acpi_wakeup_device_init() is a late_initcall and 
comments that it interacts with the button driver.

The button driver could be a module so a complete reversal of ordering 
between acpi_wakeup_device() and acpi_button_init() might in itself not 
be a problem (undeterministic order even with the button driver builtin 
might be undesireable I guess) but ...

Correct me if I'm wrong but I believe your patch implies that we could 
be racing between acpi_wakeup_device() and acpi_button_init()? If yes, 
do bad things happen when we race checking dev->wakeup.state.enabled?

As far as I can see, the acpi_device_lock isn't serialising here so if 
we have just done the acpi_enable_gpe() in acpi_button_add() but haven't 
set the enabled flag yet we could do it again here it seems.

The ACPI button driver doesn't appear to have a specific maintainer and 
Len Brown was on vacation I believe but this would ideally like a 
comment from that side...


I worry...


Makes sense in this specific case. Generally, utility of late_initcall() 
does seem to be impacted by this. Unless you can be sure that every 
device you depend on is and always will be sync you might as well be 
device_initcall() yourself after all.

Yes, I did note the bit about the endpoint probing already being async 
for example for USB but now you can't even be sure that it _started_ 
meaning you also couldn't really devise some private synchronization 
mechanism either.

Rene.



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 0/3] fastboot patches series 1, Arjan van de Ven, (Fri Jul 18, 6:15 pm)
Re: [patch 0/3] fastboot patches series 1, Ingo Molnar, (Sun Jul 20, 4:31 am)
Re: [patch 0/3] fastboot patches series 1, Simon Arlott, (Sat Jul 19, 12:51 am)
Re: [patch 0/3] fastboot patches series 1, Arjan van de Ven, (Sat Jul 19, 1:16 am)
Re: [patch 0/3] fastboot patches series 1, Andi Kleen, (Sat Jul 19, 6:22 am)
Re: [patch 0/3] fastboot patches series 1, Simon Arlott, (Sat Jul 19, 1:47 am)
[patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Fri Jul 18, 6:16 pm)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Sat Jul 19, 11:44 am)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Sun Jul 20, 7:10 am)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Rene Herman, (Sun Jul 20, 10:20 am)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Sun Jul 20, 11:35 am)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Fri Jul 18, 11:44 pm)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Sat Jul 19, 1:20 am)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Sat Jul 19, 11:35 am)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Sat Jul 19, 12:14 pm)
Re: [patch 1/3] fastboot: Create a "asynchronous" initlevel, Arjan van de Ven, (Sat Jul 19, 12:58 am)