Re: [PATCH v2 1/1] Guard pci_create_sysfs_dev_files with atomic value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 16.03.23 10:33, Alexander Stein wrote:
Hi Oliver,

Hi,


Admittedly
I would like to get rid of these two pathes for creating sysfs files in the
first place, but I do not know the pci subsystem very well.
IMHO for_each_pci_dev(pdev) in pci_sysfs_init is part of the problem as it
unconditionally iterates over the bus, without any locks, thus creating sysfs
files for each device added to the bus.
Any ideas?

First of all, this existing code is a mess.

If I understand you have the issue that your driver adds a bridge
in dw_pcie_host_init() and the generic code in pci_create_sysfs_dev_files()
populates the directory before or while your driver does so and
the devices are effectively discovered twice.

It seems to me that you must not add a bridge before pci_create_sysfs_dev_files()
has finished. Now you could add a wait_queue and a flag and wait for it to
finish. But that is not very elegant. From which initcall is your driver
probed?

	Regards
		Oliver



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux