Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2759645ybi; Sun, 28 Jul 2019 17:14:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwn6gr8CY7Nxn2YI75lpBmwec3fblpzWes0dFyzzPU/eEHElOgc0DAWjtvI13XLb69NesMB X-Received: by 2002:a17:902:694a:: with SMTP id k10mr106367684plt.255.1564359240262; Sun, 28 Jul 2019 17:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564359240; cv=none; d=google.com; s=arc-20160816; b=IZ/jzOyCM76/bjV+QD5i6ejClci+0xI88Ct99vKRQVudC3q1Bcde+7V6qLJNjkerXX hWVQ/1YUkHrpXdY9khawI8AZyQC7T09JOKlpbupHcIoIfNNJjflf0uyXYl5WIg1QFFwk GWE2kdFaYxFBlKfLgnu3JxZ5YrBFakxuKVhIjDIQU8WnY4acAtOnjDluTR3uwp7iiiM+ kySHNNKMpuTZgN/85NRgyNsqSgH6bEC/+5gdGaAnITabJrvOeuMgGmJSolreli2B2OET kbvuTsQ3FzwppH53dkyXq220k/xHnwgdMkdOJ65z+lKTj/Yq9HSIMsNrfevpJVdb67v6 4rIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RuHDByJdt6eqYp5lhPHw5YgpzwkqYgbZBSEOLuLyg04=; b=LcNq6YcxIdEE5ov1R5aoZ9c0uCqLYhtdt+rA+wqTRzyGuugbFL3tTESs90TDilH0ZA ifQueh30VlCQd3xm1ELbFSeq9EQe3tEQ7PNsx2gBGjVo3yVzxEYKO7RESBi0Yihf43/b A5m/ErGUjfil13vHo1hQ1PGBE0Jvdq+GNFmo73OI9qVo6I+4grIg51TQ9emEhkRw4qHL od5R5I0ekOZpDQBqAzzWF9NbbzVreXtxGrZtEGVtJtq0AAXDRwaISDFeGPNvRb7aanIL pIKQ96VrFrlfG+vqupX3A8gQQKoilpPjSp2/AntdA1NLxksos/uZnnWZUBxpch/rjAI5 fdqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@onstation.org header.s=default header.b=gH3oCbmk; 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 c23si24677933pfo.168.2019.07.28.17.13.45; Sun, 28 Jul 2019 17:14:00 -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 (test mode) header.i=@onstation.org header.s=default header.b=gH3oCbmk; 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 S1726441AbfG2ALx (ORCPT + 99 others); Sun, 28 Jul 2019 20:11:53 -0400 Received: from onstation.org ([52.200.56.107]:33482 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbfG2ALx (ORCPT ); Sun, 28 Jul 2019 20:11:53 -0400 Received: from localhost (c-98-239-145-235.hsd1.wv.comcast.net [98.239.145.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: masneyb) by onstation.org (Postfix) with ESMTPSA id A37F13E911; Mon, 29 Jul 2019 00:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=onstation.org; s=default; t=1564359112; bh=fTbFvKTimvfSnY3qv6EFPf24BLGT92XXZetGoC+8T30=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gH3oCbmkasua7ZqHWoXpzrYFMS2XYEalSeBlrnKp80q7IsWlxwJrL36R6Ld5jg50s daYNl/qq7EX0BKrVYHFY+/Fp/R1gvE9ZpmVo81puHzOrl+XC2k/Wzn1eWn0whVZ5fL yGCBXhyTfKb0Ov+hKYhXZmgd07Y43Mnf47CVRW6w= Date: Sun, 28 Jul 2019 20:11:51 -0400 From: Brian Masney To: Linus Walleij Cc: "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Lina Iyer , Jon Hunter , Sowjanya Komatineni , Bitan Biswas , linux-tegra@vger.kernel.org, David Daney , Masahiro Yamada , Thierry Reding , Bjorn Andersson , Andy Gross , MSM , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/4] gpio: allow customizing hierarchical IRQ chips Message-ID: <20190729001151.GA17127@onstation.org> References: <20190708110138.24657-1-masneyb@onstation.org> <20190708110138.24657-3-masneyb@onstation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 29, 2019 at 12:49:55AM +0200, Linus Walleij wrote: > On Mon, Jul 8, 2019 at 1:01 PM Brian Masney wrote: > > +static void gpiochip_add_default_irq_domain_ops(struct irq_domain_ops *ops) > > +{ > > + if (!ops->activate) > > + ops->activate = gpiochip_irq_domain_activate; > > + > > + if (!ops->deactivate) > > + ops->deactivate = gpiochip_irq_domain_deactivate; > > + > > + if (!ops->translate) > > + ops->translate = gpiochip_hierarchy_irq_domain_translate; > > + > > + if (!ops->alloc) > > + ops->alloc = gpiochip_hierarchy_irq_domain_alloc; > > + > > + if (!ops->free) > > + ops->free = irq_domain_free_irqs_common; > > +} > > I'm fine with translate(), this seems to be what Lina needs too. > > But do we really need to make them all optional? activate() and > deactivate() will require the driver to lock the irq etc which is hairy. I can't think of a reason right now that we'd need to override the others. Since the structure was there, I made all of them optional to try to future proof this a little bit. It probably would be better to only make translate optional at this point. If needed, someone can submit a patch for one or more of the others with their use case. Brian