On Mon, May 3, 2010 at 9:07 AM, Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx> wrote: > From: Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx> > Subject: Re: [PATCH v2 4/4] omap: mailbox: convert block api to kfifo > Date: Mon, 03 May 2010 08:30:36 +0300 (EEST) > >> Hi Ohad, >> >> From: ext Ohad Ben-Cohen <ohad@xxxxxxxxxx> >> Subject: [PATCH v2 4/4] omap: mailbox: convert block api to kfifo >> Date: Sun, 2 May 2010 17:44:31 +0200 >> >>> The underlying buffering implementation of mailbox >>> is converted from block API to kfifo due to the simplicity >>> and speed of kfifo. >>> >>> The default size of the kfifo buffer is set to 256 bytes. >>> This value is configurable at compile time (via >>> CONFIG_OMAP_MBOX_KFIFO_SIZE), and can be changed at >>> runtime (via the omap_kfifo_size module parameter). >> >> mbox_kfifo_size? > > It may be also nice if there's some checking of 'mbox_kfifo_size % 4 == 0' along with 'CONFIG_OMAP_MBOX_KFIFO_SIZE % 4 == 0'? Good point. I'll send a new patch together with this: diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index a500ac4..fb3d452 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -21,6 +21,7 @@ * */ +#include <linux/kernel.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/device.h> @@ -394,6 +395,10 @@ static int __init omap_mbox_init(void) if (!mboxd) return -ENOMEM; + /* kfifo size sanity check: alignment and minimal size */ + mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t)); + mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, sizeof(mbox_msg_t)); + return 0; } module_init(omap_mbox_init); > >> >>> Signed-off-by: Ohad Ben-Cohen <ohad@xxxxxxxxxx> >>> Signed-off-by: Hari Kanigeri <h-kanigeri2@xxxxxx> >>> --- >>> If you want, you can also reach me at < ohadb at ti dot com >. >>> >>> arch/arm/plat-omap/Kconfig | 9 +++ >>> arch/arm/plat-omap/include/plat/mailbox.h | 4 +- >>> arch/arm/plat-omap/mailbox.c | 107 +++++++++++++---------------- >>> 3 files changed, 58 insertions(+), 62 deletions(-) > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html