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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31E8DC7618B for ; Fri, 26 Jul 2019 13:00:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAFCA21871 for ; Fri, 26 Jul 2019 13:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564146036; bh=snCw1Um158mBU573ITh1t2XMjU+DZqyBDhQJBAQqx7c=; h=Subject:To:Cc:From:Date:List-ID:From; b=Xa2Tc8UjTQMXSZIWWHqpOImdx3Tv/cLu/mNWGll5mWwAm2/29NUT3dr3fJzhmI/kZ OdO7ax6OpxiMYuGxuxH8sywLUdW6y2Idfs6KBqNJu3EeqZkofB7u3gbi0wnb0NnPSs gBl+IaEi8BtXSK0lo7Fs74B1b0jlE/A8/zxHuPfs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbfGZNAf (ORCPT ); Fri, 26 Jul 2019 09:00:35 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:35797 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfGZNAf (ORCPT ); Fri, 26 Jul 2019 09:00:35 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0917356F; Fri, 26 Jul 2019 09:00:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 26 Jul 2019 09:00:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=9rGhEb mA/yWQXl9vs75MYs3lUTmp84YL82X57Y79keg=; b=i69G/3FIzt+c46Kh+LRRWA yujIpEgQaP/b5EsdbqMm5oyd8FIRJa7h8JSWMSWJ21o2D11pcfozJaQZ+ej4KL0O 1RtcR3LuUQouvHGSAcK38jIe0BIjIDsXkBIJKWHYZkdb75SHM4w92owIaCE006sL ruM2meGd3Cc+hc08+2IA4GDXJ1AEhsgiS7ya4J+6SsezQwano9DlStHgvAub8l/o onPnSt8pZm5ya0WNFz8auJShyZMpQZp7Wx/decK7IS6mm53aHA4vJuR7V7GeveFU CbSZ9j8G/drY6latsyvlr+ZbdqxlXMyDtBX4cfOV+eo7OjFnF+zvBT3RwuUYCOXA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrkeeggdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 982C680063; Fri, 26 Jul 2019 09:00:31 -0400 (EDT) Subject: WTF: patch "[PATCH] gpio: em: remove the gpiochip before removing the irq domain" was seriously submitted to be applied to the 5.2-stable tree? To: bgolaszewski@baylibre.com, geert+renesas@glider.be, geert@linux-m68k.org Cc: From: Date: Fri, 26 Jul 2019 15:00:30 +0200 Message-ID: <1564146030179130@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below was submitted to be applied to the 5.2-stable tree. I fail to see how this patch meets the stable kernel rules as found at Documentation/process/stable-kernel-rules.rst. I could be totally wrong, and if so, please respond to and let me know why this patch should be applied. Otherwise, it is now dropped from my patch queues, never to be seen again. thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 19ec11a2233d24a7811836fa735203aaccf95a23 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 11 Jul 2019 10:29:35 +0200 Subject: [PATCH] gpio: em: remove the gpiochip before removing the irq domain In commit 8764c4ca5049 ("gpio: em: use the managed version of gpiochip_add_data()") we implicitly altered the ordering of resource freeing: since gpiochip_remove() calls gpiochip_irqchip_remove() internally, we now can potentially use the irq_domain after it was destroyed in the remove() callback (as devm resources are freed after remove() has returned). Use devm_add_action_or_reset() to keep the ordering right and entirely kill the remove() callback in the driver. Reported-by: Geert Uytterhoeven Fixes: 8764c4ca5049 ("gpio: em: use the managed version of gpiochip_add_data()") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Reviewed-by: Geert Uytterhoeven diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index b6af705a4e5f..a87951293aaa 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -259,6 +259,13 @@ static const struct irq_domain_ops em_gio_irq_domain_ops = { .xlate = irq_domain_xlate_twocell, }; +static void em_gio_irq_domain_remove(void *data) +{ + struct irq_domain *domain = data; + + irq_domain_remove(domain); +} + static int em_gio_probe(struct platform_device *pdev) { struct em_gio_priv *p; @@ -333,39 +340,30 @@ static int em_gio_probe(struct platform_device *pdev) return -ENXIO; } + ret = devm_add_action_or_reset(&pdev->dev, em_gio_irq_domain_remove, + p->irq_domain); + if (ret) + return ret; + if (devm_request_irq(&pdev->dev, irq[0]->start, em_gio_irq_handler, 0, name, p)) { dev_err(&pdev->dev, "failed to request low IRQ\n"); - ret = -ENOENT; - goto err1; + return -ENOENT; } if (devm_request_irq(&pdev->dev, irq[1]->start, em_gio_irq_handler, 0, name, p)) { dev_err(&pdev->dev, "failed to request high IRQ\n"); - ret = -ENOENT; - goto err1; + return -ENOENT; } ret = devm_gpiochip_add_data(&pdev->dev, gpio_chip, p); if (ret) { dev_err(&pdev->dev, "failed to add GPIO controller\n"); - goto err1; + return ret; } return 0; - -err1: - irq_domain_remove(p->irq_domain); - return ret; -} - -static int em_gio_remove(struct platform_device *pdev) -{ - struct em_gio_priv *p = platform_get_drvdata(pdev); - - irq_domain_remove(p->irq_domain); - return 0; } static const struct of_device_id em_gio_dt_ids[] = { @@ -376,7 +374,6 @@ MODULE_DEVICE_TABLE(of, em_gio_dt_ids); static struct platform_driver em_gio_device_driver = { .probe = em_gio_probe, - .remove = em_gio_remove, .driver = { .name = "em_gio", .of_match_table = em_gio_dt_ids,