Received: by 10.213.65.68 with SMTP id h4csp2127874imn; Sun, 8 Apr 2018 20:25:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx49rfG/bSNE/Ezfg/+vC0IYzu5aBH9WGarxPcx5cg9jtV/IUezQdVuEZXYrENs0eZRk2YZnZ X-Received: by 10.98.7.152 with SMTP id 24mr23103737pfh.94.1523244326468; Sun, 08 Apr 2018 20:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244326; cv=none; d=google.com; s=arc-20160816; b=PcctWanY1+aXIP4H1B+Q8IjxQ1VolZJEWdXWoODIfnHzMDsyvVSkjt/VTX7XhnHceQ 5iP5+Z8sJ4ZpEDqpywCINbTrQUNagvHJDjz1v8jjtRuwNE134RfmDvNtgeZieCye+SDA eEE2PSRcnw9thQv21OywX2HmKNuWfOoKGdvzZea7Na10l8dtV2yJf7bnRPJnmB5h+iUl l6KSEsbovCrXK5L6X6ba5LMAMYVVpLtthGIfwsIp9B/nSEBK4HGf3YysbCgTWjXYYq0Z og3TwBlu93gYLZERWFfNrF9CkHhRja1D5lng3NaUwMSEkzaBsABk2K6a7z/lJnvbzvus WKkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zCSWzUfBLY0Su5NZfad5+Hcsa+K7dAOY//kz84S/KMw=; b=wrbFlQK3vu4Z5hejt8bSSAu4sOLmX9GMvgWfZu4WSEIMzXyxNXUgBzSN3sIWMhLYEO 4KVYaJeYr9p3GyyZrEeCSqscXDsgbowcigezEs6MjS3aRumkXhe8LTBp6QvJSrm0Tnnv CLXLA1TfzynOCFmzBW3EX10CauqQ3QBVGHMmw20IDheBtSYzLyd9KQX6/hhbVKQWTmt3 LiNf2ve6IwIDYLpUXKHia/3m3tv4fRnbTAi+qFIunkgOi4jK/WaSLtFaPcqUcdZcQIiS Fpxe8Y4X9We2y7HdpxwWSG54qG8YyAhrHa9sWK82i+I8+KPpnWmbyfMvokndS5EQMEBB uStw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=JM7diVif; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si3991956pls.571.2018.04.08.20.24.49; Sun, 08 Apr 2018 20:25:26 -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=@microsoft.com header.s=selector1 header.b=JM7diVif; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753530AbeDIDVx (ORCPT + 99 others); Sun, 8 Apr 2018 23:21:53 -0400 Received: from mail-sn1nam01on0134.outbound.protection.outlook.com ([104.47.32.134]:37792 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754709AbeDIAWz (ORCPT ); Sun, 8 Apr 2018 20:22:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zCSWzUfBLY0Su5NZfad5+Hcsa+K7dAOY//kz84S/KMw=; b=JM7diVifrhy4dSErCR0CuCbMr48KD+v95J71gnXsOUnEHeBTOumlO9yUeRLX4UuQSHh3L/SUId0zs+edkTttGi25axg9S2EVl+SkXyLmYElZHuZzP7Q1iU7AO5xHv3xS5ZAY8GXHKvyctCt/HT2Fqaiczu3daJLcvnRHfu3p7YA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1014.namprd21.prod.outlook.com (52.132.133.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:22:52 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:22:52 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Maarten ter Huurne , Ralf Baechle , "linux-mips@linux-mips.org" , James Hogan , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 043/161] MIPS: JZ4770: Work around config2 misreporting associativity Thread-Topic: [PATCH AUTOSEL for 4.14 043/161] MIPS: JZ4770: Work around config2 misreporting associativity Thread-Index: AQHTz5iLqRoxliRgSEKMEGprDVcqeA== Date: Mon, 9 Apr 2018 00:20:20 +0000 Message-ID: <20180409001936.162706-43-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1014;7:BwfyZNkcCtnWMe/nPcTOql+kJwsYn7m3bOWnQPqWBUdzkVkHh4OeNtTrJASrhrnDsdmzxX3ioRVHJjOqa6JGQjhipSajYXmYlJsGs1j/m1TFd/D4UWiK1tJZFXTWIy0ghf9Df1hlm6pxK0xaAYBLqZWJprYhlbSaMDUtMvjxoYzRLH/llRGm9KahZ6pIgJMcQ7zq2lt3kjQOnUjqfaGxu+1nmlnQhVJRjXKZRRh0DoVsuRvXC1ysNog0wR8UXodW;20:QwuMX4cEtbojIoNmS+y+y/+F+Ab3dosmTyJxzMxCX31Cqld+ITUlv44VnVH6BL6qEy1AvH/IbuaFcwYaOfaYq+p95BLyAC2EtDCSyZZa8RwpJOAnOwlMO99cUhl8usW/PWIxziHigoOiYyR5krwi9KfNFQ7NDVLk1cW3VLAX71U= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 27b9b9f3-5a75-4d03-ca34-08d59db00873 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1014; x-ms-traffictypediagnostic: DM5PR2101MB1014: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1014;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1014; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(39860400002)(39380400002)(396003)(376002)(189003)(199004)(81166006)(81156014)(478600001)(6436002)(72206003)(575784001)(8936002)(10290500003)(106356001)(99286004)(86362001)(2616005)(7736002)(2501003)(6666003)(446003)(476003)(8676002)(11346002)(105586002)(305945005)(5250100002)(6512007)(53936002)(68736007)(6306002)(107886003)(66066001)(86612001)(966005)(2906002)(14454004)(186003)(22452003)(25786009)(4326008)(2900100001)(486006)(36756003)(6486002)(3660700001)(54906003)(26005)(3280700002)(110136005)(1076002)(10090500001)(76176011)(6506007)(97736004)(316002)(3846002)(6116002)(102836004)(5660300001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1014;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rxPKo7YplgJl9iVNt2DJCQlQsjLpb0Nt93gVZMWygjiXUXENgiBBRpI7IaijKG6J+Se1V6rdctPBPlT3LilqDiJFOkf0dfLJDswy7eFqyBgY60lrQ1ibxCOYyDYOEuaPay3hgL2zs6uenn9TlPo+toAHz60iOwGb5ZYqJ6c5oxAqMQL/Jvk5Nh85QmsQj/xzu2MLLxN3iwgFsqmvCbQHIr0RyDjofGJdp0GCKvVCNEe1lMb64Jh17x2I8VaMcohPbOIJafoBxMn2GTbkIHk/sRZNR/PPTDuG6p8rLvfUEN1O/XSayv1C9fDIDnChCv4rU78PxSGiZGa8/QB8xgitIUZ6kvnNtz8I0VmZovGfji+LwCr8mhpywhJ+s+kFijhbgUPaTlIKO7PXGOFRm/F2VvskwRaqMAYN1zTzyaSAtjc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27b9b9f3-5a75-4d03-ca34-08d59db00873 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:20.2070 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1014 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maarten ter Huurne [ Upstream commit 1f7412e0e2f327fe7dc5a0c2fc36d7b319d05d47 ] According to config2, the associativity would be 5-ways, but the documentation states 4-ways, which also matches the documented L2 cache size of 256 kB. Signed-off-by: Maarten ter Huurne Reviewed-by: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/18488/ Signed-off-by: James Hogan Signed-off-by: Sasha Levin --- arch/mips/mm/sc-mips.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index 548acb7f8557..394673991bab 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 /* * MIPS32/MIPS64 L2 cache handling @@ -220,6 +221,14 @@ static inline int __init mips_sc_probe(void) else return 0; =20 + /* + * According to config2 it would be 5-ways, but that is contradicted + * by all documentation. + */ + if (current_cpu_type() =3D=3D CPU_JZRISC && + mips_machtype =3D=3D MACH_INGENIC_JZ4770) + c->scache.ways =3D 4; + c->scache.waysize =3D c->scache.sets * c->scache.linesz; c->scache.waybit =3D __ffs(c->scache.waysize); =20 --=20 2.15.1