Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3501454imm; Mon, 6 Aug 2018 06:02:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeUTmMqp/o91auL8nowrLu03QPyyEpPYtQBus9w5B8vjkIM0/v6LtW5kbFg21yZLw5Wx/OC X-Received: by 2002:a62:1089:: with SMTP id 9-v6mr16672527pfq.30.1533560535816; Mon, 06 Aug 2018 06:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533560535; cv=none; d=google.com; s=arc-20160816; b=1DYLFGZAXjmFpBP7z9H5iNCWtCfwG8VJ9YrrODOZvtXmR78ngh+aNVcQtr3bMWG+Lp IW8g6Pc89FdJI0qOnstLqG5Lf+d/rUh/dZJteJlwjVqfVnxuKir4Jytr0CXWv2exnXfI aqUavB7Iq3WwTUR8OYBBxAv8x14eYIfXFhLwGlb6eHwaSquVmbhqoQYvA3bRhxJxGATN xFvA+tThGANAs7OU9C0MpnHO6qmYyIsefM7H/6J033yzz0ihVDYFFYbpREZh16C3KJm/ wJqUz3S16oNbM3hfAZw4qW2mCbOkLp4aoPSO6zobNVgaTTTT0nI4RSKUUzMbxcqcPLz5 Y5Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=1kgyf+xozKBERQ/3jTZWyHubUeF9g8qmF9GMdrpyuHg=; b=ViGDx6C91tespgO77hrWUuZppVh5NXXtGtee9i/W7+pVI/KqzUdgbsRfUH11NoaKf3 frVAgKxfRMtj5ZI1VZKGqy7bgnwOzz4+apV1ZkC0qK+90pF5AdsR4K1JiPCVZBp7274s 8iLjpJRTTSqdpcVzx5nH95f7dw4ZYJtjYC+Y5PcejMbFpn4S++JrNag9tO5EZahaEEHr avyasaui5XvZDTSMXkRFKVNSF+t7Fm7EvAe0cR8GW4+gJQgRvInYb8oLyhLT4EO5Fya3 qKVOceVamiktV55v3Sy0XjF019r9SwsO53VDOIwKbBGgnwH/s5w0lz7vJ6T9YfCvt3RT 4qAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hn5PfxGY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9-v6si12324109pgj.70.2018.08.06.06.01.58; Mon, 06 Aug 2018 06:02:15 -0700 (PDT) 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=@linaro.org header.s=google header.b=Hn5PfxGY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729808AbeHFNPJ (ORCPT + 99 others); Mon, 6 Aug 2018 09:15:09 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:39591 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728723AbeHFNPJ (ORCPT ); Mon, 6 Aug 2018 09:15:09 -0400 Received: by mail-io0-f196.google.com with SMTP id o22-v6so10652049ioh.6 for ; Mon, 06 Aug 2018 04:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1kgyf+xozKBERQ/3jTZWyHubUeF9g8qmF9GMdrpyuHg=; b=Hn5PfxGY9VeXtd1JVZ9z+7XY/kpanOGzMKp38t8fOv90Z+y0SLcXGdhLX3A7DWR4Pb lpm22QSncoLBONvROz90BBOyyNkDl1vazz9BxbTqiohl7udGHc+bVVQVTcEjaY/mzbyH maFxRzqiE2dBR0Ux0lEi+vGkGREDP+W47/SLs= 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; bh=1kgyf+xozKBERQ/3jTZWyHubUeF9g8qmF9GMdrpyuHg=; b=dDR7xsDzaMGZx677pP0mnUyJn2CuT9Pq+T76BrSHKXGoxhfl9DU82Xqx96a+aASPZE D30rmDQnm927tiF/B4K1oqFh0jXsckv9P36hWEF1+iuOz42oDdxRTTuK0EpgAFnetDIN sJeRLa+U07/xaxeeJWJILVf9+bFdUzTHAonpvC6u/rirujmIGNnHlBuUR1K1NxE2ey+L MhRqsvs8WhK9ynlhiW1gg6qK0tMajVsDy52/JQkaaTbvWachcYWm7nlr+I1odAq9EzWE ox5l1RqVrD4yCR5wNshrmlvhq0dj3ycYo3sOUIpaRnYeg3vZdLVTIY6oHdn34A8wwxbk VkDg== X-Gm-Message-State: AOUpUlFPyco6ZCEnuEO5EenvqvwAHBe/NR0DtQW2OpM0ndAyPVkAeyZJ lZNA86r3iMLnC2GCITmSt7XCx3O/UNdSAesRjTQKfzrq X-Received: by 2002:a6b:c3c4:: with SMTP id t187-v6mr14328616iof.304.1533553595887; Mon, 06 Aug 2018 04:06:35 -0700 (PDT) MIME-Version: 1.0 References: <20180725122621.31713-1-quentin.schulz@bootlin.com> <20180725122621.31713-2-quentin.schulz@bootlin.com> In-Reply-To: <20180725122621.31713-2-quentin.schulz@bootlin.com> From: Linus Walleij Date: Mon, 6 Aug 2018 13:06:23 +0200 Message-ID: Subject: Re: [PATCH 2/2] pinctrl: ocelot: add support for interrupt controller To: quentin.schulz@bootlin.com Cc: Alexandre Belloni , Rob Herring , Mark Rutland , Ralf Baechle , paul.burton@mips.com, James Hogan , "open list:GPIO SUBSYSTEM" , Linux MIPS , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , Thomas Petazzoni Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Quentin, sorry for delays! On Wed, Jul 25, 2018 at 2:27 PM Quentin Schulz wrote: > This GPIO controller can serve as an interrupt controller as well on the > GPIOs it handles. > > An interrupt is generated whenever a GPIO line changes and the > interrupt for this GPIO line is enabled. This means that both the > changes from low to high and high to low generate an interrupt. > > For some use cases, it makes sense to ignore the high to low change and > not generate an interrupt. Such a use case is a line that is hold in a > level high/low manner until the event holding the line gets acked. > This can be achieved by making sure the interrupt on the GPIO controller > side gets acked and masked only after the line gets hold in its default > state, this is what's done with the fasteoi functions. > > Only IRQ_TYPE_EDGE_BOTH and IRQ_TYPE_LEVEL_HIGH are supported for now. > > Signed-off-by: Quentin Schulz Patch applied, it's such a pretty and straight-forward patch. Also IRQ is probably very nice to have, so let's get this in and supported. Please consider addressing the following in follow-up patch(es): > +static int ocelot_irq_set_type(struct irq_data *data, unsigned int type); Can't you just move the function above so you don't have to forward-declare this? > +static struct irq_chip ocelot_eoi_irqchip = { > + .name = "gpio", > + .irq_mask = ocelot_irq_mask, > + .irq_eoi = ocelot_irq_ack, > + .irq_unmask = ocelot_irq_unmask, > + .flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED, As you see the latter part of the define is "IF_HANDLED". > + .irq_set_type = ocelot_irq_set_type, > +}; > + > +static struct irq_chip ocelot_irqchip = { > + .name = "gpio", > + .irq_mask = ocelot_irq_mask, > + .irq_ack = ocelot_irq_ack, > + .irq_unmask = ocelot_irq_unmask, > + .irq_set_type = ocelot_irq_set_type, > +}; Is it really neccessary to have two irqchips? Is this to separate ACK and EOI because the EOI version doesn't survive an ACK? Yours, Linus Walleij