From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6531726169337570001==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [Intel-gfx] [PATCH 3/4] drm/i915/dgfx: OPROM OpRegion Setup Date: Mon, 07 Feb 2022 01:15:54 +0800 Message-ID: <202202070147.QgEDP0yH-lkp@intel.com> In-Reply-To: <20220206144311.5053-4-anshuman.gupta@intel.com> List-Id: --===============6531726169337570001== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Anshuman, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm-intel/for-linux-next] [also build test WARNING on drm-tip/drm-tip next-20220204] [cannot apply to v5.17-rc2] [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/Anshuman-Gupta/DGFX-OpRegi= on/20220206-224445 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: x86_64-randconfig-a011 (https://download.01.org/0day-ci/archive/202= 20207/202202070147.QgEDP0yH-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=3D1 build): # https://github.com/0day-ci/linux/commit/b59e40b3bc40920eaeeb84c7d= 36113202cb6dfae git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Anshuman-Gupta/DGFX-OpRegion/20220= 206-224445 git checkout b59e40b3bc40920eaeeb84c7d36113202cb6dfae # save the config file to linux build tree mkdir build_dir make W=3D1 O=3Dbuild_dir ARCH=3Dx86_64 SHELL=3D/bin/bash drivers/gp= u/drm/i915/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/gpu/drm/i915/display/intel_opregion.c:945: warning: This comment= starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc= -guide/kernel-doc.rst * intel_spi_get_oprom_opreg() get OPROM OpRegion image. drivers/gpu/drm/i915/display/intel_opregion.c:1599: warning: Function pa= rameter or member 'i915' not described in 'intel_opregion_init' vim +945 drivers/gpu/drm/i915/display/intel_opregion.c 943 = 944 /** > 945 * intel_spi_get_oprom_opreg() get OPROM OpRegion image. 946 * @i915: pointer to i915 device. 947 * 948 * This function parses the DGFX OPROM to retieve the opregion. 949 * OPROM has bundled multiple images but i915 only interested 950 * in CSS and opregion image. 951 * 952 * + DGFX OPROM IMAGE LAYOUT + 953 * +--------+-------+---------------------------+ 954 * | Offset | Value | ROM Header Fields +-----> Image1 (CSS) 955 * +--------------------------------------------+ 956 * | 0h | 55h | ROM Signature Byte1 | 957 * | 1h | AAh | ROM Signature Byte2 | 958 * | 2h | xx | Reserved | 959 * | 18+19h| xx | Ptr to PCI DataStructure | 960 * +----------------+---------------------------+ 961 * | PCI Data Structure | 962 * +--------------------------------------------+ 963 * | . . . | 964 * | . . . | 965 * | 10 + xx + Image Length | 966 * | 14 + xx + Code Type | 967 * | 15 + xx + Last Image Indicator | 968 * | . . . | 969 * +--------------------------------------------+ 970 * | Signature and Public Key | 971 * +--------+-------+---------------------------+ 972 * | . | . | . | 973 * | . | . | . | 974 * +--------------------------------------------+ 975 * | Offset | Value | ROM Header Fields +-----> Image2 (opre= gion, vbt) (Offset: 0x800) 976 * +--------------------------------------------+ 977 * | 0h | 55h | ROM Signature Byte1 | 978 * | 1h | AAh | ROM Signature Byte2 | 979 * | 2h | xx | Reserved | 980 * | 18+19h| xx | Ptr to PCI DataStructure | 981 * +----------------+---------------------------+ 982 * | PCI Data Structure | 983 * +--------------------------------------------+ 984 * | . . . | 985 * | . . . | 986 * | 10 + xx + Image Length | 987 * | 14 + xx + Code Type | 988 * | 15 + xx + Last Image Indicator | 989 * | . . . | 990 * | 1A + 3C + Ptr to Opregion Signature | 991 * | . . . | 992 * | . . . | 993 * | 83Ch + IntelGraphicsMem | <---+ Opregion Sig= nature 994 * +--------+-----------------------------------+ 995 * 996 * Return : Returns the opregion image blob which starts from opregi= on 997 * signature "IntelGraphicsMem". Error value in case of error 998 */ 999 static void * 1000 intel_spi_get_oprom_opreg(struct drm_i915_private *i915) 1001 { 1002 struct expansion_rom_header *exprom_hdr; 1003 struct pci_data_structure *exprom_pci_data; 1004 u8 img_sig[sizeof(OPREGION_SIGNATURE)]; 1005 u32 oprom_offset, offset; 1006 size_t img_len, opreg_len; 1007 void *opreg =3D ERR_PTR(-ENXIO); 1008 int ret; 1009 = 1010 oprom_offset =3D intel_spi_oprom_offset(i915); 1011 = 1012 exprom_hdr =3D kzalloc(sizeof(struct expansion_rom_header), GFP_KER= NEL); 1013 exprom_pci_data =3D kzalloc(sizeof(struct pci_data_structure), GFP_= KERNEL); 1014 if (!exprom_hdr || !exprom_pci_data) 1015 return ERR_PTR(-ENOMEM); 1016 = 1017 for (offset =3D oprom_offset; exprom_pci_data->last_img !=3D LAST_I= MG_INDICATOR; 1018 offset =3D offset + img_len) { 1019 intel_spi_read_oprom(i915, offset, sizeof(struct expansion_rom_hea= der), 1020 exprom_hdr); 1021 intel_spi_read_oprom(i915, offset + exprom_hdr->pcistructoffset, 1022 sizeof(struct pci_data_structure), exprom_pci_data); 1023 ret =3D pci_exp_rom_check_signature(i915, exprom_hdr, exprom_pci_d= ata); 1024 if (ret) { 1025 opreg =3D ERR_PTR(ret); 1026 goto err_free_hdr; 1027 } 1028 = 1029 img_len =3D exprom_pci_data->img_len * OPROM_BYTE_BOUNDARY; 1030 = 1031 /* CSS or OpReg signature is present at exprom_hdr->img_base offse= t */ 1032 intel_spi_read_oprom(i915, offset + exprom_hdr->img_base, 1033 sizeof(OPREGION_SIGNATURE) - 1, img_sig); 1034 = 1035 if (!memcmp(img_sig, INTEL_CSS_SIGNATURE, NUM_CSS_BYTES)) { 1036 ret =3D intel_verify_css(i915, exprom_hdr, exprom_pci_data); 1037 if (ret) { 1038 opreg =3D ERR_PTR(ret); 1039 goto err_free_hdr; 1040 } 1041 } else if (!memcmp(img_sig, OPREGION_SIGNATURE, sizeof(OPREGION_SI= GNATURE) - 1)) { 1042 opreg_len =3D img_len - exprom_hdr->img_base; 1043 opreg_len =3D ALIGN(opreg_len, 4); 1044 opreg =3D kzalloc(opreg_len, GFP_KERNEL); 1045 = 1046 if (!opreg) { 1047 opreg =3D ERR_PTR(-ENOMEM); 1048 goto err_free_hdr; 1049 } 1050 = 1051 intel_spi_read_oprom(i915, offset + exprom_hdr->img_base, 1052 opreg_len, opreg); 1053 drm_dbg_kms(&i915->drm, "Found opregion image of size %zu\n", opr= eg_len); 1054 break; 1055 } 1056 } 1057 = 1058 kfree(exprom_pci_data); 1059 kfree(exprom_hdr); 1060 = 1061 err_free_hdr: 1062 = 1063 return opreg; 1064 } 1065 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============6531726169337570001==--