Esempio n. 1
0
static void __mbox_rx_interrupt(struct omap_mbox *mbox)
{
	struct omap_mbox_queue *mq = mbox->rxq;
	mbox_msg_t msg;
	int len;

	while (!mbox_fifo_empty(mbox)) {
		if (unlikely(kfifo_avail(&mq->fifo) < sizeof(msg))) {
			omap_mbox_disable_irq(mbox, IRQ_RX);
			mq->full = true;
			goto nomem;
		}

		msg = mbox_fifo_read(mbox);

		len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
		WARN_ON(len != sizeof(msg));

		if (mbox->ops->type == OMAP_MBOX_TYPE1)
			break;
	}

	/* no more messages in the fifo. clear IRQ source. */
	ack_mbox_irq(mbox, IRQ_RX);
nomem:
	schedule_work(&mbox->rxq->work);
}
Esempio n. 2
0
static void __mbox_rx_interrupt(struct omap_mbox *mbox)
{
    struct request *rq;
    mbox_msg_t msg;
    struct request_queue *q = mbox->rxq->queue;

    disable_mbox_irq(mbox, IRQ_RX);

    while (!mbox_fifo_empty(mbox)) {
        rq = blk_get_request(q, WRITE, GFP_ATOMIC);
        if (unlikely(!rq))
            goto nomem;

        msg = mbox_fifo_read(mbox);
        rq->data = (void *)msg;

        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, NULL);
        if (mbox->ops->type == OMAP_MBOX_TYPE1)
            break;
    }

    /* no more messages in the fifo. clear IRQ source. */
    ack_mbox_irq(mbox, IRQ_RX);
    enable_mbox_irq(mbox, IRQ_RX);
    nomem:
    schedule_work(&mbox->rxq->work);
}
Esempio n. 3
0
static void __mbox_rx_interrupt(struct omap_mbox *mbox)
{
	struct omap_mbox_queue *mq = mbox->rxq;
	mbox_msg_t msg;
	int len;

	while (!mbox_fifo_empty(mbox)) {
		if (unlikely(__kfifo_len(mq->fifo) >=
				FIFO_SIZE - sizeof(msg))) {
			omap_mbox_disable_irq(mbox, IRQ_RX);
			rq_full = true;
			goto nomem;
		}

		msg = mbox_fifo_read(mbox);

		len = __kfifo_put(mq->fifo, (unsigned char *)&msg, sizeof(msg));
		if (unlikely(len != sizeof(msg)))
			pr_err("%s: __kfifo_put anomaly detected\n", __func__);
		if (mbox->ops->type == OMAP_MBOX_TYPE1)
			break;
	}

	/* no more messages in the fifo. clear IRQ source. */
	ack_mbox_irq(mbox, IRQ_RX);
nomem:
	queue_work(mboxd, &mbox->rxq->work);
}
Esempio n. 4
0
static void __mbox_rx_interrupt(struct omap_mbox *mbox)
{
	struct request *rq;
	mbox_msg_t msg;
	struct request_queue *q = mbox->rxq->queue;

	while (!mbox_fifo_empty(mbox)) {
		rq = blk_get_request(q, WRITE, GFP_ATOMIC);
		if (unlikely(!rq))
			goto nomem;

		msg = mbox_fifo_read(mbox);


		blk_insert_request(q, rq, 0, (void *)msg);
		if (mbox->ops->type == OMAP_MBOX_TYPE1)
			break;
	}

	/* no more messages in the fifo. clear IRQ source. */
	ack_mbox_irq(mbox, IRQ_RX);
nomem:
	schedule_work(&mbox->rxq->work);
}
Esempio n. 5
0
/*
 * Mailbox interrupt handler
 */
static void __mbox_tx_interrupt(struct omap_mbox *mbox)
{
	omap_mbox_disable_irq(mbox, IRQ_TX);
	ack_mbox_irq(mbox, IRQ_TX);
	tasklet_schedule(&mbox->txq->tasklet);
}
Esempio n. 6
0
static void __mbox_tx_interrupt(struct omap_mbox *mbox)
{
    disable_mbox_irq(mbox, IRQ_TX);
    ack_mbox_irq(mbox, IRQ_TX);
    schedule_work(&mbox->txq->work);
}