Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp714338imu; Tue, 11 Dec 2018 06:29:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/WOtROhWXjQNH8vqbSTrfARkbZ2fqLYeT4erO6bwpQnk78rHQGwshP+A0of2cy0U5CyFvFy X-Received: by 2002:a62:c683:: with SMTP id x3mr16173234pfk.10.1544538594858; Tue, 11 Dec 2018 06:29:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544538594; cv=none; d=google.com; s=arc-20160816; b=LUyFGMu9PrJOjuIjuuQBgphTjo0LHNiL+Emh5/CnhGhRmpsAwqXFipnvicidyzm6vJ 2J1a4feL5rD0CF5/IRYn86ezSBrgRug3nQaCneX4QNaKNEcBY4RLStCh5gUWmTYrN8iW Mdagsswz8ZpKj3AYP5Y6EP0AA278oH2wq8aOywQzaRhb2amhVejAJrWJHOVP0qp+AmDZ LRmfmLW0SuPz1l2W5flsuKigukAxNOef4KGxqw2F8NyWhPQbKixPwXdgWiwe/cefr3cG rHJItZB4OOaJdiZ+DSURrkgSpGO0EG2HW4dGtppcFjFkomyzPJUvJGUZZhq5JNbaooep 4pww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=bRafLkGQo0uBiEfr6wSBd9oPSBZaNn4Td7cHcI1iwUQ=; b=rWm5j3RcndlphPGlqzpdG+B7TihXr6XM76QRbSlSLi7UW1BzVcsGwh5jGR3d8vhHve iBt+IKbxoTY0iQhDGxDvWG64B8TGvGd89BRkLoxHmOyYacIhO+YelzYfMDua9AUV0JW+ /IyZbdyYAANbKyNHckcsThw1pYgjXfhAZbLoSsml2EfPNLH4Ki8RZzLQkdff3eqvJHys ho3WPxOoBLoiUXgzjr8+Xd3q3xscIHLOt/SwCVuq0+hVhtuvCrdd2MfYNttkC1sQiPk8 v02V/zz0txxhAX/qLwGPV0CPJSHmc3PB6cNZr4a2B68gYnVFv55nElF0zOdS3SB08Jtf ZnvA== 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 u128si13654765pfc.133.2018.12.11.06.29.29; Tue, 11 Dec 2018 06:29: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 S1726671AbeLKOPN (ORCPT + 99 others); Tue, 11 Dec 2018 09:15:13 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51167 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726444AbeLKOPM (ORCPT ); Tue, 11 Dec 2018 09:15:12 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gWioY-0004mm-5d; Tue, 11 Dec 2018 15:15:10 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gWioX-0008EC-Fu; Tue, 11 Dec 2018 15:15:09 +0100 Date: Tue, 11 Dec 2018 15:15:09 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Bartosz Golaszewski Cc: Thomas Gleixner , Linus Walleij , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 2/2] gpio: mockup: use irq_sim_fire_edge() Message-ID: <20181211141509.6x74jlzipj6o2exh@pengutronix.de> References: <20181120134032.31645-1-brgl@bgdev.pl> <20181120134032.31645-3-brgl@bgdev.pl> <20181203110916.eseh2udxvhi4lf3v@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181203110916.eseh2udxvhi4lf3v@pengutronix.de> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Bartosz, On Mon, Dec 03, 2018 at 12:09:16PM +0100, Uwe Kleine-K?nig 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 file *file, > > chip = priv->chip; > > > > gpiod_set_value_cansleep(desc, val); > > - irq_sim_fire(&chip->irqsim, priv->offset); > > + edge = val == 0 ? IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING; > > + 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. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |