{"id":2226529,"url":"http://patchwork.ozlabs.org/api/patches/2226529/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260422125753.29574-1-maximilian.brune@9elements.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260422125753.29574-1-maximilian.brune@9elements.com>","list_archive_url":null,"date":"2026-04-22T12:57:53","name":"[v3] pci: correct PCI device enumeration to include all functions on device 0","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"238bd776ae51242ded291fa4067d54151ab419f4","submitter":{"id":93175,"url":"http://patchwork.ozlabs.org/api/people/93175/?format=json","name":"Maximilian Brune","email":"maximilian.brune@9elements.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260422125753.29574-1-maximilian.brune@9elements.com/mbox/","series":[{"id":501024,"url":"http://patchwork.ozlabs.org/api/series/501024/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=501024","date":"2026-04-22T12:57:53","name":"[v3] pci: correct PCI device enumeration to include all functions on device 0","version":3,"mbox":"http://patchwork.ozlabs.org/series/501024/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226529/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226529/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=9elements.com header.i=@9elements.com header.a=rsa-sha256\n header.s=google header.b=csJv7HEf;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=9elements.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n secure) header.d=9elements.com header.i=@9elements.com header.b=\"csJv7HEf\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=9elements.com","phobos.denx.de;\n spf=pass smtp.mailfrom=maximilian.brune@9elements.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4g127t6sNbz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 00:45:14 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 91A388435B;\n\tWed, 22 Apr 2026 16:45:06 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 8C8F984178; Wed, 22 Apr 2026 14:58:05 +0200 (CEST)","from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n [IPv6:2a00:1450:4864:20::331])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 636E883936\n for <u-boot@lists.denx.de>; Wed, 22 Apr 2026 14:58:01 +0200 (CEST)","by mail-wm1-x331.google.com with SMTP id\n 5b1f17b1804b1-4891b0786beso30492775e9.1\n for <u-boot@lists.denx.de>; Wed, 22 Apr 2026 05:58:01 -0700 (PDT)","from mmax.sec.9e.network\n (p200300ed8f1a0a004662703f880fa970.dip0.t-ipconnect.de.\n [2003:ed:8f1a:a00:4662:703f:880f:a970])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488fb7a06f3sm162384965e9.22.2026.04.22.05.57.59\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 22 Apr 2026 05:57:59 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=9elements.com; s=google; t=1776862680; x=1777467480; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=e60BwJUwSBTPYoSPSX9L56xzzvHvHc09J9JBeYSXNtg=;\n b=csJv7HEfiMzU0Ce9ygq3zpSOH/tRev+OzPvFCzbi4OOzwFUdy7/YdTg/8Jg+rkYJmS\n 95VEgXtuuu0QZp0s1xE0zejpcPK0MItJee3heLtpWhJtGUkBT2XAkHuS21JCmOfHYWwk\n Yphh8k+TTTKm5WnKyLd3w7WmHeJTsj/y6hGxCgCe6o80YuQAX8fanoU/l8JR5tsF3pL1\n kDV6vqiLtJRHq66rb6tF1EjgYDL6SQEOUPJ6ZwPw96JoKVLiWW1LwI605BYUj8GCuvh4\n lI3Pmq0YEm6i1v68s9ZKelZtxxmMTHYRtRqa/FvklfEPdaDUBqyfcxdLZuCwtFW0z/lj\n rfbw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776862680; x=1777467480;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=e60BwJUwSBTPYoSPSX9L56xzzvHvHc09J9JBeYSXNtg=;\n b=hLUW1zOfApIbnWbbhzE0dRj8jUma1hUjiHKOlSjFgsw7AlhRGKY0kGdKaOlzCR/Kas\n kkiwOzqVE8CfU7CW5yCr3Oz53z7WRJiqF7XoeOVkL94EQlghF0bMi3vn8waca+L2Kqgh\n bHD45yG41ZCoc48NVNE0Xp4tVU9EOvxJayUcrMhyb70uf14bKTJmQUjcNrRemxZuL1UF\n 4mEEpQu2nt+FSe+iC+u8GLSzYVN/C0q/bQCOvAxQ51t2MUE3T0XLE9vnnW79iiS7eVnb\n Jro8QFkrLK4SZpBtlC97MMLu7GIvKnCcLTBFWrxqduNj1w5J1yMHkDXbuuCDK6bbxjch\n BqjA==","X-Gm-Message-State":"AOJu0Yx8AkryQYl2O88M9OKm+g3OlNpAwkfxmu7ebmiNFuJrmiYWV1w0\n Aynn7Bm27ST7am4T8NZHsSSSDRGL/0qVZd+6Bjww3zAEOYmqMvup/UranlWnO1MNvX4g7DicsES\n ZYwGm0fncpg==","X-Gm-Gg":"AeBDietO70KdbqXGtU11w+0DqOYt7ZUoApBJf7SsUFXR1C/BX4kQCqeNC4cxNhpc5hY\n nU52sCavmf85KdBr8HPI+TvqRRzWWpIezymc67qQsjhjI2FGIilxMRQb/evr5rvijicELlQns66\n gG72n0D72jOhdDQFTWWQq16hFi6tVYiSLIWPOshKJQtg+QJFBmRiT/hR0e3O/vTrDuThjHmoV0E\n I4ptfSMEcSs+a/GKDLVqEiemGvVcZ/0nUd8cS8rn0KUrY7YV3gdavBmpIA0GsDOLh6FJYiM5rn8\n zollvdqyTP4t7SQHc4Xz/aKoiPVl3nB6necy3559R0t/KCRGEEHTYPhbkgLqoeUl+wtGyR6AiQp\n 65TzKrrAHIcIqgWUkVowHmHvlP6Y2yAb2RevoiqRD6C/rz1bPUgB7sUco0FCMAa3dXBwyhTZ5dd\n DOFkvDOEsOzWjukZMpr7KDTvzy7BV6a9S2ucxHwPu8v4pc63C7NNuxOn5Oio3AR9KN4PAGyb5fm\n g1oSUwu3uIjabpEYWxa+bp0wLfqOtJ6EFG9IQCQOv/y+P43WdzzwxsyO28i","X-Received":"by 2002:a05:600c:37c4:b0:48a:5501:7995 with SMTP id\n 5b1f17b1804b1-48a55017b71mr113152995e9.18.1776862680522;\n Wed, 22 Apr 2026 05:58:00 -0700 (PDT)","From":"Maximilian Brune <maximilian.brune@9elements.com>","To":"u-boot@lists.denx.de","Cc":"trini@konsulko.com, andrew.goodbody@linaro.org,\n george.mccollister@konsulko.com,\n Maximilian Brune <maximilian.brune@9elements.com>,\n Simon Glass <sjg@chromium.org>","Subject":"[PATCH v3] pci: correct PCI device enumeration to include all\n functions on device 0","Date":"Wed, 22 Apr 2026 14:57:53 +0200","Message-ID":"<20260422125753.29574-1-maximilian.brune@9elements.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260416161305.24118-1-maximilian.brune@9elements.com>","References":"<20260416161305.24118-1-maximilian.brune@9elements.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Wed, 22 Apr 2026 16:44:59 +0200","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Currently the implementation does not just skip all devices beside\ndevice 0, it also skips all functions (besides 0) on device 0. This\nbroke basically all AMD platforms, since they have a lot of internal SOC\ndevices behind these functions.\n\nThis was detected, because the XHCI controller and therefore the USB\ndevices were not found by u-boot on AMD/crater platform.\n\nPCI_MASK_BUS() returns both device and function bits, so it skips any\nbdf where either device > 0 or function > 0. Using PCI_DEV() extracts\nonly the device number, matching the intent in only_one_child().\nIt therefore now checks all functions on device 0 (Linux does the same).\n\nI build tested u-boot as coreboot payload and run it on a recent x86 AMD\nplatform. Devices like the XHCI controller are now found again.\n\nFixes: fbde868ba4aa (\"pci: skip unnecessary PCIe scanning\")\nSigned-off-by: Maximilian Brune <maximilian.brune@9elements.com>\nReviewed-by: Simon Glass <sjg@chromium.org>\nCC: Tom Rini <trini@konsulko.com>\nCC: Andrew Goodbody <andrew.goodbody@linaro.org>\nCC: George McCollister <george.mccollister@konsulko.com>\nCC: Simon Glass <sjg@chromium.org>\n---\n drivers/pci/pci-uclass.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c\nindex 83b76d01f24..f58d542ef75 100644\n--- a/drivers/pci/pci-uclass.c\n+++ b/drivers/pci/pci-uclass.c\n@@ -927,7 +927,7 @@ int pci_bind_bus_devices(struct udevice *bus)\n \t\tif (PCI_FUNC(bdf) && !found_multi)\n \t\t\tcontinue;\n \n-\t\tif (only_one_child(bus) && (PCI_MASK_BUS(bdf) > 0))\n+\t\tif (only_one_child(bus) && (PCI_DEV(bdf) > 0))\n \t\t\tcontinue;\n \n \t\t/* Check only the first access, we don't expect problems */\n","prefixes":["v3"]}