[nvdimm:libnvdimm-pending 297/299] arch/powerpc/include/asm/uaccess.h:331:1: error: conflicting types for 'copy_mc_to_kernel'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git libnvdimm-pending
head: bb12557751a16ec04d801b01492257f720e4718e
commit: b00239d425d5c3c3d20f62bb1180905c0d133ab3 [297/299] x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user,kernel}()
config: powerpc-allnoconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout b00239d425d5c3c3d20f62bb1180905c0d133ab3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/uaccess.h:11,
from include/linux/crypto.h:21,
from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/linux/compat.h:15,
from arch/powerpc/kernel/asm-offsets.c:14:
>> arch/powerpc/include/asm/uaccess.h:331:1: error: conflicting types for 'copy_mc_to_kernel'
331 | copy_mc_to_kernel(void *to, const void *from, unsigned long size)
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/bitmap.h:9,
from include/linux/cpumask.h:12,
from include/linux/workqueue.h:15,
from include/linux/rhashtable-types.h:15,
from include/linux/ipc.h:7,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/compat.h:14,
from arch/powerpc/kernel/asm-offsets.c:14:
include/linux/string.h:176:15: note: previous definition of 'copy_mc_to_kernel' was here
176 | unsigned long copy_mc_to_kernel(void *dst, const void *src, size_t cnt)
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/uaccess.h:11,
from include/linux/crypto.h:21,
from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/linux/compat.h:15,
from arch/powerpc/kernel/asm-offsets.c:14:
arch/powerpc/include/asm/uaccess.h: In function 'copy_mc_to_kernel':
arch/powerpc/include/asm/uaccess.h:333:9: error: implicit declaration of function 'copy_mc_generic' [-Werror=implicit-function-declaration]
333 | return copy_mc_generic(to, from, size);
| ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:100: arch/powerpc/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1142: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:180: sub-make] Error 2
vim +/copy_mc_to_kernel +331 arch/powerpc/include/asm/uaccess.h
326
327 extern unsigned long __copy_tofrom_user(void __user *to,
328 const void __user *from, unsigned long size);
329
330 static inline unsigned long
> 331 copy_mc_to_kernel(void *to, const void *from, unsigned long size)
332 {
333 return copy_mc_generic(to, from, size);
334 }
335
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH v2 3/7] staging: most: usb: check number of reported endpoints
by kbuild test robot
Hi Christian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on usb/usb-testing linus/master v5.7-rc5 next-20200514]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Christian-Gromm/staging-most-usb...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 8a01032e02c8a0fb3e9f33791023b62dee73cc03
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project a52f10b5a382c040e7ad1ce933cda6c07a4b3a8d)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/staging/most/usb/usb.c:1010:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->busy_urbs)
^~~~~~~~~~~~~~~~
drivers/staging/most/usb/usb.c:1092:9: note: uninitialized use occurs here
return ret;
^~~
drivers/staging/most/usb/usb.c:1010:2: note: remove the 'if' if its condition is always false
if (!mdev->busy_urbs)
^~~~~~~~~~~~~~~~~~~~~
drivers/staging/most/usb/usb.c:1005:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->ep_address)
^~~~~~~~~~~~~~~~~
drivers/staging/most/usb/usb.c:1092:9: note: uninitialized use occurs here
return ret;
^~~
drivers/staging/most/usb/usb.c:1005:2: note: remove the 'if' if its condition is always false
if (!mdev->ep_address)
^~~~~~~~~~~~~~~~~~~~~~
drivers/staging/most/usb/usb.c:999:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->cap)
^~~~~~~~~~
drivers/staging/most/usb/usb.c:1092:9: note: uninitialized use occurs here
return ret;
^~~
drivers/staging/most/usb/usb.c:999:2: note: remove the 'if' if its condition is always false
if (!mdev->cap)
^~~~~~~~~~~~~~~
drivers/staging/most/usb/usb.c:995:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->conf)
^~~~~~~~~~~
drivers/staging/most/usb/usb.c:1092:9: note: uninitialized use occurs here
return ret;
^~~
drivers/staging/most/usb/usb.c:995:2: note: remove the 'if' if its condition is always false
if (!mdev->conf)
^~~~~~~~~~~~~~~~
drivers/staging/most/usb/usb.c:953:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
4 warnings generated.
vim +1010 drivers/staging/most/usb/usb.c
869d3acd488c28 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-28 923
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 924 static void release_mdev(struct device *dev)
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 925 {
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 926 struct most_dev *mdev = to_mdev_from_dev(dev);
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 927
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 928 kfree(mdev);
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 929 }
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 930 /**
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 931 * hdm_probe - probe function of USB device driver
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 932 * @interface: Interface of the attached USB device
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 933 * @id: Pointer to the USB ID table.
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 934 *
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 935 * This allocates and initializes the device instance, adds the new
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 936 * entry to the internal list, scans the USB descriptors and registers
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 937 * the interface with the core.
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 938 * Additionally, the DCI objects are created and the hardware is sync'd.
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 939 *
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 940 * Return 0 on success. In case of an error a negative number is returned.
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 941 */
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 942 static int
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 943 hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 944 {
089612f183efb4 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-08-19 945 struct usb_host_interface *usb_iface_desc = interface->cur_altsetting;
089612f183efb4 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-08-19 946 struct usb_device *usb_dev = interface_to_usbdev(interface);
089612f183efb4 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-08-19 947 struct device *dev = &usb_dev->dev;
089612f183efb4 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-08-19 948 struct most_dev *mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 949 unsigned int i;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 950 unsigned int num_endpoints;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 951 struct most_channel_capability *tmp_cap;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 952 struct usb_endpoint_descriptor *ep_desc;
7f704bf88cc1a9 drivers/staging/most/usb/usb.c Christian Gromm 2020-05-14 953 int ret;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 954
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 955 if (!mdev)
7f704bf88cc1a9 drivers/staging/most/usb/usb.c Christian Gromm 2020-05-14 956 return -ENOMEM;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 957
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 958 usb_set_intfdata(interface, mdev);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 959 num_endpoints = usb_iface_desc->desc.bNumEndpoints;
7f704bf88cc1a9 drivers/staging/most/usb/usb.c Christian Gromm 2020-05-14 960 if (num_endpoints > MAX_NUM_ENDPOINTS) {
7f704bf88cc1a9 drivers/staging/most/usb/usb.c Christian Gromm 2020-05-14 961 kfree(mdev);
7f704bf88cc1a9 drivers/staging/most/usb/usb.c Christian Gromm 2020-05-14 962 return -EINVAL;
7f704bf88cc1a9 drivers/staging/most/usb/usb.c Christian Gromm 2020-05-14 963 }
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 964 mutex_init(&mdev->io_mutex);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 965 INIT_WORK(&mdev->poll_work_obj, wq_netinfo);
e99e88a9d2b067 drivers/staging/most/hdm-usb/hdm_usb.c Kees Cook 2017-10-16 966 timer_setup(&mdev->link_stat_timer, link_stat_timer_handler, 0);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 967
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 968 mdev->usb_device = usb_dev;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 969 mdev->link_stat_timer.expires = jiffies + (2 * HZ);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 970
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 971 mdev->iface.mod = hdm_usb_fops.owner;
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 972 mdev->iface.dev = &mdev->dev;
69c90cf1b2faf5 drivers/staging/most/usb/usb.c Christian Gromm 2018-05-08 973 mdev->iface.driver_dev = &interface->dev;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 974 mdev->iface.interface = ITYPE_USB;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 975 mdev->iface.configure = hdm_configure_channel;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 976 mdev->iface.request_netinfo = hdm_request_netinfo;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 977 mdev->iface.enqueue = hdm_enqueue;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 978 mdev->iface.poison_channel = hdm_poison_channel;
3598cec585f8d5 drivers/staging/most/usb/usb.c Christian Gromm 2018-05-08 979 mdev->iface.dma_alloc = hdm_dma_alloc;
3598cec585f8d5 drivers/staging/most/usb/usb.c Christian Gromm 2018-05-08 980 mdev->iface.dma_free = hdm_dma_free;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 981 mdev->iface.description = mdev->description;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 982 mdev->iface.num_channels = num_endpoints;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 983
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 984 snprintf(mdev->description, sizeof(mdev->description),
5b082c2e07d851 drivers/staging/most/usb/usb.c Christian Gromm 2019-04-03 985 "%d-%s:%d.%d",
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 986 usb_dev->bus->busnum,
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 987 usb_dev->devpath,
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 988 usb_dev->config->desc.bConfigurationValue,
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 989 usb_iface_desc->desc.bInterfaceNumber);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 990
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 991 mdev->dev.init_name = mdev->description;
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 992 mdev->dev.parent = &interface->dev;
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 993 mdev->dev.release = release_mdev;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 994 mdev->conf = kcalloc(num_endpoints, sizeof(*mdev->conf), GFP_KERNEL);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 995 if (!mdev->conf)
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 996 goto err_free_mdev;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 997
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 998 mdev->cap = kcalloc(num_endpoints, sizeof(*mdev->cap), GFP_KERNEL);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 999 if (!mdev->cap)
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1000 goto err_free_conf;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1001
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1002 mdev->iface.channel_vector = mdev->cap;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1003 mdev->ep_address =
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1004 kcalloc(num_endpoints, sizeof(*mdev->ep_address), GFP_KERNEL);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1005 if (!mdev->ep_address)
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1006 goto err_free_cap;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1007
27e6245e35bc6c drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-09-19 1008 mdev->busy_urbs =
27e6245e35bc6c drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-09-19 1009 kcalloc(num_endpoints, sizeof(*mdev->busy_urbs), GFP_KERNEL);
27e6245e35bc6c drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-09-19 @1010 if (!mdev->busy_urbs)
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1011 goto err_free_ep_address;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1012
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1013 tmp_cap = mdev->cap;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1014 for (i = 0; i < num_endpoints; i++) {
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1015 ep_desc = &usb_iface_desc->endpoint[i].desc;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1016 mdev->ep_address[i] = ep_desc->bEndpointAddress;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1017 mdev->padding_active[i] = false;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1018 mdev->is_channel_healthy[i] = true;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1019
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1020 snprintf(&mdev->suffix[i][0], MAX_SUFFIX_LEN, "ep%02x",
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1021 mdev->ep_address[i]);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1022
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1023 tmp_cap->name_suffix = &mdev->suffix[i][0];
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1024 tmp_cap->buffer_size_packet = MAX_BUF_SIZE;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1025 tmp_cap->buffer_size_streaming = MAX_BUF_SIZE;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1026 tmp_cap->num_buffers_packet = BUF_CHAIN_SIZE;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1027 tmp_cap->num_buffers_streaming = BUF_CHAIN_SIZE;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1028 tmp_cap->data_type = MOST_CH_CONTROL | MOST_CH_ASYNC |
0540609fe217c3 drivers/staging/most/hdm-usb/hdm_usb.c Andrey Shvetsov 2016-09-21 1029 MOST_CH_ISOC | MOST_CH_SYNC;
afd14cef0156bc drivers/staging/most/hdm-usb/hdm_usb.c Sandhya Bankar 2016-03-06 1030 if (usb_endpoint_dir_in(ep_desc))
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1031 tmp_cap->direction = MOST_CH_RX;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1032 else
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1033 tmp_cap->direction = MOST_CH_TX;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1034 tmp_cap++;
27e6245e35bc6c drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-09-19 1035 init_usb_anchor(&mdev->busy_urbs[i]);
88d1878bcaa438 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-09-19 1036 spin_lock_init(&mdev->channel_lock[i]);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1037 }
59ed0480b95032 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-30 1038 dev_notice(dev, "claimed gadget: Vendor=%4.4x ProdID=%4.4x Bus=%02x Device=%02x\n",
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1039 le16_to_cpu(usb_dev->descriptor.idVendor),
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1040 le16_to_cpu(usb_dev->descriptor.idProduct),
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1041 usb_dev->bus->busnum,
59ed0480b95032 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-30 1042 usb_dev->devnum);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1043
59ed0480b95032 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-30 1044 dev_notice(dev, "device path: /sys/bus/usb/devices/%d-%s:%d.%d\n",
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1045 usb_dev->bus->busnum,
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1046 usb_dev->devpath,
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1047 usb_dev->config->desc.bConfigurationValue,
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1048 usb_iface_desc->desc.bInterfaceNumber);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1049
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1050 ret = most_register_interface(&mdev->iface);
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1051 if (ret)
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1052 goto err_free_busy_urbs;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1053
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1054 mutex_lock(&mdev->io_mutex);
654f7ec4b3b8ac drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-08-19 1055 if (le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81118 ||
5bf9bd8d19834f drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-08-19 1056 le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81119 ||
5bf9bd8d19834f drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-08-19 1057 le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81210) {
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1058 mdev->dci = kzalloc(sizeof(*mdev->dci), GFP_KERNEL);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1059 if (!mdev->dci) {
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1060 mutex_unlock(&mdev->io_mutex);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1061 most_deregister_interface(&mdev->iface);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1062 ret = -ENOMEM;
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1063 goto err_free_busy_urbs;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1064 }
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1065
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1066 mdev->dci->dev.init_name = "dci";
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 1067 mdev->dci->dev.parent = get_device(mdev->iface.dev);
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1068 mdev->dci->dev.groups = dci_attr_groups;
869d3acd488c28 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-28 1069 mdev->dci->dev.release = release_dci;
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1070 if (device_register(&mdev->dci->dev)) {
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1071 mutex_unlock(&mdev->io_mutex);
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1072 most_deregister_interface(&mdev->iface);
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1073 ret = -ENOMEM;
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1074 goto err_free_dci;
4d5f022f3a664e drivers/staging/most/usb/usb.c Christian Gromm 2017-11-21 1075 }
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1076 mdev->dci->usb_device = mdev->usb_device;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1077 }
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1078 mutex_unlock(&mdev->io_mutex);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1079 return 0;
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1080 err_free_dci:
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 1081 put_device(&mdev->dci->dev);
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1082 err_free_busy_urbs:
27e6245e35bc6c drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2016-09-19 1083 kfree(mdev->busy_urbs);
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1084 err_free_ep_address:
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1085 kfree(mdev->ep_address);
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1086 err_free_cap:
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1087 kfree(mdev->cap);
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1088 err_free_conf:
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1089 kfree(mdev->conf);
bddd3c2546e9c4 drivers/staging/most/usb/usb.c Christian Gromm 2018-09-21 1090 err_free_mdev:
723de0f9171eeb drivers/staging/most/usb/usb.c Christian Gromm 2020-01-23 1091 put_device(&mdev->dev);
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1092 return ret;
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1093 }
a4198cdf0c3460 drivers/staging/most/hdm-usb/hdm_usb.c Christian Gromm 2015-07-24 1094
:::::: The code at line 1010 was first introduced by commit
:::::: 27e6245e35bc6c20c2933d7d8afa562623be1ef5 staging: most: hdm-usb: remove proprietary urb anchoring
:::::: TO: Christian Gromm <christian.gromm(a)microchip.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
2 years, 4 months
[lpieralisi:for-review/acpi-iort-id-rework 10/11] drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c:137:2: error: implicit declaration of function 'acpi_table_parse_madt'; did you mean 'acpi_table_parse'?
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git for-review/acpi-iort-id-rework
head: 4582b00b57ab0807e87d54621173a29352109551
commit: da6f5b04155d19158b2e17bcfe04f143f7c93b76 [10/11] bus: fsl-mc: Add ACPI support for fsl-mc
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout da6f5b04155d19158b2e17bcfe04f143f7c93b76
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c:107:33: warning: 'union acpi_subtable_headers' declared inside parameter list will not be visible outside of this definition or declaration
107 | its_fsl_mc_msi_parse_madt(union acpi_subtable_headers *header,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c: In function 'its_fsl_mc_acpi_msi_init':
>> drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c:137:2: error: implicit declaration of function 'acpi_table_parse_madt'; did you mean 'acpi_table_parse'? [-Werror=implicit-function-declaration]
137 | acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
| ^~~~~~~~~~~~~~~~~~~~~
| acpi_table_parse
cc1: some warnings being treated as errors
vim +137 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c
105
106 static int __init
> 107 its_fsl_mc_msi_parse_madt(union acpi_subtable_headers *header,
108 const unsigned long end)
109 {
110 struct acpi_madt_generic_translator *its_entry;
111 struct fwnode_handle *dom_handle;
112 const char *node_name;
113 int err = -ENXIO;
114
115 its_entry = (struct acpi_madt_generic_translator *)header;
116 node_name = kasprintf(GFP_KERNEL, "ITS@0x%lx",
117 (long)its_entry->base_address);
118
119 dom_handle = iort_find_domain_token(its_entry->translation_id);
120 if (!dom_handle) {
121 pr_err("%s: Unable to locate ITS domain handle\n", node_name);
122 goto out;
123 }
124
125 err = its_fsl_mc_msi_init_one(dom_handle, node_name);
126 if (!err)
127 pr_info("fsl-mc MSI: %s domain created\n", node_name);
128
129 out:
130 kfree(node_name);
131 return err;
132 }
133
134
135 static int __init its_fsl_mc_acpi_msi_init(void)
136 {
> 137 acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
138 its_fsl_mc_msi_parse_madt, 0);
139
140 return 0;
141 }
142
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[baolu:iommu/next/20200514 4/16] drivers/iommu/intel-svm.c:367:22-26: ERROR: svm is NULL but dereferenced. (fwd)
by Julia Lawall
Hello,
Line 367 requires svm to be a valid pointer. This will cause problems
with at least the gotos on lines 266 and 300.
julia
---------- Forwarded message ----------
Date: Thu, 14 May 2020 18:31:21 +0800
From: kbuild test robot <lkp(a)intel.com>
To: kbuild(a)lists.01.org
Cc: lkp(a)intel.com, Julia Lawall <julia.lawall(a)lip6.fr>
Subject: [baolu:iommu/next/20200514 4/16] drivers/iommu/intel-svm.c:367:22-26:
ERROR: svm is NULL but dereferenced.
CC: kbuild-all(a)lists.01.org
CC: Baolu Lu <baolu.lu(a)intel.com>
TO: Lu Baolu <baolu.lu(a)linux.intel.com>
tree: baolu/iommu/next/20200514
head: 28c528ddc9501f8caba71dba375bd1d35403dd4b
commit: 64e95c1afbadc5601bc100f6424b1848888613f7 [4/16] iommu/vt-d: Add bind guest PASID support
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/iommu/intel-svm.c:367:22-26: ERROR: svm is NULL but dereferenced.
git remote add baolu git://bee.sh.intel.com/git/blu2/usb.git
git remote update baolu
git checkout 64e95c1afbadc5601bc100f6424b1848888613f7
vim +367 drivers/iommu/intel-svm.c
2f26e0a9c9860d David Woodhouse 2015-09-09 224
034d473109e907 Jacob Pan 2020-01-02 225 #define for_each_svm_dev(sdev, svm, d) \
034d473109e907 Jacob Pan 2020-01-02 226 list_for_each_entry((sdev), &(svm)->devs, list) \
034d473109e907 Jacob Pan 2020-01-02 227 if ((d) != (sdev)->dev) {} else
034d473109e907 Jacob Pan 2020-01-02 228
64e95c1afbadc5 Jacob Pan 2020-05-14 229 int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev,
64e95c1afbadc5 Jacob Pan 2020-05-14 230 struct iommu_gpasid_bind_data *data)
64e95c1afbadc5 Jacob Pan 2020-05-14 231 {
64e95c1afbadc5 Jacob Pan 2020-05-14 232 struct intel_iommu *iommu = intel_svm_device_to_iommu(dev);
64e95c1afbadc5 Jacob Pan 2020-05-14 233 struct dmar_domain *dmar_domain;
64e95c1afbadc5 Jacob Pan 2020-05-14 234 struct intel_svm_dev *sdev;
64e95c1afbadc5 Jacob Pan 2020-05-14 235 struct intel_svm *svm;
64e95c1afbadc5 Jacob Pan 2020-05-14 236 int ret = 0;
64e95c1afbadc5 Jacob Pan 2020-05-14 237
64e95c1afbadc5 Jacob Pan 2020-05-14 238 if (WARN_ON(!iommu) || !data)
64e95c1afbadc5 Jacob Pan 2020-05-14 239 return -EINVAL;
64e95c1afbadc5 Jacob Pan 2020-05-14 240
64e95c1afbadc5 Jacob Pan 2020-05-14 241 if (data->version != IOMMU_GPASID_BIND_VERSION_1 ||
64e95c1afbadc5 Jacob Pan 2020-05-14 242 data->format != IOMMU_PASID_FORMAT_INTEL_VTD)
64e95c1afbadc5 Jacob Pan 2020-05-14 243 return -EINVAL;
64e95c1afbadc5 Jacob Pan 2020-05-14 244
64e95c1afbadc5 Jacob Pan 2020-05-14 245 if (dev_is_pci(dev)) {
64e95c1afbadc5 Jacob Pan 2020-05-14 246 /* VT-d supports devices with full 20 bit PASIDs only */
64e95c1afbadc5 Jacob Pan 2020-05-14 247 if (pci_max_pasids(to_pci_dev(dev)) != PASID_MAX)
64e95c1afbadc5 Jacob Pan 2020-05-14 248 return -EINVAL;
64e95c1afbadc5 Jacob Pan 2020-05-14 249 } else {
64e95c1afbadc5 Jacob Pan 2020-05-14 250 return -ENOTSUPP;
64e95c1afbadc5 Jacob Pan 2020-05-14 251 }
64e95c1afbadc5 Jacob Pan 2020-05-14 252
64e95c1afbadc5 Jacob Pan 2020-05-14 253 /*
64e95c1afbadc5 Jacob Pan 2020-05-14 254 * We only check host PASID range, we have no knowledge to check
64e95c1afbadc5 Jacob Pan 2020-05-14 255 * guest PASID range.
64e95c1afbadc5 Jacob Pan 2020-05-14 256 */
64e95c1afbadc5 Jacob Pan 2020-05-14 257 if (data->hpasid <= 0 || data->hpasid >= PASID_MAX)
64e95c1afbadc5 Jacob Pan 2020-05-14 258 return -EINVAL;
64e95c1afbadc5 Jacob Pan 2020-05-14 259
64e95c1afbadc5 Jacob Pan 2020-05-14 260 dmar_domain = to_dmar_domain(domain);
64e95c1afbadc5 Jacob Pan 2020-05-14 261
64e95c1afbadc5 Jacob Pan 2020-05-14 262 mutex_lock(&pasid_mutex);
64e95c1afbadc5 Jacob Pan 2020-05-14 263 svm = ioasid_find(NULL, data->hpasid, NULL);
64e95c1afbadc5 Jacob Pan 2020-05-14 264 if (IS_ERR(svm)) {
64e95c1afbadc5 Jacob Pan 2020-05-14 265 ret = PTR_ERR(svm);
64e95c1afbadc5 Jacob Pan 2020-05-14 266 goto out;
64e95c1afbadc5 Jacob Pan 2020-05-14 267 }
64e95c1afbadc5 Jacob Pan 2020-05-14 268
64e95c1afbadc5 Jacob Pan 2020-05-14 269 if (svm) {
64e95c1afbadc5 Jacob Pan 2020-05-14 270 /*
64e95c1afbadc5 Jacob Pan 2020-05-14 271 * If we found svm for the PASID, there must be at
64e95c1afbadc5 Jacob Pan 2020-05-14 272 * least one device bond, otherwise svm should be freed.
64e95c1afbadc5 Jacob Pan 2020-05-14 273 */
64e95c1afbadc5 Jacob Pan 2020-05-14 274 if (WARN_ON(list_empty(&svm->devs))) {
64e95c1afbadc5 Jacob Pan 2020-05-14 275 ret = -EINVAL;
64e95c1afbadc5 Jacob Pan 2020-05-14 276 goto out;
64e95c1afbadc5 Jacob Pan 2020-05-14 277 }
64e95c1afbadc5 Jacob Pan 2020-05-14 278
64e95c1afbadc5 Jacob Pan 2020-05-14 279 for_each_svm_dev(sdev, svm, dev) {
64e95c1afbadc5 Jacob Pan 2020-05-14 280 /*
64e95c1afbadc5 Jacob Pan 2020-05-14 281 * For devices with aux domains, we should allow
64e95c1afbadc5 Jacob Pan 2020-05-14 282 * multiple bind calls with the same PASID and pdev.
64e95c1afbadc5 Jacob Pan 2020-05-14 283 */
64e95c1afbadc5 Jacob Pan 2020-05-14 284 if (iommu_dev_feature_enabled(dev,
64e95c1afbadc5 Jacob Pan 2020-05-14 285 IOMMU_DEV_FEAT_AUX)) {
64e95c1afbadc5 Jacob Pan 2020-05-14 286 sdev->users++;
64e95c1afbadc5 Jacob Pan 2020-05-14 287 } else {
64e95c1afbadc5 Jacob Pan 2020-05-14 288 dev_warn_ratelimited(dev,
64e95c1afbadc5 Jacob Pan 2020-05-14 289 "Already bound with PASID %u\n",
64e95c1afbadc5 Jacob Pan 2020-05-14 290 svm->pasid);
64e95c1afbadc5 Jacob Pan 2020-05-14 291 ret = -EBUSY;
64e95c1afbadc5 Jacob Pan 2020-05-14 292 }
64e95c1afbadc5 Jacob Pan 2020-05-14 293 goto out;
64e95c1afbadc5 Jacob Pan 2020-05-14 294 }
64e95c1afbadc5 Jacob Pan 2020-05-14 295 } else {
64e95c1afbadc5 Jacob Pan 2020-05-14 296 /* We come here when PASID has never been bond to a device. */
64e95c1afbadc5 Jacob Pan 2020-05-14 297 svm = kzalloc(sizeof(*svm), GFP_KERNEL);
64e95c1afbadc5 Jacob Pan 2020-05-14 298 if (!svm) {
64e95c1afbadc5 Jacob Pan 2020-05-14 299 ret = -ENOMEM;
64e95c1afbadc5 Jacob Pan 2020-05-14 300 goto out;
64e95c1afbadc5 Jacob Pan 2020-05-14 301 }
64e95c1afbadc5 Jacob Pan 2020-05-14 302 /* REVISIT: upper layer/VFIO can track host process that bind
64e95c1afbadc5 Jacob Pan 2020-05-14 303 * the PASID. ioasid_set = mm might be sufficient for vfio to
64e95c1afbadc5 Jacob Pan 2020-05-14 304 * check pasid VMM ownership. We can drop the following line
64e95c1afbadc5 Jacob Pan 2020-05-14 305 * once VFIO and IOASID set check is in place.
64e95c1afbadc5 Jacob Pan 2020-05-14 306 */
64e95c1afbadc5 Jacob Pan 2020-05-14 307 svm->mm = get_task_mm(current);
64e95c1afbadc5 Jacob Pan 2020-05-14 308 svm->pasid = data->hpasid;
64e95c1afbadc5 Jacob Pan 2020-05-14 309 if (data->flags & IOMMU_SVA_GPASID_VAL) {
64e95c1afbadc5 Jacob Pan 2020-05-14 310 svm->gpasid = data->gpasid;
64e95c1afbadc5 Jacob Pan 2020-05-14 311 svm->flags |= SVM_FLAG_GUEST_PASID;
64e95c1afbadc5 Jacob Pan 2020-05-14 312 }
64e95c1afbadc5 Jacob Pan 2020-05-14 313 ioasid_set_data(data->hpasid, svm);
64e95c1afbadc5 Jacob Pan 2020-05-14 314 INIT_LIST_HEAD_RCU(&svm->devs);
64e95c1afbadc5 Jacob Pan 2020-05-14 315 mmput(svm->mm);
64e95c1afbadc5 Jacob Pan 2020-05-14 316 }
64e95c1afbadc5 Jacob Pan 2020-05-14 317 sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
64e95c1afbadc5 Jacob Pan 2020-05-14 318 if (!sdev) {
64e95c1afbadc5 Jacob Pan 2020-05-14 319 ret = -ENOMEM;
64e95c1afbadc5 Jacob Pan 2020-05-14 320 goto out;
64e95c1afbadc5 Jacob Pan 2020-05-14 321 }
64e95c1afbadc5 Jacob Pan 2020-05-14 322 sdev->dev = dev;
64e95c1afbadc5 Jacob Pan 2020-05-14 323
64e95c1afbadc5 Jacob Pan 2020-05-14 324 /* Only count users if device has aux domains */
64e95c1afbadc5 Jacob Pan 2020-05-14 325 if (iommu_dev_feature_enabled(dev, IOMMU_DEV_FEAT_AUX))
64e95c1afbadc5 Jacob Pan 2020-05-14 326 sdev->users = 1;
64e95c1afbadc5 Jacob Pan 2020-05-14 327
64e95c1afbadc5 Jacob Pan 2020-05-14 328 /* Set up device context entry for PASID if not enabled already */
64e95c1afbadc5 Jacob Pan 2020-05-14 329 ret = intel_iommu_enable_pasid(iommu, sdev->dev);
64e95c1afbadc5 Jacob Pan 2020-05-14 330 if (ret) {
64e95c1afbadc5 Jacob Pan 2020-05-14 331 dev_err_ratelimited(dev, "Failed to enable PASID capability\n");
64e95c1afbadc5 Jacob Pan 2020-05-14 332 kfree(sdev);
64e95c1afbadc5 Jacob Pan 2020-05-14 333 goto out;
64e95c1afbadc5 Jacob Pan 2020-05-14 334 }
64e95c1afbadc5 Jacob Pan 2020-05-14 335
64e95c1afbadc5 Jacob Pan 2020-05-14 336 /*
64e95c1afbadc5 Jacob Pan 2020-05-14 337 * PASID table is per device for better security. Therefore, for
64e95c1afbadc5 Jacob Pan 2020-05-14 338 * each bind of a new device even with an existing PASID, we need to
64e95c1afbadc5 Jacob Pan 2020-05-14 339 * call the nested mode setup function here.
64e95c1afbadc5 Jacob Pan 2020-05-14 340 */
64e95c1afbadc5 Jacob Pan 2020-05-14 341 spin_lock(&iommu->lock);
64e95c1afbadc5 Jacob Pan 2020-05-14 342 ret = intel_pasid_setup_nested(iommu,
64e95c1afbadc5 Jacob Pan 2020-05-14 343 dev,
64e95c1afbadc5 Jacob Pan 2020-05-14 344 (pgd_t *)data->gpgd,
64e95c1afbadc5 Jacob Pan 2020-05-14 345 data->hpasid,
64e95c1afbadc5 Jacob Pan 2020-05-14 346 &data->vtd,
64e95c1afbadc5 Jacob Pan 2020-05-14 347 dmar_domain,
64e95c1afbadc5 Jacob Pan 2020-05-14 348 data->addr_width);
64e95c1afbadc5 Jacob Pan 2020-05-14 349 spin_unlock(&iommu->lock);
64e95c1afbadc5 Jacob Pan 2020-05-14 350 if (ret) {
64e95c1afbadc5 Jacob Pan 2020-05-14 351 dev_err_ratelimited(dev, "Failed to set up PASID %llu in nested mode, Err %d\n",
64e95c1afbadc5 Jacob Pan 2020-05-14 352 data->hpasid, ret);
64e95c1afbadc5 Jacob Pan 2020-05-14 353 /*
64e95c1afbadc5 Jacob Pan 2020-05-14 354 * PASID entry should be in cleared state if nested mode
64e95c1afbadc5 Jacob Pan 2020-05-14 355 * set up failed. So we only need to clear IOASID tracking
64e95c1afbadc5 Jacob Pan 2020-05-14 356 * data such that free call will succeed.
64e95c1afbadc5 Jacob Pan 2020-05-14 357 */
64e95c1afbadc5 Jacob Pan 2020-05-14 358 kfree(sdev);
64e95c1afbadc5 Jacob Pan 2020-05-14 359 goto out;
64e95c1afbadc5 Jacob Pan 2020-05-14 360 }
64e95c1afbadc5 Jacob Pan 2020-05-14 361
64e95c1afbadc5 Jacob Pan 2020-05-14 362 svm->flags |= SVM_FLAG_GUEST_MODE;
64e95c1afbadc5 Jacob Pan 2020-05-14 363
64e95c1afbadc5 Jacob Pan 2020-05-14 364 init_rcu_head(&sdev->rcu);
64e95c1afbadc5 Jacob Pan 2020-05-14 365 list_add_rcu(&sdev->list, &svm->devs);
64e95c1afbadc5 Jacob Pan 2020-05-14 366 out:
64e95c1afbadc5 Jacob Pan 2020-05-14 @367 if (list_empty(&svm->devs)) {
64e95c1afbadc5 Jacob Pan 2020-05-14 368 ioasid_set_data(data->hpasid, NULL);
64e95c1afbadc5 Jacob Pan 2020-05-14 369 kfree(svm);
64e95c1afbadc5 Jacob Pan 2020-05-14 370 }
64e95c1afbadc5 Jacob Pan 2020-05-14 371
64e95c1afbadc5 Jacob Pan 2020-05-14 372 mutex_unlock(&pasid_mutex);
64e95c1afbadc5 Jacob Pan 2020-05-14 373 return ret;
64e95c1afbadc5 Jacob Pan 2020-05-14 374 }
64e95c1afbadc5 Jacob Pan 2020-05-14 375
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[lpieralisi:for-review/acpi-iort-id-rework 8/11] include/linux/of_irq.h:87:34: error: 'of_msi_map_get_device_domain' declared 'static' but never defined
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git for-review/acpi-iort-id-rework
head: 4582b00b57ab0807e87d54621173a29352109551
commit: b5e9dd56ea850bb71fb0532c7d4be9d5e82132e6 [8/11] of/irq: make of_msi_map_get_device_domain bus agnostic
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout b5e9dd56ea850bb71fb0532c7d4be9d5e82132e6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
In file included from arch/sparc/kernel/of_device_common.c:12:
include/linux/of_irq.h:89:1: error: expected identifier or '(' before '{' token
89 | {
| ^
>> include/linux/of_irq.h:87:34: error: 'of_msi_map_get_device_domain' declared 'static' but never defined [-Werror=unused-function]
87 | static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +87 include/linux/of_irq.h
4c3141e09cfa64 Carlo Caione 2015-12-01 80
48ae34fb39b0c0 Marc Zyngier 2015-09-18 81 static inline struct irq_domain *of_msi_get_domain(struct device *dev,
48ae34fb39b0c0 Marc Zyngier 2015-09-18 82 struct device_node *np,
48ae34fb39b0c0 Marc Zyngier 2015-09-18 83 enum irq_domain_bus_token token)
48ae34fb39b0c0 Marc Zyngier 2015-09-18 84 {
48ae34fb39b0c0 Marc Zyngier 2015-09-18 85 return NULL;
48ae34fb39b0c0 Marc Zyngier 2015-09-18 86 }
82b9b4243c6d99 Marc Zyngier 2015-10-02 @87 static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
b5e9dd56ea850b Diana Craciun 2020-04-29 88 u32 id, u32 bus_token);
82b9b4243c6d99 Marc Zyngier 2015-10-02 @89 {
82b9b4243c6d99 Marc Zyngier 2015-10-02 90 return NULL;
82b9b4243c6d99 Marc Zyngier 2015-10-02 91 }
f9f9f11dcf0f3b Jonas Gorski 2015-10-12 92 static inline void of_msi_configure(struct device *dev, struct device_node *np)
f9f9f11dcf0f3b Jonas Gorski 2015-10-12 93 {
f9f9f11dcf0f3b Jonas Gorski 2015-10-12 94 }
eaddb5725357e9 Rob Herring 2015-12-09 95 static inline u32 of_msi_map_rid(struct device *dev,
eaddb5725357e9 Rob Herring 2015-12-09 96 struct device_node *msi_np, u32 rid_in)
eaddb5725357e9 Rob Herring 2015-12-09 97 {
eaddb5725357e9 Rob Herring 2015-12-09 98 return rid_in;
eaddb5725357e9 Rob Herring 2015-12-09 99 }
a8d3f362f52b65 Rob Herring 2013-11-07 100 #endif
a8d3f362f52b65 Rob Herring 2013-11-07 101
:::::: The code at line 87 was first introduced by commit
:::::: 82b9b4243c6d99d9e38087fa89183aa7479185e9 of/irq: Use the msi-map property to provide device-specific MSI domain
:::::: TO: Marc Zyngier <marc.zyngier(a)arm.com>
:::::: CC: Marc Zyngier <marc.zyngier(a)arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[dm:dm-5.8 55/57] include/linux/device-mapper.h:626:2: error: #endif without #if
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git dm-5.8
head: 2e374fada9514fe10561a41838a52dc05f0317b4
commit: 6e1746c86200d4cd2562abe0a4b2892e3be04271 [55/57] dm: use dynamic debug instead of compile-time config option
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 6e1746c86200d4cd2562abe0a4b2892e3be04271
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
In file included from drivers/md/dm.h:14,
from drivers/md/dm-uevent.c:14:
>> include/linux/device-mapper.h:626:2: error: #endif without #if
626 | #endif /* _LINUX_DEVICE_MAPPER_H */
| ^~~~~
--
In file included from drivers/md/dm.h:14,
from drivers/md/dm-linear.c:7:
>> include/linux/device-mapper.h:626:2: error: #endif without #if
626 | #endif /* _LINUX_DEVICE_MAPPER_H */
| ^~~~~
In file included from drivers/md/dm-linear.c:14:
>> include/linux/device-mapper.h:616:24: error: redefinition of 'to_sector'
616 | static inline sector_t to_sector(unsigned long long n)
| ^~~~~~~~~
In file included from drivers/md/dm.h:14,
from drivers/md/dm-linear.c:7:
include/linux/device-mapper.h:616:24: note: previous definition of 'to_sector' was here
616 | static inline sector_t to_sector(unsigned long long n)
| ^~~~~~~~~
In file included from drivers/md/dm-linear.c:14:
>> include/linux/device-mapper.h:621:29: error: redefinition of 'to_bytes'
621 | static inline unsigned long to_bytes(sector_t n)
| ^~~~~~~~
In file included from drivers/md/dm.h:14,
from drivers/md/dm-linear.c:7:
include/linux/device-mapper.h:621:29: note: previous definition of 'to_bytes' was here
621 | static inline unsigned long to_bytes(sector_t n)
| ^~~~~~~~
In file included from drivers/md/dm-linear.c:14:
>> include/linux/device-mapper.h:626:2: error: #endif without #if
626 | #endif /* _LINUX_DEVICE_MAPPER_H */
| ^~~~~
--
In file included from drivers/md/dm-snap.c:8:
>> include/linux/device-mapper.h:626:2: error: #endif without #if
626 | #endif /* _LINUX_DEVICE_MAPPER_H */
| ^~~~~
In file included from drivers/md/dm.h:14,
from drivers/md/dm-snap.c:22:
>> include/linux/device-mapper.h:616:24: error: redefinition of 'to_sector'
616 | static inline sector_t to_sector(unsigned long long n)
| ^~~~~~~~~
In file included from drivers/md/dm-snap.c:8:
include/linux/device-mapper.h:616:24: note: previous definition of 'to_sector' was here
616 | static inline sector_t to_sector(unsigned long long n)
| ^~~~~~~~~
In file included from drivers/md/dm.h:14,
from drivers/md/dm-snap.c:22:
>> include/linux/device-mapper.h:621:29: error: redefinition of 'to_bytes'
621 | static inline unsigned long to_bytes(sector_t n)
| ^~~~~~~~
In file included from drivers/md/dm-snap.c:8:
include/linux/device-mapper.h:621:29: note: previous definition of 'to_bytes' was here
621 | static inline unsigned long to_bytes(sector_t n)
| ^~~~~~~~
In file included from drivers/md/dm.h:14,
from drivers/md/dm-snap.c:22:
>> include/linux/device-mapper.h:626:2: error: #endif without #if
626 | #endif /* _LINUX_DEVICE_MAPPER_H */
| ^~~~~
In file included from drivers/md/dm-exception-store.h:15,
from drivers/md/dm-snap.c:24:
>> include/linux/device-mapper.h:616:24: error: redefinition of 'to_sector'
616 | static inline sector_t to_sector(unsigned long long n)
| ^~~~~~~~~
In file included from drivers/md/dm.h:14,
from drivers/md/dm-snap.c:22:
include/linux/device-mapper.h:616:24: note: previous definition of 'to_sector' was here
616 | static inline sector_t to_sector(unsigned long long n)
| ^~~~~~~~~
In file included from drivers/md/dm-exception-store.h:15,
from drivers/md/dm-snap.c:24:
>> include/linux/device-mapper.h:621:29: error: redefinition of 'to_bytes'
621 | static inline unsigned long to_bytes(sector_t n)
| ^~~~~~~~
In file included from drivers/md/dm.h:14,
from drivers/md/dm-snap.c:22:
include/linux/device-mapper.h:621:29: note: previous definition of 'to_bytes' was here
621 | static inline unsigned long to_bytes(sector_t n)
| ^~~~~~~~
In file included from drivers/md/dm-exception-store.h:15,
from drivers/md/dm-snap.c:24:
>> include/linux/device-mapper.h:626:2: error: #endif without #if
626 | #endif /* _LINUX_DEVICE_MAPPER_H */
| ^~~~~
--
In file included from drivers/md/dm-zoned.h:13,
from drivers/md/dm-zoned-metadata.c:8:
>> include/linux/device-mapper.h:626:2: error: #endif without #if
626 | #endif /* _LINUX_DEVICE_MAPPER_H */
| ^~~~~
drivers/md/dm-zoned-metadata.c: In function 'dmz_write_sb':
drivers/md/dm-zoned-metadata.c:779:3: error: implicit declaration of function 'export_uuid' [-Werror=implicit-function-declaration]
779 | export_uuid(sb->dmz_uuid, &zmd->uuid);
| ^~~~~~~~~~~
drivers/md/dm-zoned-metadata.c: In function 'dmz_check_sb':
drivers/md/dm-zoned-metadata.c:1015:3: error: implicit declaration of function 'import_uuid' [-Werror=implicit-function-declaration]
1015 | import_uuid(&sb_uuid, sb->dmz_uuid);
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
vim +626 include/linux/device-mapper.h
56a67df7660396 Mike Snitzer 2010-08-12 615
0bdb50c531f737 NeilBrown 2019-01-06 @616 static inline sector_t to_sector(unsigned long long n)
0da336e5fab75c Alasdair G Kergon 2008-04-24 617 {
0da336e5fab75c Alasdair G Kergon 2008-04-24 618 return (n >> SECTOR_SHIFT);
0da336e5fab75c Alasdair G Kergon 2008-04-24 619 }
0da336e5fab75c Alasdair G Kergon 2008-04-24 620
0da336e5fab75c Alasdair G Kergon 2008-04-24 @621 static inline unsigned long to_bytes(sector_t n)
0da336e5fab75c Alasdair G Kergon 2008-04-24 622 {
0da336e5fab75c Alasdair G Kergon 2008-04-24 623 return (n << SECTOR_SHIFT);
0da336e5fab75c Alasdair G Kergon 2008-04-24 624 }
0da336e5fab75c Alasdair G Kergon 2008-04-24 625
^1da177e4c3f41 Linus Torvalds 2005-04-16 @626 #endif /* _LINUX_DEVICE_MAPPER_H */
:::::: The code at line 626 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
2 years, 4 months
Re: [PATCH v2 4/8] drivers: most: usb: check number of reported endpoints
by kbuild test robot
Hi Christian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on usb/usb-testing linus/master v5.7-rc5 next-20200514]
[cannot apply to balbi-usb/next peter.chen-usb/ci-for-usb-next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Christian-Gromm/staging-most-mov...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 8a01032e02c8a0fb3e9f33791023b62dee73cc03
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project a52f10b5a382c040e7ad1ce933cda6c07a4b3a8d)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/most/most_usb.c:1104:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->busy_urbs)
^~~~~~~~~~~~~~~~
drivers/most/most_usb.c:1186:9: note: uninitialized use occurs here
return ret;
^~~
drivers/most/most_usb.c:1104:2: note: remove the 'if' if its condition is always false
if (!mdev->busy_urbs)
^~~~~~~~~~~~~~~~~~~~~
drivers/most/most_usb.c:1099:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->ep_address)
^~~~~~~~~~~~~~~~~
drivers/most/most_usb.c:1186:9: note: uninitialized use occurs here
return ret;
^~~
drivers/most/most_usb.c:1099:2: note: remove the 'if' if its condition is always false
if (!mdev->ep_address)
^~~~~~~~~~~~~~~~~~~~~~
drivers/most/most_usb.c:1093:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->cap)
^~~~~~~~~~
drivers/most/most_usb.c:1186:9: note: uninitialized use occurs here
return ret;
^~~
drivers/most/most_usb.c:1093:2: note: remove the 'if' if its condition is always false
if (!mdev->cap)
^~~~~~~~~~~~~~~
drivers/most/most_usb.c:1089:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mdev->conf)
^~~~~~~~~~~
drivers/most/most_usb.c:1186:9: note: uninitialized use occurs here
return ret;
^~~
drivers/most/most_usb.c:1089:2: note: remove the 'if' if its condition is always false
if (!mdev->conf)
^~~~~~~~~~~~~~~~
drivers/most/most_usb.c:1047:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
4 warnings generated.
vim +1104 drivers/most/most_usb.c
56c7d34c835125c6 Christian Gromm 2020-05-14 1017
56c7d34c835125c6 Christian Gromm 2020-05-14 1018 static void release_mdev(struct device *dev)
56c7d34c835125c6 Christian Gromm 2020-05-14 1019 {
56c7d34c835125c6 Christian Gromm 2020-05-14 1020 struct most_dev *mdev = to_mdev_from_dev(dev);
56c7d34c835125c6 Christian Gromm 2020-05-14 1021
56c7d34c835125c6 Christian Gromm 2020-05-14 1022 kfree(mdev);
56c7d34c835125c6 Christian Gromm 2020-05-14 1023 }
56c7d34c835125c6 Christian Gromm 2020-05-14 1024 /**
56c7d34c835125c6 Christian Gromm 2020-05-14 1025 * hdm_probe - probe function of USB device driver
56c7d34c835125c6 Christian Gromm 2020-05-14 1026 * @interface: Interface of the attached USB device
56c7d34c835125c6 Christian Gromm 2020-05-14 1027 * @id: Pointer to the USB ID table.
56c7d34c835125c6 Christian Gromm 2020-05-14 1028 *
56c7d34c835125c6 Christian Gromm 2020-05-14 1029 * This allocates and initializes the device instance, adds the new
56c7d34c835125c6 Christian Gromm 2020-05-14 1030 * entry to the internal list, scans the USB descriptors and registers
56c7d34c835125c6 Christian Gromm 2020-05-14 1031 * the interface with the core.
56c7d34c835125c6 Christian Gromm 2020-05-14 1032 * Additionally, the DCI objects are created and the hardware is sync'd.
56c7d34c835125c6 Christian Gromm 2020-05-14 1033 *
56c7d34c835125c6 Christian Gromm 2020-05-14 1034 * Return 0 on success. In case of an error a negative number is returned.
56c7d34c835125c6 Christian Gromm 2020-05-14 1035 */
56c7d34c835125c6 Christian Gromm 2020-05-14 1036 static int
56c7d34c835125c6 Christian Gromm 2020-05-14 1037 hdm_probe(struct usb_interface *interface, const struct usb_device_id *id)
56c7d34c835125c6 Christian Gromm 2020-05-14 1038 {
56c7d34c835125c6 Christian Gromm 2020-05-14 1039 struct usb_host_interface *usb_iface_desc = interface->cur_altsetting;
56c7d34c835125c6 Christian Gromm 2020-05-14 1040 struct usb_device *usb_dev = interface_to_usbdev(interface);
56c7d34c835125c6 Christian Gromm 2020-05-14 1041 struct device *dev = &usb_dev->dev;
56c7d34c835125c6 Christian Gromm 2020-05-14 1042 struct most_dev *mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
56c7d34c835125c6 Christian Gromm 2020-05-14 1043 unsigned int i;
56c7d34c835125c6 Christian Gromm 2020-05-14 1044 unsigned int num_endpoints;
56c7d34c835125c6 Christian Gromm 2020-05-14 1045 struct most_channel_capability *tmp_cap;
56c7d34c835125c6 Christian Gromm 2020-05-14 1046 struct usb_endpoint_descriptor *ep_desc;
220484e072685b00 Christian Gromm 2020-05-14 1047 int ret;
56c7d34c835125c6 Christian Gromm 2020-05-14 1048
56c7d34c835125c6 Christian Gromm 2020-05-14 1049 if (!mdev)
220484e072685b00 Christian Gromm 2020-05-14 1050 return -ENOMEM;
56c7d34c835125c6 Christian Gromm 2020-05-14 1051
56c7d34c835125c6 Christian Gromm 2020-05-14 1052 usb_set_intfdata(interface, mdev);
56c7d34c835125c6 Christian Gromm 2020-05-14 1053 num_endpoints = usb_iface_desc->desc.bNumEndpoints;
220484e072685b00 Christian Gromm 2020-05-14 1054 if (num_endpoints > MAX_NUM_ENDPOINTS) {
220484e072685b00 Christian Gromm 2020-05-14 1055 kfree(mdev);
220484e072685b00 Christian Gromm 2020-05-14 1056 return -EINVAL;
220484e072685b00 Christian Gromm 2020-05-14 1057 }
56c7d34c835125c6 Christian Gromm 2020-05-14 1058 mutex_init(&mdev->io_mutex);
56c7d34c835125c6 Christian Gromm 2020-05-14 1059 INIT_WORK(&mdev->poll_work_obj, wq_netinfo);
56c7d34c835125c6 Christian Gromm 2020-05-14 1060 timer_setup(&mdev->link_stat_timer, link_stat_timer_handler, 0);
56c7d34c835125c6 Christian Gromm 2020-05-14 1061
56c7d34c835125c6 Christian Gromm 2020-05-14 1062 mdev->usb_device = usb_dev;
56c7d34c835125c6 Christian Gromm 2020-05-14 1063 mdev->link_stat_timer.expires = jiffies + (2 * HZ);
56c7d34c835125c6 Christian Gromm 2020-05-14 1064
56c7d34c835125c6 Christian Gromm 2020-05-14 1065 mdev->iface.mod = hdm_usb_fops.owner;
56c7d34c835125c6 Christian Gromm 2020-05-14 1066 mdev->iface.dev = &mdev->dev;
56c7d34c835125c6 Christian Gromm 2020-05-14 1067 mdev->iface.driver_dev = &interface->dev;
56c7d34c835125c6 Christian Gromm 2020-05-14 1068 mdev->iface.interface = ITYPE_USB;
56c7d34c835125c6 Christian Gromm 2020-05-14 1069 mdev->iface.configure = hdm_configure_channel;
56c7d34c835125c6 Christian Gromm 2020-05-14 1070 mdev->iface.request_netinfo = hdm_request_netinfo;
56c7d34c835125c6 Christian Gromm 2020-05-14 1071 mdev->iface.enqueue = hdm_enqueue;
56c7d34c835125c6 Christian Gromm 2020-05-14 1072 mdev->iface.poison_channel = hdm_poison_channel;
56c7d34c835125c6 Christian Gromm 2020-05-14 1073 mdev->iface.dma_alloc = hdm_dma_alloc;
56c7d34c835125c6 Christian Gromm 2020-05-14 1074 mdev->iface.dma_free = hdm_dma_free;
56c7d34c835125c6 Christian Gromm 2020-05-14 1075 mdev->iface.description = mdev->description;
56c7d34c835125c6 Christian Gromm 2020-05-14 1076 mdev->iface.num_channels = num_endpoints;
56c7d34c835125c6 Christian Gromm 2020-05-14 1077
56c7d34c835125c6 Christian Gromm 2020-05-14 1078 snprintf(mdev->description, sizeof(mdev->description),
56c7d34c835125c6 Christian Gromm 2020-05-14 1079 "%d-%s:%d.%d",
56c7d34c835125c6 Christian Gromm 2020-05-14 1080 usb_dev->bus->busnum,
56c7d34c835125c6 Christian Gromm 2020-05-14 1081 usb_dev->devpath,
56c7d34c835125c6 Christian Gromm 2020-05-14 1082 usb_dev->config->desc.bConfigurationValue,
56c7d34c835125c6 Christian Gromm 2020-05-14 1083 usb_iface_desc->desc.bInterfaceNumber);
56c7d34c835125c6 Christian Gromm 2020-05-14 1084
56c7d34c835125c6 Christian Gromm 2020-05-14 1085 mdev->dev.init_name = mdev->description;
56c7d34c835125c6 Christian Gromm 2020-05-14 1086 mdev->dev.parent = &interface->dev;
56c7d34c835125c6 Christian Gromm 2020-05-14 1087 mdev->dev.release = release_mdev;
56c7d34c835125c6 Christian Gromm 2020-05-14 1088 mdev->conf = kcalloc(num_endpoints, sizeof(*mdev->conf), GFP_KERNEL);
56c7d34c835125c6 Christian Gromm 2020-05-14 1089 if (!mdev->conf)
56c7d34c835125c6 Christian Gromm 2020-05-14 1090 goto err_free_mdev;
56c7d34c835125c6 Christian Gromm 2020-05-14 1091
56c7d34c835125c6 Christian Gromm 2020-05-14 1092 mdev->cap = kcalloc(num_endpoints, sizeof(*mdev->cap), GFP_KERNEL);
56c7d34c835125c6 Christian Gromm 2020-05-14 1093 if (!mdev->cap)
56c7d34c835125c6 Christian Gromm 2020-05-14 1094 goto err_free_conf;
56c7d34c835125c6 Christian Gromm 2020-05-14 1095
56c7d34c835125c6 Christian Gromm 2020-05-14 1096 mdev->iface.channel_vector = mdev->cap;
56c7d34c835125c6 Christian Gromm 2020-05-14 1097 mdev->ep_address =
56c7d34c835125c6 Christian Gromm 2020-05-14 1098 kcalloc(num_endpoints, sizeof(*mdev->ep_address), GFP_KERNEL);
56c7d34c835125c6 Christian Gromm 2020-05-14 1099 if (!mdev->ep_address)
56c7d34c835125c6 Christian Gromm 2020-05-14 1100 goto err_free_cap;
56c7d34c835125c6 Christian Gromm 2020-05-14 1101
56c7d34c835125c6 Christian Gromm 2020-05-14 1102 mdev->busy_urbs =
56c7d34c835125c6 Christian Gromm 2020-05-14 1103 kcalloc(num_endpoints, sizeof(*mdev->busy_urbs), GFP_KERNEL);
56c7d34c835125c6 Christian Gromm 2020-05-14 @1104 if (!mdev->busy_urbs)
56c7d34c835125c6 Christian Gromm 2020-05-14 1105 goto err_free_ep_address;
56c7d34c835125c6 Christian Gromm 2020-05-14 1106
56c7d34c835125c6 Christian Gromm 2020-05-14 1107 tmp_cap = mdev->cap;
56c7d34c835125c6 Christian Gromm 2020-05-14 1108 for (i = 0; i < num_endpoints; i++) {
56c7d34c835125c6 Christian Gromm 2020-05-14 1109 ep_desc = &usb_iface_desc->endpoint[i].desc;
56c7d34c835125c6 Christian Gromm 2020-05-14 1110 mdev->ep_address[i] = ep_desc->bEndpointAddress;
56c7d34c835125c6 Christian Gromm 2020-05-14 1111 mdev->padding_active[i] = false;
56c7d34c835125c6 Christian Gromm 2020-05-14 1112 mdev->is_channel_healthy[i] = true;
56c7d34c835125c6 Christian Gromm 2020-05-14 1113
56c7d34c835125c6 Christian Gromm 2020-05-14 1114 snprintf(&mdev->suffix[i][0], MAX_SUFFIX_LEN, "ep%02x",
56c7d34c835125c6 Christian Gromm 2020-05-14 1115 mdev->ep_address[i]);
56c7d34c835125c6 Christian Gromm 2020-05-14 1116
56c7d34c835125c6 Christian Gromm 2020-05-14 1117 tmp_cap->name_suffix = &mdev->suffix[i][0];
56c7d34c835125c6 Christian Gromm 2020-05-14 1118 tmp_cap->buffer_size_packet = MAX_BUF_SIZE;
56c7d34c835125c6 Christian Gromm 2020-05-14 1119 tmp_cap->buffer_size_streaming = MAX_BUF_SIZE;
56c7d34c835125c6 Christian Gromm 2020-05-14 1120 tmp_cap->num_buffers_packet = BUF_CHAIN_SIZE;
56c7d34c835125c6 Christian Gromm 2020-05-14 1121 tmp_cap->num_buffers_streaming = BUF_CHAIN_SIZE;
56c7d34c835125c6 Christian Gromm 2020-05-14 1122 tmp_cap->data_type = MOST_CH_CONTROL | MOST_CH_ASYNC |
56c7d34c835125c6 Christian Gromm 2020-05-14 1123 MOST_CH_ISOC | MOST_CH_SYNC;
56c7d34c835125c6 Christian Gromm 2020-05-14 1124 if (usb_endpoint_dir_in(ep_desc))
56c7d34c835125c6 Christian Gromm 2020-05-14 1125 tmp_cap->direction = MOST_CH_RX;
56c7d34c835125c6 Christian Gromm 2020-05-14 1126 else
56c7d34c835125c6 Christian Gromm 2020-05-14 1127 tmp_cap->direction = MOST_CH_TX;
56c7d34c835125c6 Christian Gromm 2020-05-14 1128 tmp_cap++;
56c7d34c835125c6 Christian Gromm 2020-05-14 1129 init_usb_anchor(&mdev->busy_urbs[i]);
56c7d34c835125c6 Christian Gromm 2020-05-14 1130 spin_lock_init(&mdev->channel_lock[i]);
56c7d34c835125c6 Christian Gromm 2020-05-14 1131 }
56c7d34c835125c6 Christian Gromm 2020-05-14 1132 dev_notice(dev, "claimed gadget: Vendor=%4.4x ProdID=%4.4x Bus=%02x Device=%02x\n",
56c7d34c835125c6 Christian Gromm 2020-05-14 1133 le16_to_cpu(usb_dev->descriptor.idVendor),
56c7d34c835125c6 Christian Gromm 2020-05-14 1134 le16_to_cpu(usb_dev->descriptor.idProduct),
56c7d34c835125c6 Christian Gromm 2020-05-14 1135 usb_dev->bus->busnum,
56c7d34c835125c6 Christian Gromm 2020-05-14 1136 usb_dev->devnum);
56c7d34c835125c6 Christian Gromm 2020-05-14 1137
56c7d34c835125c6 Christian Gromm 2020-05-14 1138 dev_notice(dev, "device path: /sys/bus/usb/devices/%d-%s:%d.%d\n",
56c7d34c835125c6 Christian Gromm 2020-05-14 1139 usb_dev->bus->busnum,
56c7d34c835125c6 Christian Gromm 2020-05-14 1140 usb_dev->devpath,
56c7d34c835125c6 Christian Gromm 2020-05-14 1141 usb_dev->config->desc.bConfigurationValue,
56c7d34c835125c6 Christian Gromm 2020-05-14 1142 usb_iface_desc->desc.bInterfaceNumber);
56c7d34c835125c6 Christian Gromm 2020-05-14 1143
56c7d34c835125c6 Christian Gromm 2020-05-14 1144 ret = most_register_interface(&mdev->iface);
56c7d34c835125c6 Christian Gromm 2020-05-14 1145 if (ret)
56c7d34c835125c6 Christian Gromm 2020-05-14 1146 goto err_free_busy_urbs;
56c7d34c835125c6 Christian Gromm 2020-05-14 1147
56c7d34c835125c6 Christian Gromm 2020-05-14 1148 mutex_lock(&mdev->io_mutex);
56c7d34c835125c6 Christian Gromm 2020-05-14 1149 if (le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81118 ||
56c7d34c835125c6 Christian Gromm 2020-05-14 1150 le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81119 ||
56c7d34c835125c6 Christian Gromm 2020-05-14 1151 le16_to_cpu(usb_dev->descriptor.idProduct) == USB_DEV_ID_OS81210) {
56c7d34c835125c6 Christian Gromm 2020-05-14 1152 mdev->dci = kzalloc(sizeof(*mdev->dci), GFP_KERNEL);
56c7d34c835125c6 Christian Gromm 2020-05-14 1153 if (!mdev->dci) {
56c7d34c835125c6 Christian Gromm 2020-05-14 1154 mutex_unlock(&mdev->io_mutex);
56c7d34c835125c6 Christian Gromm 2020-05-14 1155 most_deregister_interface(&mdev->iface);
56c7d34c835125c6 Christian Gromm 2020-05-14 1156 ret = -ENOMEM;
56c7d34c835125c6 Christian Gromm 2020-05-14 1157 goto err_free_busy_urbs;
56c7d34c835125c6 Christian Gromm 2020-05-14 1158 }
56c7d34c835125c6 Christian Gromm 2020-05-14 1159
56c7d34c835125c6 Christian Gromm 2020-05-14 1160 mdev->dci->dev.init_name = "dci";
56c7d34c835125c6 Christian Gromm 2020-05-14 1161 mdev->dci->dev.parent = get_device(mdev->iface.dev);
56c7d34c835125c6 Christian Gromm 2020-05-14 1162 mdev->dci->dev.groups = dci_attr_groups;
56c7d34c835125c6 Christian Gromm 2020-05-14 1163 mdev->dci->dev.release = release_dci;
56c7d34c835125c6 Christian Gromm 2020-05-14 1164 if (device_register(&mdev->dci->dev)) {
56c7d34c835125c6 Christian Gromm 2020-05-14 1165 mutex_unlock(&mdev->io_mutex);
56c7d34c835125c6 Christian Gromm 2020-05-14 1166 most_deregister_interface(&mdev->iface);
56c7d34c835125c6 Christian Gromm 2020-05-14 1167 ret = -ENOMEM;
56c7d34c835125c6 Christian Gromm 2020-05-14 1168 goto err_free_dci;
56c7d34c835125c6 Christian Gromm 2020-05-14 1169 }
56c7d34c835125c6 Christian Gromm 2020-05-14 1170 mdev->dci->usb_device = mdev->usb_device;
56c7d34c835125c6 Christian Gromm 2020-05-14 1171 }
56c7d34c835125c6 Christian Gromm 2020-05-14 1172 mutex_unlock(&mdev->io_mutex);
56c7d34c835125c6 Christian Gromm 2020-05-14 1173 return 0;
56c7d34c835125c6 Christian Gromm 2020-05-14 1174 err_free_dci:
56c7d34c835125c6 Christian Gromm 2020-05-14 1175 put_device(&mdev->dci->dev);
56c7d34c835125c6 Christian Gromm 2020-05-14 1176 err_free_busy_urbs:
56c7d34c835125c6 Christian Gromm 2020-05-14 1177 kfree(mdev->busy_urbs);
56c7d34c835125c6 Christian Gromm 2020-05-14 1178 err_free_ep_address:
56c7d34c835125c6 Christian Gromm 2020-05-14 1179 kfree(mdev->ep_address);
56c7d34c835125c6 Christian Gromm 2020-05-14 1180 err_free_cap:
56c7d34c835125c6 Christian Gromm 2020-05-14 1181 kfree(mdev->cap);
56c7d34c835125c6 Christian Gromm 2020-05-14 1182 err_free_conf:
56c7d34c835125c6 Christian Gromm 2020-05-14 1183 kfree(mdev->conf);
56c7d34c835125c6 Christian Gromm 2020-05-14 1184 err_free_mdev:
56c7d34c835125c6 Christian Gromm 2020-05-14 1185 put_device(&mdev->dev);
56c7d34c835125c6 Christian Gromm 2020-05-14 1186 return ret;
56c7d34c835125c6 Christian Gromm 2020-05-14 1187 }
56c7d34c835125c6 Christian Gromm 2020-05-14 1188
:::::: The code at line 1104 was first introduced by commit
:::::: 56c7d34c835125c6587fb28f67cddd1d4062975f drivers: most: add usb adapter driver
:::::: TO: Christian Gromm <christian.gromm(a)microchip.com>
:::::: CC: 0day robot <lkp(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[lpieralisi:for-review/acpi-iort-id-rework 8/11] include/linux/of_irq.h:89:1: error: expected identifier or '(' before '{' token
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git for-review/acpi-iort-id-rework
head: 4582b00b57ab0807e87d54621173a29352109551
commit: b5e9dd56ea850bb71fb0532c7d4be9d5e82132e6 [8/11] of/irq: make of_msi_map_get_device_domain bus agnostic
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
git checkout b5e9dd56ea850bb71fb0532c7d4be9d5e82132e6
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from drivers/pci/msi.c:25:0:
>> include/linux/of_irq.h:89:1: error: expected identifier or '(' before '{' token
{
^
>> include/linux/of_irq.h:87:34: warning: 'of_msi_map_get_device_domain' used but never defined
static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from drivers/base/platform.c:15:0:
>> include/linux/of_irq.h:89:1: error: expected identifier or '(' before '{' token
{
^
In file included from drivers/base/platform.c:15:0:
include/linux/of_irq.h:87:34: warning: 'of_msi_map_get_device_domain' declared 'static' but never defined [-Wunused-function]
static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +89 include/linux/of_irq.h
4c3141e09cfa64 Carlo Caione 2015-12-01 80
48ae34fb39b0c0 Marc Zyngier 2015-09-18 81 static inline struct irq_domain *of_msi_get_domain(struct device *dev,
48ae34fb39b0c0 Marc Zyngier 2015-09-18 82 struct device_node *np,
48ae34fb39b0c0 Marc Zyngier 2015-09-18 83 enum irq_domain_bus_token token)
48ae34fb39b0c0 Marc Zyngier 2015-09-18 84 {
48ae34fb39b0c0 Marc Zyngier 2015-09-18 85 return NULL;
48ae34fb39b0c0 Marc Zyngier 2015-09-18 86 }
82b9b4243c6d99 Marc Zyngier 2015-10-02 @87 static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
b5e9dd56ea850b Diana Craciun 2020-04-29 88 u32 id, u32 bus_token);
82b9b4243c6d99 Marc Zyngier 2015-10-02 @89 {
82b9b4243c6d99 Marc Zyngier 2015-10-02 90 return NULL;
82b9b4243c6d99 Marc Zyngier 2015-10-02 91 }
f9f9f11dcf0f3b Jonas Gorski 2015-10-12 92 static inline void of_msi_configure(struct device *dev, struct device_node *np)
f9f9f11dcf0f3b Jonas Gorski 2015-10-12 93 {
f9f9f11dcf0f3b Jonas Gorski 2015-10-12 94 }
eaddb5725357e9 Rob Herring 2015-12-09 95 static inline u32 of_msi_map_rid(struct device *dev,
eaddb5725357e9 Rob Herring 2015-12-09 96 struct device_node *msi_np, u32 rid_in)
eaddb5725357e9 Rob Herring 2015-12-09 97 {
eaddb5725357e9 Rob Herring 2015-12-09 98 return rid_in;
eaddb5725357e9 Rob Herring 2015-12-09 99 }
a8d3f362f52b65 Rob Herring 2013-11-07 100 #endif
a8d3f362f52b65 Rob Herring 2013-11-07 101
:::::: The code at line 89 was first introduced by commit
:::::: 82b9b4243c6d99d9e38087fa89183aa7479185e9 of/irq: Use the msi-map property to provide device-specific MSI domain
:::::: TO: Marc Zyngier <marc.zyngier(a)arm.com>
:::::: CC: Marc Zyngier <marc.zyngier(a)arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months