[PATCH] Wait for hald during initialization when necessary

Paulo César Pereira de Andrade pcpa at mandriva.com.br
Wed Jan 21 08:39:27 PST 2009


Peter Hutterer wrote:

>> +    /* hald might not finish it's init yet, we'll wait for it for 2s */
>> +    unsigned int wait_for_hal = 2 * 1000000;
>> +    const unsigned int wait_for_hal_sleep_time = 100 * 1000;
>> +

>> +    /* hald might not be ready now, waiting for it for a few seconds */
>> +    while (wait_for_hal >= wait_for_hal_sleep_time)
>> +    {
>> +	    if (libhal_ctx_init(info->hal_ctx, &error))
>> +		    goto ctx_init_done;
>> +
>> +	    LogMessage(X_INFO, "config/hal: waiting for hald...\n");
>> +	    usleep (wait_for_hal_sleep_time);
>> +	    wait_for_hal -= wait_for_hal_sleep_time;
>>      }


> I think it'd be better to set a timer to fire off the reinitialization
> rather
> than a simple usleep. Doing so allows us to finish the server
> initialization
> without having to wait for hal. Any opinions?

  I can rework my patch to remove the "hal_giveup()" function, and
use a timer firing like every 8 seconds. The idea of fallback to
load/use kbd/mouse would be really only useful in a few special
cases on broken setups (usually development setups :-), so that
one would have a functional keyboard/mouse after sometime, as long
as the kdb and mouse drivers were functional ("wrong" abi would
be enough to have a inputless X Server...).

> Cheers,
>   Peter

Paulo




More information about the xorg mailing list