From patchwork Fri Sep 4 11:47:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "C.A, Subramaniam" X-Patchwork-Id: 45668 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n84BkVe7029365 for ; Fri, 4 Sep 2009 11:47:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755893AbZIDLrM (ORCPT ); Fri, 4 Sep 2009 07:47:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755882AbZIDLrM (ORCPT ); Fri, 4 Sep 2009 07:47:12 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:58005 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755825AbZIDLrL convert rfc822-to-8bit (ORCPT ); Fri, 4 Sep 2009 07:47:11 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n84BkwLT024456; Fri, 4 Sep 2009 06:47:04 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id n84BkwmH016157; Fri, 4 Sep 2009 17:16:58 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde71.ent.ti.com ([172.24.170.149]) with mapi; Fri, 4 Sep 2009 17:16:58 +0530 From: "C.A, Subramaniam" To: "linux-omap@vger.kernel.org" CC: "tony@atomide.com" , "Hiroshi.DOYU@nokia.com" , "rmk@arm.linux.org.uk" , "Kanigeri, Hari" , "Gupta, Ramesh" Date: Fri, 4 Sep 2009 17:17:53 +0530 Subject: [PATCH 3/10] omap mailbox: remove sequence bit checking Thread-Topic: [PATCH 3/10] omap mailbox: remove sequence bit checking Thread-Index: AcotVYmxjy842FiRQI+6+6xBe06GGg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From d7a03f1d174036edbad312dff1f1789736098bf0 Mon Sep 17 00:00:00 2001 From: Hiroshi DOYU Date: Wed, 2 Sep 2009 19:32:42 +0530 Subject: [PATCH 3/10] omap mailbox: remove sequence bit checking Any protocol should be handled in the upper layer and mailbox driver shouldn't care about the contents of messages. Signed-off-by: Hiroshi DOYU --- arch/arm/plat-omap/mailbox.c | 70 ++--------------------------------------- 1 files changed, 4 insertions(+), 66 deletions(-) diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 40424ed..e2bcc9d 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -28,54 +28,9 @@ #include -static int enable_seq_bit; -module_param(enable_seq_bit, bool, 0); -MODULE_PARM_DESC(enable_seq_bit, "Enable sequence bit checking."); - static struct omap_mbox *mboxes; static DEFINE_RWLOCK(mboxes_lock); -/* - * Mailbox sequence bit API - */ - -/* seq_rcv should be initialized with any value other than - * 0 and 1 << 31, to allow either value for the first - * message. */ -static inline void mbox_seq_init(struct omap_mbox *mbox) -{ - if (!enable_seq_bit) - return; - - /* any value other than 0 and 1 << 31 */ - mbox->seq_rcv = 0xffffffff; -} - -static inline void mbox_seq_toggle(struct omap_mbox *mbox, mbox_msg_t * msg) -{ - if (!enable_seq_bit) - return; - - /* add seq_snd to msg */ - *msg = (*msg & 0x7fffffff) | mbox->seq_snd; - /* flip seq_snd */ - mbox->seq_snd ^= 1 << 31; -} - -static inline int mbox_seq_test(struct omap_mbox *mbox, mbox_msg_t msg) -{ - mbox_msg_t seq; - - if (!enable_seq_bit) - return 0; - - seq = msg & (1 << 31); - if (seq == mbox->seq_rcv) - return -1; - mbox->seq_rcv = seq; - return 0; -} - /* Mailbox FIFO handle functions */ static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox) { @@ -113,13 +68,6 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) return mbox->ops->is_irq(mbox, irq); } -/* Mailbox Sequence Bit function */ -void omap_mbox_init_seq(struct omap_mbox *mbox) -{ - mbox_seq_init(mbox); -} -EXPORT_SYMBOL(omap_mbox_init_seq); - /* * message sender */ @@ -141,7 +89,6 @@ static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void *arg) goto out; } - mbox_seq_toggle(mbox, &msg); mbox_fifo_write(mbox, msg); out: return ret; @@ -254,11 +201,11 @@ static void mbox_rx_work(struct work_struct *work) /* * Mailbox interrupt handler */ -static void mbox_txq_fn(struct request_queue * q) +static void mbox_txq_fn(struct request_queue *q) { } -static void mbox_rxq_fn(struct request_queue * q) +static void mbox_rxq_fn(struct request_queue *q) { } @@ -284,11 +231,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox) msg = mbox_fifo_read(mbox); - if (unlikely(mbox_seq_test(mbox, msg))) { - pr_info("mbox: Illegal seq bit!(%08x)\n", msg); - if (mbox->err_notify) - mbox->err_notify(); - } blk_insert_request(q, rq, 0, (void *)msg); if (mbox->ops->type == OMAP_MBOX_TYPE1) @@ -320,7 +262,7 @@ static irqreturn_t mbox_interrupt(int irq, void *p) */ static ssize_t omap_mbox_write(struct device *dev, struct device_attribute *attr, - const char * buf, size_t count) + const char *buf, size_t count) { int ret; mbox_msg_t *p = (mbox_msg_t *)buf; @@ -357,10 +299,6 @@ omap_mbox_read(struct device *dev, struct device_attribute *attr, char *buf) blk_end_request_all(rq, 0); - if (unlikely(mbox_seq_test(mbox, *p))) { - pr_info("mbox: Illegal seq bit!(%08x) ignored\n", *p); - continue; - } p++; } @@ -383,7 +321,7 @@ static struct class omap_mbox_class = { }; static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox, - request_fn_proc * proc, + request_fn_proc *proc, void (*work) (struct work_struct *)) { struct request_queue *q;