Skip to content

mcb: enable register PCI devices using any BAR

Filip Jensen lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 1 replySuperseded
  3. v13 patches 1 replySuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mcb: Use more than the first bar in pci devicesdrivers/mcb/mcb-internal.h drivers/mcb/mcb-lpc.c drivers/mcb/mcb-parse.c +1 more+16 -130 replies
2/2mcb: refactor bus operations out of common codedrivers/mcb/mcb-internal.h drivers/mcb/mcb-lpc.c drivers/mcb/mcb-parse.c +1 more+111 -750 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJose Javier Rodriguez Barbarin
SeriesR-b
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] mcb: enable register PCI devices using any BAR

V2 -> V3: Thanks for second review. Fixed declaring pci_dev outside of the only block where it is needed in patch 1/2.
V1 -> V2: Thanks to the review from Johannes Thumshirn, the patch 2/3 of the first version has been removed and the cleaner solution from patch 3/3 is then kept.

The PCI mcb driver is currently only able to register devices that use the first PCI BAR. That is hardcoded in mcb-parse.c in lines 156-161:

                c = kzalloc_obj(struct chameleon_bar);
                if (!c)
                        return -ENOMEM;

                bar_count = 1;
                c->addr = mapbase;

However, mcb devices can use other indexes of the 6 PCI BARs. This serie of patches allows to use these devices by adding the relevant PCI BAR info to the chameleon table. As this code must also work for lpc devices, it has been done a refactoring in order to keep the two buses dependent operations regarding bars (get_bar and is_io_mapped_bar) outside of the common parsing code. These callback operations are stored in a structure and passed over to the parser, thus rendering each module, the mcb-lpc and mcb-pci, only with their own bus relevant logic.

This patch depends on the previously accepted patch:

Filip Jensen (2):
mcb: Use more than the first bar in pci devices
mcb: refactor bus operations out of common code

 drivers/mcb/mcb-internal.h | 10 ++++-
 drivers/mcb/mcb-lpc.c      | 56 ++++++++++++++++++++++++++-
 drivers/mcb/mcb-parse.c    | 77 +++++---------------------------------
 drivers/mcb/mcb-pci.c      | 40 +++++++++++++++++++-
 4 files changed, 111 insertions(+), 72 deletions(-)
Signature · 1 line
2.34.1