service_select_by_cpu() function in drivers/soc/fsl/dpio/dpio-service.c will cause calltrace when runs in preempt state

cancel
Showing results for 
Search instead for 
Did you mean: 

service_select_by_cpu() function in drivers/soc/fsl/dpio/dpio-service.c will cause calltrace when runs in preempt state

315 Views
hittzt
Contributor IV

Hi experts,

As stated in Subject, for DPAA2 devices, the service_select_by_cpu() function in drivers/soc/fsl/dpio/dpio-service.c file, will cause calltrace when runs in preempt state and enable CONFIG_DEBUG_PREEMPT. The calltrace as following on LX2160ardb Rev2.0 board: 

check_preemption_disabled: 2397 callbacks suppressed
BUG: using smp_processor_id() in preemptible [00000000] code: ifconfig/1938
caller is dpaa2_io_query_fq_count+0xd0/0x148
CPU: 6 PID: 1938 Comm: ifconfig Not tainted 5.2.50-yocto-standard #1
Hardware name: NXP Layerscape LX2160ARDB (DT)
Call trace:
dump_backtrace+0x0/0x140
show_stack+0x24/0x30
dump_stack+0xc4/0x10c
debug_smp_processor_id+0x134/0x138
dpaa2_io_query_fq_count+0xd0/0x148
dpaa2_eth_stop+0xc4/0x1a8
__dev_close_many+0xac/0x130
__dev_change_flags+0xb4/0x1c0
dev_change_flags+0x3c/0x78
devinet_ioctl+0x664/0x738
inet_ioctl+0x250/0x2a0
sock_do_ioctl+0x54/0x200
sock_ioctl+0x204/0x478
do_vfs_ioctl+0x640/0x8a8
ksys_ioctl+0x84/0xb8
__arm64_sys_ioctl+0x28/0x38
el0_svc_common.constprop.0+0x78/0x190
el0_svc_handler+0x70/0x90
el0_svc+0x8/0xc

 

This is because when the CONFIG_DEBUG_PREEMPT enabled, smp_processor_id will be set to debug_smp_processor_id(), which will check wether in preemptable environment of current task.

I want to query if this issue will be fixed in future or not?

Thanks,

Zhantao

0 Kudos
3 Replies

253 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Zhantao,

Which version LSDK do you use?

What application is running on the target board to trigger this cause trace exception?

Would you please provide the whole console log on your target board?

Thanks,

Yiping

0 Kudos

253 Views
hittzt
Contributor IV

Hi Yiping,

Sorry for late reply.

Actually, this issue is not so complicated.

It is not triggered by applications, it is triggered by the enable of CONFIG_DEBUG_PREEMPT.

When the config CONFIG_DEBUG_PREEMPT enabled in kernel config, the calltrace will show as users to use the dpaa2 ethernet ports.

I find it in LSDK20.04, but I think it is a generic issue.

The followings give the relation of function trace. 

dpaa2_io_query_fq_count()

   -->service_select() (inline func)

      -->service_select_by_cpu() (inline func)

         -->smp_processor_id() ( == debug_smp_processor_id when CONFIG_DEBUG_PREEMPT enabled)

debug_smp_processor_id() will check wether in preemptable environment for current task, if it is preemptable, 

the calltrace will show.

Thanks,

Zhantao

0 Kudos

253 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Zhantao,

In LSDK 20.04, a separate branch “linux-4.19-rt” of Linux kernel is used for PREEMP RT, and PREEMP_RT patches have been applied in this kernel branch.

Thanks,

Yiping

0 Kudos