summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-10-24 14:38:46 +0000
committerkettenis <kettenis@openbsd.org>2020-10-24 14:38:46 +0000
commitbc16de6891e675be6cc80bbc764f45223f289e27 (patch)
tree3bff4c89870477c9a372e20ecf926ff323904314
parentadd entry for realtek alc3204/236; (diff)
downloadwireguard-openbsd-bc16de6891e675be6cc80bbc764f45223f289e27.tar.xz
wireguard-openbsd-bc16de6891e675be6cc80bbc764f45223f289e27.zip
Prefer 32-bit MSI even if the hardware supports 64-bit MSI to work
around buggy Radeon cards that advertise 64-bit MSI but only implement 40 bits.
-rw-r--r--sys/arch/powerpc64/dev/phb.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/arch/powerpc64/dev/phb.c b/sys/arch/powerpc64/dev/phb.c
index 5b4c251b36b..e09482ec476 100644
--- a/sys/arch/powerpc64/dev/phb.c
+++ b/sys/arch/powerpc64/dev/phb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: phb.c,v 1.16 2020/09/21 11:14:28 kettenis Exp $ */
+/* $OpenBSD: phb.c,v 1.17 2020/10/24 14:38:46 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
@@ -541,11 +541,16 @@ phb_intr_establish(void *v, pci_intr_handle_t ih, int level,
if (error != OPAL_SUCCESS)
return NULL;
- if (ih.ih_type == PCI_MSI32) {
- error = opal_get_msi_32(sc->sc_phb_id, 0, xive,
- 1, opal_phys(&addr32), opal_phys(&data));
+ /*
+ * Use a 32-bit MSI address whenever possible. Some
+ * older Radeon graphics cards advertise 64-bit MSI
+ * but only implement 40 bits.
+ */
+ error = opal_get_msi_32(sc->sc_phb_id, 0, xive,
+ 1, opal_phys(&addr32), opal_phys(&data));
+ if (error == OPAL_SUCCESS)
addr = addr32;
- } else {
+ if (error != OPAL_SUCCESS && ih.ih_type != PCI_MSI32) {
error = opal_get_msi_64(sc->sc_phb_id, 0, xive,
1, opal_phys(&addr), opal_phys(&data));
}