[PATCH] drm/amdgpu: Avoid printing of stack contents on firmware load error
kernel test robot
lkp at intel.com
Thu Jun 24 13:33:12 UTC 2021
Hi Jiri,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.13-rc7 next-20210624]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jiri-Kosina/drm-amdgpu-Avoid-printing-of-stack-contents-on-firmware-load-error/20210624-173740
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7426cedc7dad67bf3c71ea6cc29ab7822e1a453f
config: arm64-randconfig-r006-20210622 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 7c8a507272587f181ec29401453949ebcd8fec65)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/f9d4f2041c2724ff3c9126761199d37acede1187
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jiri-Kosina/drm-amdgpu-Avoid-printing-of-stack-contents-on-firmware-load-error/20210624-173740
git checkout f9d4f2041c2724ff3c9126761199d37acede1187
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/amd/amdgpu/psp_v12_0.c:111:1: warning: unused label 'out' [-Wunused-label]
out:
^~~~
1 warning generated.
vim +/out +111 drivers/gpu/drm/amd/amdgpu/psp_v12_0.c
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 47
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 48 static int psp_v12_0_init_microcode(struct psp_context *psp)
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 49 {
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 50 struct amdgpu_device *adev = psp->adev;
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 51 const char *chip_name;
6627d1c1a82ba7 Changfeng 2020-09-01 52 char fw_name[30];
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 53 int err = 0;
6627d1c1a82ba7 Changfeng 2020-09-01 54 const struct ta_firmware_header_v1_0 *ta_hdr;
6627d1c1a82ba7 Changfeng 2020-09-01 55 DRM_DEBUG("\n");
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 56
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 57 switch (adev->asic_type) {
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 58 case CHIP_RENOIR:
68697982204b21 Aaron Liu 2020-10-01 59 if (adev->apu_flags & AMD_APU_IS_RENOIR)
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 60 chip_name = "renoir";
68697982204b21 Aaron Liu 2020-10-01 61 else
68697982204b21 Aaron Liu 2020-10-01 62 chip_name = "green_sardine";
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 63 break;
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 64 default:
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 65 BUG();
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 66 }
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 67
f4503f9eb3a16c Hawking Zhang 2020-04-20 68 err = psp_init_asd_microcode(psp, chip_name);
6627d1c1a82ba7 Changfeng 2020-09-01 69 if (err)
f9d4f2041c2724 Jiri Kosina 2021-06-24 70 return err;
6627d1c1a82ba7 Changfeng 2020-09-01 71
6627d1c1a82ba7 Changfeng 2020-09-01 72 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
6627d1c1a82ba7 Changfeng 2020-09-01 73 err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
6627d1c1a82ba7 Changfeng 2020-09-01 74 if (err) {
6627d1c1a82ba7 Changfeng 2020-09-01 75 release_firmware(adev->psp.ta_fw);
6627d1c1a82ba7 Changfeng 2020-09-01 76 adev->psp.ta_fw = NULL;
6627d1c1a82ba7 Changfeng 2020-09-01 77 dev_info(adev->dev,
6627d1c1a82ba7 Changfeng 2020-09-01 78 "psp v12.0: Failed to load firmware \"%s\"\n",
6627d1c1a82ba7 Changfeng 2020-09-01 79 fw_name);
6627d1c1a82ba7 Changfeng 2020-09-01 80 } else {
6627d1c1a82ba7 Changfeng 2020-09-01 81 err = amdgpu_ucode_validate(adev->psp.ta_fw);
6627d1c1a82ba7 Changfeng 2020-09-01 82 if (err)
6627d1c1a82ba7 Changfeng 2020-09-01 83 goto out2;
6627d1c1a82ba7 Changfeng 2020-09-01 84
6627d1c1a82ba7 Changfeng 2020-09-01 85 ta_hdr = (const struct ta_firmware_header_v1_0 *)
6627d1c1a82ba7 Changfeng 2020-09-01 86 adev->psp.ta_fw->data;
6627d1c1a82ba7 Changfeng 2020-09-01 87 adev->psp.ta_hdcp_ucode_version =
6627d1c1a82ba7 Changfeng 2020-09-01 88 le32_to_cpu(ta_hdr->ta_hdcp_ucode_version);
6627d1c1a82ba7 Changfeng 2020-09-01 89 adev->psp.ta_hdcp_ucode_size =
6627d1c1a82ba7 Changfeng 2020-09-01 90 le32_to_cpu(ta_hdr->ta_hdcp_size_bytes);
6627d1c1a82ba7 Changfeng 2020-09-01 91 adev->psp.ta_hdcp_start_addr =
6627d1c1a82ba7 Changfeng 2020-09-01 92 (uint8_t *)ta_hdr +
6627d1c1a82ba7 Changfeng 2020-09-01 93 le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
6627d1c1a82ba7 Changfeng 2020-09-01 94
6627d1c1a82ba7 Changfeng 2020-09-01 95 adev->psp.ta_fw_version = le32_to_cpu(ta_hdr->header.ucode_version);
6627d1c1a82ba7 Changfeng 2020-09-01 96
6627d1c1a82ba7 Changfeng 2020-09-01 97 adev->psp.ta_dtm_ucode_version =
6627d1c1a82ba7 Changfeng 2020-09-01 98 le32_to_cpu(ta_hdr->ta_dtm_ucode_version);
6627d1c1a82ba7 Changfeng 2020-09-01 99 adev->psp.ta_dtm_ucode_size =
6627d1c1a82ba7 Changfeng 2020-09-01 100 le32_to_cpu(ta_hdr->ta_dtm_size_bytes);
6627d1c1a82ba7 Changfeng 2020-09-01 101 adev->psp.ta_dtm_start_addr =
6627d1c1a82ba7 Changfeng 2020-09-01 102 (uint8_t *)adev->psp.ta_hdcp_start_addr +
6627d1c1a82ba7 Changfeng 2020-09-01 103 le32_to_cpu(ta_hdr->ta_dtm_offset_bytes);
6627d1c1a82ba7 Changfeng 2020-09-01 104 }
6627d1c1a82ba7 Changfeng 2020-09-01 105
6627d1c1a82ba7 Changfeng 2020-09-01 106 return 0;
6627d1c1a82ba7 Changfeng 2020-09-01 107
6627d1c1a82ba7 Changfeng 2020-09-01 108 out2:
6627d1c1a82ba7 Changfeng 2020-09-01 109 release_firmware(adev->psp.ta_fw);
6627d1c1a82ba7 Changfeng 2020-09-01 110 adev->psp.ta_fw = NULL;
6627d1c1a82ba7 Changfeng 2020-09-01 @111 out:
6627d1c1a82ba7 Changfeng 2020-09-01 112 if (err) {
6627d1c1a82ba7 Changfeng 2020-09-01 113 dev_err(adev->dev,
6627d1c1a82ba7 Changfeng 2020-09-01 114 "psp v12.0: Failed to load firmware \"%s\"\n",
6627d1c1a82ba7 Changfeng 2020-09-01 115 fw_name);
6627d1c1a82ba7 Changfeng 2020-09-01 116 }
6627d1c1a82ba7 Changfeng 2020-09-01 117
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 118 return err;
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 119 }
6a7a0bdbfa0c24 Aaron Liu 2019-08-09 120
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36903 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210624/745866fe/attachment-0001.gz>
More information about the dri-devel
mailing list