> Date: Tue, 21 May 2019 21:04:33 +0200 (CEST)
> From: Mark Kettenis <mark.kette...@xs4all.nl>
> 
> Logic error.  If pa->pa_pmemex is NULL we want to try allocating from
> pa->pa_memex.  But if both of them are NULL we need to assume that the
> provided base address is correct.
> 
> ok?

patrick@ pointed out an issue with this diff and I'm going to fix this
in a different way.

> Index: dev/pci/pci.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/pci.c,v
> retrieving revision 1.112
> diff -u -p -r1.112 pci.c
> --- dev/pci/pci.c     28 Jul 2018 15:28:51 -0000      1.112
> +++ dev/pci/pci.c     21 May 2019 19:00:01 -0000
> @@ -907,10 +907,10 @@ pci_reserve_resources(struct pci_attach_
>               base = PCI_ROM_ADDR(addr);
>               size = PCI_ROM_SIZE(mask);
>               if (base != 0 && size != 0) {
> -                     if (pa->pa_pmemex && extent_alloc_region(pa->pa_pmemex,
> -                         base, size, EX_NOWAIT) &&
> -                         pa->pa_memex && extent_alloc_region(pa->pa_memex,
> -                         base, size, EX_NOWAIT)) {
> +                     if ((pa->pa_pmemex && extent_alloc_region(pa->pa_pmemex,
> +                         base, size, EX_NOWAIT)) ||
> +                         (pa->pa_memex && extent_alloc_region(pa->pa_memex,
> +                         base, size, EX_NOWAIT))) {
>                               printf("%d:%d:%d: mem address conflict 
> 0x%lx/0x%lx\n",
>                                   bus, dev, func, base, size);
>                               pci_conf_write(pc, tag, PCI_ROM_REG, 0);
> 
> 

Reply via email to