linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: loic.pallardy@st.com (Loic PALLARDY)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/9] mailbox: create opened message type
Date: Fri, 21 Dec 2012 11:50:01 +0100	[thread overview]
Message-ID: <50D43ED9.4030906@st.com> (raw)
In-Reply-To: <B5906170F1614E41A8A28DE3B8D121433EC9CE7A@DBDE01.ent.ti.com>



On 12/21/2012 11:28 AM, Bedia, Vaibhav wrote:
> On Tue, Dec 18, 2012 at 18:40:07, Loic Pallardy wrote:

>> -	msg = mbox_read_reg(fifo->data);
>> -	msg |= ((mbox_msg_t) mbox_read_reg(fifo->cmd))<<  16;
>> +	msg->header = mbox_read_reg(fifo->data);
>> +	msg->header |= ((mbox_msg_t) mbox_read_reg(fifo->cmd))<<  16;
>
> Now that struct mailbox_msg encapsulates the data, you can
> get rid of the mbox_msg_t typedef completely. Having the data
> as part of the mailbox_msg along with the functions with mbox_msg_t
> as the return type just creates confusion IMHO.
>
OK I'll clean up mbox_msg_t typedef.
>>
>> -	return msg;
>> +	return 0;
>>   }
>
> Convert all return 0 functions to void?
>
> [...]
>
Yes, agree I'll change the prototype.
>>
>> +
>> +#define MAILBOX_FILL_HEADER_MSG(_msg, _header) \
>> +	MAILBOX_FILL_MSG(_msg, _header, NULL, 0);
>> +
>
> I used these patches as part of the suspend-resume support for AM335x
> which has the same mailbox IP as OMAP4. I used the MAILBOX_FILL_HEADER_MSG
> helper and things work as expected.

Nice.
>
> However, I found the 'header' part to be very confusing. Why not treat the
> OMAP case as a special case of the new MAILBOX_FILL_MSG where the data size
> is set to 1?

Yes it is another possibility. Changes are not big.
Omar, what's your view on this point?

Regards,
Loic
>
> Regards,
> Vaibhav

  reply	other threads:[~2012-12-21 10:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 13:10 [PATCH 0/9] drivers: mailbox: framework creation Loic Pallardy
2012-12-18 13:10 ` [PATCH 1/9] mailbox: OMAP: introduce mailbox framework Loic Pallardy
2012-12-18 16:59   ` Tony Lindgren
2012-12-21  8:54     ` Loic PALLARDY
2012-12-21 10:49       ` Bedia, Vaibhav
2012-12-21 10:53         ` Loic PALLARDY
2013-01-09 12:11           ` Bedia, Vaibhav
2013-01-09 12:29             ` Loic PALLARDY
2013-01-09 12:34               ` Bedia, Vaibhav
2013-01-11 13:34               ` Omar Ramirez Luna
2012-12-18 13:10 ` [PATCH 2/9] mailbox: split internal header from API header Loic Pallardy
2012-12-18 13:10 ` [PATCH 3/9] mailbox: rename omap_mbox in mailbox Loic Pallardy
2012-12-20 21:29   ` Ohad Ben-Cohen
2012-12-18 13:10 ` [PATCH 4/9] mailbox: create opened message type Loic Pallardy
2012-12-21 10:28   ` Bedia, Vaibhav
2012-12-21 10:50     ` Loic PALLARDY [this message]
2012-12-18 13:10 ` [PATCH 5/9] mailbox: change protection mechanisms Loic Pallardy
2012-12-21 10:28   ` Bedia, Vaibhav
2012-12-21 10:50     ` Loic PALLARDY
2012-12-18 13:10 ` [PATCH 6/9] mailbox: add shared memory mailbox type Loic Pallardy
2012-12-18 13:10 ` [PATCH 7/9] mailbox: add IRQF_NO_SUSPEND flag Loic Pallardy
2012-12-18 13:10 ` [PATCH 8/9] mailbox: add no_irq send message Loic Pallardy
2012-12-18 13:10 ` [PATCH 9/9] mailbox: create dbx500 mailbox driver Loic Pallardy
2012-12-20 18:16 ` [PATCH 0/9] drivers: mailbox: framework creation Linus Walleij
2012-12-20 18:28   ` Tony Lindgren
2012-12-20 19:19     ` Olof Johansson
2012-12-20 19:33       ` Tony Lindgren
2012-12-21  7:31       ` Ohad Ben-Cohen
2012-12-21  8:52         ` Loic PALLARDY
2012-12-21 19:33           ` Omar Ramirez Luna
2012-12-24 15:17             ` Ohad Ben-Cohen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D43ED9.4030906@st.com \
    --to=loic.pallardy@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).