svn commit: r278034 - head/sys/dev/ahci
Steven Hartland
smh at FreeBSD.org
Sun Feb 1 20:00:09 UTC 2015
Author: smh
Date: Sun Feb 1 20:00:08 2015
New Revision: 278034
URL: https://svnweb.freebsd.org/changeset/base/278034
Log:
Add a quirk to limit AHCI MSI vectors to one
In 10.1-RELEASE the default number of MSI vectors used was changed from one
to as many vectors as the HW supports.
This change resulted in an ahci timeouts regression when running on AMD
SB7x0/SB8x0/SB9x0 hardware, so its now limited to 1 MSI by default using
this new quirk.
MFC after: 2 weeks
Sponsored by: Multiplay
Modified:
head/sys/dev/ahci/ahci.h
head/sys/dev/ahci/ahci_pci.c
Modified: head/sys/dev/ahci/ahci.h
==============================================================================
--- head/sys/dev/ahci/ahci.h Sun Feb 1 19:07:42 2015 (r278033)
+++ head/sys/dev/ahci/ahci.h Sun Feb 1 20:00:08 2015 (r278034)
@@ -556,26 +556,27 @@ enum ahci_err_type {
bus_write_multi_stream_4((res), (offset), (addr), (count))
-#define AHCI_Q_NOFORCE 1
-#define AHCI_Q_NOPMP 2
-#define AHCI_Q_NONCQ 4
-#define AHCI_Q_1CH 8
-#define AHCI_Q_2CH 0x10
-#define AHCI_Q_4CH 0x20
-#define AHCI_Q_EDGEIS 0x40
-#define AHCI_Q_SATA2 0x80
-#define AHCI_Q_NOBSYRES 0x100
-#define AHCI_Q_NOAA 0x200
-#define AHCI_Q_NOCOUNT 0x400
-#define AHCI_Q_ALTSIG 0x800
-#define AHCI_Q_NOMSI 0x1000
-#define AHCI_Q_ATI_PMP_BUG 0x2000
-#define AHCI_Q_MAXIO_64K 0x4000
-#define AHCI_Q_SATA1_UNIT0 0x8000 /* need better method for this */
-#define AHCI_Q_ABAR0 0x10000
+#define AHCI_Q_NOFORCE 0x00000001
+#define AHCI_Q_NOPMP 0x00000002
+#define AHCI_Q_NONCQ 0x00000004
+#define AHCI_Q_1CH 0x00000008
+#define AHCI_Q_2CH 0x00000010
+#define AHCI_Q_4CH 0x00000020
+#define AHCI_Q_EDGEIS 0x00000040
+#define AHCI_Q_SATA2 0x00000080
+#define AHCI_Q_NOBSYRES 0x00000100
+#define AHCI_Q_NOAA 0x00000200
+#define AHCI_Q_NOCOUNT 0x00000400
+#define AHCI_Q_ALTSIG 0x00000800
+#define AHCI_Q_NOMSI 0x00001000
+#define AHCI_Q_ATI_PMP_BUG 0x00002000
+#define AHCI_Q_MAXIO_64K 0x00004000
+#define AHCI_Q_SATA1_UNIT0 0x00008000 /* need better method for this */
+#define AHCI_Q_ABAR0 0x00010000
+#define AHCI_Q_1MSI 0x00020000
#define AHCI_Q_BIT_STRING \
- "\020" \
+ "\021" \
"\001NOFORCE" \
"\002NOPMP" \
"\003NONCQ" \
@@ -592,7 +593,8 @@ enum ahci_err_type {
"\016ATI_PMP_BUG" \
"\017MAXIO_64K" \
"\020SATA1_UNIT0" \
- "\021ABAR0"
+ "\021ABAR0" \
+ "\0221MSI"
int ahci_attach(device_t dev);
int ahci_detach(device_t dev);
Modified: head/sys/dev/ahci/ahci_pci.c
==============================================================================
--- head/sys/dev/ahci/ahci_pci.c Sun Feb 1 19:07:42 2015 (r278033)
+++ head/sys/dev/ahci/ahci_pci.c Sun Feb 1 20:00:08 2015 (r278034)
@@ -55,12 +55,17 @@ static const struct {
int quirks;
} ahci_ids[] = {
{0x43801002, 0x00, "AMD SB600",
- AHCI_Q_NOMSI | AHCI_Q_ATI_PMP_BUG | AHCI_Q_MAXIO_64K},
- {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
- {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
+ AHCI_Q_NOMSI | AHCI_Q_ATI_PMP_BUG | AHCI_Q_MAXIO_64K},
+ {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
+ {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0",
+ AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI},
/* Not sure SB8x0/SB9x0 needs this quirk. Be conservative though */
{0x43951002, 0x00, "AMD SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG},
{0x78001022, 0x00, "AMD Hudson-2", 0},
@@ -137,7 +142,7 @@ static const struct {
{0x1f378086, 0x00, "Intel Avoton (RAID)", 0},
{0x1f3e8086, 0x00, "Intel Avoton (RAID)", 0},
{0x1f3f8086, 0x00, "Intel Avoton (RAID)", 0},
- {0x23a38086, 0x00, "Intel Coleto Creek", 0},
+ {0x23a38086, 0x00, "Intel Coleto Creek", 0},
{0x28238086, 0x00, "Intel Wellsburg (RAID)", 0},
{0x28278086, 0x00, "Intel Wellsburg (RAID)", 0},
{0x8c028086, 0x00, "Intel Lynx Point", 0},
@@ -410,10 +415,13 @@ ahci_pci_attach(device_t dev)
/* Setup interrupts. */
/* Setup MSI register parameters */
- ctlr->msi = 2;
/* Process hints. */
if (ctlr->quirks & AHCI_Q_NOMSI)
ctlr->msi = 0;
+ else if (ctlr->quirks & AHCI_Q_1MSI)
+ ctlr->msi = 1;
+ else
+ ctlr->msi = 2;
resource_int_value(device_get_name(dev),
device_get_unit(dev), "msi", &ctlr->msi);
ctlr->numirqs = 1;
More information about the svn-src-all
mailing list