public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vignesh R <vigneshr@ti.com>
To: Sekhar Nori <nsekhar@ti.com>, Mark Brown <broonie@kernel.org>
Cc: <linux-spi@vger.kernel.org>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] spi: omap2-mcspi: Add slave mode support
Date: Mon, 15 Oct 2018 15:12:38 +0530	[thread overview]
Message-ID: <28333ef8-22ca-e95f-b9d5-c0aeece20603@ti.com> (raw)
In-Reply-To: <2bef1218-ef43-cdc1-303f-b85863887a6b@ti.com>

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

  reply	other threads:[~2018-10-15  9:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  6:38 [PATCH 0/3] omap2-mcspi: Add slave mode support Vignesh R
2018-10-15  6:38 ` [PATCH 1/3] spi: omap2-mcspi: Switch to readl_poll_timeout() Vignesh R
2018-10-19 12:29   ` Applied "spi: omap2-mcspi: Switch to readl_poll_timeout()" to the spi tree Mark Brown
2018-10-15  6:38 ` [PATCH 2/3] spi: omap2-mcspi: Set FIFO DMA trigger level to word length Vignesh R
2018-10-19 12:29   ` Applied "spi: omap2-mcspi: Set FIFO DMA trigger level to word length" to the spi tree Mark Brown
2018-10-15  6:38 ` [PATCH 3/3] spi: omap2-mcspi: Add slave mode support Vignesh R
2018-10-15  8:23   ` Sekhar Nori
2018-10-15  9:42     ` Vignesh R [this message]
2018-10-15 10:04       ` Sekhar Nori
2018-10-15 14:56         ` Tony Lindgren
2018-10-19 12:29   ` Applied "spi: omap2-mcspi: Add slave mode support" to the spi tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28333ef8-22ca-e95f-b9d5-c0aeece20603@ti.com \
    --to=vigneshr@ti.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nsekhar@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox