Skip to content

core interrupt: few new API functions - #6354

Merged
jforissier merged 3 commits into
OP-TEE:masterfrom
etienne-lms:itr-chip-1-func
Oct 11, 2023
Merged

core interrupt: few new API functions#6354
jforissier merged 3 commits into
OP-TEE:masterfrom
etienne-lms:itr-chip-1-func

Conversation

@etienne-lms

Copy link
Copy Markdown
Contributor

Before summer, few P-Rs, incl. #6087, #6088 and #6096 were merged to introduce interrupt controller devices in OP-TEE core, for staged controllers and interrupts multiplexing.

I let P-R #6113 stall before summer. This P-R presents the 3 first commits from #6113, in order to finalize the integration of the interrupt framework APIs (goal: pass an itrchip reference).
On can see in #6113 the next changes that would follow this series: upgrading the few core/drivers/ source files to use the new API framework interrupt_xxx() functions then remove the deprecated itr_xxx() functions.

@gagachang

Copy link
Copy Markdown
Contributor

Hello @etienne-lms

For commit drivers: move to interrupt_call_handlers()
would you help update PLIC together?

void plic_it_handle(void)
{
	struct plic_data *pd = &plic_data;
	uint32_t id = plic_claim_interrupt(pd);

	if (id <= pd->max_it)
-		itr_handle(id);
+		interrupt_call_handlers(&pd->chip, id);
	else
		DMSG("ignoring interrupt %" PRIu32, id);

	plic_complete_interrupt(pd, id);
}

@etienne-lms

Copy link
Copy Markdown
Contributor Author

would you help update PLIC together?

Hello @gagachang, sure, I missed it. I'll do. Thanks for reporting.

@etienne-lms

Copy link
Copy Markdown
Contributor Author

comment addressed

@gagachang

Copy link
Copy Markdown
Contributor

Thanks!
For commit drivers: move to interrupt_call_handlers(),
please add
Reviewed-by: Alvin Chang <alvinga@andestech.com>

@jforissier jforissier left a comment

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.

One question, in any case:
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>

* @cpu_mask Mask of the CPUs targeted by the interrupt
*/
static inline void interrupt_raise_sgi(struct itr_chip *chip, size_t itr_num,
uint8_t cpu_mask)

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.

Not strictly related to this PR, but... I notice that cpu_mask is an uint8_t, does it mean the API can only support at most 8 cores? Or perhaps a "CPU" is not a core? (the comment near itr_raise_sgi() mentions a "cpu interface").

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.

Actually I mimicked the existing GIC function API. As for a generic purpose interrupt controller framework, I don't think "raise SGI" or "raise PPI" really make sense but I propose to postpone this to later, once there's a need.

@etienne-lms

Copy link
Copy Markdown
Contributor Author

Fixup commits squashed and review tags applied.

@jenswikl jenswikl left a comment

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.

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

Removes itr_handle() in favor to interrupt_call_handlers(). This
changes updates all implemented main interrupt controller drivers that
are the GIC driver, the HFIC driver and Atmel SAIC driver.

Reviewed-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Adds interrupt API function interrupt_alloc_add_conf_handler() to
allocate, configure and register an interrupt handler, providing
interrupt type and priority.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Defines helper API functions to call .raise_pi, .raise_sgi and
.set_affinity handlers of a chip controller. Defines API function
to query support of these handlers in the interrupt controller.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
@etienne-lms

Copy link
Copy Markdown
Contributor Author

Tag applied. Thanks for the review.

@etienne-lms

Copy link
Copy Markdown
Contributor Author

Thanks for the merge.
I've created OP-TEE/optee_docs#215 to update the documentation.

@etienne-lms
etienne-lms deleted the itr-chip-1-func branch October 13, 2023 20:45
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.

4 participants