[lkml]   [2020]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[RFC PATCH 0/2] of: unittest: add overlay gpio test to catch gpio hog problem
From: Frank Rowand <>

Geert reports that gpio hog nodes are not properly processed when
the gpio hog node is added via an overlay reply and provides an
RFC patch to fix the problem [1].

Add a unittest that shows the problem. Unittest will report "1 failed"
test before applying Geert's RFC patch and "0 failed" after applying
Geert's RFC patch.

I did not have a development system for which it would be easy to
experiment with applying an overlay containing a gpio hog, so I
instead created this unittest that uses a fake gpio node.

This series is a work in progress and I have not properly reviewed
it yet myself. The work behind the series has resulted in my
following several paths and distractions, resulting in more delay
than I would desire in continuing to review Geert's RFC patches.
I am thus releasing these patches as an RFC so that my work
behind the review is visible and available for Geert and other
reviewers of his patch.

The annotations added in patch 2/2 add a small amount of verbosity
to the console output. I have created a proof of concept tool to
explore (1) how test harnesses could use the annotations and
(2) how to make the resulting console output easier to read and
understand as a human being. The tool 'of_unittest_expect' is
available at


Frank Rowand (2):
of: unittest: add overlay gpio test to catch gpio hog problem
of: unittest: annotate warnings triggered by unittest

drivers/of/unittest-data/Makefile | 8 +-
drivers/of/unittest-data/overlay_gpio_01.dts | 23 +
drivers/of/unittest-data/overlay_gpio_02a.dts | 16 +
drivers/of/unittest-data/overlay_gpio_02b.dts | 16 +
drivers/of/unittest-data/overlay_gpio_03.dts | 23 +
drivers/of/unittest-data/overlay_gpio_04a.dts | 16 +
drivers/of/unittest-data/overlay_gpio_04b.dts | 16 +
drivers/of/unittest.c | 632 ++++++++++++++++++++++++--
8 files changed, 719 insertions(+), 31 deletions(-)
create mode 100644 drivers/of/unittest-data/overlay_gpio_01.dts
create mode 100644 drivers/of/unittest-data/overlay_gpio_02a.dts
create mode 100644 drivers/of/unittest-data/overlay_gpio_02b.dts
create mode 100644 drivers/of/unittest-data/overlay_gpio_03.dts
create mode 100644 drivers/of/unittest-data/overlay_gpio_04a.dts
create mode 100644 drivers/of/unittest-data/overlay_gpio_04b.dts

Frank Rowand <>

 \ /
  Last update: 2020-01-15 07:48    [W:0.114 / U:4.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site