summaryrefslogtreecommitdiffstats
path: root/sys/dev/ahci
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2015-02-01 20:00:08 +0000
committersmh <smh@FreeBSD.org>2015-02-01 20:00:08 +0000
commit034497915685715efafad305dcd278c391b06ee4 (patch)
treea86fe4659cb37f83ee6e66e2de7376efb9e48f89 /sys/dev/ahci
parenta1d7d753f36e6dbacae937300665bc1a7e257296 (diff)
downloadFreeBSD-src-034497915685715efafad305dcd278c391b06ee4.zip
FreeBSD-src-034497915685715efafad305dcd278c391b06ee4.tar.gz
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
Diffstat (limited to 'sys/dev/ahci')
-rw-r--r--sys/dev/ahci/ahci.h40
-rw-r--r--sys/dev/ahci/ahci_pci.c24
2 files changed, 37 insertions, 27 deletions
diff --git a/sys/dev/ahci/ahci.h b/sys/dev/ahci/ahci.h
index 79b8a56..755fdc5 100644
--- a/sys/dev/ahci/ahci.h
+++ b/sys/dev/ahci/ahci.h
@@ -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);
diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c
index 8574e47..acde18d 100644
--- a/sys/dev/ahci/ahci_pci.c
+++ b/sys/dev/ahci/ahci_pci.c
@@ -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;
OpenPOWER on IntegriCloud