Skip to content

Commit

Permalink
staging: tidspbridge: replace mbox callback with notifier_call
Browse files Browse the repository at this point in the history
Lately, mailbox callbacks have been replaced by notifier block
call chains, this needs to be changed in the users of mailbox,
otherwise compilation will break due to missing parameters.

For this new change to work, io_mbox_msg needs to be compatible
with the notifier_call definition.

Reported-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Omar Ramirez Luna authored and Greg Kroah-Hartman committed Jan 20, 2011
1 parent d1ce318 commit 85d139c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/tidspbridge/core/io_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ void io_dpc(unsigned long ref_data)
* Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then
* schedules a DPC to dispatch I/O.
*/
void io_mbox_msg(u32 msg)
int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg)
{
struct io_mgr *pio_mgr;
struct dev_object *dev_obj;
Expand All @@ -959,9 +959,9 @@ void io_mbox_msg(u32 msg)
dev_get_io_mgr(dev_obj, &pio_mgr);

if (!pio_mgr)
return;
return NOTIFY_BAD;

pio_mgr->intr_val = (u16)msg;
pio_mgr->intr_val = (u16)((u32)msg);
if (pio_mgr->intr_val & MBX_PM_CLASS)
io_dispatch_pm(pio_mgr);

Expand All @@ -973,7 +973,7 @@ void io_mbox_msg(u32 msg)
spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags);
tasklet_schedule(&pio_mgr->dpc_tasklet);
}
return;
return NOTIFY_OK;
}

/*
Expand Down
10 changes: 6 additions & 4 deletions drivers/staging/tidspbridge/core/tiomap3430.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ static struct bridge_drv_interface drv_interface_fxns = {
bridge_msg_set_queue_id,
};

static struct notifier_block dsp_mbox_notifier = {
.notifier_call = io_mbox_msg,
};

static inline void flush_all(struct bridge_dev_context *dev_context)
{
if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION ||
Expand Down Expand Up @@ -553,7 +557,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,
* Enable Mailbox events and also drain any pending
* stale messages.
*/
dev_context->mbox = omap_mbox_get("dsp");
dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier);
if (IS_ERR(dev_context->mbox)) {
dev_context->mbox = NULL;
pr_err("%s: Failed to get dsp mailbox handle\n",
Expand All @@ -563,8 +567,6 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt,

}
if (!status) {
dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg;

/*PM_IVA2GRPSEL_PER = 0xC0;*/
temp = readl(resources->dw_per_pm_base + 0xA8);
temp = (temp & 0xFFFFFF30) | 0xC0;
Expand Down Expand Up @@ -685,7 +687,7 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt)
/* Disable the mailbox interrupts */
if (dev_context->mbox) {
omap_mbox_disable_irq(dev_context->mbox, IRQ_RX);
omap_mbox_put(dev_context->mbox);
omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier);
dev_context->mbox = NULL;
}
/* Reset IVA2 clocks*/
Expand Down
21 changes: 8 additions & 13 deletions drivers/staging/tidspbridge/include/dspbridge/io_sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,17 @@ extern void io_dpc(unsigned long ref_data);
/*
* ======== io_mbox_msg ========
* Purpose:
* Main interrupt handler for the shared memory Bridge channel manager.
* Calls the Bridge's chnlsm_isr to determine if this interrupt is ours,
* then schedules a DPC to dispatch I/O.
* Main message handler for the shared memory Bridge channel manager.
* Determine if this message is ours, then schedules a DPC to
* dispatch I/O.
* Parameters:
* ref_data: Pointer to the channel manager object for this board.
* Set in an initial call to ISR_Install().
* self: Pointer to its own notifier_block struct.
* len: Length of message.
* msg: Message code received.
* Returns:
* TRUE if interrupt handled; FALSE otherwise.
* Requires:
* Must be in locked memory if executing in kernel mode.
* Must only call functions which are in locked memory if Kernel mode.
* Must only call asynchronous services.
* Interrupts are disabled and EOI for this interrupt has been sent.
* Ensures:
* NOTIFY_OK if handled; NOTIFY_BAD otherwise.
*/
void io_mbox_msg(u32 msg);
int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg);

/*
* ======== io_request_chnl ========
Expand Down

0 comments on commit 85d139c

Please sign in to comment.