[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220524145540.363553-1-jassisinghbrar@gmail.com>
Date: Tue, 24 May 2022 09:55:40 -0500
From: jassisinghbrar@...il.com
To: Hector Martin <marcan@...can.st>
Cc: Jassi Brar <jassisinghbrar@...il.com>,
Anup Patel <anup.patel@...adcom.com>,
Vinod Koul <vkoul@...nel.org>, Sven Peter <sven@...npeter.dev>,
Alyssa Rosenzweig <alyssa@...enzweig.io>,
Mun Yew Tham <mun.yew.tham@...el.com>,
Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Michal Simek <michal.simek@...inx.com>,
Arnd Bergmann <arnd@...db.de>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev
Subject: Re: [PATCH 0/7] mailbox: apple: peek_data cleanup and implementation
From: Jassi Brar <jassisinghbrar@...il.com>
Hi,
> The mailbox API has a `peek_data` operation. Its intent and
> documentation is rather ambiguous; at first glance and based on the
> name, it seems like it should only check for whether data is currently
> pending in the controller, without actually delivering it to the
> consumer. However, this interpretation is not useful for anything: the
> function can be called from atomic context, but without a way to
> actually *poll* for data from atomic context, there is no use in just
> checking for whether data is available.
>
Not exactly... the 'peek_data' is a means for client driver to hint the
controller driver that some data might have arrived (for controllers that
don't have anything like RX-Irq). The controller is then expected to dispatch
data after "not necessarily atomic" read.
For example, a quick look at some bit may tell there is data available,
but actually reading the data from buffer may be non-atomic.
In your case, you could already implement the patch-7/7 by simply calling it
peek_data() instead of poll_data(). Its ok to call mbox_chan_received_data()
from peek_data() because your data-read can be atomic.
Also some platforms may not have users of peek_data upstream (yet), so
simply weeding them out may not be right.
thanks.
Powered by blists - more mailing lists