"Nikolai Vladychevski" <[EMAIL PROTECTED]> writes:
> Hi,
>
> I got a very bad problem and I can't find where it is (besides other stuff
> that is pending)...... :
>
> I can use the modem when booting with original bios but when I use the
> motherboard with DoC the modem is not recognized. And a strange thing, the
> only parameter not recognized by the modem drivers is IRQ... Ports are
> detected ok.
> So , why with Linuxbios the irq is lost?
Because linuxBIOS does not do irq assignment. It leaves that work
to the kernel. The stock probably BIOS does assign the irq.
> (I don't understand why irq is now equal to 12, but it works)
>
> I started to debug modem's code and here in the ptserial.c program I see:
Ouch no struct pci_device. No pcibios_read_byte no pci_read_conf_byte.
The driver really is not very linux friendly.
> <....... snip .......>
> printk(KERN_INFO __FUNCTION__ ": entered detection code\n");
> printk(KERN_INFO __FUNCTION__ ": requesting info
> dwDeviceNum=%#x(%d)\n",dwDeviceNum,dwDeviceNum);
> outl(dwDeviceNum + PCI_INTERRUPT_LINE, 0xCF8);
> irq = inb(0xCFC);
> outl(dwDeviceNum + PCI_BASE_ADDRESS_0, 0xCF8);
> iobase_0 = inl(0xCFC);
> outl(dwDeviceNum + PCI_BASE_ADDRESS_1, 0xCF8);
> iobase_1 = inl(0xCFC);
>
> if (iobase_0 == 0xffffffff) iobase_0 = 0;
> if (iobase_1 == 0xffffffff) iobase_1 = 0;
> iobase_0 &= PCI_BASE_ADDRESS_IO_MASK;
> iobase_1 &= PCI_BASE_ADDRESS_IO_MASK;
>
> printk("AC97 modem device found: devnum = %8X, devid =
> %4X/%4X\n", dwDeviceNum, dwDeviceID&0xFFFF, dwDeviceID>>16);
> printk("irq = %d, iobase_0 = %4X, iobase_1 = %4X\n", irq,
> iobase_0, iobase_1);
>
> pctel_autodetect_irq = irq;
> pctel_autodetect_port_0 = iobase_0;
> pctel_autodetect_port_1 = iobase_1;
> <...... snip .......>
>
> Here , the code is:
> outl(dwDeviceNum + PCI_INTERRUPT_LINE, 0xCF8);
> irq = inb(0xCFC);
>
> the IRQ is requested through the BUS, so this is NOT the driver problem,
Oh yes it is. That is totally the wrong way to get the irq in linux.
It needs to read it from struct pci_dev.
> also the same version of the driver, with the same version
> of the kernel works ok under original BIOS flash.
Luck.
> From this point, I can
> discard driver and look why is PCI bus returning irq=0 in other place ....
> (Due to the drivers for PCTEL modem are directly from PCTEL and do not
> support higher versions than 2.4.5 , I do all my tests under 2.4.5. I
> applied pathch-2.4.6-SiS to 2.4.5 but this is not the problem origin I
> beleive, patches where applied clean)
>
> As you can see, tables are equal......
>
> Now , where is left to look ? If the driver requests IRQ directly from the
> bus and gets 0 , and the lspci requests IRQ and gets 10 .... where should I
> look for the problem?
The modem driver. It isn't using the linux kernel API to get the irq.
It is a buggy driver.
> Any help will be greatly appriciated.
>
> Nikolai
> and another question... why when I copy identical irq_table from bios to
> DoC, the resulting lspci shows different IRQs?
> Sholdn't they be the same?
Because the kernel is conservative and if the BIOS has already done
the work of assigning irqs it figures it doesn't need to bother.
Eric