public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible
@ 2005-10-25  9:56 Max Kellermann
  2005-10-25 17:32 ` Andrew Morton
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Max Kellermann @ 2005-10-25  9:56 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton

Hi Andrew,

since 2.6.14-rc4-mm1, my second ata_piix (SATA) controller does not
show up in dmesg, effectively hiding /dev/sdb.  2.6.14-rc2-mm2 and
older (with the same kernel config) were ok, the same for Linus'
kernels: 2.6.14-rc5 without -mm1 has /dev/sdb, too.

0000:00:1f.2 IDE interface: Intel Corp. 82801EB (ICH5) Serial ATA 150
Storage Controller (rev 02) (prog-if 8f [Master SecP SecO PriP PriO])
0000:00:1f.2 0101: 8086:24d1 (rev 02)

This PCI device (on-board on an Asus P4 mainboard) has two SATA
connectors, showing up as ata1/sda and ata2/sdb.

dmesg from 2.6.14-rc5:

libata version 1.12 loaded.
ata_piix version 1.04
ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 177
PCI: Setting latency timer of device 0000:00:1f.2 to 64
ata1: SATA max UDMA/133 cmd 0xEFE0 ctl 0xEFAE bmdma 0xEF60 irq 177
ata2: SATA max UDMA/133 cmd 0xEFA0 ctl 0xEFAA bmdma 0xEF68 irq 177
ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01
87:4003 88:207f
ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:
ata1: dev 0 configured for UDMA/133

dmesg from 2.6.14-rc5-mm1:

libata version 1.12 loaded.
ata_piix version 1.04
ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 193
PCI: Setting latency timer of device 0000:00:1f.2 to 64
ata1: SATA max UDMA/133 cmd 0xEFE0 ctl 0xEFAE bmdma 0xEF60 irq 193
ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01
87:4003 88:207f
ata1: dev 0 ATA-7, max UDMA/133, 240121728 sectors: LBA
ata1: dev 0 configured for UDMA/133

Need more information?  I could try to disable a few patches from your
-mm series if you name some..  it's too hard for me to guess which one
could be responsible for the breakage.

Max


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible
  2005-10-25  9:56 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible Max Kellermann
@ 2005-10-25 17:32 ` Andrew Morton
       [not found]   ` <20051025103310.51e1cdb2.akpm@osdl.org>
  2005-10-29 19:25 ` Jeff Garzik
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2005-10-25 17:32 UTC (permalink / raw)
  To: Max Kellermann; +Cc: linux-kernel

Max Kellermann <max@duempel.org> wrote:
>
> Hi Andrew,
> 
> since 2.6.14-rc4-mm1, my second ata_piix (SATA) controller does not
> show up in dmesg, effectively hiding /dev/sdb.  2.6.14-rc2-mm2 and
> older (with the same kernel config) were ok, the same for Linus'
> kernels: 2.6.14-rc5 without -mm1 has /dev/sdb, too.
> 
> 0000:00:1f.2 IDE interface: Intel Corp. 82801EB (ICH5) Serial ATA 150
> Storage Controller (rev 02) (prog-if 8f [Master SecP SecO PriP PriO])
> 0000:00:1f.2 0101: 8086:24d1 (rev 02)
> 
> This PCI device (on-board on an Asus P4 mainboard) has two SATA
> connectors, showing up as ata1/sda and ata2/sdb.
> 
> dmesg from 2.6.14-rc5:
> 
> libata version 1.12 loaded.
> ata_piix version 1.04
> ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 177
> PCI: Setting latency timer of device 0000:00:1f.2 to 64
> ata1: SATA max UDMA/133 cmd 0xEFE0 ctl 0xEFAE bmdma 0xEF60 irq 177
> ata2: SATA max UDMA/133 cmd 0xEFA0 ctl 0xEFAA bmdma 0xEF68 irq 177
> ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01
> 87:4003 88:207f
> ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:
> ata1: dev 0 configured for UDMA/133
> 
> dmesg from 2.6.14-rc5-mm1:
> 
> libata version 1.12 loaded.
> ata_piix version 1.04
> ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 193
> PCI: Setting latency timer of device 0000:00:1f.2 to 64
> ata1: SATA max UDMA/133 cmd 0xEFE0 ctl 0xEFAE bmdma 0xEF60 irq 193
> ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01
> 87:4003 88:207f
> ata1: dev 0 ATA-7, max UDMA/133, 240121728 sectors: LBA
> ata1: dev 0 configured for UDMA/133
> 
> Need more information?  I could try to disable a few patches from your
> -mm series if you name some..  it's too hard for me to guess which one
> could be responsible for the breakage.
> 

Thanks.  It'd be useful if you could test just 2.6.14-rc5+git-acpi.patch,
see if that does the same thing.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible
       [not found]   ` <20051025103310.51e1cdb2.akpm@osdl.org>
@ 2005-10-26  6:50     ` Max Kellermann
  0 siblings, 0 replies; 7+ messages in thread
From: Max Kellermann @ 2005-10-26  6:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On 2005/10/25 19:33, Andrew Morton <akpm@osdl.org> wrote:
> Andrew Morton <akpm@osdl.org> wrote:
> >
> > It'd be useful if you could test just 2.6.14-rc5+git-acpi.patch,
> >  see if that does the same thing.
> 
> And if that works OK, add git-libata-all.patch, retest.

results:

2.6.14-rc5 + git-acpi.patch + git-acpi-build-fix-2.patch:
ata2 and /dev/sdb are fine.

... + git-libata-all.patch
ata2 and /dev/sdb disappeared.

Tell me when you need further testing.

Max


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible
  2005-10-25  9:56 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible Max Kellermann
  2005-10-25 17:32 ` Andrew Morton
@ 2005-10-29 19:25 ` Jeff Garzik
  2005-10-30 11:26 ` [PATCH] " Jeff Garzik
  2005-10-30 12:59 ` Jeff Garzik
  3 siblings, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2005-10-29 19:25 UTC (permalink / raw)
  To: Max Kellermann; +Cc: linux-kernel, Andrew Morton

Max Kellermann wrote:
> Hi Andrew,
> 
> since 2.6.14-rc4-mm1, my second ata_piix (SATA) controller does not
> show up in dmesg, effectively hiding /dev/sdb.  2.6.14-rc2-mm2 and
> older (with the same kernel config) were ok, the same for Linus'
> kernels: 2.6.14-rc5 without -mm1 has /dev/sdb, too.
> 
> 0000:00:1f.2 IDE interface: Intel Corp. 82801EB (ICH5) Serial ATA 150
> Storage Controller (rev 02) (prog-if 8f [Master SecP SecO PriP PriO])
> 0000:00:1f.2 0101: 8086:24d1 (rev 02)
> 
> This PCI device (on-board on an Asus P4 mainboard) has two SATA
> connectors, showing up as ata1/sda and ata2/sdb.
> 
> dmesg from 2.6.14-rc5:

Thanks for this report.  Would it be possible for you to test 2.6.14 
(release) and 2.6.14-git1, as additional data points?

Once its out, I might ask you to try 2.6.14-git2 (tonight's upcoming 
snapshot) as well.

Regards,

	Jeff





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Re: 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible
  2005-10-25  9:56 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible Max Kellermann
  2005-10-25 17:32 ` Andrew Morton
  2005-10-29 19:25 ` Jeff Garzik
@ 2005-10-30 11:26 ` Jeff Garzik
  2005-10-30 12:59 ` Jeff Garzik
  3 siblings, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2005-10-30 11:26 UTC (permalink / raw)
  To: Max Kellermann; +Cc: linux-kernel, Andrew Morton, Alan Cox

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

Max Kellermann wrote:
> Hi Andrew,
> 
> since 2.6.14-rc4-mm1, my second ata_piix (SATA) controller does not
> show up in dmesg, effectively hiding /dev/sdb.  2.6.14-rc2-mm2 and
> older (with the same kernel config) were ok, the same for Linus'
> kernels: 2.6.14-rc5 without -mm1 has /dev/sdb, too.
> 
> 0000:00:1f.2 IDE interface: Intel Corp. 82801EB (ICH5) Serial ATA 150
> Storage Controller (rev 02) (prog-if 8f [Master SecP SecO PriP PriO])
> 0000:00:1f.2 0101: 8086:24d1 (rev 02)
> 
> This PCI device (on-board on an Asus P4 mainboard) has two SATA
> connectors, showing up as ata1/sda and ata2/sdb.

I think I found the bug.  ata_pci_init_one() got confused about the 
meaning of 'n_ports'.  I also found another bug in the same area, 
related to legacy initialization.

See the attached patch for a suggested fix (ignore ata_piix changes, 
which are obviously unrelated).

	Jeff



[-- Attachment #2: patch.fix-piix-probe --]
[-- Type: text/plain, Size: 6168 bytes --]

diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index be02147..b7fbf11 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -45,6 +45,7 @@
 #include <linux/init.h>
 #include <linux/blkdev.h>
 #include <linux/delay.h>
+#include <linux/device.h>
 #include "scsi.h"
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
@@ -625,7 +626,8 @@ static int piix_init_one (struct pci_dev
 	unsigned int pata_chan = 0, sata_chan = 0;
 
 	if (!printed_version++)
-		printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
+		dev_printk(KERN_DEBUG, &pdev->dev,
+			   "version " DRV_VERSION "\n");
 
 	/* no hotplugging support (FIXME) */
 	if (!in_module_init)
@@ -672,7 +674,9 @@ static int piix_init_one (struct pci_dev
 		port_info[pata_chan] = &piix_port_info[ich5_pata];
 		n_ports++;
 
-		printk(KERN_WARNING DRV_NAME ": combined mode detected\n");
+		dev_printk(KERN_WARNING, &pdev->dev,
+			   "combined mode detected (p=%u, s=%u)\n",
+			   pata_chan, sata_chan);
 	}
 
 	return ata_pci_init_one(pdev, port_info, n_ports);
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index cc089f1..4fa3621 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4491,10 +4491,10 @@ void ata_pci_host_stop (struct ata_host_
  */
 
 struct ata_probe_ent *
-ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int ports)
+ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info *port, int ports)
 {
 	struct ata_probe_ent *probe_ent =
-		ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]);
+		ata_probe_ent_alloc(pci_dev_to_dev(pdev), port);
 	int p = 0;
 
 	if (!probe_ent)
@@ -4527,11 +4527,11 @@ ata_pci_init_native_mode(struct pci_dev 
 	return probe_ent;
 }
 
-static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info **port, int port_num)
+static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info *port, int port_num)
 {
 	struct ata_probe_ent *probe_ent;
 
-	probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]);
+	probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port);
 	if (!probe_ent)
 		return NULL;
 
@@ -4678,14 +4678,19 @@ int ata_pci_init_one (struct pci_dev *pd
 
 	if (legacy_mode) {
 		if (legacy_mode & (1 << 0))
-			probe_ent = ata_pci_init_legacy_port(pdev, port, 0);
+			probe_ent = ata_pci_init_legacy_port(pdev, port[0], 0);
 		if (legacy_mode & (1 << 1))
-			probe_ent2 = ata_pci_init_legacy_port(pdev, port, 1);
+			probe_ent2 = ata_pci_init_legacy_port(pdev, port[1], 1);
 	} else {
-		if (n_ports == 2)
-			probe_ent = ata_pci_init_native_mode(pdev, port, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
-		else
-			probe_ent = ata_pci_init_native_mode(pdev, port, ATA_PORT_PRIMARY);
+		if (n_ports == 1)
+			probe_ent = ata_pci_init_native_mode(pdev, port[0],
+					ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
+		else {
+			probe_ent = ata_pci_init_native_mode(pdev, port[0],
+					ATA_PORT_PRIMARY);
+			probe_ent2 = ata_pci_init_native_mode(pdev, port[1],
+					ATA_PORT_PRIMARY);
+		}
 	}
 	if (!probe_ent && !probe_ent2) {
 		rc = -ENOMEM;
@@ -4695,13 +4700,10 @@ int ata_pci_init_one (struct pci_dev *pd
 	pci_set_master(pdev);
 
 	/* FIXME: check ata_device_add return */
-	if (legacy_mode) {
-		if (legacy_mode & (1 << 0))
-			ata_device_add(probe_ent);
-		if (legacy_mode & (1 << 1))
-			ata_device_add(probe_ent2);
-	} else
+	if (probe_ent)
 		ata_device_add(probe_ent);
+	if (probe_ent2)
+		ata_device_add(probe_ent2);
 
 	kfree(probe_ent);
 	kfree(probe_ent2);
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index 1a56d6c..596a4e0 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -405,7 +405,7 @@ static int nv_init_one (struct pci_dev *
 	rc = -ENOMEM;
 
 	ppi = &nv_port_info;
-	probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
+	probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
 	if (!probe_ent)
 		goto err_out_regions;
 
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
index 057f7b9..d3bcd38 100644
--- a/drivers/scsi/sata_sis.c
+++ b/drivers/scsi/sata_sis.c
@@ -263,7 +263,7 @@ static int sis_init_one (struct pci_dev 
 		goto err_out_regions;
 
 	ppi = &sis_port_info;
-	probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
+	probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
 	if (!probe_ent) {
 		rc = -ENOMEM;
 		goto err_out_regions;
diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c
index d68dc7d..145405a 100644
--- a/drivers/scsi/sata_uli.c
+++ b/drivers/scsi/sata_uli.c
@@ -202,7 +202,7 @@ static int uli_init_one (struct pci_dev 
 		goto err_out_regions;
 
 	ppi = &uli_port_info;
-	probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
+	probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
 	if (!probe_ent) {
 		rc = -ENOMEM;
 		goto err_out_regions;
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
index 80e291a..f2a2736 100644
--- a/drivers/scsi/sata_via.c
+++ b/drivers/scsi/sata_via.c
@@ -212,7 +212,7 @@ static struct ata_probe_ent *vt6420_init
 	struct ata_probe_ent *probe_ent;
 	struct ata_port_info *ppi = &svia_port_info;
 
-	probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
+	probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
 	if (!probe_ent)
 		return NULL;
 
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 0ba3af7..e75112d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -506,7 +506,7 @@ struct pci_bits {
 
 extern void ata_pci_host_stop (struct ata_host_set *host_set);
 extern struct ata_probe_ent *
-ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
+ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info *port, int portmask);
 extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
 
 #endif /* CONFIG_PCI */

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible
  2005-10-25  9:56 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible Max Kellermann
                   ` (2 preceding siblings ...)
  2005-10-30 11:26 ` [PATCH] " Jeff Garzik
@ 2005-10-30 12:59 ` Jeff Garzik
  2005-10-31 10:33   ` Max Kellermann
  3 siblings, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2005-10-30 12:59 UTC (permalink / raw)
  To: Max Kellermann; +Cc: linux-kernel, Andrew Morton, Alan Cox

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

Max Kellermann wrote:
> Hi Andrew,
> 
> since 2.6.14-rc4-mm1, my second ata_piix (SATA) controller does not
> show up in dmesg, effectively hiding /dev/sdb.  2.6.14-rc2-mm2 and
> older (with the same kernel config) were ok, the same for Linus'
> kernels: 2.6.14-rc5 without -mm1 has /dev/sdb, too.

Attached is the patch I just checked in, which should play a bit more 
nicely with Alan's PATA drivers than the last patch.

I was able to reproduce your (Max's) problem locally, and verified that 
the attached patch fixed it.

	Jeff



[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1261 bytes --]

fbf30fbaa61595e9026f628f3913888b0df2b288
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index b7fbf11..7f8aa1b 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -622,7 +622,7 @@ static int piix_init_one (struct pci_dev
 {
 	static int printed_version;
 	struct ata_port_info *port_info[2];
-	unsigned int combined = 0, n_ports = 1;
+	unsigned int combined = 0;
 	unsigned int pata_chan = 0, sata_chan = 0;
 
 	if (!printed_version++)
@@ -634,7 +634,7 @@ static int piix_init_one (struct pci_dev
 		return -ENODEV;
 
 	port_info[0] = &piix_port_info[ent->driver_data];
-	port_info[1] = NULL;
+	port_info[1] = &piix_port_info[ent->driver_data];
 
 	if (port_info[0]->host_flags & PIIX_FLAG_AHCI) {
 		u8 tmp;
@@ -672,14 +672,13 @@ static int piix_init_one (struct pci_dev
 		port_info[sata_chan] = &piix_port_info[ent->driver_data];
 		port_info[sata_chan]->host_flags |= ATA_FLAG_SLAVE_POSS;
 		port_info[pata_chan] = &piix_port_info[ich5_pata];
-		n_ports++;
 
 		dev_printk(KERN_WARNING, &pdev->dev,
 			   "combined mode detected (p=%u, s=%u)\n",
 			   pata_chan, sata_chan);
 	}
 
-	return ata_pci_init_one(pdev, port_info, n_ports);
+	return ata_pci_init_one(pdev, port_info, 2);
 }
 
 static int __init piix_init(void)

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible
  2005-10-30 12:59 ` Jeff Garzik
@ 2005-10-31 10:33   ` Max Kellermann
  0 siblings, 0 replies; 7+ messages in thread
From: Max Kellermann @ 2005-10-31 10:33 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel, Andrew Morton, Alan Cox

On 2005/10/30 13:59, Jeff Garzik <jgarzik@pobox.com> wrote:
> I was able to reproduce your (Max's) problem locally, and verified
> that the attached patch fixed it.

I can confirm that.  2.6.14-rc5-mm1 plus your patch fixed my problem,
ata2 and /dev/sdb are available.

Max


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-10-31 10:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-25  9:56 2.6.14-rc4-mm1 and later: second ata_piix controller is invisible Max Kellermann
2005-10-25 17:32 ` Andrew Morton
     [not found]   ` <20051025103310.51e1cdb2.akpm@osdl.org>
2005-10-26  6:50     ` Max Kellermann
2005-10-29 19:25 ` Jeff Garzik
2005-10-30 11:26 ` [PATCH] " Jeff Garzik
2005-10-30 12:59 ` Jeff Garzik
2005-10-31 10:33   ` Max Kellermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox