From nobody Thu Feb 16 11:55:53 2023 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 4PHYLK3rpGz3q5hm; Thu, 16 Feb 2023 11:55:53 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHYLK3225z499Q; Thu, 16 Feb 2023 11:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548553; 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=Kv0X98tyug00zTdLfFLRWGhRH1RxumPj/Ks060C0hkQ=; b=dR3NrQOQrblxr6Eb6NyBu9tE5EHYlVy+eGeGuxAoOPT39LRPWmxdtkn12InfNtLPnjpvsa +s9zWM872OTJzT7jUj38Lhzzp5zTcIgiQnFQB4nc3DGKcGakGgcZAAhLqdxWYPrVVaSnzK Uac7He7OKHXF7Hizupma0NUOQKP+GITUIpBUYd4VCW0EdpYtxgKAYUM+QasEII7LSRbBoV CmMoAdRokqw2aRQYj95dVqD7aNdvYrTxEI9tdsF+ZkXgxZjKo8HAVNU+2uH2DZaZgMbQGX 4C8X3f7oujKRbfzD+HHUsjY+A/zFZ06UeRncOrWw3E2gAdZNV7bHMPtFXzIpow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548553; 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=Kv0X98tyug00zTdLfFLRWGhRH1RxumPj/Ks060C0hkQ=; b=uinaUhFDgJtnxRH1Epmev4hnxSXjHkHVis0vuz8lwiRvcP87iTq5EIB9OeToEGOPQe+ZXr JxvNJtUB+1ARIPm3t4ycZfEpHQ6BvYrGDHsU7QhTJv+v+9ij9b+xeoWdy3/gxL3LIglw4y wYRK9dAR62SclkAB5LaTGdnXVLEzY1ACDJRbn/4AKvPLhUSQ0XSsFdqEIlTvojCjHVBeNU KlNxOZxkHWVu2omJ+G6AxgE1vU8VN0EQNC6BJ0gL26flV03MNoT9v4SPi/J0kS8UBkDGDU 51fpV5Mho9HHlKTWLGDhphwz4R1+FeqPrdKSrvCsh4SpJJnCgRZ1Y4zeRYfUYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676548553; a=rsa-sha256; cv=none; b=dqnsCDIDmjrBpI8DT3ctNzPzh+0RA7C4pVRVZx644QKTZgQ9PZv9aEzKOia4taZg7ZLeWn oal2KTJ8HSDa/j+ItfviGyhXi65a3I+ap1ZtnLt99bV8y+f7lz1GZdHtwJlS0pW+2CzuWB gVefv/99ioMGxkBWfIDcobw7dX9tb+4R/AjrRnVbNKIQ67TEKqgi3g07rRejPrSdStUstU ozlP0aL4RS2brEICv+43BC8zilxFhLXvERcHvYkW/6ytdMZrmOxa3QGmepVlL1cfbBCTL7 yYdMRu3FRX9Mf+VWS2DMeiJy5v8wVnrmb00wxEyAigNQ4fnxJ3ukJHpFBYggxQ== 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 4PHYLK1qqFz12W4; Thu, 16 Feb 2023 11:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31GBtrXw055248; Thu, 16 Feb 2023 11:55:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GBtrcU055247; Thu, 16 Feb 2023 11:55:53 GMT (envelope-from git) Date: Thu, 16 Feb 2023 11:55:53 GMT Message-Id: <202302161155.31GBtrcU055247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 2f0b0161cee5 - stable/13 - linuxkpi: Add `pci_device_is_present()` 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2f0b0161cee5f767c82e16f164a1bad5881d428b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2f0b0161cee5f767c82e16f164a1bad5881d428b commit 2f0b0161cee5f767c82e16f164a1bad5881d428b Author: Jean-Sébastien Pédron AuthorDate: 2023-01-19 17:46:37 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-16 11:55:13 +0000 linuxkpi: Add `pci_device_is_present()` This calls bus_child_present(9) internally. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38148 (cherry picked from commit 49b6d5ed142d6c59b7a517ff5660165d8647bd01) --- sys/compat/linuxkpi/common/include/linux/pci.h | 9 +++++++++ sys/compat/linuxkpi/common/src/linux_pci.c | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 8d41e33b0da8..ad7589e692f2 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -1664,4 +1664,13 @@ pci_is_enabled(struct pci_dev *pdev) PCIM_CMD_BUSMASTEREN) != 0); } +static inline int +pci_wait_for_pending_transaction(struct pci_dev *pdev) +{ + + return (0); +} + +bool pci_device_is_present(struct pci_dev *pdev); + #endif /* _LINUXKPI_LINUX_PCI_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 54780adfda14..e4f85b906563 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -962,6 +962,16 @@ out: return (-EINVAL); } +bool +pci_device_is_present(struct pci_dev *pdev) +{ + device_t dev; + + dev = pdev->dev.bsddev; + + return (bus_child_present(dev)); +} + CTASSERT(sizeof(dma_addr_t) <= sizeof(uint64_t)); struct linux_dma_obj {