Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2586353imw; Wed, 6 Jul 2022 08:24:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sJxZXz9XCLuWYD4akV+HSNFhdLtdxzzWmZ6nttaNxWV+fnCEPgK8L3lj346wBiNJ+qq1N4 X-Received: by 2002:a17:90b:1650:b0:1ec:b5e7:42ae with SMTP id il16-20020a17090b165000b001ecb5e742aemr49149318pjb.15.1657121079745; Wed, 06 Jul 2022 08:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657121079; cv=none; d=google.com; s=arc-20160816; b=phW/+/QU1x7AAM/LOK4Y7r0kJ0LOBjm/0jRxkPEH4qbJwDkSI0yG4Cd1zYOsFy/st9 KxCDsFOr+MgFrbSTbAKHiR7IO9vwKGzixgkjPxG+ivXwTnf4AR4n8BUvskoVeAbSIwZU Y8SfoBoM0LVhuZ6jFp3hRS6erjht4VeAlYLPI21ZzX/w3kvhfWcxCOmscuwUGF1QTgR2 Km/cxdpoXAIRpgdWkSTbD0f/MMk+LEsQnxu8I+ULwtutH+May/EcaCdnVj9YWh0KGbps f+YpflFfT/3q9xkfLHmVXm2nW6EuNGqd/uihNl4ZhddJKVs16z7h7NjcNYECdR5sbs5a 3BDg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u1fHJMZl7JVZVxeg5jiWFWDAPjazuTqXidgDNR+l1Uo=; b=q+dv7ONM17JdARPPlbdubIDa1kFBTe43lLCD0e6OOOj+IqYngvsYk2NrqVdkk/H5ec sAgrh9hsNKQSiaVtAjprC4oUF1lyp/o1oF3stRFxhQOuUnz+us8GlaTfKGI9Rq/aKJgg X4R6u/QBj2W5FIep6vKELTsStMe0MKXnwhS5zxjbO5GQRSyLssJ79+zVV8U7DywywtKi 19lRPHh+hCI+O21V3rn0R7xFlLZJ87N/e5vbLACsXfcH4P8slQh9FUdCBiFghXCnC6Hg Eo+mN44Ui61nWHoq2mJEv2F87rKhKJaHrgcGfCJO0aB+EXSRL+fEwdhywlWnJTue6+pW w16Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=qUclemBV; 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 n10-20020a17090a9f0a00b001ef8ab5f4e6si10111180pjp.126.2022.07.06.08.24.27; Wed, 06 Jul 2022 08:24:39 -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=@walle.cc header.s=mail2016061301 header.b=qUclemBV; 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 S233371AbiGFPQL (ORCPT + 99 others); Wed, 6 Jul 2022 11:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbiGFPQJ (ORCPT ); Wed, 6 Jul 2022 11:16:09 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A906237EF; Wed, 6 Jul 2022 08:16:08 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 6B97622248; Wed, 6 Jul 2022 17:16:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1657120566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u1fHJMZl7JVZVxeg5jiWFWDAPjazuTqXidgDNR+l1Uo=; b=qUclemBVdHEmkD5WOlJeHrjDeWl26LsOZpTtHl6Oer9NZMsIUybGx/uckf3ddAAJVd+58j jvBAR3biT7aKoYBP9ju5hN6pJ1j9S4crhcum3voJ3A8y81aFjp+KOMzCnuz+zLgX7ywyY7 qFf77ixPqHdD4DE0Hc8XJmB83GigeC0= From: Michael Walle To: Linus Walleij , Marc Zyngier , Thomas Gleixner Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH 2/2] pinctrl: ocelot: make irq_chip immutable Date: Wed, 6 Jul 2022 17:15:53 +0200 Message-Id: <20220706151553.1580790-2-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220706151553.1580790-1-michael@walle.cc> References: <20220706151553.1580790-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Since recently, the kernel is nagging about mutable irq_chips: [ 2.593426] gpio gpiochip0: (ocelot-gpio): not an immutable chip, please consider fixing it! Make it const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Michael Walle --- drivers/pinctrl/pinctrl-ocelot.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index 349e063a04fa..5902a77be5ef 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -1761,6 +1761,7 @@ static void ocelot_irq_mask(struct irq_data *data) regmap_update_bits(info->map, REG(OCELOT_GPIO_INTR_ENA, info, gpio), BIT(gpio % 32), 0); + gpiochip_disable_irq(chip, gpio); } static void ocelot_irq_unmask(struct irq_data *data) @@ -1769,6 +1770,7 @@ static void ocelot_irq_unmask(struct irq_data *data) struct ocelot_pinctrl *info = gpiochip_get_data(chip); unsigned int gpio = irqd_to_hwirq(data); + gpiochip_enable_irq(chip, gpio); regmap_update_bits(info->map, REG(OCELOT_GPIO_INTR_ENA, info, gpio), BIT(gpio % 32), BIT(gpio % 32)); } @@ -1790,8 +1792,10 @@ static struct irq_chip ocelot_eoi_irqchip = { .irq_mask = ocelot_irq_mask, .irq_eoi = ocelot_irq_ack, .irq_unmask = ocelot_irq_unmask, - .flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED, + .flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED | + IRQCHIP_IMMUTABLE, .irq_set_type = ocelot_irq_set_type, + GPIOCHIP_IRQ_RESOURCE_HELPERS }; static struct irq_chip ocelot_irqchip = { @@ -1800,6 +1804,8 @@ static struct irq_chip ocelot_irqchip = { .irq_ack = ocelot_irq_ack, .irq_unmask = ocelot_irq_unmask, .irq_set_type = ocelot_irq_set_type, + .flags = IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS }; static int ocelot_irq_set_type(struct irq_data *data, unsigned int type) @@ -1863,7 +1869,7 @@ static int ocelot_gpiochip_register(struct platform_device *pdev, irq = platform_get_irq_optional(pdev, 0); if (irq > 0) { girq = &gc->irq; - girq->chip = &ocelot_irqchip; + gpio_irq_chip_set_chip(girq, &ocelot_irqchip); girq->parent_handler = ocelot_irq_handler; girq->num_parents = 1; girq->parents = devm_kcalloc(&pdev->dev, 1, -- 2.30.2