Re: EP93xx PIO IDE driver proposal

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

 



Bartlomiej Zolnierkiewicz wrote:

So you're saying I should support all PIO modes? If so, I would have to make conditional code, checking perhaps a module param to sort which PIO mode to use.

If you advertise PIO0-PIO4 as supported the core IDE code will do all the
work on figuring which modes are supported by the attached devices. You
just need to be able to set them.

Alan

Ok, so I've been studying that (I was quite lost for a time, I confess, I'm not that much familiar with the IDE subsystem, so please bear with me ;-) ).

So I need to set up a hook for 'set_pio_mode()', so that when the IDE subsystem detects a device and figures the most suitable PIO mode for the device, it will call the 'set_pio_mode' routine provided by the driver in order to configure the host controller for that PIO mode.

This also means that my host controller driver should always default to PIO Mode 0, as the initial host controller setup that is carried out by the 'init_hwif' routine, allowing devices to be detected. Afterwards, the IDE subsystem detects the most suitable PIO mode and calls 'set_pio_mode' to change that configuration.

Am I correct on this?

Yes! :)

There is still a room for improvement though -- it would be better to fix
IDE core to set PIO0 before probing devices for all host controllers.

Moreover it seems that doing it this way would allow us to remove ->init_hwif
method from this driver and do all necessary setup in ep93xx_ide_probe()
(this controller is a single port one so theoretically there shouldn't be
a need for having per-port ->init_hwif implementation).

So, I should remove the 'init_hwif' hook, and all the host controller setup would be made in the driver's probe method, correct?

Yes, that would be preferred (of course given that you fix IDE core to do
initial PIO0 setup first).

Er, it's not that easy... Think about older CompactFlash cards (and ancient drives of course) that don't support setting explicit PIO modes (only the default one) since they don't support IORDY... and also ide_config_drive_speed() expects drive->id to be already filled in... So I guess you mean just calling set_pio_mode() prior to probing -- without setting the drive's own mode?

Thanks,
Bart

WBR, 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