Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp62949ybj; Fri, 8 May 2020 06:36:05 -0700 (PDT) X-Google-Smtp-Source: APiQypK7PoNjn+VNN1+jRExUqbduqvby9P2qlTwAG86vsW+epPkAW1ZNbykQ877wBEn1/1npiwuj X-Received: by 2002:a17:906:3f45:: with SMTP id f5mr2007283ejj.18.1588944964968; Fri, 08 May 2020 06:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588944964; cv=none; d=google.com; s=arc-20160816; b=tfDj/m0MSOlfyOGSET38saJF00A7ywAPyQ6+FQ2GwC8lc6bVhdRmGaFb0WXf4tMSft uATg0jXMVqqcpQS41jy1Muv67h2zjHcEuLveCoglpQ24Uj5hkUQRW2rAXHHffu6VrpVD 28+EcaqBIpu3Kw1m3iFAbq51SR7tWs2e1WyCye/U++yBddZKof0jslyMRS8T+1vBHJu8 CiFx7ViHiZm8RRj4qb45Dp2vYQR5DFYJyevd2eT0avYTnLUFdmQ+itOUnJ4kxy5aweDS JdLtjC+luhSz5t9SiMmPQ73gWwlQdlDqrjEDsHZUp+jrFrt39GdJpCZ7Ai6FSFLiSEc5 0UVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Dkf4aftrnyg0oRzmwaN0XRYnwwPcJBl569e29QTy2tI=; b=pTR3On9fF4qpyADMawhIkRlK3YazfXDygso5QFkvadmg/kVGySJkGP8ZFpcDMksaV0 Aah02FwZG6FyIk4hVYdP3gsjd81ODs+gK/9k8iXmsCMBgblW/epCEQQe+izzgpN9wRin yuXm2nczOosJP2+oVIYllYFhiePGH7GWdQ3736h+z5VG8pHFUaiNadD32k/Ss+a52dou c3MAhBkR3J4A4vdwkNNPyOVxqZmrCQ29UNTDPW1DCloZT+GCSvEVhzvladW8sEmpW/8z dAegMrCzacxW9HXOX86t9kkhUa/w0jItMdfPjWWwdHaDXFzVPgzSN6FLySTX3hVAgaN8 OjrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si1003503edy.59.2020.05.08.06.35.37; Fri, 08 May 2020 06:36:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728692AbgEHNbp (ORCPT + 99 others); Fri, 8 May 2020 09:31:45 -0400 Received: from elvis.franken.de ([193.175.24.41]:44851 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727975AbgEHNbo (ORCPT ); Fri, 8 May 2020 09:31:44 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1jX36M-0003ty-03; Fri, 08 May 2020 15:31:42 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 9EAF3C041B; Fri, 8 May 2020 15:28:09 +0200 (CEST) Date: Fri, 8 May 2020 15:28:09 +0200 From: Thomas Bogendoerfer To: Sergey.Semin@baikalelectronics.ru Cc: Paul Burton , Serge Semin , Alexey Malahov , Ralf Baechle , Arnd Bergmann , Rob Herring , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Jiaxun Yang , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 08/20] mips: Fix cpu_has_mips64r1/2 activation for MIPS32 CPUs Message-ID: <20200508132809.GA15641@alpha.franken.de> References: <20200306124807.3596F80307C2@mail.baikalelectronics.ru> <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> <20200506174238.15385-9-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200506174238.15385-9-Sergey.Semin@baikalelectronics.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2020 at 08:42:26PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > From: Serge Semin > diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h > index e2f31bd6363b..7e22b9c1e279 100644 > --- a/arch/mips/include/asm/cpu-features.h > +++ b/arch/mips/include/asm/cpu-features.h > @@ -64,6 +64,8 @@ > ((MIPS_ISA_REV >= (ge)) && (MIPS_ISA_REV < (lt))) > #define __isa_range_or_flag(ge, lt, flag) \ > (__isa_range(ge, lt) || ((MIPS_ISA_REV < (lt)) && __isa(flag))) > +#define __isa_range_and_flag(ge, lt, flag) \ > + (__isa_range(ge, lt) && __isa(flag)) > > /* > * SMP assumption: Options of CPU 0 are a superset of all processors. > @@ -291,10 +293,10 @@ > # define cpu_has_mips32r6 __isa_ge_or_flag(6, MIPS_CPU_ISA_M32R6) > #endif > #ifndef cpu_has_mips64r1 > -# define cpu_has_mips64r1 __isa_range_or_flag(1, 6, MIPS_CPU_ISA_M64R1) > +# define cpu_has_mips64r1 __isa_range_and_flag(1, 6, MIPS_CPU_ISA_M64R1) that's not the correct fix. You want to check for cpu_has_64bits here. Something like # define cpu_has_mips64r1 (cpu_has_64bits && __isa_range_or_flag(1, 6, MIPS_CPU_ISA_M64R1)) should do the trick. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]