Re: Implementation details of PCI Managed (devres) Functions

From: Tejun Heo
Date: Thu Nov 09 2023 - 13:52:21 EST


Hello, Philipp.

On Wed, Nov 08, 2023 at 10:02:29PM +0100, Philipp Stanner wrote:
...
> That struct keeps track of the requested BARs. That's why there can
> only be one mapping per BAR, because that table is statically allocated
> and is indexed with the bar-number.
> pcim_iomap_table() now only ever returns the table with the pointers to
> the BARs. Adding tables to that struct that keep track of which
> mappings exist in which bars would be a bit tricky and require probably
> an API change for everyone who currently uses pcim_iomap_table(), and
> that's more than 100 C-files.
>
> So, it seems that a concern back in 2007 was to keep things simple and
> skip the more complex data structures necessary for keeping track of
> the various mappings within a bar.

It was so long ago that I don't remember much but I do remember taking a
shortcut there for convenience / simplicity. I'm sure it's already clear but
there's no deeper reason, so if you wanna put in the work to make it
consistent, that'd be great.

Thanks.

--
tejun