Skip to content

Commit

Permalink
ARM: OMAP: Fix Unbalanced enable for IRQ in omap mailbox
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Hiroshi DOYU authored and Tony Lindgren committed May 9, 2008
1 parent 0692f05 commit bfbdcf8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
25 changes: 15 additions & 10 deletions arch/arm/mach-omap2/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ struct omap_mbox2_priv {

static struct clk *mbox_ick_handle;

static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
omap_mbox_type_t irq);

static inline unsigned int mbox_read_reg(unsigned int reg)
{
return __raw_readl(mbox_base + reg);
Expand All @@ -81,7 +84,7 @@ static inline void mbox_write_reg(unsigned int val, unsigned int reg)
}

/* Mailbox H/W preparations */
static inline int omap2_mbox_startup(struct omap_mbox *mbox)
static int omap2_mbox_startup(struct omap_mbox *mbox)
{
unsigned int l;

Expand All @@ -97,46 +100,48 @@ static inline int omap2_mbox_startup(struct omap_mbox *mbox)
l |= 0x00000011;
mbox_write_reg(l, MAILBOX_SYSCONFIG);

omap2_mbox_enable_irq(mbox, IRQ_RX);

return 0;
}

static inline void omap2_mbox_shutdown(struct omap_mbox *mbox)
static void omap2_mbox_shutdown(struct omap_mbox *mbox)
{
clk_disable(mbox_ick_handle);
clk_put(mbox_ick_handle);
}

/* Mailbox FIFO handle functions */
static inline mbox_msg_t omap2_mbox_fifo_read(struct omap_mbox *mbox)
static mbox_msg_t omap2_mbox_fifo_read(struct omap_mbox *mbox)
{
struct omap_mbox2_fifo *fifo =
&((struct omap_mbox2_priv *)mbox->priv)->rx_fifo;
return (mbox_msg_t) mbox_read_reg(fifo->msg);
}

static inline void omap2_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
static void omap2_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
{
struct omap_mbox2_fifo *fifo =
&((struct omap_mbox2_priv *)mbox->priv)->tx_fifo;
mbox_write_reg(msg, fifo->msg);
}

static inline int omap2_mbox_fifo_empty(struct omap_mbox *mbox)
static int omap2_mbox_fifo_empty(struct omap_mbox *mbox)
{
struct omap_mbox2_fifo *fifo =
&((struct omap_mbox2_priv *)mbox->priv)->rx_fifo;
return (mbox_read_reg(fifo->msg_stat) == 0);
}

static inline int omap2_mbox_fifo_full(struct omap_mbox *mbox)
static int omap2_mbox_fifo_full(struct omap_mbox *mbox)
{
struct omap_mbox2_fifo *fifo =
&((struct omap_mbox2_priv *)mbox->priv)->tx_fifo;
return (mbox_read_reg(fifo->fifo_stat));
}

/* Mailbox IRQ handle functions */
static inline void omap2_mbox_enable_irq(struct omap_mbox *mbox,
static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
omap_mbox_type_t irq)
{
struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv;
Expand All @@ -147,7 +152,7 @@ static inline void omap2_mbox_enable_irq(struct omap_mbox *mbox,
mbox_write_reg(l, p->irqenable);
}

static inline void omap2_mbox_disable_irq(struct omap_mbox *mbox,
static void omap2_mbox_disable_irq(struct omap_mbox *mbox,
omap_mbox_type_t irq)
{
struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv;
Expand All @@ -158,7 +163,7 @@ static inline void omap2_mbox_disable_irq(struct omap_mbox *mbox,
mbox_write_reg(l, p->irqenable);
}

static inline void omap2_mbox_ack_irq(struct omap_mbox *mbox,
static void omap2_mbox_ack_irq(struct omap_mbox *mbox,
omap_mbox_type_t irq)
{
struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv;
Expand All @@ -167,7 +172,7 @@ static inline void omap2_mbox_ack_irq(struct omap_mbox *mbox,
mbox_write_reg(bit, p->irqstatus);
}

static inline int omap2_mbox_is_irq(struct omap_mbox *mbox,
static int omap2_mbox_is_irq(struct omap_mbox *mbox,
omap_mbox_type_t irq)
{
struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv;
Expand Down
1 change: 0 additions & 1 deletion arch/arm/plat-omap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ static int omap_mbox_init(struct omap_mbox *mbox)
"failed to register mailbox interrupt:%d\n", ret);
goto fail_request_irq;
}
enable_mbox_irq(mbox, IRQ_RX);

mq = mbox_queue_alloc(mbox, mbox_txq_fn, mbox_tx_work);
if (!mq) {
Expand Down

0 comments on commit bfbdcf8

Please sign in to comment.