Re: [PATCH] dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle

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

 





On 24/10/2019 00:27, Tony Lindgren wrote:
* Grygorii Strashko <grygorii.strashko@xxxxxx> [191023 20:56]:
On 23/10/2019 23:18, Tony Lindgren wrote:
And no, adding pm_runtime_get_sync() to issue_pending is not
a solution. There may be clocks and regulators that need to
be powered up, and we don't want to use pm_runtime_irq_safe()
because of the permanent use count on the parent.

5 cents.

I think the right thing might be to get rid of pm_runtime_xxx()
in cppi41_dma_issue_pending(). So overall approach will be:

- new job -> cppi41_dma_prep_slave_sg() -> pm_runtime_get()
- issue_pending: fill backlog if suspended or run_queue if active (pm_runtime_active())
- job done: dmaengine_desc_get_callback_invoke() ->

	dmaengine_desc_get_callback_invoke();
	pm_runtime_mark_last_busy(cdd->ddev.dev);
	pm_runtime_put_autosuspend(cdd->ddev.dev);
   in all places.

It even might allow to get rid of cdd->lock.

Well I don't think cppi41_dma_prep_slave_sg() is necessarily
paired with anything currently.

It should - dma cmpletion callbacks have to be called somewhere.


 This can potentially leading
to pm_runtime_get() called multiple times?

That's the idea - increase pm_counter as many times as jobs submitted.


So I think we'd also need cppi41_dma_cleanup_slave_sg()
or similar, and require they get called in a paired manner.

It might be better to add seprate PM runtime specific
functions that dma consumers can optionally call.

not sure here. It seems just over designed very old stuff ;)

--
Best regards,
grygorii



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux