Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp1013206rdb; Fri, 1 Sep 2023 10:06:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJyg9AehKjVZkCSPx4JVEhanGci6pSd9TneSUy3lPAqig1RjaqUt4a8uyg/rEeZy4hEzxJ X-Received: by 2002:a17:90a:f683:b0:271:7cd6:165d with SMTP id cl3-20020a17090af68300b002717cd6165dmr3050130pjb.26.1693587986167; Fri, 01 Sep 2023 10:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693587986; cv=none; d=google.com; s=arc-20160816; b=lxW6DUgDeJ+sdvl7mHoNxOUyBtS8dUn6UxOX278z5SWGDTzntbGB3XZV4EdaYAXB2M xNw4a9359Ut/shlUvJ/rb8yDLi0D3hKrbsjiyoHf3xJCNsD6Wk9latShc+UUPQlAKo6c 4r//BkmhJgRpzFW3BnnjaRNWLdq7p1XfPmDEpl/aURiM28MfU5KoF3m9alX6D6kA0FVg zoHC+D2Qd/NVFK9t+4IRfUX41kfzGmqBjdL6kTp9nXEA8ZCq3Eafy8C6/gey4qfwrCn7 5dUlIpbyoUVee3EE5CPHTrYxgZoLCFsX8wzqlYWOmnMfz2HNBTpfPD+2hiBChvWbtNIL T2eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=s4vO5rlHGjemIi5rqB6BKtYyZb3xmo2Mj0tlWrhSbB8=; fh=R/LKeUrLG/8v4oOIY4fOZv0pbchYqse67R2bIk5+EuQ=; b=NzFXckLFJEhuPv6tHqYWv/wPNnYF7uf0C7ulgCV5FFF8MSZWI7IwtfhUkUbInvSppS +9s8eWTzhIXBO7kdQB/HDCgg2xe79MtaZYzF4smXUvCHGCAHXcn+Q+du5AP8U2OrviVj QRJFV9Bgxfq9V6cgFu5/k2NgVlJHdNRL8zmfhmQwYstvzb7tJMvbXM3Oq7UNg9fSn6xR bVc9BCt3DTZPFOUTtibGyFjqL/X0b9GUpMwlTAedddq0Dev8OpP+adsb8p/9KoWIODBh RrfK1rSRlMTG0iM4lmpIdOVxKS5B3rQ2R+RTYnagXI0HTfX3o3baPChlvB2g8b7C4U/H Swdg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a656793000000b005638183ab90si3060609pgr.611.2023.09.01.10.05.47; Fri, 01 Sep 2023 10:06:26 -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 S1349483AbjIAMeV (ORCPT + 99 others); Fri, 1 Sep 2023 08:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238417AbjIAMeU (ORCPT ); Fri, 1 Sep 2023 08:34:20 -0400 X-Greylist: delayed 577 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 01 Sep 2023 05:34:17 PDT Received: from mail.bugwerft.de (mail.bugwerft.de [46.23.86.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1C6F910CF; Fri, 1 Sep 2023 05:34:17 -0700 (PDT) Received: from hq-00595.fritz.box (unknown [176.126.217.202]) by mail.bugwerft.de (Postfix) with ESMTPSA id C227D280203; Fri, 1 Sep 2023 12:24:37 +0000 (UTC) From: Daniel Mack To: linux-gpio@vger.kernel.org, manikanta.guntupalli@amd.com Cc: linux-kernel@vger.kernel.org, Daniel Mack , stable@kernel.org Subject: [PATCH] gpio: zynq: restore zynq_gpio_irq_reqres/zynq_gpio_irq_relres callbacks Date: Fri, 1 Sep 2023 14:24:24 +0200 Message-ID: <20230901122424.247070-1-daniel@zonque.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Commit f56914393537 ("gpio: zynq: fix zynqmp_gpio not an immutable chip warning") ditched the open-coded resource allocation handlers in favor of the generic ones. These generic handlers don't maintain the PM runtime anymore, which causes a regression in that level IRQs are no longer reported. Restore the original handlers to fix this. Signed-off-by: Daniel Mack Fixes: f56914393537 ("gpio: zynq: fix zynqmp_gpio not an immutable chip warning") Cc: stable@kernel.org --- drivers/gpio/gpio-zynq.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 0a7264aabe48..324e942c0650 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -575,6 +575,26 @@ static int zynq_gpio_set_wake(struct irq_data *data, unsigned int on) return 0; } +static int zynq_gpio_irq_reqres(struct irq_data *d) +{ + struct gpio_chip *chip = irq_data_get_irq_chip_data(d); + int ret; + + ret = pm_runtime_resume_and_get(chip->parent); + if (ret < 0) + return ret; + + return gpiochip_reqres_irq(chip, d->hwirq); +} + +static void zynq_gpio_irq_relres(struct irq_data *d) +{ + struct gpio_chip *chip = irq_data_get_irq_chip_data(d); + + gpiochip_relres_irq(chip, d->hwirq); + pm_runtime_put(chip->parent); +} + /* irq chip descriptor */ static const struct irq_chip zynq_gpio_level_irqchip = { .name = DRIVER_NAME, @@ -584,9 +604,10 @@ static const struct irq_chip zynq_gpio_level_irqchip = { .irq_unmask = zynq_gpio_irq_unmask, .irq_set_type = zynq_gpio_set_irq_type, .irq_set_wake = zynq_gpio_set_wake, + .irq_request_resources = zynq_gpio_irq_reqres, + .irq_release_resources = zynq_gpio_irq_relres, .flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED | IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE, - GPIOCHIP_IRQ_RESOURCE_HELPERS, }; static const struct irq_chip zynq_gpio_edge_irqchip = { @@ -597,8 +618,9 @@ static const struct irq_chip zynq_gpio_edge_irqchip = { .irq_unmask = zynq_gpio_irq_unmask, .irq_set_type = zynq_gpio_set_irq_type, .irq_set_wake = zynq_gpio_set_wake, + .irq_request_resources = zynq_gpio_irq_reqres, + .irq_release_resources = zynq_gpio_irq_relres, .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE, - GPIOCHIP_IRQ_RESOURCE_HELPERS, }; static void zynq_gpio_handle_bank_irq(struct zynq_gpio *gpio, -- 2.41.0