All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Allow deferred execution of iomem_get_mapping()
@ 2021-06-25 23:31 Krzysztof Wilczyński
  2021-06-25 23:31 ` [PATCH 1/2] sysfs: Invoke iomem_get_mapping() from the sysfs open callback Krzysztof Wilczyński
  2021-06-25 23:31 ` [PATCH 2/2] PCI/sysfs: Pass iomem_get_mapping() as a function pointer Krzysztof Wilczyński
  0 siblings, 2 replies; 14+ messages in thread
From: Krzysztof Wilczyński @ 2021-06-25 23:31 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Dan Williams, Greg Kroah-Hartman, Daniel Vetter, Kees Cook,
	Pali Rohár, Oliver O'Halloran, linux-pci

Hello,

At the moment, the dependency on iomem_get_mapping() that is currently
used in the pci_create_resource_files() and pci_create_legacy_files()
stops us from completely retiring the late_initcall() that is used to
invoke pci_sysfs_init() when creating sysfs object for PCI devices.

This dependency on iomem_get_mapping() stops us from retiring the
late_initcall at the moment as when we convert dynamically added sysfs
objects, that are primarily added in the pci_create_resource_files() and
pci_create_legacy_files(), as these attributes are added before the VFS
completes its initialisation, and since most of the PCI devices are
typically enumerated in subsys_initcall this leads to a failure and an
Oops related to iomem_get_mapping() access.

See relevant conversations:
  https://lore.kernel.org/linux-pci/20210204165831.2703772-1-daniel.vetter@ffwll.ch/
  https://lore.kernel.org/linux-pci/20210313215747.GA2394467@bjorn-Precision-5520/
  
After some deliberation about the problem at hand, Dan Williams
suggested a solution to the problem, see:
  https://lore.kernel.org/linux-pci/CAPcyv4i0y_4cMGEpNVShLUyUk3nyWH203Ry3S87BqnDJE0Rmxg@mail.gmail.com/

The idea is to defer execution of the iomem_get_mapping() to only when
the sysfs open callback is run, and thus removing the reliance of
fs_initcalls to complete before any other sub-system that uses the
iomem_get_mapping().

Currently, the PCI sub-system will benefit the most from this change
allowing for it to complete the transition from dynamically created to
static sysfs objects.

This series aims to take Dan Williams' idea through the finish line.

Related to:
  https://lore.kernel.org/linux-pci/20210527205845.GA1421476@bjorn-Precision-5520/
  https://lore.kernel.org/linux-pci/20210507102706.7658-1-danijel.slivka@amd.com/
  https://lore.kernel.org/linux-pci/20200716110423.xtfyb3n6tn5ixedh@pali/

	Krzysztof

Krzysztof Wilczyński (2):
  sysfs: Invoke iomem_get_mapping() from the sysfs open callback
  PCI/sysfs: Pass iomem_get_mapping() as a function pointer

 drivers/pci/pci-sysfs.c | 6 +++---
 fs/sysfs/file.c         | 2 +-
 include/linux/sysfs.h   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-06-28 18:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 23:31 [PATCH 0/2] Allow deferred execution of iomem_get_mapping() Krzysztof Wilczyński
2021-06-25 23:31 ` [PATCH 1/2] sysfs: Invoke iomem_get_mapping() from the sysfs open callback Krzysztof Wilczyński
2021-06-25 23:53   ` Dan Williams
2021-06-28 10:09   ` Christoph Hellwig
2021-06-28 10:41     ` Krzysztof Wilczy??ski
2021-06-28 17:36     ` Dan Williams
2021-06-28 18:06       ` Krzysztof Wilczyński
2021-06-28 18:29         ` Dan Williams
2021-06-25 23:31 ` [PATCH 2/2] PCI/sysfs: Pass iomem_get_mapping() as a function pointer Krzysztof Wilczyński
2021-06-25 23:56   ` Dan Williams
2021-06-26 13:07     ` Krzysztof Wilczyński
2021-06-28 10:15   ` Christoph Hellwig
2021-06-28 10:24     ` Krzysztof Wilczy??ski
2021-06-28 11:09       ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.