lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ECE29E32-7925-44C3-BAAA-B16003E9E997@oracle.com>
Date: Wed, 21 Jan 2026 19:13:48 +0000
From: Haakon Bugge <haakon.bugge@...cle.com>
To: Lukas Wunner <lukas@...ner.de>
CC: Bjorn Helgaas <bhelgaas@...gle.com>,
        Johannes Thumshirn
	<morbidrsa@...il.com>,
        "linux-pci@...r.kernel.org"
	<linux-pci@...r.kernel.org>,
        "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>,
        "linux-acpi@...r.kernel.org"
	<linux-acpi@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] PCI: Initialize RCB from pci_configure_device

> On Wed, Jan 21, 2026 at 12:35:40PM +0100, Håkon Bugge wrote:
> +	if (pcie_cap_has_lnkctl(dev) &&
> +	    (pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) &&
> +	    !dev->is_virtfn && pcie_root_rcb_set(dev)) {
> +		u16 lnkctl;
> +
> +		pcie_capability_read_word(dev, PCI_EXP_LNKCTL, &lnkctl);
> +		if (lnkctl & PCI_EXP_LNKCTL_RCB)
> +			return;
> +
> +		pcie_capability_write_word(dev, PCI_EXP_LNKCTL, lnkctl | PCI_EXP_LNKCTL_RCB);
> 
> You may want to use pcie_capability_set_word() for brevity.

Well, that would incur an additional pcie_capability_read_word(), so between brevity and performance, I chose performance. Another, probably better reason to use pcie_capability_set_word() is that it calls (for PCI_EXP_LNKCTL) pcie_capability_clear_and_set_word_locked(). However, I assume that during device probing, the locking is not needed.


Thxs, Håkon

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ