From patchwork Tue Mar 30 08:56:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 413144 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76736C433E0 for ; Tue, 30 Mar 2021 08:58:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BF8F61959 for ; Tue, 30 Mar 2021 08:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231629AbhC3I5c (ORCPT ); Tue, 30 Mar 2021 04:57:32 -0400 Received: from www.zeus03.de ([194.117.254.33]:42638 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbhC3I5N (ORCPT ); Tue, 30 Mar 2021 04:57:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=qEj0gd9b5dP6yH2NCFYOIYkYymz 6y2EV8e9qLz0MKYY=; b=S/GGt3/TbG73K7KvnKHZf/c5gwy6sus4pgmcYRp8/fU HkQzwxvl2+jhIu3xbqOhZLELIBZJwzs+ryRS77popBDEi9+w9LkEDg9fa8l7sjna PZxs90ECJWp8bdLWEKw0GgZ4QNxNYryADKbUKtWDeMfdywtUzgD5mG+nyyLoWfjQ = Received: (qmail 144548 invoked from network); 30 Mar 2021 10:57:11 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 30 Mar 2021 10:57:11 +0200 X-UD-Smtp-Session: l3s3148p1@scjjLr2+htMgARa4RV5TAXqFgB02ZUaY From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, Wolfram Sang Subject: [PATCH RFC/RFT 0/1] add simple logic analyzer using polling Date: Tue, 30 Mar 2021 10:56:54 +0200 Message-Id: <20210330085655.12615-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Okay, this one is maybe a bit brave, let's see if it is suitable for upstream. This is an in-kernel logic analyzer based on GPIO polling with local irqs disabled. Besides the driver, there is a script which isolates a CPU to get towards the best possible result. I am aware of the latency limitations. However, the intention is only for debugging. Especially for remote debugging and to get a first impression, this has already been useful. So, I wonder if we want to provide this for others, too, and have it in Linus' tree. Documentation is within the patch, to get a better idea what this is all about. A branch with preparation for the Renesas Salvator-XS boards is here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/gpio-logic-analyzer The documentation is also available online on the elinux wiki: https://elinux.org/Kernel_GPIO_Logic_analyzer Looking forward to comments. If somebody has a pointer how to detect if a task was requested to be killed (while irqs and preemption are disabled), I'd appreciate that to avoid the currently unkillable sub-process. All the best, Wolfram Wolfram Sang (1): misc: add simple logic analyzer using polling .../dev-tools/gpio-logic-analyzer.rst | 63 ++++ Documentation/dev-tools/index.rst | 1 + .../bindings/misc/gpio-logic-analyzer.yaml | 40 ++ drivers/misc/Kconfig | 12 + drivers/misc/Makefile | 1 + drivers/misc/gpio-logic-analyzer.c | 355 ++++++++++++++++++ tools/debugging/gpio-logic-analyzer | 156 ++++++++ 7 files changed, 628 insertions(+) create mode 100644 Documentation/dev-tools/gpio-logic-analyzer.rst create mode 100644 Documentation/devicetree/bindings/misc/gpio-logic-analyzer.yaml create mode 100644 drivers/misc/gpio-logic-analyzer.c create mode 100755 tools/debugging/gpio-logic-analyzer