From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbbJLTUq (ORCPT ); Mon, 12 Oct 2015 15:20:46 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:60112 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950AbbJLTUo (ORCPT ); Mon, 12 Oct 2015 15:20:44 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Robert Jarzmik , Haojian Zhuang , Eric Miao , Daniel Mack , linux-kernel@vger.kernel.org Subject: Re: [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Date: Mon, 12 Oct 2015 21:20:17 +0200 Message-ID: <5395757.goqVg4VzNo@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <87r3kz6hq9.fsf@belgarion.home> References: <5287252.pkh9x0t1Y6@wuerfel> <874mhw6mj1.fsf@belgarion.home> <87r3kz6hq9.fsf@belgarion.home> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:TODEgUuGdsEJtLdQF2M9IuEPHE7c9c4X8cGJd4hCBVZ3AH/QBSI pzPRAZH6vmahnJdmF4BXJrJCKrmavFwvoMuycntzlbuQEetH0x7aMuwhPaC/0GX7O1tqtW8 shbS9MFfZAJSy3KFG49FdwQF4O8YDyXDyEaTAc7U71Ylm0MqBLB2SvqfGMDHfb/zY2xqmXR eAnIR8Jm76cYrc4PGLPCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:jTTUKExf/jA=:B0FlwkEs4JkniLDNh5136v 0lp1chtUvfbROiNLCSmS8AEf1nYu0WR/15FCIUNNW9TMfqaWDOIa1Bh0WzEq5DryEPfVK+0N+ BC+cid+a6AV0ZFsinSMMeZ16SdK0389oic0DFGZZ1d00A3fhvqotZFViTBq+djYWUhgmpFnw4 mvdqucBnXf86rK0oHGyasdxJJglZKieYPxU6E06433BFSdTaZKBeRuCQesNvms6mS7lyuoRZd uk6YveOUVons/Vph0xTIAT77NCe07TFKTPv+zOZyIjPwIgdV+wS0VHV2ytbshalEeORqRHk5n loHfXD7WYif8g+3PfvP1S4EfRPgmYffBa6U50IBc8KQNX3mLoxLSzG2nO06Yobku92yNIHRj+ apl+511agRMz7KysL2T8nJNZgtNbUGgWxVlXNRgFZA+doyeueiRRcW1l2nssV2LXq1qiCiyQd NgEDY65mJWjA2oOo5SB+7fh8Mga+ViaYTqaysl1MemoAqqfPWo0oqBcdisK3ARJiH6JwjJCBt iBkBd4XhTXfVnIky/MitJhn2EAFvxvzZotU7jkBpd6rrQWwZgfZrKZDyeLcqKdZHbigsBXaPL Ks8y5mThOpUZJfvltcAO04764JPMRD3610zbU3Dbi+zyXIdX+eq5BsnMkqIWScUN4A5Ij9CfR XZ06hZpMRE22jqj28I+Bd4eItAZgb+76e1zkbkgEV/Z2mBOFqQF1rlqX7XjvABHU6wUCu9/T/ ZxJo7hZWThD33v5y Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 12 October 2015 20:53:50 Robert Jarzmik wrote: > Robert Jarzmik writes: > > > Arnd Bergmann writes: > > > >> The z2 machine calls pxa27x_set_pwrmode() in order to power off > >> the machine, but this function gets discarded early at boot because > >> it is marked __init, as pointed out by kbuild: > >> > >> WARNING: vmlinux.o(.text+0x145c4): Section mismatch in reference from the function z2_power_off() to the function .init.text:pxa27x_set_pwrmode() > >> The function z2_power_off() references > >> the function __init pxa27x_set_pwrmode(). > >> This is often because z2_power_off lacks a __init > >> annotation or the annotation of pxa27x_set_pwrmode is wrong. > >> > >> This removes the __init section modifier to fix rebooting and the > >> build error. > >> > >> Signed-off-by: Arnd Bergmann > >> Fixes: ba4a90a6d86a ("ARM: pxa/z2: fix building error of pxa27x_cpu_suspend() no longer available") > >> --- > >> This is a fix for an old bug, I'd just put it into 4.4 > >> > >> It showed up now because section mismatches now produce errors instead > >> of warnings. > > > > Hi Arnd, > > > > I already have this queued for 4.4 from Thierry's patch in : > > http://www.spinics.net/lists/arm-kernel/msg449414.html > > > > Yet your patch is more complete, as it deals also with the header in pxa27x.h > > and has the fixes tag. > > > > Now I'm wondering if I should enhance Thierry's patch with yours and keeping > > your signoff with your permission, or drop Thierry's one to replace by yours (I > > don't know if it's sane behavior to drop an already queued patch ...) > > Actually, I've rethought it over and Thierry's patch approach looks somehow more > appealing to me. What Thierry did is that he modified the _use_ of > pxa27x_set_pwrmode() to be called from a __init annonated function. While your > patch makes pxa27x_set_pwrmode() non __init. > > It looks to me the powermode should be initialized once and for all in the > machine init code. So unless I've overseen something, I'll keep Thierry's patch. Ah, sorry. I should have looked at the link you sent. Thierry's patch indeed looks much nicer if that works, but I'm not entirely sure if it is safe or not. Only two other pxa27x machines set the PWRMODE_DEEPSLEEP flag, so it looks like there is a reason for some machines not to set it. The z2 in particular never did, except in the powerdown handler. So if it is unable to wake up reliably from DEEPSLEEP, that may be a reason to use that flag only in the poweroff function but not during normal operation. Arnd