Skip to content

Commit

Permalink
libata: Spot bridge chips
Browse files Browse the repository at this point in the history
If we have a PATA cable with a SATA drive on it then we've found a
bridge and we can flip the cable type. This fixes some cable detect
problems with SATA bridges on chipsets and misdetected cable types.

In theory cable detection and mode limiting is needed if you put a
SATA/PATA bridge on a 40 wire cable, but I see no way to deal with
that other than to point out its not a good idea anyway.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Oct 12, 2007
1 parent 4743d08 commit 614fe29
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,17 @@ int ata_bus_probe(struct ata_port *ap)
if (ap->ops->cable_detect)
ap->cbl = ap->ops->cable_detect(ap);

/* We may have SATA bridge glue hiding here irrespective of the
reported cable types and sensed types */
ata_link_for_each_dev(dev, &ap->link) {
if (!ata_dev_enabled(dev))
continue;
/* SATA drives indicate we have a bridge. We don't know which
end of the link the bridge is which is a problem */
if (ata_id_is_sata(dev->id))
ap->cbl = ATA_CBL_SATA;
}

/* After the identify sequence we can now set up the devices. We do
this in the normal order so that the user doesn't get confused */

Expand Down

0 comments on commit 614fe29

Please sign in to comment.