From: Kent Gibson <warthog618@gmail.com>
To: linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com
Cc: Kent Gibson <warthog618@gmail.com>
Subject: [libgpiod][PATCH 0/2] fix potential discarding of events by read events
Date: Sat, 12 Sep 2020 10:22:46 +0800 [thread overview]
Message-ID: <20200912022248.16240-1-warthog618@gmail.com> (raw)
This patch set addresses a bug where reading events can quietly discard
events. The problem occurs any time a request made is for a number of
events that differs from the number available at the time - a number
that userspace is unaware of.
The problem is due to the read multiple always reading up to 16 events
from the kernel - independent of how many events have been requested.
The problem applies to reading both single and multiple events, as the
single event read implementation wraps the multiple.
The first patch extends test coverage to highlight the problem.
The second fixes the bug.
Kent Gibson (2):
tests: event: reading test coverage extended to cover reading a subset
of available events
core: fix reading subset of available events
lib/core.c | 5 +-
tests/tests-event.c | 144 ++++++++++++++++++++++++++++++++++++++------
2 files changed, 128 insertions(+), 21 deletions(-)
base-commit: fc61e740fcbe3c6594295766759888c96c45bd29
--
2.28.0
next reply other threads:[~2020-09-12 2:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-12 2:22 Kent Gibson [this message]
2020-09-12 2:22 ` [libgpiod][PATCH 1/2] tests: event: reading test coverage extended to cover reading a subset of available events Kent Gibson
2020-09-12 3:54 ` Kent Gibson
2020-09-12 2:22 ` [libgpiod][PATCH 2/2] core: fix reading " Kent Gibson
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=20200912022248.16240-1-warthog618@gmail.com \
--to=warthog618@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=linux-gpio@vger.kernel.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).