Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1437688ybk; Sun, 10 May 2020 17:05:02 -0700 (PDT) X-Google-Smtp-Source: APiQypJWn8TwlbKoWK59yBPRSCAXuRe2Xy49UPPegPezC8KAPgwNyVEe00R4DBL7Ea7fgoixfmIR X-Received: by 2002:aa7:cf92:: with SMTP id z18mr10572814edx.42.1589155502222; Sun, 10 May 2020 17:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589155502; cv=none; d=google.com; s=arc-20160816; b=CJCXWDWW+rhBfR4SfvAHWcNPrV6/aICinr1T5qCktG0Le4MzW5VOwhH6pvoSnFfjBV oU6Odk6fZZN3rrxhdIyETNst8c7hBFyY1YzuHVDcw7rKE6Ozz0V9CRXjfnroWunaKOC6 4vTsj2ZqKmsO6W9gMOygIsBagk5NfsKEdYzh8cL48vVLetCoSsewA4xG0MjQ644nk+MH 7H+4g9aL+kofcIpVhbBVdhc1bMrLEumRELdrUlLa/JSNELyQm0KZrW9HBbkPkV500EVB Y0cBkIBJ8YMjMe5lD+pGPevP1ZzEtqWZlMm27UbkpDtx6sC6qWBTHnZiegbquKXjwWdu pUIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EFjXnFREBtVYaofUai+P5FgqhPi7+LmguHKP4UmO41Q=; b=sJd58DE7mEfIFb//h7vSQEK2FpTRbaAvsNfXH3gIdxmMc8nkYr8VZqR0noL9WB8Aqr oWk3lJUbA4i9t+OcEYdXLVIbxRGP7G3AWC3MWD7n7hEZwmDM8JVhb2A5iIHaMBq5Crnj fD4PbEEV5z9eLg+uoRDPPtuS78FI22ODnZOzVwPKDErKDzmokJ5lraLvADZ5c825bFGF Ad6Gd9xgKG3ZA0X8b4DYy/8eGXDl0tVHrcCUNBYZJ/14cPS6RLB9fWjMoXnaoxpCjFfy BMpilvR5x7NTCi0G2XjXUz9QJIQ3MfpEFRHO0S/C3pPx7L8sbh4rHIcD9IkA+PZfE3gx yMvw== 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 c17si5130865ejn.336.2020.05.10.17.04.39; Sun, 10 May 2020 17:05:02 -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 S1729255AbgEJX7r (ORCPT + 99 others); Sun, 10 May 2020 19:59:47 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:47676 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729078AbgEJX7r (ORCPT ); Sun, 10 May 2020 19:59:47 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 0AB0C803088B; Sun, 10 May 2020 23:59:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id okmZ8RUkSoro; Mon, 11 May 2020 02:59:43 +0300 (MSK) Date: Mon, 11 May 2020 02:59:42 +0300 From: Serge Semin To: Thomas Bogendoerfer CC: Serge Semin , Paul Burton , Alexey Malahov , Ralf Baechle , Arnd Bergmann , Rob Herring , , , Jiaxun Yang , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , , Subject: Re: [PATCH v2 08/20] mips: Fix cpu_has_mips64r1/2 activation for MIPS32 CPUs Message-ID: <20200510235942.msznsepuaww7gj2c@mobilestation> References: <20200306124807.3596F80307C2@mail.baikalelectronics.ru> <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> <20200506174238.15385-9-Sergey.Semin@baikalelectronics.ru> <20200508132809.GA15641@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200508132809.GA15641@alpha.franken.de> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 08, 2020 at 03:28:09PM +0200, Thomas Bogendoerfer wrote: > 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. Good point. Thanks. I'll fix it in v3. -Sergey > > Thomas. > > -- > Crap can work. Given enough thrust pigs will fly, but it's not necessarily a > good idea. [ RFC1925, 2.3 ]