On Monday 11 May 2009 15:20:33 João Ramos wrote: > > >>>> > >>>> > >>> Well, yes. Though I hoped that you would at least give a try to fixing > >>> IDE core to program PIO0 initially for all host drivers that implement > >>> ->set_pio_mode method... > >>> > >>> > >> Sorry, I didn't noticed your hint... Sure, I can give it a try ;-) > >> Maybe with a little help, but I can try. You mean, when the host driver > >> is registered (ide_host_register, or ide_host_add that later calls > >> ide_host_register), maybe in the 'ide_init_port' method (sorry, I need > >> some guidance here...) check if the 'set_pio_mode' method is > >> implemented, and after initializing each port (d->init_hwif(hwif)) > >> default it to PIO Mode 0, calling set_pio_mode method. > >> > > > > ide_init_port() seems OK but I think that ide_port_init_devices() > > [it is called after ide_init_port()] would be a bit safer and more > > flexible (some host drivers may also require special ->init_dev > > setup first) and the check for ->set_pio_mode method presence can > > be done just before actually using the method, i.e. > > > > const struct ide_port_ops *port_ops = hwif->port_ops; > > > > if (port_ops && port_ops->set_pio_mode) > > port_ops->set_pio_mode(...) > > > > > > Ok, so the patch for this is attached in this e-mail. > > Please confirm and make your comments. --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -1031,6 +1031,13 @@ static void ide_port_init_devices(ide_hwif_t *hwif) if (port_ops && port_ops->init_dev) port_ops->init_dev(drive); + + /* + * if driver uses PIO mode, default to PIO Mode 0 before we + * figure out the most suited mode for the attached device + */ + if (port_ops && port_ops->set_pio_mode) + port_ops->set_pio_mode(drive, 0); } } Looks good but please move this into a separate ide_port_for_each_dev() loop (some host drivers require full initial setup of both devices on the port before ->set_pio_mode can be called). -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html