Re: omap4 mcspi interrupts do not appear

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

 



Hi Tony and friends,

On 11/21/19, Tony Lindgren <tony@xxxxxxxxxxx> wrote:
> * Laurentiu-Cristian Duca <laurentiu.duca@xxxxxxxxx> [191121 14:03]:
>> Hello linux-omap community,
>>
>>  I am an open source enthusiast and I am trying to modify
>> omap4 mcspi drivers in order to use interrupts instead of polling.
>> I use beaglebone black.
>>   After I set CS active and enable channel 0 and interrupts,
>> I receive only two interrupts (in fact a pair):
>> - tx0_empty and after this I fill the tx buffer by writing in the
>> mcspi tx reg n-times
>> and then reset the flag in IRQSTATUS
>> - as a follow up to the actions taken for tx0_empty,
>> rx0_full interrupt is risen and I read the mcspi rx reg n-times
>> and reset the flag in IRQSTATUS.
>> After that no interrupt comes (neither of tx_empty, rx_full or EOT)
>> even if interrupts and channel0 are enabled and CS is active,
>> so I can not transfer remaining data.
>>   FIFO is enabled and OMAP2_MCSPI_XFERLEVEL is setup accordingly to
>> transfer size.
>>   Note that if I want to transfer a message that needs only one pair
>> of interrupts,
>> then EOT interrupt comes, which is the expected behavior.
>>   If I use the polling method to see if something is pending on channel0
>> everything works well, but need to use interrupts
>> because I want to port this driver to Xenomai real-time linux.
>>   The dts for spi0 and spi1 is not changed.
>>
>>   Any ideas? Did anybody successfully used interrupts (not dma) on omap4
>> mcspi?
>
> Looks like I'm also seeing zero counts in /proc/interrupts for
> spi for my devices. My guess without looking at the code is that
> it currently does the transfers with dma and uses the dma interrupt
> and dma completion callback.

If transfer len is less than DMA_MIN_BYTES (160), dma is not used
and instead it is used omap2_mcspi_txrx_pio() which makes the transfer
by polling channel 0 for events.
I want to use interrupts instead of polling.
If I set CS active and enable channel 0, then in IRQSTATUS is raised
up TX0_EMPTY
and after interrupts are enabled, TX0_EMPTY interrupt will occur.
But if I reset the TX0_EMPTY bit in IRQSTATUS
(as the am335x manual says in chapter 24.3.4.1 Interrupt-driven operation:
The interrupt status bit should always be reset after the channel is
enabled and before the event is enabled as an interrupt source) then
no interrupts will occur even if interrupts are enabled.


>
> Maybe check am335x and omap4460 related errata pdf and see if
> it provides more clues?
>
> It could also be that the driver bails out wrongly somewhere
> if no dma is configured.
>
> Regards,
>
> Tony
>



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux