diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2024-06-16 18:00:09 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2024-06-16 18:00:09 +0000 |
commit | e7abbe00bf499db2b8a61a775ae69284114f028d (patch) | |
tree | 8b8b02c991e4f6a64f78bda8da43fe8ba426d79d /sys | |
parent | 35069bd4c6ae5a471b2c4855aca823b2a65aad8e (diff) |
Disable MSI on Zhaoxin ZX-100/ZX-200/ZX-E StorX to unhang SSD
The Unchartevice 6640MA's BIOS forces one of three SATA speeds:
- Gen1/2: bsd.rd reaches installer, but SSD does not attach
- Gen3: bsd.rd attaches SSD but hangs
MSI works for iwm(4) and and xhci(4), only ahci(4) bugs out, so add a quirk
for this controller as done for a few other devices already:
ahci0 at pci0 dev 15 function 0 "Zhaoxin StorX AHCI" rev 0x01: apic 9 int 21, AHCI 1.3.1
-ahci0: device not communicating on port 0
+ahci0: port 0: 6.0Gb/s
scsibus0 at ahci0: 32 targets
+sd0 at scsibus0 targ 0 lun 0: <ATA, 256GB SSD, V1.3> naa.5000000000000000
+sd0: 244198MB, 512 bytes/sector, 500118192 sectors, thin
OK kettenis
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/ahci_pci.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/dev/pci/ahci_pci.c b/sys/dev/pci/ahci_pci.c index 183df336aaa..964abde5b0a 100644 --- a/sys/dev/pci/ahci_pci.c +++ b/sys/dev/pci/ahci_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci_pci.c,v 1.17 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: ahci_pci.c,v 1.18 2024/06/16 18:00:08 kn Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -71,6 +71,8 @@ int ahci_intel_attach(struct ahci_softc *, struct pci_attach_args *); int ahci_samsung_attach(struct ahci_softc *, struct pci_attach_args *); +int ahci_storx_attach(struct ahci_softc *, + struct pci_attach_args *); static const struct ahci_device ahci_devices[] = { { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON2_SATA_1, @@ -148,7 +150,10 @@ static const struct ahci_device ahci_devices[] = { NULL, ahci_samsung_attach }, { PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8251_SATA, - ahci_no_match, ahci_vt8251_attach } + ahci_no_match, ahci_vt8251_attach }, + + { PCI_VENDOR_ZHAOXIN, PCI_PRODUCT_ZHAOXIN_STORX_AHCI, + NULL, ahci_storx_attach }, }; int ahci_pci_match(struct device *, void *, void *); @@ -286,6 +291,19 @@ ahci_samsung_attach(struct ahci_softc *sc, struct pci_attach_args *pa) } int +ahci_storx_attach(struct ahci_softc *sc, struct pci_attach_args *pa) +{ + /* + * Disable MSI with the ZX-100/ZX-200/ZX-E StorX AHCI Controller + * in the Unchartevice 6640MA notebook, otherwise ahci(4) hangs + * with SATA speed set to "Gen3" in BIOS. + */ + sc->sc_flags |= AHCI_F_NO_MSI; + + return (0); +} + +int ahci_pci_match(struct device *parent, void *match, void *aux) { struct pci_attach_args *pa = aux; |