tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 5fcb9628fd1227a5f11d87171cb1b8b5c414d9d9
commit: 157e72e831cb8f323108b5df6d0b148aef9507fb [827/2089] drm/amdgpu: add sdma ip block
for sienna_cichlid (v5)
config: i386-randconfig-s001-20200617 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-rc1-6-g78f577f8-dirty
git checkout 157e72e831cb8f323108b5df6d0b148aef9507fb
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:140:53: sparse: sparse:
cast to restricted __le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:141:58: sparse:
sparse: cast to restricted __le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:153:33: sparse: sparse: cast to restricted
__le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:153:33: sparse: sparse: cast to restricted
__le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:153:33: sparse: sparse: cast to restricted
__le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:742:27: sparse: sparse: cast to restricted
__le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:746:33: sparse: sparse: cast to restricted
__le32
> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:833:28: sparse: sparse:
incorrect type in assignment (different base types) @@ expected unsigned int volatile
[usertype] @@ got restricted __le32 [usertype] @@
> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:833:28: sparse: expected unsigned int
volatile [usertype]
> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:833:28: sparse: got restricted __le32
[usertype]
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:851:23: sparse: sparse: cast to
restricted __le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:894:28: sparse: sparse: incorrect type in
assignment (different base types) @@ expected unsigned int volatile [usertype] @@
got restricted __le32 [usertype] @@
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:894:28: sparse: expected unsigned int
volatile [usertype]
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:894:28: sparse: got restricted __le32
[usertype]
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:926:15: sparse: sparse: cast to restricted
__le32
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:1322:21: sparse: sparse: cast to restricted
__le32
vim +140 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
96
97 /**
98 * sdma_v5_2_init_microcode - load ucode images from disk
99 *
100 * @adev: amdgpu_device pointer
101 *
102 * Use the firmware interface to load the ucode images into
103 * the driver (not loaded into hw).
104 * Returns 0 on success, error on failure.
105 */
106
107 // emulation only, won't work on real chip
108 // navi10 real chip need to use PSP to load firmware
109 static int sdma_v5_2_init_microcode(struct amdgpu_device *adev)
110 {
111 const char *chip_name;
112 char fw_name[40];
113 int err = 0, i;
114 struct amdgpu_firmware_info *info = NULL;
115 const struct common_firmware_header *header = NULL;
116 const struct sdma_firmware_header_v1_0 *hdr;
117
118 DRM_DEBUG("\n");
119
120 switch (adev->asic_type) {
121 case CHIP_SIENNA_CICHLID:
122 chip_name = "sienna_cichlid";
123 break;
124 default:
125 BUG();
126 }
127
128 for (i = 0; i < adev->sdma.num_instances; i++) {
129 if (i == 0)
130 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_sdma.bin", chip_name);
131 else
132 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_sdma%d.bin", chip_name,
i);
133 err = request_firmware(&adev->sdma.instance[i].fw, fw_name,
adev->dev);
134 if (err)
135 goto out;
136 err = amdgpu_ucode_validate(adev->sdma.instance[i].fw);
137 if (err)
138 goto out;
139 hdr = (const struct sdma_firmware_header_v1_0
*)adev->sdma.instance[i].fw->data;
140 adev->sdma.instance[i].fw_version =
le32_to_cpu(hdr->header.ucode_version);
141 adev->sdma.instance[i].feature_version =
le32_to_cpu(hdr->ucode_feature_version);
142 if (adev->sdma.instance[i].feature_version >= 20)
143 adev->sdma.instance[i].burst_nop = true;
144 DRM_DEBUG("psp_load == '%s'\n",
145 adev->firmware.load_type == AMDGPU_FW_LOAD_PSP ? "true" :
"false");
146
147 if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
148 info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i];
149 info->ucode_id = AMDGPU_UCODE_ID_SDMA0 + i;
150 info->fw = adev->sdma.instance[i].fw;
151 header = (const struct common_firmware_header *)info->fw->data;
152 adev->firmware.fw_size +=
153 ALIGN(le32_to_cpu(header->ucode_size_bytes), PAGE_SIZE);
154 }
155 }
156 out:
157 if (err) {
158 DRM_ERROR("sdma_v5_2: Failed to load firmware \"%s\"\n",
fw_name);
159 for (i = 0; i < adev->sdma.num_instances; i++) {
160 release_firmware(adev->sdma.instance[i].fw);
161 adev->sdma.instance[i].fw = NULL;
162 }
163 }
164 return err;
165 }
166
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org