From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753300AbdKMO6i (ORCPT ); Mon, 13 Nov 2017 09:58:38 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:44887 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783AbdKMO6g (ORCPT ); Mon, 13 Nov 2017 09:58:36 -0500 X-Google-Smtp-Source: AGs4zMb6ym+R+/4gr3gGS9Maieh4M+4eOOxcUMGlDDlnEb0uNAEeqxGM9byq5lVzvBvir1hycbydHA== Subject: Re: [PATCH] clocksource/drivers/timer-of: mark timer_of_exit as __init To: Sudeep Holla , Arnd Bergmann Cc: Thomas Gleixner , Benjamin Gaignard , LKML References: <20171106133450.482858-1-arnd@arndb.de> <20171113101107.GA9084@e107155-lin> From: Daniel Lezcano Message-ID: <6cdbbe9b-309a-7cb9-648f-7df2295c510f@linaro.org> Date: Mon, 13 Nov 2017 15:58:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171113101107.GA9084@e107155-lin> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/11/2017 11:11, Sudeep Holla wrote: > On Sun, Nov 12, 2017 at 11:24:56PM +0100, Arnd Bergmann wrote: >> On Sun, Nov 12, 2017 at 10:16 PM, Thomas Gleixner wrote: >>> On Mon, 6 Nov 2017, Arnd Bergmann wrote: >>>> The newly added function triggers a harmless Kbuild warning because >>>> of a missing annotation: >>>> >>>> WARNING: vmlinux.o(.text+0x448098): Section mismatch in reference from the function timer_of_exit() to the function .init.text:timer_clk_exit() >>>> The function timer_of_exit() references >>>> the function __init timer_clk_exit(). >>>> This is often because timer_of_exit lacks a __init >>>> annotation or the annotation of timer_clk_exit is wrong. >>>> >>>> The function is only called from other __init functions, so it >>>> can safely be marked as __init as well. >>> >>> Hmm. I don't see any caller at all. From the intention of the patch I >>> assume this isn't designed for using from init functions, so we rather have >>> to remove the __init annotations from the called functions. >>> >>> Sudeep posted a patch which does that: >>> >>> https://lkml.kernel.org/r/1509979716-10646-1-git-send-email-sudeep.holla@arm.com >>> >>> Though I rather would know whether this function is going to be used at >>> all and what the intention of this patch was. >>> >>> Benjamin???? >> >> My interpretation was that timer drivers are still supposed to be unregistered >> at module unload time, but that you might use the new timer_of_exit() >> in the failure path of whatever function calls timer_of_init() successfully >> when something fails in the next step. >> >> Sudeep's interpretation also makes sense, I had not thought of that, but >> I now found the patch that adds a user in an init function: >> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1519644.html >> >> It seems I guessed right and Sudeep guessed wrong (both by pure chance >> I admit). > > Ah OK, I just went by name that it will be called by some exit/remove > function. > >> Both patches solve the problem, Sudeep's version is a little >> more robust in case we ever add a caller in an __exit function (which I >> think is currently not allowed), while mine saves a little bit of memory >> and matches the current usage better. >> > > Agreed, may be if we add users which is called from init functions, the > warning should disappear. Also as tglx suggested, we could rename if it's > just used from init function error/exit paths. The drivers are not compiled as module AFAICT, the function will be called in the init error path. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog