Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp887433yba; Thu, 18 Apr 2019 11:13:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRNyR2/cq2yaM+nqi7RADMLZypShJqJIDvqxGn6pXfooftWTurGnQ8h6nXUw+52XPA7/Pe X-Received: by 2002:a63:3857:: with SMTP id h23mr88037480pgn.305.1555611221714; Thu, 18 Apr 2019 11:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611221; cv=none; d=google.com; s=arc-20160816; b=Um4hJFJrNNJtwgWycOvj6e1wJlzxCiHGtRc8YDLXzUSPGv6YOnFHTJUDzdFUTzJ4Dr Ii+H4ymwOLiiOXBN9fQsxTmDhxDD25KytglUYstUjL0q+RPHzPOjVOXoMZEvzt7h0aVh /8ez3aWAiowAzWLtCVh0sr0hMMAh2i4PGBwNbC6Nzx+xi9zWQqpM28H0R6PB8e8059vR MC91nXT+7KdGYzvko0w/Hj35oFj+poXLLqCll6iJwleVxpA9tV9JzK0bG7NX+hqjKXQs qjgzgBD9YnbqX/sj4x8mePAY6dJdXHClhUabMKpn4Bd/H1+bQfjkN0toINMWttpll4mD VavA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kd67vAJ5F1LHmdeGXZXK2MPVpNwZCVG+bT/LvJTvjPc=; b=Shxsda6ytQdmZOTh5iAbeTueTSZHdP9enIeHKw2+jdSfK3zxpV57H1ezgXvtceV/rN iQSM/vWFuWLxhEPYZ4W4HSwkiETg0yWE5tMf125WoEvg8WF1vOGHvVvKowVe747sUsTn 9gAaYWytUgGkUcqH4/OjJpNi/ddEYkZyJ4x3OPHaC8MxJlOxK3fLSuY3sZafNj4EgBPj xj2iGabRR1EGauILQWJyIHPeJ0PPuFvU9DKBSDjjqx2TfMPmeUcf74aQJGUdVnIvf9+x 3jwhDJtd0UkFOe6ixlgnBGVi4i5r6KgDXrijnd+FhCL/K+mdUqJZlCitwuq0fb0u6hdJ yqiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WGGFDWYQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si2524017pgg.367.2019.04.18.11.13.26; Thu, 18 Apr 2019 11:13:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WGGFDWYQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391605AbfDRSLp (ORCPT + 99 others); Thu, 18 Apr 2019 14:11:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:43992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391942AbfDRSLn (ORCPT ); Thu, 18 Apr 2019 14:11:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 321A820652; Thu, 18 Apr 2019 18:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611101; bh=sK3aDPlbjYJzleQG6KNa59qwJ2HjCeNuLKNkYioXDi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WGGFDWYQS806ctF+nG4w1AeeVVdPzl4G7MCMuoPZvwDcchIgyNLoZILxkLaPQXMhY ngBn8db/O5Pl76rxu1LBfLxe3yZEhhyjXdiP7Kkn6euBXkmkJeQKwEF8PIfBsGLmzo v6gwYyFsiN8HTMzFUyfVk+FtneMdmqya6sUb6AV4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Whitehead , Thomas Gleixner , luto@kernel.org, Sasha Levin Subject: [PATCH 5.0 58/93] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors Date: Thu, 18 Apr 2019 19:57:36 +0200 Message-Id: <20190418160443.388745788@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 18fb053f9b827bd98cfc64f2a35df8ab19745a1d ] There are comments in processor-cyrix.h advising you to _not_ make calls using the deprecated macros in this style: setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80); This is because it expands the macro into a non-functioning calling sequence. The calling order must be: outb(CX86_CCR2, 0x22); inb(0x23); >From the comments: * When using the old macros a line like * setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); * gets expanded to: * do { * outb((CX86_CCR2), 0x22); * outb((({ * outb((CX86_CCR2), 0x22); * inb(0x23); * }) | 0x88), 0x23); * } while (0); The new macros fix this problem, so use them instead. Tested on an actual Geode processor. Signed-off-by: Matthew Whitehead Signed-off-by: Thomas Gleixner Cc: luto@kernel.org Link: https://lkml.kernel.org/r/1552596361-8967-2-git-send-email-tedheadster@gmail.com Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/cyrix.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index d12226f60168..1d9b8aaea06c 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c @@ -124,7 +124,7 @@ static void set_cx86_reorder(void) setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ /* Load/Store Serialize to mem access disable (=reorder it) */ - setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80); + setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80); /* set load/store serialize from 1GB to 4GB */ ccr3 |= 0xe0; setCx86(CX86_CCR3, ccr3); @@ -135,11 +135,11 @@ static void set_cx86_memwb(void) pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n"); /* CCR2 bit 2: unlock NW bit */ - setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04); + setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04); /* set 'Not Write-through' */ write_cr0(read_cr0() | X86_CR0_NW); /* CCR2 bit 2: lock NW bit and set WT1 */ - setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14); + setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14); } /* @@ -153,14 +153,14 @@ static void geode_configure(void) local_irq_save(flags); /* Suspend on halt power saving and enable #SUSP pin */ - setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88); + setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); ccr3 = getCx86(CX86_CCR3); setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ /* FPU fast, DTE cache, Mem bypass */ - setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38); + setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38); setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ set_cx86_memwb(); @@ -296,7 +296,7 @@ static void init_cyrix(struct cpuinfo_x86 *c) /* GXm supports extended cpuid levels 'ala' AMD */ if (c->cpuid_level == 2) { /* Enable cxMMX extensions (GX1 Datasheet 54) */ - setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1); + setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1); /* * GXm : 0x30 ... 0x5f GXm datasheet 51 @@ -319,7 +319,7 @@ static void init_cyrix(struct cpuinfo_x86 *c) if (dir1 > 7) { dir0_msn++; /* M II */ /* Enable MMX extensions (App note 108) */ - setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1); + setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1); } else { /* A 6x86MX - it has the bug. */ set_cpu_bug(c, X86_BUG_COMA); -- 2.19.1