Re: EP93xx PIO IDE driver proposal

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

 



Hello.

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.

Best regards,
João Ramos

------------------------------------------------------------------------

Initially set PIO Mode 0 for all host drivers that use PIO transfer mode

All drivers have to use the PIO mode (at least to transfer the taskfile -- and for some PIO only commands too).

(and export a 'set_pio_mode' method)

   s/export/have/

before the IDE core figures out
the most suited PIO mode for the attached device.

Signed-off-by: Joao Ramos <joao.ramos@xxxxxxx>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxxxxxx>
Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>

   Alan is hardly much interested in the IDE patches. :-)

---

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 7f264ed..f92cac4 100644
--- 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,

   This passage is pointless.

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);
 	}
 }

MBR, Sergei
--
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

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux