* [PATCH] ata_piix: implement ignore_PCS driver option
@ 2006-02-12 10:08 Tejun Heo
2006-02-12 10:17 ` [PATCH] ata_piix: add information message about PCS Tejun Heo
2006-02-12 19:19 ` [PATCH] ata_piix: implement ignore_PCS driver option Jeff Garzik
0 siblings, 2 replies; 3+ messages in thread
From: Tejun Heo @ 2006-02-12 10:08 UTC (permalink / raw)
To: Jeff Garzik, linux-ide; +Cc: jfs, kmannth, 0602
On some configurations, ICH5 SATA incorrectly reports 0 for PCS even
when ports are active and operational. This patch adds a driver
parameter which, when set, causes ata_piix ignore PCS value and
proceed with device probing.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
This patch is against
the current upstream (bef4a456b8dc8b3638f4d49a25a89e1467da9483)
+ http://article.gmane.org/gmane.linux.ide/7967
+ http://article.gmane.org/gmane.linux.ide/7968 (2 patches)
+ http://article.gmane.org/gmane.linux.ide/7970
drivers/scsi/ata_piix.c | 11 +++++++++++
1 file changed, 11 insertions(+)
Index: work1/drivers/scsi/ata_piix.c
===================================================================
--- work1.orig/drivers/scsi/ata_piix.c 2006-02-12 18:48:31.000000000 +0900
+++ work1/drivers/scsi/ata_piix.c 2006-02-12 18:48:31.000000000 +0900
@@ -330,6 +330,11 @@ MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
MODULE_VERSION(DRV_VERSION);
+static int ignore_PCS = 0;
+module_param(ignore_PCS, int, 0444);
+MODULE_PARM_DESC(ignore_PCS, "ignore PCS register to force device probing, "
+ "useful on some ICH5 SATA setups (0=off, 1=on)");
+
/**
* piix_pata_cbl_detect - Probe host controller cable detect info
* @ap: Port for which cable detect info is desired
@@ -428,6 +433,12 @@ static int piix_sata_probe (struct ata_p
pci_read_config_byte(pdev, ICH5_PCS, &pcs);
orig_mask = (int) pcs & 0xff;
+ if (ignore_PCS) {
+ printk(KERN_INFO "ata%u: ignoring PIIX PCS (0x%x)\n",
+ ap->id, pcs);
+ return 1;
+ }
+
/* TODO: this is vaguely wrong for ICH6 combined mode,
* where only two of the four SATA ports are mapped
* onto a single ATA channel. It is also vaguely inaccurate
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ata_piix: add information message about PCS
2006-02-12 10:08 [PATCH] ata_piix: implement ignore_PCS driver option Tejun Heo
@ 2006-02-12 10:17 ` Tejun Heo
2006-02-12 19:19 ` [PATCH] ata_piix: implement ignore_PCS driver option Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2006-02-12 10:17 UTC (permalink / raw)
To: Jeff Garzik, linux-ide; +Cc: jfs, kmannth, 0602
So far, the incorrect PCS problem has only been reported on two ICH5
SATA setups and masked PCS was zero in both cases. This patch makes
ata_piix print an information message about ignore_PCS option in such
cases.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
Jeff, this patch makes ata_piix advertise about ignore_PCS option if
the PCS value seems suspicious on ICH5 sata. IMHO, this can make
lives much easier for those who are trying to figure out this rather
obscure problem with small amount of added code.
drivers/scsi/ata_piix.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Index: work1/drivers/scsi/ata_piix.c
===================================================================
--- work1.orig/drivers/scsi/ata_piix.c 2006-02-12 18:55:25.000000000 +0900
+++ work1/drivers/scsi/ata_piix.c 2006-02-12 18:55:41.000000000 +0900
@@ -101,6 +101,7 @@ enum {
ICH5_PCS = 0x92, /* port control and status */
PIIX_SCC = 0x0A, /* sub-class code register */
+ PIIX_FLAG_FLAKY_PCS = (1 << 26), /* PCS reportedly flaky */
PIIX_FLAG_AHCI = (1 << 27), /* AHCI possible */
PIIX_FLAG_CHECKINTR = (1 << 28), /* make sure PCI INTx enabled */
PIIX_FLAG_COMBINED = (1 << 29), /* combined mode possible */
@@ -274,7 +275,7 @@ static struct ata_port_info piix_port_in
{
.sht = &piix_sht,
.host_flags = ATA_FLAG_SATA | PIIX_FLAG_COMBINED |
- PIIX_FLAG_CHECKINTR,
+ PIIX_FLAG_CHECKINTR | PIIX_FLAG_FLAKY_PCS,
.pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
.udma_mask = 0x7f, /* udma0-6 */
@@ -439,6 +440,11 @@ static int piix_sata_probe (struct ata_p
return 1;
}
+ if (orig_mask == 0 && ap->flags & PIIX_FLAG_FLAKY_PCS)
+ printk(KERN_INFO "ata%u: PIIX PCS is 0x%x, consider using "
+ "ignore_PCS option to force device probing\n",
+ ap->id, pcs);
+
/* TODO: this is vaguely wrong for ICH6 combined mode,
* where only two of the four SATA ports are mapped
* onto a single ATA channel. It is also vaguely inaccurate
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ata_piix: implement ignore_PCS driver option
2006-02-12 10:08 [PATCH] ata_piix: implement ignore_PCS driver option Tejun Heo
2006-02-12 10:17 ` [PATCH] ata_piix: add information message about PCS Tejun Heo
@ 2006-02-12 19:19 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2006-02-12 19:19 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, jfs, kmannth, 0602
Tejun Heo wrote:
> On some configurations, ICH5 SATA incorrectly reports 0 for PCS even
> when ports are active and operational. This patch adds a driver
> parameter which, when set, causes ata_piix ignore PCS value and
> proceed with device probing.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
Given my comments in the last email, after reviewing the docs, I think
we should fix ata_piix SATA probe behavior before considering this
patch. Fixing ata_piix may make this patch unnecessary.
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-12 19:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-12 10:08 [PATCH] ata_piix: implement ignore_PCS driver option Tejun Heo
2006-02-12 10:17 ` [PATCH] ata_piix: add information message about PCS Tejun Heo
2006-02-12 19:19 ` [PATCH] ata_piix: implement ignore_PCS driver option Jeff Garzik
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).