]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
remoteproc: allocate vrings on demand, free when not needed
authorOhad Ben-Cohen <ohad@wizery.com>
Thu, 17 May 2012 11:23:59 +0000 (14:23 +0300)
committerOhad Ben-Cohen <ohad@wizery.com>
Wed, 4 Jul 2012 10:27:04 +0000 (13:27 +0300)
commit6db20ea8d85064175c7ef594c433c6c2e6bbab83
tree6087ffde8501059bdfd578758fb05c53aba3d620
parent485802a6c524e62b5924849dd727ddbb1497cc71
remoteproc: allocate vrings on demand, free when not needed

Dynamically allocate the vrings' DMA when the remote processor
is about to be powered on (i.e. when ->find_vqs() is invoked),
and release them as soon as it is powered off (i.e. when ->del_vqs()
is invoked).

The obvious and immediate benefit is better memory utilization, since
memory for the vrings is now only allocated when the relevant remote
processor is used.

Additionally, this approach also makes recovery of a (crashing)
remote processor easier: one just needs to remove the relevant
vdevs, and the entire vrings cleanup takes place automagically.

Tested-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
drivers/remoteproc/remoteproc_core.c
drivers/remoteproc/remoteproc_internal.h
drivers/remoteproc/remoteproc_virtio.c