Re: PATCH: switch ide-proc to use the ide_key functionality

From: Alan Cox
Date: Mon Aug 16 2004 - 19:44:39 EST


On Tue, Aug 17, 2004 at 02:31:25AM +0200, Bartlomiej Zolnierkiewicz wrote:
> > > It is also still racy for some drivers because ide_register_hw() ->
> > > init_hwif_data() sets hwif->key to zero - you must set hwif->hold to 1.
> >
> > ide_register_hw holds ide_setting_sem. I think that should be ok ?
>
> ide_setting_sem doesn't help situation when hwif is unregistered and some
> other driver is loaded later and takes this hwif using ide_register_hw().

Right - ide_cfg_sem is covering this. ide_cfg_sem is taken after
ide_setting_sem so how about making init_hwif_data restore that field.

ide_drive_from_key can then take ide_cfg_sem during its checking

The other alternative is to never use key = 0 in the real world but I
see no reason for not just taking ide_cfg_sem during the key to drive
operation. ide_cfg_sem is the read lock for configuration change so this
is logically the right behaviour too ?





-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/