Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1191298rwd; Thu, 15 Jun 2023 07:28:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5F/MFLFELyZZR6XDYIpUYFPd/NSc4RM9afKBdMjHSTWo3bdvYRrgx0+0qraCPXJPX3ybmx X-Received: by 2002:a19:4f56:0:b0:4f8:4961:6aa9 with SMTP id a22-20020a194f56000000b004f849616aa9mr247604lfk.8.1686839336956; Thu, 15 Jun 2023 07:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686839336; cv=none; d=google.com; s=arc-20160816; b=DA7cd24LwafToC1EpZIpGn09ZRx+mMslho8I2UU/6jIpGGzFhl2hlQQVlBXGHDIAjb nrYkpO5lir3O58jY335hFBdRttGz9LmGnACh00FU2jbfAVwNaPjjNfKrTXcvRBiEMAFg gwyG8Sru5X8WrZBMz2Xy7FkhpT/tJOl2nXtw65p7+IifGxlNHVRSqNxhcy1TmgQv7Njy MTjJ3Y+qDbO6hdouIiVtkYxFqGC0RmujrJ0wT3/kMGOG8ITrkGWHZzyvSZLiG5gVb062 2iSTaUwQSLMHmAB6c2ZhFJNXA0l7ThDgqu6NL2lBYccNacRDjJnRvKOyqJ7U2SAIzVJM Iu8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8tbFxV0ES/OznLa3QmlMD6yaqCsP95A8qSLkUV9gcRA=; b=hmdy57Io6nWkkUuWOJq0tSYP8nJt777Gaq+tX0f2VXIVb7SKJeXz46F6ozomAx3aQh Pi9cAmIIisLjL85a9gYpanPgz4KzyBl89AaVjbNDsE4kCpSeNLhQfnPmjhG7XDqZok4Q rIO7ANJmfruXOXegbm7gVDWbAJGwwc7UUU3RCzJWUELZiCMfRD2KMAIoCh7iMv2GMf6B qcBKfZwK105n7o/4ojjPXXGBLJazlxefhpwuQd6cS70w5nGG4L66MGVitRkQgFC/ONp1 H6z7GmtDUyurYG2IkB8EOkoep2qxS/idQxHm7idHgru2MahWDquIgALbmlWcHN/Dpduw xaPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=T+GKvtK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m21-20020aa7d355000000b00519371a9fd2si1818183edr.321.2023.06.15.07.28.32; Thu, 15 Jun 2023 07:28:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=T+GKvtK9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344728AbjFON5J (ORCPT + 99 others); Thu, 15 Jun 2023 09:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245328AbjFON5G (ORCPT ); Thu, 15 Jun 2023 09:57:06 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E91842D65; Thu, 15 Jun 2023 06:56:30 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-62fe192f7d3so15696786d6.3; Thu, 15 Jun 2023 06:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686837389; x=1689429389; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8tbFxV0ES/OznLa3QmlMD6yaqCsP95A8qSLkUV9gcRA=; b=T+GKvtK9J4PYGDVV9IyI7VuGpA83q+zS9pA3HCEB/3b9WWYBpxYgvcr9gUm5YaonwJ vJ2Qfb+O3rsa/PaUGQmIYSC9Fyz/uczVqYWCYLAk46aAjpk4AxtIW0j7WIYs0hW2kq9h 65uowTa7TtzQGkvCayN+/WCnSDevqTs+nYChhx95TX/AaiBeBh9nsH9Kukwud4Ub12Su z/Mlvu2+mqAiE40bZ5iWZNM8NyTR33MrJGv0G2+Sg2YrRUhIYaK5mRCczqmo2ZaTkDBm bDgyJAVAsa1+/ZRcB9COnL2L3Hhe2HRj2IxLWGgZ1uuNAFQ0pRSPXbw0oGdc6DAeglCa +gPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686837389; x=1689429389; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8tbFxV0ES/OznLa3QmlMD6yaqCsP95A8qSLkUV9gcRA=; b=dy8PtoIu8Y2g10OdvhpYCfco3tgnxw+nUMvWmYrTpg3HKM+DaqwdMtv3kH7M0fOsY1 cZd8ZqwYl+2i8Ao6TZdVZMXaGLBZxHXVJu9mcc+Ardu+68lUPHdQt4ejY/tgKM86N2Jg f4ANK4wnHvqC4bExdoprqEmRihHQL/hMhCZxmRMrvL1gNJFRMDTgucJIMWfbyMwiNFGE OrdUiIxRs0QeovXpprHzPQgPCl8OHp1FCbTbs8yoY6arcWyASZ+xRBcj/SlURGP22E3R +UVSbqMszG/FQ1IQisfmbGXqRGnfZLwjbyUPMQ13GNzzUDcncs8UFPICU74r18WyWdby pCCA== X-Gm-Message-State: AC+VfDxb+THnL6RGjB/eeMD/c8l2rcbVs7R+hzG8OIwEV7ufICI5UTFd Jyen6vhrqiH1wuvUoXjcz4lWK4oa9WYSjl1PMkA= X-Received: by 2002:a05:6214:29ef:b0:626:1637:f58c with SMTP id jv15-20020a05621429ef00b006261637f58cmr21335345qvb.30.1686837389181; Thu, 15 Jun 2023 06:56:29 -0700 (PDT) MIME-Version: 1.0 References: <20230607081803.778223-1-jiawenwu@trustnetic.com> <15e2fc098a1e63317368f4812290ca35@walle.cc> <010401d99f6f$26d41600$747c4200$@trustnetic.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 15 Jun 2023 16:55:52 +0300 Message-ID: Subject: Re: [PATCH v2] gpiolib: Fix GPIO chip IRQ initialization restriction To: Michael Walle Cc: Jiawen Wu , linus.walleij@linaro.org, brgl@bgdev.pl, shreeya.patel@collabora.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 15, 2023 at 1:45=E2=80=AFPM Michael Walle wr= ote: > > BTW, I wonder if it has problems when unregistering gpio-regmap. > > Call Trace of irq_domain_remove() always exits in my test: > > https://lore.kernel.org/all/011c01d98d3d$99e6c6e0$cdb454a0$@trustnetic.= com/ > > > > Of course, it could be because there was something wrong with my > > test code. But I want to be clear about this. > > Mh, you've said you don't use the devm_ variant of > regmap_add_irq_chip(), > correct? Do you call regmap_del_irq_chip() yourself? > > It seems that gpiolib is already removing the domain itself. Mh. > I guess if the the domain is set via gpiochip_irqchip_add_domain() > gpiolib must not call irq_domain_remove() because the domain resource > is handled externally (i.e. gpiolib doesn't allocate the domain > itself) in our case. > > Nice finding! Looks like it has been broken since the beginning > when I've introduced the gpiochip_irqchip_add_domain(). Will you > do another fixes patch for that? I'm not sure where to store > that information though. Maybe a new bool "no_domain_free" > in struct gpio_irq_chip? While reading this I also thought about flag, but please use positive notation, e.g. "irq_domain_is_ext". --=20 With Best Regards, Andy Shevchenko