Re: pci_check_and_set_intx_mask(dev, true)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/10/2021, Amol <suratiamol@xxxxxxxxx> wrote:
> On 28/10/2021, Amol <suratiamol@xxxxxxxxx> wrote:
>> Hello,
>>
>> If pci_check_and_set_intx_mask is called with the intention of masking,
>> and if there indeed is an IRQ pending, then the comparison
>> "mask != irq_pending" evaluates to false: the 'mask' variable is 1, and
>
> Correction: Evaluates to true. Causes the function to return without
> masking.
>
>> 'irq_pending' is 0x80, in that case.
>>
>> This state causes the function to return without masking, contrary to the
>> behaviour expected of it as given by a comment:
>>
>> "Check if the device dev has its INTx line asserted, mask it and return
>> true
>> in that case. False is returned if no interrupt was pending."
>>
>> My vfio/pcipassthrough setup sees INTx line asserted as the VM is being
>> shutdown, but the line is not masked; the host kernel panics saying
>> "nobody cared" - there's no handler.
>>
>> Is the inconsistency with the pci intx masking really a problem, or just
>> a
>> misunderstanding on my part?

It is indeed a misunderstanding on my part. I missed the fact that the
datatype involved here is _Bool; the compiler must be emitting extra
instructions to convert non-zero values to 1.

Apologies for the spam.

>>
>> Thanks,
>> Amol
>>
>



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux