Received: from milmhbs1.lsil.com (147.145.21.209) by coscas01.lsi.com
 (172.21.36.60) with Microsoft SMTP Server id 8.1.393.1; Thu, 20 Aug 2009
 13:39:05 -0600
Received: from mail1.lsil.com (mail1.lsil.com [147.145.40.21])	by
 milmhbs1.lsil.com (8.12.11/8.12.11) with ESMTP id n7KJd5JX029813	for
 <andy.sharp@lsi.com>; Thu, 20 Aug 2009 12:39:05 -0700
Received: from psmtp.com (exprod7mx206.postini.com [64.18.2.46])	by
 mail1.lsil.com (8.12.11/8.12.11) with SMTP id n7KJd014023791	for
 <andy.sharp@lsi.com>; Thu, 20 Aug 2009 12:39:03 -0700 (PDT)
Received: from source ([78.24.191.182]) by exprod7mx206.postini.com
 ([64.18.6.14]) with SMTP;	Thu, 20 Aug 2009 15:39:04 EDT
Received: from localhost.localdomain ([127.0.0.1]:44893 "EHLO
	eddie.linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by ftp.linux-mips.org	with
 ESMTP id S1492816AbZHTTik (ORCPT <rfc822;andy.sharp@lsi.com>);	Thu, 20 Aug
 2009 21:38:40 +0200
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 20 Aug 2009 21:38:23
 +0200 (CEST)
Received: from mail3.caviumnetworks.com ([12.108.191.235]:46584 "EHLO
	mail3.caviumnetworks.com" rhost-flags-OK-OK-OK-OK)	by ftp.linux-mips.org with
 ESMTP id S1492793AbZHTTiR (ORCPT	<rfc822;linux-mips@linux-mips.org>); Thu, 20
 Aug 2009 21:38:17 +0200
Received: from caexch01.caveonetworks.com (Not Verified[192.168.16.9]) by
 mail3.caviumnetworks.com with MailMarshal (v6,2,2,3503)	id <B4a8da5b80000>;
 Thu, 20 Aug 2009 15:36:29 -0400
Received: from caexch01.caveonetworks.com ([192.168.16.9]) by
 caexch01.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);	 Thu, 20
 Aug 2009 12:35:59 -0700
Received: from dd1.caveonetworks.com ([64.169.86.201]) by
 caexch01.caveonetworks.com over TLS secured channel with Microsoft
 SMTPSVC(6.0.3790.3959);	 Thu, 20 Aug 2009 12:35:58 -0700
Received: from dd1.caveonetworks.com (localhost.localdomain [127.0.0.1])	by
 dd1.caveonetworks.com (8.14.2/8.14.2) with ESMTP id n7KJZseJ006082;	Thu, 20
 Aug 2009 12:35:54 -0700
Received: (from ddaney@localhost)	by dd1.caveonetworks.com
 (8.14.2/8.14.2/Submit) id n7KJZrpJ006080;	Thu, 20 Aug 2009 12:35:53 -0700
From: David Daney <ddaney@caviumnetworks.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>
CC: David Daney <ddaney@caviumnetworks.com>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Thu, 20 Aug 2009 13:35:53 -0600
Subject: [PATCH] MIPS: Octeon: Check all CCAs in cvmx_write_csr.
Thread-Topic: [PATCH] MIPS: Octeon: Check all CCAs in cvmx_write_csr.
Thread-Index: AcohzeFhzJ8OQz/uRGKJfcKl5dYvfw==
Message-ID: <1250796953-6056-1-git-send-email-ddaney@caviumnetworks.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: coscas01.lsi.com
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 20 Aug 2009 19:35:59.0017 (UTC)
 FILETIME=[71871190:01CA21CD]
x-scanned-by: MIMEDefang 2.39
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-neptune: 1/1/1.00/84
x-pstn-levels: (S:79.04140/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-settings: 3 (1.0000:1.0000) s cv gt3 gt2 gt1 r p m c 
x-pstn-addresses: from <ddaney@caviumnetworks.com> [db-null] 
x-archive-position: 23915
x-ecartis-version: Ecartis v1.0.0
x-original-sender: ddaney@caviumnetworks.com
x-list: linux-mips
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

The current code only checks CCA of 0 when deciding if a dummy read is
needed.  Since the kernel can (and does) use other CCAs we need to
mask out the CCA bits from the address.  Since the address constant
now fits in 16 bits, there is an added benefit that smaller code is
generated.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/include/asm/octeon/cvmx.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/oc=
teon/cvmx.h
index e31e3fe..9d9381e 100644
--- a/arch/mips/include/asm/octeon/cvmx.h
+++ b/arch/mips/include/asm/octeon/cvmx.h
@@ -271,7 +271,7 @@ static inline void cvmx_write_csr(uint64_t csr_addr, ui=
nt64_t val)
 	 * what RSL read we do, so we choose CVMX_MIO_BOOT_BIST_STAT
 	 * because it is fast and harmless.
 	 */
-	if ((csr_addr >> 40) =3D=3D (0x800118))
+	if (((csr_addr >> 40) & 0x7ffff) =3D=3D (0x118))
 		cvmx_read64(CVMX_MIO_BOOT_BIST_STAT);
 }
=20
--=20
1.6.0.6


