Re: [PATCH v3 2/2] drm: bridge: Add TI SN65DSI83/84/85 DSI to LVDS bridge
by kernel test robot
Hi Jagan,
I love your patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linux/master linus/master v5.11-rc7 next-20210212]
[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/Jagan-Teki/dt-bindings-display-b...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: i386-randconfig-m021-20210215 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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/gpu/drm/bridge/ti-sn65dsi8x.c:193 sn65dsi_enable() warn: unsigned 'val' is never less than zero.
drivers/gpu/drm/bridge/ti-sn65dsi8x.c:422 sn65dsi_probe() error: uninitialized symbol 'ret'.
Old smatch warnings:
drivers/gpu/drm/bridge/ti-sn65dsi8x.c:214 sn65dsi_enable() warn: unsigned 'val' is never less than zero.
vim +/val +193 drivers/gpu/drm/bridge/ti-sn65dsi8x.c
170
171 static void sn65dsi_enable(struct drm_bridge *bridge)
172 {
173 struct sn65dsi *sn = bridge_to_sn65dsi(bridge);
174 struct drm_display_mode *mode = bridge_to_mode(bridge);
175 int bpp = mipi_dsi_pixel_format_to_bpp(sn->dsi->format);
176 unsigned int lanes = sn->dsi->lanes;
177 unsigned int pixel_clk = mode->clock * 1000;
178 unsigned int dsi_clk = pixel_clk * bpp / (lanes * 2);
179 unsigned int val;
180
181 /* reset SOFT_RESET bit */
182 regmap_write(sn->regmap, SN65DSI_SOFT_RESET, 0x0);
183
184 msleep(10);
185
186 /* reset PLL_EN bit */
187 regmap_write(sn->regmap, SN65DSI_CLK_PLL, 0x0);
188
189 msleep(10);
190
191 /* setup lvds clock */
192 val = sn65dsi_get_clk_range(0, 5, pixel_clk, 25000000, 25000000);
> 193 if (val < 0) {
194 DRM_DEV_ERROR(sn->dev, "invalid LVDS clock range %d\n", val);
195 return;
196 }
197
198 regmap_update_bits(sn->regmap, SN65DSI_LVDS_CLK,
199 LVDS_CLK_RANGE_MASK, val << LVDS_CLK_RANGE_SHIFT);
200
201 regmap_update_bits(sn->regmap, SN65DSI_LVDS_CLK, HS_CLK_SRC, HS_CLK_SRC);
202
203 /* setup bridge clock divider */
204 val = (dsi_clk / pixel_clk) - 1;
205 regmap_update_bits(sn->regmap, SN65DSI_CLK_DIV,
206 DSI_CLK_DIV_MASK, val << DSI_CLK_DIV_SHIFT);
207
208 /* configure dsi */
209 regmap_update_bits(sn->regmap, SN65DSI_DSI_CFG,
210 CHA_DSI_LANES_MASK, lanes << CHA_DSI_LANES_SHIFT);
211
212 /* dsi clock range */
213 val = sn65dsi_get_clk_range(8, 100, dsi_clk, 40000000, 5000000);
214 if (val < 0) {
215 DRM_DEV_ERROR(sn->dev, "invalid DSI clock range %d\n", val);
216 return;
217 }
218
219 regmap_write(sn->regmap, SN65DSI_DSI_CLK_RANGE, val);
220
221 /* setup lvds modes */
222 regmap_read(sn->regmap, SN65DSI_LVDS_MODE, &val);
223 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
224 val |= VS_NEG_POLARITY;
225 if (mode->flags & DRM_MODE_FLAG_PHSYNC)
226 val |= HS_NEG_POLARITY;
227 if (bpp == 24) /* Channel A mode */
228 val |= CHA_24BPP_MODE;
229 regmap_write(sn->regmap, SN65DSI_LVDS_MODE, val);
230
231 /* TODO Channel B is not configure yet */
232 sn65dsi_configure_cha(sn, mode);
233
234 /* set PLL_EN bit */
235 regmap_write(sn->regmap, SN65DSI_CLK_PLL, PLL_EN);
236
237 msleep(10);
238
239 /* set SOFT_RESET bit */
240 regmap_write(sn->regmap, SN65DSI_SOFT_RESET, SOFT_RESET);
241
242 msleep(10);
243 }
244
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
fs/btrfs/tree-checker.c:1038:9: warning: missing braces around initializer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 358feceebbf68f33c44c6650d14455389e65282d
commit: 1465af12e254a68706e110846f59cf0f09683184 btrfs: tree-checker: fix false alert caused by legacy btrfs root item
date: 4 months ago
config: i386-randconfig-a014-20200624 (attached as .config)
compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3
reproduce (this is a W=1 build):
# 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 1465af12e254a68706e110846f59cf0f09683184
# 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 >>):
fs/btrfs/tree-checker.c: In function 'check_root_item':
>> fs/btrfs/tree-checker.c:1038:9: warning: missing braces around initializer [-Wmissing-braces]
struct btrfs_root_item ri = { 0 };
^
fs/btrfs/tree-checker.c:1038:9: warning: (near initialization for 'ri.inode') [-Wmissing-braces]
vim +1038 fs/btrfs/tree-checker.c
1033
1034 static int check_root_item(struct extent_buffer *leaf, struct btrfs_key *key,
1035 int slot)
1036 {
1037 struct btrfs_fs_info *fs_info = leaf->fs_info;
> 1038 struct btrfs_root_item ri = { 0 };
1039 const u64 valid_root_flags = BTRFS_ROOT_SUBVOL_RDONLY |
1040 BTRFS_ROOT_SUBVOL_DEAD;
1041 int ret;
1042
1043 ret = check_root_key(leaf, key, slot);
1044 if (ret < 0)
1045 return ret;
1046
1047 if (btrfs_item_size_nr(leaf, slot) != sizeof(ri) &&
1048 btrfs_item_size_nr(leaf, slot) != btrfs_legacy_root_item_size()) {
1049 generic_err(leaf, slot,
1050 "invalid root item size, have %u expect %zu or %u",
1051 btrfs_item_size_nr(leaf, slot), sizeof(ri),
1052 btrfs_legacy_root_item_size());
1053 }
1054
1055 /*
1056 * For legacy root item, the members starting at generation_v2 will be
1057 * all filled with 0.
1058 * And since we allow geneartion_v2 as 0, it will still pass the check.
1059 */
1060 read_extent_buffer(leaf, &ri, btrfs_item_ptr_offset(leaf, slot),
1061 btrfs_item_size_nr(leaf, slot));
1062
1063 /* Generation related */
1064 if (btrfs_root_generation(&ri) >
1065 btrfs_super_generation(fs_info->super_copy) + 1) {
1066 generic_err(leaf, slot,
1067 "invalid root generation, have %llu expect (0, %llu]",
1068 btrfs_root_generation(&ri),
1069 btrfs_super_generation(fs_info->super_copy) + 1);
1070 return -EUCLEAN;
1071 }
1072 if (btrfs_root_generation_v2(&ri) >
1073 btrfs_super_generation(fs_info->super_copy) + 1) {
1074 generic_err(leaf, slot,
1075 "invalid root v2 generation, have %llu expect (0, %llu]",
1076 btrfs_root_generation_v2(&ri),
1077 btrfs_super_generation(fs_info->super_copy) + 1);
1078 return -EUCLEAN;
1079 }
1080 if (btrfs_root_last_snapshot(&ri) >
1081 btrfs_super_generation(fs_info->super_copy) + 1) {
1082 generic_err(leaf, slot,
1083 "invalid root last_snapshot, have %llu expect (0, %llu]",
1084 btrfs_root_last_snapshot(&ri),
1085 btrfs_super_generation(fs_info->super_copy) + 1);
1086 return -EUCLEAN;
1087 }
1088
1089 /* Alignment and level check */
1090 if (!IS_ALIGNED(btrfs_root_bytenr(&ri), fs_info->sectorsize)) {
1091 generic_err(leaf, slot,
1092 "invalid root bytenr, have %llu expect to be aligned to %u",
1093 btrfs_root_bytenr(&ri), fs_info->sectorsize);
1094 return -EUCLEAN;
1095 }
1096 if (btrfs_root_level(&ri) >= BTRFS_MAX_LEVEL) {
1097 generic_err(leaf, slot,
1098 "invalid root level, have %u expect [0, %u]",
1099 btrfs_root_level(&ri), BTRFS_MAX_LEVEL - 1);
1100 return -EUCLEAN;
1101 }
1102 if (ri.drop_level >= BTRFS_MAX_LEVEL) {
1103 generic_err(leaf, slot,
1104 "invalid root level, have %u expect [0, %u]",
1105 ri.drop_level, BTRFS_MAX_LEVEL - 1);
1106 return -EUCLEAN;
1107 }
1108
1109 /* Flags check */
1110 if (btrfs_root_flags(&ri) & ~valid_root_flags) {
1111 generic_err(leaf, slot,
1112 "invalid root flags, have 0x%llx expect mask 0x%llx",
1113 btrfs_root_flags(&ri), valid_root_flags);
1114 return -EUCLEAN;
1115 }
1116 return 0;
1117 }
1118
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
sound/pci/asihpi/hpioctl.c:346:9: warning: missing braces around initializer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ac30d8ce28d61c05ac3a8b1452e889371136f3af
commit: 472eb39103e885f302fd8fd6eff104fcf5503f1b ALSA: asihpi: fix iounmap in error handler
date: 5 months ago
config: i386-randconfig-a014-20200624 (attached as .config)
compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3
reproduce (this is a W=1 build):
# 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 472eb39103e885f302fd8fd6eff104fcf5503f1b
# 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 >>):
sound/pci/asihpi/hpioctl.c: In function 'asihpi_adapter_probe':
>> sound/pci/asihpi/hpioctl.c:346:9: warning: missing braces around initializer [-Wmissing-braces]
struct hpi_pci pci = { 0 };
^
sound/pci/asihpi/hpioctl.c:346:9: warning: (near initialization for 'pci.ap_mem_base') [-Wmissing-braces]
vim +346 sound/pci/asihpi/hpioctl.c
336
337 int asihpi_adapter_probe(struct pci_dev *pci_dev,
338 const struct pci_device_id *pci_id)
339 {
340 int idx, nm, low_latency_mode = 0, irq_supported = 0;
341 int adapter_index;
342 unsigned int memlen;
343 struct hpi_message hm;
344 struct hpi_response hr;
345 struct hpi_adapter adapter;
> 346 struct hpi_pci pci = { 0 };
347
348 memset(&adapter, 0, sizeof(adapter));
349
350 dev_printk(KERN_DEBUG, &pci_dev->dev,
351 "probe %04x:%04x,%04x:%04x,%04x\n", pci_dev->vendor,
352 pci_dev->device, pci_dev->subsystem_vendor,
353 pci_dev->subsystem_device, pci_dev->devfn);
354
355 if (pci_enable_device(pci_dev) < 0) {
356 dev_err(&pci_dev->dev,
357 "pci_enable_device failed, disabling device\n");
358 return -EIO;
359 }
360
361 pci_set_master(pci_dev); /* also sets latency timer if < 16 */
362
363 hpi_init_message_response(&hm, &hr, HPI_OBJ_SUBSYSTEM,
364 HPI_SUBSYS_CREATE_ADAPTER);
365 hpi_init_response(&hr, HPI_OBJ_SUBSYSTEM, HPI_SUBSYS_CREATE_ADAPTER,
366 HPI_ERROR_PROCESSING_MESSAGE);
367
368 hm.adapter_index = HPI_ADAPTER_INDEX_INVALID;
369
370 nm = HPI_MAX_ADAPTER_MEM_SPACES;
371
372 for (idx = 0; idx < nm; idx++) {
373 HPI_DEBUG_LOG(INFO, "resource %d %pR\n", idx,
374 &pci_dev->resource[idx]);
375
376 if (pci_resource_flags(pci_dev, idx) & IORESOURCE_MEM) {
377 memlen = pci_resource_len(pci_dev, idx);
378 pci.ap_mem_base[idx] =
379 ioremap(pci_resource_start(pci_dev, idx),
380 memlen);
381 if (!pci.ap_mem_base[idx]) {
382 HPI_DEBUG_LOG(ERROR,
383 "ioremap failed, aborting\n");
384 /* unmap previously mapped pci mem space */
385 goto err;
386 }
387 }
388 }
389
390 pci.pci_dev = pci_dev;
391 hm.u.s.resource.bus_type = HPI_BUS_PCI;
392 hm.u.s.resource.r.pci = &pci;
393
394 /* call CreateAdapterObject on the relevant hpi module */
395 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);
396 if (hr.error)
397 goto err;
398
399 adapter_index = hr.u.s.adapter_index;
400 adapter.adapter = hpi_find_adapter(adapter_index);
401
402 if (prealloc_stream_buf) {
403 adapter.p_buffer = vmalloc(prealloc_stream_buf);
404 if (!adapter.p_buffer) {
405 HPI_DEBUG_LOG(ERROR,
406 "HPI could not allocate "
407 "kernel buffer size %d\n",
408 prealloc_stream_buf);
409 goto err;
410 }
411 }
412
413 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
414 HPI_ADAPTER_OPEN);
415 hm.adapter_index = adapter.adapter->index;
416 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);
417
418 if (hr.error) {
419 HPI_DEBUG_LOG(ERROR, "HPI_ADAPTER_OPEN failed, aborting\n");
420 goto err;
421 }
422
423 /* Check if current mode == Low Latency mode */
424 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
425 HPI_ADAPTER_GET_MODE);
426 hm.adapter_index = adapter.adapter->index;
427 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);
428
429 if (!hr.error
430 && hr.u.ax.mode.adapter_mode == HPI_ADAPTER_MODE_LOW_LATENCY)
431 low_latency_mode = 1;
432 else
433 dev_info(&pci_dev->dev,
434 "Adapter at index %d is not in low latency mode\n",
435 adapter.adapter->index);
436
437 /* Check if IRQs are supported */
438 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
439 HPI_ADAPTER_GET_PROPERTY);
440 hm.adapter_index = adapter.adapter->index;
441 hm.u.ax.property_set.property = HPI_ADAPTER_PROPERTY_SUPPORTS_IRQ;
442 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);
443 if (hr.error || !hr.u.ax.property_get.parameter1) {
444 dev_info(&pci_dev->dev,
445 "IRQs not supported by adapter at index %d\n",
446 adapter.adapter->index);
447 } else {
448 irq_supported = 1;
449 }
450
451 /* WARNING can't init mutex in 'adapter'
452 * and then copy it to adapters[] ?!?!
453 */
454 adapters[adapter_index] = adapter;
455 mutex_init(&adapters[adapter_index].mutex);
456 pci_set_drvdata(pci_dev, &adapters[adapter_index]);
457
458 if (low_latency_mode && irq_supported) {
459 if (!adapter.adapter->irq_query_and_clear) {
460 dev_err(&pci_dev->dev,
461 "no IRQ handler for adapter %d, aborting\n",
462 adapter.adapter->index);
463 goto err;
464 }
465
466 /* Disable IRQ generation on DSP side by setting the rate to 0 */
467 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
468 HPI_ADAPTER_SET_PROPERTY);
469 hm.adapter_index = adapter.adapter->index;
470 hm.u.ax.property_set.property = HPI_ADAPTER_PROPERTY_IRQ_RATE;
471 hm.u.ax.property_set.parameter1 = 0;
472 hm.u.ax.property_set.parameter2 = 0;
473 hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);
474 if (hr.error) {
475 HPI_DEBUG_LOG(ERROR,
476 "HPI_ADAPTER_GET_MODE failed, aborting\n");
477 goto err;
478 }
479
480 /* Note: request_irq calls asihpi_isr here */
481 if (request_irq(pci_dev->irq, asihpi_isr, IRQF_SHARED,
482 "asihpi", &adapters[adapter_index])) {
483 dev_err(&pci_dev->dev, "request_irq(%d) failed\n",
484 pci_dev->irq);
485 goto err;
486 }
487
488 adapters[adapter_index].interrupt_mode = 1;
489
490 dev_info(&pci_dev->dev, "using irq %d\n", pci_dev->irq);
491 adapters[adapter_index].irq = pci_dev->irq;
492 } else {
493 dev_info(&pci_dev->dev, "using polled mode\n");
494 }
495
496 dev_info(&pci_dev->dev, "probe succeeded for ASI%04X HPI index %d\n",
497 adapter.adapter->type, adapter_index);
498
499 return 0;
500
501 err:
502 while (--idx >= 0) {
503 if (pci.ap_mem_base[idx]) {
504 iounmap(pci.ap_mem_base[idx]);
505 pci.ap_mem_base[idx] = NULL;
506 }
507 }
508
509 if (adapter.p_buffer) {
510 adapter.buffer_size = 0;
511 vfree(adapter.p_buffer);
512 }
513
514 HPI_DEBUG_LOG(ERROR, "adapter_probe failed\n");
515 return -ENODEV;
516 }
517
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH net-next v2 5/7] mld: convert ipv6_mc_socklist->sflist to RCU
by kernel test robot
Hi Taehee,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Taehee-Yoo/mld-change-context-fr...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 3c5a2fd042d0bfac71a2dfb99515723d318df47b
config: x86_64-randconfig-s022-20210214 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://github.com/0day-ci/linux/commit/5a21fa32b1401aa428cd0249ee5b02ddb...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Taehee-Yoo/mld-change-context-from-atomic-to-sleepable/20210214-015930
git checkout 5a21fa32b1401aa428cd0249ee5b02ddb12cff60
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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/ipv6/mcast.c:430:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> net/ipv6/mcast.c:430:17: sparse: struct ip6_sf_socklist [noderef] __rcu *
>> net/ipv6/mcast.c:430:17: sparse: struct ip6_sf_socklist *
net/ipv6/mcast.c: note: in included file:
include/net/mld.h:32:43: sparse: sparse: array of flexible structures
net/ipv6/mcast.c:257:25: sparse: sparse: context imbalance in 'ip6_mc_find_dev_rcu' - different lock contexts for basic block
net/ipv6/mcast.c:447:9: sparse: sparse: context imbalance in 'ip6_mc_source' - unexpected unlock
net/ipv6/mcast.c:536:9: sparse: sparse: context imbalance in 'ip6_mc_msfilter' - unexpected unlock
net/ipv6/mcast.c:583:21: sparse: sparse: context imbalance in 'ip6_mc_msfget' - unexpected unlock
net/ipv6/mcast.c:2724:25: sparse: sparse: context imbalance in 'igmp6_mc_get_next' - unexpected unlock
net/ipv6/mcast.c:2746:9: sparse: sparse: context imbalance in 'igmp6_mc_get_idx' - wrong count at exit
net/ipv6/mcast.c:2773:9: sparse: sparse: context imbalance in 'igmp6_mc_seq_stop' - unexpected unlock
net/ipv6/mcast.c:2845:31: sparse: sparse: context imbalance in 'igmp6_mcf_get_next' - unexpected unlock
net/ipv6/mcast.c:2877:9: sparse: sparse: context imbalance in 'igmp6_mcf_get_idx' - wrong count at exit
net/ipv6/mcast.c:2894:9: sparse: sparse: context imbalance in 'igmp6_mcf_seq_next' - wrong count at exit
net/ipv6/mcast.c:2907:17: sparse: sparse: context imbalance in 'igmp6_mcf_seq_stop' - unexpected unlock
vim +430 net/ipv6/mcast.c
325
326 int ip6_mc_source(int add, int omode, struct sock *sk,
327 struct group_source_req *pgsr)
328 {
329 struct in6_addr *source, *group;
330 struct ipv6_mc_socklist *pmc;
331 struct inet6_dev *idev;
332 struct ipv6_pinfo *inet6 = inet6_sk(sk);
333 struct ip6_sf_socklist *psl;
334 struct net *net = sock_net(sk);
335 int i, j, rv;
336 int leavegroup = 0;
337 int err;
338
339 source = &((struct sockaddr_in6 *)&pgsr->gsr_source)->sin6_addr;
340 group = &((struct sockaddr_in6 *)&pgsr->gsr_group)->sin6_addr;
341
342 if (!ipv6_addr_is_multicast(group))
343 return -EINVAL;
344
345 rcu_read_lock();
346 idev = ip6_mc_find_dev_rcu(net, group, pgsr->gsr_interface);
347 if (!idev) {
348 rcu_read_unlock();
349 return -ENODEV;
350 }
351
352 err = -EADDRNOTAVAIL;
353
354 for_each_pmc_rcu(inet6, pmc) {
355 if (pgsr->gsr_interface && pmc->ifindex != pgsr->gsr_interface)
356 continue;
357 if (ipv6_addr_equal(&pmc->addr, group))
358 break;
359 }
360 if (!pmc) { /* must have a prior join */
361 err = -EINVAL;
362 goto done;
363 }
364 /* if a source filter was set, must be the same mode as before */
365 if (rcu_access_pointer(pmc->sflist)) {
366 if (pmc->sfmode != omode) {
367 err = -EINVAL;
368 goto done;
369 }
370 } else if (pmc->sfmode != omode) {
371 /* allow mode switches for empty-set filters */
372 ip6_mc_add_src(idev, group, omode, 0, NULL, 0);
373 ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);
374 pmc->sfmode = omode;
375 }
376
377 psl = rtnl_dereference(pmc->sflist);
378 if (!add) {
379 if (!psl)
380 goto done; /* err = -EADDRNOTAVAIL */
381 rv = !0;
382 for (i = 0; i < psl->sl_count; i++) {
383 rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
384 if (rv == 0)
385 break;
386 }
387 if (rv) /* source not found */
388 goto done; /* err = -EADDRNOTAVAIL */
389
390 /* special case - (INCLUDE, empty) == LEAVE_GROUP */
391 if (psl->sl_count == 1 && omode == MCAST_INCLUDE) {
392 leavegroup = 1;
393 goto done;
394 }
395
396 /* update the interface filter */
397 ip6_mc_del_src(idev, group, omode, 1, source, 1);
398
399 for (j = i+1; j < psl->sl_count; j++)
400 psl->sl_addr[j-1] = psl->sl_addr[j];
401 psl->sl_count--;
402 err = 0;
403 goto done;
404 }
405 /* else, add a new source to the filter */
406
407 if (psl && psl->sl_count >= sysctl_mld_max_msf) {
408 err = -ENOBUFS;
409 goto done;
410 }
411 if (!psl || psl->sl_count == psl->sl_max) {
412 struct ip6_sf_socklist *newpsl;
413 int count = IP6_SFBLOCK;
414
415 if (psl)
416 count += psl->sl_max;
417 newpsl = sock_kmalloc(sk, IP6_SFLSIZE(count), GFP_ATOMIC);
418 if (!newpsl) {
419 err = -ENOBUFS;
420 goto done;
421 }
422 newpsl->sl_max = count;
423 newpsl->sl_count = count - IP6_SFBLOCK;
424 if (psl) {
425 for (i = 0; i < psl->sl_count; i++)
426 newpsl->sl_addr[i] = psl->sl_addr[i];
427 atomic_sub(IP6_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc);
428 kfree_rcu(psl, rcu);
429 }
> 430 rcu_assign_pointer(psl, newpsl);
431 rcu_assign_pointer(pmc->sflist, psl);
432 }
433 rv = 1; /* > 0 for insert logic below if sl_count is 0 */
434 for (i = 0; i < psl->sl_count; i++) {
435 rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
436 if (rv == 0) /* There is an error in the address. */
437 goto done;
438 }
439 for (j = psl->sl_count-1; j >= i; j--)
440 psl->sl_addr[j+1] = psl->sl_addr[j];
441 psl->sl_addr[i] = *source;
442 psl->sl_count++;
443 err = 0;
444 /* update the interface list */
445 ip6_mc_add_src(idev, group, omode, 1, source, 1);
446 done:
447 read_unlock_bh(&idev->lock);
448 rcu_read_unlock();
449 if (leavegroup)
450 err = ipv6_sock_mc_drop(sk, pgsr->gsr_interface, group);
451 return err;
452 }
453
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
drivers/misc/habanalabs/common/irq.c:50:12: warning: no previous declaration for 'hl_eq_inc_ptr'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ac30d8ce28d61c05ac3a8b1452e889371136f3af
commit: 70b2f993ea4a79c298aac4ec1c58089020536ba5 habanalabs: create common folder
date: 7 months ago
config: i386-randconfig-a014-20200624 (attached as .config)
compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3
reproduce (this is a W=1 build):
# 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 70b2f993ea4a79c298aac4ec1c58089020536ba5
# 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/misc/habanalabs/common/irq.c:50:12: warning: no previous declaration for 'hl_eq_inc_ptr' [-Wmissing-declarations]
inline u32 hl_eq_inc_ptr(u32 ptr)
^
vim +/hl_eq_inc_ptr +50 drivers/misc/habanalabs/common/irq.c
9494a8dd8d22cb drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 41
3db99f000b76bb drivers/misc/habanalabs/irq.c Lee Jones 2020-07-01 42 /**
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 43 * hl_eq_inc_ptr - increment ci of eq
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 44 *
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 45 * @ptr: the current ci value of the event queue
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 46 *
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 47 * Increment ptr by 1. If it reaches the number of event queue
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 48 * entries, set it to 0
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 49 */
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 @50 inline u32 hl_eq_inc_ptr(u32 ptr)
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 51 {
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 52 ptr++;
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 53 if (unlikely(ptr == HL_EQ_LENGTH))
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 54 ptr = 0;
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 55 return ptr;
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 56 }
1251f23ae8583b drivers/misc/habanalabs/irq.c Oded Gabbay 2019-02-16 57
:::::: The code at line 50 was first introduced by commit
:::::: 1251f23ae8583b1bb99c3db07102f4c9cc3160fe habanalabs: add event queue and interrupts
:::::: TO: Oded Gabbay <oded.gabbay(a)gmail.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[freescale-fslc:pr/257 12917/17025] drivers/gpu/drm/panel/panel-wks-101wx001.c:216:25: error: 'platform_of_match' undeclared here (not in a function)
by kernel test robot
Hi Robert,
FYI, the error/warning still remains.
tree: https://github.com/Freescale/linux-fslc pr/257
head: 5df3672236fb7ca1b04a8e8fa65bf039400b5020
commit: e15e046b8fceb6ae7c94d0ad78ef00a7432efb7b [12917/17025] MLK-24334-1: drm/panel: Add support for WKS-101WX001-WCT parallel display
config: arc-randconfig-r031-20210214 (attached as .config)
compiler: arceb-elf-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
# https://github.com/Freescale/linux-fslc/commit/e15e046b8fceb6ae7c94d0ad78...
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/257
git checkout e15e046b8fceb6ae7c94d0ad78ef00a7432efb7b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.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 errors (new ones prefixed by >>):
In file included from drivers/gpu/drm/panel/panel-wks-101wx001.c:10:
>> drivers/gpu/drm/panel/panel-wks-101wx001.c:216:25: error: 'platform_of_match' undeclared here (not in a function)
216 | MODULE_DEVICE_TABLE(of, platform_of_match);
| ^~~~~~~~~~~~~~~~~
include/linux/module.h:227:15: note: in definition of macro 'MODULE_DEVICE_TABLE'
227 | extern typeof(name) __mod_##type##__##name##_device_table \
| ^~~~
>> include/linux/module.h:227:21: error: '__mod_of__platform_of_match_device_table' aliased to undefined symbol 'platform_of_match'
227 | extern typeof(name) __mod_##type##__##name##_device_table \
| ^~~~~~
drivers/gpu/drm/panel/panel-wks-101wx001.c:216:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
216 | MODULE_DEVICE_TABLE(of, platform_of_match);
| ^~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for IMX_IRQSTEER
Depends on ARCH_MXC || COMPILE_TEST
Selected by
- DRM_IMX_DCSS && HAS_IOMEM
vim +/platform_of_match +216 drivers/gpu/drm/panel/panel-wks-101wx001.c
211
212 static const struct of_device_id wks_of_match[] = {
213 { .compatible = "wks,101wx001", },
214 { /* sentinel */ }
215 };
> 216 MODULE_DEVICE_TABLE(of, platform_of_match);
217
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
drivers/rtc/rtc-pcf8523.c:35:9: warning: 'REG_OFFSET' macro redefined
by kernel test robot
Hi Thomas,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ac30d8ce28d61c05ac3a8b1452e889371136f3af
commit: 7fd70c65faacd39628ba5f670be6490010c8132f ARM: irqstat: Get rid of duplicated declaration
date: 3 months ago
config: arm-randconfig-r003-20210214 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# 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 7fd70c65faacd39628ba5f670be6490010c8132f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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/rtc/rtc-pcf8523.c:35:9: warning: 'REG_OFFSET' macro redefined [-Wmacro-redefined]
#define REG_OFFSET 0x0e
^
arch/arm/mach-ixp4xx/include/mach/platform.h:23:9: note: previous definition is here
#define REG_OFFSET 0
^
1 warning generated.
vim +/REG_OFFSET +35 drivers/rtc/rtc-pcf8523.c
f803f0d079ded4 Thierry Reding 2012-12-17 34
bc3bee02527252 Russell King 2017-09-29 @35 #define REG_OFFSET 0x0e
bc3bee02527252 Russell King 2017-09-29 36 #define REG_OFFSET_MODE BIT(7)
bc3bee02527252 Russell King 2017-09-29 37
:::::: The code at line 35 was first introduced by commit
:::::: bc3bee0252725240ffa62180d387cc245179c549 rtc: pcf8523: add support for trimming the RTC oscillator
:::::: TO: Russell King <rmk+kernel(a)armlinux.org.uk>
:::::: CC: Alexandre Belloni <alexandre.belloni(a)free-electrons.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH v2] usb: typec: tcpm: Export partner Source Capabilities
by kernel test robot
Hi Kyle,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on v5.11-rc7 next-20210212]
[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/Kyle-Tso/usb-typec-tcpm-Export-p...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: x86_64-randconfig-a013-20210214 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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
# https://github.com/0day-ci/linux/commit/a80af7a2f4fa112b43e7b2b262729a8e1...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kyle-Tso/usb-typec-tcpm-Export-partner-Source-Capabilities/20210214-113553
git checkout a80af7a2f4fa112b43e7b2b262729a8e1b28c132
# 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 >>):
>> drivers/usb/typec/tcpm/tcpm.c:5762:11: error: implicit declaration of function 'tcpm_copy_pdos' [-Werror,-Wimplicit-function-declaration]
nr_pdo = tcpm_copy_pdos(*src_pdo, port->source_caps,
^
1 error generated.
vim +/tcpm_copy_pdos +5762 drivers/usb/typec/tcpm/tcpm.c
5741
5742 /*
5743 * Don't call this function in interrupt context. Caller needs to free the
5744 * memory by calling tcpm_put_partner_src_caps.
5745 */
5746 int tcpm_get_partner_src_caps(struct tcpm_port *port, u32 **src_pdo)
5747 {
5748 unsigned int nr_pdo;
5749
5750 mutex_lock(&port->lock);
5751 if (port->nr_source_caps == 0) {
5752 mutex_unlock(&port->lock);
5753 return -ENODATA;
5754 }
5755
5756 *src_pdo = kcalloc(port->nr_source_caps, sizeof(u32), GFP_KERNEL);
5757 if (!src_pdo) {
5758 mutex_unlock(&port->lock);
5759 return -ENOMEM;
5760 }
5761
> 5762 nr_pdo = tcpm_copy_pdos(*src_pdo, port->source_caps,
5763 port->nr_source_caps);
5764 mutex_unlock(&port->lock);
5765 return nr_pdo;
5766 }
5767 EXPORT_SYMBOL_GPL(tcpm_get_partner_src_caps);
5768
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
Re: [PATCH] staging: android: ashmem: Declared file operation with const keyword
by kernel test robot
Hi Thais,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/0day-ci/linux/commits/Thais-Camacho/staging-android-as...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 4eb839aef182fccf8995ee439fc2b48d43e45918
config: x86_64-randconfig-a014-20210214 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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
# https://github.com/0day-ci/linux/commit/32b5e3c9154f059b60686c16a3c3a316f...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thais-Camacho/staging-android-ashmem-Declared-file-operation-with-const-keyword/20210214-103440
git checkout 32b5e3c9154f059b60686c16a3c3a316f85b6976
# 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 >>):
>> drivers/staging/android/ashmem.c:430:16: error: cannot assign to variable 'vmfile_fops' with const-qualified type 'const struct file_operations'
vmfile_fops = *vmfile->f_op;
~~~~~~~~~~~ ^
drivers/staging/android/ashmem.c:379:38: note: variable 'vmfile_fops' declared const here
static const struct file_operations vmfile_fops;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
drivers/staging/android/ashmem.c:431:21: error: cannot assign to variable 'vmfile_fops' with const-qualified type 'const struct file_operations'
vmfile_fops.mmap = ashmem_vmfile_mmap;
~~~~~~~~~~~~~~~~ ^
drivers/staging/android/ashmem.c:379:38: note: variable 'vmfile_fops' declared const here
static const struct file_operations vmfile_fops;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
drivers/staging/android/ashmem.c:432:34: error: cannot assign to variable 'vmfile_fops' with const-qualified type 'const struct file_operations'
vmfile_fops.get_unmapped_area =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
drivers/staging/android/ashmem.c:379:38: note: variable 'vmfile_fops' declared const here
static const struct file_operations vmfile_fops;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
3 errors generated.
vim +430 drivers/staging/android/ashmem.c
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 376
11980c2ac4ccfa Robert Love 2011-12-20 377 static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
11980c2ac4ccfa Robert Love 2011-12-20 378 {
32b5e3c9154f05 Thais Camacho 2021-02-13 379 static const struct file_operations vmfile_fops;
11980c2ac4ccfa Robert Love 2011-12-20 380 struct ashmem_area *asma = file->private_data;
11980c2ac4ccfa Robert Love 2011-12-20 381 int ret = 0;
11980c2ac4ccfa Robert Love 2011-12-20 382
11980c2ac4ccfa Robert Love 2011-12-20 383 mutex_lock(&ashmem_mutex);
11980c2ac4ccfa Robert Love 2011-12-20 384
11980c2ac4ccfa Robert Love 2011-12-20 385 /* user needs to SET_SIZE before mapping */
59848d6aded59a Alistair Strachan 2018-06-19 386 if (!asma->size) {
11980c2ac4ccfa Robert Love 2011-12-20 387 ret = -EINVAL;
11980c2ac4ccfa Robert Love 2011-12-20 388 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 389 }
11980c2ac4ccfa Robert Love 2011-12-20 390
8632c614565d0c Alistair Strachan 2018-06-19 391 /* requested mapping size larger than object size */
8632c614565d0c Alistair Strachan 2018-06-19 392 if (vma->vm_end - vma->vm_start > PAGE_ALIGN(asma->size)) {
11980c2ac4ccfa Robert Love 2011-12-20 393 ret = -EINVAL;
11980c2ac4ccfa Robert Love 2011-12-20 394 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 395 }
11980c2ac4ccfa Robert Love 2011-12-20 396
11980c2ac4ccfa Robert Love 2011-12-20 397 /* requested protection bits must match our allowed protection mask */
59848d6aded59a Alistair Strachan 2018-06-19 398 if ((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask, 0)) &
59848d6aded59a Alistair Strachan 2018-06-19 399 calc_vm_prot_bits(PROT_MASK, 0)) {
11980c2ac4ccfa Robert Love 2011-12-20 400 ret = -EPERM;
11980c2ac4ccfa Robert Love 2011-12-20 401 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 402 }
56f76fc68492af Arve Hjønnevåg 2011-12-20 403 vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
11980c2ac4ccfa Robert Love 2011-12-20 404
11980c2ac4ccfa Robert Love 2011-12-20 405 if (!asma->file) {
11980c2ac4ccfa Robert Love 2011-12-20 406 char *name = ASHMEM_NAME_DEF;
11980c2ac4ccfa Robert Love 2011-12-20 407 struct file *vmfile;
3e338d3c95c735 Suren Baghdasaryan 2020-07-30 408 struct inode *inode;
11980c2ac4ccfa Robert Love 2011-12-20 409
11980c2ac4ccfa Robert Love 2011-12-20 410 if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0')
11980c2ac4ccfa Robert Love 2011-12-20 411 name = asma->name;
11980c2ac4ccfa Robert Love 2011-12-20 412
11980c2ac4ccfa Robert Love 2011-12-20 413 /* ... and allocate the backing shmem file */
11980c2ac4ccfa Robert Love 2011-12-20 414 vmfile = shmem_file_setup(name, asma->size, vma->vm_flags);
7f44cb0ba88b40 Viresh Kumar 2015-07-31 415 if (IS_ERR(vmfile)) {
11980c2ac4ccfa Robert Love 2011-12-20 416 ret = PTR_ERR(vmfile);
11980c2ac4ccfa Robert Love 2011-12-20 417 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 418 }
97fbfef6bd5978 Shuxiao Zhang 2017-04-06 419 vmfile->f_mode |= FMODE_LSEEK;
3e338d3c95c735 Suren Baghdasaryan 2020-07-30 420 inode = file_inode(vmfile);
3e338d3c95c735 Suren Baghdasaryan 2020-07-30 421 lockdep_set_class(&inode->i_rwsem, &backing_shmem_inode_class);
11980c2ac4ccfa Robert Love 2011-12-20 422 asma->file = vmfile;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 423 /*
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 424 * override mmap operation of the vmfile so that it can't be
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 425 * remapped which would lead to creation of a new vma with no
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 426 * asma permission checks. Have to override get_unmapped_area
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 427 * as well to prevent VM_BUG_ON check for f_ops modification.
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 428 */
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 429 if (!vmfile_fops.mmap) {
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 @430 vmfile_fops = *vmfile->f_op;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 431 vmfile_fops.mmap = ashmem_vmfile_mmap;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 432 vmfile_fops.get_unmapped_area =
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 433 ashmem_vmfile_get_unmapped_area;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 434 }
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 435 vmfile->f_op = &vmfile_fops;
11980c2ac4ccfa Robert Love 2011-12-20 436 }
11980c2ac4ccfa Robert Love 2011-12-20 437 get_file(asma->file);
11980c2ac4ccfa Robert Love 2011-12-20 438
11980c2ac4ccfa Robert Love 2011-12-20 439 /*
11980c2ac4ccfa Robert Love 2011-12-20 440 * XXX - Reworked to use shmem_zero_setup() instead of
11980c2ac4ccfa Robert Love 2011-12-20 441 * shmem_set_file while we're in staging. -jstultz
11980c2ac4ccfa Robert Love 2011-12-20 442 */
11980c2ac4ccfa Robert Love 2011-12-20 443 if (vma->vm_flags & VM_SHARED) {
11980c2ac4ccfa Robert Love 2011-12-20 444 ret = shmem_zero_setup(vma);
11980c2ac4ccfa Robert Love 2011-12-20 445 if (ret) {
11980c2ac4ccfa Robert Love 2011-12-20 446 fput(asma->file);
11980c2ac4ccfa Robert Love 2011-12-20 447 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 448 }
44960f2a7b63e2 John Stultz 2018-07-31 449 } else {
44960f2a7b63e2 John Stultz 2018-07-31 450 vma_set_anonymous(vma);
11980c2ac4ccfa Robert Love 2011-12-20 451 }
11980c2ac4ccfa Robert Love 2011-12-20 452
295992fb815e79 Christian König 2020-09-14 453 vma_set_file(vma, asma->file);
295992fb815e79 Christian König 2020-09-14 454 /* XXX: merge this with the get_file() above if possible */
295992fb815e79 Christian König 2020-09-14 455 fput(asma->file);
11980c2ac4ccfa Robert Love 2011-12-20 456
11980c2ac4ccfa Robert Love 2011-12-20 457 out:
11980c2ac4ccfa Robert Love 2011-12-20 458 mutex_unlock(&ashmem_mutex);
11980c2ac4ccfa Robert Love 2011-12-20 459 return ret;
11980c2ac4ccfa Robert Love 2011-12-20 460 }
11980c2ac4ccfa Robert Love 2011-12-20 461
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months