Re: [PATCH 1/2] sysfs: Invoke iomem_get_mapping() from the sysfs open callback

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

 



Hi Christoph,

> >  	if (battr->mapping)
> > -		of->file->f_mapping = battr->mapping;
> > +		of->file->f_mapping = battr->mapping();
> 
> I think get_mapping() is a better name now.  That being said this
> whole programming model looks a little weird.

I would have to lean on Daniel and Dan here as they might have more
context than I do, especially since in the PCI world we are only
consumers of this new API.  The related patches are:

  commit 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims the region")
  commit 636b21b50152 ("PCI: Revoke mappings like devmem") 

> Also, does this patch imply the mapping field of the sysfs bin
> attributes wasn't used before at all?

No, everything worked as intended, thankfully.  Changes here are meant
to help us transition to use static sysfs objects when we add various
PCI-related attributes a particular device.  This in turn will allow us
to remove the need for late_initcall() in the drivers/pci/pci-sysfs.c,
and thus fix the race condition people noticed on some platforms when
sysfs objects are being added while PCI sub-system and devices are
initialised.

More details are captured in the following conversations:
  https://lore.kernel.org/linux-pci/20200716110423.xtfyb3n6tn5ixedh@pali/
  https://lore.kernel.org/linux-pci/20210527205845.GA1421476@bjorn-Precision-5520/
  https://lore.kernel.org/linux-pci/20210313215747.GA2394467@bjorn-Precision-5520/

Dan's original patch:
  https://lore.kernel.org/linux-pci/CAPcyv4i0y_4cMGEpNVShLUyUk3nyWH203Ry3S87BqnDJE0Rmxg@xxxxxxxxxxxxxx/

	Krzysztof



[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