<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/include/linux/pci.h, branch v7.2-rc1</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge branch 'pci/controller/dwc-imx6'</title>
<updated>2026-06-23T22:32:06+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2026-06-23T22:32:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=878f37d6dea3f08814a92d0456bd30e032b87e21'/>
<id>878f37d6dea3f08814a92d0456bd30e032b87e21</id>
<content type='text'>
- Move IMX6SX_GPR12_PCIE_TEST_POWERDOWN handling into the core reset
  functions (Richard Zhu)

- Add pci_host_common_parse_ports() for use by any native driver to parse
  Root Port properties (currently only reset GPIOs) (Sherry Sun)

- Assert PERST# before enabling regulators to ensure that even if power is
  enabled, endpoint stays inactive until REFCLK is stable (Sherry Sun)

- Parse reset properties in Root Port nodes (falling back to host bridge)
  to help support Key E connectors and the pwrctrl framework (Sherry Sun)

- Configure i.MX95 REF_USE_PAD before PHY reset (Richard Zhu)

- Assert i.MX95 ref_clk_en after reference clock stabilizes (Richard Zhu)

- Integrate new pwrctrl API for DTs with Root Port-level power supplies
  (Sherry Sun)

* pci/controller/dwc-imx6:
  PCI: imx6: Integrate new pwrctrl API
  PCI: imx6: Assert ref_clk_en after reference clock stabilizes on i.MX95
  PCI: imx6: Configure REF_USE_PAD before PHY reset for i.MX95
  PCI: imx6: Parse 'reset-gpios' in Root Port nodes
  PCI: imx6: Assert PERST# before enabling regulators
  PCI: host-generic: Add common helpers for parsing Root Port properties
  dt-bindings: PCI: fsl,imx6q-pcie: Add reset GPIO in Root Port node
  PCI: imx6: Fix IMX6SX_GPR12_PCIE_TEST_POWERDOWN handling
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Move IMX6SX_GPR12_PCIE_TEST_POWERDOWN handling into the core reset
  functions (Richard Zhu)

- Add pci_host_common_parse_ports() for use by any native driver to parse
  Root Port properties (currently only reset GPIOs) (Sherry Sun)

- Assert PERST# before enabling regulators to ensure that even if power is
  enabled, endpoint stays inactive until REFCLK is stable (Sherry Sun)

- Parse reset properties in Root Port nodes (falling back to host bridge)
  to help support Key E connectors and the pwrctrl framework (Sherry Sun)

- Configure i.MX95 REF_USE_PAD before PHY reset (Richard Zhu)

- Assert i.MX95 ref_clk_en after reference clock stabilizes (Richard Zhu)

- Integrate new pwrctrl API for DTs with Root Port-level power supplies
  (Sherry Sun)

* pci/controller/dwc-imx6:
  PCI: imx6: Integrate new pwrctrl API
  PCI: imx6: Assert ref_clk_en after reference clock stabilizes on i.MX95
  PCI: imx6: Configure REF_USE_PAD before PHY reset for i.MX95
  PCI: imx6: Parse 'reset-gpios' in Root Port nodes
  PCI: imx6: Assert PERST# before enabling regulators
  PCI: host-generic: Add common helpers for parsing Root Port properties
  dt-bindings: PCI: fsl,imx6q-pcie: Add reset GPIO in Root Port node
  PCI: imx6: Fix IMX6SX_GPR12_PCIE_TEST_POWERDOWN handling
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'pci/sysfs'</title>
<updated>2026-06-23T22:32:03+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2026-06-23T22:32:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8b3a73b4fe107705f2a11f413a0516119632ea40'/>
<id>8b3a73b4fe107705f2a11f413a0516119632ea40</id>
<content type='text'>
- Require CAP_SYS_ADMIN to write to sysfs 'resourceN_resize' attributes
  (Krzysztof Wilczyński)

- Convert PCI resource files to static attributes to avoid races that cause
  'duplicate filename' warnings and boot panics (Krzysztof Wilczyński)

- Remove pci_create_sysfs_dev_files() and pci_remove_sysfs_dev_files(),
  which are obsolete after converting to static attributes (Krzysztof
  Wilczyński)

- Add security_locked_down(LOCKDOWN_PCI_ACCESS) to alpha PCI resource mmap
  path to match the generic path (Krzysztof Wilczyński)

- Convert sysfs 'legacy_io' and 'legacy_mem' to static attributes
  (Krzysztof Wilczyński)

- Remove pci_create_legacy_files() and pci_sysfs_init(), which are obsolete
  after converting to static attributes (Krzysztof Wilczyński)

- Expose sysfs 'resourceN_resize' attributes only on platforms with PCI
  mmap (Krzysztof Wilczyński)

- Use kstrtobool() to parse the 'rom' attribute input to avoid the
  unexpected behavior of enabling the ROM when writing '0' with no trailing
  newline (Krzysztof Wilczyński)

* pci/sysfs:
  PCI/sysfs: Use kstrtobool() to parse the ROM attribute input
  PCI/sysfs: Limit BAR resize attribute scope to platforms with PCI mmap
  PCI/sysfs: Remove pci_create_legacy_files() and pci_sysfs_init()
  PCI/sysfs: Convert legacy I/O and memory attributes to static definitions
  PCI/sysfs: Add __weak pci_legacy_has_sparse() helper
  alpha/PCI: Compute legacy size in pci_mmap_legacy_page_range()
  PCI: Add macros for legacy I/O and memory address space sizes
  PCI/sysfs: Remove pci_{create,remove}_sysfs_dev_files()
  alpha/PCI: Convert resource files to static attributes
  alpha/PCI: Add static PCI resource attribute macros
  alpha/PCI: Remove WARN from __pci_mmap_fits() and __legacy_mmap_fits()
  alpha/PCI: Fix __pci_mmap_fits() overflow for zero-length BARs
  alpha/PCI: Use PCI resource accessor macros
  alpha/PCI: Use BAR index in sysfs attr-&gt;private instead of resource pointer
  alpha/PCI: Add security_locked_down() check to pci_mmap_resource()
  PCI/sysfs: Limit pci_sysfs_init() late_initcall compile scope
  PCI/sysfs: Add stubs for pci_{create,remove}_sysfs_dev_files()
  PCI/sysfs: Warn about BAR resize failure in __resource_resize_store()
  PCI/sysfs: Convert PCI resource files to static attributes
  PCI/sysfs: Add static PCI resource attribute macros
  PCI/sysfs: Add CAP_SYS_ADMIN check to __resource_resize_store()
  PCI/sysfs: Split pci_llseek_resource() for device and legacy attributes
  PCI/sysfs: Only allow supported resource types in I/O and MMIO helpers
  PCI: Add pci_resource_is_io() and pci_resource_is_mem() helpers
  PCI/sysfs: Use PCI resource accessor macros
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Require CAP_SYS_ADMIN to write to sysfs 'resourceN_resize' attributes
  (Krzysztof Wilczyński)

- Convert PCI resource files to static attributes to avoid races that cause
  'duplicate filename' warnings and boot panics (Krzysztof Wilczyński)

- Remove pci_create_sysfs_dev_files() and pci_remove_sysfs_dev_files(),
  which are obsolete after converting to static attributes (Krzysztof
  Wilczyński)

- Add security_locked_down(LOCKDOWN_PCI_ACCESS) to alpha PCI resource mmap
  path to match the generic path (Krzysztof Wilczyński)

- Convert sysfs 'legacy_io' and 'legacy_mem' to static attributes
  (Krzysztof Wilczyński)

- Remove pci_create_legacy_files() and pci_sysfs_init(), which are obsolete
  after converting to static attributes (Krzysztof Wilczyński)

- Expose sysfs 'resourceN_resize' attributes only on platforms with PCI
  mmap (Krzysztof Wilczyński)

- Use kstrtobool() to parse the 'rom' attribute input to avoid the
  unexpected behavior of enabling the ROM when writing '0' with no trailing
  newline (Krzysztof Wilczyński)

* pci/sysfs:
  PCI/sysfs: Use kstrtobool() to parse the ROM attribute input
  PCI/sysfs: Limit BAR resize attribute scope to platforms with PCI mmap
  PCI/sysfs: Remove pci_create_legacy_files() and pci_sysfs_init()
  PCI/sysfs: Convert legacy I/O and memory attributes to static definitions
  PCI/sysfs: Add __weak pci_legacy_has_sparse() helper
  alpha/PCI: Compute legacy size in pci_mmap_legacy_page_range()
  PCI: Add macros for legacy I/O and memory address space sizes
  PCI/sysfs: Remove pci_{create,remove}_sysfs_dev_files()
  alpha/PCI: Convert resource files to static attributes
  alpha/PCI: Add static PCI resource attribute macros
  alpha/PCI: Remove WARN from __pci_mmap_fits() and __legacy_mmap_fits()
  alpha/PCI: Fix __pci_mmap_fits() overflow for zero-length BARs
  alpha/PCI: Use PCI resource accessor macros
  alpha/PCI: Use BAR index in sysfs attr-&gt;private instead of resource pointer
  alpha/PCI: Add security_locked_down() check to pci_mmap_resource()
  PCI/sysfs: Limit pci_sysfs_init() late_initcall compile scope
  PCI/sysfs: Add stubs for pci_{create,remove}_sysfs_dev_files()
  PCI/sysfs: Warn about BAR resize failure in __resource_resize_store()
  PCI/sysfs: Convert PCI resource files to static attributes
  PCI/sysfs: Add static PCI resource attribute macros
  PCI/sysfs: Add CAP_SYS_ADMIN check to __resource_resize_store()
  PCI/sysfs: Split pci_llseek_resource() for device and legacy attributes
  PCI/sysfs: Only allow supported resource types in I/O and MMIO helpers
  PCI: Add pci_resource_is_io() and pci_resource_is_mem() helpers
  PCI/sysfs: Use PCI resource accessor macros
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'pci/resource'</title>
<updated>2026-06-23T22:32:02+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2026-06-23T22:32:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=131618da3a0716d10d47645214e32d75fe19efa8'/>
<id>131618da3a0716d10d47645214e32d75fe19efa8</id>
<content type='text'>
- Improve resource claim logging for debuggability (Ilpo Järvinen)

- Rename 'added' to 'add_list' for naming consistency (Ilpo Järvinen)

- Consolidate 'add_list' sanity checks (Ilpo Järvinen)

- Clean up several uses of const parameters (Ilpo Järvinen)

- Move pci_resource_alignment() from header to setup-res.c file (Ilpo
  Järvinen)

* pci/resource:
  PCI: Move pci_resource_alignment() to setup-res.c file
  PCI: Convert pci_resource_alignment() input parameters to const
  PCI: Make pci_sriov_resource_alignment() pci_dev const
  powerpc/pseries: Make pseries_get_iov_fw_value() &amp; pnv_iov_get() pci_dev const
  resource: Make resource_alignment() input const resource
  PCI: Remove const removal cast
  PCI: Consolidate add_list (aka realloc_head) empty sanity checks
  PCI: Rename 'added' to 'add_list'
  PCI: Log all resource claims
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Improve resource claim logging for debuggability (Ilpo Järvinen)

- Rename 'added' to 'add_list' for naming consistency (Ilpo Järvinen)

- Consolidate 'add_list' sanity checks (Ilpo Järvinen)

- Clean up several uses of const parameters (Ilpo Järvinen)

- Move pci_resource_alignment() from header to setup-res.c file (Ilpo
  Järvinen)

* pci/resource:
  PCI: Move pci_resource_alignment() to setup-res.c file
  PCI: Convert pci_resource_alignment() input parameters to const
  PCI: Make pci_sriov_resource_alignment() pci_dev const
  powerpc/pseries: Make pseries_get_iov_fw_value() &amp; pnv_iov_get() pci_dev const
  resource: Make resource_alignment() input const resource
  PCI: Remove const removal cast
  PCI: Consolidate add_list (aka realloc_head) empty sanity checks
  PCI: Rename 'added' to 'add_list'
  PCI: Log all resource claims
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'pci/pm'</title>
<updated>2026-06-23T22:32:01+00:00</updated>
<author>
<name>Bjorn Helgaas</name>
<email>bhelgaas@google.com</email>
</author>
<published>2026-06-23T22:32:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3a81c660546352577a35280898d9aa20d8a91e3d'/>
<id>3a81c660546352577a35280898d9aa20d8a91e3d</id>
<content type='text'>
- Set power state to 'unknown' for all devices, not just those with
  drivers, during suspend (Lukas Wunner)

- Skip restoring Resizable BARs and VF Resizable BARs if device doesn't
  respond to config reads, to avoid invalid array accesses (Marco
  Nenciarini)

- Add pci_suspend_retains_context() so drivers can tell whether devices may
  be reset while resuming from suspend due to platform issues; use this in
  nvme to avoid issues on Qcom RCs (Manivannan Sadhasivam)

* pci/pm:
  nvme-pci: Use pci_suspend_retains_context() during suspend
  PCI: qcom: Indicate broken L1SS exit during resume from system suspend
  PCI: Indicate context lost if L1SS exit is broken during resume from system suspend
  PCI: Add pci_suspend_retains_context() to check if device state is preserved during suspend
  PCI/IOV: Skip VF Resizable BAR restore on read error
  PCI: Skip Resizable BAR restore on read error
  PCI: Stop setting cached power state to 'unknown' on unbind
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Set power state to 'unknown' for all devices, not just those with
  drivers, during suspend (Lukas Wunner)

- Skip restoring Resizable BARs and VF Resizable BARs if device doesn't
  respond to config reads, to avoid invalid array accesses (Marco
  Nenciarini)

- Add pci_suspend_retains_context() so drivers can tell whether devices may
  be reset while resuming from suspend due to platform issues; use this in
  nvme to avoid issues on Qcom RCs (Manivannan Sadhasivam)

* pci/pm:
  nvme-pci: Use pci_suspend_retains_context() during suspend
  PCI: qcom: Indicate broken L1SS exit during resume from system suspend
  PCI: Indicate context lost if L1SS exit is broken during resume from system suspend
  PCI: Add pci_suspend_retains_context() to check if device state is preserved during suspend
  PCI/IOV: Skip VF Resizable BAR restore on read error
  PCI: Skip Resizable BAR restore on read error
  PCI: Stop setting cached power state to 'unknown' on unbind
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI/sysfs: Remove pci_create_legacy_files() and pci_sysfs_init()</title>
<updated>2026-06-23T20:19:09+00:00</updated>
<author>
<name>Krzysztof Wilczyński</name>
<email>kwilczynski@kernel.org</email>
</author>
<published>2026-05-08T04:35:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2800a911ced1540baa78de7494218aaf1c7dc4fa'/>
<id>2800a911ced1540baa78de7494218aaf1c7dc4fa</id>
<content type='text'>
Currently, pci_create_legacy_files() and pci_remove_legacy_files() are
no-op stubs.  With legacy attributes now handled by static groups
registered via pcibus_groups[], no call site needs them.

Remove both functions, their declarations, and the call sites in
pci_register_host_bridge(), pci_alloc_child_bus(), and pci_remove_bus().

Remove the pci_sysfs_init() late_initcall and sysfs_initialized.  The
late_initcall originally existed to create all the dynamic PCI sysfs files,
but with both resource and legacy attributes now handled by static groups,
it is no longer needed.

Remove the legacy_io and legacy_mem fields from struct pci_bus which were
used to track the dynamically allocated legacy attributes.

Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-24-kwilczynski@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, pci_create_legacy_files() and pci_remove_legacy_files() are
no-op stubs.  With legacy attributes now handled by static groups
registered via pcibus_groups[], no call site needs them.

Remove both functions, their declarations, and the call sites in
pci_register_host_bridge(), pci_alloc_child_bus(), and pci_remove_bus().

Remove the pci_sysfs_init() late_initcall and sysfs_initialized.  The
late_initcall originally existed to create all the dynamic PCI sysfs files,
but with both resource and legacy attributes now handled by static groups,
it is no longer needed.

Remove the legacy_io and legacy_mem fields from struct pci_bus which were
used to track the dynamically allocated legacy attributes.

Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-24-kwilczynski@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: Add macros for legacy I/O and memory address space sizes</title>
<updated>2026-06-23T20:19:09+00:00</updated>
<author>
<name>Krzysztof Wilczyński</name>
<email>kwilczynski@kernel.org</email>
</author>
<published>2026-05-08T04:35:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e52e497e3778c99c3fb26ef6a47af6a219133f8c'/>
<id>e52e497e3778c99c3fb26ef6a47af6a219133f8c</id>
<content type='text'>
Add defines for the standard PCI legacy address space sizes, replacing the
raw literals used by the legacy sysfs attributes.

Then, replace open-coded values with the newly added macros.

No functional changes intended.

Suggested-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-20-kwilczynski@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add defines for the standard PCI legacy address space sizes, replacing the
raw literals used by the legacy sysfs attributes.

Then, replace open-coded values with the newly added macros.

No functional changes intended.

Suggested-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-20-kwilczynski@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI/sysfs: Remove pci_{create,remove}_sysfs_dev_files()</title>
<updated>2026-06-23T20:19:09+00:00</updated>
<author>
<name>Krzysztof Wilczyński</name>
<email>kwilczynski@kernel.org</email>
</author>
<published>2026-05-08T04:35:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b45bebbfa0be8b1c8be5d3c5946f8f04d556fdf0'/>
<id>b45bebbfa0be8b1c8be5d3c5946f8f04d556fdf0</id>
<content type='text'>
Currently, pci_create_sysfs_dev_files() and pci_remove_sysfs_dev_files()
are no-op stubs.  With both the generic and Alpha resource files now
handled by static attribute groups, no platform needs dynamic per-device
sysfs file creation.

Remove both functions, their declarations, and the call sites in
pci_bus_add_device() and pci_stop_dev().

Remove __weak pci_create_resource_files() and pci_remove_resource_files()
stubs and their declarations in pci.h, as no architecture overrides them
anymore.

Remove the res_attr[] and res_attr_wc[] fields from struct pci_dev which
were used to track dynamically allocated resource attributes.

Finally, simplify pci_sysfs_init() to only handle legacy file creation
under HAVE_PCI_LEGACY, removing the per-device loop and the
HAVE_PCI_SYSFS_INIT helper added earlier.

Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-19-kwilczynski@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, pci_create_sysfs_dev_files() and pci_remove_sysfs_dev_files()
are no-op stubs.  With both the generic and Alpha resource files now
handled by static attribute groups, no platform needs dynamic per-device
sysfs file creation.

Remove both functions, their declarations, and the call sites in
pci_bus_add_device() and pci_stop_dev().

Remove __weak pci_create_resource_files() and pci_remove_resource_files()
stubs and their declarations in pci.h, as no architecture overrides them
anymore.

Remove the res_attr[] and res_attr_wc[] fields from struct pci_dev which
were used to track dynamically allocated resource attributes.

Finally, simplify pci_sysfs_init() to only handle legacy file creation
under HAVE_PCI_LEGACY, removing the per-device loop and the
HAVE_PCI_SYSFS_INIT helper added earlier.

Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-19-kwilczynski@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI/sysfs: Add stubs for pci_{create,remove}_sysfs_dev_files()</title>
<updated>2026-06-23T20:19:08+00:00</updated>
<author>
<name>Krzysztof Wilczyński</name>
<email>kwilczynski@kernel.org</email>
</author>
<published>2026-05-08T04:35:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2c31a9675f50a61c9ceed6dab2545be7aa896d1a'/>
<id>2c31a9675f50a61c9ceed6dab2545be7aa896d1a</id>
<content type='text'>
On platforms with HAVE_PCI_MMAP or ARCH_GENERIC_PCI_MMAP_RESOURCE, resource
files are now handled by static attribute groups registered via
pci_dev_groups[].

Stub out the pci_create_sysfs_dev_files() and pci_remove_sysfs_dev_files(),
as the dynamic resource file creation is no longer needed.

Also, simplify pci_sysfs_init() on these platforms to only iterate buses
for legacy attributes creation, skipping the per-device loop.

Move the __weak stubs for pci_create_resource_files() and
pci_remove_resource_files() into the #else branch since only platforms
without HAVE_PCI_MMAP (such as Alpha architecture) still need them.  Guard
the res_attr[] and res_attr_wc[] fields in struct pci_dev the same way.

Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-10-kwilczynski@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On platforms with HAVE_PCI_MMAP or ARCH_GENERIC_PCI_MMAP_RESOURCE, resource
files are now handled by static attribute groups registered via
pci_dev_groups[].

Stub out the pci_create_sysfs_dev_files() and pci_remove_sysfs_dev_files(),
as the dynamic resource file creation is no longer needed.

Also, simplify pci_sysfs_init() on these platforms to only iterate buses
for legacy attributes creation, skipping the per-device loop.

Move the __weak stubs for pci_create_resource_files() and
pci_remove_resource_files() into the #else branch since only platforms
without HAVE_PCI_MMAP (such as Alpha architecture) still need them.  Guard
the res_attr[] and res_attr_wc[] fields in struct pci_dev the same way.

Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-10-kwilczynski@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI/sysfs: Convert PCI resource files to static attributes</title>
<updated>2026-06-23T20:02:15+00:00</updated>
<author>
<name>Krzysztof Wilczyński</name>
<email>kwilczynski@kernel.org</email>
</author>
<published>2026-05-08T04:35:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ca617c60af9f6bb74216645ce4362dcb96697d52'/>
<id>ca617c60af9f6bb74216645ce4362dcb96697d52</id>
<content type='text'>
Currently, the PCI resource files (resourceN, resourceN_wc) are dynamically
created by pci_create_sysfs_dev_files(), called from both
pci_bus_add_device() and the pci_sysfs_init() late_initcall, with only a
sysfs_initialized flag for synchronisation.  This has caused warnings and
boot panics when both paths race on the same device, e.g.:

  sysfs: cannot create duplicate filename '/devices/pci0000:3c/0000:3c:01.0/0000:3e:00.2/resource2'

This is especially likely on Devicetree-based platforms, where the PCI host
controllers are platform drivers that probe via the driver model, which can
happen during or after the late_initcall.  As such, pci_bus_add_device()
and pci_sysfs_init() are more likely to overlap.

Convert to static const attributes with three attribute groups (I/O, UC,
WC), each with an .is_bin_visible() callback that checks resource flags,
BAR length, and non_mappable_bars.  A .bin_size() callback provides
pci_resource_len() to the kernfs node for correct stat and lseek behaviour.

As part of this conversion:

  - Rename pci_read_resource_io() and pci_write_resource_io() to
    pci_read_resource() and pci_write_resource() since the callbacks are no
    longer I/O-specific in the static attribute context.

  - Update __resource_resize_store() to use sysfs_create_groups() and
    sysfs_remove_groups(), which re-evaluates visibility and runs the
    .bin_size() callback for the static resource attribute groups.

  - Remove pci_create_resource_files(), pci_remove_resource_files(), and
    pci_create_attr() which are no longer needed.

  - Move the __weak stubs outside the #if guard so they remain available
    for callers converted in subsequent commits.

Platforms that do not define the HAVE_PCI_MMAP macro or the
ARCH_GENERIC_PCI_MMAP_RESOURCE macro, such as Alpha architecture,
continue using their platform-specific resource file creation.

For reference, the dynamic creation dates back to the pre-Git era:

  https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/drivers/pci/pci-sysfs.c?id=42298be0eeb5ae98453b3374c36161b05a46c5dc

The write-combine support was added in commit 45aec1ae72fc ("x86: PAT
export resource_wc in pci sysfs").

Many other reports mentioned in the cover letter (first Link: below).

Link: https://lore.kernel.org/r/20260508043543.217179-1-kwilczynski@kernel.org/
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=215515
Closes: https://github.com/openwrt/openwrt/issues/17143
Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-8-kwilczynski@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, the PCI resource files (resourceN, resourceN_wc) are dynamically
created by pci_create_sysfs_dev_files(), called from both
pci_bus_add_device() and the pci_sysfs_init() late_initcall, with only a
sysfs_initialized flag for synchronisation.  This has caused warnings and
boot panics when both paths race on the same device, e.g.:

  sysfs: cannot create duplicate filename '/devices/pci0000:3c/0000:3c:01.0/0000:3e:00.2/resource2'

This is especially likely on Devicetree-based platforms, where the PCI host
controllers are platform drivers that probe via the driver model, which can
happen during or after the late_initcall.  As such, pci_bus_add_device()
and pci_sysfs_init() are more likely to overlap.

Convert to static const attributes with three attribute groups (I/O, UC,
WC), each with an .is_bin_visible() callback that checks resource flags,
BAR length, and non_mappable_bars.  A .bin_size() callback provides
pci_resource_len() to the kernfs node for correct stat and lseek behaviour.

As part of this conversion:

  - Rename pci_read_resource_io() and pci_write_resource_io() to
    pci_read_resource() and pci_write_resource() since the callbacks are no
    longer I/O-specific in the static attribute context.

  - Update __resource_resize_store() to use sysfs_create_groups() and
    sysfs_remove_groups(), which re-evaluates visibility and runs the
    .bin_size() callback for the static resource attribute groups.

  - Remove pci_create_resource_files(), pci_remove_resource_files(), and
    pci_create_attr() which are no longer needed.

  - Move the __weak stubs outside the #if guard so they remain available
    for callers converted in subsequent commits.

Platforms that do not define the HAVE_PCI_MMAP macro or the
ARCH_GENERIC_PCI_MMAP_RESOURCE macro, such as Alpha architecture,
continue using their platform-specific resource file creation.

For reference, the dynamic creation dates back to the pre-Git era:

  https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/drivers/pci/pci-sysfs.c?id=42298be0eeb5ae98453b3374c36161b05a46c5dc

The write-combine support was added in commit 45aec1ae72fc ("x86: PAT
export resource_wc in pci sysfs").

Many other reports mentioned in the cover letter (first Link: below).

Link: https://lore.kernel.org/r/20260508043543.217179-1-kwilczynski@kernel.org/
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=215515
Closes: https://github.com/openwrt/openwrt/issues/17143
Signed-off-by: Krzysztof Wilczyński &lt;kwilczynski@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Tested-by: Shivaprasad G Bhat &lt;sbhat@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260508043543.217179-8-kwilczynski@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>PCI: Make pci_sriov_resource_alignment() pci_dev const</title>
<updated>2026-06-23T17:08:51+00:00</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2026-04-29T12:26:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=79a648209dadcc0f2ff0f27100fd79d1c890ccf8'/>
<id>79a648209dadcc0f2ff0f27100fd79d1c890ccf8</id>
<content type='text'>
pci_sriov_resource_alignment() inputs struct pci_dev which it should not
need to alter to calculate alignment.

Make pci_dev pci_sriov_resource_alignment() inputs const. It requires
making pci_iov_resource_size() input const as well.

Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://patch.msgid.link/20260429122617.7324-8-ilpo.jarvinen@linux.intel.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pci_sriov_resource_alignment() inputs struct pci_dev which it should not
need to alter to calculate alignment.

Make pci_dev pci_sriov_resource_alignment() inputs const. It requires
making pci_iov_resource_size() input const as well.

Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://patch.msgid.link/20260429122617.7324-8-ilpo.jarvinen@linux.intel.com
</pre>
</div>
</content>
</entry>
</feed>
