From nobody Mon Sep 28 08:08:51 2026 Received: from mail-yx1-f53.google.com (mail-yx1-f53.google.com [74.125.224.53]) (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 8056A46AEDD for ; Mon, 24 Aug 2026 16:57:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787590646; cv=none; b=LsTIm7yZ+6vto4WiceUPX8F38kK7hxGoSqLo6Khh7G5a84MYI0eg9TPjuH8tZuHJiAaEWLz4zpN75rE0GAC4zRABPSMtMpxjXtF1fM41z2r4jDR9UvLlPsYooexVokVl+q097iLj/Tk8poVKWCeJZqyo/jS5gjD5lizwmEg5QxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787590646; c=relaxed/simple; bh=qPFbyNfgpwg9yWO/kca52NMFXHq9EURI69hJLqr0qrM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AixjIbY5X7MqwmkxInJTdVAlJfOyGhG5G/faQDBCXluvtUD13wvS+bcRaJ4hGdZrjZkojKRF8kDKtA05NItoXw7AuCj5NIaIZrqvrwjc6txJK0IZb0deASal/abTQqpJ8soDs71BvTy/CmO3o1ykDviuKNvgifLixuEG4929vHI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=h1wzptdP; arc=none smtp.client-ip=74.125.224.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="h1wzptdP" Received: by mail-yx1-f53.google.com with SMTP id 956f58d0204a3-66bd7857841so2996855d50.3 for ; Mon, 24 Aug 2026 09:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1787590643; x=1788195443; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jo/Xp3hk+Y605226pQBHdS6U5/IvpUZWChA5HanrmAI=; b=h1wzptdPqkr+QfphaDJJo4lY4zulUAnPCqNDH4x4r3fndjvbw08ACoC2xWZECrnNXi kyWjzfwWeiFuJgk9wgJxhLGtdkHu8Dub/jJW8pZizv29QT21v9lJhQteI6p1ePrKQdS3 mWB7sx6wQABbo3jRs32YobCoEAzev4iK64pXy3G7vaZzEBWh5YmEICcfDWWBpqyCnCqt w9NSf8pAApMmDScZ7w4oVlJonidz1et+8czqw+CSSMtKYtjOlqLQHTSS0CxaNjlQlZRv NjfJn8AeKQSGfRpfAW1qZr2DLa9CpXyJDnQfL+ULPSeO7CwJlZJJyaSzmAg7JzN+2v/0 XAfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787590643; x=1788195443; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jo/Xp3hk+Y605226pQBHdS6U5/IvpUZWChA5HanrmAI=; b=fA10bvTnoM0bXY3gabFHV86lrAwomFnQMFWg6wv52RxXufhEhU4N2u3EY5D8TXHllF MrckNlQMtq+/2/wI/7LfxZKVFSmay/1YlGVhbcCZ6bS4TMzsLBs+LekXob0b+IYq4+6c 2KfGU4tYDIedD59iGlEs/hcmRJCg0Pf1j6qpOx8/sLd+EX2p1c1GZoYHig31ijYXcCcH 7bALciInjzYD1nk1vRyHEHB1vDiE7mj0Sc6qG6mhDzElqUptZjnyzSRUcvOMtmquca84 icgN2ADdMrkmkUZWcxUF/1PtYtWowg9dsPstI1yoQWI3uca/aDt6oY0DYxhAqxZPKoOV e4+g== X-Forwarded-Encrypted: i=1; AHgh+RopdtMvcgjQshd4S8tbqDuZWXIhP64ihrDMuDv5656I8cXiODSOYSkLgJyV3bQOsyhdDPV8ZHsxGHsI0XM=@vger.kernel.org X-Gm-Message-State: AFuF++kAOdCYCUDsyOLpTfzrvJYbReToGyNqqHhl4LYyaoajW4hPjROM 5AUwdI9S1Hwh/jKLe4e4X1B/FpwJkn7F5SRa9NzLgWamn+uOj4i3E0z3sgZOOWghZNnoGnjHERZ lorHxB/E= X-Gm-Gg: AR+sD111ou2ndtbN6koAxNQgjh1kVRFqc2drQdIMVQhedpMo/DCI9nS2WgXKmEoC5IO hSPk0uFmh6pgz0UUq23kFDpPpiHmexGT3uerz+AmceRPJEFWKpHM9xpZL264q3rJLDVvlZLd1ET AErInO/VUXHmshrA1oDzh09JDeF4QcGOFiT6Mjbmxhtj3j792FFVgjV6Bi93guqAzl8UXXoglez 7UUk0UUIGj4tjoVvYvk2t3CdQRfv0wTUhH0k/JnUbPdUy5DdOOorzMneYU4ZEbgMsRRwGx1mZtF bnmfiBIi0aef+fPYtLmU0zl1zzrOakDiqk1PD7JYc+Y9ou7xIXmA4RU8oZB2ok+ad+KfCt9cIzq L8hr5gHSe0VCKfnUgL+rX6kTFVIrJuB5ge7iSlKQ5rEtQUSpvjbTLIP4pAgmSt8f5CALYzuTANV DJLlGGEQZTxXpJCeNU5DN0qdfmTlzu2JIJLfZXKnPHqeAHtVx3waNjrFocIlNmihrAPi+SgG41S iUP5g/z+0BNu7sNv76UaDBzuuaLmvsV9wFGX4+EGEd2WG5FDFI= X-Received: by 2002:a05:690e:4287:20b0:66b:14e5:d226 with SMTP id 956f58d0204a3-66d14aea4b3mr99471d50.34.1787590643448; Mon, 24 Aug 2026 09:57:23 -0700 (PDT) Received: from [10.200.24.109] ([12.55.13.134]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-66cf4665056sm4137612d50.8.2026.08.24.09.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 09:57:23 -0700 (PDT) From: Anirudh Srinivasan Date: Mon, 24 Aug 2026 11:57:06 -0500 Subject: [PATCH 1/2] PCI: Add Tenstorrent vendor ID to linux/pci_ids.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260824-blackhole_quirk-v1-1-fc004672cdbd@oss.tenstorrent.com> References: <20260824-blackhole_quirk-v1-0-fc004672cdbd@oss.tenstorrent.com> In-Reply-To: <20260824-blackhole_quirk-v1-0-fc004672cdbd@oss.tenstorrent.com> To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, joelsmith@tenstorrent.com, Anirudh Srinivasan X-Mailer: b4 0.15.1 Add Tenstorrent vendor ID to pci_ids.h. This will be used to apply a pci quirk for the Tenstorrent Blackhole card. Signed-off-by: Anirudh Srinivasan --- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1c9d40e09107d..8ebe4c468d39d 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2630,6 +2630,8 @@ =20 #define PCI_VENDOR_ID_ALIBABA 0x1ded =20 +#define PCI_VENDOR_ID_TENSTORRENT 0x1e52 + #define PCI_VENDOR_ID_CXL 0x1e98 =20 #define PCI_VENDOR_ID_TEHUTI 0x1fc9 --=20 2.43.0 From nobody Mon Sep 28 08:08:51 2026 Received: from mail-yx1-f49.google.com (mail-yx1-f49.google.com [74.125.224.49]) (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 6BFBF46D0A5 for ; Mon, 24 Aug 2026 16:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787590648; cv=none; b=glaUCa0z6dzvwKXr9UCTLDrnXVrS58msFdeCRfgX5n4zlD7tLR2H6XH/vxjYuJlZvzk+g+WEh1ogd9SPZkAYJNYKovavl7lWdwPsDV6PUwXFujxLDjn2IxuAJnsB3VWXKq6QDi6vbvPS9sugUBSLWlLdglxfbxDPncmeJI2+nws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787590648; c=relaxed/simple; bh=go4n6ZuQRhYmWKvNHMZ8SaBHasMSdrMAkVmjL3Xy3Q0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BnHciPpFX1K1j95xZb5x5/HiREaACsrU2eXLjwgstOBFXEnVjlPXs9gYgWKP/e+NvgqoJFf6Me7KKHkIPEOvVxuocweaXAur1SENZ8zqsL/ocF3ma9YB21ClOqF8N4i2ToMPGltNkYyzfR+O00dTOkJ1ypG0TriGn9ZEl9zGOAI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=IZYpIrpP; arc=none smtp.client-ip=74.125.224.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="IZYpIrpP" Received: by mail-yx1-f49.google.com with SMTP id 956f58d0204a3-66c70f05859so5408665d50.1 for ; Mon, 24 Aug 2026 09:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1787590645; x=1788195445; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yxmgsXZEQFkN2JV6d5wK/Y1ilbmlZEBc59h1qR2MPM8=; b=IZYpIrpPQABD/TF9aE7F2X+elvOUf2Qz1oS5n6wBEo3F2fLQA+sRzNYCZ07tIitHv/ hvIekK+RCDzsXiN2xqgjiWQM6w6+U+XJY91Rf4MiBXIz0Bt/esessruaPDUEJnhDhhA5 TPIChC9gbVyltU1Sue72rzsb5SwdwYhlZsoLgaBzeSLzGQzQAx6vpEgO8NGuxRAVLGSD 5p5qsGwDW/tL7LSMUeZ7Lf/bCjGJUZFmkVTJ9Gt2kum9mz2ZRoVw2tf0q0qFs73MwWh5 vJJtFAb/9j/PRC0/oWCwumy5jgf1S1F2k1Ld9Lt98zlg628kSej+vkyQ8TXrC9i2T0Qj joJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787590645; x=1788195445; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yxmgsXZEQFkN2JV6d5wK/Y1ilbmlZEBc59h1qR2MPM8=; b=XjckFsS/nD2L0rPtUWXIiyWuoF+C9ctHcJENDesdtUvLLSVcGq5mVLTrY0rKT0j6pt rNglfXdHjzLJVNuw9EYsbd3eIkfAm05rCYQVEUReYfvu3zl5dB3RZWXcoXkuz/APGR3i ZLfakO+UnYwYRvnLFXTw5VTkqikDcvP3+NfQ1lGDM9e70HZwiLXw7tEwOT9/HUjrs4zN LQAoVKB84sNE5139BI7Ov4AEkpjzDHuKFaA5vTYO+DC0rHszOg6aam9XIAksEXblcZme qW5mWyv8laNSXIjJWRFtZNVCYhkVEVc+1PIRkFpPF1LTwO8/72CEuU6rPxxbHhHHagnt kV/Q== X-Forwarded-Encrypted: i=1; AHgh+RpgsHIWeN3G7ghoSoxjtIgzqVXZRn61e7n3/9my4dlDvydMSUI+PA0C6cg4fUnmGuUMvfNB3w2Y1wLQKIU=@vger.kernel.org X-Gm-Message-State: AFuF++nknRkY4gdt13ff5Ir5VSEQ5KmHwguBNqa5vsGiKI54P/I6X0pX aVMzOm7GKhTAhfYFjb1k5gomwkqxKRZml1W50hr22L+ykwOYwmo5RRvtvSxeEEMUjjwwXz6DJnY Oe7XSLq8= X-Gm-Gg: AR+sD12RHbEqeLPlMfMjMdNuSkPbvBKBB6F3aM2zUO7oyec7DwdYN4BXoA0EqFk0oZu BCm/ZY0zd0TRqxWzrxCzg8yRzUbd3FX2pzZ8UAUeS6vm3/t+FJDZJDhIT3o8MjI41QfQ7re/0gm oNdsnVoHXVgYmk0t6UbNRb0c+6PCBYy2MwAdwOA9VpnTgKmv77IReOqk1gIM6k/PdH+qP/6I4JD f/5Ty4FluODncM6UVBZBlNh2sw54ktxr8yaWBSBeZWyc9u/xAaz8RwyIDMYyucx9kCcoC9JujYz lm9HHWjnFUcXX7+ROsF+3UpMk2lphwu6jD/CDW/QxCjMbMVCHEZdBbgB4FOH9HSTdAZXbNOoPhB 4rrJidJ72id/VYep1ulX3X0IauzpPxYCGtAfdQOZu9wkvsr3Au738YZTzrL6jZz81uWbv1/0TaY Ed8a5D7IST6tZlfzttq5RAf+AokKQteOR1TZReU1rgXRajtSKbA8yMMgjvVnR97wZm2bvKz/m8t 2S8Tyid/sMNPdpGO5Fy1aY1euTE7J72hVMWvQE= X-Received: by 2002:a53:df83:0:b0:66d:11b0:ac59 with SMTP id 956f58d0204a3-66d11b0aef7mr641221d50.12.1787590643998; Mon, 24 Aug 2026 09:57:23 -0700 (PDT) Received: from [10.200.24.109] ([12.55.13.134]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-66cf4665056sm4137612d50.8.2026.08.24.09.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 09:57:23 -0700 (PDT) From: Anirudh Srinivasan Date: Mon, 24 Aug 2026 11:57:07 -0500 Subject: [PATCH 2/2] PCI: quirks: Drop unassignable 32 GiB BAR 4 on Tenstorrent Blackhole Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260824-blackhole_quirk-v1-2-fc004672cdbd@oss.tenstorrent.com> References: <20260824-blackhole_quirk-v1-0-fc004672cdbd@oss.tenstorrent.com> In-Reply-To: <20260824-blackhole_quirk-v1-0-fc004672cdbd@oss.tenstorrent.com> To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, joelsmith@tenstorrent.com, Anirudh Srinivasan X-Mailer: b4 0.15.1 Tenstorrent Blackhole cards expose a 32 GiB BAR 4 that is unused by most software talking to the card. This BAR cannot be assigned on hosts whose PCI aperture is smaller than 32 GiB (e.g some ARM/RISC-V systems). This failure also results in BAR 0 (256 MiB) and 2 (2 MiB) being unassigned because bridge windows are sized as the sum of all enabled child BARs. This makes the card completely unusable on such systems. spacemit-k1-pcie 80000000.pcie: PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [bus 00-ff] pci_bus 0000:00: root bus resource [io 0x100000-0x1fffff] (bus address= [0x10000-0x10ffff]) pci_bus 0000:00: root bus resource [mem 0x1100110000-0x117fffffff] (bus= address [0x00110000-0x7fffffff]) pci_bus 0000:00: root bus resource [mem 0x1800000000-0x18ffffffff pref] pci 0000:01:00.0: [1e52:b140] type 00 class 0x120000 PCIe Endpoint pci 0000:01:00.0: BAR 0 [mem 0x00000000-0x1fffffff 64bit pref] pci 0000:01:00.0: BAR 2 [mem 0x1120000000-0x11200fffff 64bit pref] pci 0000:01:00.0: BAR 4 [mem 0xfffffff800000000-0xffffffffffffffff 64bi= t pref] pci 0000:00:00.0: bridge window [mem size 0x820100000 64bit pref]: can'= t assign; no space pci 0000:00:00.0: bridge window [mem size 0x820100000 64bit pref]: fail= ed to assign pci 0000:00:00.0: BAR 0 [mem 0x1108000000-0x110fffffff]: assigned pci 0000:00:00.0: BAR 1 [mem 0x1110000000-0x1117ffffff]: assigned pci 0000:00:00.0: BAR 0 [mem 0x1108000000-0x110fffffff]: releasing pci 0000:00:00.0: BAR 1 [mem 0x1110000000-0x1117ffffff]: releasing pci 0000:00:00.0: bridge window [mem size 0x820100000 64bit pref]: can'= t assign; no space pci 0000:00:00.0: bridge window [mem size 0x820100000 64bit pref]: fail= ed to assign pci 0000:00:00.0: BAR 0 [mem 0x1108000000-0x110fffffff]: assigned pci 0000:00:00.0: BAR 1 [mem 0x1110000000-0x1117ffffff]: assigned pci 0000:01:00.0: BAR 4 [mem size 0x800000000 64bit pref]: can't assign= ; no space pci 0000:01:00.0: BAR 4 [mem size 0x800000000 64bit pref]: failed to as= sign pci 0000:01:00.0: BAR 0 [mem size 0x20000000 64bit pref]: can't assign;= no space pci 0000:01:00.0: BAR 0 [mem size 0x20000000 64bit pref]: failed to ass= ign pci 0000:01:00.0: BAR 2 [mem size 0x00100000 64bit pref]: can't assign;= no space pci 0000:01:00.0: BAR 2 [mem size 0x00100000 64bit pref]: failed to ass= ign pci 0000:01:00.0: BAR 4 [mem size 0x800000000 64bit pref]: can't assign= ; no space pci 0000:01:00.0: BAR 4 [mem size 0x800000000 64bit pref]: failed to as= sign pci 0000:01:00.0: BAR 0 [mem size 0x20000000 64bit pref]: can't assign;= no space pci 0000:01:00.0: BAR 0 [mem size 0x20000000 64bit pref]: failed to ass= ign pci 0000:01:00.0: BAR 2 [mem size 0x00100000 64bit pref]: can't assign;= no space pci 0000:01:00.0: BAR 2 [mem size 0x00100000 64bit pref]: failed to ass= ign Add a header fixup that walks the root-bus apertures and drops BAR 4 when it is larger than every root-bus aperture. Resource assignment skips resources with zero flags (pdev_resource_assignable()), so the bridge window then sizes to BARs 0/2 and succeeds. This was tested on a Spacemit-K3 RISC-V board that has only 4GiB of BAR space. tt-smi and tt-bh-linux are able to run on the card. Signed-off-by: Anirudh Srinivasan --- drivers/pci/quirks.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index b09f27f7846fc..df54e379c116b 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -6415,3 +6415,35 @@ static void pci_mask_replay_timer_timeout(struct pci= _dev *pdev) DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_t= imeout); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_t= imeout); #endif + +/* + * Drop unused 32 GiB BAR 4 on Tenstorrent Blackhole cards so the card is + * usable on systems with smaller host bridge apertures. + */ +static void quirk_tenstorrent_blackhole_bar4(struct pci_dev *pdev) +{ + struct resource *res =3D &pdev->resource[4]; + struct pci_bus *bus =3D pdev->bus; + struct resource *win; + + if (!(res->flags & IORESOURCE_MEM)) + return; + + /* Find the root bus; its resource list holds the host apertures */ + while (bus->parent) + bus =3D bus->parent; + + pci_bus_for_each_resource(bus, win) { + if (!win || !(win->flags & IORESOURCE_MEM)) + continue; + if (resource_size(res) <=3D resource_size(win)) + return; + } + + pci_info(pdev, "BAR 4 %pR larger than every host bridge aperture, droppin= g it\n", + res); + res->start =3D 0; + res->end =3D 0; + res->flags =3D 0; +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TENSTORRENT, 0xb140, quirk_tenstorr= ent_blackhole_bar4); --=20 2.43.0