drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: sparse: incorrect type in initializer (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 136057256686de39cc3a07c2e39ef6bc43003ff6
commit: 4c9398822106c366d88c8c68ddf44bd371d39961 PCI: qcom: Add support for configuring BDF to SID mapping for SM8250
date: 12 months ago
config: alpha-randconfig-s032-20211117 (attached as .config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4c9398822106c366d88c8c68ddf44bd371d39961
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha
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/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned short [usertype] bdf_be @@ got restricted __be16 [usertype] @@
drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: expected unsigned short [usertype] bdf_be
drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: got restricted __be16 [usertype]
vim +1305 drivers/pci/controller/dwc/pcie-qcom.c
1266
1267 static int qcom_pcie_config_sid_sm8250(struct qcom_pcie *pcie)
1268 {
1269 /* iommu map structure */
1270 struct {
1271 u32 bdf;
1272 u32 phandle;
1273 u32 smmu_sid;
1274 u32 smmu_sid_len;
1275 } *map;
1276 void __iomem *bdf_to_sid_base = pcie->parf + PCIE20_PARF_BDF_TO_SID_TABLE_N;
1277 struct device *dev = pcie->pci->dev;
1278 u8 qcom_pcie_crc8_table[CRC8_TABLE_SIZE];
1279 int i, nr_map, size = 0;
1280 u32 smmu_sid_base;
1281
1282 of_get_property(dev->of_node, "iommu-map", &size);
1283 if (!size)
1284 return 0;
1285
1286 map = kzalloc(size, GFP_KERNEL);
1287 if (!map)
1288 return -ENOMEM;
1289
1290 of_property_read_u32_array(dev->of_node,
1291 "iommu-map", (u32 *)map, size / sizeof(u32));
1292
1293 nr_map = size / (sizeof(*map));
1294
1295 crc8_populate_msb(qcom_pcie_crc8_table, QCOM_PCIE_CRC8_POLYNOMIAL);
1296
1297 /* Registers need to be zero out first */
1298 memset_io(bdf_to_sid_base, 0, CRC8_TABLE_SIZE * sizeof(u32));
1299
1300 /* Extract the SMMU SID base from the first entry of iommu-map */
1301 smmu_sid_base = map[0].smmu_sid;
1302
1303 /* Look for an available entry to hold the mapping */
1304 for (i = 0; i < nr_map; i++) {
> 1305 u16 bdf_be = cpu_to_be16(map[i].bdf);
1306 u32 val;
1307 u8 hash;
1308
1309 hash = crc8(qcom_pcie_crc8_table, (u8 *)&bdf_be, sizeof(bdf_be),
1310 0);
1311
1312 val = readl(bdf_to_sid_base + hash * sizeof(u32));
1313
1314 /* If the register is already populated, look for next available entry */
1315 while (val) {
1316 u8 current_hash = hash++;
1317 u8 next_mask = 0xff;
1318
1319 /* If NEXT field is NULL then update it with next hash */
1320 if (!(val & next_mask)) {
1321 val |= (u32)hash;
1322 writel(val, bdf_to_sid_base + current_hash * sizeof(u32));
1323 }
1324
1325 val = readl(bdf_to_sid_base + hash * sizeof(u32));
1326 }
1327
1328 /* BDF [31:16] | SID [15:8] | NEXT [7:0] */
1329 val = map[i].bdf << 16 | (map[i].smmu_sid - smmu_sid_base) << 8 | 0;
1330 writel(val, bdf_to_sid_base + hash * sizeof(u32));
1331 }
1332
1333 kfree(map);
1334
1335 return 0;
1336 }
1337
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[android-common:android-4.14-stable 21099/25402] gcc-7: error: unrecognized command line option '-ftrivial-auto-var-init=pattern'
by kernel test robot
tree: https://android.googlesource.com/kernel/common android-4.14-stable
head: 29af89acb271ea6d4e0094e84d6fc54b14b3482b
commit: a7eda6eddca559c1c3a897a35692f9d49d46c9dd [21099/25402] BACKPORT: security: allow using Clang's zero initialization for stack variables
config: i386-randconfig-a001-20211122 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android-4.14-stable
git checkout a7eda6eddca559c1c3a897a35692f9d49d46c9dd
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 prepare
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> gcc-7: error: unrecognized command line option '-ftrivial-auto-var-init=pattern'
make[2]: *** [./Kbuild:22: kernel/bounds.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1214: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:146: sub-make] Error 2
make: Target 'prepare' not remade because of errors.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[android-common:android-4.14-stable 18176/25402] drivers/scsi/ufs/ufshcd-crypto.c:250:26: warning: no previous declaration for 'ufshcd_blk_crypto_mode_num_for_alg_dusize'
by kernel test robot
tree: https://android.googlesource.com/kernel/common android-4.14-stable
head: 29af89acb271ea6d4e0094e84d6fc54b14b3482b
commit: e12563c18d484e6379d03105b4565db7bb3a7975 [18176/25402] BACKPORT: FROMLIST: Update Inline Encryption from v5 to v6 of patch series
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android-4.14-stable
git checkout e12563c18d484e6379d03105b4565db7bb3a7975
# save the attached .config to linux build tree
make W=1 ARCH=i386
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/scsi/ufs/ufshcd-crypto.c:250:26: warning: no previous declaration for 'ufshcd_blk_crypto_mode_num_for_alg_dusize' [-Wmissing-declarations]
enum blk_crypto_mode_num ufshcd_blk_crypto_mode_num_for_alg_dusize(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/ufshcd_blk_crypto_mode_num_for_alg_dusize +250 drivers/scsi/ufs/ufshcd-crypto.c
249
> 250 enum blk_crypto_mode_num ufshcd_blk_crypto_mode_num_for_alg_dusize(
251 enum ufs_crypto_alg ufs_crypto_alg,
252 enum ufs_crypto_key_size key_size)
253 {
254 /*
255 * This is currently the only mode that UFS and blk-crypto both support.
256 */
257 if (ufs_crypto_alg == UFS_CRYPTO_ALG_AES_XTS &&
258 key_size == UFS_CRYPTO_KEY_SIZE_256)
259 return BLK_ENCRYPTION_MODE_AES_256_XTS;
260
261 return BLK_ENCRYPTION_MODE_INVALID;
262 }
263
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
include/asm-generic/io.h:291:22: sparse: sparse: incorrect type in argument 1 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 136057256686de39cc3a07c2e39ef6bc43003ff6
commit: 6e1e90ec027509a7e8d4efbd77a65b32b5a8b3ec regmap: mmio: add config option to allow relaxed MMIO accesses
date: 1 year, 1 month ago
config: h8300-randconfig-s031-20211117 (attached as .config)
compiler: h8300-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6e1e90ec027509a7e8d4efbd77a65b32b5a8b3ec
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=h8300
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/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:32:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:32:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:38:11: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
>> include/asm-generic/io.h:291:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] b @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:291:22: sparse: expected unsigned short [usertype] b
include/asm-generic/io.h:291:22: sparse: got restricted __le16 [usertype]
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:38:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:38:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] b @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] b
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:14:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:14:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
vim +291 include/asm-generic/io.h
9439eb3ab9d1ec Will Deacon 2013-09-03 286
9439eb3ab9d1ec Will Deacon 2013-09-03 287 #ifndef writew_relaxed
a71e7c44ffb7ba Sinan Kaya 2018-04-06 288 #define writew_relaxed writew_relaxed
a71e7c44ffb7ba Sinan Kaya 2018-04-06 289 static inline void writew_relaxed(u16 value, volatile void __iomem *addr)
a71e7c44ffb7ba Sinan Kaya 2018-04-06 290 {
a71e7c44ffb7ba Sinan Kaya 2018-04-06 @291 __raw_writew(cpu_to_le16(value), addr);
a71e7c44ffb7ba Sinan Kaya 2018-04-06 292 }
9439eb3ab9d1ec Will Deacon 2013-09-03 293 #endif
9439eb3ab9d1ec Will Deacon 2013-09-03 294
:::::: The code at line 291 was first introduced by commit
:::::: a71e7c44ffb7baea0c0795824afc34cc0bc1a301 io: change writeX_relaxed() to remove barriers
:::::: TO: Sinan Kaya <okaya(a)codeaurora.org>
:::::: CC: Arnd Bergmann <arnd(a)arndb.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[agd5f:drm-next 85/124] drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:64:18: warning: variable 'ecc_err_cnt' set but not used
by kernel test robot
tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next
head: 7890b8e78e6987fe59b5df0f3797e81f30131a61
commit: 8882f90a3fe2457c8b3f86bbbbef8754f704f5ef [85/124] drm/amdgpu: add new query interface for umc block v2
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.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
git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f drm-next
git checkout 8882f90a3fe2457c8b3f86bbbbef8754f704f5ef
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc
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/gpu/drm/amd/amdgpu/umc_v6_7.c: In function 'umc_v6_7_ecc_info_query_correctable_error_count':
>> drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:64:18: warning: variable 'ecc_err_cnt' set but not used [-Wunused-but-set-variable]
64 | uint32_t ecc_err_cnt;
| ^~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c: In function 'umc_v6_7_ecc_info_query_ras_error_count':
>> drivers/gpu/drm/amd/amdgpu/umc_v6_7.c:113:18: warning: variable 'umc_reg_offset' set but not used [-Wunused-but-set-variable]
113 | uint32_t umc_reg_offset = 0;
| ^~~~~~~~~~~~~~
vim +/ecc_err_cnt +64 drivers/gpu/drm/amd/amdgpu/umc_v6_7.c
59
60 static void umc_v6_7_ecc_info_query_correctable_error_count(struct amdgpu_device *adev,
61 uint32_t channel_index,
62 unsigned long *error_count)
63 {
> 64 uint32_t ecc_err_cnt;
65 uint64_t mc_umc_status;
66 struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
67
68 /*
69 * select the lower chip and check the error count
70 * skip add error count, calc error counter only from mca_umc_status
71 */
72 ecc_err_cnt = ras->umc_ecc.ecc[channel_index].ce_count_lo_chip;
73
74 /*
75 * select the higher chip and check the err counter
76 * skip add error count, calc error counter only from mca_umc_status
77 */
78 ecc_err_cnt = ras->umc_ecc.ecc[channel_index].ce_count_hi_chip;
79
80 /* check for SRAM correctable error
81 MCUMC_STATUS is a 64 bit register */
82 mc_umc_status = ras->umc_ecc.ecc[channel_index].mca_umc_status;
83 if (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1 &&
84 REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, CECC) == 1)
85 *error_count += 1;
86 }
87
88 static void umc_v6_7_ecc_info_querry_uncorrectable_error_count(struct amdgpu_device *adev,
89 uint32_t channel_index,
90 unsigned long *error_count)
91 {
92 uint64_t mc_umc_status;
93 struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
94
95 /* check the MCUMC_STATUS */
96 mc_umc_status = ras->umc_ecc.ecc[channel_index].mca_umc_status;
97 if ((REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1) &&
98 (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Deferred) == 1 ||
99 REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, UECC) == 1 ||
100 REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, PCC) == 1 ||
101 REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, UC) == 1 ||
102 REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, TCC) == 1))
103 *error_count += 1;
104 }
105
106 static void umc_v6_7_ecc_info_query_ras_error_count(struct amdgpu_device *adev,
107 void *ras_error_status)
108 {
109 struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
110
111 uint32_t umc_inst = 0;
112 uint32_t ch_inst = 0;
> 113 uint32_t umc_reg_offset = 0;
114 uint32_t channel_index = 0;
115
116 /*TODO: driver needs to toggle DF Cstate to ensure
117 * safe access of UMC registers. Will add the protection */
118 LOOP_UMC_INST_AND_CH(umc_inst, ch_inst) {
119 umc_reg_offset = get_umc_v6_7_reg_offset(adev,
120 umc_inst,
121 ch_inst);
122 channel_index = get_umc_v6_7_channel_index(adev,
123 umc_inst,
124 ch_inst);
125 umc_v6_7_ecc_info_query_correctable_error_count(adev,
126 channel_index,
127 &(err_data->ce_count));
128 umc_v6_7_ecc_info_querry_uncorrectable_error_count(adev,
129 channel_index,
130 &(err_data->ue_count));
131 }
132 }
133
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months