Saturday, February 28, 2009

Plan9 AC97 Driver Bug

The AC97 driver was crashing the system, after taking a look I saw this in audioac97.c, ac97reset:
if(p->mem[0].size == 64){
  ctlr->port = p->mem[0].bar & ~3;
  ctlr->mixport = p->mem[1].bar & ~3;
} else if(p->mem[1].size == 64){
  ctlr->port = p->mem[1].bar & ~3;
  ctlr->mixport = p->mem[0].bar & ~3;
}
So what happens if neither size is 64? Crash.
My pci was showing sizes of 1024 and 256 for the audio device.
This is what I did to get it working:
ctlr->port = p->mem[1].bar & ~3;
ctlr->mixport = p->mem[0].bar & ~3;

0 comments:

Post a Comment