Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2037271imm; Mon, 16 Jul 2018 00:37:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdYV/+5oFe5wFrU/Dk0jVYENtfAlYDTbOW7eAJX2R/i7e6vqsRCCmvLvXd22p1aPKYI0+2O X-Received: by 2002:a17:902:6b84:: with SMTP id p4-v6mr15631346plk.272.1531726630059; Mon, 16 Jul 2018 00:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726630; cv=none; d=google.com; s=arc-20160816; b=jcXk1portTTnt7lC0IsU01eiWfnzwI0vGXdNa8+DMGFo0/TwrjBte7gub5yFBODBbs 6wFQnIQHRdqRo3D2Dtdo0Qn6AdKUkbx4JktOj7/oy+zstE9ubSFIVWWKYVctWBBefv9A Tb3B2UJROuKPGzm0ab/QDzuBjKaQgMNqWwhI1c/X+ewrLWuGFqcysKd+kn6um4e9td2Q XrJditoDhqlep1Ilgvlmy6rH8dloxWoxvqVEsWNJWPCBbS2Zznq05EZ9icPJpHLp6lcn 0IrpTH940ZOc3We5ZwW7zJJunlxz7RF5bmENl+oU5paKWXlotAIRppcUdP0EU/IaxJlb Yrkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pdRBfZt2kG0+I42nBdmEN0+qBONY7IQKuHuI60Z3D8Y=; b=XXwV/GizZ2rHp2BiueWpUxpW8t7GFjvMwHZbIx4zPO+j4npbHZhgn0a8cQYhdHRls5 7QHromz9MGQzUlFsmiel8pz3sZMvfW8C3DnQKxAVTJw1UwVGqZ/WJFfVW6DCvrGx4aKk Fir9zArGwDGmHou++OlR0pnGaeXt/mHt1i0QSIzsZatLrStVIMJfsCa+i1/6AkT1NWQc kQJ+pGGoZRunnFsMBYyi6U4O4k85ZIKnZAhZNaqy8zdGwVzKgzB41qZox0wVatR8xqbQ zdK2SoRH5W6USnw1PGNnWDVg2lNsDAmpr+iZc5KTF7zYUtzEVxokpM0LqnPRRtTyTsng 5aVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d30-v6si2096983pld.428.2018.07.16.00.36.43; Mon, 16 Jul 2018 00:37:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730897AbeGPICC (ORCPT + 99 others); Mon, 16 Jul 2018 04:02:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46586 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730092AbeGPICB (ORCPT ); Mon, 16 Jul 2018 04:02:01 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2D779CA5; Mon, 16 Jul 2018 07:36:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , Fabio Estevam , Philipp Zabel , Lucas Stach Subject: [PATCH 4.17 06/67] drm/etnaviv: Fix driver unregistering Date: Mon, 16 Jul 2018 09:34:35 +0200 Message-Id: <20180716073444.139871619@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fabio Estevam commit bf6ba3aeb2962e5ee4a78e7535af579ecba630bb upstream. Russell King reported: "When removing and reloading the etnaviv module, the following splat occurs: sysfs: cannot create duplicate filename '/devices/platform/etnaviv' CPU: 0 PID: 1471 Comm: modprobe Not tainted 4.17.0+ #1608 Hardware name: Marvell Dove (Cubox) Backtrace: [] (dump_backtrace) from [] (show_stack+0x18/0x1c) r6:ef033e38 r5:ee07b340 r4:edb9d000 r3:00000000 [] (show_stack) from [] (dump_stack+0x20/0x28) [] (dump_stack) from [] (sysfs_warn_dup+0x5c/0x70) [] (sysfs_warn_dup) from [] (sysfs_create_dir_ns+0x90/0x98) ..." Commit 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node") introduced DRM registration via platform_device_register_simple(), but missed to call platform_device_unregister() inside etnaviv_exit(). Fix the problem by calling platform_device_unregister() inside etnaviv_exit(). While at it, also rearrange the function calls in the exit path to make them happen in the opposite order of registration. Tested on a imx6-sabresd board. Cc: Fixes: 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node") Reported-by: Russell King Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel Signed-off-by: Lucas Stach Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -742,8 +742,9 @@ module_init(etnaviv_init); static void __exit etnaviv_exit(void) { - platform_driver_unregister(&etnaviv_gpu_driver); + platform_device_unregister(etnaviv_drm); platform_driver_unregister(&etnaviv_platform_driver); + platform_driver_unregister(&etnaviv_gpu_driver); } module_exit(etnaviv_exit);