Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932795AbcCJWsJ (ORCPT ); Thu, 10 Mar 2016 17:48:09 -0500 Received: from down.free-electrons.com ([37.187.137.238]:51765 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932089AbcCJWsF (ORCPT ); Thu, 10 Mar 2016 17:48:05 -0500 Date: Thu, 10 Mar 2016 23:48:01 +0100 From: Alexandre Belloni To: Josh Poimboeuf Cc: Joshua Kinard , Alessandro Zummo , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, kbuild test robot , Ingo Molnar Subject: Re: [PATCH] rtc: ds1685: actually spin forever in poweroff error path Message-ID: <20160310224801.GP9868@piout.net> References: <201603060005.PHCyifJr%fengguang.wu@intel.com> <25c2e99dc116c666a05e641082a2690c05c09a23.1457362965.git.jpoimboe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25c2e99dc116c666a05e641082a2690c05c09a23.1457362965.git.jpoimboe@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1542 Lines: 35 On 07/03/2016 at 09:03:02 -0600, Josh Poimboeuf wrote : > objtool reports the following warnings: > > drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_work_queue()+0x0: duplicate frame pointer save > drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_work_queue()+0x3: duplicate frame pointer setup > drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_work_queue()+0x0: frame pointer state mismatch > > The warning message needs to be improved, but what it really means in > this case is that ds1685_rtc_poweroff() has a possible code path where > it can actually fall through to the next function in the object code, > ds1685_rtc_work_queue(). > > The bug is caused by the use of the unreachable() macro in a place which > is actually reachable. That causes gcc to assume that the printk() > immediately before the unreachable() macro never returns, when in fact > it does. So gcc places the printk() at the very end of the function's > object code. When the printk() returns, the next function starts > executing. > > The surrounding comment and printk message state that the code should > spin forever, which explains the unreachable() statement. However the > actual spin code is missing. > > Reported-by: kbuild test robot > Signed-off-by: Josh Poimboeuf > --- > drivers/rtc/rtc-ds1685.c | 1 + > 1 file changed, 1 insertion(+) > Applied, thanks. -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com