Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4624691imu; Tue, 29 Jan 2019 04:56:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN7AfHiCy+QUwzgugdA5XLorVcr4xVO5XPwBHfpM2o1pvVMxxdxFMQIPJMSyAMIgZoJSsZol X-Received: by 2002:a17:902:4681:: with SMTP id p1mr26541619pld.184.1548766572253; Tue, 29 Jan 2019 04:56:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548766572; cv=none; d=google.com; s=arc-20160816; b=1GJhJAkEynElK+iOcCMsDG20/Cb3AYSwb5pAbAAZDzx2IWji6b2ZnC9KeG1NWmmQ4+ DkW7ffGDxP1IjL76nEd50lAEektJWjiG44ckE53m/5vv9EMryeyv6HqfzBFj0BULXsnT VfbucpFp4Xn6zPlPjUsswqtk/ILWvH+vnwnUDTNBMoAm2NYCZtdFhQO6K3eQxLQKUNIl gs5pH+2rKabSE0aTx6bhgaq9mOibRWs1JbTXUphChXNnA0L0u3yo5Imb0N97FTbhO2WX K0Lc0KMB2ZVpmQnNvlgDFS7ijkle2cDAZtHIbz3/UdEknb/vpQxnPRWhCnfP3APt6g0o 5Hbw== 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=WWlD+6/q7kGtVxEy3LoKAfmZP8MiXY4e1Rw1hEDufoE=; b=zu5EGnjtGzpCVsY9/FdoV+4T8Io9YbflXHFnppGWzucoU7PYHzZY1yt0wfshLUfFZp GSFo862kY2Q+7kTETb1RvK9LHxeePcVFPlLHIxtmOE/eXmRBcFH7Qv1S9Wq6wizOztKt n+He+I/yQQiigeubf24cwTKYtkGEdbHhQ17Qg8ueGu2qj5R3ss4EewR58DEYiWgLttfg XO/z9LmBaWthq+a5MaL/ixxVTcIBOsiAGBF4OjnwMOtmM3DKX1r0qRLqhFmX+7Bx6DfD x+LjXQ0Plbreq0JTfNw+B2E925nBTzszwB3R0GIh/hbXppTUaGzjJ5x2ToxvzpWCH54u aHVA== 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 12si4174418pfx.102.2019.01.29.04.55.56; Tue, 29 Jan 2019 04:56:12 -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 S1727658AbfA2Mza (ORCPT + 99 others); Tue, 29 Jan 2019 07:55:30 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:48025 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727166AbfA2Mza (ORCPT ); Tue, 29 Jan 2019 07:55:30 -0500 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1goSvG-000300-VU; Tue, 29 Jan 2019 13:55:26 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1goSvF-0008P2-LX; Tue, 29 Jan 2019 13:55:25 +0100 Date: Tue, 29 Jan 2019 13:55:25 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Bartosz Golaszewski Cc: Linus Walleij , Thomas Gleixner , Marc Zyngier , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Bartosz Golaszewski Subject: Re: [PATCH v2 3/9] irq/irq_sim: provide irq_sim_fire_type() Message-ID: <20190129125525.ahgiwaftubs3tlog@pengutronix.de> References: <20190129084411.30495-1-brgl@bgdev.pl> <20190129084411.30495-4-brgl@bgdev.pl> <20190129090706.33wcxb6d2c64yx7c@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::c5 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 On Tue, Jan 29, 2019 at 12:01:37PM +0100, Bartosz Golaszewski wrote: > wt., 29 sty 2019 o 10:07 Uwe Kleine-König > napisał(a): > > > > Hello Bartosz, > > > > On Tue, Jan 29, 2019 at 09:44:05AM +0100, Bartosz Golaszewski wrote: > > > -void irq_sim_fire(struct irq_sim *sim, unsigned int offset) > > > +void irq_sim_fire_type(struct irq_sim *sim, > > > + unsigned int offset, unsigned int type) > > > { > > > struct irq_sim_irq_ctx *ctx = irq_sim_get_ctx(sim, offset); > > > > > > - if (ctx->enabled) { > > > + /* Only care about relevant flags. */ > > > + type &= IRQ_TYPE_SENSE_MASK; > > > + > > > + if (ctx->enabled && (ctx->type & type)) { > > > set_bit(offset, sim->work_ctx.pending); > > > irq_work_queue(&sim->work_ctx.work); > > > } > > > } > > > -EXPORT_SYMBOL_GPL(irq_sim_fire); > > > +EXPORT_SYMBOL_GPL(irq_sim_fire_type); > > > > This looks better than the previous variant. I wonder if it would be > > still more sensible to have type only in the mockup driver. But I don't > > have the complete picture here and it might be easier this way. > > > > I'm afraid I don't follow. Wasn't that the way it was done in v1? No, in v1 you already had "type" in the irq_sim driver and the logic if the irq should trigger in mockup. My wondering is about having both in the mockup driver. Then you have the tracking of the line's level and the logic if it should trigger an irq in a single place. But as I said, I'm not sure if this is better than your proposed solution in v2. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |