hpt366 is strange in that its cable detection register uses the higher bit for master, so the testing should be 2 >> port_no instead of 1 << port_no. Fix it. Info provided by Alan Cox. Signed-off-by: Tejun Heo <tj@xxxxxxxxxx> Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> --- drivers/ata/pata_hpt366.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: work/drivers/ata/pata_hpt366.c =================================================================== --- work.orig/drivers/ata/pata_hpt366.c +++ work/drivers/ata/pata_hpt366.c @@ -215,7 +215,7 @@ static int hpt36x_cable_detect(struct at struct pci_dev *pdev = to_pci_dev(ap->host->dev); pci_read_config_byte(pdev, 0x5A, &ata66); - if (ata66 & (1 << ap->port_no)) + if (ata66 & (2 >> ap->port_no)) return ATA_CBL_PATA40; return ATA_CBL_PATA80; } -- 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