Re: 2.6.23-rc1-mm2 (checks-for-80wire-cable-use-in-pata_via)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Alan Cox <alan@...>
Cc: Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-ide@...>
Date: Wednesday, August 1, 2007 - 4:13 pm

Le 01.08.2007 08:09, Andrew Morton a écrit :
...
...

Alan,

this does not work after a suspend-resume cycle, I get a " ACPI get
timing mode failed (AE 0x1001)" error.

$ dmesg | grep ata
...
scsi0 : pata_via
scsi1 : pata_via
ata1: PATA max UDMA/100 cmd 0x000101f0 ctl 0x000103f6 bmdma
0x0001b800 irq 14
ata2: PATA max UDMA/100 cmd 0x00010170 ctl 0x00010376 bmdma
0x0001b808 irq 15
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: configured for UDMA/100
ata1.01: configured for UDMA/100
ata2.00: ATAPI: HL-DT-ST DVDRAM GSA-4165B, DL03, max UDMA/33
ata2.01: ATAPI: CD-950E/AKU, A4Q, max MWDMA2, CDB intr
ata2.00: configured for UDMA/33
ata2.01: configured for MWDMA2
ata1.00: Unable to set Link PM policy
ata1.01: Unable to set Link PM policy
ata2.00: Unable to set Link PM policy
ata2.01: Unable to set Link PM policy
...
[ suspend-to-disk/resume cycle happens here ]
...
ata1.00: Unable to set Link PM policy
ata1.01: Unable to set Link PM policy
ata2.00: Unable to set Link PM policy
ata2.01: Unable to set Link PM policy
ata1: ACPI get timing mode failed (AE 0x1001)   <==========
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
ata2: ACPI get timing mode failed (AE 0x1001)
ata2.00: configured for UDMA/33
ata2.01: configured for MWDMA2


Anyway, long before 2.6.23-rc1-mm2, 80-wire cable detection was
already wrong after a suspend-resume cycle. So I cooked the
following patch 2 days ago.

It may be the wrong approach but it works for me.

-- 
pata_via: preserve cable detection bits in via_do_set_mode

via_cable_detect performs cable detection by checking bits in PCI
layer. But via_do_set_mode overwrites these bits. This behaviour
breaks cable detection after suspend/resume cycle.

So let's teach via_do_set_mode to preserve cable detection bits.

Signed-off-by: Laurent Riffard <laurent.riffard@free.fr>
---

 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
@@ -238,6 +238,7 @@ static void via_do_set_mode(struct ata_p
 	unsigned long T =  1000000000 / via_clock;
 	unsigned long UT = T/tdiv;
 	int ut;
+	u8 cable80_status;
 	int offset = 3 - (2*ap->port_no) - adev->devno;


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



-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 2:09 am)
[-mm patch] make pm3fb_init() static again, Adrian Bunk, (Tue Aug 14, 5:21 pm)
2.6.23-rc1-mm2: MMC_ARMMMCI compile error, Adrian Bunk, (Wed Aug 8, 5:31 pm)
Re: 2.6.23-rc1-mm2: MMC_ARMMMCI compile error, Pierre Ossman, (Thu Aug 9, 8:03 am)
Re: 2.6.23-rc1-mm2, Marc Dietrich, (Fri Aug 3, 7:00 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Fri Aug 3, 12:38 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Fri Aug 3, 1:03 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Fri Aug 3, 1:21 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 5:08 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 5:37 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 6:05 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 6:20 pm)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Tue Aug 7, 7:08 pm)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Tue Aug 7, 7:14 pm)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 2:24 am)
Re: [NFS] 2.6.23-rc1-mm2, Marc Dietrich, (Mon Aug 6, 7:05 am)
Re: [NFS] 2.6.23-rc1-mm2, Trond Myklebust, (Mon Aug 6, 12:24 pm)
Re: [NFS] 2.6.23-rc1-mm2, Marc Dietrich, (Tue Aug 7, 8:09 am)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 7:13 am)
Re: [NFS] 2.6.23-rc1-mm2, Oleg Nesterov, (Mon Aug 6, 6:53 am)
Re: [NFS] 2.6.23-rc1-mm2, Johannes Berg, (Mon Aug 6, 6:58 am)
Re: 2.6.23-rc1-mm2: Fix crash in sysfs_hash_and_remove, Rafael J. Wysocki, (Thu Aug 2, 1:31 pm)
Re: 2.6.23-rc1-mm2: Fix crash in sysfs_hash_and_remove, Eric W. Biederman, (Thu Aug 2, 2:19 pm)
[PATCH -mm] linux-audit list is subscribers-only , Gabriel C, (Wed Aug 1, 7:59 pm)
Re: [PATCH -mm] linux-audit list is subscribers-only, Randy Dunlap, (Wed Aug 1, 9:30 pm)
INOTIFY=n , AUDIT*=y compile error, Gabriel C, (Wed Aug 1, 7:40 pm)
Re: 2.6.23-rc1-mm2, , (Wed Aug 1, 4:30 pm)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:40 pm)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Wed Aug 1, 4:52 pm)
Re: 2.6.23-rc1-mm2, Mel Gorman, (Wed Aug 1, 7:40 pm)
Re: 2.6.23-rc1-mm2, Andy Whitcroft, (Thu Aug 2, 10:01 am)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Thu Aug 2, 1:44 pm)
Re: 2.6.23-rc1-mm2, Torsten Kaiser, (Thu Aug 2, 12:38 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 5:17 pm)
Re: 2.6.23-rc1-mm2 (checks-for-80wire-cable-use-in-pata_via), Laurent Riffard, (Wed Aug 1, 4:13 pm)
[PATCH -mm] Fix a section mismatch warning, Gabriel C, (Wed Aug 1, 11:19 am)
[PATCH] fix slown down printk on boot compile error, Heiko Carstens, (Wed Aug 1, 7:16 am)
Re: [PATCH] fix slown down printk on boot compile error, Randy Dunlap, (Wed Aug 1, 12:32 pm)
Re: 2.6.23-rc1-mm2, Gabriel C, (Wed Aug 1, 6:56 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 1:26 pm)
Re: 2.6.23-rc1-mm2, Gabriel C, (Wed Aug 1, 1:39 pm)
unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Gabriel C, (Wed Aug 1, 6:33 am)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Andrew Morton, (Wed Aug 1, 1:22 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Gabriel C, (Wed Aug 1, 1:35 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ), Josef Sipek, (Wed Aug 1, 1:27 pm)
Re: unionfs compile error ( Re: 2.6.23-rc1-mm2 ) , Erez Zadok, (Thu Aug 2, 12:29 pm)
[PATCH] prevent SSB compilation on s390 part 2, Heiko Carstens, (Wed Aug 1, 5:34 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, Heiko Carstens, (Wed Aug 1, 10:43 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, Michael Buesch, (Wed Aug 1, 10:54 am)
Re: [PATCH] prevent SSB compilation on s390 part 2, John W. Linville, (Wed Aug 1, 8:24 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Wed Aug 1, 4:02 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:08 pm)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Mon Aug 6, 3:34 pm)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 5:25 pm)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Mon Aug 6, 6:34 pm)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 7:12 pm)
Re: 2.6.23-rc1-mm2, Greg KH, (Wed Aug 1, 12:36 pm)
Re: 2.6.23-rc1-mm2, Paul Mackerras, (Wed Aug 1, 6:32 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 6:14 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:10 pm)
Re: 2.6.23-rc1-mm2, Kumar Gala, (Fri Aug 3, 5:39 am)
Re: 2.6.23-rc1-mm2, Segher Boessenkool, (Mon Aug 6, 3:12 pm)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:13 am)
Re: 2.6.23-rc1-mm2, Jiri Kosina, (Wed Aug 1, 6:23 am)
Re: 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 5:47 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Alan Stern, (Thu Aug 2, 10:20 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Mariusz Kozlowski, (Thu Aug 2, 10:32 am)
Re: [linux-usb-devel] 2.6.23-rc1-mm2, Jiri Kosina, (Thu Aug 2, 10:26 am)
Re: 2.6.23-rc1-mm2, Ingo Molnar, (Wed Aug 1, 4:16 am)
Re: 2.6.23-rc1-mm2, Paul Mundt, (Wed Aug 1, 2:25 am)
Re: 2.6.23-rc1-mm2, Jason Wessel, (Wed Aug 1, 8:22 am)
Re: 2.6.23-rc1-mm2, Mike Frysinger, (Wed Aug 1, 3:58 am)
Re: 2.6.23-rc1-mm2, Paul Mundt, (Wed Aug 1, 4:15 am)
Re: 2.6.23-rc1-mm2, Mike Frysinger, (Wed Aug 1, 5:04 am)
Re: 2.6.23-rc1-mm2, Andrew Morton, (Wed Aug 1, 4:10 am)
Re: 2.6.23-rc1-mm2, Christoph Hellwig, (Wed Aug 1, 9:45 am)
Re: 2.6.23-rc1-mm2, Jason Wessel, (Wed Aug 1, 9:57 am)