mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Riffard <laurent.riffard@free.fr>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: 2.6.23-rc1-mm2 (checks-for-80wire-cable-use-in-pata_via)
Date: Wed, 01 Aug 2007 22:13:41 +0200	[thread overview]
Message-ID: <46B0E975.30404@free.fr> (raw)
In-Reply-To: <20070731230932.a9459617.akpm@linux-foundation.org>

Le 01.08.2007 08:09, Andrew Morton a écrit :
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc1/2.6.23-rc1-mm2/
...
> +libata-acpi-checks-for-80wire-cable-use-in-pata_via.patch
...
>  sata/pata things

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);




  parent reply	other threads:[~2007-08-01 20:14 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-01  6:09 2.6.23-rc1-mm2 Andrew Morton
2007-08-01  6:25 ` 2.6.23-rc1-mm2 Paul Mundt
2007-08-01  7:58   ` 2.6.23-rc1-mm2 Mike Frysinger
2007-08-01  8:10     ` 2.6.23-rc1-mm2 Andrew Morton
2007-08-01 13:45       ` 2.6.23-rc1-mm2 Christoph Hellwig
2007-08-01 13:57         ` 2.6.23-rc1-mm2 Jason Wessel
2007-08-01  8:15     ` 2.6.23-rc1-mm2 Paul Mundt
2007-08-01  9:04       ` 2.6.23-rc1-mm2 Mike Frysinger
2007-08-01 12:22   ` 2.6.23-rc1-mm2 Jason Wessel
2007-08-01  7:36 ` 2.6.23-rc1-mm2 (vm-dont-run-touch_buffer-during-buffercache-lookups.patch) Eric St-Laurent
2007-08-01  7:46   ` Andrew Morton
2007-08-01  8:04     ` Eric St-Laurent
2007-08-01  8:30       ` Andrew Morton
2007-08-01  8:02 ` 2.6.23-rc1-mm2 Mariusz Kozlowski
2007-08-01  8:13   ` 2.6.23-rc1-mm2 Andrew Morton
2007-08-01  8:16     ` 2.6.23-rc1-mm2 Ingo Molnar
2007-08-01 10:23     ` 2.6.23-rc1-mm2 Jiri Kosina
2007-08-02  9:47       ` 2.6.23-rc1-mm2 Mariusz Kozlowski
2007-08-02 14:20         ` [linux-usb-devel] 2.6.23-rc1-mm2 Alan Stern
2007-08-02 14:26           ` Jiri Kosina
2007-08-02 14:32           ` Mariusz Kozlowski
2007-08-01 10:32   ` 2.6.23-rc1-mm2 Paul Mackerras
2007-08-02 10:14     ` 2.6.23-rc1-mm2 Mariusz Kozlowski
2007-08-03  9:39       ` 2.6.23-rc1-mm2 Kumar Gala
2007-08-06 19:12         ` 2.6.23-rc1-mm2 Segher Boessenkool
2007-08-06 19:10       ` 2.6.23-rc1-mm2 Segher Boessenkool
2007-08-01 16:36   ` 2.6.23-rc1-mm2 Greg KH
2007-08-06 19:08   ` 2.6.23-rc1-mm2 Segher Boessenkool
2007-08-06 19:34     ` 2.6.23-rc1-mm2 Mariusz Kozlowski
2007-08-06 21:25       ` 2.6.23-rc1-mm2 Segher Boessenkool
2007-08-06 22:34         ` 2.6.23-rc1-mm2 Mariusz Kozlowski
2007-08-06 23:12           ` 2.6.23-rc1-mm2 Segher Boessenkool
2007-08-01  9:34 ` [PATCH] prevent SSB compilation on s390 part 2 Heiko Carstens
2007-08-01 12:24   ` John W. Linville
2007-08-01 14:43   ` Heiko Carstens
2007-08-01 14:54     ` Michael Buesch
2007-08-01 10:33 ` unionfs compile error ( Re: 2.6.23-rc1-mm2 ) Gabriel C
2007-08-01 17:22   ` Andrew Morton
2007-08-01 17:27     ` Josef Sipek
2007-08-02 16:29       ` Erez Zadok
2007-08-01 17:35     ` Gabriel C
2007-08-01 10:56 ` 2.6.23-rc1-mm2 Gabriel C
2007-08-01 17:26   ` 2.6.23-rc1-mm2 Andrew Morton
2007-08-01 17:39     ` 2.6.23-rc1-mm2 Gabriel C
2007-08-01 11:16 ` [PATCH] fix slown down printk on boot compile error Heiko Carstens
2007-08-01 16:32   ` Randy Dunlap
2007-08-01 13:01 ` drivers/scsi/advansys.c compile error ( Re: 2.6.23-rc1-mm2 ) Gabriel C
2007-08-01 13:39   ` [PATCH] drivers/scsi/advansys.c: fix advansys_board_found compile error Eugene Teo
2007-08-01 13:54     ` Gabriel C
2007-08-01 13:55     ` Matthew Wilcox
2007-08-01 14:27       ` Gabriel C
2007-08-01 14:32         ` Matthew Wilcox
2007-08-01 14:46           ` Gabriel C
2007-08-01 14:23 ` [PATCH -mm] Fix defined but not used warning in drivers/kvm/vmx.c Gabriel C
2007-08-01 18:35   ` Avi Kivity
2007-08-01 15:19 ` [PATCH -mm] Fix a section mismatch warning Gabriel C
2007-08-01 20:13 ` Laurent Riffard [this message]
2007-08-01 20:30 ` 2.6.23-rc1-mm2 Valdis.Kletnieks
2007-08-01 20:40   ` 2.6.23-rc1-mm2 Andrew Morton
2007-08-01 20:52     ` 2.6.23-rc1-mm2 Torsten Kaiser
2007-08-01 21:17       ` 2.6.23-rc1-mm2 Andrew Morton
2007-08-01 23:40       ` 2.6.23-rc1-mm2 Mel Gorman
2007-08-02  4:38         ` 2.6.23-rc1-mm2 Torsten Kaiser
2007-08-02 14:01         ` 2.6.23-rc1-mm2 Andy Whitcroft
2007-08-02 17:44           ` 2.6.23-rc1-mm2 Torsten Kaiser
2007-08-01 23:40 ` INOTIFY=n , AUDIT*=y compile error Gabriel C
2007-08-01 23:59 ` [PATCH -mm] linux-audit list is subscribers-only Gabriel C
2007-08-02  1:30   ` Randy Dunlap
2007-08-02 13:11 ` [PATCH -mm] Fix section mismatch warnings in sound/pci/hda/ Gabriel C
2007-08-02 13:24   ` Takashi Iwai
2007-08-02 16:32     ` Sam Ravnborg
2007-08-02 17:17       ` Takashi Iwai
2007-08-02 17:31 ` 2.6.23-rc1-mm2: Fix crash in sysfs_hash_and_remove Rafael J. Wysocki
2007-08-02 17:34   ` Tejun Heo
2007-08-02 18:19     ` Eric W. Biederman
2007-08-03 11:00 ` 2.6.23-rc1-mm2 Marc Dietrich
2007-08-03 16:38   ` 2.6.23-rc1-mm2 Andrew Morton
2007-08-03 17:03     ` [NFS] 2.6.23-rc1-mm2 Trond Myklebust
2007-08-03 17:21       ` Oleg Nesterov
2007-08-06  6:24         ` Johannes Berg
2007-08-06 10:53           ` Oleg Nesterov
2007-08-06 10:58             ` Johannes Berg
2007-08-06 11:05           ` Marc Dietrich
2007-08-06 11:13             ` Johannes Berg
2007-08-06 16:24             ` Trond Myklebust
2007-08-07 12:09               ` Marc Dietrich
2007-08-07 21:08         ` Trond Myklebust
2007-08-07 21:37           ` Oleg Nesterov
2007-08-07 22:05             ` Trond Myklebust
2007-08-07 22:20               ` Oleg Nesterov
2007-08-07 23:08                 ` Trond Myklebust
2007-08-07 23:14                   ` Oleg Nesterov
2007-08-08 21:31 ` 2.6.23-rc1-mm2: MMC_ARMMMCI compile error Adrian Bunk
2007-08-09 12:03   ` Pierre Ossman
2007-08-14 21:21 ` [-mm patch] make pm3fb_init() static again Adrian Bunk
2007-08-14 21:21 ` [-mm patch] fs/reiser4/plugin/: make 3 functions static Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46B0E975.30404@free.fr \
    --to=laurent.riffard@free.fr \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome