Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7559074ybn; Mon, 30 Sep 2019 16:10:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIaG2DeSq1hkYNG6dXU3L+nWiNWvgv1rJRqg9vkTrPCLPmX3INlEElOZbvuCE5kqec3RRm X-Received: by 2002:a50:f09d:: with SMTP id v29mr21980096edl.4.1569885043143; Mon, 30 Sep 2019 16:10:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1569885043; cv=pass; d=google.com; s=arc-20160816; b=f9u+dSdZPoyfS3ERpEqCZKM88q1VF1C0ekr+jSpLmSmmitRnQDgjKCYauOGlsyCTQi rSnk7NjzZ7beJ7G5e2yy1I9sguXwY7lAeTOBmYm49ey80MvJ6Ns+J65y1SYspg/1zQXa lPiAZICiBSoJXhcxVuy1fUKy1/+gxJL2TZyYekMMexfqhpvMUJtp9aeajJbUGLTSag+H RnAQtikp7Kjqai+6Map6miEPoE49nzNOV/y7hcu7WNzhMSNuanP6NA1cXSsJGKRDBOUg gTRxxGaThJD6WXW7X2ikIiMctFGX6mEAyVkAc+Yg15/OW0LqHzdE652ako2FzwXw4ceC RL7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=kDvKslP4waykgwOT3pICa4cjuCwk8SfOxtgfBgmSfb4=; b=CfUwwyukOPntZXMD5EqORwEzgGlm85c+YB44rV2L4/kCpmo4OO46HtPISSbDpAcgqI VI/YckJueoXGw1TeOWbfGfkX/WCMMPBJ4ZClFcGU5wdYQquZPBTBTuktsVRslVTygbmS Sy5EITCgBGIG4dJhNhV6zqL9+tUzq7LzFeBtBhLvbPIIOj0v0mFCPEeKohf8kXcTSyp9 5MfUEHCAsZPs5paBo0iB6/ETs2B2DWMXdozP11wY6uh3/S3ntIWnK7xLoMNMFpFSNj6d fOaDYiKflK4gY+1ZPHW6ok0xrwl4261fjQ36u5ZKYYoSE2qVcFpvaBPjOBSifIm/0nZD V1/w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wavecomp.com header.s=selector2 header.b=nSgy2I47; arc=pass (i=1 spf=pass spfdomain=wavecomp.com dkim=pass dkdomain=mips.com dmarc=pass fromdomain=mips.com); 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 w6si7963894ejf.8.2019.09.30.16.10.18; Mon, 30 Sep 2019 16:10:43 -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=@wavecomp.com header.s=selector2 header.b=nSgy2I47; arc=pass (i=1 spf=pass spfdomain=wavecomp.com dkim=pass dkdomain=mips.com dmarc=pass fromdomain=mips.com); 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 S1732807AbfI3XJ3 (ORCPT + 99 others); Mon, 30 Sep 2019 19:09:29 -0400 Received: from mail-eopbgr820129.outbound.protection.outlook.com ([40.107.82.129]:60959 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732782AbfI3XJZ (ORCPT ); Mon, 30 Sep 2019 19:09:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nLTkSPlp7aWJiNBGE0zegV+h93v5qsgKibWC2A7paMHa2YNgWYDq2GrTex0jjFSw0SsquR/rl80yQ5AwaxN/Vp2eCVcWXa5wJk/tTm2N6mMkiLqX438xFxhwYDOKKzP49O+hzpDiOzNzHpjYnggJAoRaHul3jyU7ot2kBv0M7/LBjwaEsVVPrjI1u2wm7+naH2EKk7pQwAWS1t0NCNmpt5S7M+yUiiRs0ycINQlYan4T7y0q77/B+wAJdqh+vDmqH72iYOD80PsHvk6YyYOlCaQGCNBfKN2U6vgVJM/GcUYESngbwnqSZbcenfsl3egsqRuJtze/ioo6nDTanKdZ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kDvKslP4waykgwOT3pICa4cjuCwk8SfOxtgfBgmSfb4=; b=Q3UDbVA0rEdmAZrDkXGJrt0Z3KAOsBc4kfwRhvNsmbEto+KAlkyIGbesTIawlRfOSYkYCBp2P0N4txOlUqgb8JyfkGieOxUFjKsLiMRp5Dv0C/DEMXRVtffcgER6KNjtMwM0IVi7ToK+8VaB6xkcW8g3FtCTBs82wmDJs3jfdEa+xhVNzs4gIp2Xtb3o0noqdmQrrEVUDsmendrMhmS6QYwa0PkS7/gamq0rMoygs1ifS6Q5RTX/8AE6qfGILco9+j1nU6sDCRAzuk+SGU7RrAncPSbznS6KjwRp0VD1jSDClrVdWyy0sWTmP77jlBD70SDDecmtNCpF3WqiKcsoIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wavecomp.com; dmarc=pass action=none header.from=mips.com; dkim=pass header.d=mips.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavecomp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kDvKslP4waykgwOT3pICa4cjuCwk8SfOxtgfBgmSfb4=; b=nSgy2I47NpVbqKLnZUKbt+fEnDHWiAqV7B2UfGdvDw5zFspvOm0nRqQXbZW5FPiIRm2ewU+KbzxhD7IaVjx31DoTj5sOlQXs2lG1s56luZrKuTMizsIDKcL0PvWFwNJP9AjtgZjnbZmDBrQLG9InjS//KMqFICQrX/9SLLydueQ= Received: from MWHPR2201MB1277.namprd22.prod.outlook.com (10.172.60.12) by MWHPR2201MB1022.namprd22.prod.outlook.com (10.174.167.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.17; Mon, 30 Sep 2019 23:09:12 +0000 Received: from MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::498b:c2cd:e816:1481]) by MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::498b:c2cd:e816:1481%2]) with mapi id 15.20.2305.017; Mon, 30 Sep 2019 23:09:12 +0000 From: Paul Burton To: "linux-mips@vger.kernel.org" CC: Huacai Chen , Jiaxun Yang , "linux-kernel@vger.kernel.org" , Paul Burton Subject: [PATCH 35/37] MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler Thread-Topic: [PATCH 35/37] MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler Thread-Index: AQHVd+QCU5ec8BbikU2GQVtPG2qJTQ== Date: Mon, 30 Sep 2019 23:08:44 +0000 Message-ID: <20190930230806.2940505-36-paul.burton@mips.com> References: <20190930230806.2940505-1-paul.burton@mips.com> In-Reply-To: <20190930230806.2940505-1-paul.burton@mips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR21CA0006.namprd21.prod.outlook.com (2603:10b6:a03:114::16) To MWHPR2201MB1277.namprd22.prod.outlook.com (2603:10b6:301:18::12) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.23.0 x-originating-ip: [12.94.197.246] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: da36d510-1352-4f04-31c7-08d745fb2484 x-ms-traffictypediagnostic: MWHPR2201MB1022: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 01762B0D64 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39850400004)(346002)(396003)(376002)(136003)(366004)(189003)(199004)(14454004)(256004)(6512007)(81166006)(316002)(81156014)(44832011)(2351001)(486006)(476003)(6916009)(14444005)(186003)(478600001)(2501003)(6436002)(50226002)(6666004)(8676002)(11346002)(8936002)(2616005)(5640700003)(66946007)(6486002)(42882007)(64756008)(66446008)(66476007)(66556008)(446003)(6506007)(1076003)(305945005)(4744005)(386003)(52116002)(7736002)(102836004)(2906002)(71190400001)(71200400001)(36756003)(5660300002)(26005)(4326008)(66066001)(54906003)(25786009)(76176011)(107886003)(99286004)(6116002)(3846002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1022;H:MWHPR2201MB1277.namprd22.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fg3lXp9ROyZFwTBZx5bigvhv6cZCaVI0aZj8FHtzOMGLbu/qasszOZ7EI6gbc7mzeXiXTjSaPxLvvGFvvFv2h31o0P0xFwOqzNH/iel9+N0cPld4t8AWqbuYIDvPxQp076Fvm/BHMKwXPtDx1/EDs8Qd7yDD7upv05Q/QA7xjwWopW51TWIKDo+DZuoVeGtesXK5xbdqlMacmBFmSnqxOw11Pg6d1KXeslSkYG5YQG3duLrKrRj9qFwkrDG+eEYeJc4NVPkiOKiK/Rfh0jlxQ3ws60zLTpNs2lMfvoK9zQ+hr/Nn14Om3qQDYQQE6wvHfr6oXCtUFedvPuiZ796UOi1PgQUFQXsw3H7IctAX7Py/JinL7IKu6YxAtaADtrBy9CI3brVmKYUUiP4/da4ITiD+jxE7U3DWupJQk/LsO1Q= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-Network-Message-Id: da36d510-1352-4f04-31c7-08d745fb2484 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2019 23:08:45.0424 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WuqNcb7PxeJ6duo0UuuFpaFjyRqqmAdPxi+MIlvn/IVa1lW0E2SNyzAav1d0s3kYSedisv12vvsRVBEOdUp82A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR2201MB1022 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In ejtag_debug_handler we use LL & SC instructions to acquire & release an open-coded spinlock. For Loongson3 systems affected by LL/SC errata this requires that we insert a sync instruction prior to the LL in order to ensure correct behavior of the LL/SC loop. Signed-off-by: Paul Burton --- arch/mips/kernel/genex.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index efde27c99414..ac4f2b835165 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -18,6 +18,7 @@ #include #include #include +#include #include #include =20 @@ -353,6 +354,7 @@ NESTED(ejtag_debug_handler, PT_SIZE, sp) =20 #ifdef CONFIG_SMP 1: PTR_LA k0, ejtag_debug_buffer_spinlock + __SYNC(full, loongson3_war) ll k0, 0(k0) bnez k0, 1b PTR_LA k0, ejtag_debug_buffer_spinlock --=20 2.23.0