Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754474AbcDVP4Q (ORCPT ); Fri, 22 Apr 2016 11:56:16 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:50525 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753740AbcDVP4P (ORCPT ); Fri, 22 Apr 2016 11:56:15 -0400 Date: Fri, 22 Apr 2016 16:56:02 +0100 From: "Maciej W. Rozycki" To: Paul Burton CC: , Ralf Baechle , , "stable # v4 . 4+" , Subject: Re: [PATCH] MIPS: Allow R6 compact branch policy to be left unspecified In-Reply-To: <1461314611-15317-1-git-send-email-paul.burton@imgtec.com> Message-ID: References: <1461314611-15317-1-git-send-email-paul.burton@imgtec.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [10.20.78.30] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 50 On Fri, 22 Apr 2016, Paul Burton wrote: > It turns out that some toolchains which support MIPS R6 don't support > the -mcompact-branches flag to specify compact branch behaviour. Default > to not providing the -mcompact-branch option to the compiler such that > we can build with such toolchains. Good idea overall, one further suggestion below. > diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug > index f0e314c..e91b3d1 100644 > --- a/arch/mips/Kconfig.debug > +++ b/arch/mips/Kconfig.debug > @@ -117,7 +117,15 @@ if CPU_MIPSR6 > > choice > prompt "Compact branch policy" > - default MIPS_COMPACT_BRANCHES_OPTIMAL > + default MIPS_COMPACT_BRANCHES_DEFAULT > + > +config MIPS_COMPACT_BRANCHES_DEFAULT > + bool "Toolchain Default (don't specify)" > + help > + Don't pass the -mcompact-branches flag to the compiler, allowing it > + to use its default (generally "optimal"). This is particularly > + useful for early R6-supporting toolchains which don't support the > + -mcompact-branches flag. > > config MIPS_COMPACT_BRANCHES_NEVER > bool "Never (force delay slot branches)" How about making the option depend on DEBUG_KERNEL and maybe making it an umbrella setting to hide details from users who do not want to be bothered, i.e. something like: config MIPS_COMPACT_BRANCHES_OVERRIDE bool "Override the toolchain default for compact branch policy" depends on DEBUG_KERNEL default n [...] if MIPS_COMPACT_BRANCHES_OVERRIDE choice prompt "Compact branch policy" default MIPS_COMPACT_BRANCHES_OPTIMAL [...] endif # MIPS_COMPACT_BRANCHES_OVERRIDE ? Maciej