Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3310082imu; Sun, 11 Nov 2018 12:06:14 -0800 (PST) X-Google-Smtp-Source: AJdET5es36kjs1BgwPFiq1MVbukL4dUUyq9fZct3zW0/0G97zksJ6RYyeci3cE5GX2l8pOLR4d1i X-Received: by 2002:a63:2214:: with SMTP id i20mr13782668pgi.83.1541966773990; Sun, 11 Nov 2018 12:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541966773; cv=none; d=google.com; s=arc-20160816; b=BX1NibMG7GgwwAAL8TyhWgrCvIfQSkeGUTCvewSFGzF2YqicUrBPwHMot1sNjKbtN9 2FCo5oiW0EyAflHpGi1ReWrAS4Mp1ndRy8sWYLKtaWvjk2wm19fLEp2YsCCMrH2M6F49 xkP3CidIzvQYEQ/arTMWMYA+2yPhiMiLcvIbOFS44bKsmRs/EVb6gsem1ATrm754OwjR 3Q6+g/3NiDmPNGGjJpiXIbcaDtLpACeeukdi0XVvlXv/tiPJ+li8KHtfvMHzneeC843J Hb4Y8P+nL53LR712JHQVANAcFq59DekIEOigNfdMvbYXsHUv+jgMdYRpmLRUTH0bDOfU zkmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=rdvVNG2QH0o3e5kGWtLbQDdAwNVMSSiyn+sCymFyFQg=; b=wbvEcZe1CptzJnkJnz2Emc3A9W0ASqQGGnwFDmiBun456kppjYJtdOXgmXk2G+xmH5 wFYkN0LlGOu0Yqf49haHTRx2SA1SKjagd5sYIdPe06Pl/2t2s816KFFI9kUL7MY2DPwc 63EE1mfQZJsToDWKmFGRJHOel91lSaljMGIG0cVq5kUAkGle7+pphF1MRkVEPisCggFG DdH+qlsqKT8EVXn4vGqsggSz9r8BbFILkYbVm2nqWamFdXiiHsctrdmB0ayNsU/1N78I oas8pI40rA8INhYLKjSIUZuWuKP3BowgxC7mU8mGRmQh9qHNiV8AWhx6hh1vvdOFk1p2 EkZQ== ARC-Authentication-Results: i=1; mx.google.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 ba2-v6si15029807plb.88.2018.11.11.12.05.59; Sun, 11 Nov 2018 12:06:13 -0800 (PST) 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; 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 S1731295AbeKLFzH (ORCPT + 99 others); Mon, 12 Nov 2018 00:55:07 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:51832 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbeKLFzF (ORCPT ); Mon, 12 Nov 2018 00:55:05 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsz-0000lK-OX; Sun, 11 Nov 2018 19:59:09 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsS-0001Z3-Nj; Sun, 11 Nov 2018 19:58:36 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Paul Burton" , "Hauke Mehrtens" , linux-mips@linux-mips.org, "=?UTF-8?Q?Rafa=C5=82=20?= =?UTF-8?Q?Mi=C5=82ecki?=" , "Chris Packham" , "James Hogan" , "Tokunori Ikegami" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 151/366] MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Tokunori Ikegami commit 2a027b47dba6b77ab8c8e47b589ae9bbc5ac6175 upstream. The erratum and workaround are described by BCM5300X-ES300-RDS.pdf as below. R10: PCIe Transactions Periodically Fail Description: The BCM5300X PCIe does not maintain transaction ordering. This may cause PCIe transaction failure. Fix Comment: Add a dummy PCIe configuration read after a PCIe configuration write to ensure PCIe configuration access ordering. Set ES bit of CP0 configu7 register to enable sync function so that the sync instruction is functional. Resolution: hndpci.c: extpci_write_config() hndmips.c: si_mips_init() mipsinc.h CONF7_ES This is fixed by the CFE MIPS bcmsi chipset driver also for BCM47XX. Also the dummy PCIe configuration read is already implemented in the Linux BCMA driver. Enable ExternalSync in Config7 when CONFIG_BCMA_DRIVER_PCI_HOSTMODE=y too so that the sync instruction is externalised. Signed-off-by: Tokunori Ikegami Reviewed-by: Paul Burton Acked-by: Hauke Mehrtens Cc: Chris Packham Cc: Rafał Miłecki Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/19461/ Signed-off-by: James Hogan Signed-off-by: Ben Hutchings --- arch/mips/bcm47xx/setup.c | 6 ++++++ arch/mips/include/asm/mipsregs.h | 3 +++ 2 files changed, 9 insertions(+) --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c @@ -253,6 +253,12 @@ static int __init bcm47xx_cpu_fixes(void */ if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706) cpu_wait = NULL; + + /* + * BCM47XX Erratum "R10: PCIe Transactions Periodically Fail" + * Enable ExternalSync for sync instruction to take effect + */ + set_c0_config7(MIPS_CONF7_ES); break; #endif } --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -674,6 +674,8 @@ #define MIPS_CONF7_WII (_ULCAST_(1) << 31) #define MIPS_CONF7_RPS (_ULCAST_(1) << 2) +/* ExternalSync */ +#define MIPS_CONF7_ES (_ULCAST_(1) << 8) #define MIPS_CONF7_IAR (_ULCAST_(1) << 10) #define MIPS_CONF7_AR (_ULCAST_(1) << 16) @@ -1817,6 +1819,7 @@ __BUILD_SET_C0(status) __BUILD_SET_C0(cause) __BUILD_SET_C0(config) __BUILD_SET_C0(config5) +__BUILD_SET_C0(config7) __BUILD_SET_C0(intcontrol) __BUILD_SET_C0(intctl) __BUILD_SET_C0(srsmap)