Re: [PATCH] staging: android: ashmem: Declared file operation with const keyword
by kernel test robot
Hi ratnesh-r1,
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/ratnesh-r1/staging-android-ashme...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git fa783154524a71ab74e293cd8251155e5971952b
config: x86_64-randconfig-a002-20220124 (https://download.01.org/0day-ci/archive/20220124/202201241907.69JG769L-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/c24fe2afe4abdf6436628abd13a0109ec...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review ratnesh-r1/staging-android-ashmem-Declared-file-operation-with-const-keyword/20220124-151116
git checkout c24fe2afe4abdf6436628abd13a0109ec420f373
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
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: In function 'ashmem_mmap':
>> drivers/staging/android/ashmem.c:431:16: error: assignment of read-only variable 'vmfile_fops'
431 | vmfile_fops = *vmfile->f_op;
| ^
>> drivers/staging/android/ashmem.c:432:21: error: assignment of member 'mmap' in read-only object
432 | vmfile_fops.mmap = ashmem_vmfile_mmap;
| ^
>> drivers/staging/android/ashmem.c:433:34: error: assignment of member 'get_unmapped_area' in read-only object
433 | vmfile_fops.get_unmapped_area =
| ^
vim +/vmfile_fops +431 drivers/staging/android/ashmem.c
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 377
11980c2ac4ccfa Robert Love 2011-12-20 378 static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
11980c2ac4ccfa Robert Love 2011-12-20 379 {
c24fe2afe4abdf ratnesh-r1 2022-01-23 380 static const struct file_operations vmfile_fops;
11980c2ac4ccfa Robert Love 2011-12-20 381 struct ashmem_area *asma = file->private_data;
11980c2ac4ccfa Robert Love 2011-12-20 382 int ret = 0;
11980c2ac4ccfa Robert Love 2011-12-20 383
11980c2ac4ccfa Robert Love 2011-12-20 384 mutex_lock(&ashmem_mutex);
11980c2ac4ccfa Robert Love 2011-12-20 385
11980c2ac4ccfa Robert Love 2011-12-20 386 /* user needs to SET_SIZE before mapping */
59848d6aded59a Alistair Strachan 2018-06-19 387 if (!asma->size) {
11980c2ac4ccfa Robert Love 2011-12-20 388 ret = -EINVAL;
11980c2ac4ccfa Robert Love 2011-12-20 389 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 390 }
11980c2ac4ccfa Robert Love 2011-12-20 391
8632c614565d0c Alistair Strachan 2018-06-19 392 /* requested mapping size larger than object size */
8632c614565d0c Alistair Strachan 2018-06-19 393 if (vma->vm_end - vma->vm_start > PAGE_ALIGN(asma->size)) {
11980c2ac4ccfa Robert Love 2011-12-20 394 ret = -EINVAL;
11980c2ac4ccfa Robert Love 2011-12-20 395 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 396 }
11980c2ac4ccfa Robert Love 2011-12-20 397
11980c2ac4ccfa Robert Love 2011-12-20 398 /* requested protection bits must match our allowed protection mask */
59848d6aded59a Alistair Strachan 2018-06-19 399 if ((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask, 0)) &
59848d6aded59a Alistair Strachan 2018-06-19 400 calc_vm_prot_bits(PROT_MASK, 0)) {
11980c2ac4ccfa Robert Love 2011-12-20 401 ret = -EPERM;
11980c2ac4ccfa Robert Love 2011-12-20 402 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 403 }
56f76fc68492af Arve Hjønnevåg 2011-12-20 404 vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
11980c2ac4ccfa Robert Love 2011-12-20 405
11980c2ac4ccfa Robert Love 2011-12-20 406 if (!asma->file) {
11980c2ac4ccfa Robert Love 2011-12-20 407 char *name = ASHMEM_NAME_DEF;
11980c2ac4ccfa Robert Love 2011-12-20 408 struct file *vmfile;
3e338d3c95c735 Suren Baghdasaryan 2020-07-30 409 struct inode *inode;
11980c2ac4ccfa Robert Love 2011-12-20 410
11980c2ac4ccfa Robert Love 2011-12-20 411 if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0')
11980c2ac4ccfa Robert Love 2011-12-20 412 name = asma->name;
11980c2ac4ccfa Robert Love 2011-12-20 413
11980c2ac4ccfa Robert Love 2011-12-20 414 /* ... and allocate the backing shmem file */
11980c2ac4ccfa Robert Love 2011-12-20 415 vmfile = shmem_file_setup(name, asma->size, vma->vm_flags);
7f44cb0ba88b40 Viresh Kumar 2015-07-31 416 if (IS_ERR(vmfile)) {
11980c2ac4ccfa Robert Love 2011-12-20 417 ret = PTR_ERR(vmfile);
11980c2ac4ccfa Robert Love 2011-12-20 418 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 419 }
97fbfef6bd5978 Shuxiao Zhang 2017-04-06 420 vmfile->f_mode |= FMODE_LSEEK;
3e338d3c95c735 Suren Baghdasaryan 2020-07-30 421 inode = file_inode(vmfile);
3e338d3c95c735 Suren Baghdasaryan 2020-07-30 422 lockdep_set_class(&inode->i_rwsem, &backing_shmem_inode_class);
11980c2ac4ccfa Robert Love 2011-12-20 423 asma->file = vmfile;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 424 /*
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 425 * override mmap operation of the vmfile so that it can't be
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 426 * remapped which would lead to creation of a new vma with no
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 427 * asma permission checks. Have to override get_unmapped_area
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 428 * as well to prevent VM_BUG_ON check for f_ops modification.
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 429 */
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 430 if (!vmfile_fops.mmap) {
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 @431 vmfile_fops = *vmfile->f_op;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 @432 vmfile_fops.mmap = ashmem_vmfile_mmap;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 @433 vmfile_fops.get_unmapped_area =
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 434 ashmem_vmfile_get_unmapped_area;
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 435 }
6d67b0290b4b84 Suren Baghdasaryan 2020-01-27 436 vmfile->f_op = &vmfile_fops;
11980c2ac4ccfa Robert Love 2011-12-20 437 }
11980c2ac4ccfa Robert Love 2011-12-20 438 get_file(asma->file);
11980c2ac4ccfa Robert Love 2011-12-20 439
11980c2ac4ccfa Robert Love 2011-12-20 440 /*
11980c2ac4ccfa Robert Love 2011-12-20 441 * XXX - Reworked to use shmem_zero_setup() instead of
11980c2ac4ccfa Robert Love 2011-12-20 442 * shmem_set_file while we're in staging. -jstultz
11980c2ac4ccfa Robert Love 2011-12-20 443 */
11980c2ac4ccfa Robert Love 2011-12-20 444 if (vma->vm_flags & VM_SHARED) {
11980c2ac4ccfa Robert Love 2011-12-20 445 ret = shmem_zero_setup(vma);
11980c2ac4ccfa Robert Love 2011-12-20 446 if (ret) {
11980c2ac4ccfa Robert Love 2011-12-20 447 fput(asma->file);
11980c2ac4ccfa Robert Love 2011-12-20 448 goto out;
11980c2ac4ccfa Robert Love 2011-12-20 449 }
44960f2a7b63e2 John Stultz 2018-07-31 450 } else {
44960f2a7b63e2 John Stultz 2018-07-31 451 vma_set_anonymous(vma);
11980c2ac4ccfa Robert Love 2011-12-20 452 }
11980c2ac4ccfa Robert Love 2011-12-20 453
295992fb815e79 Christian König 2020-09-14 454 vma_set_file(vma, asma->file);
295992fb815e79 Christian König 2020-09-14 455 /* XXX: merge this with the get_file() above if possible */
295992fb815e79 Christian König 2020-09-14 456 fput(asma->file);
11980c2ac4ccfa Robert Love 2011-12-20 457
11980c2ac4ccfa Robert Love 2011-12-20 458 out:
11980c2ac4ccfa Robert Love 2011-12-20 459 mutex_unlock(&ashmem_mutex);
11980c2ac4ccfa Robert Love 2011-12-20 460 return ret;
11980c2ac4ccfa Robert Love 2011-12-20 461 }
11980c2ac4ccfa Robert Love 2011-12-20 462
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
drivers/net/ethernet/cirrus/cs89x0.c:897:41: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'?
by kernel test robot
Hi Arnd,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 47fd22f2b84765a2f7e3f150282497b902624547 cs89x0: rework driver configuration
date: 6 months ago
config: m68k-randconfig-r006-20220123 (https://download.01.org/0day-ci/archive/20220124/202201241942.ipae4E4A-lk...)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# 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 47fd22f2b84765a2f7e3f150282497b902624547
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/
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 include/linux/printk.h:456,
from include/linux/kernel.h:19,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/net/ethernet/cirrus/cs89x0.c:51:
drivers/net/ethernet/cirrus/cs89x0.c: In function 'net_open':
>> drivers/net/ethernet/cirrus/cs89x0.c:897:41: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'? [-Werror=implicit-function-declaration]
897 | (unsigned long)isa_virt_to_bus(lp->dma_buff));
| ^~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:134:29: note: in definition of macro '__dynamic_func_call'
134 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:162:9: note: in expansion of macro '_dynamic_func_call'
162 | _dynamic_func_call(fmt, __dynamic_pr_debug, \
| ^~~~~~~~~~~~~~~~~~
include/linux/printk.h:471:9: note: in expansion of macro 'dynamic_pr_debug'
471 | dynamic_pr_debug(fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~
drivers/net/ethernet/cirrus/cs89x0.c:86:17: note: in expansion of macro 'pr_debug'
86 | pr_##level(fmt, ##__VA_ARGS__); \
| ^~~
drivers/net/ethernet/cirrus/cs89x0.c:894:17: note: in expansion of macro 'cs89_dbg'
894 | cs89_dbg(1, debug, "%s: dma %lx %lx\n",
| ^~~~~~~~
cc1: some warnings being treated as errors
vim +897 drivers/net/ethernet/cirrus/cs89x0.c
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 825
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 826 static int
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 827 net_open(struct net_device *dev)
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 828 {
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 829 struct net_local *lp = netdev_priv(dev);
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 830 int result = 0;
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 831 int i;
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 832 int ret;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 833
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 834 if (dev->irq < 2) {
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 835 /* Allow interrupts to be generated by the chip */
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 836 /* Cirrus' release had this: */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 837 #if 0
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 838 writereg(dev, PP_BusCTL, readreg(dev, PP_BusCTL) | ENABLE_IRQ);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 839 #endif
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 840 /* And 2.3.47 had this: */
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 841 writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 842
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 843 for (i = 2; i < CS8920_NO_INTS; i++) {
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 844 if ((1 << i) & lp->irq_map) {
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 845 if (request_irq(i, net_interrupt, 0, dev->name,
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 846 dev) == 0) {
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 847 dev->irq = i;
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 848 write_irq(dev, lp->chip_type, i);
6fba180ee8b1c8 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 849 /* writereg(dev, PP_BufCFG, GENERATE_SW_INTERRUPT); */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 850 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 851 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 852 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 853 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 854
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 855 if (i >= CS8920_NO_INTS) {
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 856 writereg(dev, PP_BusCTL, 0); /* disable interrupts. */
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 857 pr_err("can't get an interrupt\n");
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 858 ret = -EAGAIN;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 859 goto bad_out;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 860 }
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 861 } else {
47fd22f2b84765 drivers/net/ethernet/cirrus/cs89x0.c Arnd Bergmann 2021-08-03 862 #if IS_ENABLED(CONFIG_CS89x0_ISA)
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 863 if (((1 << dev->irq) & lp->irq_map) == 0) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 864 pr_err("%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 865 dev->name, dev->irq, lp->irq_map);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 866 ret = -EAGAIN;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 867 goto bad_out;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 868 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 869 #endif
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 870 /* FIXME: Cirrus' release had this: */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 871 writereg(dev, PP_BusCTL, readreg(dev, PP_BusCTL)|ENABLE_IRQ);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 872 /* And 2.3.47 had this: */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 873 #if 0
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 874 writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 875 #endif
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 876 write_irq(dev, lp->chip_type, dev->irq);
a0607fd3a25ba1 drivers/net/cs89x0.c Joe Perches 2009-11-18 877 ret = request_irq(dev->irq, net_interrupt, 0, dev->name, dev);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 878 if (ret) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 879 pr_err("request_irq(%d) failed\n", dev->irq);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 880 goto bad_out;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 881 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 882 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 883
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 884 #if ALLOW_DMA
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 885 if (lp->use_dma && (lp->isa_config & ANY_ISA_DMA)) {
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 886 unsigned long flags;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 887 lp->dma_buff = (unsigned char *)__get_dma_pages(GFP_KERNEL,
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 888 get_order(lp->dmasize * 1024));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 889 if (!lp->dma_buff) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 890 pr_err("%s: cannot get %dK memory for DMA\n",
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 891 dev->name, lp->dmasize);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 892 goto release_irq;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 893 }
808e9a77358995 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 894 cs89_dbg(1, debug, "%s: dma %lx %lx\n",
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 895 dev->name,
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 896 (unsigned long)lp->dma_buff,
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 @897 (unsigned long)isa_virt_to_bus(lp->dma_buff));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 898 if ((unsigned long)lp->dma_buff >= MAX_DMA_ADDRESS ||
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 899 !dma_page_eq(lp->dma_buff,
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 900 lp->dma_buff + lp->dmasize * 1024 - 1)) {
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 901 pr_err("%s: not usable as DMA buffer\n", dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 902 goto release_irq;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 903 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 904 memset(lp->dma_buff, 0, lp->dmasize * 1024); /* Why? */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 905 if (request_dma(dev->dma, dev->name)) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 906 pr_err("%s: cannot get dma channel %d\n",
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 907 dev->name, dev->dma);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 908 goto release_irq;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 909 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 910 write_dma(dev, lp->chip_type, dev->dma);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 911 lp->rx_dma_ptr = lp->dma_buff;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 912 lp->end_dma_buff = lp->dma_buff + lp->dmasize * 1024;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 913 spin_lock_irqsave(&lp->lock, flags);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 914 disable_dma(dev->dma);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 915 clear_dma_ff(dev->dma);
ef0657c49e0f93 drivers/net/cs89x0.c Julia Lawall 2009-07-06 916 set_dma_mode(dev->dma, DMA_RX_MODE); /* auto_init as well */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 917 set_dma_addr(dev->dma, isa_virt_to_bus(lp->dma_buff));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 918 set_dma_count(dev->dma, lp->dmasize * 1024);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 919 enable_dma(dev->dma);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 920 spin_unlock_irqrestore(&lp->lock, flags);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 921 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 922 #endif /* ALLOW_DMA */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 923
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 924 /* set the Ethernet address */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 925 for (i = 0; i < ETH_ALEN / 2; i++)
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 926 writereg(dev, PP_IA + i * 2,
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 927 (dev->dev_addr[i * 2] |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 928 (dev->dev_addr[i * 2 + 1] << 8)));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 929
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 930 /* while we're testing the interface, leave interrupts disabled */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 931 writereg(dev, PP_BusCTL, MEMORY_ON);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 932
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 933 /* Set the LineCTL quintuplet based on adapter configuration read from EEPROM */
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 934 if ((lp->adapter_cnf & A_CNF_EXTND_10B_2) &&
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 935 (lp->adapter_cnf & A_CNF_LOW_RX_SQUELCH))
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 936 lp->linectl = LOW_RX_SQUELCH;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 937 else
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 938 lp->linectl = 0;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 939
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 940 /* check to make sure that they have the "right" hardware available */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 941 switch (lp->adapter_cnf & A_CNF_MEDIA_TYPE) {
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 942 case A_CNF_MEDIA_10B_T:
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 943 result = lp->adapter_cnf & A_CNF_10B_T;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 944 break;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 945 case A_CNF_MEDIA_AUI:
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 946 result = lp->adapter_cnf & A_CNF_AUI;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 947 break;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 948 case A_CNF_MEDIA_10B_2:
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 949 result = lp->adapter_cnf & A_CNF_10B_2;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 950 break;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 951 default:
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 952 result = lp->adapter_cnf & (A_CNF_10B_T |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 953 A_CNF_AUI |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 954 A_CNF_10B_2);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 955 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 956 if (!result) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 957 pr_err("%s: EEPROM is configured for unavailable media\n",
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 958 dev->name);
17a9440f7deb78 drivers/net/cs89x0.c Wang Chen 2008-05-30 959 release_dma:
17a9440f7deb78 drivers/net/cs89x0.c Wang Chen 2008-05-30 960 #if ALLOW_DMA
17a9440f7deb78 drivers/net/cs89x0.c Wang Chen 2008-05-30 961 free_dma(dev->dma);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 962 release_irq:
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 963 release_dma_buff(lp);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 964 #endif
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 965 writereg(dev, PP_LineCTL,
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 966 readreg(dev, PP_LineCTL) & ~(SERIAL_TX_ON | SERIAL_RX_ON));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 967 free_irq(dev->irq, dev);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 968 ret = -EAGAIN;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 969 goto bad_out;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 970 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 971
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 972 /* set the hardware to the configured choice */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 973 switch (lp->adapter_cnf & A_CNF_MEDIA_TYPE) {
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 974 case A_CNF_MEDIA_10B_T:
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 975 result = detect_tp(dev);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 976 if (result == DETECTED_NONE) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 977 pr_warn("%s: 10Base-T (RJ-45) has no cable\n",
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 978 dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 979 if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 980 result = DETECTED_RJ45H; /* Yes! I don't care if I see a link pulse */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 981 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 982 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 983 case A_CNF_MEDIA_AUI:
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 984 result = detect_aui(dev);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 985 if (result == DETECTED_NONE) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 986 pr_warn("%s: 10Base-5 (AUI) has no cable\n", dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 987 if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 988 result = DETECTED_AUI; /* Yes! I don't care if I see a carrrier */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 989 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 990 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 991 case A_CNF_MEDIA_10B_2:
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 992 result = detect_bnc(dev);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 993 if (result == DETECTED_NONE) {
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 994 pr_warn("%s: 10Base-2 (BNC) has no cable\n", dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 995 if (lp->auto_neg_cnf & IMM_BIT) /* check "ignore missing media" bit */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 996 result = DETECTED_BNC; /* Yes! I don't care if I can xmit a packet */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 997 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 998 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 999 case A_CNF_MEDIA_AUTO:
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1000 writereg(dev, PP_LineCTL, lp->linectl | AUTO_AUI_10BASET);
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1001 if (lp->adapter_cnf & A_CNF_10B_T) {
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1002 result = detect_tp(dev);
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1003 if (result != DETECTED_NONE)
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1004 break;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1005 }
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1006 if (lp->adapter_cnf & A_CNF_AUI) {
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1007 result = detect_aui(dev);
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1008 if (result != DETECTED_NONE)
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1009 break;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1010 }
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1011 if (lp->adapter_cnf & A_CNF_10B_2) {
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1012 result = detect_bnc(dev);
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1013 if (result != DETECTED_NONE)
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1014 break;
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1015 }
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1016 pr_err("%s: no media detected\n", dev->name);
17a9440f7deb78 drivers/net/cs89x0.c Wang Chen 2008-05-30 1017 goto release_dma;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1018 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1019 switch (result) {
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1020 case DETECTED_NONE:
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1021 pr_err("%s: no network cable attached to configured media\n",
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1022 dev->name);
17a9440f7deb78 drivers/net/cs89x0.c Wang Chen 2008-05-30 1023 goto release_dma;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1024 case DETECTED_RJ45H:
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1025 pr_info("%s: using half-duplex 10Base-T (RJ-45)\n", dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1026 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1027 case DETECTED_RJ45F:
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1028 pr_info("%s: using full-duplex 10Base-T (RJ-45)\n", dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1029 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1030 case DETECTED_AUI:
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1031 pr_info("%s: using 10Base-5 (AUI)\n", dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1032 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1033 case DETECTED_BNC:
dd92b9ade43907 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1034 pr_info("%s: using 10Base-2 (BNC)\n", dev->name);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1035 break;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1036 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1037
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1038 /* Turn on both receive and transmit operations */
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1039 writereg(dev, PP_LineCTL,
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1040 readreg(dev, PP_LineCTL) | SERIAL_RX_ON | SERIAL_TX_ON);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1041
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1042 /* Receive only error free packets addressed to this card */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1043 lp->rx_mode = 0;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1044 writereg(dev, PP_RxCTL, DEF_RX_ACCEPT);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1045
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1046 lp->curr_rx_cfg = RX_OK_ENBL | RX_CRC_ERROR_ENBL;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1047
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1048 if (lp->isa_config & STREAM_TRANSFER)
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1049 lp->curr_rx_cfg |= RX_STREAM_ENBL;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1050 #if ALLOW_DMA
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1051 set_dma_cfg(dev);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1052 #endif
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1053 writereg(dev, PP_RxCFG, lp->curr_rx_cfg);
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1054
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1055 writereg(dev, PP_TxCFG, (TX_LOST_CRS_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1056 TX_SQE_ERROR_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1057 TX_OK_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1058 TX_LATE_COL_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1059 TX_JBR_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1060 TX_ANY_COL_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1061 TX_16_COL_ENBL));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1062
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1063 writereg(dev, PP_BufCFG, (READY_FOR_TX_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1064 RX_MISS_COUNT_OVRFLOW_ENBL |
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1065 #if ALLOW_DMA
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1066 dma_bufcfg(dev) |
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1067 #endif
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1068 TX_COL_COUNT_OVRFLOW_ENBL |
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1069 TX_UNDERRUN_ENBL));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1070
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1071 /* now that we've got our act together, enable everything */
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1072 writereg(dev, PP_BusCTL, (ENABLE_IRQ
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1073 | (dev->mem_start ? MEMORY_ON : 0) /* turn memory on */
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1074 #if ALLOW_DMA
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1075 | dma_busctl(dev)
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1076 #endif
ca034bcdb1786b drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1077 ));
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1078 netif_start_queue(dev);
808e9a77358995 drivers/net/ethernet/cirrus/cs89x0.c Joe Perches 2012-05-18 1079 cs89_dbg(1, debug, "net_open() succeeded\n");
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1080 return 0;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1081 bad_out:
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1082 return ret;
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1083 }
^1da177e4c3f41 drivers/net/cs89x0.c Linus Torvalds 2005-04-16 1084
:::::: The code at line 897 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
Re: [PATCH 10/23] MM: submit multipage write for SWP_FS_OPS swap-space
by kernel test robot
Hi NeilBrown,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.17-rc1 next-20220124]
[cannot apply to trondmy-nfs/linux-next cifs/for-next hnaz-mm/master]
[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/NeilBrown/Repair-SWAP-over_NFS/2...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20220124/202201241811.2ofGi6Q2-lk...)
compiler: powerpc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/267352b9af826e20ab71b46a7cd70d510...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review NeilBrown/Repair-SWAP-over_NFS/20220124-115716
git checkout 267352b9af826e20ab71b46a7cd70d51058b3030
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash
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 mm/vmscan.c:61:
mm/swap.h:68:1: error: expected identifier or '(' before '{' token
68 | {
| ^
mm/vmscan.c: In function 'shrink_page_list':
>> mm/vmscan.c:1978:17: error: implicit declaration of function 'swap_write_unplug'; did you mean 'swap_writepage'? [-Werror=implicit-function-declaration]
1978 | swap_write_unplug(plug);
| ^~~~~~~~~~~~~~~~~
| swap_writepage
In file included from mm/vmscan.c:61:
mm/vmscan.c: At top level:
mm/swap.h:66:19: warning: 'swap_readpage' declared 'static' but never defined [-Wunused-function]
66 | static inline int swap_readpage(struct page *page, bool do_poll,
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +1978 mm/vmscan.c
1526
1527 /*
1528 * shrink_page_list() returns the number of reclaimed pages
1529 */
1530 static unsigned int shrink_page_list(struct list_head *page_list,
1531 struct pglist_data *pgdat,
1532 struct scan_control *sc,
1533 struct reclaim_stat *stat,
1534 bool ignore_references)
1535 {
1536 LIST_HEAD(ret_pages);
1537 LIST_HEAD(free_pages);
1538 LIST_HEAD(demote_pages);
1539 unsigned int nr_reclaimed = 0;
1540 unsigned int pgactivate = 0;
1541 bool do_demote_pass;
1542 struct swap_iocb *plug = NULL;
1543
1544 memset(stat, 0, sizeof(*stat));
1545 cond_resched();
1546 do_demote_pass = can_demote(pgdat->node_id, sc);
1547
1548 retry:
1549 while (!list_empty(page_list)) {
1550 struct address_space *mapping;
1551 struct page *page;
1552 enum page_references references = PAGEREF_RECLAIM;
1553 bool dirty, writeback;
1554 unsigned int nr_pages;
1555
1556 cond_resched();
1557
1558 page = lru_to_page(page_list);
1559 list_del(&page->lru);
1560
1561 if (!trylock_page(page))
1562 goto keep;
1563
1564 VM_BUG_ON_PAGE(PageActive(page), page);
1565
1566 nr_pages = compound_nr(page);
1567
1568 /* Account the number of base pages even though THP */
1569 sc->nr_scanned += nr_pages;
1570
1571 if (unlikely(!page_evictable(page)))
1572 goto activate_locked;
1573
1574 if (!sc->may_unmap && page_mapped(page))
1575 goto keep_locked;
1576
1577 /*
1578 * The number of dirty pages determines if a node is marked
1579 * reclaim_congested. kswapd will stall and start writing
1580 * pages if the tail of the LRU is all dirty unqueued pages.
1581 */
1582 page_check_dirty_writeback(page, &dirty, &writeback);
1583 if (dirty || writeback)
1584 stat->nr_dirty++;
1585
1586 if (dirty && !writeback)
1587 stat->nr_unqueued_dirty++;
1588
1589 /*
1590 * Treat this page as congested if the underlying BDI is or if
1591 * pages are cycling through the LRU so quickly that the
1592 * pages marked for immediate reclaim are making it to the
1593 * end of the LRU a second time.
1594 */
1595 mapping = page_mapping(page);
1596 if (((dirty || writeback) && mapping &&
1597 inode_write_congested(mapping->host)) ||
1598 (writeback && PageReclaim(page)))
1599 stat->nr_congested++;
1600
1601 /*
1602 * If a page at the tail of the LRU is under writeback, there
1603 * are three cases to consider.
1604 *
1605 * 1) If reclaim is encountering an excessive number of pages
1606 * under writeback and this page is both under writeback and
1607 * PageReclaim then it indicates that pages are being queued
1608 * for IO but are being recycled through the LRU before the
1609 * IO can complete. Waiting on the page itself risks an
1610 * indefinite stall if it is impossible to writeback the
1611 * page due to IO error or disconnected storage so instead
1612 * note that the LRU is being scanned too quickly and the
1613 * caller can stall after page list has been processed.
1614 *
1615 * 2) Global or new memcg reclaim encounters a page that is
1616 * not marked for immediate reclaim, or the caller does not
1617 * have __GFP_FS (or __GFP_IO if it's simply going to swap,
1618 * not to fs). In this case mark the page for immediate
1619 * reclaim and continue scanning.
1620 *
1621 * Require may_enter_fs() because we would wait on fs, which
1622 * may not have submitted IO yet. And the loop driver might
1623 * enter reclaim, and deadlock if it waits on a page for
1624 * which it is needed to do the write (loop masks off
1625 * __GFP_IO|__GFP_FS for this reason); but more thought
1626 * would probably show more reasons.
1627 *
1628 * 3) Legacy memcg encounters a page that is already marked
1629 * PageReclaim. memcg does not have any dirty pages
1630 * throttling so we could easily OOM just because too many
1631 * pages are in writeback and there is nothing else to
1632 * reclaim. Wait for the writeback to complete.
1633 *
1634 * In cases 1) and 2) we activate the pages to get them out of
1635 * the way while we continue scanning for clean pages on the
1636 * inactive list and refilling from the active list. The
1637 * observation here is that waiting for disk writes is more
1638 * expensive than potentially causing reloads down the line.
1639 * Since they're marked for immediate reclaim, they won't put
1640 * memory pressure on the cache working set any longer than it
1641 * takes to write them to disk.
1642 */
1643 if (PageWriteback(page)) {
1644 /* Case 1 above */
1645 if (current_is_kswapd() &&
1646 PageReclaim(page) &&
1647 test_bit(PGDAT_WRITEBACK, &pgdat->flags)) {
1648 stat->nr_immediate++;
1649 goto activate_locked;
1650
1651 /* Case 2 above */
1652 } else if (writeback_throttling_sane(sc) ||
1653 !PageReclaim(page) || !may_enter_fs(page, sc->gfp_mask)) {
1654 /*
1655 * This is slightly racy - end_page_writeback()
1656 * might have just cleared PageReclaim, then
1657 * setting PageReclaim here end up interpreted
1658 * as PageReadahead - but that does not matter
1659 * enough to care. What we do want is for this
1660 * page to have PageReclaim set next time memcg
1661 * reclaim reaches the tests above, so it will
1662 * then wait_on_page_writeback() to avoid OOM;
1663 * and it's also appropriate in global reclaim.
1664 */
1665 SetPageReclaim(page);
1666 stat->nr_writeback++;
1667 goto activate_locked;
1668
1669 /* Case 3 above */
1670 } else {
1671 unlock_page(page);
1672 wait_on_page_writeback(page);
1673 /* then go back and try same page again */
1674 list_add_tail(&page->lru, page_list);
1675 continue;
1676 }
1677 }
1678
1679 if (!ignore_references)
1680 references = page_check_references(page, sc);
1681
1682 switch (references) {
1683 case PAGEREF_ACTIVATE:
1684 goto activate_locked;
1685 case PAGEREF_KEEP:
1686 stat->nr_ref_keep += nr_pages;
1687 goto keep_locked;
1688 case PAGEREF_RECLAIM:
1689 case PAGEREF_RECLAIM_CLEAN:
1690 ; /* try to reclaim the page below */
1691 }
1692
1693 /*
1694 * Before reclaiming the page, try to relocate
1695 * its contents to another node.
1696 */
1697 if (do_demote_pass &&
1698 (thp_migration_supported() || !PageTransHuge(page))) {
1699 list_add(&page->lru, &demote_pages);
1700 unlock_page(page);
1701 continue;
1702 }
1703
1704 /*
1705 * Anonymous process memory has backing store?
1706 * Try to allocate it some swap space here.
1707 * Lazyfree page could be freed directly
1708 */
1709 if (PageAnon(page) && PageSwapBacked(page)) {
1710 if (!PageSwapCache(page)) {
1711 if (!(sc->gfp_mask & __GFP_IO))
1712 goto keep_locked;
1713 if (page_maybe_dma_pinned(page))
1714 goto keep_locked;
1715 if (PageTransHuge(page)) {
1716 /* cannot split THP, skip it */
1717 if (!can_split_huge_page(page, NULL))
1718 goto activate_locked;
1719 /*
1720 * Split pages without a PMD map right
1721 * away. Chances are some or all of the
1722 * tail pages can be freed without IO.
1723 */
1724 if (!compound_mapcount(page) &&
1725 split_huge_page_to_list(page,
1726 page_list))
1727 goto activate_locked;
1728 }
1729 if (!add_to_swap(page)) {
1730 if (!PageTransHuge(page))
1731 goto activate_locked_split;
1732 /* Fallback to swap normal pages */
1733 if (split_huge_page_to_list(page,
1734 page_list))
1735 goto activate_locked;
1736 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
1737 count_vm_event(THP_SWPOUT_FALLBACK);
1738 #endif
1739 if (!add_to_swap(page))
1740 goto activate_locked_split;
1741 }
1742
1743 /* Adding to swap updated mapping */
1744 mapping = page_mapping(page);
1745 }
1746 } else if (unlikely(PageTransHuge(page))) {
1747 /* Split file THP */
1748 if (split_huge_page_to_list(page, page_list))
1749 goto keep_locked;
1750 }
1751
1752 /*
1753 * THP may get split above, need minus tail pages and update
1754 * nr_pages to avoid accounting tail pages twice.
1755 *
1756 * The tail pages that are added into swap cache successfully
1757 * reach here.
1758 */
1759 if ((nr_pages > 1) && !PageTransHuge(page)) {
1760 sc->nr_scanned -= (nr_pages - 1);
1761 nr_pages = 1;
1762 }
1763
1764 /*
1765 * The page is mapped into the page tables of one or more
1766 * processes. Try to unmap it here.
1767 */
1768 if (page_mapped(page)) {
1769 enum ttu_flags flags = TTU_BATCH_FLUSH;
1770 bool was_swapbacked = PageSwapBacked(page);
1771
1772 if (unlikely(PageTransHuge(page)))
1773 flags |= TTU_SPLIT_HUGE_PMD;
1774
1775 try_to_unmap(page, flags);
1776 if (page_mapped(page)) {
1777 stat->nr_unmap_fail += nr_pages;
1778 if (!was_swapbacked && PageSwapBacked(page))
1779 stat->nr_lazyfree_fail += nr_pages;
1780 goto activate_locked;
1781 }
1782 }
1783
1784 if (PageDirty(page)) {
1785 /*
1786 * Only kswapd can writeback filesystem pages
1787 * to avoid risk of stack overflow. But avoid
1788 * injecting inefficient single-page IO into
1789 * flusher writeback as much as possible: only
1790 * write pages when we've encountered many
1791 * dirty pages, and when we've already scanned
1792 * the rest of the LRU for clean pages and see
1793 * the same dirty pages again (PageReclaim).
1794 */
1795 if (page_is_file_lru(page) &&
1796 (!current_is_kswapd() || !PageReclaim(page) ||
1797 !test_bit(PGDAT_DIRTY, &pgdat->flags))) {
1798 /*
1799 * Immediately reclaim when written back.
1800 * Similar in principal to deactivate_page()
1801 * except we already have the page isolated
1802 * and know it's dirty
1803 */
1804 inc_node_page_state(page, NR_VMSCAN_IMMEDIATE);
1805 SetPageReclaim(page);
1806
1807 goto activate_locked;
1808 }
1809
1810 if (references == PAGEREF_RECLAIM_CLEAN)
1811 goto keep_locked;
1812 if (!may_enter_fs(page, sc->gfp_mask))
1813 goto keep_locked;
1814 if (!sc->may_writepage)
1815 goto keep_locked;
1816
1817 /*
1818 * Page is dirty. Flush the TLB if a writable entry
1819 * potentially exists to avoid CPU writes after IO
1820 * starts and then write it out here.
1821 */
1822 try_to_unmap_flush_dirty();
1823 switch (pageout(page, mapping, &plug)) {
1824 case PAGE_KEEP:
1825 goto keep_locked;
1826 case PAGE_ACTIVATE:
1827 goto activate_locked;
1828 case PAGE_SUCCESS:
1829 stat->nr_pageout += thp_nr_pages(page);
1830
1831 if (PageWriteback(page))
1832 goto keep;
1833 if (PageDirty(page))
1834 goto keep;
1835
1836 /*
1837 * A synchronous write - probably a ramdisk. Go
1838 * ahead and try to reclaim the page.
1839 */
1840 if (!trylock_page(page))
1841 goto keep;
1842 if (PageDirty(page) || PageWriteback(page))
1843 goto keep_locked;
1844 mapping = page_mapping(page);
1845 fallthrough;
1846 case PAGE_CLEAN:
1847 ; /* try to free the page below */
1848 }
1849 }
1850
1851 /*
1852 * If the page has buffers, try to free the buffer mappings
1853 * associated with this page. If we succeed we try to free
1854 * the page as well.
1855 *
1856 * We do this even if the page is PageDirty().
1857 * try_to_release_page() does not perform I/O, but it is
1858 * possible for a page to have PageDirty set, but it is actually
1859 * clean (all its buffers are clean). This happens if the
1860 * buffers were written out directly, with submit_bh(). ext3
1861 * will do this, as well as the blockdev mapping.
1862 * try_to_release_page() will discover that cleanness and will
1863 * drop the buffers and mark the page clean - it can be freed.
1864 *
1865 * Rarely, pages can have buffers and no ->mapping. These are
1866 * the pages which were not successfully invalidated in
1867 * truncate_cleanup_page(). We try to drop those buffers here
1868 * and if that worked, and the page is no longer mapped into
1869 * process address space (page_count == 1) it can be freed.
1870 * Otherwise, leave the page on the LRU so it is swappable.
1871 */
1872 if (page_has_private(page)) {
1873 if (!try_to_release_page(page, sc->gfp_mask))
1874 goto activate_locked;
1875 if (!mapping && page_count(page) == 1) {
1876 unlock_page(page);
1877 if (put_page_testzero(page))
1878 goto free_it;
1879 else {
1880 /*
1881 * rare race with speculative reference.
1882 * the speculative reference will free
1883 * this page shortly, so we may
1884 * increment nr_reclaimed here (and
1885 * leave it off the LRU).
1886 */
1887 nr_reclaimed++;
1888 continue;
1889 }
1890 }
1891 }
1892
1893 if (PageAnon(page) && !PageSwapBacked(page)) {
1894 /* follow __remove_mapping for reference */
1895 if (!page_ref_freeze(page, 1))
1896 goto keep_locked;
1897 /*
1898 * The page has only one reference left, which is
1899 * from the isolation. After the caller puts the
1900 * page back on lru and drops the reference, the
1901 * page will be freed anyway. It doesn't matter
1902 * which lru it goes. So we don't bother checking
1903 * PageDirty here.
1904 */
1905 count_vm_event(PGLAZYFREED);
1906 count_memcg_page_event(page, PGLAZYFREED);
1907 } else if (!mapping || !__remove_mapping(mapping, page, true,
1908 sc->target_mem_cgroup))
1909 goto keep_locked;
1910
1911 unlock_page(page);
1912 free_it:
1913 /*
1914 * THP may get swapped out in a whole, need account
1915 * all base pages.
1916 */
1917 nr_reclaimed += nr_pages;
1918
1919 /*
1920 * Is there need to periodically free_page_list? It would
1921 * appear not as the counts should be low
1922 */
1923 if (unlikely(PageTransHuge(page)))
1924 destroy_compound_page(page);
1925 else
1926 list_add(&page->lru, &free_pages);
1927 continue;
1928
1929 activate_locked_split:
1930 /*
1931 * The tail pages that are failed to add into swap cache
1932 * reach here. Fixup nr_scanned and nr_pages.
1933 */
1934 if (nr_pages > 1) {
1935 sc->nr_scanned -= (nr_pages - 1);
1936 nr_pages = 1;
1937 }
1938 activate_locked:
1939 /* Not a candidate for swapping, so reclaim swap space. */
1940 if (PageSwapCache(page) && (mem_cgroup_swap_full(page) ||
1941 PageMlocked(page)))
1942 try_to_free_swap(page);
1943 VM_BUG_ON_PAGE(PageActive(page), page);
1944 if (!PageMlocked(page)) {
1945 int type = page_is_file_lru(page);
1946 SetPageActive(page);
1947 stat->nr_activate[type] += nr_pages;
1948 count_memcg_page_event(page, PGACTIVATE);
1949 }
1950 keep_locked:
1951 unlock_page(page);
1952 keep:
1953 list_add(&page->lru, &ret_pages);
1954 VM_BUG_ON_PAGE(PageLRU(page) || PageUnevictable(page), page);
1955 }
1956 /* 'page_list' is always empty here */
1957
1958 /* Migrate pages selected for demotion */
1959 nr_reclaimed += demote_page_list(&demote_pages, pgdat);
1960 /* Pages that could not be demoted are still in @demote_pages */
1961 if (!list_empty(&demote_pages)) {
1962 /* Pages which failed to demoted go back on @page_list for retry: */
1963 list_splice_init(&demote_pages, page_list);
1964 do_demote_pass = false;
1965 goto retry;
1966 }
1967
1968 pgactivate = stat->nr_activate[0] + stat->nr_activate[1];
1969
1970 mem_cgroup_uncharge_list(&free_pages);
1971 try_to_unmap_flush();
1972 free_unref_page_list(&free_pages);
1973
1974 list_splice(&ret_pages, page_list);
1975 count_vm_events(PGACTIVATE, pgactivate);
1976
1977 if (plug)
> 1978 swap_write_unplug(plug);
1979 return nr_reclaimed;
1980 }
1981
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
[esmil:visionfive 48/63] sound/soc/starfive/spdif.h:145:6: warning: no previous prototype for 'sf_spdif_pcm_push_tx'
by kernel test robot
tree: https://github.com/esmil/linux visionfive
head: fdbe623707a8f3f9b9d2cb3c4c240299a12b8302
commit: 20e1533986c528bed5da7a0957f828337d17d47d [48/63] ASoC: starfive: Add StarFive JH7100 audio drivers
config: sparc-randconfig-r014-20220124 (https://download.01.org/0day-ci/archive/20220124/202201241838.ABa6OLrH-lk...)
compiler: sparc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/esmil/linux/commit/20e1533986c528bed5da7a0957f828337d1...
git remote add esmil https://github.com/esmil/linux
git fetch --no-tags esmil visionfive
git checkout 20e1533986c528bed5da7a0957f828337d17d47d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc SHELL=/bin/bash sound/soc/
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 >>):
In file included from sound/soc/starfive/spdif.c:21:
>> sound/soc/starfive/spdif.h:145:6: warning: no previous prototype for 'sf_spdif_pcm_push_tx' [-Wmissing-prototypes]
145 | void sf_spdif_pcm_push_tx(struct sf_spdif_dev *dev) { }
| ^~~~~~~~~~~~~~~~~~~~
>> sound/soc/starfive/spdif.h:146:6: warning: no previous prototype for 'sf_spdif_pcm_pop_rx' [-Wmissing-prototypes]
146 | void sf_spdif_pcm_pop_rx(struct sf_spdif_dev *dev) { }
| ^~~~~~~~~~~~~~~~~~~
>> sound/soc/starfive/spdif.h:147:5: warning: no previous prototype for 'sf_spdif_pcm_register' [-Wmissing-prototypes]
147 | int sf_spdif_pcm_register(struct platform_device *pdev)
| ^~~~~~~~~~~~~~~~~~~~~
--
In file included from sound/soc/starfive/pwmdac.c:19:
>> sound/soc/starfive/pwmdac.h:145:6: warning: no previous prototype for 'sf_pwmdac_pcm_push_tx' [-Wmissing-prototypes]
145 | void sf_pwmdac_pcm_push_tx(struct sf_pwmdac_dev *dev) { }
| ^~~~~~~~~~~~~~~~~~~~~
>> sound/soc/starfive/pwmdac.h:146:6: warning: no previous prototype for 'sf_pwmdac_pcm_pop_rx' [-Wmissing-prototypes]
146 | void sf_pwmdac_pcm_pop_rx(struct sf_pwmdac_dev *dev) { }
| ^~~~~~~~~~~~~~~~~~~~
>> sound/soc/starfive/pwmdac.h:147:5: warning: no previous prototype for 'sf_pwmdac_pcm_register' [-Wmissing-prototypes]
147 | int sf_pwmdac_pcm_register(struct platform_device *pdev)
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/sf_spdif_pcm_push_tx +145 sound/soc/starfive/spdif.h
139
140 #if IS_ENABLED(CONFIG_SND_STARFIVE_SPDIF_PCM)
141 void sf_spdif_pcm_push_tx(struct sf_spdif_dev *dev);
142 void sf_spdif_pcm_pop_rx(struct sf_spdif_dev *dev);
143 int sf_spdif_pcm_register(struct platform_device *pdev);
144 #else
> 145 void sf_spdif_pcm_push_tx(struct sf_spdif_dev *dev) { }
> 146 void sf_spdif_pcm_pop_rx(struct sf_spdif_dev *dev) { }
> 147 int sf_spdif_pcm_register(struct platform_device *pdev)
148 {
149 return -EINVAL;
150 }
151 #endif
152
153
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks
drivers/pci/controller/pcie-mt7621.c:549:34: warning: unused variable 'mt7621_pcie_ids'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 87c71931633bd15e9cfd51d4a4d9cd685e8cdb55 Merge branch 'pci/driver-cleanup'
date: 11 days ago
config: mips-randconfig-r031-20220124 (https://download.01.org/0day-ci/archive/20220124/202201241754.igtHzgHv-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7b3d30728816403d1fd73cc5082e9fb761262bce)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# 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 87c71931633bd15e9cfd51d4a4d9cd685e8cdb55
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/pci/controller/
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/pci/controller/pcie-mt7621.c:112:20: warning: unused function 'pcie_rmw' [-Wunused-function]
static inline void pcie_rmw(struct mt7621_pcie *pcie, u32 reg, u32 clr, u32 set)
^
>> drivers/pci/controller/pcie-mt7621.c:549:34: warning: unused variable 'mt7621_pcie_ids' [-Wunused-const-variable]
static const struct of_device_id mt7621_pcie_ids[] = {
^
2 warnings generated.
vim +/mt7621_pcie_ids +549 drivers/pci/controller/pcie-mt7621.c
03f152e31f4ae89 drivers/staging/mt7621-pci/pci-mt7621.c John Crispin 2018-03-15 548
4793895f597d42e drivers/pci/controller/pcie-mt7621.c Bjorn Helgaas 2021-12-22 @549 static const struct of_device_id mt7621_pcie_ids[] = {
03f152e31f4ae89 drivers/staging/mt7621-pci/pci-mt7621.c John Crispin 2018-03-15 550 { .compatible = "mediatek,mt7621-pci" },
03f152e31f4ae89 drivers/staging/mt7621-pci/pci-mt7621.c John Crispin 2018-03-15 551 {},
03f152e31f4ae89 drivers/staging/mt7621-pci/pci-mt7621.c John Crispin 2018-03-15 552 };
4793895f597d42e drivers/pci/controller/pcie-mt7621.c Bjorn Helgaas 2021-12-22 553 MODULE_DEVICE_TABLE(of, mt7621_pcie_ids);
03f152e31f4ae89 drivers/staging/mt7621-pci/pci-mt7621.c John Crispin 2018-03-15 554
:::::: The code at line 549 was first introduced by commit
:::::: 4793895f597d42eb54a0f54711b61263b6a8dd03 PCI: mt7621: Rename mt7621_pci_ to mt7621_pcie_
:::::: TO: Bjorn Helgaas <bhelgaas(a)google.com>
:::::: CC: Bjorn Helgaas <bhelgaas(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 4 weeks