From nobody Fri Jun 03 17:19:27 2022 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 6AA871BDA98C; Fri, 3 Jun 2022 17:19:29 +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 4LF8km3Hyvz4XYv; Fri, 3 Jun 2022 17:19:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654276768; 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=VV4jcYY//18aqc+tspKZa+2TMFN8A/DgfjkBLZh/DUU=; b=d3KWvCPjio+rrBy23qrgYZ23wKhbzuWxlMAWzetBn6cRGiP2kLK4psRRkQiOv/2K8I0pQ4 T+/DCdWqVNr4nZujbaTMuJ5vWbP1LX8hMPyBS7BaUZmVPQ0ZEc7R0cNmuSNA8VqHc1HFgP GB0RduEZFceld6isOrk7REHcFhEKrgRBPH8YcneK3bTKmJQS3NlF0ttkIGeTGIlqHuLD56 johpo+2ke5QoTpAMp511mqE85+BgBInGuE5Ahm8XIoLyF+I4sac7cc7yU+jc21jGjE86Gz /zC0Z1KiRR3hyd6w3nTENZxEnpn0OiSyaM/vqu0TYGK23JzaWQCsoWF4prIFCA== 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 1AA5852FA; Fri, 3 Jun 2022 17:19:28 +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 253HJRs9065777; Fri, 3 Jun 2022 17:19:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 253HJRgZ065776; Fri, 3 Jun 2022 17:19:27 GMT (envelope-from git) Date: Fri, 3 Jun 2022 17:19:27 GMT Message-Id: <202206031719.253HJRgZ065776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bdd0de1a902d - stable/13 - LinuxKPI: implement pcie_capability_set_word() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bdd0de1a902d4c5b0b1690e926fefa5ce0209cb9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654276768; 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=VV4jcYY//18aqc+tspKZa+2TMFN8A/DgfjkBLZh/DUU=; b=abfmQPkr7y3A4pFb6ZFCXO6kbkf+UFH8pgSqdU88pc3Y2VCxxVB1yU0anmkbOqtTIWArSK uW8WYuSbb3qb9kxnBfd9ql6uBlHA+Cjb3xeqVrt363lkZSBmIit6BulCvgydFGX9iypPe3 ppc49E2whl+UmUErO0aDdvgoKuHz63Quzlrb7DVxSf0LL5c7sY5UqehnhHqlBeVWILyv4S wjcYDog6HcvXom7VWrY/7OOKExym4GqueuhC4B9KV9nsS1XwY35cUeEBi2LhUOn7ca5N9B rjTqe13KRUsUwzgIf0v8GSyAbH2MH/kxMr817ANhUoDPH+Qc4SddPbiBrX+2VQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654276768; a=rsa-sha256; cv=none; b=KSXTol3OsBrmbrj/nJd2DVnXRprlggzy07g0T97xncIP2VaWGDhcxSyfIcal8uQQ9yi+GN qTQS/PAs9rH22njEgJzlOHTY7jfjqxqIkoNb5/OHsWSkhADsNkBQloqoGYJHcGHrNT/WT4 Y7lJM1GmVh+wZCj88zdqjMVO74wAOkzOuiP3AlAVpYWEBJhB6RfbyjNonWoP8cFZkP1cFu mYjECF6GsGr0svKutkqQZBVH4ilY2amcS+k+Uj6T4lgIlaaj72jNSwhaTSfDfJlh1HjgJx YyRS0h8JdJ14zRszW69ybRxdDwa1/EsLzhm+dLpEmtiXMZLOz3aMkdyKaYvfCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bdd0de1a902d4c5b0b1690e926fefa5ce0209cb9 commit bdd0de1a902d4c5b0b1690e926fefa5ce0209cb9 Author: Bjoern A. Zeeb AuthorDate: 2022-05-18 22:36:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-03 16:56:49 +0000 LinuxKPI: implement pcie_capability_set_word() Implement pcie_capability_set_word() using the already available read/write functions. Also define the completion timeout disable value to our PCI one. Both needed by a driver update. Sponsored by: The FreeBSD Foundation Reviewed by: manu, hselasky Differential Revision: https://reviews.freebsd.org/D35250 (cherry picked from commit 85eb99f9a47151f90565a1fb37395b8302c2978c) --- sys/compat/linuxkpi/common/include/linux/pci.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index efe0780190b7..95187a231e1f 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -131,6 +131,7 @@ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ #define PCI_EXP_DEVCAP2 PCIER_DEVICE_CAP2 /* Device Capabilities 2 */ #define PCI_EXP_DEVCTL2 PCIER_DEVICE_CTL2 /* Device Control 2 */ #define PCI_EXP_DEVCTL2_LTR_EN PCIEM_CTL2_LTR_ENABLE +#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS PCIEM_CTL2_COMP_TIMO_DISABLE #define PCI_EXP_LNKCAP2 PCIER_LINK_CAP2 /* Link Capabilities 2 */ #define PCI_EXP_LNKCTL2 PCIER_LINK_CTL2 /* Link Control 2 */ #define PCI_EXP_LNKSTA2 PCIER_LINK_STA2 /* Link Status 2 */ @@ -1165,6 +1166,22 @@ pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val) return pci_write_config_word(dev, pci_pcie_cap(dev) + pos, val); } +static inline int +pcie_capability_set_word(struct pci_dev *dev, int pos, uint16_t val) +{ + int error; + uint16_t v; + + error = pcie_capability_read_word(dev, pos, &v); + if (error != 0) + return (error); + + v |= val; + + error = pcie_capability_write_word(dev, pos, v); + return (error); +} + static inline int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed, enum pcie_link_width *width) {