From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.17 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292959; b=2qTjLF7HICy8TYj4KTcfFDK54uFH5FtkWzlElETbRDQq7IaJnE3d5be3cx68JTbrvuMF plubDn6Qs6q11RFJQ7TZ4w55MBf8HZSVyWW7bZMjmBX1hZl5JFucJDCk9cAjr5wLLmb5W QRuGeZBd24MgRgIkjyswkLArtHMVZoNXIn8hYd3r9zsRg30Z1EhekyMl39yll6HcbhWBW QMT4Hqwwm8t8JNLTAdn9U4iJ5PWL9FDJoGRfr10uEZmiV+/XB3Eyvbao3ubsqDo3OvtEU kWPsyEYNljTWoeNx3OECJ/OWh/xqEEDtQ6b9fbFvN8sKGOkvLAAGykTYPdbrn8oOr/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292959; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=Jt/DEbkvL0a0Q1ckIjbFkaK6/X3Zto1fIqrD7J7uaAg=; b=cRWb6dnIlegaa0so+QDp48JgkMhEyU6huZBr0GD9oJX+RfMYpGE/toIVtoj8BQQ54lB8 +I/cEchUmY7sXppcxVQoTgHzKXuxuoarANzVimAbGwkqCtYtZi23EbVv0UaElHAZpecYM DQn0Tq6VFJAw4iCxOj1kEYErm+OFJL4h0O+7nkngWWpnFNndzU3XbRVjHG/HcSS9gZS0M uyo2BJAQtL9NiLYVfsKjtvPSYgHaVqhPtcN3XCCQQjSBar9EspWcQDInVSFdNiw9ORy6R d3AG8+PuBrMBmXIgJ48Umhb/mkVenn4/Jzg/kV4ySI3Xu+p006pjKkvs/SlW7OnDSiA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=abIwYKN1; arc=none smtp.remote-ip=198.175.65.17 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 584CC606A322 for ; Thu, 3 Dec 2026 10:15:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 584CC606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=abIwYKN1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796292960; x=1827828960; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Jt/DEbkvL0a0Q1ckIjbFkaK6/X3Zto1fIqrD7J7uaAg=; b=abIwYKN1VUa3NwC7HiLIqgh+ieFUgnTbU0D5IlNxdQYsfbd8lAv87pkD zvH+HyQOna+ZbVkC7EeIev6i9XDfnJ3wseceKdkjtKFO4AT8PaGwBd6HO 2OFdxbJ7Da5UDpX6hnkSgPhKJrDe8nNi9pb2A03+zvhUqQBs/Ary498CZ xxK6k/Aotir5eMAN6nU6sF8AQN30U9nHi+MJCC9tgChSrnF95qDIGmikq BvfWvNTgyUQk6ka+bhWK34pQmEN6aJrQ5iYPn2+hMQYdMSn4fJ9dvMw2T XIhkcmp1WFPYVeee/EIejMrMoptkjXxZw6n9Qlvj8M9NqoVjTLEePG7CH A==; X-CSE-ConnectionGUID: cuAJCy/lQJ+2XdY318/DOA== X-CSE-MsgGUID: R1pTW2A/Qca4KJTh56qoVg== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5253820" X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="5253820" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 02:15:59 -0800 X-CSE-ConnectionGUID: tpu+ilVkS5GQpr/t/Q132g== X-CSE-MsgGUID: v+Qqd9b+Rkel9A4KfQcUHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,248,1787036400"; d="scan'208";a="13981277" Received: from inaky-mobl1.amr.corp.intel.com (HELO localhost) ([10.245.244.115]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 02:15:10 -0800 Date: Thu, 3 Dec 2026 12:15:07 +0200 From: Andy Shevchenko To: Michael Walle Cc: William Breathitt Gray , Linus Walleij , Bartosz Golaszewski , Petar Stepanovic , SriNavmani A , Prasad Bolisetty , Tzu-Hao Wei , Karthikeyan Mitran , Mathieu Dubois-Briand , Lee Jones , Long Zhao , Joseph Telaak , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFT PATCH v2 06/14] gpio: regmap: add helpers to add a regmap-irq chip Message-ID: References: <20261127145232.814492-1-mwalle@kernel.org> <20261127145232.814492-7-mwalle@kernel.org> X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Mon, Nov 30, 2026 at 11:35:58AM +0100, Michael Walle wrote: > On Fri Nov 27, 2026 at 7:43 PM CET, Andy Shevchenko wrote: > > On Fri, Nov 27, 2026 at 03:52:23PM +0100, Michael Walle wrote: > >> The most common use-case is to use regmap-irq together with gpio-regmap. > >> To make life easier for that and to avoid code duplication, add helpers > >> to create and attach a regmap-irq domain. These helpers are intended to > >> be called by the new .create_irq_domain() callback. > >> > >> gpio_regmap_add_irq_chip() locks the GPIO line while its interrupt is > >> requested. This assumes that the hwirq numbers match the GPIO offsets. > >> If a driver doesn't follow that, there is one without the locking called > >> gpio_regmap_add_irq_chip_nolock(). > > > > Hmm... Can't we simply have a boolean flag instead in GPIO regmap configuration > > and just distinguish it inside the common helper? > > Not sure about that, it has nothing to do with the gpio regmap > itself and would even be ignored if these helpers are not used. So > I'd like to keep it out of the config. > > We could use a boolean argument for the gpio_regmap_add_irq_chip(), > but then you can't use a function pointer. Thinking further, there > might be some driver data just setting this callback. Who knows. > Thus, I've gone that route. OK. Let's see how it will evolve. ... > >> +/** > >> + * gpio_regmap_add_irq_chip_nolock() - Add a regmap-irq chip without line locking > >> + * @gpio: gpio_regmap device > >> + * @irq: the parent interrupt > >> + * @irq_flags: the IRQF_ flags to use for @irq > >> + * @chip: the regmap-irq chip description > >> + * > >> + * Same as gpio_regmap_add_irq_chip() but doesn't lock the GPIO lines. > >> + * Can be used if the hwirq numbers of the regmap-irq chip don't match > >> + * the GPIO offsets. > >> + * > >> + * Return: irq_domain or an ERR_PTR() error value. > > > > Okay, this might justify returning error pointer, but irq_domain_create_*() > > shadows that with NULL, which questions the usefulness of it (the error code). > > I'm fine with either approach but still tend towards using > > irq_domain_create_*() helpers instead their open coded variants. > > I'll go with the irq_domain_create_ helper, but I'm unsure if we > want to drop the ERR_PTR here and instead just return NULL. I'd keep > the ERR_PTR here just in case someone will do more than just call > the domain creation helper. That's why I have no strong opinion, but since the helpers provided by IRQ domain core I believe that the error codes (since they are shadowed in this case) are considered internal granulation and users in general do not need to care about them. > > On the other hand there is no much win, especially if you replace > > > > info = {}; > > > > info.XXX = ...; > > > > ... = irq_domain_instantiate(&info); > > > > with direct assignment as it's done inside irq_domain_create_*(), > > > >> + */ -- With Best Regards, Andy Shevchenko