From nobody Sun Oct 20 00:34:46 2024 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 4XWKFy5KmTz5ZW68; Sun, 20 Oct 2024 00:34:46 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XWKFy38z5z4Zc1; Sun, 20 Oct 2024 00:34:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729384486; 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=63/6Sl8PFYcrbVbWy6LxwuZ3aXHa+OAdPrWvFrw4GI4=; b=wptV1N7+d9zPOMJbeTOeuxkBjU4jnEgfTVjNI0xX8Bljls+9HvYn5T39kk6AqqUNX+Uyd4 V+zNSri4iJ3n6OrH1li+XIyYYvDAsxYx8tYmmlRTtvDm6tRG3jkCB07mCK9NgY9a3r+I1+ I7e3j7lxhKGZmbC05up6i7XxkZduTnAShoHdNez331WgyBQMKxFwJHi8v7MZRAwlbxkyPj 9HFZPX5XmfC24lVJ9OGTJ+JJ9SkU3wkKhpUZvOS/wOzqBr1v3oCt+bTTZORETKub6F0zb4 63gtqWGGFoNhVPGo1Kxm47Bvlb8gGre9kiFB6VKZ82qqi5/rzCqlW5r50jojuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729384486; 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=63/6Sl8PFYcrbVbWy6LxwuZ3aXHa+OAdPrWvFrw4GI4=; b=J4CK/XfUbfTPCKYUCLF0chxgGhYg+O8TsYnhpP7uyANVotL/ec8njEQemV5qvxoGJmSpWX 2roRD04YSY/ahe8sXb4XYEMjNzT+MLEu8vlHuoPTwrPJ5NPBC7bx3j86Ac4sIvQ0+Ppik0 vAkdN2FdIhReJzRT/1OD35K6+K4NiqnvaPv/XmEnn7/58uDIrsOdg/KCd8VgTXOygju1N3 ypVkx7z6TmeG5r8aCvYjzloIZR6vOF3+3VVs6DD8qpFO6hxi5Vd1laK7qDs3us6qyU7yYD 2YkHw30KdUm4aAtFaTEVZt8uonlCKUqhkxUX1krst6KNzlXbRGcnyDK2CUsvzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729384486; a=rsa-sha256; cv=none; b=bgUV90R0Wf/K/5JxuQeW/EX9nXnH2CAlkWDbZ4ki+bf3PSkQtbjLca/lmBTuMtEC5bVIWl b8Cmp/2j6K5bw7fOBo63MUVDronPO7BpL/IIrw3o0aNlJO+MkvSetViUBpJz03IYws8v2c yDqD6njuzQoT4neqs0hVwvSapZ6trTM1W2i8E6/tEaqQQKp4rZYWYpyAbA3Es8laxpfCAG MioDuMM3hlVfsQNlP0fuzEbzMoovUhprs2KaZwR3Mx0VhexRbKFJuM/JugSvERu6TbDbAy n+OU7xIvd9IudVmc6xuXOc2McEnZfLGN1B40ixKTEdIbWiDnkQycZ4BOuHGcUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XWKFy2lb2zgDD; Sun, 20 Oct 2024 00:34:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49K0Ykhd061344; Sun, 20 Oct 2024 00:34:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49K0YkeI061341; Sun, 20 Oct 2024 00:34:46 GMT (envelope-from git) Date: Sun, 20 Oct 2024 00:34:46 GMT Message-Id: <202410200034.49K0YkeI061341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c01a4b1fbc05 - stable/14 - iommu_get_requester(): do not panic if asked about non-pci device 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c01a4b1fbc05333b9faefb8d381b903e122a4cea Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c01a4b1fbc05333b9faefb8d381b903e122a4cea commit c01a4b1fbc05333b9faefb8d381b903e122a4cea Author: Konstantin Belousov AuthorDate: 2024-10-13 10:04:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-20 00:33:03 +0000 iommu_get_requester(): do not panic if asked about non-pci device (cherry picked from commit 7896b03fff4d9c2e9c35ecf1dce2e0d672467a5a) --- sys/dev/iommu/busdma_iommu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index f3b58306d6af..dbd4ee0ef0f1 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -127,6 +127,12 @@ iommu_get_requester(device_t dev, uint16_t *rid) pci_class = devclass_find("pci"); l = requester = dev; + pci = device_get_parent(dev); + if (pci == NULL || device_get_devclass(pci) != pci_class) { + *rid = 0; /* XXXKIB: Could be ACPI HID */ + return (requester); + } + *rid = pci_get_rid(dev); /*