Skip to content

core: interrupt: dt_driver providers/consumers - #6097

Closed
etienne-lms wants to merge 5 commits into
OP-TEE:masterfrom
etienne-lms:itr-chip-2
Closed

core: interrupt: dt_driver providers/consumers#6097
etienne-lms wants to merge 5 commits into
OP-TEE:masterfrom
etienne-lms:itr-chip-2

Conversation

@etienne-lms

Copy link
Copy Markdown
Contributor

2 patches etracted from #5954:
1st commit: resources for interrupt controller to register to dt_driver and allow interrupt consumer device drivers to use DT means to retrive and configure their interrupt.
2nd commit: GID driver registers to dt_driver as an interrupt providers.

@etienne-lms etienne-lms changed the title Itr chip 2 core: interrupt: dt_driver providers/consumers Jun 7, 2023

@borneoa borneoa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find how to review the commit message! Anyway:

when an dependent interrupt controller is not yet initialized.

s/an/a/

@etienne-lms

Copy link
Copy Markdown
Contributor Author

I force pushed the 2 patches with commit message bieng fixed.

Comment thread core/include/kernel/interrupt.h Outdated
Comment thread core/include/kernel/interrupt.h Outdated
* Helper function for when caller retrieves the first interrupt defined
* in "interrupts" or "extended-interrupts" DT binding property list.
*/
static inline TEE_Result dt_get_interrupt(const void *fdt, int node,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be under CFG_DT switch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, it calls an empty inline function so compiler already knows it's also empty.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but feels strange to have a dt_* function not under CFG_DT switch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 definition instead of 2 under alternate #if/#else cases.

Comment thread core/kernel/interrupt.c Outdated
Comment thread core/kernel/interrupt.c
Comment thread core/kernel/interrupt.c Outdated

@etienne-lms etienne-lms left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. There is 1 comment I'm not certain being worth it.

* Helper function for when caller retrieves the first interrupt defined
* in "interrupts" or "extended-interrupts" DT binding property list.
*/
static inline TEE_Result dt_get_interrupt(const void *fdt, int node,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, it calls an empty inline function so compiler already knows it's also empty.

Comment thread core/kernel/interrupt.c Outdated
Comment thread core/kernel/interrupt.c
Comment thread core/kernel/interrupt.c Outdated
@etienne-lms

Copy link
Copy Markdown
Contributor Author

comments addressed

@etienne-lms

etienne-lms commented Jun 14, 2023

Copy link
Copy Markdown
Contributor Author

Rebased. I appended 2 more fixup commits due to the rebasing.

(edited)

Adds interrupt chip framework API functions for an interrupt controller
to register as an interrupt provider in the driver probing sequence
based on device tree. This allows interrupt consumer to be deferred
when a dependent interrupt controller is not yet initialized.

Interrupt controller register driver in DT_DRIVER providers list with:
dt_register_interrupt_provider().

Interrupt consumer can get their interrupt through DT data with
dt_get_interrupt(), dt_get_interrupt_by_index() or
dt_get_interrupt_by_name().

This change removes inclusion of interrupt.h from kernel/dt.h as it is
not needed and conflicts with inclusion of kernel/dt.h from
kernel/interrupt.h.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Registers GIC driver as an interrupt controller in DT_DRIVER
providers when DT is supported. This change allows interrupt
consumer nodes to leverage interrupts and interrupts-extended
properties DT bindings for their device drivers to retrieve
their interrupts.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Should rename the commit "interrupt: provider and consumer nodes

Fixes s/inited/initialized/

Changes s/Provide/Provides/g for local description. Makes sense;

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Updates defined type itr_dt_get_func.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Updates dt_get_gic_chip_cb().

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
@github-actions

Copy link
Copy Markdown

This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions Bot added the Stale label Jul 16, 2023
@github-actions github-actions Bot closed this Jul 22, 2023
@etienne-lms
etienne-lms deleted the itr-chip-2 branch October 12, 2023 09:39
@etienne-lms
etienne-lms restored the itr-chip-2 branch October 12, 2023 09:39
@etienne-lms
etienne-lms deleted the itr-chip-2 branch January 8, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants