drivers/scsi/smartpqi/smartpqi_init.c:2070 pqi_update_scsi_devices() error: we previously assumed 'physdev_list' could be null (see line 2006)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
commit: 5e6a9760f7da4dd86cca43ac6423695d6cb0dff4 scsi: smartpqi: add module param for exposure order
date: 12 months ago
config: ia64-randconfig-m031-20200811 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
drivers/scsi/smartpqi/smartpqi_init.c:2070 pqi_update_scsi_devices() error: we previously assumed 'physdev_list' could be null (see line 2006)
Old smatch warnings:
drivers/scsi/smartpqi/smartpqi_init.c:2077 pqi_update_scsi_devices() error: we previously assumed 'logdev_list' could be null (see line 2013)
drivers/scsi/smartpqi/smartpqi_init.c:2134 pqi_update_scsi_devices() warn: inconsistent indenting
drivers/scsi/smartpqi/smartpqi_init.c:6995 pqi_ctrl_init() warn: impossible condition '(ctrl_info->max_outstanding_requests > (~0)) => (0-u32max > u32max)'
vim +/physdev_list +2070 drivers/scsi/smartpqi/smartpqi_init.c
1977
1978 static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info)
1979 {
1980 int i;
1981 int rc;
1982 LIST_HEAD(new_device_list_head);
1983 struct report_phys_lun_extended *physdev_list = NULL;
1984 struct report_log_lun_extended *logdev_list = NULL;
1985 struct report_phys_lun_extended_entry *phys_lun_ext_entry;
1986 struct report_log_lun_extended_entry *log_lun_ext_entry;
1987 struct bmic_identify_physical_device *id_phys = NULL;
1988 u32 num_physicals;
1989 u32 num_logicals;
1990 struct pqi_scsi_dev **new_device_list = NULL;
1991 struct pqi_scsi_dev *device;
1992 struct pqi_scsi_dev *next;
1993 unsigned int num_new_devices;
1994 unsigned int num_valid_devices;
1995 bool is_physical_device;
1996 u8 *scsi3addr;
1997 unsigned int physical_index;
1998 unsigned int logical_index;
1999 static char *out_of_memory_msg =
2000 "failed to allocate memory, device discovery stopped";
2001
2002 rc = pqi_get_device_lists(ctrl_info, &physdev_list, &logdev_list);
2003 if (rc)
2004 goto out;
2005
> 2006 if (physdev_list)
2007 num_physicals =
2008 get_unaligned_be32(&physdev_list->header.list_length)
2009 / sizeof(physdev_list->lun_entries[0]);
2010 else
2011 num_physicals = 0;
2012
2013 if (logdev_list)
2014 num_logicals =
2015 get_unaligned_be32(&logdev_list->header.list_length)
2016 / sizeof(logdev_list->lun_entries[0]);
2017 else
2018 num_logicals = 0;
2019
2020 if (num_physicals) {
2021 /*
2022 * We need this buffer for calls to pqi_get_physical_disk_info()
2023 * below. We allocate it here instead of inside
2024 * pqi_get_physical_disk_info() because it's a fairly large
2025 * buffer.
2026 */
2027 id_phys = kmalloc(sizeof(*id_phys), GFP_KERNEL);
2028 if (!id_phys) {
2029 dev_warn(&ctrl_info->pci_dev->dev, "%s\n",
2030 out_of_memory_msg);
2031 rc = -ENOMEM;
2032 goto out;
2033 }
2034 }
2035
2036 num_new_devices = num_physicals + num_logicals;
2037
2038 new_device_list = kmalloc_array(num_new_devices,
2039 sizeof(*new_device_list),
2040 GFP_KERNEL);
2041 if (!new_device_list) {
2042 dev_warn(&ctrl_info->pci_dev->dev, "%s\n", out_of_memory_msg);
2043 rc = -ENOMEM;
2044 goto out;
2045 }
2046
2047 for (i = 0; i < num_new_devices; i++) {
2048 device = kzalloc(sizeof(*device), GFP_KERNEL);
2049 if (!device) {
2050 dev_warn(&ctrl_info->pci_dev->dev, "%s\n",
2051 out_of_memory_msg);
2052 rc = -ENOMEM;
2053 goto out;
2054 }
2055 list_add_tail(&device->new_device_list_entry,
2056 &new_device_list_head);
2057 }
2058
2059 device = NULL;
2060 num_valid_devices = 0;
2061 physical_index = 0;
2062 logical_index = 0;
2063
2064 for (i = 0; i < num_new_devices; i++) {
2065
2066 if ((!pqi_expose_ld_first && i < num_physicals) ||
2067 (pqi_expose_ld_first && i >= num_logicals)) {
2068 is_physical_device = true;
2069 phys_lun_ext_entry =
> 2070 &physdev_list->lun_entries[physical_index++];
2071 log_lun_ext_entry = NULL;
2072 scsi3addr = phys_lun_ext_entry->lunid;
2073 } else {
2074 is_physical_device = false;
2075 phys_lun_ext_entry = NULL;
2076 log_lun_ext_entry =
2077 &logdev_list->lun_entries[logical_index++];
2078 scsi3addr = log_lun_ext_entry->lunid;
2079 }
2080
2081 if (is_physical_device && pqi_skip_device(scsi3addr))
2082 continue;
2083
2084 if (device)
2085 device = list_next_entry(device, new_device_list_entry);
2086 else
2087 device = list_first_entry(&new_device_list_head,
2088 struct pqi_scsi_dev, new_device_list_entry);
2089
2090 memcpy(device->scsi3addr, scsi3addr, sizeof(device->scsi3addr));
2091 device->is_physical_device = is_physical_device;
2092 if (is_physical_device) {
2093 if (phys_lun_ext_entry->device_type ==
2094 SA_EXPANDER_SMP_DEVICE)
2095 device->is_expander_smp_device = true;
2096 } else {
2097 device->is_external_raid_device =
2098 pqi_is_external_raid_addr(scsi3addr);
2099 }
2100
2101 /* Gather information about the device. */
2102 rc = pqi_get_device_info(ctrl_info, device);
2103 if (rc == -ENOMEM) {
2104 dev_warn(&ctrl_info->pci_dev->dev, "%s\n",
2105 out_of_memory_msg);
2106 goto out;
2107 }
2108 if (rc) {
2109 if (device->is_physical_device)
2110 dev_warn(&ctrl_info->pci_dev->dev,
2111 "obtaining device info failed, skipping physical device %016llx\n",
2112 get_unaligned_be64(
2113 &phys_lun_ext_entry->wwid));
2114 else
2115 dev_warn(&ctrl_info->pci_dev->dev,
2116 "obtaining device info failed, skipping logical device %08x%08x\n",
2117 *((u32 *)&device->scsi3addr),
2118 *((u32 *)&device->scsi3addr[4]));
2119 rc = 0;
2120 continue;
2121 }
2122
2123 if (!pqi_is_supported_device(device))
2124 continue;
2125
2126 pqi_assign_bus_target_lun(device);
2127
2128 if (device->is_physical_device) {
2129 device->wwid = phys_lun_ext_entry->wwid;
2130 if ((phys_lun_ext_entry->device_flags &
2131 REPORT_PHYS_LUN_DEV_FLAG_AIO_ENABLED) &&
2132 phys_lun_ext_entry->aio_handle) {
2133 device->aio_enabled = true;
2134 device->aio_handle =
2135 phys_lun_ext_entry->aio_handle;
2136 }
2137 if (device->devtype == TYPE_DISK ||
2138 device->devtype == TYPE_ZBC) {
2139 pqi_get_physical_disk_info(ctrl_info,
2140 device, id_phys);
2141 }
2142 } else {
2143 memcpy(device->volume_id, log_lun_ext_entry->volume_id,
2144 sizeof(device->volume_id));
2145 }
2146
2147 if (pqi_is_device_with_sas_address(device))
2148 device->sas_address = get_unaligned_be64(&device->wwid);
2149
2150 new_device_list[num_valid_devices++] = device;
2151 }
2152
2153 pqi_update_device_list(ctrl_info, new_device_list, num_valid_devices);
2154
2155 out:
2156 list_for_each_entry_safe(device, next, &new_device_list_head,
2157 new_device_list_entry) {
2158 if (device->keep_device)
2159 continue;
2160 list_del(&device->new_device_list_entry);
2161 pqi_free_device(device);
2162 }
2163
2164 kfree(new_device_list);
2165 kfree(physdev_list);
2166 kfree(logdev_list);
2167 kfree(id_phys);
2168
2169 return rc;
2170 }
2171
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/gpu/drm/amd/powerplay/smu_cmn.c:485:9: warning: Identical condition 'ret', second condition is always false
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
commit: caad2613dc4bd7396f1f0d32f5f0e650f9d8ebc4 drm/amd/powerplay: move table setting common code to smu_cmn.c
date: 3 weeks ago
compiler: alpha-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
In file included from drivers/gpu/drm/amd/amdgpu/../powerplay/smu_cmn.c:
>> drivers/gpu/drm/amd/powerplay/smu_cmn.c:485:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
return ret;
^
drivers/gpu/drm/amd/powerplay/smu_cmn.c:477:6: note: first condition
if (ret)
^
drivers/gpu/drm/amd/powerplay/smu_cmn.c:485:9: note: second condition
return ret;
^
>> drivers/gpu/drm/amd/powerplay/smu_cmn.c:336:11: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
size += sprintf(buf + size, "%02d. %-20s (%2d) : %sn",
^
vim +/ret +485 drivers/gpu/drm/amd/powerplay/smu_cmn.c
304
305 size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,
306 char *buf)
307 {
308 uint32_t feature_mask[2] = { 0 };
309 int32_t feature_index = 0;
310 uint32_t count = 0;
311 uint32_t sort_feature[SMU_FEATURE_COUNT];
312 uint64_t hw_feature_count = 0;
313 size_t size = 0;
314 int ret = 0, i;
315
316 ret = smu_cmn_get_enabled_mask(smu,
317 feature_mask,
318 2);
319 if (ret)
320 return 0;
321
322 size = sprintf(buf + size, "features high: 0x%08x low: 0x%08x\n",
323 feature_mask[1], feature_mask[0]);
324
325 for (i = 0; i < SMU_FEATURE_COUNT; i++) {
326 feature_index = smu_cmn_to_asic_specific_index(smu,
327 CMN2ASIC_MAPPING_FEATURE,
328 i);
329 if (feature_index < 0)
330 continue;
331 sort_feature[feature_index] = i;
332 hw_feature_count++;
333 }
334
335 for (i = 0; i < hw_feature_count; i++) {
> 336 size += sprintf(buf + size, "%02d. %-20s (%2d) : %s\n",
337 count++,
338 smu_get_feature_name(smu, sort_feature[i]),
339 i,
340 !!smu_cmn_feature_is_enabled(smu, sort_feature[i]) ?
341 "enabled" : "disabled");
342 }
343
344 return size;
345 }
346
347 int smu_cmn_set_pp_feature_mask(struct smu_context *smu,
348 uint64_t new_mask)
349 {
350 int ret = 0;
351 uint32_t feature_mask[2] = { 0 };
352 uint64_t feature_2_enabled = 0;
353 uint64_t feature_2_disabled = 0;
354 uint64_t feature_enables = 0;
355
356 ret = smu_cmn_get_enabled_mask(smu,
357 feature_mask,
358 2);
359 if (ret)
360 return ret;
361
362 feature_enables = ((uint64_t)feature_mask[1] << 32 |
363 (uint64_t)feature_mask[0]);
364
365 feature_2_enabled = ~feature_enables & new_mask;
366 feature_2_disabled = feature_enables & ~new_mask;
367
368 if (feature_2_enabled) {
369 ret = smu_cmn_feature_update_enable_state(smu,
370 feature_2_enabled,
371 true);
372 if (ret)
373 return ret;
374 }
375 if (feature_2_disabled) {
376 ret = smu_cmn_feature_update_enable_state(smu,
377 feature_2_disabled,
378 false);
379 if (ret)
380 return ret;
381 }
382
383 return ret;
384 }
385
386 int smu_cmn_disable_all_features_with_exception(struct smu_context *smu,
387 enum smu_feature_mask mask)
388 {
389 uint64_t features_to_disable = U64_MAX;
390 int skipped_feature_id;
391
392 skipped_feature_id = smu_cmn_to_asic_specific_index(smu,
393 CMN2ASIC_MAPPING_FEATURE,
394 mask);
395 if (skipped_feature_id < 0)
396 return -EINVAL;
397
398 features_to_disable &= ~(1ULL << skipped_feature_id);
399
400 return smu_cmn_feature_update_enable_state(smu,
401 features_to_disable,
402 0);
403 }
404
405 int smu_cmn_get_smc_version(struct smu_context *smu,
406 uint32_t *if_version,
407 uint32_t *smu_version)
408 {
409 int ret = 0;
410
411 if (!if_version && !smu_version)
412 return -EINVAL;
413
414 if (smu->smc_fw_if_version && smu->smc_fw_version)
415 {
416 if (if_version)
417 *if_version = smu->smc_fw_if_version;
418
419 if (smu_version)
420 *smu_version = smu->smc_fw_version;
421
422 return 0;
423 }
424
425 if (if_version) {
426 ret = smu_send_smc_msg(smu, SMU_MSG_GetDriverIfVersion, if_version);
427 if (ret)
428 return ret;
429
430 smu->smc_fw_if_version = *if_version;
431 }
432
433 if (smu_version) {
434 ret = smu_send_smc_msg(smu, SMU_MSG_GetSmuVersion, smu_version);
435 if (ret)
436 return ret;
437
438 smu->smc_fw_version = *smu_version;
439 }
440
441 return ret;
442 }
443
444 int smu_cmn_update_table(struct smu_context *smu,
445 enum smu_table_id table_index,
446 int argument,
447 void *table_data,
448 bool drv2smu)
449 {
450 struct smu_table_context *smu_table = &smu->smu_table;
451 struct amdgpu_device *adev = smu->adev;
452 struct smu_table *table = &smu_table->driver_table;
453 int table_id = smu_cmn_to_asic_specific_index(smu,
454 CMN2ASIC_MAPPING_TABLE,
455 table_index);
456 uint32_t table_size;
457 int ret = 0;
458 if (!table_data || table_id >= SMU_TABLE_COUNT || table_id < 0)
459 return -EINVAL;
460
461 table_size = smu_table->tables[table_index].size;
462
463 if (drv2smu) {
464 memcpy(table->cpu_addr, table_data, table_size);
465 /*
466 * Flush hdp cache: to guard the content seen by
467 * GPU is consitent with CPU.
468 */
469 amdgpu_asic_flush_hdp(adev, NULL);
470 }
471
472 ret = smu_send_smc_msg_with_param(smu, drv2smu ?
473 SMU_MSG_TransferTableDram2Smu :
474 SMU_MSG_TransferTableSmu2Dram,
475 table_id | ((argument & 0xFFFF) << 16),
476 NULL);
477 if (ret)
478 return ret;
479
480 if (!drv2smu) {
481 amdgpu_asic_flush_hdp(adev, NULL);
482 memcpy(table_data, table->cpu_addr, table_size);
483 }
484
> 485 return ret;
486 }
487
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/net/ethernet/netronome/nfp/devlink_param.c:101 nfp_devlink_param_u8_get() warn: potential spectre issue 'arg->hi_to_dl' (local cap)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
commit: ff04788c5b583d79c5c15e28c4ae7b876e69d00c nfp: devlink: add 'fw_load_policy' support
date: 11 months ago
config: ia64-randconfig-m031-20200811 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
drivers/net/ethernet/netronome/nfp/devlink_param.c:101 nfp_devlink_param_u8_get() warn: potential spectre issue 'arg->hi_to_dl' [r] (local cap)
vim +101 drivers/net/ethernet/netronome/nfp/devlink_param.c
56
57 static int
58 nfp_devlink_param_u8_get(struct devlink *devlink, u32 id,
59 struct devlink_param_gset_ctx *ctx)
60 {
61 const struct nfp_devlink_param_u8_arg *arg;
62 struct nfp_pf *pf = devlink_priv(devlink);
63 struct nfp_nsp *nsp;
64 char hwinfo[32];
65 long value;
66 int err;
67
68 if (id >= ARRAY_SIZE(nfp_devlink_u8_args))
69 return -EOPNOTSUPP;
70
71 arg = &nfp_devlink_u8_args[id];
72
73 nsp = nfp_nsp_open(pf->cpp);
74 if (IS_ERR(nsp)) {
75 err = PTR_ERR(nsp);
76 nfp_warn(pf->cpp, "can't access NSP: %d\n", err);
77 return err;
78 }
79
80 snprintf(hwinfo, sizeof(hwinfo), arg->hwinfo_name);
81 err = nfp_nsp_hwinfo_lookup_optional(nsp, hwinfo, sizeof(hwinfo),
82 arg->default_hi_val);
83 if (err) {
84 nfp_warn(pf->cpp, "HWinfo lookup failed: %d\n", err);
85 goto exit_close_nsp;
86 }
87
88 err = kstrtol(hwinfo, 0, &value);
89 if (err || value < 0 || value > arg->max_hi_val) {
90 nfp_warn(pf->cpp, "HWinfo '%s' value %li invalid\n",
91 arg->hwinfo_name, value);
92
93 if (arg->invalid_dl_val >= 0)
94 ctx->val.vu8 = arg->invalid_dl_val;
95 else
96 err = arg->invalid_dl_val;
97
98 goto exit_close_nsp;
99 }
100
> 101 ctx->val.vu8 = arg->hi_to_dl[value];
102
103 exit_close_nsp:
104 nfp_nsp_close(nsp);
105 return err;
106 }
107
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/rpmsg/qcom_glink_smem.c:93:48: sparse: sparse: incorrect type in argument 2 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 8 weeks ago
config: m68k-randconfig-s032-20200814 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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.2-168-g9554805c-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=m68k
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/rpmsg/qcom_glink_smem.c:93:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *src @@ got void * @@
>> drivers/rpmsg/qcom_glink_smem.c:93:48: sparse: expected void const volatile [noderef] __iomem *src
drivers/rpmsg/qcom_glink_smem.c:93:48: sparse: got void *
>> drivers/rpmsg/qcom_glink_smem.c:96:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *src @@ got void *fifo @@
drivers/rpmsg/qcom_glink_smem.c:96:47: sparse: expected void const volatile [noderef] __iomem *src
drivers/rpmsg/qcom_glink_smem.c:96:47: sparse: got void *fifo
--
drivers/ide/ide-io-std.c:185:25: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ide/ide-io-std.c:185:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned int volatile [noderef] [usertype] __iomem *port @@ got unsigned int [usertype] * @@
>> drivers/ide/ide-io-std.c:185:25: sparse: expected unsigned int volatile [noderef] [usertype] __iomem *port
drivers/ide/ide-io-std.c:185:25: sparse: got unsigned int [usertype] *
drivers/ide/ide-io-std.c:200:17: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/ide/ide-io-std.c:200:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned short volatile [noderef] [usertype] __iomem *port @@ got unsigned short [usertype] * @@
>> drivers/ide/ide-io-std.c:200:17: sparse: expected unsigned short volatile [noderef] [usertype] __iomem *port
drivers/ide/ide-io-std.c:200:17: sparse: got unsigned short [usertype] *
drivers/ide/ide-io-std.c:229:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ide/ide-io-std.c:229:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned int volatile [noderef] [usertype] __iomem *port @@ got unsigned int [usertype] * @@
drivers/ide/ide-io-std.c:229:25: sparse: expected unsigned int volatile [noderef] [usertype] __iomem *port
drivers/ide/ide-io-std.c:229:25: sparse: got unsigned int [usertype] *
drivers/ide/ide-io-std.c:244:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/ide/ide-io-std.c:244:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned short volatile [noderef] [usertype] __iomem *port @@ got unsigned short [usertype] * @@
drivers/ide/ide-io-std.c:244:17: sparse: expected unsigned short volatile [noderef] [usertype] __iomem *port
drivers/ide/ide-io-std.c:244:17: sparse: got unsigned short [usertype] *
--
>> drivers/ide/q40ide.c:79:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned short volatile [noderef] [usertype] __iomem *port @@ got unsigned short [usertype] * @@
>> drivers/ide/q40ide.c:79:17: sparse: expected unsigned short volatile [noderef] [usertype] __iomem *port
drivers/ide/q40ide.c:79:17: sparse: got unsigned short [usertype] *
drivers/ide/q40ide.c:83:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned short volatile [noderef] [usertype] __iomem *port @@ got unsigned short [usertype] * @@
drivers/ide/q40ide.c:83:25: sparse: expected unsigned short volatile [noderef] [usertype] __iomem *port
drivers/ide/q40ide.c:83:25: sparse: got unsigned short [usertype] *
drivers/ide/q40ide.c:92:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned short volatile [noderef] [usertype] __iomem *port @@ got unsigned short [usertype] * @@
drivers/ide/q40ide.c:92:17: sparse: expected unsigned short volatile [noderef] [usertype] __iomem *port
drivers/ide/q40ide.c:92:17: sparse: got unsigned short [usertype] *
drivers/ide/q40ide.c:96:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned short volatile [noderef] [usertype] __iomem *port @@ got unsigned short [usertype] * @@
drivers/ide/q40ide.c:96:26: sparse: expected unsigned short volatile [noderef] [usertype] __iomem *port
drivers/ide/q40ide.c:96:26: sparse: got unsigned short [usertype] *
vim +93 drivers/rpmsg/qcom_glink_smem.c
caf989c350e8e0b Bjorn Andersson 2017-08-24 78
caf989c350e8e0b Bjorn Andersson 2017-08-24 79 static void glink_smem_rx_peak(struct qcom_glink_pipe *np,
b88eee975a26b15 Bjorn Andersson 2017-08-24 80 void *data, unsigned int offset, size_t count)
caf989c350e8e0b Bjorn Andersson 2017-08-24 81 {
caf989c350e8e0b Bjorn Andersson 2017-08-24 82 struct glink_smem_pipe *pipe = to_smem_pipe(np);
caf989c350e8e0b Bjorn Andersson 2017-08-24 83 size_t len;
caf989c350e8e0b Bjorn Andersson 2017-08-24 84 u32 tail;
caf989c350e8e0b Bjorn Andersson 2017-08-24 85
caf989c350e8e0b Bjorn Andersson 2017-08-24 86 tail = le32_to_cpu(*pipe->tail);
b88eee975a26b15 Bjorn Andersson 2017-08-24 87 tail += offset;
b88eee975a26b15 Bjorn Andersson 2017-08-24 88 if (tail >= pipe->native.length)
b88eee975a26b15 Bjorn Andersson 2017-08-24 89 tail -= pipe->native.length;
caf989c350e8e0b Bjorn Andersson 2017-08-24 90
caf989c350e8e0b Bjorn Andersson 2017-08-24 91 len = min_t(size_t, count, pipe->native.length - tail);
928002a5e9dab2d Arun Kumar Neelakantam 2018-10-03 92 if (len)
928002a5e9dab2d Arun Kumar Neelakantam 2018-10-03 @93 memcpy_fromio(data, pipe->fifo + tail, len);
caf989c350e8e0b Bjorn Andersson 2017-08-24 94
928002a5e9dab2d Arun Kumar Neelakantam 2018-10-03 95 if (len != count)
928002a5e9dab2d Arun Kumar Neelakantam 2018-10-03 @96 memcpy_fromio(data + len, pipe->fifo, (count - len));
caf989c350e8e0b Bjorn Andersson 2017-08-24 97 }
caf989c350e8e0b Bjorn Andersson 2017-08-24 98
:::::: The code at line 93 was first introduced by commit
:::::: 928002a5e9dab2ddc1a0fe3e00739e89be30dc6b rpmsg: glink: smem: Support rx peak for size less than 4 bytes
:::::: TO: Arun Kumar Neelakantam <aneela(a)codeaurora.org>
:::::: CC: Bjorn Andersson <bjorn.andersson(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1555 dest_is_valid() error: we previously assumed 'dest' could be null (see line 1545)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
commit: ff189b43568216c6211e9e7ddd9026cb8295e744 net/mlx5: Add ignore level support fwd to table rules
date: 7 months ago
config: ia64-randconfig-m031-20200811 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1555 dest_is_valid() error: we previously assumed 'dest' could be null (see line 1545)
Old smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1818 _mlx5_add_flow_rules() error: double unlocked 'ft->node.lock' (orig line 1810)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1834 _mlx5_add_flow_rules() error: double unlocked 'ft->node.lock' (orig line 1810)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1840 _mlx5_add_flow_rules() error: double unlocked 'ft->node.lock' (orig line 1810)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1846 _mlx5_add_flow_rules() error: double unlocked 'ft->node.lock' (orig line 1810)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1859 _mlx5_add_flow_rules() error: double unlocked 'fte->node.lock' (orig line 1857)
vim +/dest +1555 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
1537
1538 static bool dest_is_valid(struct mlx5_flow_destination *dest,
1539 struct mlx5_flow_act *flow_act,
1540 struct mlx5_flow_table *ft)
1541 {
1542 bool ignore_level = flow_act->flags & FLOW_ACT_IGNORE_FLOW_LEVEL;
1543 u32 action = flow_act->action;
1544
> 1545 if (dest && (dest->type == MLX5_FLOW_DESTINATION_TYPE_COUNTER))
1546 return counter_is_valid(action);
1547
1548 if (!(action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST))
1549 return true;
1550
1551 if (ignore_level) {
1552 if (ft->type != FS_FT_FDB)
1553 return false;
1554
> 1555 if (dest->type == MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE &&
1556 dest->ft->type != FS_FT_FDB)
1557 return false;
1558 }
1559
1560 if (!dest || ((dest->type ==
1561 MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE) &&
1562 (dest->ft->level <= ft->level && !ignore_level)))
1563 return false;
1564 return true;
1565 }
1566
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH v2] mm: introduce reference pages
by kernel test robot
Hi Peter,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to mmotm/master hnaz-linux-mm/master arm64/for-next/core tip/x86/asm v5.8 next-20200813]
[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/Peter-Collingbourne/mm-introduce...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
config: x86_64-randconfig-a015-20200813 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 62ef1cb2079123b86878e4bfed3c14db448f1373)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from include/linux/crypto.h:20:
In file included from include/linux/slab.h:136:
In file included from include/linux/kasan.h:14:
>> include/linux/pgtable.h:1063:17: error: implicit declaration of function 'page_to_section' [-Werror,-Wimplicit-function-declaration]
return pfn == page_to_pfn((struct page *)vma->vm_private_data);
^
include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
#define page_to_pfn __page_to_pfn
^
include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
int __sec = page_to_section(__pg); \
^
include/linux/pgtable.h:1063:17: note: did you mean '__nr_to_section'?
include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
#define page_to_pfn __page_to_pfn
^
include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
int __sec = page_to_section(__pg); \
^
include/linux/mmzone.h:1220:35: note: '__nr_to_section' declared here
static inline struct mem_section *__nr_to_section(unsigned long nr)
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
>> include/linux/mm.h:1444:29: error: static declaration of 'page_to_section' follows non-static declaration
static inline unsigned long page_to_section(const struct page *page)
^
include/linux/pgtable.h:1063:17: note: previous implicit declaration is here
return pfn == page_to_pfn((struct page *)vma->vm_private_data);
^
include/asm-generic/memory_model.h:81:21: note: expanded from macro 'page_to_pfn'
#define page_to_pfn __page_to_pfn
^
include/asm-generic/memory_model.h:64:14: note: expanded from macro '__page_to_pfn'
int __sec = page_to_section(__pg); \
^
2 errors generated.
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1203: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:185: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +/page_to_section +1063 include/linux/pgtable.h
1056
1057 static inline int is_zero_or_refpage_pfn(struct vm_area_struct *vma,
1058 unsigned long pfn)
1059 {
1060 if (is_zero_pfn(pfn))
1061 return true;
1062 if (unlikely(!vma->vm_ops && vma->vm_private_data))
> 1063 return pfn == page_to_pfn((struct page *)vma->vm_private_data);
1064 return false;
1065 }
1066
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH v2] mm: introduce reference pages
by kernel test robot
Hi Peter,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to mmotm/master hnaz-linux-mm/master arm64/for-next/core tip/x86/asm v5.8 next-20200813]
[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/Peter-Collingbourne/mm-introduce...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
config: m68k-randconfig-r035-20200813 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
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 >>):
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from drivers/char/mem.c:12:
include/linux/pgtable.h: In function 'is_zero_or_refpage_pfn':
>> arch/m68k/include/asm/page_mm.h:165:23: error: implicit declaration of function 'page_to_nid'; did you mean 'zone_to_nid'? [-Werror=implicit-function-declaration]
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from drivers/char/mem.c:12:
include/linux/mm.h: At top level:
include/linux/mm.h:1283:19: error: static declaration of 'page_to_nid' follows non-static declaration
1283 | static inline int page_to_nid(const struct page *page)
| ^~~~~~~~~~~
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from drivers/char/mem.c:12:
arch/m68k/include/asm/page_mm.h:165:23: note: previous implicit declaration of 'page_to_nid' was here
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from include/asm-generic/bug.h:5,
from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from drivers/char/mem.c:12:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from drivers/char/mem.c:12:
drivers/char/mem.c: In function 'mmap_kmem':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
170 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
| ^~~~~~~~~~~~~~~
drivers/char/mem.c:430:7: note: in expansion of macro 'pfn_valid'
430 | if (!pfn_valid(pfn))
| ^~~~~~~~~
drivers/char/mem.c: In function 'read_kmem':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
drivers/char/mem.c:476:9: note: in expansion of macro 'virt_addr_valid'
476 | if (!virt_addr_valid(kbuf))
| ^~~~~~~~~~~~~~~
drivers/char/mem.c: In function 'do_write_kmem':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
drivers/char/mem.c:554:8: note: in expansion of macro 'virt_addr_valid'
554 | if (!virt_addr_valid(ptr))
| ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/rcupdate.h:25,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/utsname.h:6,
from drivers/char/random.c:312:
include/linux/pgtable.h: In function 'is_zero_or_refpage_pfn':
>> arch/m68k/include/asm/page_mm.h:165:23: error: implicit declaration of function 'page_to_nid'; did you mean 'zone_to_nid'? [-Werror=implicit-function-declaration]
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from include/linux/bvec.h:13,
from include/linux/blk_types.h:10,
from include/linux/genhd.h:19,
from drivers/char/random.c:323:
include/linux/mm.h: At top level:
include/linux/mm.h:1283:19: error: static declaration of 'page_to_nid' follows non-static declaration
1283 | static inline int page_to_nid(const struct page *page)
| ^~~~~~~~~~~
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/rcupdate.h:25,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/utsname.h:6,
from drivers/char/random.c:312:
arch/m68k/include/asm/page_mm.h:165:23: note: previous implicit declaration of 'page_to_nid' was here
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/rculist.h:10,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/utsname.h:6,
from drivers/char/random.c:312:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/char/random.c: At top level:
drivers/char/random.c:2297:6: warning: no previous prototype for 'add_hwgenerator_randomness' [-Wmissing-prototypes]
2297 | void add_hwgenerator_randomness(const char *buffer, size_t count,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/wait.h:9,
from include/linux/poll.h:8,
from drivers/char/tpm/tpm-chip.c:18:
include/linux/pgtable.h: In function 'is_zero_or_refpage_pfn':
>> arch/m68k/include/asm/page_mm.h:165:23: error: implicit declaration of function 'page_to_nid'; did you mean 'zone_to_nid'? [-Werror=implicit-function-declaration]
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from include/linux/highmem.h:8,
from include/linux/tpm.h:24,
from include/linux/tpm_eventlog.h:6,
from drivers/char/tpm/tpm-chip.c:24:
include/linux/mm.h: At top level:
include/linux/mm.h:1283:19: error: static declaration of 'page_to_nid' follows non-static declaration
1283 | static inline int page_to_nid(const struct page *page)
| ^~~~~~~~~~~
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/wait.h:9,
from include/linux/poll.h:8,
from drivers/char/tpm/tpm-chip.c:18:
arch/m68k/include/asm/page_mm.h:165:23: note: previous implicit declaration of 'page_to_nid' was here
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/wait.h:9,
from include/linux/poll.h:8,
from drivers/char/tpm/tpm-interface.c:22:
include/linux/pgtable.h: In function 'is_zero_or_refpage_pfn':
>> arch/m68k/include/asm/page_mm.h:165:23: error: implicit declaration of function 'page_to_nid'; did you mean 'zone_to_nid'? [-Werror=implicit-function-declaration]
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from include/linux/kallsyms.h:12,
from include/linux/bpf.h:21,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from drivers/char/tpm/tpm-interface.c:26:
include/linux/mm.h: At top level:
include/linux/mm.h:1283:19: error: static declaration of 'page_to_nid' follows non-static declaration
1283 | static inline int page_to_nid(const struct page *page)
| ^~~~~~~~~~~
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/wait.h:9,
from include/linux/poll.h:8,
from drivers/char/tpm/tpm-interface.c:22:
arch/m68k/include/asm/page_mm.h:165:23: note: previous implicit declaration of 'page_to_nid' was here
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from include/linux/poll.h:6,
from drivers/char/tpm/tpm-interface.c:22:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:16,
from drivers/char/tpm/st33zp24/i2c.c:7:
include/linux/pgtable.h: In function 'is_zero_or_refpage_pfn':
>> arch/m68k/include/asm/page_mm.h:165:23: error: implicit declaration of function 'page_to_nid'; did you mean 'zone_to_nid'? [-Werror=implicit-function-declaration]
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
In file included from include/linux/highmem.h:8,
from include/linux/tpm.h:24,
from drivers/char/tpm/st33zp24/i2c.c:14:
include/linux/mm.h: At top level:
include/linux/mm.h:1283:19: error: static declaration of 'page_to_nid' follows non-static declaration
1283 | static inline int page_to_nid(const struct page *page)
| ^~~~~~~~~~~
In file included from arch/m68k/include/asm/page.h:60,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:16,
from drivers/char/tpm/st33zp24/i2c.c:7:
arch/m68k/include/asm/page_mm.h:165:23: note: previous implicit declaration of 'page_to_nid' was here
165 | pgdat = &pg_data_map[page_to_nid(__p)]; \
| ^~~~~~~~~~~
include/linux/pgtable.h:1063:17: note: in expansion of macro 'page_to_pfn'
1063 | return pfn == page_to_pfn((struct page *)vma->vm_private_data);
| ^~~~~~~~~~~
drivers/char/tpm/st33zp24/i2c.c:291:36: warning: 'st33zp24_i2c_acpi_match' defined but not used [-Wunused-const-variable=]
291 | static const struct acpi_device_id st33zp24_i2c_acpi_match[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/char/tpm/st33zp24/i2c.c:285:34: warning: 'of_st33zp24_i2c_match' defined but not used [-Wunused-const-variable=]
285 | static const struct of_device_id of_st33zp24_i2c_match[] = {
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +165 arch/m68k/include/asm/page_mm.h
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 155
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 156 #define pfn_to_page(pfn) ({ \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 157 unsigned long __pfn = (pfn); \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 158 struct pglist_data *pgdat; \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 159 pgdat = __virt_to_node((unsigned long)pfn_to_virt(__pfn)); \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 160 pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 161 })
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 162 #define page_to_pfn(_page) ({ \
ba8f318471f66d5 arch/m68k/include/asm/page_mm.h Ian Campbell 2011-08-18 163 const struct page *__p = (_page); \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 164 struct pglist_data *pgdat; \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 @165 pgdat = &pg_data_map[page_to_nid(__p)]; \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 166 ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \
12d810c1b8c2b91 include/asm-m68k/page.h Roman Zippel 2007-05-31 167 })
^1da177e4c3f415 include/asm-m68k/page.h Linus Torvalds 2005-04-16 168
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[chrome-os:chromeos-5.4 32/59] arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'nohz_newidle_balance' - unexpected unlock
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 08f8d1398111d6717028218f58d8c7e228ef4d15
commit: e76f44b723928dfde31f8b46af3fae56bfd0d508 [32/59] FROMLIST: sched: Core-wide rq->lock
config: sparc64-randconfig-s032-20200812 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.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.2-168-g9554805c-dirty
git checkout e76f44b723928dfde31f8b46af3fae56bfd0d508
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc64
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 >>)
kernel/sched/fair.c:6408:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:6408:20: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:6408:20: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:6555:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] tmp @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:6555:9: sparse: expected struct sched_domain *[assigned] tmp
kernel/sched/fair.c:6555:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:7943:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *child @@ got struct sched_domain [noderef] <asn:4> *child @@
kernel/sched/fair.c:7943:40: sparse: expected struct sched_domain *child
kernel/sched/fair.c:7943:40: sparse: got struct sched_domain [noderef] <asn:4> *child
kernel/sched/fair.c:9336:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:9336:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:9336:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:8995:44: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *sd_parent @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:8995:44: sparse: expected struct sched_domain *sd_parent
kernel/sched/fair.c:8995:44: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:9414:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:9414:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:9414:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:10013:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:10013:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:10013:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:5796:28: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *sd @@ got struct sched_domain [noderef] <asn:4> *child @@
kernel/sched/fair.c:5796:28: sparse: expected struct sched_domain *sd
kernel/sched/fair.c:5796:28: sparse: got struct sched_domain [noderef] <asn:4> *child
kernel/sched/fair.c:5802:28: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *sd @@ got struct sched_domain [noderef] <asn:4> *child @@
kernel/sched/fair.c:5802:28: sparse: expected struct sched_domain *sd
kernel/sched/fair.c:5802:28: sparse: got struct sched_domain [noderef] <asn:4> *child
kernel/sched/fair.c:5809:28: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *sd @@ got struct sched_domain [noderef] <asn:4> *child @@
kernel/sched/fair.c:5809:28: sparse: expected struct sched_domain *sd
kernel/sched/fair.c:5809:28: sparse: got struct sched_domain [noderef] <asn:4> *child
kernel/sched/fair.c:5817:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] tmp @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:5817:17: sparse: expected struct sched_domain *[assigned] tmp
kernel/sched/fair.c:5817:17: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:7985:41: sparse: sparse: dereference of noderef expression
kernel/sched/fair.c:8363:45: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *child @@ got struct sched_domain [noderef] <asn:4> *child @@
kernel/sched/fair.c:8363:45: sparse: expected struct sched_domain *child
kernel/sched/fair.c:8363:45: sparse: got struct sched_domain [noderef] <asn:4> *child
kernel/sched/fair.c:9463:1: sparse: sparse: context imbalance in 'rebalance_domains' - different lock contexts for basic block
kernel/sched/fair.c: note: in included file (through include/linux/jump_label.h, include/linux/dynamic_debug.h, include/linux/printk.h, ...):
>> arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'nohz_newidle_balance' - unexpected unlock
--
kernel/sched/rt.c:1679:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/rt.c:1679:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/rt.c:1679:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/rt.c: note: in included file (through include/linux/jump_label.h, include/linux/dynamic_debug.h, include/linux/printk.h, ...):
>> arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'find_lock_lowest_rq' - unexpected unlock
>> arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'push_rt_task' - unexpected unlock
--
kernel/sched/deadline.c:1927:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/deadline.c:1927:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/deadline.c:1927:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/deadline.c: note: in included file (through include/linux/jump_label.h, include/linux/dynamic_debug.h, include/linux/printk.h, ...):
>> arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'dl_task_offline_migration' - unexpected unlock
>> arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'find_lock_later_rq' - unexpected unlock
>> arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'push_dl_task' - unexpected unlock
>> arch/sparc/include/asm/jump_label.h:13:9: sparse: sparse: context imbalance in 'pull_dl_task' - unexpected unlock
vim +/nohz_newidle_balance +13 arch/sparc/include/asm/jump_label.h
dff9d3c21525102 David S. Miller 2010-09-17 10
11276d5306b8e5b Peter Zijlstra 2015-07-24 11 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
d430d3d7e646eb1 Jason Baron 2011-03-16 12 {
3f0116c3238a96b Ingo Molnar 2013-10-10 @13 asm_volatile_goto("1:\n\t"
d430d3d7e646eb1 Jason Baron 2011-03-16 14 "nop\n\t"
d430d3d7e646eb1 Jason Baron 2011-03-16 15 "nop\n\t"
d430d3d7e646eb1 Jason Baron 2011-03-16 16 ".pushsection __jump_table, \"aw\"\n\t"
d430d3d7e646eb1 Jason Baron 2011-03-16 17 ".align 4\n\t"
d430d3d7e646eb1 Jason Baron 2011-03-16 18 ".word 1b, %l[l_yes], %c0\n\t"
d430d3d7e646eb1 Jason Baron 2011-03-16 19 ".popsection \n\t"
11276d5306b8e5b Peter Zijlstra 2015-07-24 20 : : "i" (&((char *)key)[branch]) : : l_yes);
11276d5306b8e5b Peter Zijlstra 2015-07-24 21
11276d5306b8e5b Peter Zijlstra 2015-07-24 22 return false;
11276d5306b8e5b Peter Zijlstra 2015-07-24 23 l_yes:
11276d5306b8e5b Peter Zijlstra 2015-07-24 24 return true;
11276d5306b8e5b Peter Zijlstra 2015-07-24 25 }
11276d5306b8e5b Peter Zijlstra 2015-07-24 26
:::::: The code at line 13 was first introduced by commit
:::::: 3f0116c3238a96bc18ad4b4acefe4e7be32fa861 compiler/gcc4: Add quirk for 'asm goto' miscompilation bug
:::::: TO: Ingo Molnar <mingo(a)kernel.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH] af_packet: TPACKET_V3: fix fill status rwlock imbalance
by kernel test robot
Hi John,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
[also build test WARNING on net/master sparc-next/master linus/master v5.8 next-20200813]
[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/John-Ogness/af_packet-TPACKET_V3...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git bfdd5aaa54b0a44d9df550fe4c9db7e1470a11b8
config: i386-randconfig-s002-20200813 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-168-g9554805c-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
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 >>)
>> net/packet/af_packet.c:1008:13: sparse: sparse: context imbalance in '__packet_lookup_frame_in_block' - different lock contexts for basic block
>> net/packet/af_packet.c:2402:17: sparse: sparse: context imbalance in 'tpacket_rcv' - unexpected unlock
vim +/__packet_lookup_frame_in_block +1008 net/packet/af_packet.c
f6fb8f100b80737 chetan loke 2011-08-19 1006
f6fb8f100b80737 chetan loke 2011-08-19 1007 /* Assumes caller has the sk->rx_queue.lock */
f6fb8f100b80737 chetan loke 2011-08-19 @1008 static void *__packet_lookup_frame_in_block(struct packet_sock *po,
f6fb8f100b80737 chetan loke 2011-08-19 1009 struct sk_buff *skb,
f6fb8f100b80737 chetan loke 2011-08-19 1010 unsigned int len
f6fb8f100b80737 chetan loke 2011-08-19 1011 )
f6fb8f100b80737 chetan loke 2011-08-19 1012 {
bc59ba399113fcb chetan loke 2011-08-25 1013 struct tpacket_kbdq_core *pkc;
bc59ba399113fcb chetan loke 2011-08-25 1014 struct tpacket_block_desc *pbd;
f6fb8f100b80737 chetan loke 2011-08-19 1015 char *curr, *end;
f6fb8f100b80737 chetan loke 2011-08-19 1016
e3192690a3c8897 Joe Perches 2012-06-03 1017 pkc = GET_PBDQC_FROM_RB(&po->rx_ring);
f6fb8f100b80737 chetan loke 2011-08-19 1018 pbd = GET_CURR_PBLOCK_DESC_FROM_CORE(pkc);
f6fb8f100b80737 chetan loke 2011-08-19 1019
f6fb8f100b80737 chetan loke 2011-08-19 1020 /* Queue is frozen when user space is lagging behind */
f6fb8f100b80737 chetan loke 2011-08-19 1021 if (prb_queue_frozen(pkc)) {
f6fb8f100b80737 chetan loke 2011-08-19 1022 /*
f6fb8f100b80737 chetan loke 2011-08-19 1023 * Check if that last block which caused the queue to freeze,
f6fb8f100b80737 chetan loke 2011-08-19 1024 * is still in_use by user-space.
f6fb8f100b80737 chetan loke 2011-08-19 1025 */
878cd3ba37f77de Rosen, Rami 2017-05-24 1026 if (prb_curr_blk_in_use(pbd)) {
f6fb8f100b80737 chetan loke 2011-08-19 1027 /* Can't record this packet */
f6fb8f100b80737 chetan loke 2011-08-19 1028 return NULL;
f6fb8f100b80737 chetan loke 2011-08-19 1029 } else {
f6fb8f100b80737 chetan loke 2011-08-19 1030 /*
f6fb8f100b80737 chetan loke 2011-08-19 1031 * Ok, the block was released by user-space.
f6fb8f100b80737 chetan loke 2011-08-19 1032 * Now let's open that block.
f6fb8f100b80737 chetan loke 2011-08-19 1033 * opening a block also thaws the queue.
f6fb8f100b80737 chetan loke 2011-08-19 1034 * Thawing is a side effect.
f6fb8f100b80737 chetan loke 2011-08-19 1035 */
f6fb8f100b80737 chetan loke 2011-08-19 1036 prb_open_block(pkc, pbd);
f6fb8f100b80737 chetan loke 2011-08-19 1037 }
f6fb8f100b80737 chetan loke 2011-08-19 1038 }
f6fb8f100b80737 chetan loke 2011-08-19 1039
f6fb8f100b80737 chetan loke 2011-08-19 1040 smp_mb();
f6fb8f100b80737 chetan loke 2011-08-19 1041 curr = pkc->nxt_offset;
f6fb8f100b80737 chetan loke 2011-08-19 1042 pkc->skb = skb;
e3192690a3c8897 Joe Perches 2012-06-03 1043 end = (char *)pbd + pkc->kblk_size;
f6fb8f100b80737 chetan loke 2011-08-19 1044
f6fb8f100b80737 chetan loke 2011-08-19 1045 /* first try the current block */
f6fb8f100b80737 chetan loke 2011-08-19 1046 if (curr+TOTAL_PKT_LEN_INCL_ALIGN(len) < end) {
f6fb8f100b80737 chetan loke 2011-08-19 1047 prb_fill_curr_block(curr, pkc, pbd, len);
f6fb8f100b80737 chetan loke 2011-08-19 1048 return (void *)curr;
f6fb8f100b80737 chetan loke 2011-08-19 1049 }
f6fb8f100b80737 chetan loke 2011-08-19 1050
f6fb8f100b80737 chetan loke 2011-08-19 1051 /* Ok, close the current block */
f6fb8f100b80737 chetan loke 2011-08-19 1052 prb_retire_current_block(pkc, po, 0);
f6fb8f100b80737 chetan loke 2011-08-19 1053
f6fb8f100b80737 chetan loke 2011-08-19 1054 /* Now, try to dispatch the next block */
f6fb8f100b80737 chetan loke 2011-08-19 1055 curr = (char *)prb_dispatch_next_block(pkc, po);
f6fb8f100b80737 chetan loke 2011-08-19 1056 if (curr) {
f6fb8f100b80737 chetan loke 2011-08-19 1057 pbd = GET_CURR_PBLOCK_DESC_FROM_CORE(pkc);
f6fb8f100b80737 chetan loke 2011-08-19 1058 prb_fill_curr_block(curr, pkc, pbd, len);
f6fb8f100b80737 chetan loke 2011-08-19 1059 return (void *)curr;
f6fb8f100b80737 chetan loke 2011-08-19 1060 }
f6fb8f100b80737 chetan loke 2011-08-19 1061
f6fb8f100b80737 chetan loke 2011-08-19 1062 /*
f6fb8f100b80737 chetan loke 2011-08-19 1063 * No free blocks are available.user_space hasn't caught up yet.
f6fb8f100b80737 chetan loke 2011-08-19 1064 * Queue was just frozen and now this packet will get dropped.
f6fb8f100b80737 chetan loke 2011-08-19 1065 */
f6fb8f100b80737 chetan loke 2011-08-19 1066 return NULL;
f6fb8f100b80737 chetan loke 2011-08-19 1067 }
f6fb8f100b80737 chetan loke 2011-08-19 1068
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month