From patchwork Fri Dec 21 19:25:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10740983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA34813A4 for ; Fri, 21 Dec 2018 19:25:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA62028892 for ; Fri, 21 Dec 2018 19:25:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE6BD28895; Fri, 21 Dec 2018 19:25:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7705328892 for ; Fri, 21 Dec 2018 19:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bmFhAUaV6PbvkF43DCLmwEq6FXzvW4ntcAVexQebNBM=; b=BVTNwY7W+Ia2gn 5ApXAx7JgaeaZOOxbZpw/upfzDOO0wVc/AlJrPOIE2OF1CkcMUgMROgwgdqEB6TJdndkZAkRQEB9h nFDKX1P/A0VVoYLy2pJt2Y21Y6VavrmzsMWUBLe3ZkFVIvXFrxbGM+pCJr0CiXUprWZW+tMTaUL3x OOm85I4tW3p6i9QkbnluAQXFGtfIZvLqbiQW/68dpFO500OYYNSr6MMeDqSrtiq61QvGV9lZGeXMP SaI7aJOn7nh6ANPDjlGrQyhpMDK/dX+r2VPTN79ktdvOYni5UuNSPwWTs6QNSyeOc7o27HMR7EXbA 1UWd8K/L4L09SCe2YVpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaQQh-0003YH-Jr; Fri, 21 Dec 2018 19:25:51 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaQQW-0003OX-6L for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2018 19:25:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F2BB1596; Fri, 21 Dec 2018 11:25:34 -0800 (PST) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F157B3F575; Fri, 21 Dec 2018 11:25:32 -0800 (PST) From: James Morse To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] firmware: arm_sdei: fix wrong of_node_put() in init function Date: Fri, 21 Dec 2018 19:25:18 +0000 Message-Id: <20181221192519.94915-2-james.morse@arm.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181221192519.94915-1-james.morse@arm.com> References: <20181221192519.94915-1-james.morse@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181221_112540_262752_29364E93 X-CRM114-Status: GOOD ( 12.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , James Morse , Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicolas Saenz Julienne After finding a "firmware" dt node arm_sdei tries to match it's compatible string with it. To do so it's calling of_find_matching_node() which already takes care of decreasing the refcount on the "firmware" node. We are then incorrectly decreasing the refcount on that node again. This patch removes the unwarranted call to of_node_put(). Signed-off-by: Nicolas Saenz Julienne Signed-off-by: James Morse --- drivers/firmware/arm_sdei.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index 1ea71640fdc2..dffb47c6b480 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -1017,7 +1017,6 @@ static bool __init sdei_present_dt(void) return false; np = of_find_matching_node(fw_np, sdei_of_match); - of_node_put(fw_np); if (!np) return false; From patchwork Fri Dec 21 19:25:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 10740985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBC1713B5 for ; Fri, 21 Dec 2018 19:26:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAFE328895 for ; Fri, 21 Dec 2018 19:26:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF51D28899; Fri, 21 Dec 2018 19:26:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B8E628895 for ; Fri, 21 Dec 2018 19:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bJ3zPrtMiGBdzkODj0/4huEpKaEPLUpAl8Rgp6VmlPg=; b=a1zAnEntyPDMRO zKnvDUJDuQBr8ZbU26qDXRiOFkPINi8n2C3MpygHLZej0vJzOTiNi0V2w4nZOZPY8G5oSenem3X7b Zl7rFV2nwgk6X40hKsouUnQyS/tgaOqBqovf9Ojo5OGBjP8Cbm7A0Y0RdrAj8CJijhzKrZsN9RnZq Wp4C4B4NlIlgZghLQNGRHUhC5FUXxB93WJM7/ZqSYUMA1DFEOyPhMg7cMqDyaNOtbDG70HrBQTkHU Wj+z3puDzWiE8f7M5VWs5MTfqQDdkgZpPBJwPEglMbPegcV+G3UatJyG6F85iQnS8PftzArhNa4GK 9NP3zs7bJTZ7Pa7EF/8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaQR8-0003tp-BS; Fri, 21 Dec 2018 19:26:18 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaQQW-0003OZ-6O for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2018 19:25:42 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B702615AD; Fri, 21 Dec 2018 11:25:36 -0800 (PST) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A539D3F575; Fri, 21 Dec 2018 11:25:35 -0800 (PST) From: James Morse To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] firmware: arm_sdei: Fix DT platform device creation Date: Fri, 21 Dec 2018 19:25:19 +0000 Message-Id: <20181221192519.94915-3-james.morse@arm.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181221192519.94915-1-james.morse@arm.com> References: <20181221192519.94915-1-james.morse@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181221_112540_262839_B862928F X-CRM114-Status: GOOD ( 11.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , James Morse , Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP It turns out the dt-probing part of this wasn't tested properly after it was merged. commit 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()") changed the core-code to generate the platform devices, meaning the driver's attempt fails, and it bails out. Fix this by removing the manual platform-device creation for DT systems, core code has always done this for us. CC: Nicolas Saenz Julienne Signed-off-by: James Morse --- Why is this useful on DT systems? The spec has parts to bind interrupts as NMI, and signal CPUs with a well known event number. As probing has evidently never worked with DT I don't think it needs a fix/stable tag. --- drivers/firmware/arm_sdei.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index dffb47c6b480..c64c7da73829 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -1009,7 +1009,6 @@ static struct platform_driver sdei_driver = { static bool __init sdei_present_dt(void) { - struct platform_device *pdev; struct device_node *np, *fw_np; fw_np = of_find_node_by_name(NULL, "firmware"); @@ -1019,11 +1018,7 @@ static bool __init sdei_present_dt(void) np = of_find_matching_node(fw_np, sdei_of_match); if (!np) return false; - - pdev = of_platform_device_create(np, sdei_driver.driver.name, NULL); of_node_put(np); - if (!pdev) - return false; return true; }