Skip to content

acs_pcie.c has the pal_pcie_check_bus_valid check too late #478

Closed
@cdwilde

Description

@cdwilde

In the latest PR Support to limit scanning entire PCIe space, the check for bus is buried down in the function area, causing lots of wasted prints and time:

  /* Iterate over all buses, devices and functions in this ecam */
   for (bus_index = start_bus; bus_index <= end_bus; bus_index++)
   {
       for (dev_index = 0; dev_index < PCIE_MAX_DEV; dev_index++)
       {
           for (func_index = 0; func_index < PCIE_MAX_FUNC; func_index++)
           {
               if (pal_pcie_check_bus_valid(bus_index)) {
                   val_print(ACS_PRINT_DEBUG,
                    "       Bus 0x%x marked as invalid in Platform API...Skipping\n", bus_index);
                   continue;
               }

It needs to be moved up to the bus portion of the big for loop:

  /* Iterate over all buses, devices and functions in this ecam */
   for (bus_index = start_bus; bus_index <= end_bus; bus_index++)
   {
               if (pal_pcie_check_bus_valid(bus_index)) {
                   val_print(ACS_PRINT_DEBUG,
                    "       Bus 0x%x marked as invalid in Platform API...Skipping\n", bus_index);
                   continue;
               }           for (dev_index = 0; dev_index < PCIE_MAX_DEV; dev_index++)
       {
           for (func_index = 0; func_index < PCIE_MAX_FUNC; func_index++)
           {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions