Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3711251imj; Tue, 12 Feb 2019 03:26:06 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibweb1kb+fSkJcu7q+o1Du1wGNHthp4sVtZ4dzxvGa2AfswmEB2Ut+lYhgSRBORgkRaWhZo X-Received: by 2002:a17:902:e78e:: with SMTP id cp14mr3560970plb.4.1549970766005; Tue, 12 Feb 2019 03:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549970765; cv=none; d=google.com; s=arc-20160816; b=xXvQk3BEPSgJrjRU7vQ/5b+FsPthIC/4LWKEkOBg9KgcLqgQ1z+iAhpAusk1MiN9jp Q9LB8xxfk4pkEO3RF2cBKGtIX8TmbDHceTvqi9CE3CNPFij9LtPn+brQM9HNu/xiUTXy gGNvCR1juyhVWJO/EsFUB2cuRccbWy3KPD9B8ZI8XR7yrB5Hb0uZ/tHxzUTx8j0zphek 6xdrK/rv5oOsXr12fp7Lry/gkx1CKTT9YFnnQqYUnVNQ0FQ5Lmk2qVcBJd6ReuWn5CfB 4vZI6/KqFMLgacAF2eQUw3+8tuLoHf9Kop26RBvBaajwxYFtxyatzcC5u/q1nXw5dYp9 +CDg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=T8dK2KMpZ8QSiNr+8g35NywCf/tdgQPftRQJOvlPkto=; b=0gYnmeL+AzkYUa2MxlhM7exWkqaYDa5/r/6bZlPaVosFF85/9I7bk8b090vWyqM6z3 D7OBI6spskSk2iF9Gu3/ys0pGPp4E9O++jOQmw/6HfmeQl5VWGWQ+unZcQoYuplz9eCJ e3o7aEQkbBA78qf2RhbpCtrXP/Qpy95CZFXWbHmYK9GU1F6QvxGm3nTEoBfZsF6shgJR OANE6nSKKogn33AArXMhjQxOOgB5JwSAmAhXL4SIs4GdR0amTxmKelmExnq/ODAOGxBX m49mG6uVJyGnVay9c7EGEzs29b42aI3ZXsXhej7nL7Z516XYxn9VmuP2jkMujfxfOttB tEPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=M4gVzWxo; 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 c24si1038006pgk.269.2019.02.12.03.25.50; Tue, 12 Feb 2019 03:26:05 -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; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=M4gVzWxo; 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 S1729271AbfBLLKM (ORCPT + 99 others); Tue, 12 Feb 2019 06:10:12 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:37530 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729255AbfBLLKL (ORCPT ); Tue, 12 Feb 2019 06:10:11 -0500 Received: by mail-it1-f195.google.com with SMTP id b5so6536552iti.2 for ; Tue, 12 Feb 2019 03:10:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=T8dK2KMpZ8QSiNr+8g35NywCf/tdgQPftRQJOvlPkto=; b=M4gVzWxo4dfkMF0LfmbG7U0Nego/6ppoMxFP0JT5NFRNAetg0qh3GydBlYmdwD+Wsf IRrZEatHR1A++97mxwAz2yV7P6n8mzYsNi8vVt+MLD6HVjSczCPkyLggl6qMChV7X9jl xmPfwFpU8+b5vzWAC9/DC7w3JlQB+9GdQxIRKsD4OQDoszp2HAnS6MTQ+sorpCoEnrBy fEyeIl+lZJ2J8bSKQltTqJsBmeHeQ/LNjTm/vipI1rz5HulngT5sVM8Z7x0bxs7hyInj jP9bR5hY6ztNv4lmZBefahoS6FgdtrcqIO7eoWBOI3oe9qY5LlsFcvrtbm2lcUC3mfwv dcHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=T8dK2KMpZ8QSiNr+8g35NywCf/tdgQPftRQJOvlPkto=; b=fCoK8es1geZEwoyzrkzKBumDcDqoYO9OOSv7O25aBMUvAX9G+5SCM26hQ4hlREOckF FDb7ZFFEG1Q/M9sLZyoSfr1YE0krkP6mtPcmTIzOHnGdu4SgC54vIcqHIaTTCJHJ6De0 du3LNNg6AyLo4dr43uNzGp3MmKgYkBZ9Xi1hYHSGb1IKK/jMuhh/EXUTJDWmVAoKdoUg YCH8PsHFEOluukmKeL52+gq8onhbtj8JNHUQhwvMQOVcKtbzcEdQfOhirDHCW866DNqg FKRw//LHg4R2TbcdapnaBRGykAfrFPGuvSW5OjMV6NpBTLjANIYx2EYH+H9jyBbVo3qr HCHA== X-Gm-Message-State: AHQUAubnkCO6QS4liaXRm0L9Jn2i/0yOjfkazqV+qgMUBC31OvwJPvPJ 87yqNFIHR9cVk4AAJYUKJBJ69Cf1D3MDFfYpA1wYIg== X-Received: by 2002:a5d:88d3:: with SMTP id i19mr1780591iol.187.1549969810428; Tue, 12 Feb 2019 03:10:10 -0800 (PST) MIME-Version: 1.0 References: <20190129084411.30495-1-brgl@bgdev.pl> <20190129084411.30495-4-brgl@bgdev.pl> <656763ec-41b9-cdee-22bd-1f32d74473a0@arm.com> <20190212110501.wd7ks7vms7pi63dk@pengutronix.de> In-Reply-To: <20190212110501.wd7ks7vms7pi63dk@pengutronix.de> From: Bartosz Golaszewski Date: Tue, 12 Feb 2019 12:09:59 +0100 Message-ID: Subject: Re: [PATCH v2 3/9] irq/irq_sim: provide irq_sim_fire_type() To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Marc Zyngier , Bartosz Golaszewski , Linus Walleij , Thomas Gleixner , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wt., 12 lut 2019 o 12:05 Uwe Kleine-K=C3=B6nig napisa=C5=82(a): > > On Tue, Feb 12, 2019 at 10:27:54AM +0000, Marc Zyngier wrote: > > On 12/02/2019 09:19, Bartosz Golaszewski wrote: > > > When userspace wants to monitor GPIO line interrupts, the GPIO > > > framework requests a threaded interrupt with IRQF_TRIGGER_FALLING, > > > IRQF_TRIGGER_RISING or both. The testing module tries to act like rea= l > > > hardware and so if we pass only one of the *_TRIGGER_* flags, we want > > > the simulated interrupt of corresponding type to be fired. > > > > Well, that's not how HW works. > > I cannot follow. I agree with Bartosz here. If you configure your SoC's > irq-controller to only fire on a raising edge, you don't get an event > when the line falls. > > > > Another solution - if you don't like this one - would be to have mor= e > > > specialized functions: irq_sim_fire_rising() and > > > irq_sim_fire_falling(). How about that? > > > > I think you're missing the point. So far, your API has been "an > > interrupt has fired", no matter what the trigger is, and that's fine. > > That's just modeling the output of an abstract interrupt controller int= o > > whatever the irqsim is simulating. > > > > Now, what you're exposing is "this is how the line changed". Which is a= n > > entirely different business, as you're now exposing the device output > > line. Yes, you can model it with raising/falling, but you need at least > > resampling for level interrupts, and actual edge detection (raising > > followed by raising only generates a single interrupt, while > > raising-falling-raising generates two). > > This matches my concern and that's why I suggested somewhere else in > this thread to put the configuration of the sensitiveness and the actual > tracking of the line in the same component (either irqsim or > gpio-mockup). Given that there are only two irqsim users and the other > one (something in iio) doesn't need that sensitiveness stuff (and I > cannot imagine another user of irqsim with the sensitiveness support) I > think it is best to move this to the mockup driver. That's how "normal" > hardware drivers have to do it, too. > This is what v1 of this series did - it provided a function to retrieve the type and the logic lived in gpio-mockup. Maybe we need to get back to that solution. Bart