From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795053457; b=pdfCrxHMK2g0Mwt40oRz9V8tiXKgsRM2nCbjA7Abizfn39zmfjlIvQKGxzvk1fI9JC4G qxyYC0yvCUdznKaOU0gZiWDO8n7axcX4QugaxDFP36KPadhecLRbofgiJ2j3ez685AM6F sXZzJCTXbgVEu8Ap66KukN9oPxQe24WqMyjtKgBAXpyOlgGtSdoR73n66rYZ0TgHVURVr bg2lw56GUyku/4WQHtg2bIQNNU/dCdiJjPotVjwhpTEQbSlq2RL/fL8NewrYECZkKjguP lHmFPbiIIVF+RxSipSzwoxqNUmmjErJXJb+PvsGTr9VqQX6O9V1REBrzythENCVtsyQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795053457; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=yWrMmqpwog0oTaDIlMAW7FGD2SlH9fo15NyjqUchaQ8=; b=t2Q5w28S+4q6VJQpMahdHBaWM4CkKOt3ylJcVJTyShaRALcPzakme1gOLTNgqlz9qTFa LpADE36CTo+pd6sd1gjSe7csl+CQRXGWy9B0ihB3FPafpuWpztE4oRCKSXGVd+vuuiSTA P1KEDPhV02rkE8wlGEyFjzgPS2AYNU5zAJM3knNdL2tjP876zaAnUuSO49i9niIVAc1Da 6hhKHW0gVWbl5kK/0MV8L9xxiLIw0IqazKUNWP33vjPjASMNnO5fohCvK7LuPFAkCEnJs gSBHIdkY1xRxnn+xSlrSMSoUn0ANiHMxBgC1VnOSzXhxeAkUfbm7XrYtHsdygjOzTDw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hCiCEUr0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 034D6606A31C; Thu, 19 Nov 2026 01:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hCiCEUr0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B54B1F000C4; Thu, 19 Nov 2026 01:57:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795053456; bh=yWrMmqpwog0oTaDIlMAW7FGD2SlH9fo15NyjqUchaQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hCiCEUr0JOVCB5UMi6mTD9Gx4uzyFiGB+9rN+iJ8MdHNXD1BdECYdH5P+lbwI4Zli iJy9jRKi824Nb7rdKg3HVZtuEeY3lKWoztWXTBrqgbHOGOLPt2hG1c5pYmjHS/ksXK IBkvJWtMsDYjGX1lhByFFszKoFt2fpNAwOYS73NU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Imre Kaloz , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.15 0925/2214] MIPS: sgi-ip32: Leave MACE PCI control alone in config accesses Date: Wed, 18 Nov 2026 15:43:21 +0100 Message-ID: <20261118150049.373077007@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Imre Kaloz [ Upstream commit a55a7df2cf788234850d9053ecc25a5470175929 ] mace_pci_read_config() clears the master abort interrupt enable in the MACE PCI control register around each config read. A register read followed by two register writes can hang CRIME 1.1 under DMA load. Ack master aborts in the error register instead, and follow every write with a read so back-to-back accesses cannot form that sequence. Fixes: c990081bf87b ("[MIPS] Fix IP32 breakage") Cc: stable@vger.kernel.org Signed-off-by: Imre Kaloz Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/pci/ops-mace.c | 26 +++++++++++++++++++------- arch/mips/pci/pci-ip32.c | 2 ++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/arch/mips/pci/ops-mace.c b/arch/mips/pci/ops-mace.c index 951d8070fb486..8827e5f2ea460 100644 --- a/arch/mips/pci/ops-mace.c +++ b/arch/mips/pci/ops-mace.c @@ -35,15 +35,27 @@ static inline int mkaddr(struct pci_bus *bus, unsigned int devfn, (reg & 0xfc); } +/* + * On CRIME 1.1, a MACE PCI register read followed by two register writes + * can hang the machine under DMA load, so every register write in this + * file is followed by a read. Config cycles to empty slots end in a + * master abort; ack it with interrupts still off so the bridge error + * interrupt does not report it. + */ +static void mace_pci_ack_abort(void) +{ + u32 error = mace->pci.error; + + if (error & MACEPCI_ERROR_MASTER_ABORT) { + mace->pci.error = error & ~MACEPCI_ERROR_MASTER_ABORT; + mace->pci.error; + } +} static int mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, int reg, int size, u32 *val) { - u32 control = mace->pci.control; - - /* disable master aborts interrupts during config read */ - mace->pci.control = control & ~MACEPCI_CONTROL_MAR_INT; mace->pci.config_addr = mkaddr(bus, devfn, reg); switch (size) { case 1: @@ -56,9 +68,7 @@ mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, *val = mace->pci.config_data.l; break; } - /* ack possible master abort */ - mace->pci.error &= ~MACEPCI_ERROR_MASTER_ABORT; - mace->pci.control = control; + mace_pci_ack_abort(); /* * someone forgot to set the ultra bit for the onboard * scsi chips; we fake it here @@ -77,6 +87,7 @@ mace_pci_write_config(struct pci_bus *bus, unsigned int devfn, int reg, int size, u32 val) { mace->pci.config_addr = mkaddr(bus, devfn, reg); + mace->pci.error; switch (size) { case 1: mace->pci.config_data.b[(reg & 3) ^ 3] = val; @@ -88,6 +99,7 @@ mace_pci_write_config(struct pci_bus *bus, unsigned int devfn, mace->pci.config_data.l = val; break; } + mace_pci_ack_abort(); DPRINTK("write%d: reg=%08x,val=%02x\n", size * 8, reg, val); diff --git a/arch/mips/pci/pci-ip32.c b/arch/mips/pci/pci-ip32.c index 30aca6f76563d..41ec8453c865d 100644 --- a/arch/mips/pci/pci-ip32.c +++ b/arch/mips/pci/pci-ip32.c @@ -77,6 +77,8 @@ static irqreturn_t macepci_error(int irq, void *dev) } mace->pci.error = flags; + /* follow the write with a read, see mace_pci_ack_abort() */ + mace->pci.error; return IRQ_HANDLED; } -- 2.53.0