All of lore.kernel.org
 help / color / mirror / Atom feed
* [libgpiod][PATCH v2 0/2] fix potential discarding of events by read events
@ 2020-09-12  8:11 Kent Gibson
  2020-09-12  8:11 ` [libgpiod][PATCH v2 1/2] tests: event: reading test coverage extended to cover reading a subset of available events Kent Gibson
  2020-09-12  8:11 ` [libgpiod][PATCH v2 2/2] core: fix reading " Kent Gibson
  0 siblings, 2 replies; 8+ messages in thread
From: Kent Gibson @ 2020-09-12  8:11 UTC (permalink / raw)
  To: linux-gpio, bgolaszewski; +Cc: Kent Gibson

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.

Changes for v2:
 - restored usleep() when creating multiple events in patch 1.

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 | 157 ++++++++++++++++++++++++++++++++++++++------
 2 files changed, 141 insertions(+), 21 deletions(-)


base-commit: fc61e740fcbe3c6594295766759888c96c45bd29
-- 
2.28.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-14 23:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-12  8:11 [libgpiod][PATCH v2 0/2] fix potential discarding of events by read events Kent Gibson
2020-09-12  8:11 ` [libgpiod][PATCH v2 1/2] tests: event: reading test coverage extended to cover reading a subset of available events Kent Gibson
2020-09-12  8:11 ` [libgpiod][PATCH v2 2/2] core: fix reading " Kent Gibson
2020-09-14  8:12   ` Bartosz Golaszewski
2020-09-14 15:16     ` Andy Shevchenko
2020-09-14 15:20       ` Bartosz Golaszewski
2020-09-14 15:22         ` Andy Shevchenko
2020-09-14 23:33       ` Kent Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.