From nobody Mon Jan 5 20:09:23 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dlQPH2DlBz6N09X for ; Mon, 05 Jan 2026 20:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dlQPH1SDnz3QnK for ; Mon, 05 Jan 2026 20:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767643763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jqyk7sLopEVMVCBSVpvxIKsit2ak0+yX6FOiBeRv8qs=; b=PjBgurMBkdTjBuEozd27aO2BG+3NiBwEoSCf0N+l++VpNOgfAdOhCsNMZuouxJMmrmDF07 k6Tu8mZik/qC6E4pONABn6MOyokDjQYZCBgkejl6yy4Lh8Lkg4O57udOvB4e68yIVxUFpP W1egV9vAEKK/x3rlOlOtfw1uXY7vbJkq67lgMx1l4ZkLU5aWPtIwnEtx2ZO9CNJIrw5Nz0 okB8ZtskqCZ3YK2Z2+t32aR0BLjARXT7NrOhlHVT1VBiTVKbNUn/9uNyed11Iqd3WUOO9D AqWaJUFQnVe2IzCCh9IkKBj+K9COSdtrj4h1t18T+fKQHDnOkPx7yG3NWnYATg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767643763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jqyk7sLopEVMVCBSVpvxIKsit2ak0+yX6FOiBeRv8qs=; b=wSpyn9gudcnBNvU1lfakYfrORJr8M67Z1hDeUX8iiKBq4VgNsGyeyzqcLaQad6x7xGx2du 4mevXDRmzAsK2ZCeMyR2c5uEic462oqHszThBSxSQ25ikEM1Rgp5z+qQuzgrVDKDQE+q3f xhwut/FhZO8pq45rnCs3dzYhAtkZNN2aGly0L4MUjrp97Xpx9H6eC4gKDHtSTuogbQvob/ uPW2ZB9sKHJvNNDbcxnxfKG3QZ0v2D0e3NsP4DE9HII8XnCS4HWMVwtXx3rnPlp2nZyNum wMVeOaQ7C0kxhv1KZ4351rns0tdHQNpKS8Gjuq4zE84AqesJ9jW9Mcpf4Ikzrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767643763; a=rsa-sha256; cv=none; b=UP2bpkiLp3Z/x6SJiJyRYSP5YppqDtYbcT+42e0u1m0y155aNunbXi22tURCeEd+uI6ffp OKC+T/bCBi9TFLqMvelFGiMIHX3+O3gbSmA0qo/gxuM7NmqkzOiLENb6PztHdVbWVvW3Xk /Nok840w32tmL0+qC7FbrC5wNVFtnLDrNs0DqPQuFxZ+Idka1Z/ok6GDa70CqLaVVEVLeK ED/93mFtFWh6H7rVGZNQlXV9dmgKoLLwZFcohqJPz4vUvFFFZX8kGd1f1/Fg++4NDbhYcI qHwXSpNXd+K4Z1pYlVvunC5HzqhDXJ+VGKRanaYYFQv96C7yar3PooHIVQ4MhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dlQPH11Nbzbc7 for ; Mon, 05 Jan 2026 20:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8c81 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 05 Jan 2026 20:09:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: ace666bd21a2 - main - linuxkpi: Define `PCI_POSSIBLE_ERROR()` macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ace666bd21a204c62807f2c899402a7dc9ab161a Auto-Submitted: auto-generated Date: Mon, 05 Jan 2026 20:09:23 +0000 Message-Id: <695c1a73.8c81.4f69096c@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=ace666bd21a204c62807f2c899402a7dc9ab161a commit ace666bd21a204c62807f2c899402a7dc9ab161a Author: Jean-Sébastien Pédron AuthorDate: 2025-08-09 16:14:05 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-01-05 19:32:44 +0000 linuxkpi: Define `PCI_POSSIBLE_ERROR()` macro It comes with `PCI_ERROR_RESPONSE` and `PCI_SET_ERROR_RESPONSE()` but we don't use them so far. Therefore `PCI_POSSIBLE_ERROR()` will always reture false. As written in the comment, this macro is a bit weird given the Linux `pci_read_*() functions can return an error code separately from the read value. The `PCI_POSSIBLE_ERROR()` macro started to be used by the amdgpu DRM driver in Linux 6.10. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54487 --- sys/compat/linuxkpi/common/include/linux/pci.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 06336bf963d6..8fe09554aed2 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -253,6 +253,20 @@ extern const char *pci_power_names[6]; #define PCI_IRQ_LEGACY PCI_IRQ_INTX #endif +/* + * Linux PCI code uses `PCI_SET_ERROR_RESPONSE()` to indicate to the caller of + * a `pci_read_*()` function that the read failed. An example of failure is + * whether the device was disconnected. It is a bit weird because Linux + * `pci_read_*()` can return an error value, as the read value is stored in a + * integer passed by pointer. + * + * We don't set PCI_ERROR_RESPONSE anywhere as of this commit, but the DRM + * drivers started to use `PCI_POSSIBLE_ERROR()`. + */ +#define PCI_ERROR_RESPONSE (~0ULL) +#define PCI_SET_ERROR_RESPONSE(val) (*(val) = ((typeof(*(val))) PCI_ERROR_RESPONSE)) +#define PCI_POSSIBLE_ERROR(val) ((val) == ((typeof(val)) PCI_ERROR_RESPONSE)) + struct pci_dev; struct pci_driver {