From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0974BEB64D8 for ; Fri, 16 Jun 2023 18:02:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241646AbjFPSC2 (ORCPT ); Fri, 16 Jun 2023 14:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232711AbjFPSCZ (ORCPT ); Fri, 16 Jun 2023 14:02:25 -0400 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF4130F7; Fri, 16 Jun 2023 11:02:19 -0700 (PDT) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 04802156; Fri, 16 Jun 2023 20:02:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1686938537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eIHJ2QfFukG4vpUDvtvYpyy2v1OCiVGRJxhVd3mkd+E=; b=mVK99UndmKPksUU/pbftjQEF74gtBJxZxs5NgrWNK4snu0k1nM5+WcYVAZFIJxyE0xsir/ uaWrwkz5Va+mtDs4XSE4ymtbNpVYSn/HlyYgAbMmoa2S0mU5AXyMPpMA8JBjRJ01xzq5Q8 o7eiYbiYhEdgkVn2G8ENEeGfgAehUu9YNVJh9I0s45eMP+x7F0SdZtCl4qYjMmrMTML2VR XfZQ9EX6HVCcBRWSu113ST0SrylYDCpHqox9E7+DyAUCCICb+ATyPdg74/SIPG9SLx2QXU /ogZ2p5IWHeRr0C6/pCMQzyDLALjJDOURiqY7tN+xTWgTgjn6atGZoS8XrY0pw== MIME-Version: 1.0 Date: Fri, 16 Jun 2023 20:02:16 +0200 From: Michael Walle To: Andy Shevchenko Cc: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Jiawen Wu Subject: Re: [PATCH] gpiolib: Fix irq_domain resource tracking for gpiochip_irqchip_add_domain() In-Reply-To: References: <20230616-fixes-gpiolib-irq-domain-v1-1-27fe870db961@kernel.org> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <4b55afe91d2a704c0229340c5ea4885e@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2023-06-16 16:13, schrieb Andy Shevchenko: > On Fri, Jun 16, 2023 at 09:30:06AM +0200, Michael Walle wrote: >> Up until commit 6a45b0e2589f ("gpiolib: Introduce >> gpiochip_irqchip_add_domain()") all irq_domains were allocated >> by gpiolib itself and thus gpiolib also takes care of freeing it. >> >> With gpiochip_irqchip_add_domain() a user of gpiolib can associate an >> irq_domain with the gpio_chip. This irq_domain is not managed by >> gpiolib and therefore must not be freed by gpiolib. > > With or without below nit-pick > Reviewed-by: Andy Shevchenko > > ... > >> /* Remove all IRQ mappings and delete the domain */ >> - if (gc->irq.domain) { >> + if (!gc->irq.domain_is_ext && gc->irq.domain) { > > Looking at this, perhaps positive about allocation? > > domain_is_allocated? I mean all domains are allocated ;) domain_is_allocated_externally? I'm bad with short and concise names.. -michael