lkml.org 
[lkml]   [2018]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] spi: omap2-mcspi: Add slave mode support
From
Date
Hi Sekhar,

On Monday 15 October 2018 01:53 PM, Sekhar Nori wrote:

[...]
>>
>> +static irqreturn_t omap2_mcspi_irq_handler(int irq, void *data)
>> +{
>> + struct omap2_mcspi *mcspi = data;
>> + u32 irqstat;
>> +
>> + irqstat = mcspi_read_reg(mcspi->master, OMAP2_MCSPI_IRQSTATUS);
>> + if (!irqstat)
>> + return IRQ_NONE;
>> +
>> + /* Disable IRQ and wakeup slave xfer task */
>> + mcspi_write_reg(mcspi->master, OMAP2_MCSPI_IRQENABLE, 0);
>> + if (irqstat & OMAP2_MCSPI_IRQSTATUS_EOW)
>> + complete(&mcspi->txdone);
>> +
>> + return IRQ_HANDLED;
>
> You need to have the:
>
> pm_runtime_get_sync();
>
> /* access registers */
>
> pm_runtime_mark_last_busy();
> pm_runtime_put_autosuspend();
>
> sequence here. I think thats also missing from the dma callbacks.
> Probably working by chance today.
>

This is taken care of by the SPI core as part of __spi_pump_messages():
pm_runtime_get_sync()
...
spi_transfer_one_message
...
omap2_mcspi_transfer_one
...
omap2_mcspi_txrx_dma

So, both in dma callbacks and in IRQ handler, SPI controller is in
active state.


--
Regards
Vignesh

\
 
 \ /
  Last update: 2018-10-15 11:42    [W:0.076 / U:3.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site