From patchwork Mon May 29 07:42:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiawen Wu X-Patchwork-Id: 100136 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1348726vqr; Mon, 29 May 2023 01:03:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CaeDH0ZbUiCsgwupP07ML3cMzncUnUtTx6BTyxIr8Ti0XHfTUAfs/vpjPEvqaU2v93RRs X-Received: by 2002:a17:902:b485:b0:1af:c1a7:3bb5 with SMTP id y5-20020a170902b48500b001afc1a73bb5mr10323731plr.4.1685347403334; Mon, 29 May 2023 01:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685347403; cv=none; d=google.com; s=arc-20160816; b=dgcqoUMVromu5kvH8ecCepsubnWt/R0Lh3zLLDnFY+x9kmFFce1Jrhe3k6n3TaYjXh ImkvhgxZo0tTqyFDZ9gu7Cq5DtrO+xyaS9t2yh/WXGOfZusi7WisUTgnQrzEgOs6tlYo YL0w6hUHv++hNlX1hgjFMDAopiFKtygQJE7ifB8+dOg1V2jR48of1PEIBfTRVlVDZ7is im9BhKG7lc8ocnC6+N8i4BLXMUerg0LQ7UMGv/6/nqsU3Ifye3N8SbM8lDQPkUUA6eYi fLSJvITrKzprZ35t3rabDyt7SPpb9Uka2QC9aZAonC9/EKWggOcP1XqmgHopfA+Btn+m gR9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=3gWFtRzVUEa4feScSnYuFAHI3m+T/1Nkip6eE6hm1Tc=; b=x4mLxPy9uUtbtQ9blfPqjNV8pWfbtPzd5lj7Js2mdr8+xeKFchjjFHStEE8q+UchY0 kFZBxJkpa3GRrA1L6PThTrQ2xy8haf5IqgUl0cUuDvdrWZGFgNRNNKxS5uMWxzGK/Rgc /cwSXydOM9xt7Hn0aKgyvpT3ANnFNs/Luit8v+lfSknCeorp6+BljleBey4FsLYzMDTN AnEt+XXzBasuSn65UIV1QUOxZaaB8PrFf/DTLruHQrkgcoSt6YBw0rPOx1TXACdBSrwG UhiP4RnzYKgzO5rMBxE8KDTm5r+/dkZQUM/eNfc3OTL3Jukpu4VylbOw6SfcPlgtNDa6 OwWQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id je11-20020a170903264b00b001b045d65aedsi1060846plb.228.2023.05.29.01.03.11; Mon, 29 May 2023 01:03:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231552AbjE2HpI (ORCPT + 99 others); Mon, 29 May 2023 03:45:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbjE2HpB (ORCPT ); Mon, 29 May 2023 03:45:01 -0400 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07F62AC; Mon, 29 May 2023 00:44:54 -0700 (PDT) X-QQ-mid: bizesmtp75t1685346271t2dsh6fi Received: from wxdbg.localdomain.com ( [183.159.96.128]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 29 May 2023 15:44:22 +0800 (CST) X-QQ-SSF: 01400000000000J0Z000000A0000000 X-QQ-FEAT: eSZ1CZgv+JDnClWgMPbLdL6Yn+9Meybq4WT4eTj7rXbJ1L6TQWpUnAm2mROMV ofkFElQi08BdjMr3eXJJvzEyZrfjFKXQKDeDc+xIjLLOe+89hbMXvZLj85XvjjHkQCwHVeI QOsqlNZg3wFTsPTgJaSN1+tNg9K6HIWXe9ZhPcSvCvDJCLbXMv3b6upAPUc0c4Zc9PdjDl3 M0C57woFwk39p2d3WLFdVHSYL1TwEsCegCK1Ojglw2g8QGG+/XhaydOaBuxFANp/hLp3b6W cOTuiLInlp3THu6N0GA2tFCej5jx72TcKz7pPtp+X7carWLjqzSi+n8d6CjnYQ9KbSw/2VN mXhXQcPJMn96a2YqLBPugtpj9d9fuF/z3Mf4FAyGYmI3AwezwUD9M84vd1i4w== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 9551324987145372188 From: Jiawen Wu To: linus.walleij@linaro.org, brgl@bgdev.pl, andy.shevchenko@gmail.com, shreeya.patel@collabora.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiawen Wu Subject: [PATCH] gpiolib: Fix GPIO chip IRQ initialization restriction Date: Mon, 29 May 2023 15:42:27 +0800 Message-Id: <20230529074227.636933-1-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767214839164279968?= X-GMAIL-MSGID: =?utf-8?q?1767214839164279968?= In case of gpio-regmap, IRQ chip is added by regmap-irq and associated with GPIO chip by gpiochip_irqchip_add_domain(). The initialization flag was not added in gpiochip_irqchip_add_domain(), causing gpiochip_to_irq() to return -EPROBE_DEFER. Fixes: 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members before initialization") Signed-off-by: Jiawen Wu Cc: shreeya.patel@collabora.com --- drivers/gpio/gpiolib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 04fb05df805b..1b6cd4ffb761 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1789,6 +1789,7 @@ int gpiochip_irqchip_add_domain(struct gpio_chip *gc, gc->to_irq = gpiochip_to_irq; gc->irq.domain = domain; + gc->irq.initialized = true; return 0; }