Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp191428imu; Wed, 21 Nov 2018 17:58:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/XiUMafuA2XH0DbkxjYTS6Lv+5dSTd+WUAtcCYJ2Fh+82YNvwQ3nIpQkQ7w/9yjoszgDm1k X-Received: by 2002:a63:a064:: with SMTP id u36mr8263338pgn.145.1542851880743; Wed, 21 Nov 2018 17:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542851880; cv=none; d=google.com; s=arc-20160816; b=M8DcG4Xa31232ZVWwsvBNs5HI2X7NLqtJKUIlYQhvyQ07/JJITcDY/pOz4OaBoOMBF FFpSLQTEC8U/+cMLn5Ewe3s7buNvoiw6qX/TLi2aMgH4svRyt4triN+63HhkDegWAPU4 MZACfHvnBzJjWQ60C49Zco7sdwiTdXEYM7hPzQzpEGFFionHAGupvOjTtuGkJGbc8N0F sV/DNELgNx74BXT/m/Fj9M3k+JoFvUgaq+jJ80arBPoKXRb9oPUc3ULm5+A9yJWprAGV 2ncBNqWNEvu1Hpqgk34XOF8tUJ3o1YXKEgyl0Tfx2VUhbIMPmIATJb9Fk+L6eHZbN8Kh 3jlw== 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=wsHKxJI3jBnMbRUCdAd6xx0tUaceirNwJ56aYN00+ts=; b=nWKNAOJavOFnibrUBzXg4nBY3qbRBoydaEievSRyH2ZsRXT/AOHZke/maS3eE8xHu+ SSsD1Lfjw54XEa49pyjzgPPPTlf2KfAzJLxUyxHJgqO7S7L8Jp91kHIB5o21GDZrk+Lh MdP9hAO0+zqvOP2ZdCkQ/AgLBfGfMTOLjelrQavM4/SJR7e5fQGTWbOwu0euLTuhph7M IOZt3ymt5WGw0f0Qq8gQcgSva+++Ou2O8rJpfollx+YAE5n+fMMN9wl1aawsBbsPiKOV fgVgo7o5SSh7gAlYPPwDOpePZx6sWEReaqowWF1lY/j4b1/AEObRnUlFuOLOsWweIldQ +a2w== 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 c6si27427069plr.414.2018.11.21.17.57.46; Wed, 21 Nov 2018 17:58:00 -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 S1732486AbeKVFur (ORCPT + 99 others); Thu, 22 Nov 2018 00:50:47 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:47183 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729634AbeKVFuq (ORCPT ); Thu, 22 Nov 2018 00:50:46 -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 1gPXxu-0001Sr-SG; Wed, 21 Nov 2018 20:15:10 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gPXxt-0000aF-Pm; Wed, 21 Nov 2018 20:15:09 +0100 Date: Wed, 21 Nov 2018 20:15:09 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Bartosz Golaszewski Cc: Thomas Gleixner , Linus Walleij , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski Subject: Re: [PATCH 1/2] irq/irq_sim: provide irq_sim_fire_edge() Message-ID: <20181121191509.ia2vcklvx4q2rh56@pengutronix.de> References: <20181120134032.31645-1-brgl@bgdev.pl> <20181120134032.31645-2-brgl@bgdev.pl> <20181120171742.gkwb4s4qbcqvnefj@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Wed, Nov 21, 2018 at 05:34:32PM +0100, Bartosz Golaszewski wrote: > wt., 20 lis 2018 o 18:17 Uwe Kleine-König > napisał(a): > > > > On Tue, Nov 20, 2018 at 02:40:31PM +0100, Bartosz Golaszewski wrote: > > > From: Bartosz Golaszewski > > > > > > The irq_sim irqchip doesn't allow to configure the sensitivity so every > > > call to irq_sim_fire() fires a dummy interrupt. This used to not matter > > > for gpio-mockup (one of the irq_sim users) until 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). > > > > > > Introduce a specialized variant of irq_sim_fire() which takes another > > > argument called edge. allowing to specify the trigger type for the > > > dummy interrupt. > > > > I wonder if it's worth the effort to fix irq_sim. If you take a look in > > my gpio-simulator patch, it is trivial to get it right without external > > help with an amount of code that is usual for a driver that handles > > irqs. > > You're basically recommending handcrafting another local piece of code > for simulating interrupts - something that multiple users may be > interested in. You did that in your proposed gpio-simulator and I > still can't understand why you couldn't reuse the existing solution. > Even if it's broken for your use-case, it's surely easier to fix it > than to rewrite and duplicate it? There are very few cases where code > consolidation is not a good thing and I don't think this is one of > them. I don't say that factoring out common stuff is bad. But if in the end you call irq_sim_something(some, parameters, offset); with the simulator and if you don't use the irq simulator you do irq = irq_find_mapping(irqdomain, offset); generic_handle_irq(irq); I prefer the latter because it's only a single additional line and in return it's more obvious what it does because it's the same that many other drivers (for real hardware) also do. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |