Re: 2.6.23-rc4-mm1: broke pata_via cable detection

2007-09-10 Thread Jeff Garzik

Laurent Riffard wrote:

Le 01.09.2007 06:58, Andrew Morton a écrit :

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc4/2.6.23-rc4-mm1/

[...]

+libata-correct-handling-of-srst-reset-sequences.patch

[...]

Alan,

libata-correct-handling-of-srst-reset-sequences.patch broke 80-wire
cable detection on pata_via driver:


$ dmesg | grep ata1
ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xb800 irq 14
ata1.00: ATA-5: ST340016A, 3.75, max UDMA/100
ata1.00: 78165360 sectors, multi 16: LBA 
ata1.01: ATA-7: Maxtor 6Y080L0, YAR41BW0, max UDMA/133
ata1.01: 160086528 sectors, multi 16: LBA 
ata1.00: limited to UDMA/33 due to 40-wire cable

ata1.01: limited to UDMA/33 due to 40-wire cable
ata1.00: configured for UDMA/33
ata1.01: configured for UDMA/33


2.6.23-rc3-mm1 and 2.6.23-rc4 work fine (ata1 devices are configured
for UDMA/100).

Few weeks ago, I wrote a patch to solve a wrong cable detection
problem after suspend-to-disk/resume, and it solves this problem
too. Is it the right way to go ?



via_do_set_mode overwrites 80-wire cable detection bits. Let's
preserve them.

Signed-off-by: Laurent Riffard <[EMAIL PROTECTED]>


applied


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc4-mm1: broke pata_via cable detection

2007-09-10 Thread Jeff Garzik

Laurent Riffard wrote:

Le 01.09.2007 06:58, Andrew Morton a écrit :

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc4/2.6.23-rc4-mm1/

[...]

+libata-correct-handling-of-srst-reset-sequences.patch

[...]

Alan,

libata-correct-handling-of-srst-reset-sequences.patch broke 80-wire
cable detection on pata_via driver:


$ dmesg | grep ata1
ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xb800 irq 14
ata1.00: ATA-5: ST340016A, 3.75, max UDMA/100
ata1.00: 78165360 sectors, multi 16: LBA 
ata1.01: ATA-7: Maxtor 6Y080L0, YAR41BW0, max UDMA/133
ata1.01: 160086528 sectors, multi 16: LBA 
ata1.00: limited to UDMA/33 due to 40-wire cable

ata1.01: limited to UDMA/33 due to 40-wire cable
ata1.00: configured for UDMA/33
ata1.01: configured for UDMA/33


2.6.23-rc3-mm1 and 2.6.23-rc4 work fine (ata1 devices are configured
for UDMA/100).

Few weeks ago, I wrote a patch to solve a wrong cable detection
problem after suspend-to-disk/resume, and it solves this problem
too. Is it the right way to go ?



via_do_set_mode overwrites 80-wire cable detection bits. Let's
preserve them.

Signed-off-by: Laurent Riffard [EMAIL PROTECTED]


applied


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc4-mm1: broke pata_via cable detection

2007-09-02 Thread Alan Cox
> via_do_set_mode overwrites 80-wire cable detection bits. Let's
> preserve them.

Agreed, on a reset case we may otherwise get confused and misdetect the
cable. Change agrees with the data sheet


> 
> Signed-off-by: Laurent Riffard <[EMAIL PROTECTED]>

Acked-by: Alan Cox <[EMAIL PROTECTED]>

Thanks a lot
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc4-mm1: broke pata_via cable detection

2007-09-02 Thread Laurent Riffard
Le 01.09.2007 06:58, Andrew Morton a écrit :
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc4/2.6.23-rc4-mm1/
[...]
> +libata-correct-handling-of-srst-reset-sequences.patch
[...]

Alan,

libata-correct-handling-of-srst-reset-sequences.patch broke 80-wire
cable detection on pata_via driver:

> $ dmesg | grep ata1
> ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xb800 irq 14
> ata1.00: ATA-5: ST340016A, 3.75, max UDMA/100
> ata1.00: 78165360 sectors, multi 16: LBA 
> ata1.01: ATA-7: Maxtor 6Y080L0, YAR41BW0, max UDMA/133
> ata1.01: 160086528 sectors, multi 16: LBA 
> ata1.00: limited to UDMA/33 due to 40-wire cable
> ata1.01: limited to UDMA/33 due to 40-wire cable
> ata1.00: configured for UDMA/33
> ata1.01: configured for UDMA/33

2.6.23-rc3-mm1 and 2.6.23-rc4 work fine (ata1 devices are configured
for UDMA/100).

Few weeks ago, I wrote a patch to solve a wrong cable detection
problem after suspend-to-disk/resume, and it solves this problem
too. Is it the right way to go ?



via_do_set_mode overwrites 80-wire cable detection bits. Let's
preserve them.

Signed-off-by: Laurent Riffard <[EMAIL PROTECTED]>
---
 drivers/ata/pata_via.c |7 +++
 1 file changed, 7 insertions(+)

Index: linux-2.6-mm/drivers/ata/pata_via.c
===
--- linux-2.6-mm.orig/drivers/ata/pata_via.c
+++ linux-2.6-mm/drivers/ata/pata_via.c
@@ -245,6 +245,7 @@ static void via_do_set_mode(struct ata_p
unsigned long T =  10 / via_clock;
unsigned long UT = T/tdiv;
int ut;
+   u8 cable80_status;
int offset = 3 - (2*ap->port_no) - adev->devno;


@@ -294,9 +295,14 @@ static void via_do_set_mode(struct ata_p
ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
break;
}
+
+   /* Get 80-wire cable detection bit */
+   pci_read_config_byte(pdev, 0x50 + offset, _status);
+   cable80_status &= 0x10;
+
/* Set UDMA unless device is not UDMA capable */
if (udma_type)
-   pci_write_config_byte(pdev, 0x50 + offset, ut);
+   pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
 }

 static void via_set_piomode(struct ata_port *ap, struct ata_device
*adev)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc4-mm1: broke pata_via cable detection

2007-09-02 Thread Laurent Riffard
Le 01.09.2007 06:58, Andrew Morton a écrit :
 ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc4/2.6.23-rc4-mm1/
[...]
 +libata-correct-handling-of-srst-reset-sequences.patch
[...]

Alan,

libata-correct-handling-of-srst-reset-sequences.patch broke 80-wire
cable detection on pata_via driver:

 $ dmesg | grep ata1
 ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xb800 irq 14
 ata1.00: ATA-5: ST340016A, 3.75, max UDMA/100
 ata1.00: 78165360 sectors, multi 16: LBA 
 ata1.01: ATA-7: Maxtor 6Y080L0, YAR41BW0, max UDMA/133
 ata1.01: 160086528 sectors, multi 16: LBA 
 ata1.00: limited to UDMA/33 due to 40-wire cable
 ata1.01: limited to UDMA/33 due to 40-wire cable
 ata1.00: configured for UDMA/33
 ata1.01: configured for UDMA/33

2.6.23-rc3-mm1 and 2.6.23-rc4 work fine (ata1 devices are configured
for UDMA/100).

Few weeks ago, I wrote a patch to solve a wrong cable detection
problem after suspend-to-disk/resume, and it solves this problem
too. Is it the right way to go ?



via_do_set_mode overwrites 80-wire cable detection bits. Let's
preserve them.

Signed-off-by: Laurent Riffard [EMAIL PROTECTED]
---
 drivers/ata/pata_via.c |7 +++
 1 file changed, 7 insertions(+)

Index: linux-2.6-mm/drivers/ata/pata_via.c
===
--- linux-2.6-mm.orig/drivers/ata/pata_via.c
+++ linux-2.6-mm/drivers/ata/pata_via.c
@@ -245,6 +245,7 @@ static void via_do_set_mode(struct ata_p
unsigned long T =  10 / via_clock;
unsigned long UT = T/tdiv;
int ut;
+   u8 cable80_status;
int offset = 3 - (2*ap-port_no) - adev-devno;


@@ -294,9 +295,14 @@ static void via_do_set_mode(struct ata_p
ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
break;
}
+
+   /* Get 80-wire cable detection bit */
+   pci_read_config_byte(pdev, 0x50 + offset, cable80_status);
+   cable80_status = 0x10;
+
/* Set UDMA unless device is not UDMA capable */
if (udma_type)
-   pci_write_config_byte(pdev, 0x50 + offset, ut);
+   pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
 }

 static void via_set_piomode(struct ata_port *ap, struct ata_device
*adev)


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc4-mm1: broke pata_via cable detection

2007-09-02 Thread Alan Cox
 via_do_set_mode overwrites 80-wire cable detection bits. Let's
 preserve them.

Agreed, on a reset case we may otherwise get confused and misdetect the
cable. Change agrees with the data sheet


 
 Signed-off-by: Laurent Riffard [EMAIL PROTECTED]

Acked-by: Alan Cox [EMAIL PROTECTED]

Thanks a lot
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/