Received: by 10.223.185.116 with SMTP id b49csp1125661wrg; Fri, 23 Feb 2018 12:22:38 -0800 (PST) X-Google-Smtp-Source: AH8x225D14wDqWwWJ7O0u3+ZBgwqsZKfErN8lbMa1dNr6wwVIIFI5Sh0WvXY5eMyi4IyExQ5b0Dv X-Received: by 10.99.120.193 with SMTP id t184mr2378642pgc.348.1519417357966; Fri, 23 Feb 2018 12:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417357; cv=none; d=google.com; s=arc-20160816; b=tLq9pi9ckixJdm2BCQrqSt/WV4Mt/ESDaI9l2LYnRsnReufXiAvBfS6+z+DKfioCZc dNcT+4Dz7vERagq+3S9hDgmwrpO485LwcJ55tB+U4GV3c8bgTGP2xTzWK29SYgqNMfd5 51tCH8IA6hVQBONoMpX9vqEUiDhsDv0w/XiQTJ77ymKOAAs2AGGlGn09bUAgpV1ovrmH ILLH5vx0CfS0IrjQhYW/UN3wARByjBHrOz0Yuhhnb58tK9B65mUq7S+KQafskQSg3sAm ZJJ/7M4Kgq8thoQ8Pat/OPu2xq+NTVna5nh34wSMy1rUIXILFB01dMnEShouoWqbTCtC pl4g== 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=ZMT5V3KdQXU7zXqMgW1H/i1b5vBp4LR1XMuEkxmLkfM=; b=zkcY92uPHMzXIc5SejtdAKx9Qyb/OXmCvo+GZXoRCY9TPDSpBvPvD2cv2WBOwTC60R Wx/6Cx+RqrqBgZaqb5aeXpGUitQdgFusrEP+gnMUE5VaGiS7Cthe6Cy64gbm7wSydEHF WVxQSDKGbCDWw8ZkbSY1hiQdkLORvPHz482Fnyk7GrgoYvE2caVZ1CXMFvf0+X1+f9o3 mi/ZSjvhHj02hHnoYuD/uqIyv7k0Pb0q9NsyRtptp3A8OBHJswd88lSdEFb8M6JdffbM eTzt/QNW6oCyw8jzqk6V+2NWfeRyeHcRUtoqIP6JJlzCid5JdcDWUGXouoq7BJoqqisW PTGA== 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 j127si1885348pgc.653.2018.02.23.12.22.23; Fri, 23 Feb 2018 12:22:37 -0800 (PST) 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 S932414AbeBWSij (ORCPT + 99 others); Fri, 23 Feb 2018 13:38:39 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39366 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754024AbeBWSig (ORCPT ); Fri, 23 Feb 2018 13:38:36 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 90BD910D7; Fri, 23 Feb 2018 18:38:35 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Luis R. Rodriguez" , Wolfram Sang Subject: [PATCH 4.4 128/193] i2c: remove __init from i2c_register_board_info() Date: Fri, 23 Feb 2018 19:26:01 +0100 Message-Id: <20180223170345.922970960@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luis R. Rodriguez commit 5abe9b26847c65a698f38744a52635b287514294 upstream. As of next-20160607 with allyesconfig we get this linker failure: MODPOST vmlinux.o WARNING: vmlinux.o(.text+0x21bc0d): Section mismatch in reference from the function intel_scu_devices_create() to the function .init.text:i2c_register_board_info() This is caused by the fact that intel_scu_devices_create() calls i2c_register_board_info() and intel_scu_devices_create() is not annotated with __init. This typically involves manual code inspection and if one is certain this is correct we would just peg intel_scu_devices_create() with a __ref annotation. In this case this would be wrong though as the intel_scu_devices_create() call is exported, and used in the ipc_probe() on drivers/platform/x86/intel_scu_ipc.c. The issue is that even though builtin_pci_driver(ipc_driver) is used this just exposes the probe routine, which can occur at any point in time if this bus supports hotplug. A race can happen between kernel_init_freeable() that calls the init calls (in this case registeres the intel_scu_ipc.c driver, and later free_initmem(), which would free the i2c_register_board_info(). If a probe happens later in boot i2c_register_board_info() would not be present and we should get a page fault. Signed-off-by: Luis R. Rodriguez [wsa: made function declaration a one-liner] Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/i2c-boardinfo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/i2c/i2c-boardinfo.c +++ b/drivers/i2c/i2c-boardinfo.c @@ -56,9 +56,7 @@ EXPORT_SYMBOL_GPL(__i2c_first_dynamic_bu * The board info passed can safely be __initdata, but be careful of embedded * pointers (for platform_data, functions, etc) since that won't be copied. */ -int __init -i2c_register_board_info(int busnum, - struct i2c_board_info const *info, unsigned len) +int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned len) { int status;