Skip to contentSkip to conversation

pata_marvell: fix cable detection - take 2

PATCH In review Arnaud Patard 2 participants 3 messages Nov 20, 2006 – Nov 21, 2006 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pata_marvell: fix cable detection - take 2

Last time I looked at the cable detection code, I fixed the "always detect cable as sata cable" case, but this is not enough. I didn't notice that the 80-pin cable was seen as a 40-pin cable. The appended patch fixes that.

---

drivers/ata/pata_marvell.c +2 -3
Index: libata-dev/drivers/ata/pata_marvell.c
===================================================================
@@ -57,11 +57,10 @@ static int marvell_pre_reset(struct ata_
 	switch(ap->port_no)
 	{
 	case 0:
-		/* Might be backward, docs unclear */
 		if (inb(ap->ioaddr.bmdma_addr + 1) & 1)
-			ap->cbl = ATA_CBL_PATA80;
-		else
 			ap->cbl = ATA_CBL_PATA40;
+		else
+			ap->cbl = ATA_CBL_PATA80;
 		break;
 
 	case 1: /* Legacy SATA port */
#1 lore raw
Quoted 5 lines · Arnaud Patard

Last time I looked at the cable detection code, I fixed the "always detect cable as sata cable" case, but this is not enough. I didn't notice that the 80-pin cable was seen as a 40-pin cable. The appended patch fixes that.

Thanks - the docs were a bit blank on which was which - have you checked this now detects right both ways around ?

#2 lore raw
Quoted 9 lines · Alan Cox
Quoted 5 lines · Arnaud Patard

Last time I looked at the cable detection code, I fixed the "always detect cable as sata cable" case, but this is not enough. I didn't notice that the 80-pin cable was seen as a 40-pin cable. The appended patch fixes that.

Thanks - the docs were a bit blank on which was which - have you checked this now detects right both ways around ?

yeah, I've tested on two boxes, with 40-pin and 80-pin cables :)