{"id":2229927,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229927/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260428223147.3092087-1-gloveless@jqluv.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.1/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260428223147.3092087-1-gloveless@jqluv.com>","date":"2026-04-28T22:31:47","name":"PCI: mark Thunderbolt-attached devices as removable","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"ede05be56750162a537acbcb3c733f3b334e81b5","submitter":{"id":93094,"url":"http://patchwork.ozlabs.org/api/1.1/people/93094/?format=json","name":"Geramy Loveless","email":"gloveless@jqluv.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260428223147.3092087-1-gloveless@jqluv.com/mbox/","series":[{"id":501942,"url":"http://patchwork.ozlabs.org/api/1.1/series/501942/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=501942","date":"2026-04-28T22:31:47","name":"PCI: mark Thunderbolt-attached devices as removable","version":1,"mbox":"http://patchwork.ozlabs.org/series/501942/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229927/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229927/checks/","tags":{},"headers":{"Return-Path":"\n <linux-pci+bounces-53359-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=jqluv-com.20251104.gappssmtp.com\n header.i=@jqluv-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=h+j/IdFu;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-53359-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=jqluv-com.20251104.gappssmtp.com\n header.i=@jqluv-com.20251104.gappssmtp.com header.b=\"h+j/IdFu\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.175","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=jqluv.com","smtp.subspace.kernel.org;\n spf=none smtp.mailfrom=jqluv.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4wFm6M0bz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 08:33:48 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 599DF30BA918\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 22:32:00 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id B8EDD37B030;\n\tTue, 28 Apr 2026 22:31:59 +0000 (UTC)","from mail-pf1-f175.google.com (mail-pf1-f175.google.com\n [209.85.210.175])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E35F3822AC\n\tfor <linux-pci@vger.kernel.org>; Tue, 28 Apr 2026 22:31:57 +0000 (UTC)","by mail-pf1-f175.google.com with SMTP id\n d2e1a72fcca58-82f9fdfc965so4860883b3a.1\n        for <linux-pci@vger.kernel.org>; Tue, 28 Apr 2026 15:31:57 -0700 (PDT)","from geramyl-MS-S1-MAX.. ([2601:201:8080:e5c0:4857:38db:7c94:21e1])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-834ed5a1026sm110276b3a.4.2026.04.28.15.31.55\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 28 Apr 2026 15:31:56 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777415519; cv=none;\n b=Ct3I5befoA3RljrCpt9S9b+FbAGfmJOZkdxIq+zgdxvhh8xuYsylfK+SWSCACWo2Tuhm8dv9hyaHfDoT56p/n1eQc/+Z/7ZKev1s/YQ4JOP8I2Wx0pK6EoyGpKpBulDJ04PqYENK7rB77rf+dlk+0a+Ro4DwuKzkAi5ms38rieA=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777415519; c=relaxed/simple;\n\tbh=1TILo7Kc7IXkpW2prs6AGO5QGWX2eoulzDvpaF+l4tc=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=WyJndv9II2NPVXjMYtP+94RVKjTL9GsgNXglnep2SGDAze+2okP7P+LO8vHrm8AcUKrAS/o1+vDQKrgQ2kMdgI/pd5vwqJtdLE/mYDb6bPKxUg29tlzyUFE8K/sHo8f9Pr7+CYSxANXFEfeYNesQtAPcsQBSq0l7GyyU+8LNQn8=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=jqluv.com;\n spf=none smtp.mailfrom=jqluv.com;\n dkim=pass (2048-bit key) header.d=jqluv-com.20251104.gappssmtp.com\n header.i=@jqluv-com.20251104.gappssmtp.com header.b=h+j/IdFu;\n arc=none smtp.client-ip=209.85.210.175","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=jqluv-com.20251104.gappssmtp.com; s=20251104; t=1777415517;\n x=1778020317; darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=hRQFtmX2KARB7XLU3bk156bMegoBkNu0rj20CmJIQFY=;\n        b=h+j/IdFuNiUIQ66rVOdDJf1wpQqNWDq6nfzL3u8Sp/m7WjiFzmGFdBf+vBHWL6Liya\n         zJtiegyaKNYbc3MN8/xg+cTWNe6Wna6obQRP9VSxiGypi/7lbGix1QrUjojIQt+2a7xk\n         nthCL1zYnOw255qMeD2HVqWXvghnG0I8YyuAL/fYIly+3xwQXne5NbtpQ0xbDFqdIOD6\n         TsSURY/aI09KgglbctG53ZuyR1Jr5vNfpuaVpuqKHHNNFBaZZo+vRhw25X9vxH5p4ZuK\n         J6PDd/BUz1P3v6whPZ3ibfFu+Dw0H2gqsrlvvom5ZLM9qOsTJS8cKOLm5SW/ZEDJRQWF\n         dQhg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777415517; x=1778020317;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=hRQFtmX2KARB7XLU3bk156bMegoBkNu0rj20CmJIQFY=;\n        b=fJs0rua477hnFf5QqbM4iI5REBBPqL/B8Pu9hbA12e18p9kXXiO/VU2u0SKh+4HkeX\n         /IL39RYAkQvCREOh32nn5HaFPO+/bMOdWZ7FniXVQSdPH1e2FfAGY9cPyER50pwNA8eA\n         Oe7nhwM8z6CNNt2Fv+uOUzDmxRUlJBfwbnpRFZ2eC9EBlniOQ92IhqigqOfpU/CPD30R\n         jSMYLDiN+Yowzjo+RrvAAcQI/mdcRStw3+CGAyp46HpDHrDpr8G/bToGT6F8f+ElmzyG\n         B9FL3AUDUEkkVDzJj+yymzCrS1Rb3lDEX3ERvAyFmPxLI+hHUDkOdWmpQ/Rx3/YFbst5\n         5HeQ==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/I/F8cszuE1MKACFwTmHtXeN+iRKvedJFWCH3QcwGZsTzH9V2ge2Z9btwPr1Sq/nQ9eBor5p9vF4c=@vger.kernel.org","X-Gm-Message-State":"AOJu0YwE6eq/PqdGBynScUVFvlYwTVUodvLsTy54beutbpJfjOxTjp4V\n\t35BCOLkKoyMTA8ZuiGVzERfXTKZLpmokko09q0MbLtsFXiidzkyFgvFFsbTMY117sWg=","X-Gm-Gg":"AeBDiet4c/JktpFEkGCO7XDLafPSHc4mD5VPihYJ9GQ0ZkCkPyXjdGER/2Lzs5bdB59\n\tYy/Ds+NzUmt7xbFDg1DVS/fteoyFKe4hNDBLBJIpn/ZQoYww5Ps4JXEvwQ3/u4klob9AOZ+KpvK\n\tVGgfQFiAxbbZJh0KMOaH3SqKuXFrgXd/3y9tGNml3QdwsxIqxSBmimD59cW0aY/3PtRUoam6HB/\n\tFsG1r2dn1L3tFCI+ZWU0UWtgrgDV3PBc/u6qyQJ4KioYhY+Y4npF++Kbcvj9JXQjw88iie3V9Lf\n\tkG+Lck/eOmmf0lnx44qKrkHzg2F6EpVLAZPM7DQ1ci6EExkvR4ytp22e5yGp86UZ18mqokrXKcM\n\tHiFhkIMfiheOzh09ezinUmMnmYAuAUdB5+we+jD5uWImI2F7mgeQecZue7g/2vZw5LqRdau43/2\n\tvTqaK2rASb56kueSi5ONxzF68h0kjHW4i+qmhONaAbZvKv2gU=","X-Received":"by 2002:a05:6a00:f9a:b0:82c:2155:5b6d with SMTP id\n d2e1a72fcca58-834ddabdb7dmr5235533b3a.12.1777415516668;\n        Tue, 28 Apr 2026 15:31:56 -0700 (PDT)","From":"Geramy Loveless <gloveless@jqluv.com>","To":"bhelgaas@google.com","Cc":"mario.limonciello@amd.com,\n\tilpo.jarvinen@linux.intel.com,\n\tchristian.koenig@amd.com,\n\tcristi@ieee.org,\n\tlinux-pci@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tGeramy Loveless <gloveless@jqluv.com>","Subject":"[PATCH] PCI: mark Thunderbolt-attached devices as removable","Date":"Tue, 28 Apr 2026 15:31:47 -0700","Message-ID":"<20260428223147.3092087-1-gloveless@jqluv.com>","X-Mailer":"git-send-email 2.43.0","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"pci_set_removable() only marks devices as removable if their upstream\nbridge has the ACPI ExternalFacingPort property set.  Some firmware\n(e.g. MSI MS-S1 MAX with AMD Strix Halo) does not set this property on\nThunderbolt root ports, so devices behind them are never marked\nremovable.  This causes all drivers that use dev_is_removable() to miss\neGPU-specific code paths.\n\nFall back to pci_is_thunderbolt_attached() when the parent is not\nalready marked removable.  set_pcie_thunderbolt() runs before\npci_set_removable() during device add, so the is_thunderbolt flag is\nalready available.\n\nThis fixes the problem at the PCI core level so all drivers benefit\nfrom correct removable detection, not just individual drivers that add\ntheir own Thunderbolt checks.\n\nSigned-off-by: Geramy Loveless <gloveless@jqluv.com>\n---\n drivers/pci/probe.c | 22 ++++++++++++++--------\n 1 file changed, 14 insertions(+), 8 deletions(-)","diff":"diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c\nindex bccc7a4bdd7..2387edc5b89 100644\n--- a/drivers/pci/probe.c\n+++ b/drivers/pci/probe.c\n@@ -1761,17 +1761,23 @@ static void pci_set_removable(struct pci_dev *dev)\n \tif (!parent)\n \t\treturn;\n \t/*\n-\t * We (only) consider everything tunneled below an external_facing\n-\t * device to be removable by the user. We're mainly concerned with\n-\t * consumer platforms with user accessible thunderbolt ports that are\n-\t * vulnerable to DMA attacks, and we expect those ports to be marked by\n-\t * the firmware as external_facing. Devices in traditional hotplug\n-\t * slots can technically be removed, but the expectation is that unless\n-\t * the port is marked with external_facing, such devices are less\n+\t * We consider everything tunneled below an external_facing device to\n+\t * be removable by the user. We're mainly concerned with consumer\n+\t * platforms with user accessible thunderbolt ports that are vulnerable\n+\t * to DMA attacks, and we expect those ports to be marked by the\n+\t * firmware as external_facing. Devices in traditional hotplug slots\n+\t * can technically be removed, but the expectation is that unless the\n+\t * port is marked with external_facing, such devices are less\n \t * accessible to user / may not be removed by end user, and thus not\n \t * exposed as \"removable\" to userspace.\n+\t *\n+\t * Some firmware does not set the ExternalFacingPort property on\n+\t * Thunderbolt root ports.  In that case, fall back to checking\n+\t * whether the device sits below a Thunderbolt controller, which\n+\t * is itself inherently user-removable.\n \t */\n-\tif (dev_is_removable(&parent->dev)) {\n+\tif (dev_is_removable(&parent->dev) ||\n+\t    pci_is_thunderbolt_attached(dev)) {\n \t\tdev_set_removable(&dev->dev, DEVICE_REMOVABLE);\n \t\treturn;\n \t}\n","prefixes":[]}