Re: [PATCH] PATA port support for PDC2037x
From: Jeff Garzik <hidden>
Date: 2004-09-30 03:39:35
Erik Benada wrote:
Jeff, included is patch to add support for PATA port on Promise PDC2037x controllers. Patch is against 2.6.8.1 vanilla kernel. I tested this patch on my PDC20378 on-board controller with 1 PATA drive attached. I didn't do any large testing but my drive was detected properly and I was able to mount and use filesystem on it. I tried to minimize changes to libata code. I just added flags for each port to ata_probe_ent structure and modified ata_host_init() function. Promise SATA driver was changed to use new ata_probe_ent->port_flags, check for presence of PATA port and pdc_phy_reset will use different reset code for PATA and SATA ports. Any comments, suggestions?
Very nice! I don't see any bugs in the code... my main concern is that I definitely want to see host controllers (struct ata_host_set) support multiple ata_port_operations structures. That would eliminate the need to do + if (ap->flags & ATA_FLAG_SATA) + sata_phy_reset(ap); + else + pdc_pata_phy_reset(ap); and also eliminate a few other roadblocks. However, implementing such is not a simple as your solution. I will definitely merge this patch into my libata-dev queue, so that others can download and test it (and/or simply get their PATA port working). We'll see where it goes from there. If nobody (including me) implements the ata_port_operations solution I described, then I will probably push this into upstream 2.6.x as an incremental step towards the proper solution. Thanks, Jeff