Skip to content

Commit de2f75d

Browse files
committed
Merge tag 'x86-apic-2025-12-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 apic updates from Ingo Molnar: - x86/apic: Fix the frequency in apic=verbose log output (Julian Stecklina) - Simplify mp_irqdomain_alloc() slightly (Christophe JAILLET) * tag 'x86-apic-2025-12-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic: Fix frequency in apic=verbose log output x86/ioapic: Simplify mp_irqdomain_alloc() slightly
2 parents 6d2c10e + ed4f963 commit de2f75d

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

arch/x86/kernel/apic/apic.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static struct resource lapic_resource = {
173173
.flags = IORESOURCE_MEM | IORESOURCE_BUSY,
174174
};
175175

176+
/* Measured in ticks per HZ. */
176177
unsigned int lapic_timer_period = 0;
177178

178179
static void apic_pm_activate(void);
@@ -792,6 +793,7 @@ static int __init calibrate_APIC_clock(void)
792793
{
793794
struct clock_event_device *levt = this_cpu_ptr(&lapic_events);
794795
u64 tsc_perj = 0, tsc_start = 0;
796+
long delta_tsc_khz, bus_khz;
795797
unsigned long jif_start;
796798
unsigned long deltaj;
797799
long delta, deltatsc;
@@ -894,14 +896,15 @@ static int __init calibrate_APIC_clock(void)
894896
apic_pr_verbose("..... calibration result: %u\n", lapic_timer_period);
895897

896898
if (boot_cpu_has(X86_FEATURE_TSC)) {
897-
apic_pr_verbose("..... CPU clock speed is %ld.%04ld MHz.\n",
898-
(deltatsc / LAPIC_CAL_LOOPS) / (1000000 / HZ),
899-
(deltatsc / LAPIC_CAL_LOOPS) % (1000000 / HZ));
899+
delta_tsc_khz = (deltatsc * HZ) / (1000 * LAPIC_CAL_LOOPS);
900+
901+
apic_pr_verbose("..... CPU clock speed is %ld.%03ld MHz.\n",
902+
delta_tsc_khz / 1000, delta_tsc_khz % 1000);
900903
}
901904

902-
apic_pr_verbose("..... host bus clock speed is %u.%04u MHz.\n",
903-
lapic_timer_period / (1000000 / HZ),
904-
lapic_timer_period % (1000000 / HZ));
905+
bus_khz = (long)lapic_timer_period * HZ / 1000;
906+
apic_pr_verbose("..... host bus clock speed is %ld.%03ld MHz.\n",
907+
bus_khz / 1000, bus_khz % 1000);
905908

906909
/*
907910
* Do a sanity check on the APIC calibration result

arch/x86/kernel/apic/io_apic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,7 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
28642864

28652865
ioapic = mp_irqdomain_ioapic_idx(domain);
28662866
pin = info->ioapic.pin;
2867-
if (irq_find_mapping(domain, (irq_hw_number_t)pin) > 0)
2867+
if (irq_resolve_mapping(domain, (irq_hw_number_t)pin))
28682868
return -EEXIST;
28692869

28702870
data = kzalloc(sizeof(*data), GFP_KERNEL);

0 commit comments

Comments
 (0)