From: frowand.list@gmail.com To: Rob Herring <robh+dt@kernel.org>, Geert Uytterhoeven <geert+renesas@glider.be>, pantelis.antoniou@konsulko.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alan Tull <atull@kernel.org> Subject: [PATCH v2 0/2] of: unittest: add overlay gpio test to catch gpio hog problem Date: Thu, 20 Feb 2020 12:40:19 -0600 Message-ID: <1582224021-12827-1-git-send-email-frowand.list@gmail.com> (raw) From: Frank Rowand <frank.rowand@sony.com> Geert reports that gpio hog nodes are not properly processed when the gpio hog node is added via an overlay reply and provides an patch to fix the problem [1]. Add a unittest that shows the problem. Unittest will report "1 failed" test before applying Geert's patch and "0 failed" after applying Geert's 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. Some tests in the devicetree unittests result in printk messages from the code being tested. It can be difficult to determine whether the messages are the result of unittest or are potentially reporting bugs that should be fixed. The most recent example of a person asking whether to be concerned about these messages is [2]. Patch 2 adds annotations for all messages triggered by unittests, except KERN_DEBUG messages. (KERN_DEBUG is a special case due to the possible interaction of CONFIG_DYNAMIC_DEBUG.) 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 https://github.com/frowand/dt_tools The format of the annotations is expected to change when unittests are converted to use the kunit infrastructure when the broader testing community has an opportunity to discuss the implementation of annotations of test triggered messages. [1] https://lore.kernel.org/r/20200220130149.26283-1-geert+renesas@glider.be [2] https://lore.kernel.org/r/6021ac63-b5e0-ed3d-f964-7c6ef579cd68@huawei.com 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 | 628 ++++++++++++++++++++++++-- 8 files changed, 715 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 <frank.rowand@sony.com>
next reply index Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-20 18:40 frowand.list [this message] 2020-02-20 18:40 ` [PATCH v2 1/2] " frowand.list 2020-02-26 16:42 ` Rob Herring 2020-03-13 16:40 ` Frank Rowand 2020-03-16 8:45 ` Anders Roxell 2020-03-26 1:56 ` Frank Rowand 2020-03-26 10:39 ` Anders Roxell 2020-03-26 15:33 ` Frank Rowand 2020-04-08 12:27 ` Anders Roxell 2020-02-20 18:40 ` [PATCH v2 2/2] of: unittest: annotate warnings triggered by unittest frowand.list 2020-02-26 16:42 ` Rob Herring
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=1582224021-12827-1-git-send-email-frowand.list@gmail.com \ --to=frowand.list@gmail.com \ --cc=atull@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=geert+renesas@glider.be \ --cc=linux-kernel@vger.kernel.org \ --cc=pantelis.antoniou@konsulko.com \ --cc=robh+dt@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
Linux-Devicetree Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-devicetree/0 linux-devicetree/git/0.git git clone --mirror https://lore.kernel.org/linux-devicetree/1 linux-devicetree/git/1.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-devicetree linux-devicetree/ https://lore.kernel.org/linux-devicetree \ devicetree@vger.kernel.org public-inbox-index linux-devicetree Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-devicetree AGPL code for this site: git clone https://public-inbox.org/public-inbox.git