Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp354645ybn; Tue, 1 Oct 2019 22:28:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdrwVoJPGKlWvwjpfh87PWPCzwsWUY1c8VwjxFNviZI0hvlrykFR+JnXlx4Tf+8aSaThGl X-Received: by 2002:a05:6402:356:: with SMTP id r22mr1876325edw.254.1569994116593; Tue, 01 Oct 2019 22:28:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1569994116; cv=pass; d=google.com; s=arc-20160816; b=EOUcWiDbNFcSbvqNMgNm8ezvbWRQwhJhhlMB/8gOCdXDpeAbUplO0D/JWxpCFP4wJ2 ybWsmEVmD2OEUEErp7fJtU78fa6z2yAT9P4cTG3EqvS97yIQiCHiq6HUEAkFVA2RbPG5 nJQ1zIqTQ/ctRd7m/a34C37xpm0NhsQ4FM3OQQZe8B8nhnkqEnq2VQd5tJP6HP21QCoZ Zgyj9Mzevzsns+VjBZEo66Vtn/BfAw8w6BO3OTVAWt7Ppjebi0YFXkbHPVbuHH/eF1hv 69kjaXDF+TfGTS0/Thr8bUhld3GTQylUGwjh/SuaXCuNmGBK+z+dpBmYtdiOw99G05E7 i9/g== 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=/+BP8EbJp0rVcdy7AFdozelvMtBsULC5QYdNbsMvZFo=; b=XwxhENrPNRDnGTPw71zvSusWbDOFyICfAKEjAGUsMSu9q5woValQlPnGLYpWos/HaU 6qvPACQQFgoH0ErUsaNRhlh2gjkcWYYPmSqf9HuyUgTZenZD0AJYnwZYShpTM0hvz48f CNfb6J0A7RESVyVIfgbzcU0r8X1UUD75rXn94SykvfLox4SeKOTozhaGq3qi5iJ4H+l5 rttfmNw4fhVLCty0RCYQzyuEQ1SJc733xByVPsvjCYJH0AE45NHJbrvXw1oOIXHTBA9i /4HxC8ksB4TNm45BXR0Tmm47x7NwIufpV+9ASlXdFr9CGMDA0Ylr2x4UOSrtFzjzfn4e kTCg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wavecomp.com header.s=selector2 header.b=W1wn3Znz; 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 q28si10640545eda.322.2019.10.01.22.28.12; Tue, 01 Oct 2019 22:28:36 -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=W1wn3Znz; 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 S1728471AbfJAVy2 (ORCPT + 99 others); Tue, 1 Oct 2019 17:54:28 -0400 Received: from mail-eopbgr750115.outbound.protection.outlook.com ([40.107.75.115]:30851 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728425AbfJAVyW (ORCPT ); Tue, 1 Oct 2019 17:54:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HUl6jQ//W19rsoIqZaY0BQCNcXnP4ASTai2TIGMWhxalgVQheJCPKsQ0LJe/E6oh7OcTMvK75txz0HBuIP6isiyH5IPgZ5k3JG1wNGfr7io5qB31coyXlX210LNVHNLxCdJTPcnoLilrSQ3k64yDZKVygjJNvKt4ewOPklZr47NXPIUtYUTF3+/MAzw0lV1P3W5BLAsbU5rC91eRSEVuCaPPomYZZ7QBvNWR1fcP1LsHwniofpBVl8p1Pj4coJw7c1yMthX3wibOjbABe5DLTJEqV23/Gr7SiZG1vrqhuYQgqFBy78Gw8YLI6xeDc5rDJsdDh8DSNRVJyev933QREA== 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=/+BP8EbJp0rVcdy7AFdozelvMtBsULC5QYdNbsMvZFo=; b=Ranmi2QLqhuKN2M5e9JGowrGjsJXqCyzpbq3oQ/qDubk51W+QTawlmG7ryZLz21Bscj28JJu2l4FV5BbzA2IUDqGftm3pscOSkcj60s+dQWR8hzWmYN3O0ustq2z+o4XyoUp1Udjhx/3ig/pKu2rfNZQG4f9+LOw61PCOPdfWzPRtDgp3aEGVIcBDmEIsT9ti7uCbtuRXbaWEThWuwUCb4CLx4Z4y2YujEgc67a24L+IU2C4PwmqzyL95ENV5J0Joh58b+Y7FXO5HS6S49oN6Ped6dtfv39SBV0N0E4ON9twfBod3hXoStx1NkxxTKmoryKWGy282fBeHrK970x0/w== 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=/+BP8EbJp0rVcdy7AFdozelvMtBsULC5QYdNbsMvZFo=; b=W1wn3Znz6NJd7mvW86PJOD/i5Ll9GiWvBD6LPpswZM3rlCVM3kTVDkj1/oQu2QSugpXjuv/TT6z5hnXV76V/prTjiZ2MUDwgyIxkm7KyHBBn8JDtQECnV+mCJjA9oIqOpu47Iq6xkGbxTBjhhpo2Z/z/HGC0vA8zIbvFEHc057U= Received: from MWHPR2201MB1277.namprd22.prod.outlook.com (10.172.60.12) by MWHPR2201MB1581.namprd22.prod.outlook.com (10.174.167.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.15; Tue, 1 Oct 2019 21:54:16 +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.022; Tue, 1 Oct 2019 21:54:16 +0000 From: Paul Burton To: "linux-mips@vger.kernel.org" CC: Huacai Chen , Jiaxun Yang , "linux-kernel@vger.kernel.org" , Paul Burton Subject: [PATCH v2 34/36] MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler Thread-Topic: [PATCH v2 34/36] MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler Thread-Index: AQHVeKKwzu5kY6X3IUqruCoqAj70MQ== Date: Tue, 1 Oct 2019 21:53:42 +0000 Message-ID: <20191001215249.4157062-35-paul.burton@mips.com> References: <20191001215249.4157062-1-paul.burton@mips.com> In-Reply-To: <20191001215249.4157062-1-paul.burton@mips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR07CA0093.namprd07.prod.outlook.com (2603:10b6:a03:12b::34) 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: bf9d3143-be94-4bbe-8a42-08d746b9d341 x-ms-traffictypediagnostic: MWHPR2201MB1581: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 0177904E6B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(39850400004)(366004)(346002)(396003)(376002)(189003)(199004)(8936002)(26005)(478600001)(6512007)(8676002)(81166006)(81156014)(6916009)(386003)(76176011)(186003)(6506007)(25786009)(52116002)(6436002)(99286004)(6486002)(316002)(102836004)(54906003)(14454004)(5640700003)(2501003)(486006)(4744005)(66476007)(7736002)(256004)(14444005)(66556008)(66946007)(1076003)(64756008)(36756003)(107886003)(66066001)(66446008)(4326008)(42882007)(2906002)(6666004)(3846002)(6116002)(476003)(446003)(2616005)(11346002)(2351001)(71190400001)(44832011)(5660300002)(50226002)(305945005)(71200400001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1581;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: Uaw5EaBerF5xwd5YTlTFeJlsR4XQK800G1X/DWfMHO2l1+qfQlzxLX31OfrIE/AF1+j2DMXzZ4DLktEhxlqEDrZnVKym/ORZE4GNBRfb0pp/3uUpPwaMWwddb91cqwiL7WDUOo2ofGeq1Ym0WISce+4O1W15BWhlJWYsevesOB1+aHP4cEHWA7HNSkFtU35hWY9ochFQhF35qyOSZvfbYZiupDR1ltyxI2bn52OyFM+q53U+Kq/2YpHQfmT4iOIbLKmv+XJUe9i2ryKAGCUr0WZb/6B94ygq3zYaR2xZTDqbL/zdHWouy2OQ6HuCYrZDZXg10xEHpbqHaVFX/j/JfKRW0o726pWNcjLGImOyyoU10MYwjpL13PL1Hir8X68ZvmRxvHm+YXywt1CvOXemri+i4tBFPM2PahNzfcxxixc= 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: bf9d3143-be94-4bbe-8a42-08d746b9d341 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2019 21:53:42.5305 (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: KYYekGG+Fe40NXL31TgHTn6mCGZQ5OPJDL/qGIsXdK/Snn1tEsED5jzM0STidMrvyczg5sq82C8v9VM3ZdJgbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR2201MB1581 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 --- Changes in v2: None 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