From 7bebb76e9334ca8a7966e8cb2d2be89204feac05 Mon Sep 17 00:00:00 2001 From: jmatthew Date: Mon, 20 Sep 2021 01:18:00 +0000 Subject: [PATCH] pci_mapreg_map() will assign an address to the BAR if it doesn't have one already, so we shouldn't refuse to attach in that case. noticed by kevlo@ on arm64 ok dlg@ deraadt@ --- sys/dev/pci/if_aq_pci.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/if_aq_pci.c b/sys/dev/pci/if_aq_pci.c index 373618581e0..12785537072 100644 --- a/sys/dev/pci/if_aq_pci.c +++ b/sys/dev/pci/if_aq_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aq_pci.c,v 1.1 2021/09/02 10:11:21 mlarkin Exp $ */ +/* $OpenBSD: if_aq_pci.c,v 1.2 2021/09/20 01:18:00 jmatthew Exp $ */ /* $NetBSD: if_aq.c,v 1.27 2021/06/16 00:21:18 riastradh Exp $ */ /* @@ -961,9 +961,8 @@ aq_attach(struct device *parent, struct device *self, void *aux) aqp = aq_lookup(pa); bar = pci_conf_read(pc, tag, AQ_BAR0); - if ((PCI_MAPREG_MEM_ADDR(bar) == 0) || - (PCI_MAPREG_TYPE(bar) != PCI_MAPREG_TYPE_MEM)) { - printf("%s: wrong BAR type\n", DEVNAME(sc)); + if (PCI_MAPREG_TYPE(bar) != PCI_MAPREG_TYPE_MEM) { + printf(": wrong BAR type\n"); return; } -- 2.20.1