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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello HariBabu Gattem,

Commit 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:1588 __setup_irq()
	warn: sleeping in atomic context

drivers/soc/xilinx/xlnx_event_manager.c
   608          virq_sgi = irq_create_fwspec_mapping(&sgi_fwspec);
   609  
   610          cpu = get_cpu();
                      ^^^^^^^^^
get_cpu() disables preemption

   611          per_cpu(cpu_number1, cpu) = cpu;
   612          ret = request_percpu_irq(virq_sgi, xlnx_event_handler, "xlnx_event_mgmt",
                      ^^^^^^^^^^^^^^^^^^
You can't call request_percpu_irq() with preempt disabled.  It does
sleeping allocations and it uses mutexes.  The way to test this at
runtime is to enable DEBUG_ATOMIC_SLEEP.

   613                                   &cpu_number1);
   614          put_cpu();
   615  
   616          WARN_ON(ret);

regards,
dan carpenter




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux