From: Jens Axboe <axboe@suse.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Mark Lord <liml@rtr.ca>, "zhao, forrest" <forrest.zhao@intel.com>,
Jeff Garzik <jeff@garzik.org>, Tejun Heo <htejun@gmail.com>,
linux-ide@vger.kernel.org
Subject: Re: 2.6.17-rc5-git1: regression: resume from suspend(RAM) fails: libata issue
Date: Sat, 27 May 2006 08:29:50 +0200 [thread overview]
Message-ID: <20060527062950.GC23315@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0605262028460.5623@g5.osdl.org>
On Fri, May 26 2006, Linus Torvalds wrote:
>
>
> On Fri, 26 May 2006, Mark Lord wrote:
> >
> > Well, this problem has been with us all for a year now,
> > and at this point it impacts practically *every* new "centrino"
> > notebook out there.
> >
> > We have a very simple workaround (previous post) that addresses it
> > for 2.6.17, and it's about damn time it got fixed.
> >
> > If there's a better solution for *2.6.17*, then *please* post it.
> > Otherwise, we have a fix. Maybe Linus or Andrew should just apply it?
>
> I'm definitely in the "at some point, protesting a patch that works
> becomes an untenably position to take, no matter _how_ ugly the patch is"
> camp.
>
> If the people who complain that it is ugly cannot come up with an
> alternate solution that works and isn't ugly, at some point the "ugly"
> complaint just becomes totally pointless.
If that wasn't the case, then we wouldn't even have basic sata suspend
support in the Linus kernels right now... So agreed.
> Of course, I'm not on linux-ide, and I didn't see this particular
> discussion from the start (or even the alledged simple workaround in the
> "previous post"), but can people please fill me in? And if the choice is
> not between "ugly" vs "pretty", but between "ugly" vs "nonworking", I
> think we know what the answer should be.
There was no real discussion on this issue yet. I think we all agree
that the functionality of the patch (waiting for BSY clear on resume) is
the right thing to do. This posted patch moved SCSI stuff into ata_piix,
which isn't really very nice. Jeff wants to do it from the pci resume,
which just seems wrong to me since it's a device (disk) condition not a
"host" condition. FWIW, here's what I had in mind as suggested in the
original reply. Not tested at all for functionality, but it compiles.
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 6dc8814..103afc3 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -151,6 +151,7 @@ static int piix_pata_probe_reset(struct
static int piix_sata_probe_reset(struct ata_port *ap, unsigned int *classes);
static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev);
static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
+static int piix_port_resume(struct ata_port *ap);
static unsigned int in_module_init = 1;
@@ -250,6 +251,7 @@ static const struct ata_port_operations
.port_start = ata_port_start,
.port_stop = ata_port_stop,
+ .port_resume = piix_port_resume,
.host_stop = ata_host_stop,
};
@@ -738,6 +740,16 @@ static int piix_disable_ahci(struct pci_
return rc;
}
+static int piix_port_resume(struct ata_port *ap)
+{
+ u8 status = ata_busy_wait(ap, ATA_BUSY, 200000);
+
+ if (status & ATA_BUSY)
+ return 1;
+
+ return 0;
+}
+
/**
* piix_check_450nx_errata - Check for problem 450NX setup
* @ata_dev: the PCI device to check
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index fa476e7..ae7fac1 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4298,6 +4298,8 @@ int ata_device_resume(struct ata_port *a
{
if (ap->flags & ATA_FLAG_SUSPENDED) {
ap->flags &= ~ATA_FLAG_SUSPENDED;
+ if (ap->ops->port_resume)
+ ap->ops->port_resume(ap);
ata_set_mode(ap);
}
if (!ata_dev_present(dev))
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b80d2e7..0be5d02 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -461,6 +461,7 @@ struct ata_port_operations {
int (*port_start) (struct ata_port *ap);
void (*port_stop) (struct ata_port *ap);
+ int (*port_resume) (struct ata_port *ap);
void (*host_stop) (struct ata_host_set *host_set);
--
Jens Axboe
next prev parent reply other threads:[~2006-05-27 6:30 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-26 9:04 [PATCH] Add ata_piix's own resume function zhao, forrest
2006-05-26 23:05 ` Jens Axboe
2006-05-26 23:28 ` Jeff Garzik
2006-05-26 23:38 ` Jeff Garzik
2006-05-26 23:50 ` Jeff Garzik
2006-05-27 6:21 ` Jens Axboe
2006-05-27 6:31 ` Jeff Garzik
2006-05-27 6:46 ` Jens Axboe
2006-05-27 6:52 ` Jeff Garzik
2006-05-27 3:22 ` 2.6.17-rc5-git1: regression: resume from suspend(RAM) fails: libata issue Mark Lord
2006-05-27 3:32 ` Linus Torvalds
2006-05-27 3:41 ` Jeff Garzik
2006-05-27 4:00 ` [PATCH] " Jeff Garzik
2006-05-27 18:23 ` Mark Lord
2006-05-27 18:47 ` Linus Torvalds
2006-05-27 19:01 ` Jeff Garzik
2006-05-27 19:06 ` Jeff Garzik
2006-05-27 19:01 ` Mark Lord
2006-05-27 20:45 ` Jens Axboe
2006-05-27 20:58 ` Jeff Garzik
2006-05-27 21:11 ` Jens Axboe
2006-05-27 21:17 ` Jeff Garzik
2006-05-27 21:20 ` Jens Axboe
2006-05-27 21:23 ` Mark Lord
2006-05-27 21:25 ` Jens Axboe
2006-05-27 21:30 ` Mark Lord
2006-05-27 21:24 ` Jeff Garzik
2006-05-27 21:26 ` Jens Axboe
2006-05-27 21:31 ` Mark Lord
2006-05-27 21:32 ` Jeff Garzik
2006-05-27 21:33 ` Jens Axboe
2006-05-27 21:34 ` Jeff Garzik
2006-05-27 21:37 ` Mark Lord
2006-05-27 21:51 ` Jeff Garzik
2006-05-27 21:41 ` Tejun Heo
2006-05-27 21:45 ` Jeff Garzik
2006-05-27 21:38 ` Linus Torvalds
2006-05-27 21:50 ` Jeff Garzik
2006-05-27 21:57 ` Linus Torvalds
2006-05-27 22:11 ` Jeff Garzik
2006-05-27 21:50 ` Linus Torvalds
2006-05-27 21:53 ` Jeff Garzik
2006-05-27 22:14 ` Linus Torvalds
2006-05-27 22:06 ` Mark Lord
2006-05-27 22:11 ` Jens Axboe
2006-05-27 22:13 ` Jeff Garzik
2006-05-27 22:15 ` Jens Axboe
2006-05-27 22:15 ` Mark Lord
2006-05-27 22:17 ` Jens Axboe
2006-05-27 22:21 ` Linus Torvalds
2006-05-27 22:29 ` Mark Lord
2006-05-27 22:36 ` Jens Axboe
2006-05-27 22:48 ` Mark Lord
2006-05-27 22:53 ` Jens Axboe
2006-05-27 22:55 ` Jeff Garzik
2006-05-27 23:10 ` Mark Lord
2006-05-28 0:24 ` Linus Torvalds
2006-05-28 0:26 ` Linus Torvalds
2006-05-28 0:56 ` Jeff Garzik
2006-05-28 0:35 ` Linus Torvalds
2006-05-28 0:51 ` Mark Lord
2006-05-28 0:53 ` Jeff Garzik
2006-05-28 0:56 ` Mark Lord
2006-05-28 1:01 ` Linus Torvalds
2006-05-28 1:03 ` Jeff Garzik
2006-05-28 1:01 ` Jeff Garzik
2006-05-28 15:28 ` [PATCH] 2.6.17-rc5: the latest consensus libata resume fix Mark Lord
2006-05-28 17:14 ` Jens Axboe
2006-05-28 19:05 ` Jeff Garzik
2006-05-28 19:18 ` Mark Lord
2006-05-28 20:10 ` Jeff Garzik
2006-05-28 20:27 ` Mark Lord
2006-05-28 22:28 ` Jens Axboe
2006-05-29 1:28 ` Jeff Garzik
2006-05-29 2:53 ` Mark Lord
2006-05-29 3:18 ` Jeff Garzik
2006-05-29 3:28 ` zhao, forrest
2006-05-29 2:43 ` Mark Lord
2006-05-27 22:35 ` [PATCH] Re: 2.6.17-rc5-git1: regression: resume from suspend(RAM) fails: libata issue Jens Axboe
2006-05-27 22:52 ` Jeff Garzik
2006-05-27 22:54 ` Jens Axboe
2006-05-27 23:06 ` Jens Axboe
2006-05-27 22:56 ` Mark Lord
2006-05-27 23:03 ` Jeff Garzik
2006-05-27 22:18 ` Linus Torvalds
2006-05-27 22:23 ` Mark Lord
2006-05-27 22:43 ` Mark Lord
2006-05-28 0:13 ` Linus Torvalds
2006-05-27 18:54 ` Jeff Garzik
2006-05-27 19:08 ` Mark Lord
2006-05-27 19:15 ` Jeff Garzik
2006-05-27 19:24 ` Mark Lord
2006-05-27 20:24 ` Jens Axboe
2006-05-27 6:29 ` Jens Axboe [this message]
2006-05-27 6:36 ` Jeff Garzik
2006-05-27 7:01 ` Jens Axboe
2006-05-27 7:06 ` Jeff Garzik
2006-05-27 18:46 ` Mark Lord
2006-05-27 3:35 ` Jeff Garzik
2006-05-27 6:20 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2006-05-26 19:25 Mark Lord
2006-05-26 19:44 ` Mark Lord
2006-05-26 23:42 ` Jeff Garzik
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=20060527062950.GC23315@suse.de \
--to=axboe@suse.de \
--cc=forrest.zhao@intel.com \
--cc=htejun@gmail.com \
--cc=jeff@garzik.org \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.