[PATCH v6 4/5] PCI: vmd: Update type of the __iomem pointers
Derrick, Jonathan
jonathan.derrick at intel.com
Tue Dec 1 05:19:32 AEDT 2020
On Mon, 2020-11-30 at 11:20 -0600, Bjorn Helgaas wrote:
> On Mon, Nov 30, 2020 at 09:06:56AM +0000, David Laight wrote:
> > From: Krzysztof Wilczynski
> > > Sent: 29 November 2020 23:08
> > >
> > > Use "void __iomem" instead "char __iomem" pointer type when working with
> > > the accessor functions (with names like readb() or writel(), etc.) to
> > > better match a given accessor function signature where commonly the
> > > address pointing to an I/O memory region would be a "void __iomem"
> > > pointer.
> >
> > ISTM that is heading in the wrong direction.
> >
> > I think (form the variable names etc) that these are pointers
> > to specific registers.
> >
> > So what you ought to have is a type for that register block.
> > Typically this is actually a structure - to give some type
> > checking that the offsets are being used with the correct
> > base address.
>
> In this case, "cfgbar" is not really a pointer to a register; it's the
> address of memory-mapped config space. The VMD hardware turns
> accesses to that space into PCI config transactions on its secondary
> side. xgene_pcie_get_cfg_base() and brcm_pcie_map_conf() are similar
> situations and use "void *".
>
> Bjorn
Yes it's just the passthrough window for PCI config bus ops.
Reviewed-by: Jon Derrick <jonathan.derrick at intel.com>
More information about the Linuxppc-dev
mailing list