tree:
https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git habanalabs-next
head: f3fad4c1da9034b716430407921cbd316d8c76dd
commit: a260a3d5bfbee39ef056d45a6c1edd734b6fa375 [10/62] habanalabs: sync stream refactor
functions
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/...
git remote add ogabbay
https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
git fetch --no-tags ogabbay habanalabs-next
git checkout a260a3d5bfbee39ef056d45a6c1edd734b6fa375
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/misc/habanalabs/common/command_submission.c: In function
'cs_ioctl_signal_wait':
> drivers/misc/habanalabs/common/command_submission.c:904:32:
warning: variable 'cntr' set but not used [-Wunused-but-set-variable]
904 | struct hl_cs_counters_atomic *cntr;
| ^~~~
vim +/cntr +904 drivers/misc/habanalabs/common/command_submission.c
894
895 static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
896 void __user *chunks, u32 num_chunks,
897 u64 *cs_seq)
898 {
899 struct hl_device *hdev = hpriv->hdev;
900 struct hl_ctx *ctx = hpriv->ctx;
901 struct hl_cs_chunk *cs_chunk_array, *chunk;
902 struct hw_queue_properties *hw_queue_prop;
903 struct hl_fence *sig_fence = NULL;
904 struct hl_cs_counters_atomic *cntr;
905 struct
hl_cs_compl *sig_waitcs_cmpl;
906 struct hl_cs *cs;
907 enum hl_queue_type q_type;
908 u32 size_to_copy, q_idx;
909 u64 signal_seq;
910 int rc;
911
912 *cs_seq = ULLONG_MAX;
913 cntr = &hdev->aggregated_cs_counters;
914
915 if (num_chunks > HL_MAX_JOBS_PER_CS) {
916 dev_err(hdev->dev,
917 "Number of chunks can NOT be larger than %d\n",
918 HL_MAX_JOBS_PER_CS);
919 rc = -EINVAL;
920 goto out;
921 }
922
923 cs_chunk_array = kmalloc_array(num_chunks, sizeof(*cs_chunk_array),
924 GFP_ATOMIC);
925 if (!cs_chunk_array) {
926 rc = -ENOMEM;
927 goto out;
928 }
929
930 size_to_copy = num_chunks * sizeof(struct hl_cs_chunk);
931 if (copy_from_user(cs_chunk_array, chunks, size_to_copy)) {
932 dev_err(hdev->dev, "Failed to copy cs chunk array from user\n");
933 rc = -EFAULT;
934 goto free_cs_chunk_array;
935 }
936
937 /* currently it is guaranteed to have only one chunk */
938 chunk = &cs_chunk_array[0];
939
940 if (chunk->queue_index >= hdev->asic_prop.max_queues) {
941 dev_err(hdev->dev, "Queue index %d is invalid\n",
942 chunk->queue_index);
943 rc = -EINVAL;
944 goto free_cs_chunk_array;
945 }
946
947 q_idx = chunk->queue_index;
948 hw_queue_prop = &hdev->asic_prop.hw_queues_props[q_idx];
949 q_type = hw_queue_prop->type;
950
951 if ((q_idx >= hdev->asic_prop.max_queues) ||
952 (!hw_queue_prop->supports_sync_stream)) {
953 dev_err(hdev->dev, "Queue index %d is invalid\n", q_idx);
954 rc = -EINVAL;
955 goto free_cs_chunk_array;
956 }
957
958 if (cs_type == CS_TYPE_WAIT) {
959 rc = cs_ioctl_extract_signal_seq(hdev, chunk, &signal_seq);
960 if (rc)
961 goto free_cs_chunk_array;
962
963 sig_fence = hl_ctx_get_fence(ctx, signal_seq);
964 if (IS_ERR(sig_fence)) {
965 dev_err(hdev->dev,
966 "Failed to get signal CS with seq 0x%llx\n",
967 signal_seq);
968 rc = PTR_ERR(sig_fence);
969 goto free_cs_chunk_array;
970 }
971
972 if (!sig_fence) {
973 /* signal CS already finished */
974 rc = 0;
975 goto free_cs_chunk_array;
976 }
977
978 sig_waitcs_cmpl =
979 container_of(sig_fence, struct hl_cs_compl, base_fence);
980
981 if (sig_waitcs_cmpl->type != CS_TYPE_SIGNAL) {
982 dev_err(hdev->dev,
983 "CS seq 0x%llx is not of a signal CS\n",
984 signal_seq);
985 hl_fence_put(sig_fence);
986 rc = -EINVAL;
987 goto free_cs_chunk_array;
988 }
989
990 if (completion_done(&sig_fence->completion)) {
991 /* signal CS already finished */
992 hl_fence_put(sig_fence);
993 rc = 0;
994 goto free_cs_chunk_array;
995 }
996 }
997
998 /* increment refcnt for context */
999 hl_ctx_get(hdev, ctx);
1000
1001 rc = allocate_cs(hdev, ctx, cs_type, &cs);
1002 if (rc) {
1003 if (cs_type == CS_TYPE_WAIT)
1004 hl_fence_put(sig_fence);
1005 hl_ctx_put(ctx);
1006 goto free_cs_chunk_array;
1007 }
1008
1009 /*
1010 * Save the signal CS fence for later initialization right before
1011 * hanging the wait CS on the queue.
1012 */
1013 if (cs_type == CS_TYPE_WAIT)
1014 cs->signal_fence = sig_fence;
1015
1016 hl_debugfs_add_cs(cs);
1017
1018 *cs_seq = cs->sequence;
1019
1020 if (cs_type == CS_TYPE_WAIT || cs_type == CS_TYPE_SIGNAL)
1021 rc = cs_ioctl_signal_wait_create_jobs(hdev, ctx, cs, q_type,
1022 q_idx);
1023
1024 if (rc)
1025 goto put_cs;
1026
1027
1028 /* increment refcount as for external queues we get completion */
1029 cs_get(cs);
1030
1031 rc = hl_hw_queue_schedule_cs(cs);
1032 if (rc) {
1033 if (rc != -EAGAIN)
1034 dev_err(hdev->dev,
1035 "Failed to submit CS %d.%llu to H/W queues, error %d\n",
1036 ctx->asid, cs->sequence, rc);
1037 goto free_cs_object;
1038 }
1039
1040 rc = HL_CS_STATUS_SUCCESS;
1041 goto put_cs;
1042
1043 free_cs_object:
1044 cs_rollback(hdev, cs);
1045 *cs_seq = ULLONG_MAX;
1046 /* The path below is both for good and erroneous exits */
1047 put_cs:
1048 /* We finished with the CS in this function, so put the ref */
1049 cs_put(cs);
1050 free_cs_chunk_array:
1051 kfree(cs_chunk_array);
1052 out:
1053 return rc;
1054 }
1055
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org