RE: [PATCH v3 4/4] omap: mailbox: convert block api to kfifo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Hiroshi DOYU [mailto:Hiroshi.DOYU@xxxxxxxxx]
> Sent: Tuesday, June 08, 2010 4:56 AM
> To: felipe.contreras@xxxxxxxxx
> Cc: Guzman Lugo, Fernando; ohad@xxxxxxxxxx; Chitriki Rudramuni, Deepak;
> Ramirez Luna, Omar; Kanigeri, Hari; linux-omap@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 4/4] omap: mailbox: convert block api to kfifo
> 
> From: ext Felipe Contreras <felipe.contreras@xxxxxxxxx>
> Subject: Re: [PATCH v3 4/4] omap: mailbox: convert block api to kfifo
> Date: Tue, 8 Jun 2010 11:43:28 +0200
> 
> > On Tue, Jun 8, 2010 at 6:46 AM, Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx>
> wrote:
> >> From: "ext Guzman Lugo, Fernando" <fernando.lugo@xxxxxx>
> >>> I think the best thing to do here is remove the spinlock, if not,
> >>> you are preventing that omap_mbox_msg_send be executed from a
> >>> tasklet or isr context. That maybe in this moment it is not called
> >>> but it could be needed in the future. The caller of
> >>> omap_mbox_msg_send should be take care of that function can not be
> >>> call simultaneously.
> >>
> >> What about adding another function, omap_mbox_msg_send_sync()?
> >
> > That's exactly what I was thinking about when I heard the problem.
> > Would this function send all the msgs already queued, and then wait
> > for the current one actually be sent?

A function like that could be helpful in some cases I think. Maybe and other one to flush (discard) all pending messages would be good too. So that I can clean the mailbox and would not be needed to do a mbox_put and mbox_get.

> 
> Could be as you said. I haven't thought that much.
> 
> What I just thought was to bypass kfifo and tasklet and to put a
> message directly to H/W fifo. Maily just for the above case which
> Fernando described above.
> 
> Fernando, what do you think on Felipes?

Why don't just bypass the tasklet? I think the kfifo is ok in order to not discard the message in case of full hw fifo. I was thinking in the omap_mbox_msg_send just check if we have messajes in the kfifo or if the hw fifo is full. If so, store the message en the kfifo and enable not full interrupt. Otherwise write the message to hw fifo.


	if (kfifo_len(&mq->fifo) || mbox_fifo_full(mbox)) {
		kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
		omap_mbox_enable_irq(mbox, IRQ_TX);
	} else
		mbox_fifo_write(mbox, msg);


and in the tx isr just send the messages store in the kfifo, reding the messages from the kfifo is very fast and at last we will be able to send 4 messages (most of the cases we will be able to send 1 message), which I think is even faster than just doing the tasklet schedule.


	while (kfifo_len(&mq->fifo) && !mbox_fifo_full(mbox)) {
		kfifo_out(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
		mbox_fifo_write(mbox, msg);
	}
	If (!mbox_fifo_full(mbox))
		omap_mbox_disable_irq(mbox, IRQ_TX);



Regards,
Fernando.


--
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


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux