[bug report] soc: xilinx: Fix for call trace due to the usage of smp_processor_id()

Dan Carpenter dan.carpenter at linaro.org
Thu Feb 1 04:20:04 PST 2024


Hello HariBabu Gattem,

The patch daed80ed0758: "soc: xilinx: Fix for call trace due to the
usage of smp_processor_id()" from Oct 26, 2023 (linux-next), leads to
the following Smatch static checker warning:

	kernel/irq/manage.c:2614 __request_percpu_irq()
	warn: sleeping in atomic context

drivers/soc/xilinx/xlnx_event_manager.c
   610          cpu = get_cpu();
                ^^^^^^^^^^^^^^^
The patch adds get_cpu() which disables preemption.

   611          per_cpu(cpu_number1, cpu) = cpu;
   612          ret = request_percpu_irq(virq_sgi, xlnx_event_handler, "xlnx_event_mgmt",
                      ^^^^^^^^^^^^^^^^^^
request_percpu_irq() does a sleeping allocation so it's a sleeping in
atomic bug.

   613                                   &cpu_number1);
   614          put_cpu();

regards,
dan carpenter



More information about the linux-arm-kernel mailing list