Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp899021imu; Tue, 11 Dec 2018 09:15:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/Upba8vX1GFMz2sqwHrDMUtzeKqz4ONqn6LpSYH88nDoTNRdJtUABNPvzR+vUi2rX5cHXFW X-Received: by 2002:a62:1112:: with SMTP id z18mr16868485pfi.173.1544548510400; Tue, 11 Dec 2018 09:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548510; cv=none; d=google.com; s=arc-20160816; b=LikfIsMuLiuIrvRJc3o3Mro6mJxppK0vpow1/RyikkSsdXJIi1tVfVO0APMhC7fcTY U9OEnGCYPKiUopoZVHuikFphg3fIoHaHliKC72sldG/I/GCTN7rCdVWQ0IBK9t/mxuHE XczuPPiVHw8rCuaKNMW7SjwBamZthKkUBX9PYejWAoTkDYiaIJNIvDXf/duUmZmtDMOT DuXPc8Jqbr2B3iY2SbDEvuj/xGI4VkAOE5UICxnImz7/pkNVVBiGCz5bvafqu9qwkT6E K4zzafw/6JkZXOSAEaU+nLcaKQRo1Vp0JPn49Ub1Vm6OiWB+mZPDR7xYm3lz0m1xn7fa NsCA== 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=Z67cECj/N8A+GztAxrBX6BJXkk6pkF30/HSeWqeZTVE=; b=k2Wu9Uy1cPTxpm4k1bw7NgjyABiK9xeAJWhZ1mjeWFOC/5/3IW32t+6qafuYJOGbNq R5urLmjMvW7j90k6ixDuNJpAJD0bXANepRgx/yDTWFwZHqoy6dS++gdTp9QD20lfwd/u 0+beUtr3YYjDlveM+3Uaj71iJ1iYRhQkPHzkMJ04n51Ury02SXg/w6t486i+2OBY7EV0 Fxn8mGWTPKi+uQIq3JV1Eu8Vwd+Z28HjAh4u7AVR6ra2VSjym1reWKRvJZGTrk+7GDsy nsnrIlI/kugtikJdEqDKZOYu8rgUtsqPNP25xNSvfTIVsSaIrrIGYXR29CilmgS0Qipa MaKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=l0ds9tv2; 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 x1si12926442pfn.111.2018.12.11.09.14.55; Tue, 11 Dec 2018 09:15:10 -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=l0ds9tv2; 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 S1727213AbeLKPjH (ORCPT + 99 others); Tue, 11 Dec 2018 10:39:07 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:44076 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726499AbeLKPjG (ORCPT ); Tue, 11 Dec 2018 10:39:06 -0500 Received: by mail-io1-f68.google.com with SMTP id r200so12090269iod.11 for ; Tue, 11 Dec 2018 07:39:06 -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=Z67cECj/N8A+GztAxrBX6BJXkk6pkF30/HSeWqeZTVE=; b=l0ds9tv2UKGL66zlj+teDMfqrbzMa5ePyPCexFJ0WTgtQZ5aEjcsxMGrV4pxc828KK IPoMU1tGgkQ+UZA2wqOL8eFwzxIO/xvzLmSqQ3FFCRMl9lBTsOLP1xWYfomgriLvp5dR EI03HaLsbZYwvztBvR05g4cXSg9y9XiAjJVKtWHQBxXrYae7z+TKkYEbN3ecZ5cvcqh1 MoaB8k43/Adrf5fVlpCZ8bSAXpiDJVofaGpIOn/a5FLzi5tYjsh6BZfM/DrQzholH2Fq YnpUboCEJ0OszBFlD5wBUrHak+4O9z7NynabNU3NQbyR/g1akCRC41X8HR0YfJcwKNI7 xJLQ== 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=Z67cECj/N8A+GztAxrBX6BJXkk6pkF30/HSeWqeZTVE=; b=gI6hBUZhxZoXieEsBJ+5UWODNMrl/QsT/wAHS0/pPbId1bHZHKIVgzVHJGsdUTRNl5 0OroqZprW77AhmekVhQx+h1UEuWzg79FLQIDxrWZ0aMuOrvwlY7hzLTgwdTZolDHMhhK UFCQ7O4Cys8q1a8OyqnsYHNCV4rh5dS0aB1G7b4+8PFiHMtziB9wqtk2lqJYwO6nStrN Soy9rBjsaKIBw+UYfYDFCpT/wqH+I9zk7fd5tYXZ/T04ufZi7iTxv/7KwadskRCPWZ95 rHgbAWamg5Lf8esbHCscc6yaZmyQ6czENyvhgaGxMXiPCwYaWZ4vq5VhNJ3eA5XG2eXU lYPg== X-Gm-Message-State: AA+aEWaG3bPcY07xFUdFrWwg4KmbZT2qobSKxAyUfoXYdd15NiLGFTE5 deynA+i7LOmntlhhEEcNCW8wTHKhZkZlgKg8GoC22g== X-Received: by 2002:a5d:9298:: with SMTP id s24mr14555922iom.111.1544542745437; Tue, 11 Dec 2018 07:39:05 -0800 (PST) MIME-Version: 1.0 References: <20181120134032.31645-1-brgl@bgdev.pl> <20181120134032.31645-3-brgl@bgdev.pl> <20181203110916.eseh2udxvhi4lf3v@pengutronix.de> <20181211141509.6x74jlzipj6o2exh@pengutronix.de> In-Reply-To: <20181211141509.6x74jlzipj6o2exh@pengutronix.de> From: Bartosz Golaszewski Date: Tue, 11 Dec 2018 16:38:54 +0100 Message-ID: Subject: Re: [PATCH 2/2] gpio: mockup: use irq_sim_fire_edge() To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Thomas Gleixner , Linus Walleij , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski 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., 11 gru 2018 o 15:15 Uwe Kleine-K=C3=B6nig napisa=C5=82(a): > > Hello Bartosz, > > On Mon, Dec 03, 2018 at 12:09:16PM +0100, Uwe Kleine-K=C3=B6nig wrote: > > On Tue, Nov 20, 2018 at 02:40:32PM +0100, Bartosz Golaszewski wrote: > > > @@ -213,7 +213,8 @@ static ssize_t gpio_mockup_event_write(struct fil= e *file, > > > chip =3D priv->chip; > > > > > > gpiod_set_value_cansleep(desc, val); > > > - irq_sim_fire(&chip->irqsim, priv->offset); > > > + edge =3D val =3D=3D 0 ? IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RIS= ING; > > > + irq_sim_fire_edge(&chip->irqsim, priv->offset, edge); > > > > If I write 0 twice into the debugfs file, does it fire two irqs or only > > one? I think it fires two but only one would be the right behaviour?! > > If you still think that patch 1 of this series is the way to go, I think > this objection is still valid. Then you need to check the state of the > line by at least calling (something like) .get_value to determine if the > previous value was different. > Hi Uwe, I've already started working on a series improving the entire concept. I've taken some of your suggestions into account. Since we're already at rc-6 I'd like to get those upstream despite there being some disagreements to keep the userspace intact. For now it will generate two falling edge interrupts when you write 0 twice= . Bart