All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Peer Chen <pchen@nvidia.com>
Cc: "Hemmann, Volker Armin" <volker.armin.hemmann@tu-clausthal.de>,
	Jeff Garzik <jeff@garzik.org>,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Kuan Luo <kluo@nvidia.com>
Subject: Re: 2.6.24.X: SATA/AHCI related boot delay. - not with 2.6.24.3
Date: Mon, 09 Jun 2008 18:43:10 +0900	[thread overview]
Message-ID: <484CFB2E.30202@gmail.com> (raw)
In-Reply-To: <484CF531.30804@gmail.com>

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

Volker, can you please test the attached patch?

Thanks.

-- 
tejun

[-- Attachment #2: mcp65-ahci.patch --]
[-- Type: text/x-patch, Size: 3719 bytes --]

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 544b7d6..1c62b8e 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -89,6 +89,7 @@ enum {
 	board_ahci_sb600	= 3,
 	board_ahci_mv		= 4,
 	board_ahci_sb700	= 5,
+	board_ahci_mcp65	= 6,
 
 	/* global controller registers */
 	HOST_CAP		= 0x00, /* host capabilities */
@@ -190,6 +191,7 @@ enum {
 	AHCI_HFLAG_NO_PMP		= (1 << 6), /* no PMP */
 	AHCI_HFLAG_NO_HOTPLUG		= (1 << 7), /* ignore PxSERR.DIAG.N */
 	AHCI_HFLAG_SECT255		= (1 << 8), /* max 255 sectors */
+	AHCI_HFLAG_YES_NCQ		= (1 << 9), /* force NCQ cap on */
 
 	/* ap->flags bits */
 
@@ -384,6 +386,14 @@ static const struct ata_port_info ahci_port_info[] = {
 		.udma_mask	= ATA_UDMA6,
 		.port_ops	= &ahci_ops,
 	},
+	/* board_ahci_mcp65 */
+	{
+		AHCI_HFLAGS	(AHCI_HFLAG_YES_NCQ),
+		.flags		= AHCI_FLAG_COMMON,
+		.pio_mask	= 0x1f, /* pio0-4 */
+		.udma_mask	= ATA_UDMA6,
+		.port_ops	= &ahci_ops,
+	},
 };
 
 static const struct pci_device_id ahci_pci_tbl[] = {
@@ -438,14 +448,14 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(VIA, 0x6287), board_ahci_vt8251 }, /* VIA VT8251 */
 
 	/* NVIDIA */
-	{ PCI_VDEVICE(NVIDIA, 0x044c), board_ahci },		/* MCP65 */
-	{ PCI_VDEVICE(NVIDIA, 0x044d), board_ahci },		/* MCP65 */
-	{ PCI_VDEVICE(NVIDIA, 0x044e), board_ahci },		/* MCP65 */
-	{ PCI_VDEVICE(NVIDIA, 0x044f), board_ahci },		/* MCP65 */
-	{ PCI_VDEVICE(NVIDIA, 0x045c), board_ahci },		/* MCP65 */
-	{ PCI_VDEVICE(NVIDIA, 0x045d), board_ahci },		/* MCP65 */
-	{ PCI_VDEVICE(NVIDIA, 0x045e), board_ahci },		/* MCP65 */
-	{ PCI_VDEVICE(NVIDIA, 0x045f), board_ahci },		/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x044c), board_ahci_mcp65 },	/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x044d), board_ahci_mcp65 },	/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x044e), board_ahci_mcp65 },	/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x044f), board_ahci_mcp65 },	/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x045c), board_ahci_mcp65 },	/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x045d), board_ahci_mcp65 },	/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x045e), board_ahci_mcp65 },	/* MCP65 */
+	{ PCI_VDEVICE(NVIDIA, 0x045f), board_ahci_mcp65 },	/* MCP65 */
 	{ PCI_VDEVICE(NVIDIA, 0x0550), board_ahci },		/* MCP67 */
 	{ PCI_VDEVICE(NVIDIA, 0x0551), board_ahci },		/* MCP67 */
 	{ PCI_VDEVICE(NVIDIA, 0x0552), board_ahci },		/* MCP67 */
@@ -624,6 +634,12 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
 		cap &= ~HOST_CAP_NCQ;
 	}
 
+	if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) {
+		dev_printk(KERN_INFO, &pdev->dev,
+			   "controller can do NCQ, turning on CAP_NCQ\n");
+		cap |= HOST_CAP_NCQ;
+	}
+
 	if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
 		dev_printk(KERN_INFO, &pdev->dev,
 			   "controller can't do PMP, turning off CAP_PMP\n");
@@ -2118,7 +2134,8 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int printed_version;
-	struct ata_port_info pi = ahci_port_info[ent->driver_data];
+	unsigned int board_id = ent->driver_data;
+	struct ata_port_info pi = ahci_port_info[board_id];
 	const struct ata_port_info *ppi[] = { &pi, NULL };
 	struct device *dev = &pdev->dev;
 	struct ahci_host_priv *hpriv;
@@ -2167,6 +2184,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -ENOMEM;
 	hpriv->flags |= (unsigned long)pi.private_data;
 
+	/* MCP65 revision A1 and A2 can't do MSI */
+	if (board_id == board_ahci_mcp65 &&
+	    (pdev->revision == 0xa1 || pdev->revision == 0xa2))
+		hpriv->flags |= AHCI_HFLAG_NO_MSI;
+
 	if ((hpriv->flags & AHCI_HFLAG_NO_MSI) || pci_enable_msi(pdev))
 		pci_intx(pdev, 1);
 

  reply	other threads:[~2008-06-09  9:43 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-09 18:22 2.6.24.X: SATA/AHCI related boot delay Volker Armin Hemmann
2008-03-10 13:05 ` Tejun Heo
2008-03-10 16:57   ` Volker Armin Hemmann
2008-03-16  8:34   ` Volker Armin Hemmann
2008-03-17  7:16   ` 2.6.24.X: SATA/AHCI related boot delay. - not with 2.6.24.3 Volker Armin Hemmann
2008-03-18  7:36     ` Tejun Heo
2008-03-18 10:59       ` Volker Armin Hemmann
2008-03-18 12:56         ` Tejun Heo
2008-03-18 13:33           ` Volker Armin Hemmann
2008-03-19  3:26             ` Tejun Heo
2008-03-19  3:27               ` Tejun Heo
2008-03-19  7:53                 ` Volker Armin Hemmann
2008-03-19  8:58                   ` Tejun Heo
2008-03-19 10:08                     ` Volker Armin Hemmann
2008-03-19 11:43                       ` Tejun Heo
2008-03-19 13:55                         ` Volker Armin Hemmann
2008-04-02  3:57                           ` Tejun Heo
2008-04-02 17:09                             ` Volker Armin Hemmann
2008-04-03  1:48                               ` Tejun Heo
2008-04-03  5:04                                 ` Volker Armin Hemmann
2008-04-03  5:26                                   ` Tejun Heo
2008-04-03 11:47                                     ` Volker Armin Hemmann
2008-04-11  6:05                                       ` Tejun Heo
2008-04-11 11:55                                         ` Volker Armin Hemmann
2008-04-12  1:27                                           ` Tejun Heo
2008-04-12  1:42                                             ` Jeff Garzik
2008-04-14  4:02                                               ` Peer Chen
2008-04-14  4:02                                                 ` Peer Chen
2008-04-14  6:41                                                 ` Volker Armin Hemmann
2008-04-14  8:11                                                   ` Peer Chen
2008-04-14  8:11                                                     ` Peer Chen
2008-04-14 21:12                                                     ` Volker Armin Hemmann
2008-04-15 12:57                                                       ` Peer Chen
2008-04-15 12:57                                                         ` Peer Chen
2008-04-15 16:20                                                         ` Volker Armin Hemmann
2008-04-18  5:51                                                           ` Peer Chen
2008-04-18  5:51                                                             ` Peer Chen
2008-04-19 13:48                                                             ` Volker Armin Hemmann
2008-04-22 10:10                                                               ` Peer Chen
2008-04-22 10:10                                                                 ` Peer Chen
2008-04-22 12:44                                                                 ` Volker Armin Hemmann
2008-04-22 14:11                                                                   ` Tejun Heo
2008-04-22 15:12                                                                     ` Volker Armin Hemmann
2008-05-29 14:54                                                                     ` Hemmann, Volker Armin
2008-05-30  4:19                                                                       ` Tejun Heo
2008-05-30 10:43                                                                         ` Hemmann, Volker Armin
2008-05-31  0:49                                                                           ` Tejun Heo
2008-06-03  7:56                                                                             ` Peer Chen
2008-06-03  7:56                                                                               ` Peer Chen
2008-06-09  9:17                                                                               ` Tejun Heo
2008-06-09  9:43                                                                                 ` Tejun Heo [this message]
2008-06-09 14:49                                                                                   ` Hemmann, Volker Armin
2008-04-03 10:44                                 ` Peer Chen
2008-04-03 10:44                                   ` Peer Chen
2008-04-11  6:06                                   ` Tejun Heo
2008-04-11  9:50                                     ` Peer Chen
2008-04-11  9:50                                       ` Peer Chen
2008-04-11 11:46                                       ` Volker Armin Hemmann
2008-03-27 16:40                         ` Volker Armin Hemmann
  -- strict thread matches above, loose matches on Subject: below --
2008-03-21  3:04 Fw: " osb972ww-linuxczmil
2008-03-21 10:42 ` Alan Cox

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=484CFB2E.30202@gmail.com \
    --to=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=kluo@nvidia.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pchen@nvidia.com \
    --cc=volker.armin.hemmann@tu-clausthal.de \
    /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.