Unverified Commit d30414e1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12299 v2 ACPI&PCI LTS patches 2024.10

Merge Pull Request from: @ci-robot 
 
PR sync from: Xiongfeng Wang <wangxiongfeng2@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/QVGQ6SW5LMAFO7S332ODM62KLXTF3WJW/ 
Haibo Xu (1):
  arm64: ACPI: NUMA: initialize all values of acpi_early_node_map to
    NUMA_NO_NODE

Jonathan Cameron (2):
  ACPI: processor: Return an error if acpi_processor_get_info() fails in
    processor_add()
  ACPI: processor: Fix memory leaks in error paths of processor_add()

Justin Stitt (2):
  ntp: Clamp maxerror and esterror to operating range
  ntp: Safeguard against time_constant overflow

Phil Chang (1):
  hrtimer: Prevent queuing of hrtimer without a function callback

Xiongfeng Wang (1):
  Revert "ntp: Avoid undefined behaviour in second_overflow()"

Zqiang (1):
  smp: Add missing destroy_work_on_stack() call in smp_call_on_cpu()


-- 
2.20.1
 
https://gitee.com/openeuler/kernel/issues/IAYQRI 
 
Link:https://gitee.com/openeuler/kernel/pulls/12299

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents edb6b9ec 6eefb2a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@

#include <asm/numa.h>

static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
static int acpi_early_node_map[NR_CPUS] __initdata = { [0 ... NR_CPUS - 1] = NUMA_NO_NODE };

int __init acpi_numa_get_nid(unsigned int cpu)
{
+8 −7
Original line number Diff line number Diff line
@@ -391,7 +391,7 @@ static int acpi_processor_add(struct acpi_device *device,

	result = acpi_processor_get_info(device);
	if (result) /* Processor is not physically present or unavailable */
		return 0;
		goto err_clear_driver_data;

	BUG_ON(pr->id >= nr_cpu_ids);

@@ -406,7 +406,7 @@ static int acpi_processor_add(struct acpi_device *device,
			"BIOS reported wrong ACPI id %d for the processor\n",
			pr->id);
		/* Give up, but do not abort the namespace scan. */
		goto err;
		goto err_clear_driver_data;
	}
	/*
	 * processor_device_array is not cleared on errors to allow buggy BIOS
@@ -418,12 +418,12 @@ static int acpi_processor_add(struct acpi_device *device,
	dev = get_cpu_device(pr->id);
	if (!dev) {
		result = -ENODEV;
		goto err;
		goto err_clear_per_cpu;
	}

	result = acpi_bind_one(dev, device);
	if (result)
		goto err;
		goto err_clear_per_cpu;

	pr->dev = dev;

@@ -434,10 +434,11 @@ static int acpi_processor_add(struct acpi_device *device,
	dev_err(dev, "Processor driver could not be attached\n");
	acpi_unbind_one(dev);

 err:
	free_cpumask_var(pr->throttling.shared_cpu_map);
	device->driver_data = NULL;
 err_clear_per_cpu:
	per_cpu(processors, pr->id) = NULL;
 err_clear_driver_data:
	device->driver_data = NULL;
	free_cpumask_var(pr->throttling.shared_cpu_map);
 err_free_pr:
	kfree(pr);
	return result;
+1 −0
Original line number Diff line number Diff line
@@ -791,6 +791,7 @@ int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys)

	queue_work_on(cpu, system_wq, &sscs.work);
	wait_for_completion(&sscs.done);
	destroy_work_on_stack(&sscs.work);

	return sscs.ret;
}
+2 −0
Original line number Diff line number Diff line
@@ -1171,6 +1171,8 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
	struct hrtimer_clock_base *base;
	unsigned long flags;

	if (WARN_ON_ONCE(!timer->function))
		return;
	/*
	 * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft
	 * match.
+4 −7
Original line number Diff line number Diff line
@@ -686,19 +686,16 @@ static inline void process_adjtimex_modes(const struct timex *txc, s32 *time_tai
	}

	if (txc->modes & ADJ_MAXERROR)
		time_maxerror = txc->maxerror;
	if (time_maxerror > NTP_PHASE_LIMIT)
		time_maxerror = NTP_PHASE_LIMIT;
		time_maxerror = clamp(txc->maxerror, (__kernel_long_t)0, (__kernel_long_t)NTP_PHASE_LIMIT);

	if (txc->modes & ADJ_ESTERROR)
		time_esterror = txc->esterror;
		time_esterror = clamp(txc->esterror, (__kernel_long_t)0, (__kernel_long_t)NTP_PHASE_LIMIT);

	if (txc->modes & ADJ_TIMECONST) {
		time_constant = txc->constant;
		time_constant = clamp(txc->constant, (__kernel_long_t)0, (__kernel_long_t)MAXTC);
		if (!(time_status & STA_NANO))
			time_constant += 4;
		time_constant = min(time_constant, (long)MAXTC);
		time_constant = max(time_constant, 0l);
		time_constant = clamp(time_constant, (long)0, (long)MAXTC);
	}

	if (txc->modes & ADJ_TAI &&