From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 5B0CD2066DE for ; Sun, 16 Aug 2026 13:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786885752; cv=none; b=CBKFUCufUkKjOr67C78N/pg+dqIl3FDrj/IDJpINJwoPRyE0Wmw3qB+duyLiB+Oc1iFjgQ5MeupfXko+9GMHLb5TQvMq70yybMb6SYwXpCWsyvLET5HSkCWpbm5XEx5ALBOnL0Zfi/e5hoFULbNP8otP84AT4VU3L3uHxmm7k48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786885752; c=relaxed/simple; bh=lmX7cu/4tn1qYsG36Mbmi2IHh1zIEcmDIbZEfHIyJ6g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=PYzMWX6QF4BK+C1RKchcrJcZqwK4t45HmH9X/U+hD9D2ERPUWSoi3GNjaBQKSS/AjPIC8bBie2YjI6rlGGnFLBoTrhz2Gts6LWVOZTsjvPCdnK9L0/1Otjg2vaIyoW+13W7kVKnKc+pmRKttA3Tgs3iHamukD+CU7mPHkWdDzGE= 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=FeU79Lbq; arc=none smtp.client-ip=209.85.128.45 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="FeU79Lbq" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4957799b92fso3107095e9.1 for ; Sun, 16 Aug 2026 06:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786885749; x=1787490549; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=d0KY6ujsVdhJpdGQ0TGxZp2xPfufyCTAKNlLxKb3PUM=; b=FeU79LbqqyX1Yyx8d+XdaphPQQx2qDWIvFKasl7D9hsq76jNKBzR5b5Zwqu3GCGRH3 GwizNGEgFnXu/78C0DIoDONHDyotwlT/cM9PK4zKPs0o/8tz7dCeu5AFrp104l43saYC vGC68U9fLPB+h1HVHBJtfRgqRQThiDn3M/JBoOqXY/lj3WCvBuqFU3iEm+tv677Co9iT pLgw2ehBkr0jZjdMjd0o0NOw1Dr5uFdg4oDXjeunD2ZfMoMfD/TratcnUC7aT/Lh6mhl ScThs2j3BiQmsA7EMLGkr7ejHfleYw95JJR02GGhzCqXbx53iZCMaw1BDC9ZsoCtdOvq 1zSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786885749; x=1787490549; h=mime-version:content-transfer-encoding:content-type: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 :content-type; bh=d0KY6ujsVdhJpdGQ0TGxZp2xPfufyCTAKNlLxKb3PUM=; b=aMeSZu3tRk+/oM9QEOaOm5PKTs2HeyOAslPZ5ayZxNHVhfoC1bfvf5ALra5mvVv26J VJ71lMhnlOtVH5ZkueHlTRtmq1E/aPC4rB89kG2pd1S4mw8m42T9lyrp57TryAd4K39m ypA4QiLw5q0xyl963VkpcFhrWmf3HsoGs6ESrZa3rauI5w80NtZRASaoy/NhEO4qxHBv sWea5vA/axGtyMbpTgLb+QFwqooonJzHv3EchX+9CUbTcjyfIlVxUYW7spKIMIWNis+w nidJYfEzTFEJfkemmP8T3rzvFPIyx5FWEmZL+IBTTty57hRxZOKUC7LWSKNyqmgVWd9l xJew== X-Gm-Message-State: AOJu0Yz2PtORfdjOnwpkhFFhDMSANIp6EKpiuQzoxpeVw2MSfgnjZg6D zdqmH360sOAWoMz0K8wBQgFE9AKijSXyJ+z3suvDVyt3eP8IJwUSJXqu X-Gm-Gg: AR+sD114FbR3uGDrv9uOxpnEEMHt4iEzYofqQTjZHZT6XFp4YMsSc/B/qB/unHzEd2e /przqxZ7GbJ7d6SoIqhpS9rsMltNPvEPclnsKCucG2loBD1xlXH525SR6fN9hAO2vT+1z7SkIPE muUuX+OCscNxV51UV91ZUQFkkDT58QR7aZ3uuGb2nykzYXLEg3rrWCz1xhyeuTlkwMrnovV4zz/ IwFDcS2ecyL4cqYXu955Tq04xyxp6xbUnszh/7DvQMhNovl71gpwD/w8dMw+XVEwV4keptPgrQI uqRX5h4hRdusj9iT8DG/2UZLD+EUuEHMByMTu4IyrRrhUlsBpU+4ZsCXPk+oGgx3vkzwhwyH9L3 oitq9FZfxHJSSJ4aMPFqotF49UlSH/GshaHeY/pCtljXH/vZpEuAU881yrpTNpR+NovuRmZyCrd BQnPyvEIpcdgEx0RLT/M8tvENI7/0GJrLvFyg1xeOMfqthLF48yAXPo0f+zDo2ICbsSmfE0PCHz Jq6l+Iv4jDrAXYj+PK4qRQ1E9AlheojfWolvhWklw== X-Received: by 2002:a05:600c:8b57:b0:499:8411:9e8d with SMTP id 5b1f17b1804b1-499878cb099mr138184085e9.0.1786885748398; Sun, 16 Aug 2026 06:09:08 -0700 (PDT) Received: from [127.0.0.1] (ip-109-193-028-127.um39.pools.vodafone-ip.de. [109.193.28.127]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49996105c0bsm66548375e9.4.2026.08.16.06.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2026 06:09:07 -0700 (PDT) From: Marek Czernohous To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Danilo Krummrich , Lyude Paul , David Airlie , Simona Vetter Subject: [PATCH v4 1/2] drm/nouveau/pci: use config-space MSI rearm on MCP79/MCP7A (NVAC) Date: Sun, 16 Aug 2026 15:09:04 +0200 Message-ID: <178688574401.522643.12812428444459119913@gmail.com> X-Mailer: python-smtplib In-Reply-To: <178688574400.522643.6695278742335367229@gmail.com> References: <178688574400.522643.6695278742335367229@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- .../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 112b674ed9c8..0172e0d200f8 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 ea62dc97f118..f7e02a16e5bc 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 a14ea0f7b1c8..90f03baeb22a 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 000000000000..e2ae242f1aa7 --- /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.54.0