Subject: Re: personal impression of issues on netbsd/macppc
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Tim Kelly <hockey@dialectronics.com>
List: port-macppc
Date: 11/20/2004 12:39:28
Hi Nathan,
> That the word "probably" has to be used in the explanation of what's
> going on here makes me think that this issue isn't fully understood
> and doesn't make a good case for per-architecture "optimizing".
I didn't explore the issue more after the fix (defining ALLOW_MEMIO in
-current) solved the problem. The reported problem by Michael Wolfson
was
Adaptec AHA-2940 Ultra (SCSI mass storage) at ? dev 15 function 0
(intrswiz 0, intrpin 0x1, i/o off, mem on, no quirks): Adaptec 2940
Ultra SCSI adapter: unable to map registers
The particular code during resolution
pointed to (in src/sys/dev/pci/ahc.c) (and I apologize for formatting
errors, Sylpheed is _really_ starting to irritate me)
ahc_pci_attach(parent, self, aux)
....
#ifdef AHC_ALLOW_MEMIO
memh_valid = 0;
memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag,
AHC_PCI_MEMADDR);
switch (memtype) {
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
memh_valid = (pci_mapreg_map(pa, AHC_PCI_MEMADDR,
memtype, 0, &memt, &memh, NULL, NULL) == 0);
break;
default:
memh_valid = 0;
}
#endif
ioh_valid = (pci_mapreg_map(pa, AHC_PCI_IOADDR,
PCI_MAPREG_TYPE_IO, 0, &iot,
&ioh, NULL, NULL) == 0);
#if 0
printf("%s: bus info: memt 0x%lx, memh 0x%lx, iot 0x%lx, ioh 0x%lx\n",
ahc_name(ahc),(u_long)memt,(u_long)memh,(u_long)iot,
(u_long)ioh);
#endif
if (ioh_valid) {
st = iot;
sh = ioh;
#ifdef AHC_ALLOW_MEMIO
} else if (memh_valid) {
st = memt;
sh = memh;
#endif
} else {
printf(": unable to map registers\n");
return;
}
It appeared that I/O was unavailable, and without AHC_ALLOW_MEMIO, the
mapping couldn't occur. With it back in -current, the card has worked
fine, or at least MW reported it was fine and hasn't said anything
since.
From a performance point of view, is writing to I/O space faster or
slower than writing to memory space? Because the above code appears to
default to using I/O even if memory space is available.
tim