From: Mathias Jeschke <jeschke@informatik.hu-berlin.de>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Subject: AHCI driver with ASUS P5B
Date: Thu, 31 Aug 2006 21:32:25 +0200 [thread overview]
Message-ID: <20060831193225.GA10312@mail.majes.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 907 bytes --]
Hello Jeff,
first thank you for your great job on the AHCI linux kernel driver.
I have a problem with the detection of 2 of my 4 SATA ports on the
mainboard (a P5B one), since ASUS implemented the last two as port 4 and 5
(started by zero) - so port 2 and 3 are physically unused.
Your driver reads a value of "4" and initializes only the first 4 ports
and so ports 4 and 5 become unusable.
So I have a suggestion to support some boards with "incorrect" ports value
in the controller register:
Add an extra kernel parameter (e.g. "ahci=<nr_of_ports>") and override
these "autodetection" if such a kernel paramter is given.
I added a patch file, which implements this feature.
Regards,
Mathias
--
Mathias Jeschke
home: http://www.informatik.hu-berlin.de/~jeschke/
mail: jeschke@informatik.hu-berlin.de
gpg fingerprint: CF50 E22C 50F4 AF70 9628 7AB9 7E10 3A60 EAE5 4729
[-- Attachment #1.2: ahci-ports.patch --]
[-- Type: text/plain, Size: 1289 bytes --]
--- linux-2.6.17.11.orig/drivers/scsi/ahci.c 2006-08-31 12:54:06.000000000 +0200
+++ linux-2.6.17.11/drivers/scsi/ahci.c 2006-08-31 21:12:40.000000000 +0200
@@ -201,6 +201,7 @@
static u8 ahci_check_status(struct ata_port *ap);
static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
static void ahci_remove_one (struct pci_dev *pdev);
+static u8 sata_phy_ports;
static struct scsi_host_template ahci_sht = {
.module = THIS_MODULE,
@@ -1015,7 +1016,8 @@
hpriv->cap = readl(mmio + HOST_CAP);
hpriv->port_map = readl(mmio + HOST_PORTS_IMPL);
- probe_ent->n_ports = (hpriv->cap & 0x1f) + 3;
+ probe_ent->n_ports = sata_phy_ports ? sata_phy_ports : (hpriv->cap & 0x1f) + 1;
+ dev_printk(KERN_INFO, &pdev->dev, "override autodetection, use kernel paramter: ports=%u\n", sata_phy_ports);
VPRINTK("cap 0x%x port_map 0x%x n_ports %d\n",
hpriv->cap, hpriv->port_map, probe_ent->n_ports);
@@ -1347,3 +1349,19 @@
module_init(ahci_init);
module_exit(ahci_exit);
+
+#if !defined(MODULE)
+static int __init ahci_setup(char *str)
+{
+ int ints[2];
+
+ get_options(str, ARRAY_SIZE(ints), ints);
+ if (ints[0] == 1)
+ sata_phy_ports = ints[1];
+
+ return 0;
+}
+
+__setup("ahci=", ahci_setup);
+#endif
+
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
reply other threads:[~2006-08-31 19:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20060831193225.GA10312@mail.majes.de \
--to=jeschke@informatik.hu-berlin.de \
--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).