Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp897051yba; Thu, 18 Apr 2019 11:24:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3/j3X2vlg8A1RkQ1+0nZJ3MIMPiSTiQVeOQQv/2uN12f8ZnHXBgOzKMDHGx+74mNXXYGM X-Received: by 2002:a63:2c09:: with SMTP id s9mr86292596pgs.411.1555611845256; Thu, 18 Apr 2019 11:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611845; cv=none; d=google.com; s=arc-20160816; b=QZbYehic8+HGzfu1EKEK1l6fTlyWIhIAONiveapk3CMM+pXGYVOjurGBH56wa3VMsz 8T4CflVCCBokFharhscNnXKnV9+bVPFyQZP+OXMwkpPSOCp+HcloOB+PWQGOajQ/HNQb Mnp9E6Uno6M1OCRg0tWqsHkUVkGzAQgfwjA16rIWnYguGcqWyk/q2I8j/pMyFxUwkqcl XnV8TWZvWDCQ0g43ZVTXsviQQe9E9bfY5tXgUksjoK195ww2nKlbhqRPY3KpI+IKpasC yboUEVrV3ypQzDnv0NnmhyXb/an1LeZYOdZrZ8slCVGon8pbNgKpWcX/bTrP9HqfyX4R o8BQ== 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=9bYo+Iu9hzcN7FWuMpsbu7lOuvVyWrtN1Ak/ZYtMMRM=; b=u2bttNasgTGjevLLAB0RKi5q+nl3VlenAbiyXLS4Yz0V177CBaSvfuQL/kiIyPNxba TTi4YOwQ5JJHj7uprwUcVB5P2US7fBnoIjSp1W5caU6iPCqATASrv8CvSI5bLiSdWVHt zPMOteK6L9OgrWrRHoo5NBBF/Ql/9GGWHSMmiecH5L18fJKnha8Z0nsgdYe3jPOD+B54 qoUuWIwJ6hJeoHrmyvPvLPcI9O/Gc+YEUDxt+FaHRRcLP1fbEjdYEVfBO2MJ48Nbj9t+ M2WT/cCIYoKnLYP2hK96iF7xynti8tMvlLkWeO6Ktptfimel1bwn8AOZVyvYqjZDADs6 muvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PriBdGv5; 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 d3si2895538pfc.278.2019.04.18.11.23.49; Thu, 18 Apr 2019 11:24:05 -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=PriBdGv5; 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 S2403904AbfDRSVC (ORCPT + 99 others); Thu, 18 Apr 2019 14:21:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:39308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391727AbfDRSIM (ORCPT ); Thu, 18 Apr 2019 14:08:12 -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 404132186A; Thu, 18 Apr 2019 18:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610891; bh=HD2DXfVd1IYu2Yi6Sj65wj0+NEwk5JF/XhWZnH6Mtc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PriBdGv5BPsvV2G3TlizdITtqHnEhtZEG1S7Q+QyvsTlgg5m3VNkFVhldMcxmXumC Zb7bGe0x0pT9QxN6qlA8kd/QuD4u7XU4yMVAIGInLeX7LnQN5sxAg0LfQPxn9Qut8o e1yY+mTDc9b1TNWrcyjQqIJ4lzvC73fys/p4QYfA= 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 4.9 23/50] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors Date: Thu, 18 Apr 2019 19:57:34 +0200 Message-Id: <20190418160425.521301995@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160422.455656724@linuxfoundation.org> References: <20190418160422.455656724@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 d39cfb2c6b63..311d0fad17e6 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c @@ -121,7 +121,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); @@ -132,11 +132,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); } /* @@ -150,14 +150,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(); @@ -293,7 +293,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 @@ -316,7 +316,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