rpmsg: use less buffers when vrings are small
authorSuman Anna <s-anna@ti.com>
Tue, 16 Sep 2014 18:33:07 +0000 (13:33 -0500)
committerOhad Ben-Cohen <ohad@wizery.com>
Wed, 26 Nov 2014 16:24:36 +0000 (18:24 +0200)
commitb1b9891441fa33fd0d49b5cb3aa7f04bca1cc1db
tree50101517ccd4202654ac1146e6d2d2d9e3c9668f
parent5d01410fe4d92081f349b013a2e7a95429e4f2c9
rpmsg: use less buffers when vrings are small

Adjust the number of rpmsg buffers to rely on the size of the
vring, instead of using the hard coded value of 512 (256 per
direction).

This is needed when small vrings are being used, where 256
buffers are too much to fit in a vring.

While considering the vring size, keep using the 512 hard coded
value as an upper limit to avoid wacky resource tables consuming
unreasonable amount of memory.

NOTE: The number of buffers is already assumed to be symmetrical
in each direction, and that logic is unchanged.

Signed-off-by: Suman Anna <s-anna@ti.com>
[edit commit message, small code and comment simplification]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
drivers/rpmsg/virtio_rpmsg_bus.c