Skip to contentSkip to conversation

i8253 clocksource vs. rthal_get_8254_tsc

Xenomai Jan Kiszka 2 participants 8 messages Feb 6, 2013

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 9 lines · Jan Kiszka

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

This emulation replaces Xenomai's TSC emulation when the kernel boots on a cpu without a TSC: the detection is made at run-time instead of compilation time using self-modifying code (this in order to be able to build Debian kernels which boots with any configuration). There is no reason to keep the compilation-time dependency on !INPUT_PCSPKR with I-pipe core, as now the pc speaker is disabled at run-time too. Unfortunately, I could not find how to arrange the Kconfig either.

Signature · 1 line
                                                                Gilles.
author
#2 lore raw
Quoted 9 lines · Gilles Chanteperdrix
Quoted 7 lines · Jan Kiszka

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

Quoted 8 lines
Quoted 2 lines

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

This emulation replaces Xenomai's TSC emulation when the kernel boots on a cpu without a TSC: the detection is made at run-time instead of compilation time using self-modifying code (this in order to be able to build Debian kernels which boots with any configuration).

Hmm, that's for the kernel. But what prevents rthal_setup_8254_tsc from being executed in addition? I'm currently a bit lost in the #ifdefs.

Quoted 4 lines

There is no
reason to keep the compilation-time dependency on !INPUT_PCSPKR with I-pipe core, as now the pc speaker is disabled at run-time too. Unfortunately, I could not find how to arrange the Kconfig either.

As this is only about practically unsupported combinations of Xenomai (2.6.x) and I-pipe (for kernel 2.6.x) on x86, we could move from a configure-time to a build-time detection (#ifdef CONFIG_INPUT_PCSPKR -> BUILD_BUG()).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
author
#3 lore raw
Quoted 14 lines · Jan Kiszka
Quoted 13 lines · Gilles Chanteperdrix
Quoted 9 lines · Jan Kiszka

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

Quoted 7 lines
Quoted 4 lines

This emulation replaces Xenomai's TSC emulation when the kernel boots on a cpu without a TSC: the detection is made at run-time instead of compilation time using self-modifying code (this in order to be able to build Debian kernels which boots with any configuration).

Hmm, that's for the kernel. But what prevents rthal_setup_8254_tsc from being executed in addition? I'm currently a bit lost in the #ifdefs.

Ah! IPIPE_CORE_APIREV < 2, right?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#4 lore raw
In reply to Jan Kiszka
Quoted 14 lines · Jan Kiszka
Quoted 13 lines · Gilles Chanteperdrix
Quoted 9 lines · Jan Kiszka

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

Quoted 7 lines
Quoted 4 lines

This emulation replaces Xenomai's TSC emulation when the kernel boots on a cpu without a TSC: the detection is made at run-time instead of compilation time using self-modifying code (this in order to be able to build Debian kernels which boots with any configuration).

Hmm, that's for the kernel. But what prevents rthal_setup_8254_tsc from being executed in addition? I'm currently a bit lost in the #ifdefs.

rthal_setup_8254_tsc is not called.

Quoted 10 lines
Quoted 5 lines

There is no
reason to keep the compilation-time dependency on !INPUT_PCSPKR with I-pipe core, as now the pc speaker is disabled at run-time too. Unfortunately, I could not find how to arrange the Kconfig either.

As this is only about practically unsupported combinations of Xenomai (2.6.x) and I-pipe (for kernel 2.6.x) on x86, we could move from a configure-time to a build-time detection (#ifdef CONFIG_INPUT_PCSPKR -> BUILD_BUG()).

There is already a run-time detection which simply does not declare the PC speaker platform device when there is no tsc.

Signature · 1 line
                                                                Gilles.
author
#5 lore raw
Quoted 33 lines · Gilles Chanteperdrix
Quoted 14 lines · Jan Kiszka
Quoted 13 lines · Gilles Chanteperdrix
Quoted 9 lines · Jan Kiszka

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

Quoted 7 lines
Quoted 4 lines

This emulation replaces Xenomai's TSC emulation when the kernel boots on a cpu without a TSC: the detection is made at run-time instead of compilation time using self-modifying code (this in order to be able to build Debian kernels which boots with any configuration).

Hmm, that's for the kernel. But what prevents rthal_setup_8254_tsc from being executed in addition? I'm currently a bit lost in the #ifdefs.

rthal_setup_8254_tsc is not called.

Quoted 6 lines
Quoted 5 lines

There is no
reason to keep the compilation-time dependency on !INPUT_PCSPKR with I-pipe core, as now the pc speaker is disabled at run-time too. Unfortunately, I could not find how to arrange the Kconfig either.

Quoted 8 lines
Quoted 4 lines

As this is only about practically unsupported combinations of Xenomai (2.6.x) and I-pipe (for kernel 2.6.x) on x86, we could move from a configure-time to a build-time detection (#ifdef CONFIG_INPUT_PCSPKR -> BUILD_BUG()).

There is already a run-time detection which simply does not declare the PC speaker platform device when there is no tsc.

That's for core-3.4+, but not for older kernels. If we are fine with ignoring them, I'll just write a patch to remove that Kconfig dependency.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#6 lore raw
Quoted 40 lines · Jan Kiszka
Quoted 39 lines · Gilles Chanteperdrix
Quoted 14 lines · Jan Kiszka
Quoted 13 lines · Gilles Chanteperdrix
Quoted 9 lines · Jan Kiszka

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

Quoted 7 lines
Quoted 4 lines

This emulation replaces Xenomai's TSC emulation when the kernel boots on a cpu without a TSC: the detection is made at run-time instead of compilation time using self-modifying code (this in order to be able to build Debian kernels which boots with any configuration).

Hmm, that's for the kernel. But what prevents rthal_setup_8254_tsc from being executed in addition? I'm currently a bit lost in the #ifdefs.

rthal_setup_8254_tsc is not called.

Quoted 10 lines
Quoted 5 lines

There is no
reason to keep the compilation-time dependency on !INPUT_PCSPKR with I-pipe core, as now the pc speaker is disabled at run-time too. Unfortunately, I could not find how to arrange the Kconfig either.

As this is only about practically unsupported combinations of Xenomai (2.6.x) and I-pipe (for kernel 2.6.x) on x86, we could move from a configure-time to a build-time detection (#ifdef CONFIG_INPUT_PCSPKR -> BUILD_BUG()).

Quoted 5 lines
Quoted 2 lines

There is already a run-time detection which simply does not declare the PC speaker platform device when there is no tsc.

That's for core-3.4+, but not for older kernels. If we are fine with ignoring them, I'll just write a patch to remove that Kconfig dependency.

You could replace !INPUT_PCSPKR with !X86_TSC && !INPUT_PCSPKR I-pipe core kernels can be compiled with CONFIG_X86_TSC anyway.

Signature · 1 line
                                                                Gilles.
author
#7 lore raw
Quoted 45 lines · Gilles Chanteperdrix
Quoted 43 lines · Jan Kiszka
Quoted 41 lines · Gilles Chanteperdrix
Quoted 14 lines · Jan Kiszka
Quoted 13 lines · Gilles Chanteperdrix
Quoted 9 lines · Jan Kiszka

Hi Gilles,

I just realized that there is now a 8253 clocksource in core-3.4+. How does this work together with Xenomai's TSC emulation via the 8254 in the x86 hal_32? Xenomai reprograms the PIT in rthal_setup_8254_tsc - is this harmless?

I came across this while trying to get rid of Xenomai's "depends on !INPUT_PCSPKR" to avoid that circular Kbuild dependency.

Quoted 7 lines
Quoted 4 lines

This emulation replaces Xenomai's TSC emulation when the kernel boots on a cpu without a TSC: the detection is made at run-time instead of compilation time using self-modifying code (this in order to be able to build Debian kernels which boots with any configuration).

Hmm, that's for the kernel. But what prevents rthal_setup_8254_tsc from being executed in addition? I'm currently a bit lost in the #ifdefs.

rthal_setup_8254_tsc is not called.

Quoted 10 lines
Quoted 5 lines

There is no
reason to keep the compilation-time dependency on !INPUT_PCSPKR with I-pipe core, as now the pc speaker is disabled at run-time too. Unfortunately, I could not find how to arrange the Kconfig either.

As this is only about practically unsupported combinations of Xenomai (2.6.x) and I-pipe (for kernel 2.6.x) on x86, we could move from a configure-time to a build-time detection (#ifdef CONFIG_INPUT_PCSPKR -> BUILD_BUG()).

There is already a run-time detection which simply does not declare the PC speaker platform device when there is no tsc.

Quoted 6 lines
Quoted 2 lines

That's for core-3.4+, but not for older kernels. If we are fine with ignoring them, I'll just write a patch to remove that Kconfig dependency.

You could replace !INPUT_PCSPKR with !X86_TSC && !INPUT_PCSPKR I-pipe core kernels can be compiled with CONFIG_X86_TSC anyway.

We already have "depend on (X86_TSC || !X86 || !INPUT_PCSPKR)", and that's not impressing kconfig's dependency analyzer. I suppose it is not taking the ! into account in its cycle detection.

CONFIG A
depends on !B

CONFIG B
depends on !A

A cycle, but harmless.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux