From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: David Lechner <david@lechnology.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
kamel.bouhara@bootlin.com, gwendal@chromium.org,
alexandre.belloni@bootlin.com, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com,
patrick.havelange@essensium.com, fabrice.gasnier@st.com,
mcoquelin.stm32@gmail.com, alexandre.torgue@st.com
Subject: Re: [PATCH v2 0/4] Introduce the Counter character device interface
Date: Tue, 2 Jun 2020 11:46:26 -0400 [thread overview]
Message-ID: <20200602154626.GA5082@shinobu> (raw)
In-Reply-To: <ac473c9a-f9cd-21ae-8f8f-d5181df2c134@lechnology.com>
[-- Attachment #1: Type: text/plain, Size: 2311 bytes --]
On Tue, Jun 02, 2020 at 10:18:07AM -0500, David Lechner wrote:
> On 5/31/20 12:14 PM, William Breathitt Gray wrote:
> > Yielding the following /dev/counter0 memory layout:
> >
> > +------------+-----------------+------------+-------------------+
> > | Byte 0 | Byte 1 - Byte 8 | Byte 9 | Byte 10 - Byte 17 |
> > +------------+-----------------+------------+-------------------+
> > | Boundary 0 | Count 0 | Boundary 1 | Count 1 |
> > +------------+-----------------+------------+-------------------+
>
> A potential pitfall with this sort of packing is that some platforms
> do not support unaligned access, so data would have to be "unpacked"
> before it could be used.
Since the user defines the format of this data, they could reorganize it
to a more streamline alignment; for example:
# echo "C0 C1 C0E0 C1E0" > counter0/chrdev_format
Yielding the following /dev/counter0 memory layout instead:
+-----------------+------------------+------------+------------+
| Byte 0 - Byte 7 | Byte 8 - Byte 15 | Byte 16 | Byte 17 |
+-----------------+------------------+------------+------------+
| Count 0 | Count 1 | Boundary 0 | Boundary 1 |
+-----------------+------------------+------------+------------+
In the future, we could also define a padding argument to give users
more control over the exact offsets:
# echo "C0E0 P7 C0 C1E0 P7 C1" > counter0/chrdev_format
Yielding the following /dev/counter0 memory layout instead:
+------------+-----------------+------------------+------------+
| Byte 0 | Byte 1 - Byte 7 | Byte 8 - Byte 15 | Byte 16 |
+------------+-----------------+------------------+------------+
| Boundary 0 | Padding | Count 0 | Boundary 1 |
+------------+-----------------+------------------+------------+
+-------------------+-------------------+
| Byte 17 - Byte 23 | Byte 24 - Byte 31 |
+-------------------+-------------------+
| Padding | Count 1 |
+-------------------+-------------------+
I not sure it's best to introduce padding support with this patchset
given how much is already changing, but I don't anticipate packing
alignment to be something difficult to support in the future with this
interface.
William Breathitt Gray
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2020-06-02 15:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-16 19:19 [PATCH v2 0/4] Introduce the Counter character device interface William Breathitt Gray
2020-05-16 19:20 ` [PATCH v2 2/4] docs: counter: Update to reflect sysfs internalization William Breathitt Gray
2020-05-24 16:12 ` Jonathan Cameron
2020-05-16 19:20 ` [PATCH v2 3/4] counter: Add character device interface William Breathitt Gray
2020-05-20 15:07 ` kbuild test robot
2020-05-16 19:20 ` [PATCH v2 4/4] docs: counter: Document " William Breathitt Gray
2020-05-24 16:19 ` Jonathan Cameron
2020-05-29 13:26 ` Pavel Machek
2020-05-31 13:31 ` William Breathitt Gray
2020-05-24 16:25 ` [PATCH v2 0/4] Introduce the Counter " Jonathan Cameron
2020-05-24 17:54 ` William Breathitt Gray
2020-05-31 15:18 ` Jonathan Cameron
2020-05-31 17:14 ` William Breathitt Gray
2020-06-01 10:31 ` Jonathan Cameron
2020-06-02 15:18 ` David Lechner
2020-06-02 15:46 ` William Breathitt Gray [this message]
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=20200602154626.GA5082@shinobu \
--to=vilhelm.gray@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@st.com \
--cc=david@lechnology.com \
--cc=fabrice.gasnier@st.com \
--cc=gwendal@chromium.org \
--cc=jic23@kernel.org \
--cc=kamel.bouhara@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=patrick.havelange@essensium.com \
--cc=syednwaris@gmail.com \
/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).