From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, jfs@keytradebank.com, 0602@eq.cz,
linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 6/6] ata_piix: don't scan non-existent device
Date: Wed, 1 Mar 2006 01:25:39 +0900 [thread overview]
Message-ID: <11411439392891-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11411439383398-git-send-email-htejun@gmail.com>
ata_std_softreset() sometimes reports presence of dev 1 even when it
doesn't exist (PCS-wise). This usually happens reading dev 1's
signature returns that of dev 0 (e.g. on ICH6M). This patch turns off
non-existent device on such cases.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/scsi/ata_piix.c | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
cda8686b4ad82a9272748af4388d47475c6acb2b
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 72e38e6..625db11 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -566,14 +566,31 @@ static unsigned int piix_sata_probe (str
*/
static int piix_sata_probe_reset(struct ata_port *ap, unsigned int *classes)
{
- if (!piix_sata_probe(ap)) {
+ unsigned int mask;
+ int i, rc;
+
+ mask = piix_sata_probe(ap);
+ if (!mask) {
printk(KERN_INFO "ata%u: SATA port has no device.\n", ap->id);
return 0;
}
- return ata_drive_probe_reset(ap, ata_std_probeinit,
- ata_std_softreset, NULL,
- ata_std_postreset, classes);
+ rc = ata_drive_probe_reset(ap, ata_std_probeinit,
+ ata_std_softreset, NULL,
+ ata_std_postreset, classes);
+ if (rc)
+ return rc;
+
+ for (i = 0; i < 2; i++) {
+ if (ata_class_present(classes[i]) && !(mask & (1 << i))) {
+ printk(KERN_WARNING "ata%u: dev %u class %d for "
+ "non-existent device, fixing up\n",
+ ap->id, i, classes[i]);
+ classes[i] = ATA_DEV_NONE;
+ }
+ }
+
+ return 0;
}
/**
--
1.2.1
next prev parent reply other threads:[~2006-02-28 16:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-28 16:25 [PATCHSET] ata_piix: improve combined mode handling Tejun Heo
2006-02-28 16:25 ` [PATCH 1/6] libata: seperate out ata_class_present() Tejun Heo
2006-03-03 20:40 ` Jeff Garzik
2006-02-28 16:25 ` [PATCH 3/6] ata_piix: add a couple of flags Tejun Heo
2006-03-03 20:33 ` Jeff Garzik
2006-03-05 5:28 ` [PATCH] ata_piix: rename PIIX_FLAG_IGN_PRESENT to PIIX_FLAG_IGNORE_PCS Tejun Heo
2006-03-05 5:36 ` Jeff Garzik
2006-02-28 16:25 ` [PATCH 2/6] ata_piix: finer-grained port_info Tejun Heo
2006-02-28 16:25 ` [PATCH 4/6] ata_piix: implement proper port map Tejun Heo
2006-02-28 16:25 ` Tejun Heo [this message]
2006-03-03 20:43 ` [PATCH 6/6] ata_piix: don't scan non-existent device Jeff Garzik
2006-02-28 16:25 ` [PATCH 5/6] ata_piix: reimplement piix_sata_probe() Tejun Heo
2006-02-28 18:17 ` [PATCHSET] ata_piix: improve combined mode handling Jeff Garzik
2006-03-01 5:16 ` Tejun Heo
2006-03-03 17:37 ` Jeff Garzik
2006-03-03 20:53 ` 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=11411439392891-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=0602@eq.cz \
--cc=jfs@keytradebank.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).