From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8369C3F660F for ; Thu, 11 Jun 2026 12:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781181942; cv=none; b=NnAlF3KDeZbeSA6Y5cXbPg6zXa9tS2C17pz++8Sz9wUjeQ5Higl/Hh8t+ODbD5g0hV9NcmHkG6KIgi1F31UgcnRSD5Hxosvcylty9xwogaD6RAUGK5SBa++PNbvvBi/qYacKVutQsdL3bMUtF7HlHJjFknrZL99WR3bD8EO19wg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781181942; c=relaxed/simple; bh=hJQ1joGDdJs9zBIZwGJeVzrz7NtAz5D7rhmtNcEgeuQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ASJvwf667BF11sf7SDTccWNl/2NJoxeF8662GbYDkJPxKAOqfeReq3zZ6e10hdUHSGy4VMD+gXbaQT7fDETH1p4F5L1Q1GxwxgTAjD1yrylBxkqN2KfepIdb9mV+urU3V9mzxjbC8DTQ1BX5ip5lvBnz+N0dZe4/BHJ/+7zehUM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PI4/cMxo; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PI4/cMxo" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-45ef74860bfso562831f8f.1 for ; Thu, 11 Jun 2026 05:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781181939; x=1781786739; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LXPVPLZ24FFS4gpZDOA+n5sn4Zne5FOUIT6Mg5+7lsY=; b=PI4/cMxo5TbNasEAclx8SCiI2z6X5uu+6vA5i6in9b0vxCCKSWpPXG9R8FF7mwebXL tJ0EYwFjtKUcRs9glNc+Jo2/2J8Q+SLMN82+XHO7IkNu3oA3VDftzQ0zchwq5y+X/ZeW EhMaMYVunDRe4LOspvTqC0nB++lU9xB5uk5n6NCi920j4tyEdyNK7BAKg71CFyrFXyN5 QuAb3w+LAc/HXnsn+hnVvGbUaxZEaS9gzAnIcmDNSiMIJP5AoIhsdQSUUOw0ghaumeU3 +JF3/GWQnae6gRomWEMvt3wL16bkOQlyjbm6VNB+PMJPLWnU+YBWcsAPKNgctz7qCjLu sRSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781181939; x=1781786739; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LXPVPLZ24FFS4gpZDOA+n5sn4Zne5FOUIT6Mg5+7lsY=; b=cA71UG5PU+uX29AgD2iNaFC27CrZiliGIr302uGRj05qZ7qTQr4TaDElWfciLri4dx y7WkmFzdE46gO8E9Vq7QUKUN0E53RhgRIO/83Bho4sGGM9v7oIMLSFfEOPacOPJ8cTcs 4IaapP3N72S90so6QXIOMTx6qgkiCASs/7wsFNB24JoSsu9CA/Bh5Pl1DdlP6k5ojRxE G2EVj09RxqP+Fe12c4iDCmaJiKxwmRonvBC7244BOpOr3+xltQE//JQ8GxruGRQnJH2u XYSdLzLBKpPUM4GXMv06TsTf4CtfhA8tHJEV/mbXogNEEclo2FCGwiqtdAPvrZUCbuH/ vlMQ== X-Forwarded-Encrypted: i=1; AFNElJ8VCnoM1Jj9xWfDbCEcZs66UIWs/vgEPbrWj0CEDbJmv1EWvrT5QynPVQah4x4qbTlf2QxZYYyySHX79UA=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+qwr4qiDsPRsbhVaarc8lKPnoXU9GFcjjLlo4lUEY5yk37BqG wX9gYtCLj+p3lq7aS8ygCVMZL0powCIAI5wx9Oh10W78rFNQRF4d0oIufzwWv2iomNk= X-Gm-Gg: Acq92OGKrL1qpb4V7uzZ8VrPUj8e47Ymk92ehonADcCVdncPDVLeYtYJuCelhuHW45M dgtt++OGrDOmM1i2SzRDxHM1FnPK9QLy8ywIKgBJSWsH4/99hViSbR2V48KfWNJuvdJIyrfFKkx VyfmUB/l/USD8pIYKmK7za7pqCmNNrY6fhAkwUPkJjRINiroDMwT02QmHa3byP5NXWfMof+wE8S qad0VWmwTJoM4woMT70nw65+FSYsoi4+LqlqzycwjCr8GamBKQ2nznlOPHICWxflzX7KkFoakj/ 5n0cGZmc07ul4YD7oQyXnR8Cf5xP1lv543W+i2bL9ahdM75tb+lsDYN+PLvbviFfSD+6jby5BPn IY1LhPkt9O0j0O26WsJlSfe8NhPNkJMesZrlrOG9+FXSAn4UOn0HZQ63URZH+OIQgbIQ0HiG4N/ QXLHoBE+rN8d5s3laIz2m2sQPfE3V1FHisW02McElcJ6A3oSKChGw4HCmQTgHEVQZ5Lo1bFeKOs pEmA7+1qxRY5h7EurOJBBnEdb9F X-Received: by 2002:a05:600c:8b29:b0:490:6e0f:29f4 with SMTP id 5b1f17b1804b1-490e55cc3fdmr17908975e9.3.1781181938417; Thu, 11 Jun 2026 05:45:38 -0700 (PDT) Received: from localhost.localdomain (ip-109-193-028-127.um39.pools.vodafone-ip.de. [109.193.28.127]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490e532c778sm48697645e9.14.2026.06.11.05.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 05:45:38 -0700 (PDT) From: Marek Czernohous To: Lyude Paul , Danilo Krummrich Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Fab Stz Subject: [PATCH v3 1/2] drm/nouveau/pci: use config-space MSI rearm on MCP79/MCP7A (NVAC) Date: Thu, 11 Jun 2026 14:45:34 +0200 Message-ID: <20260611124535.527275-2-mczernohous@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260611124535.527275-1-mczernohous@gmail.com> References: <20260611124535.527275-1-mczernohous@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Marek Czernohous NVAC (MCP79/MCP7A) uses g94_pci_func, whose .msi_rearm is nv40_pci_msi_rearm(): a re-arm write through the MMIO mirror of PCI config space. On this IGP that path is unreliable; when a re-arm is missed the interrupt line stays dead, command submission times out and the GPU appears hung until reboot. On an Apple Mac mini (early 2009, MCP79, boot0 0x0ac080b1) this showed as sporadic fifo timeouts and GPU hangs under load unless MSI was disabled via config=NvMSI=0. Give NVAC its own pci func that re-arms through real PCI config space (nv46_pci_msi_rearm) instead. This follows existing precedent: nv46.c documents the MMIO-mirror re-arm as broken on several related parts, and commit 5112abc6a433 ("drm/nouveau/pci/g92: Fix rearm") fixed g92 the same way while moving the remaining chipsets, NVAC included, into the newly added shared g94 table, where NVAC stayed on the MMIO path. This change completes that fix for NVAC. The sibling IGP NVAA (MCP77/MCP78) has MSI disabled entirely as "reported broken" in nvkm_pci_new_(); NVAC works correctly once the re-arm goes through config space, so disabling MSI is not necessary. Only NVAC is switched: that is the hardware this has been validated on. The other users of g94_pci_func (G94/G96/G98/GT2xx and the MCP77/MCP89 IGPs) keep their current behavior; MCP77 and MCP89 plausibly want the same treatment but were not tested. Tested on the Mac mini as a daily driver for two months with MSI enabled and zero fifo timeouts. Independently confirmed stable on an iMac9,1 (MCP79) running 6.12.90 with the v1 form of this change (the same one-line functional switch, applied to that kernel's g94 implementation). Fixes: 5112abc6a433 ("drm/nouveau/pci/g92: Fix rearm") Cc: # v6.16+ Tested-by: Fab Stz Assisted-by: Claude:claude-opus-4-7 Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Marek Czernohous --- The stable tag is annotated v6.16+ because the new file uses the .cfg member introduced there by 2f89bb3264af ("drm/nouveau/pci: add PRI address of config space mirror to nvkm_pci_func"); on older kernels the backport is the era-specific one-line .msi_rearm switch in the g94 implementation (nv46_pci_msi_rearm exists everywhere), happy to send those per tree if wanted. v2 -> v3: no code changes; annotated the stable tag, clarified the g92 precedent wording and that the iMac9,1 test used the v1 form, minor nits (copyright line, declaration style matching the header, boot0 notation). v1 -> v2: narrowed to NVAC via a dedicated mcp79 pci func instead of changing the shared g94 table (only chipset the fix was validated on); added Fixes/stable/Assisted-by tags. v2: https://lore.kernel.org/all/c5a46ddcc38172b43bc3d7432e8114669f3dc933.1781162589.git.marek@czernohous.de/ v1: https://lore.kernel.org/nouveau/20260409172126.115441-2-marek@czernohous.de/ .../gpu/drm/nouveau/include/nvkm/subdev/pci.h | 1 + .../gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/pci/Kbuild | 1 + .../gpu/drm/nouveau/nvkm/subdev/pci/mcp79.c | 35 +++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/pci/mcp79.c diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h index 112b674..0172e0d 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h @@ -46,6 +46,7 @@ int nv4c_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct n int g84_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **); int g92_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **); int g94_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **); +int mcp79_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **); int gf100_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **); int gf106_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **); int gk104_pci_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_pci **); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index b101e14..a809ec3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c @@ -1237,7 +1237,7 @@ nvac_chipset = { .mc = { 0x00000001, g98_mc_new }, .mmu = { 0x00000001, mcp77_mmu_new }, .mxm = { 0x00000001, nv50_mxm_new }, - .pci = { 0x00000001, g94_pci_new }, + .pci = { 0x00000001, mcp79_pci_new }, .therm = { 0x00000001, g84_therm_new }, .timer = { 0x00000001, nv41_timer_new }, .volt = { 0x00000001, nv40_volt_new }, diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild index a14ea0f..90f03ba 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild @@ -9,6 +9,7 @@ nvkm-y += nvkm/subdev/pci/nv4c.o nvkm-y += nvkm/subdev/pci/g84.o nvkm-y += nvkm/subdev/pci/g92.o nvkm-y += nvkm/subdev/pci/g94.o +nvkm-y += nvkm/subdev/pci/mcp79.o nvkm-y += nvkm/subdev/pci/gf100.o nvkm-y += nvkm/subdev/pci/gf106.o nvkm-y += nvkm/subdev/pci/gk104.o diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/mcp79.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/mcp79.c new file mode 100644 index 0000000..e2ae242 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/mcp79.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright 2026 Marek Czernohous + * + * MCP79/MCP7A (NVAC): like g94, but MSI re-arm goes through real PCI + * config space. The MMIO-mirror re-arm is unreliable on this IGP and a + * missed re-arm kills the interrupt line (see the nv46 comment; g92 + * already re-arms through config space for the same reason). + */ +#include "priv.h" + +static const struct nvkm_pci_func +mcp79_pci_func = { + .cfg = { .addr = 0x088000, .size = 0x1000 }, + + .init = g84_pci_init, + .msi_rearm = nv46_pci_msi_rearm, + + .pcie.init = g84_pcie_init, + .pcie.set_link = g84_pcie_set_link, + + .pcie.max_speed = g84_pcie_max_speed, + .pcie.cur_speed = g84_pcie_cur_speed, + + .pcie.set_version = g84_pcie_set_version, + .pcie.version = g84_pcie_version, + .pcie.version_supported = g92_pcie_version_supported, +}; + +int +mcp79_pci_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, + struct nvkm_pci **ppci) +{ + return nvkm_pci_new_(&mcp79_pci_func, device, type, inst, ppci); +} -- 2.53.0