[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#303135: Fwd: Re: ata_piix installation/device detection problems on Dell server



Hello Sven,

Forwarding this mail for one of our kernel maintainers as I'm unsure if 
you've seen it.

Would you be able to compile a kernel with the attached patches and see if 
that allows you to access the CD's (either without general ide module or 
with that module loaded after the SATA module; not sure which)?

TIA,
Frans Pop

----------  Forwarded Message  ----------

Subject: Re: ata_piix installation/device detection problems on Dell 
server
Date: Wednesday 06 April 2005 10:28
From: Horms <horms@debian.org>
To: Christian Perrier <bubulle@debian.org>
Cc: debian-boot@lists.debian.org

On Wed, Apr 06, 2005 at 07:22:09AM +0200, Christian Perrier wrote:
> Quoting Frans Pop (aragorn@tiscali.nl):
> > We have seen several reports with this issue, but as no one on the
> > d-i team has access to this hardware it has been kind of elusive.

On the subject of the ATA issue, I friend mentioned to me in passing
that he had some luck in resolving a dell + ata problem by
changing the "sata operation" to Autodetect/ATA".

I also believe that his problem has been resolved upstream
(and likely in unbuntu which he uses) but may well
be present in the debian kernel. I'd welcome an oppertunity
to test this, and in particular see if either of these
two patches from upstream help.

> I have partial access to Dell hardware (ie we have several Dell
> servers at work). Petter Reinholdtsen also seems to have some access
> to Dell servers and so does Fabrice Lorrain who reported here from
> time to time about fail/pass installs.
>
> I also have in mind to get in closer touch with Dell by using the
> contacts I have because my organisation is a large Dell user (in fact,
> the contracts are under renewal and, this not being a secret, Dell is
> currently facing another well-known hardware manufacturer which is
> already a big supporter of the Debian project....I guess everyone will
> figure out..:-)))
>
> If Dell wins our contract, I will certainly make my best, using the
> good relations we will have, to try getting in touch with their Linux
> staff, first from the French office, then maybe higher, to see whether
> there is some interest from them to work closer from the Debian
> project.

Yes, some hardware to test on would be most useful.
There is this long standing problem with is dell related,
it would be nice to see if there is a kernel solution for it.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=277298

--
Horms

-------------------------------------------------------
# origin: bzolnier (BitKeeper)
# cset: 1.1938.134.1 (2.6) key=416b214bV7CwIRgRqoomLi6qTfcGmw
# URL: http://linux.bkbits.net:8080/linux-2.6/cset@416b214bV7CwIRgRqoomLi6qTfcGmw
# inclusion: upstream
# descrition: [PATCH] libata: PCI IDE legacy mode fix
# revision date: Wed, 06 Apr 2005 17:25:20 +0900
#
# S rset: ChangeSet|1.1938.132.2..1.1938.134.1
# I rset: drivers/scsi/libata-core.c|1.100..1.101
# I rset: include/linux/libata.h|1.55..1.56
# I rset: drivers/scsi/ata_piix.c|1.31..1.32
#
# Key:
# S: Skipped  ChangeSet file only
# O: Original Followed by Updated
# U: Updated  Included with updated range of versions
# I: Included Included verbatim
# E: Excluded Excluded on request from user
# D: Deleted  Manually deleted by subsequent user edit
# R: Revised  Manually revised by subsequent user edit
#
#
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/10/11 20:11:55-04:00 bzolnier@elka.pw.edu.pl 
#   [PATCH] libata: PCI IDE legacy mode fix
#   
#   In PCI IDE legacy mode ap->port_no is incorrectly set to zero for
#   the second port.  Fix it by adding ->hard_port_no to struct ata_probe_ent
#   and struct ata_port (per Jeff's suggestion) and teaching ata_piix.c
#   to use it instead of ->port_no.
#   
#   Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
# 
# include/linux/libata.h
#   2004/10/11 15:52:22-04:00 bzolnier@elka.pw.edu.pl +2 -0
#   PCI IDE legacy mode fix
# 
# drivers/scsi/libata-core.c
#   2004/10/11 15:52:22-04:00 bzolnier@elka.pw.edu.pl +8 -0
#   PCI IDE legacy mode fix
# 
# drivers/scsi/ata_piix.c
#   2004/10/11 15:52:22-04:00 bzolnier@elka.pw.edu.pl +10 -10
#   PCI IDE legacy mode fix
# 
#
===== drivers/scsi/libata-core.c 1.100 vs 1.101 =====
--- 1.100/drivers/scsi/libata-core.c	2004-09-16 15:45:15 +09:00
+++ 1.101/drivers/scsi/libata-core.c	2004-10-12 04:52:22 +09:00
@@ -3032,6 +3032,8 @@ static void ata_host_init(struct ata_por
 	ap->ctl = ATA_DEVCTL_OBS;
 	ap->host_set = host_set;
 	ap->port_no = port_no;
+	ap->hard_port_no =
+		ent->legacy_mode ? ent->hard_port_no : port_no;
 	ap->pio_mask = ent->pio_mask;
 	ap->mwdma_mask = ent->mwdma_mask;
 	ap->udma_mask = ent->udma_mask;
@@ -3338,8 +3340,14 @@ ata_pci_init_legacy_mode(struct pci_dev 
 	probe_ent[0].n_ports = 1;
 	probe_ent[0].irq = 14;
 
+	probe_ent[0].hard_port_no = 0;
+	probe_ent[0].legacy_mode = 1;
+
 	probe_ent[1].n_ports = 1;
 	probe_ent[1].irq = 15;
+
+	probe_ent[1].hard_port_no = 1;
+	probe_ent[1].legacy_mode = 1;
 
 	probe_ent[0].port[0].cmd_addr = 0x1f0;
 	probe_ent[0].port[0].altstatus_addr =
===== include/linux/libata.h 1.55 vs 1.56 =====
--- 1.55/include/linux/libata.h	2004-09-16 15:45:15 +09:00
+++ 1.56/include/linux/libata.h	2004-10-12 04:52:22 +09:00
@@ -189,6 +189,7 @@ struct ata_probe_ent {
 	Scsi_Host_Template	*sht;
 	struct ata_ioports	port[ATA_MAX_PORTS];
 	unsigned int		n_ports;
+	unsigned int		hard_port_no;
 	unsigned int		pio_mask;
 	unsigned int		mwdma_mask;
 	unsigned int		udma_mask;
@@ -273,6 +274,7 @@ struct ata_port {
 	unsigned long		flags;	/* ATA_FLAG_xxx */
 	unsigned int		id;	/* unique id req'd by scsi midlyr */
 	unsigned int		port_no; /* unique port #; from zero */
+	unsigned int		hard_port_no;	/* hardware port #; from zero */
 
 	struct ata_prd		*prd;	 /* our SG list */
 	dma_addr_t		prd_dma; /* and its DMA mapping */
===== drivers/scsi/ata_piix.c 1.31 vs 1.32 =====
--- 1.31/drivers/scsi/ata_piix.c	2004-09-16 15:45:15 +09:00
+++ 1.32/drivers/scsi/ata_piix.c	2004-10-12 04:52:22 +09:00
@@ -268,7 +268,7 @@ static void piix_pata_cbl_detect(struct 
 		goto cbl40;
 
 	/* check BIOS cable detect results */
-	mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC;
+	mask = ap->hard_port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC;
 	pci_read_config_byte(pdev, PIIX_IOCFG, &tmp);
 	if ((tmp & mask) == 0)
 		goto cbl40;
@@ -294,7 +294,7 @@ cbl40:
 static void piix_pata_phy_reset(struct ata_port *ap)
 {
 	if (!pci_test_config_bits(ap->host_set->pdev,
-				  &piix_enable_bits[ap->port_no])) {
+				  &piix_enable_bits[ap->hard_port_no])) {
 		ata_port_disable(ap);
 		printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
 		return;
@@ -327,8 +327,8 @@ static int piix_sata_probe (struct ata_p
 	int orig_mask, mask, i;
 	u8 pcs;
 
-	mask = (PIIX_PORT_PRESENT << ap->port_no) |
-	       (PIIX_PORT_ENABLED << ap->port_no);
+	mask = (PIIX_PORT_PRESENT << ap->hard_port_no) |
+	       (PIIX_PORT_ENABLED << ap->hard_port_no);
 
 	pci_read_config_byte(pdev, ICH5_PCS, &pcs);
 	orig_mask = (int) pcs & 0xff;
@@ -345,7 +345,7 @@ static int piix_sata_probe (struct ata_p
 		mask = (PIIX_PORT_PRESENT << i) | (PIIX_PORT_ENABLED << i);
 
 		if ((orig_mask & mask) == mask)
-			if (combined || (i == ap->port_no))
+			if (combined || (i == ap->hard_port_no))
 				return 1;
 	}
 
@@ -394,7 +394,7 @@ static void piix_set_piomode (struct ata
 	unsigned int pio	= adev->pio_mode - XFER_PIO_0;
 	struct pci_dev *dev	= ap->host_set->pdev;
 	unsigned int is_slave	= (adev->devno != 0);
-	unsigned int master_port= ap->port_no ? 0x42 : 0x40;
+	unsigned int master_port= ap->hard_port_no ? 0x42 : 0x40;
 	unsigned int slave_port	= 0x44;
 	u16 master_data;
 	u8 slave_data;
@@ -412,10 +412,10 @@ static void piix_set_piomode (struct ata
 		/* enable PPE, IE and TIME */
 		master_data |= 0x0070;
 		pci_read_config_byte(dev, slave_port, &slave_data);
-		slave_data &= (ap->port_no ? 0x0f : 0xf0);
+		slave_data &= (ap->hard_port_no ? 0x0f : 0xf0);
 		slave_data |=
 			(timings[pio][0] << 2) |
-			(timings[pio][1] << (ap->port_no ? 4 : 0));
+			(timings[pio][1] << (ap->hard_port_no ? 4 : 0));
 	} else {
 		master_data &= 0xccf8;
 		/* enable PPE, IE and TIME */
@@ -445,9 +445,9 @@ static void piix_set_dmamode (struct ata
 {
 	unsigned int udma	= adev->dma_mode; /* FIXME: MWDMA too */
 	struct pci_dev *dev	= ap->host_set->pdev;
-	u8 maslave		= ap->port_no ? 0x42 : 0x40;
+	u8 maslave		= ap->hard_port_no ? 0x42 : 0x40;
 	u8 speed		= udma;
-	unsigned int drive_dn	= (ap->port_no ? 2 : 0) + adev->devno;
+	unsigned int drive_dn	= (ap->hard_port_no ? 2 : 0) + adev->devno;
 	int a_speed		= 3 << (drive_dn * 4);
 	int u_flag		= 1 << drive_dn;
 	int v_flag		= 0x01 << drive_dn;
# origin: jason.d.gaston (BitKeeper)
# cset: 1.1966.19.1 (2.6) key=41ddef86je30CbKgp5uBV9FbFEHpYQ
# URL: http://linux.bkbits.net:8080/linux-2.6/cset@41ddef86je30CbKgp5uBV9FbFEHpYQ
# inclusion: upstream
# descrition: [PATCH] SATA support for Intel ICH7
# revision date: Wed, 06 Apr 2005 17:24:52 +0900
#
# S rset: ChangeSet|1.1966.10.3..1.1966.19.1
# I rset: drivers/pci/quirks.c|1.64..1.65
# I rset: drivers/scsi/ahci.c|1.9..1.10
# I rset: drivers/scsi/ata_piix.c|1.35..1.36
#
# Key:
# S: Skipped  ChangeSet file only
# O: Original Followed by Updated
# U: Updated  Included with updated range of versions
# I: Included Included verbatim
# E: Excluded Excluded on request from user
# D: Deleted  Manually deleted by subsequent user edit
# R: Revised  Manually revised by subsequent user edit
#
#
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/01/06 21:10:14-05:00 jason.d.gaston@intel.com 
#   [PATCH] SATA support for Intel ICH7
#   
#   Reposting patch with word wrap turned off.  Please let me know if
#   this is still not formated correctly.
#   
#   This patch adds the Intel ICH7 DID's to the ata_piix.c SATA driver,
#   ahci.c SATA AHCI driver and quirks.c for ICH7 SATA support.
#   
#   Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
# 
# drivers/scsi/ata_piix.c
#   2004/12/28 10:07:38-05:00 jason.d.gaston@intel.com +15 -0
#   SATA support for Intel ICH7 - 2.6.10 - repost
# 
# drivers/scsi/ahci.c
#   2004/12/28 10:07:38-05:00 jason.d.gaston@intel.com +6 -2
#   SATA support for Intel ICH7 - 2.6.10 - repost
# 
# drivers/pci/quirks.c
#   2004/12/30 07:24:21-05:00 jason.d.gaston@intel.com +5 -1
#   SATA support for Intel ICH7 - 2.6.10 - repost
# 
#
===== drivers/pci/quirks.c 1.64 vs 1.65 =====
--- 1.64/drivers/pci/quirks.c	2004-12-24 13:38:24 +09:00
+++ 1.65/drivers/pci/quirks.c	2004-12-30 21:24:21 +09:00
@@ -1144,6 +1144,10 @@ static void __devinit quirk_intel_ide_co
 	case 0x2653:
 		ich = 6;
 		break;
+	case 0x27c0:
+	case 0x27c4:
+		ich = 7;
+		break;
 	default:
 		/* we do not handle this PCI device */
 		return;
@@ -1163,7 +1167,7 @@ static void __devinit quirk_intel_ide_co
 		else
 			return;			/* not in combined mode */
 	} else {
-		WARN_ON(ich != 6);
+		WARN_ON((ich != 6) && (ich != 7));
 		tmp &= 0x3;  /* interesting bits 1:0 */
 		if (tmp & (1 << 0))
 			comb = (1 << 2);	/* PATA port 0, SATA port 1 */
===== drivers/scsi/ahci.c 1.9 vs 1.10 =====
--- 1.9/drivers/scsi/ahci.c	2004-12-08 08:54:23 +09:00
+++ 1.10/drivers/scsi/ahci.c	2004-12-29 00:07:38 +09:00
@@ -239,9 +239,13 @@ static struct ata_port_info ahci_port_in
 
 static struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VENDOR_ID_INTEL, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-	  board_ahci },
+	  board_ahci }, /* ICH6 */
 	{ PCI_VENDOR_ID_INTEL, 0x2653, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-	  board_ahci },
+	  board_ahci }, /* ICH6M */
+	{ PCI_VENDOR_ID_INTEL, 0x27c1, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+	  board_ahci }, /* ICH7 */
+	{ PCI_VENDOR_ID_INTEL, 0x27c5, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+	  board_ahci }, /* ICH7M */
 	{ }	/* terminate list */
 };
 
===== drivers/scsi/ata_piix.c 1.35 vs 1.36 =====
--- 1.35/drivers/scsi/ata_piix.c	2004-11-14 04:24:05 +09:00
+++ 1.36/drivers/scsi/ata_piix.c	2004-12-29 00:07:38 +09:00
@@ -60,6 +60,7 @@ enum {
 	piix4_pata		= 2,
 	ich6_sata		= 3,
 	ich6_sata_rm		= 4,
+	ich7_sata		= 5,
 };
 
 static int piix_init_one (struct pci_dev *pdev,
@@ -90,6 +91,8 @@ static struct pci_device_id piix_pci_tbl
 	{ 0x8086, 0x2651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata },
 	{ 0x8086, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_rm },
 	{ 0x8086, 0x2653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_rm },
+	{ 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7_sata },
+	{ 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7_sata },
 
 	{ }	/* terminate list */
 };
@@ -226,6 +229,18 @@ static struct ata_port_info piix_port_in
 	},
 
 	/* ich6_sata_rm */
+	{
+		.sht		= &piix_sht,
+		.host_flags	= ATA_FLAG_SATA | ATA_FLAG_SRST |
+				  PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR |
+				  ATA_FLAG_SLAVE_POSS | PIIX_FLAG_AHCI,
+		.pio_mask	= 0x1f,	/* pio0-4 */
+		.mwdma_mask	= 0x07, /* mwdma0-2 */
+		.udma_mask	= 0x7f,	/* udma0-6 */
+		.port_ops	= &piix_sata_ops,
+	},
+
+	/* ich7_sata */
 	{
 		.sht		= &piix_sht,
 		.host_flags	= ATA_FLAG_SATA | ATA_FLAG_SRST |

Reply to: