Description of problem: 1. Issue 1 - batch related values for IAA are incorrect From Intel IAA spec [1], Intel IAA does not support batch processing. Two batch related default values for IAA are incorrect in current code: (1) The max batch size of device is set during device initialization, that indicates batch is supported. It should be always 0 on IAA. (2) The max batch size of work queue is set to WQ_DEFAULT_MAX_BATCH (32) as the default value regardless of Intel DSA or IAA device during work queue setup and cleanup. It should be always 0 on IAA. Fix the issues by setting the max batch size of device and max batch size of work queue to 0 on IAA device, that means batch is not supported. 2. Issue 2 - batch related sysfs attributes should be invisible In current code, dev.max_batch_size and wq.max_batch_size attributes in sysfs are exposed to user to show or update the values. From Intel IAA spec [1], Intel IAA does not support batch processing. So these sysfs attributes should not be supported on IAA device. Fix this issue by making the attributes of max_batch_size invisible in sysfs through is_visible() filter when the device is IAA. Version-Release number of selected component (if applicable): ANCK 5.10 Dev. How reproducible: Always. Steps to Reproduce: # modprobe idxd # cat /sys/bus/dsa/devices/dsa0/max_batch_size 1024 # cat /sys/bus/dsa/devices/dsa0/wq0.0/max_batch_size 32 # cat /sys/bus/dsa/devices/iax1/max_batch_size 1 # cat /sys/bus/dsa/devices/iax1/wq1.0/max_batch_size 32 Actual results: # cat /sys/bus/dsa/devices/iax1/max_batch_size 1 # cat /sys/bus/dsa/devices/iax1/wq1.0/max_batch_size 32 Expected results: These two sysfs attributes should be invisible: # cat /sys/bus/dsa/devices/iax1/max_batch_size # cat /sys/bus/dsa/devices/iax1/wq1.0/max_batch_size Additional info: This issue is reproducible in latest upstream kernel. So we need upstream fixing.
The patch submitted to LKML: https://lore.kernel.org/all/20220808031922.29751-1-xiaochen.shen@intel.com/ dmaengine maintainer requested to rebase on top of 'next' branch of https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git Rebase is working in progress. There will be no functional change.
The patch v2 submitted to LKML: https://lore.kernel.org/all/20220930201528.18621-1-xiaochen.shen@intel.com/
Link: https://gitee.com/anolis/cloud-kernel/pulls/754
Mark as FIXED because PR https://gitee.com/anolis/cloud-kernel/pulls/754 has been merged.