diff options
author | Jonathan Matthew <jmatthew@cvs.openbsd.org> | 2021-09-20 01:18:01 +0000 |
---|---|---|
committer | Jonathan Matthew <jmatthew@cvs.openbsd.org> | 2021-09-20 01:18:01 +0000 |
commit | 8a8b0cd838e90184493459e7b38b1fe39a358e3e (patch) | |
tree | a055d6cc27e53364b9c0a306c3b70402a11dd43e /sys/dev/pci | |
parent | fc66fdbcdafb2ca854c10326302b4f986eaddaf5 (diff) |
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@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_aq_pci.c | 7 |
1 files 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; } |