Skip to contentSkip to conversation

State of resume for AHCI?

DISCUSSION Jeremy Fitzhardinge 6 participants 16 messages Jun 1, 2006 – Jun 6, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Jeff,

I'm trying to get a Thinkpad X60 working properly. My biggest remaining problem is the failure of AHCI to resume properly after suspend-to-ram. I know the problem is known about and there are patches floating about to address it, but I don't really understand the larger picture. There were some discussions about it a couple of months ago, but I haven't seen anything much since.

Is there a git tree which should work properly on this hardware, or a current patch to do it? Does somebody need to bring the existing patch up to date? Does fixing this require more infrastructure changes which are still brewing?

I'm running 2.6.17-rc2-mm1 (soon mm2). I've tried porting Hannes Reinecke's patch to this tree, but there have been some code changes which cause significant conflicts, and I don't really know enough about the driver/hardware to be confident in my changes. That said, I have got something compiling, but it crashes somewhere in the kobject stuff when it encounters the first port with no drive on it; this looks like a more general scsi/libata bug; I'll track it down if its interesting.

Anyway, I'd appreciate it if you could give me some hints about how to get a fix with some current kernel.

Thanks,
J

#1 lore raw

The one-line "resume fix" (attached) *might* be all that you need. This is in current Linus 2.6.17-rc*-git*

Cheers

Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from vger.kernel.org (vger.kernel.org [209.132.176.167])

	by mail.rtr.ca (Postfix) with ESMTP id 2DCD7830162
	for <[email protected]>; Sun, 28 May 2006 11:28:07 -0400 (EDT)
Received: ([email protected]) by vger.kernel.org via listexpand
	id S1750768AbWE1P2E (ORCPT <rfc822;[email protected]>);
	Sun, 28 May 2006 11:28:04 -0400
Received: ([email protected]) by vger.kernel.org id S1750772AbWE1P2D
	(ORCPT <rfc822;linux-ide-outgoing>); Sun, 28 May 2006 11:28:03 -0400
Received: from rtr.ca ([64.26.128.89]:19922 "EHLO mail.rtr.ca")
	by vger.kernel.org with ESMTP id S1750768AbWE1P2C (ORCPT
	<rfc822;[email protected]>); Sun, 28 May 2006 11:28:02 -0400
Received: from silvy.localnet (silvy.localnet [10.0.0.14])
	by mail.rtr.ca (Postfix) with ESMTP id D0C538300A1;
	Sun, 28 May 2006 11:28:00 -0400 (EDT)

From: Mark Lord <[email protected]>
Organization: Real-Time Remedies Inc.
To: Jeff Garzik <[email protected]>
Subject: [PATCH] 2.6.17-rc5: the latest consensus libata resume fix
Date: Sun, 28 May 2006 11:28:00 -0400
User-Agent: KMail/1.9.1
Cc: Linus Torvalds <[email protected]>, Jens Axboe <[email protected]>,
"zhao, forrest" <[email protected]>,
Tejun Heo <[email protected]>, [email protected]
References: <[email protected]> <[email protected]> <[email protected]>
In-Reply-To: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <[email protected]>
Sender: [email protected]
Precedence: bulk
X-Mailing-List: [email protected]

Okay, just to sum things up.

The patch below is the current "release candidate" for improving the libata/ata_piix resume functionality in 2.6.17-rc*.

It forces libata to wait for up to 2 seconds for BUSY|DRQ to clear on resume before continuing. This is only for 2.6.17 at present.

We are waiting on Jens to test and report back for this specific version.

---

drivers/scsi/libata-core.c +1 -0
@@ -4296,6 +4296,7 @@ static int ata_start_drive(struct ata_po
  */
 int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
 {
 	if (ap->flags & ATA_FLAG_SUSPENDED) {
+		ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000);
 		ap->flags &= ~ATA_FLAG_SUSPENDED;
 		ata_set_mode(ap);

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 2 lines · Mark Lord

The one-line "resume fix" (attached) *might* be all that you need. This is in current Linus 2.6.17-rc*-git*

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

libata should define a default suspend hook for devices that haven't added their own, to prevent accidents with people trying to suspend devices that haven't been fixed up. It's a data integrity issue!

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

J

#4 lore raw
Quoted 10 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

According to our test of Hannes's patch, it's not sufficient to support AHCI suspend/resume.

Now I'm writing a patch to try to provide complete support for AHCI suspend/resume and will send out patch soon, hopefully by the end of today.

Thanks,
Forrest

#5 lore raw
Quoted 3 lines · forrest

According to our test of Hannes's patch, it's not sufficient to support AHCI suspend/resume.

Yes. I merged it into mm2, and it didn't make any difference.

Quoted 3 lines

Now I'm writing a patch to try to provide complete support for AHCI suspend/resume and will send out patch soon, hopefully by the end of today.

Great, looking forward to it.

J

#6 lore raw
In reply to zhao, forrest
Quoted 10 lines · forrest
Quoted 9 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Quoted 9 lines
Quoted 1 line

Is that correct/sufficient? Or should something else be happening?

According to our test of Hannes's patch, it's not sufficient to support AHCI suspend/resume.

Now I'm writing a patch to try to provide complete support for AHCI suspend/resume and will send out patch soon, hopefully by the end of today.

Can I have details, please? What doesn't work?

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke			[email protected]
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
#7 lore raw
In reply to Jeremy Fitzhardinge
Quoted 10 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

No that's it, I know for a fact that suspend/resume works perfectly with the 10.1 suse kernel. You can give that a shot, if you want.

Signature · 1 line
Jens Axboe
#8 lore raw
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Quoted 8 lines
Quoted 5 lines

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

No that's it, I know for a fact that suspend/resume works perfectly with the 10.1 suse kernel. You can give that a shot, if you want.

You may mean the Hannes's patch for 10.1 SUSE kernel. Hannes's patch posted in open source community(or in linux-ide mailing list) didn't work.

Forrest

#9 lore raw
Quoted 11 lines · forrest
Quoted 10 lines · Jens Axboe
Quoted 9 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Is that correct/sufficient? Or should something else be happening?

No that's it, I know for a fact that suspend/resume works perfectly with the 10.1 suse kernel. You can give that a shot, if you want.

You may mean the Hannes's patch for 10.1 SUSE kernel. Hannes's patch posted in open source community(or in linux-ide mailing list) didn't work.

I didn't say Hannes patch, I said I know that 10.1 works. And that is probably in large due to the patch that Hannes did, which implents resume/suspend and takes care of reinitializing the resources.

Signature · 1 line
Jens Axboe
#10 lore raw
Quoted 15 lines · Jens Axboe
Quoted 14 lines · forrest
Quoted 13 lines · Jens Axboe
Quoted 10 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

No that's it, I know for a fact that suspend/resume works perfectly with the 10.1 suse kernel. You can give that a shot, if you want.

Quoted 8 lines
Quoted 3 lines

You may mean the Hannes's patch for 10.1 SUSE kernel. Hannes's patch posted in open source community(or in linux-ide mailing list) didn't work.

I didn't say Hannes patch, I said I know that 10.1 works. And that is probably in large due to the patch that Hannes did, which implents resume/suspend and takes care of reinitializing the resources.

Indeed. I didn't post the latest set of patches to the open-source community as Jeff indicated he would only accept patches against libata-dev. And as I didn't have time to port them yet I didn't feel the need to do so.

Forrest, please drop me a mail if I can be of further assistance.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke			[email protected]
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
#11 lore raw
Quoted 20 lines · Hannes Reinecke
Quoted 19 lines · Jens Axboe
Quoted 17 lines · forrest
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Quoted 7 lines
Quoted 5 lines

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

No that's it, I know for a fact that suspend/resume works perfectly with the 10.1 suse kernel. You can give that a shot, if you want.

You may mean the Hannes's patch for 10.1 SUSE kernel. Hannes's patch posted in open source community(or in linux-ide mailing list) didn't work.

Quoted 8 lines
Quoted 4 lines

I didn't say Hannes patch, I said I know that 10.1 works. And that is probably in large due to the patch that Hannes did, which implents resume/suspend and takes care of reinitializing the resources.

Indeed. I didn't post the latest set of patches to the open-source community as Jeff indicated he would only accept patches against libata-dev. And as I didn't have time to port them yet I didn't feel the need to do so.

Understandable, I hope you will have some time to push it for 2.6.18 though.

Signature · 1 line
Jens Axboe
#12 lore raw
In reply to Hannes Reinecke
Quoted 24 lines · Hannes Reinecke
Quoted 15 lines · Jens Axboe
Quoted 14 lines · forrest
Quoted 13 lines · Jens Axboe
Quoted 10 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

No that's it, I know for a fact that suspend/resume works perfectly with the 10.1 suse kernel. You can give that a shot, if you want.

Quoted 8 lines
Quoted 3 lines

You may mean the Hannes's patch for 10.1 SUSE kernel. Hannes's patch posted in open source community(or in linux-ide mailing list) didn't work.

I didn't say Hannes patch, I said I know that 10.1 works. And that is probably in large due to the patch that Hannes did, which implents resume/suspend and takes care of reinitializing the resources.

Quoted 6 lines

Indeed. I didn't post the latest set of patches to the open-source community as Jeff indicated he would only accept patches against libata-dev. And as I didn't have time to port them yet I didn't feel the need to do so.

Forrest, please drop me a mail if I can be of further assistance.

I almost finished porting a patch from OpenSUSE, will send it out in an hour, please help review it :)

Thanks,
Forrest

#13 lore raw
Quoted 30 lines · forrest
Quoted 29 lines · Hannes Reinecke
Quoted 15 lines · Jens Axboe
Quoted 14 lines · forrest
Quoted 13 lines · Jens Axboe
Quoted 10 lines · Jeremy Fitzhardinge
Quoted 4 lines · Jens Axboe

It's a lot more complicated than that, I'm afraid. ahci doesn't even have the resume/suspend methods defined, plus it needs more work than piix on resume.

Hannes Reinecke's patch implements those functions, basically by factoring out the shutdown and init code and calling them at suspend/resume time as well.

Is that correct/sufficient? Or should something else be happening?

No that's it, I know for a fact that suspend/resume works perfectly with the 10.1 suse kernel. You can give that a shot, if you want.

Quoted 8 lines
Quoted 3 lines

You may mean the Hannes's patch for 10.1 SUSE kernel. Hannes's patch posted in open source community(or in linux-ide mailing list) didn't work.

I didn't say Hannes patch, I said I know that 10.1 works. And that is probably in large due to the patch that Hannes did, which implents resume/suspend and takes care of reinitializing the resources.

Indeed. I didn't post the latest set of patches to the open-source community as Jeff indicated he would only accept patches against libata-dev. And as I didn't have time to port them yet I didn't feel the need to do so.

Quoted 4 lines
Quoted 1 line

Forrest, please drop me a mail if I can be of further assistance.

I almost finished porting a patch from OpenSUSE, will send it out in an hour, please help review it :)

Wonderful! Please do test it as well :-)

Signature · 1 line
Jens Axboe
#14 lore raw
In reply to Mark Lord
Quoted 2 lines · Mark Lord

The one-line "resume fix" (attached) *might* be all that you need. This is in current Linus 2.6.17-rc*-git*

Oh.. yes, you'll have to switch to the ata_piix driver for this to work. So long as your AHCI is an Intel one, that will probably work fine.

Cheers

#15 lore raw
Quoted 6 lines · Mark Lord
Quoted 2 lines · Mark Lord

The one-line "resume fix" (attached) *might* be all that you need. This is in current Linus 2.6.17-rc*-git*

Oh.. yes, you'll have to switch to the ata_piix driver for this to work. So long as your AHCI is an Intel one, that will probably work fine.

Many notebooks don't allow changing between piix and ahci modes. My notebook detects one piix interface and four ahci ports. The piix interface is connected to the harddisk while one of the ahci ports is the hotswap bay. So, my harddisk suspends and resumes fine but I can't use my dvd rom after suspend/resume.

Signature · 1 line
tejun