Skip to content

[PW_SID:1100296] acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()#2007

Open
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1100296
Open

[PW_SID:1100296] acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()#2007
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1100296

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1100296 applied to workflow__riscv__fixes

Name: acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1100296
Version: 1

…t_intc()

riscv_acpi_register_ext_intc() inserts into ext_intc_list, which
is sorted with the largest gsi_base first. It walks the list
until it finds the first entry with a smaller gsi_base, then
inserts the new entry before that entry. After the loop it also
caps the predecessor's nr_irqs if that predecessor was registered
as PENDING.

The current code uses the loop cursor for both jobs:

    list_for_each_entry(node, &ext_intc_list, list) {
            if (node->gsi_base < ext_intc_element->gsi_base)
                    break;
    }

    prev = list_prev_entry(node, list);
    if (!list_entry_is_head(prev, &ext_intc_list, list)) {
            ...
    }

    list_add_tail(&ext_intc_element->list, &node->list);

If the loop falls through (no entry has a smaller gsi_base),
node ends up past the end of the list. `&node->list` resolves
to `&ext_intc_list` via container_of() offset cancellation. So
list_prev_entry() lands on the last real entry, and
list_add_tail() inserts at the tail. The code works today.

It is fragile though. Any future change that reads another field
of node will hit memory before the ext_intc_list global.

Track the insertion point with a dedicated list_head pointer.
Initialise pos to `&ext_intc_list`. Set it to `&node->list` on
early break. Use pos->prev for the PENDING adjustment, and pos
for list_add_tail(). The cursor is no longer touched after the
loop. Behaviour is unchanged.

Same shape as the Koschel cleanups from 2022 (e.g. 99d8ae4
tracing, 2966a99 clockevents, dc1acd5 dlm).

Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 139.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1125.15 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1674.96 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 87.10 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "acpi/riscv: use a dedicated insertion point in riscv_acpi_register_ext_intc()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants