XRT
XRT copied to clipboard
vmalloc called when in atomic
Bug reported by slab/slub memory checks:
BUG: sleeping function called from invalid context in_atomic() : 1, irqs_disabled() : 0, non_block: 0, xxxxxxxx ... vmalloc+xxxx zocl_read_sect+xxxx zocl_xclbin_read_axlf+xxxx zocl_read_axlf_ioctl+xxxxx
In functionzocl_xclbin_read_axlf, a call to zocl_read_sect is protected by the spinlock zdev->attr_rwlock while this function calls the vmalloc primitive, which one may block. This could lead to dead lock.
The call to zocl_xclbin_read_axlf is already synchronized by a mutex, is this spinlock necessary ?
I will take a look and come back. Thanks.