[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202506281152.eY0YQpxs-lkp@intel.com>
Date: Sat, 28 Jun 2025 11:42:00 +0800
From: kernel test robot <lkp@...el.com>
To: Viken Dadhaniya <viken.dadhaniya@....qualcomm.com>,
andi.shyti@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, gregkh@...uxfoundation.org,
jirislaby@...nel.org, andersson@...nel.org, konradybcio@...nel.org,
johan+linaro@...nel.org, dianders@...omium.org, agross@...nel.org,
linux-arm-msm@...r.kernel.org, linux-i2c@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org, linux-spi@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev, mukesh.savaliya@....qualcomm.com,
quic_anupkulk@...cinc.com,
Viken Dadhaniya <viken.dadhaniya@....qualcomm.com>
Subject: Re: [PATCH v5 2/5] soc: qcom: geni-se: Add support to load QUP SE
Firmware via Linux subsystem
Hi Viken,
kernel test robot noticed the following build warnings:
[auto build test WARNING on andi-shyti/i2c/i2c-host]
[also build test WARNING on tty/tty-testing tty/tty-next tty/tty-linus broonie-spi/for-next linus/master v6.16-rc3 next-20250627]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Viken-Dadhaniya/dt-bindings-qcom-se-common-Add-QUP-Peripheral-specific-properties-for-I2C-SPI-and-SERIAL-bus/20250624-175308
base: https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git i2c/i2c-host
patch link: https://lore.kernel.org/r/20250624095102.1587580-3-viken.dadhaniya%40oss.qualcomm.com
patch subject: [PATCH v5 2/5] soc: qcom: geni-se: Add support to load QUP SE Firmware via Linux subsystem
config: alpha-randconfig-r122-20250628 (https://download.01.org/0day-ci/archive/20250628/202506281152.eY0YQpxs-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 14.3.0
reproduce: (https://download.01.org/0day-ci/archive/20250628/202506281152.eY0YQpxs-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506281152.eY0YQpxs-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/soc/qcom/qcom-geni-se.c:941:21: sparse: sparse: cast from restricted __le32
>> drivers/soc/qcom/qcom-geni-se.c:941:21: sparse: sparse: restricted __le32 degrades to integer
vim +941 drivers/soc/qcom/qcom-geni-se.c
891
892 /**
893 * geni_read_elf() - Read an ELF file.
894 * @se: Pointer to the SE resources structure.
895 * @fw: Pointer to the firmware buffer.
896 * @pelfseg: Pointer to the SE-specific ELF header.
897 *
898 * Read the ELF file and output a pointer to the header data, which
899 * contains the firmware data and any other details.
900 *
901 * Return: 0 if successful, otherwise return an error value.
902 */
903 static int geni_read_elf(struct geni_se *se, const struct firmware *fw, struct se_fw_hdr **pelfseg)
904 {
905 const struct elf32_hdr *ehdr;
906 struct elf32_phdr *phdrs, *phdr;
907 const struct se_fw_hdr *elfseg;
908 const u8 *addr;
909 int i;
910
911 if (!fw || fw->size < sizeof(struct elf32_hdr))
912 return -EINVAL;
913
914 ehdr = (struct elf32_hdr *)fw->data;
915 phdrs = (struct elf32_phdr *)(ehdr + 1);
916
917 if (ehdr->e_phnum < 2)
918 return -EINVAL;
919
920 for (i = 0; i < ehdr->e_phnum; i++) {
921 phdr = &phdrs[i];
922
923 if (fw->size < phdr->p_offset + phdr->p_filesz)
924 return -EINVAL;
925
926 if (phdr->p_type != PT_LOAD || !phdr->p_memsz)
927 continue;
928
929 if (MI_PBT_PAGE_MODE_VALUE(phdr->p_flags) != MI_PBT_NON_PAGED_SEGMENT ||
930 MI_PBT_SEGMENT_TYPE_VALUE(phdr->p_flags) == MI_PBT_HASH_SEGMENT ||
931 MI_PBT_ACCESS_TYPE_VALUE(phdr->p_flags) == MI_PBT_NOTUSED_SEGMENT ||
932 MI_PBT_ACCESS_TYPE_VALUE(phdr->p_flags) == MI_PBT_SHARED_SEGMENT)
933 continue;
934
935 if (phdr->p_filesz < sizeof(struct se_fw_hdr))
936 continue;
937
938 addr = fw->data + phdr->p_offset;
939 elfseg = (const struct se_fw_hdr *)addr;
940
> 941 if (cpu_to_le32(elfseg->magic) != MAGIC_NUM_SE || elfseg->version != 1)
942 continue;
943
944 if (phdr->p_filesz < elfseg->fw_offset +
945 elfseg->fw_size_in_items * sizeof(u32) ||
946 phdr->p_filesz < elfseg->cfg_idx_offset +
947 elfseg->cfg_size_in_items * sizeof(u8) ||
948 phdr->p_filesz < elfseg->cfg_val_offset +
949 elfseg->cfg_size_in_items * sizeof(u32))
950 continue;
951
952 if (elfseg->serial_protocol != se->protocol)
953 continue;
954
955 *pelfseg = (struct se_fw_hdr *)addr;
956 return 0;
957 }
958 return -EINVAL;
959 }
960
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists