Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp344008ybl; Thu, 15 Aug 2019 18:44:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqztLVbjpaGTV9S+Z+zAjFxJxQLzQEQ8nBb9WXXmsUb1eGueooV4N/jgNpO6cwJZP6qb9mES X-Received: by 2002:a63:f07:: with SMTP id e7mr6010451pgl.238.1565919857473; Thu, 15 Aug 2019 18:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565919857; cv=none; d=google.com; s=arc-20160816; b=j1koXl28DjUidijM11SQ6E37jVPEdVWvD8yuQAWT39m257my/D2NyfqWdf4d9hOH7u qIogjfHlt/ehzVrR1vOkdN9w99zK3HocYun969feKPT9a5Yl19O1av8yTV549kcHe2o0 tYXX6KENnaMl+SUdyLSxV82eAwsQAIaGkJzkZ9GcyxPOKmOuxaY8uC8oLBMDL1RhCzj6 XyGLsHSwSB5hAWQmGFphNPOSYZmWiZZmeBg8KJ9xB+l2c7bjxBMOOOC4gS5LIYdEzARm z5o7WPVgZLnlGw33JdWPUZeToXXw9TLGZjruYnDr8liTMeAEd98GYOVCuaakIsIU5NF+ OtmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8VbhEcPGlD1jR06LiS0BPOdxImUFEJIhW0+NTt0heb4=; b=fMHoTWTIMR07Ro2ekFWy3cVTkmM1Lcl2F1XhRrwnlXMimjaiMnLLwIzf4iyYNzoq7S m5AiOCW9NNm14pFlMinPov9MenHwKQUcB8Q0G8omE8sptbpKjWOJr07OffRYh9LIEjIH 6ch9+wmJgVwdv8Mkv597qwECEgX4jymh0Mw1qradCcO3pJogcQSro1ZQCo8AxlIRefx0 BjbO7z+GdGA3dsWciau+KS4ctsuw5GRlRqueMYulpVJH2QZeHFEPf52cF/Q6Y7APuE1V IbBeM7jkXBfZiqH+y7ReUplXanBbRwNXOhTSrZECLjgzAHE6iEjz7Qc/ujxVLFJtAoE/ hLiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@runbox.com header.s=rbselector1 header.b="IEnS2BL/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=runbox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si2964797plu.126.2019.08.15.18.44.00; Thu, 15 Aug 2019 18:44:17 -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; dkim=pass header.i=@runbox.com header.s=rbselector1 header.b="IEnS2BL/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=runbox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbfHPBmd (ORCPT + 99 others); Thu, 15 Aug 2019 21:42:33 -0400 Received: from aibo.runbox.com ([91.220.196.211]:48518 "EHLO aibo.runbox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbfHPBmc (ORCPT ); Thu, 15 Aug 2019 21:42:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=8VbhEcPGlD1jR06LiS0BPOdxImUFEJIhW0+NTt0heb4=; b=IEnS2BL/zufWxOFgwpg7ST+/4P ShC8HQuIFcoBnJUKuT3115ogqc3gDkdT7I6rLuSYk8Th1iSK5vJuydGewHgvvyEeixUBbF1AA5+/q m48IYLifzFZ+E6+gLAQg1DMnwoy3yuhTrcleLpMI1gaqhd5aNsYwRd4+f3EEgbRmFTjl9YNXAkdRH WGnAo9BbrnXTTUHlD8q6yr9efH2bQE5v7eJfVdhsply33F8KHwN1ssBWen8gz229PJ9sb1bNyWIVy rFt4mqc1MgOxZ4swfb4G6vqC6nqBbutRsLH6584yng9tf2XJ0YbteDeSPcPrx6Bjp3wqI8l2k/bDq /Xl9CrrQ==; Received: from [10.9.9.202] (helo=mailfront20.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1hyRGA-0006Oa-9I; Fri, 16 Aug 2019 03:42:30 +0200 Received: by mailfront20.runbox with esmtpsa [Authenticated alias (536975)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1hyRFm-0008Lw-64; Fri, 16 Aug 2019 03:42:06 +0200 From: "M. Vefa Bicakci" To: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rajneesh Bhardwaj , Vishwanath Somayaji , Darren Hart , Andy Shevchenko , "M. Vefa Bicakci" Subject: [PATCH] platform/x86: intel_pmc_core_pltdrv: Module removal warning fix Date: Thu, 15 Aug 2019 21:41:40 -0400 Message-Id: <20190816014140.10687-2-m.v.b@runbox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190816014140.10687-1-m.v.b@runbox.com> References: <20190816014140.10687-1-m.v.b@runbox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prior to this commit, removing the intel_pmc_core_pltdrv module would cause the following warning: ------------[ cut here ]------------ Device 'intel_pmc_core.0' does not have a release() function, \ it is broken and must be fixed. See Documentation/kobject.txt. WARNING: CPU: 0 PID: 2202 at drivers/base/core.c:1238 device_release+0x6f/0x80 Modules linked in: fuse intel_rapl_msr ip6table_filter ip6_tables ipt_REJECT \ nf_reject_ipv4 xt_conntrack iptable_filter xt_MASQUERADE iptable_nat nf_nat \ nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c intel_rapl_common \ intel_pmc_core_pltdrv(-) xen_netfront intel_pmc_core crct10dif_pclmul \ crc32_pclmul crc32c_intel ghash_clmulni_intel intel_rapl_perf pcspkr binfmt_misc \ u2mfn(O) xenfs xen_gntdev xen_gntalloc xen_blkback xen_privcmd xen_evtchn \ ip_tables overlay xen_blkfront CPU: 0 PID: 2202 Comm: rmmod Tainted: G W O 5.3.0-rc3-next-20190809-1 #2 RIP: 0010:device_release+0x6f/0x80 Code: 48 8b 85 c0 02 00 00 48 85 c0 74 09 48 8b 40 40 48 85 c0 75 c6 48 8b 75 50 48 85 f6 74 10 48 c7 c7 58 68 12 82 e8 5f 62 a9 ff <0f> 0b eb b5 48 8b 75 00 eb ea 0f 1f 80 00 00 00 00 0f 1f 44 00 00 RSP: 0018:ffffc90000763ea8 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffffffff822da080 RCX: 0000000000000006 RDX: 0000000000000007 RSI: 0000000000000082 RDI: ffff88813ba17540 RBP: ffffffffc0107010 R08: 0000000000000195 R09: 000000000000000d R10: 000000000000000a R11: ffffc90000763d65 R12: ffff88800c9e9000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 000071250bf142c0(0000) GS:ffff88813ba00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000060ab8fd82d49 CR3: 00000001273ba004 CR4: 00000000003606f0 Call Trace: kobject_put+0x85/0x1b0 __x64_sys_delete_module+0x14b/0x270 do_syscall_64+0x5f/0x1a0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x71250c031c6b Code: 73 01 c3 48 8b 0d 1d 42 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ed 41 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007ffec29e6038 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0 RAX: ffffffffffffffda RBX: 00006040bc3e07b0 RCX: 000071250c031c6b RDX: 000000000000000a RSI: 0000000000000800 RDI: 00006040bc3e0818 RBP: 00007ffec29e6088 R08: 1999999999999999 R09: 0000000000000000 R10: 000071250c0a6ac0 R11: 0000000000000206 R12: 00007ffec29e6250 R13: 00007ffec29e67b7 R14: 00006040bc3e0260 R15: 00007ffec29e6090 ---[ end trace 5e5421608729d6f5 ]--- This commit hence adds an empty release function for the driver. Signed-off-by: M. Vefa Bicakci --- drivers/platform/x86/intel_pmc_core_pltdrv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/platform/x86/intel_pmc_core_pltdrv.c b/drivers/platform/x86/intel_pmc_core_pltdrv.c index a8754a6db1b8..186540014c48 100644 --- a/drivers/platform/x86/intel_pmc_core_pltdrv.c +++ b/drivers/platform/x86/intel_pmc_core_pltdrv.c @@ -18,8 +18,16 @@ #include #include +static void intel_pmc_core_release(struct device *dev) +{ + /* Nothing to do. */ +} + static struct platform_device pmc_core_device = { .name = "intel_pmc_core", + .dev = { + .release = intel_pmc_core_release, + }, }; /* -- 2.21.0