Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3130041imj; Mon, 11 Feb 2019 14:33:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IYdG9SECMXgfCGQs7OzsPbpJshggsM/T2EMko1UupJmrdfxJLoVndhh90JbFYZFbc7hLwrd X-Received: by 2002:a17:902:7592:: with SMTP id j18mr559994pll.289.1549924434084; Mon, 11 Feb 2019 14:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549924434; cv=none; d=google.com; s=arc-20160816; b=yKB7XgC8Jo/T58e1mHww8DAo/B/V75Sm6ojvIB+b622GMVA8YmrNZza0yOFoc8YSoG 1iWGklMPSB4JhLbPpR4YIdPGlpp8jvSFXapAOU6dp6yKnpjvOCK62HuEYK2f9s4HIRNF 02reD0KMQ4wNnJq5ATzngZpvzNLjqR60ytx+XWUNkv5U+4Z1cntqA7dZzGHt9Jhwn5jz xjm/elmcnL3vuI2Xt01f2eyOiic+hMtcGNOmst132o6dpzMKiYi2uYA+iXj1mz/pcImc 6EKCLNdpZ9Jksi+3+4VFbEsf3mWBVLx/qI4keNWarF48vnC3TEKrftfox82NNmWKuDWi aLOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=30oe9rJMvUlLsnQBxYE7j1p/q5LgAcpQeGAuQDqvd2E=; b=J9QbGryRxP3f7UMFZrUlGNIjXihxERO2ngqFsGrpnbevgJLgBMNtum7muX6Pdmn01f 2m7QAl5EuHeozE3V+bTDuJn1hmY6RxKy51Y/gh3BVCGcovwfu64s6iOtOPR2l248lP/s YFwjgGtD439rz6A0VfLMrV3X5ybRh1BUxjDzuYSy0lE1tJm01JCg736A28JvxiyX9GsT uwPRXQdTc7IpW5YcLCkTolkfrj1J/eumFrcc61shKoKuD0oFEcE/ppHjM8IknzrA0s0p 0zrV2Fy4fGAWZ+2fcbfT2N6PBXtLY6znnU8mg/92bMrBntKkQgurwJFP5dNpt18ByZPq FKDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si10996353plv.137.2019.02.11.14.33.38; Mon, 11 Feb 2019 14:33:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727376AbfBKWdU convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Feb 2019 17:33:20 -0500 Received: from foss.arm.com ([217.140.101.70]:57900 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbfBKWdU (ORCPT ); Mon, 11 Feb 2019 17:33:20 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3FA56EBD; Mon, 11 Feb 2019 14:33:19 -0800 (PST) Received: from why.wild-wind.fr.eu.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8EC873F675; Mon, 11 Feb 2019 14:33:17 -0800 (PST) Date: Mon, 11 Feb 2019 22:33:13 +0000 From: Marc Zyngier To: Bartosz Golaszewski Cc: Thomas Gleixner , "open list:GPIO SUBSYSTEM" , Linus Walleij , Linux Kernel Mailing List , Bartosz Golaszewski , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5p?= =?UTF-8?B?Zw==?= Subject: Re: [PATCH v2 0/9] gpio: mockup: improve the user-space testing interface Message-ID: <20190211223313.34f6c8be@why.wild-wind.fr.eu.org> In-Reply-To: References: <20190129084411.30495-1-brgl@bgdev.pl> Organization: ARM Ltd X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Feb 2019 11:23:46 +0100 Bartosz Golaszewski wrote: > wt., 29 sty 2019 o 09:44 Bartosz Golaszewski napisał(a): > > > > From: Bartosz Golaszewski > > > > This series aims at reworking the gpio-mockup debugfs interface. The > > reason for that is the fact that certain known problems with this > > testing module exist and the user-space tests are broken anyway > > after commit fa38869b0161 ("gpiolib: Don't support irq sharing > > for userspace") which made it impossible for gpio-mockup to ignore > > certain events (e.g. only receive notifications about rising edge > > events). > > > > The first three patches improve the interrupt simulator. The first one > > makes the struct irq_chip part of the irq_sim structure so that we can > > support multiple instances at once. The second delegates the irq number > > mapping to the irq domain subsystem. The third patch provides a helper > > that will allow users to specify the type of the fired interrupt so that > > the configuration set by the set_type() callback can be taken into account. > > > > Next six patches improve the gpio-mockup module. Patches 4-5 have been > > reviewed before but missed the last merge window. Patch 6 is there > > because we're already breaking the debugfs interface anyway and it > > removes a link that has no users. Patches 7-8 are minor tweaks. > > > > Last patch introduces a rework of the debugfs interface. With this > > change each mockup chip is represented by a directory named after the > > chip's device name under /gpio-mockup/. Each line > > is represented by a file using the line's offset as the name under the > > chip's directory. Reading from the line's file yields the current > > *value*, writing to the line's file changes the current "pull". Default > > pull for mockup lines is down. More info on that can be found in the > > comment added by this change to the gpio-mockup code. > > > > This is somewhat inspired by the idea of the gpio-simulator by > > Uwe Kleine-König except that I strongly belive that when testing > > certain user API code paths we should not be using the same paths for > > verification. That's why there's a separate interface (debugfs) sharing > > as little as possible with the character device that allows to check if > > various operations (reading and setting values, events) work as > > expected instead of two connected dummy chips sharing the same > > interface. > > > > If accepted this will of course require major modification of user-space > > tests in libgpiod once upstream. > > > > v1 -> v2: > > - instead of providing the irq_sim_get_type() helper, move the irq type > > logic into the simulator and provide a helper that allows users to specify > > the type of the fired interrupt > > > > Bartosz Golaszewski (9): > > irq/irq_sim: don't share the irq_chip structure between simulators > > irq/irq_sim: use irq domain > > irq/irq_sim: provide irq_sim_fire_type() > > gpio: mockup: add locking > > gpio: mockup: implement get_multiple() > > gpio: mockup: don't create the debugfs link named after the label > > gpio: mockup: change the type of 'offset' to unsigned int > > gpio: mockup: change the signature of unlocked get/set helpers > > gpio: mockup: rework debugfs interface > > > > drivers/gpio/gpio-mockup.c | 185 +++++++++++++++++++++++++++++++------ > > include/linux/irq_sim.h | 17 +++- > > kernel/irq/irq_sim.c | 126 ++++++++++++++++++------- > > 3 files changed, 263 insertions(+), 65 deletions(-) > > > > -- > > 2.19.1 > > > > Marc, Thomas, > > if there are no objections - could you please ack the three first > patches and let me take them through the GPIO tree? I would really > appreciate if we could have them in v5.1. There are certainly a number of questions that have to be answered before this can be merged. I can't find a rational for patch #1, and patch #2 looks like a set of misuse of APIs. At the very least, I'd like to see these questions answered, and the code in patch #2 fixed. Thanks, M. -- Without deviation from the norm, progress is not possible.