From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: "Jassi Brar"
<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Vincent Yang"
<vincent.yang.fujitsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Devicetree List"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"Olof Johansson" <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Paweł Moll" <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
"Mark Rutland" <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org"
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
"Kumar Gala" <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"Sudeep Holla" <sudeep.holla-5wv7dgnIgG8@public.gmane.org>,
"Andy Green" <andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Patch Tracking"
<patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Vincent Yang"
<Vincent.Yang-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>,
"Tetsuya Nuriya"
<nuriya.tetsuya-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
Subject: Re: [PATCH v5 2/7] mailbox: arm_mhu: add driver for ARM MHU controller
Date: Wed, 4 Feb 2015 15:09:57 +0000 [thread overview]
Message-ID: <20150204150957.GH8656@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4418090.U8XOXMKsEU@wuerfel>
On Wed, Feb 04, 2015 at 11:29:55AM +0100, Arnd Bergmann wrote:
> On Wednesday 04 February 2015 08:57:43 Jassi Brar wrote:
> > On 3 February 2015 at 20:55, Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> > > On Tuesday 03 February 2015 14:46:11 Russell King - ARM Linux wrote:
> > >> On Tue, Feb 03, 2015 at 08:09:34PM +0530, Jassi Brar wrote:
>
> > > I had expected to see here something like:
> > >
> > > static int mhu_send_data(struct mbox_chan *chan, void *data)
> > > {
> > > struct mhu_link *mlink = chan->con_priv;
> > > u32 *arg = data;
> > >
> > > writel_relaxed(*arg, mlink->tx_reg + INTR_SET_OFS);
> > > }
> > >
> > > i.e. dereferencing the pointer instead of using the actual value.
> > >
> > OK, just curious how is this (dereferencing to the u32 variable on
> > stack of the client driver) better?
>
> The API as I understand is defined to use the pointer to point to
> a chunk of data of fixed size, with the size being known to both
> the client driver and the mailbox driver. This is the reason for
> having a pointer in the first place.
>
> Using the bits of the pointer as the message instead of pointing
> to the message feels like an abuse of the API.
I agree on those two points. However, passing the address of something
on the stack to mbox_send_message() is also not particularly on - it
may save the pointer to use later on if its operating on non-blocking
mode.
A possible alternative would be if the user of mbox_send_message()
stored the message in an array, operated as a circular buffer, and
passed the address of the word to send. That would avoid the need
to repeatedly allocate and free memory (which would be expensive for
the sake of a u32.)
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-02-04 15:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 9:21 [PATCH v5 0/7] Support for Fujitsu MB86S7X SoCs Vincent Yang
[not found] ` <1422955310-6542-1-git-send-email-Vincent.Yang-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>
2015-02-03 9:27 ` [PATCH v5 1/7] ARM: Add platform support " Vincent Yang
2015-02-03 9:29 ` [PATCH v5 2/7] mailbox: arm_mhu: add driver for ARM MHU controller Vincent Yang
[not found] ` <1422955763-6630-1-git-send-email-Vincent.Yang-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>
2015-02-03 12:32 ` Russell King - ARM Linux
[not found] ` <20150203123216.GO8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-02-03 14:39 ` Jassi Brar
[not found] ` <CAJe_ZhdL6=4bMPRitFeCqrO2jeYQuDa9071estTBd3PTbmURYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-03 14:46 ` Russell King - ARM Linux
[not found] ` <20150203144611.GS8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-02-03 15:25 ` Arnd Bergmann
2015-02-04 3:27 ` Jassi Brar
[not found] ` <CAJe_Zhfyr9ts=k_=kyXqC=aGtQdrq9MtrRXt6LQKR7iofKjqKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-04 10:29 ` Arnd Bergmann
2015-02-04 14:34 ` Jassi Brar
[not found] ` <CAJe_Zhe_d-H10J8cH-fxcbusoJV8jMUW-pruXVkEKY7PnLMGFA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-04 14:48 ` Arnd Bergmann
2015-02-04 15:33 ` Jassi Brar
[not found] ` <CAJe_ZhceTfWnSWmR+_T+G-BM00hAhTbn5OGwNiOZQFxy6f5QSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-04 16:42 ` Arnd Bergmann
2015-02-05 5:08 ` Jassi Brar
[not found] ` <CAJe_ZhcXR4oaBKZx3n0ckCzXgbREoezUXjizJ09QXQVqEQ3G_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-05 11:43 ` Arnd Bergmann
2015-02-05 12:02 ` Jassi Brar
[not found] ` <CAJe_Zhf_WuRK2EE0Sj9ksXDDe5VA=DJ+H3eS4YRKpDZLdRRfow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-05 12:08 ` Russell King - ARM Linux
[not found] ` <20150205120829.GO8656-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-02-05 12:31 ` Arnd Bergmann
2015-02-05 14:50 ` Jassi Brar
2015-02-04 15:09 ` Russell King - ARM Linux [this message]
2015-02-03 9:31 ` [PATCH v5 4/7] clk: Add clock driver for mb86s7x Vincent Yang
2015-02-03 9:32 ` [PATCH v5 5/7] dt: mb86s7x: add dt files for MB86S7x evbs Vincent Yang
2015-02-03 9:34 ` [PATCH v5 6/7] of: add Fujitsu vendor prefix Vincent Yang
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=20150204150957.GH8656@n2100.arm.linux.org.uk \
--to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
--cc=Vincent.Yang-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org \
--cc=andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=nuriya.tetsuya-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
--cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
--cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sudeep.holla-5wv7dgnIgG8@public.gmane.org \
--cc=vincent.yang.fujitsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).