Page 1 of 1

IRQ 46

Posted: Sat Oct 05, 2013 10:33 am
by bigbob
Hi,

Sending command IDENTIFY to ATA winchester fires IRQ46(in Bochs or real HW) unless it is disabled:

Code: Select all

out(0x3F6, 2) // set nIEN primary control port
out(0x376, 2) // set nIEN secondary control port
This works with Bochs because no IRQ46 gets fired if nIEN is set in Bochs.
The problem is that on real HW (with a primary master winchester) the interrupt occurs regardless of disabling it.
I read that IRQ46 is the primary channel interrupt.

I even put delays after setting nIEN and only then did I executed the IDENTIFY command. It didn't help.
Reading the status register didn't help either.
As far as I know only interrupts less than 16 can be acknowledged with EOI.

EDIT: I tried selecting the drive before setting nIEN. It didn't work:

Code: Select all

out(0x1F6, 0xA0 | slavebit<<4)
sleep(1)
out(0x3F6, 2)

Do I have to do something else to disable the interrupt?

Regards,
Rob

Re: IRQ 46

Posted: Sat Oct 05, 2013 12:20 pm
by bigbob
If I simply return from the ISR46 with iret then it works on real HW, of course :-) .
I just wanted to figure out why disabling nIEN didn't work on real HW.
Answer is still appreciated.

Re: IRQ 46

Posted: Mon Oct 07, 2013 4:58 am
by bigbob
I did a PCI scan on real HW and found (in hex):

bus slot devId venId Class Sub Fun
00 00 0269 1106 06 00 00(00) 01(00) 02(00) 03(00) 07(00) CPU-to-PCI bridge
00 01 B198 1106 06 04 00(00) PCI-to-PCI bridge
00 09 4320 11AB 02 00 00(0A) Marvell Yukon PCI ...
00 0F 3149 1106 01 04 00(0A) 01(FF) Sata RAID Controller
00 10 3038 1106 0C 03 00(0B) 01(0B) 02(03) 03(03) 04(0A) USB PCI controller
00 11 3227 1106 06 01 00(00) 05(0A) PCI-to-ISA bridge
01 00 002D 10DE 03 00 00(0B) NVIDIA RIVA TNT2 64 AGP ...

Texts can be retrieved from the PCI-database:
http://www.pcidatabase.com/
The bold values in parenthesis are the IRQs. So, for example the SATA RAID controller (Bus=0, slot=0x0F, vendorId=0x1106, DeviceID=0x3149, class=0x01, subclass=0x04) function=0 has IRQ0x0A assigned. I managed to change the IRQs here.
The question is that how could I change the IRQ sent by the Primary channel (IRQ46 or 0x2E)?
It is not that important in connection to winchesters but ATAPI devices signal the data by sending an IRQ and I wonder if they will also send IRQ46 or not. I would like to assign a different IRQ and not having IRQ sharing.
I couldn't manage to do a better pci-table-formatting.

EDIT: this lspci is not correct. A line should be printed for every function because they can be different devices.