Re: [PATCH v2 2/9] vfio/fsl-mc: Scan DPRC objects on vfio-fsl-mc driver bind

From: kbuild test robot
Date: Fri May 08 2020 - 18:51:08 EST


Hi Diana,

I love your patch! Yet something to improve:

[auto build test ERROR on vfio/next]
[also build test ERROR on linus/master v5.7-rc4 next-20200508]
[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/Diana-Craciun/vfio-fsl-mc-VFIO-support-for-FSL-MC-devices/20200509-034845
base: https://github.com/awilliam/linux-vfio.git next
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# 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@xxxxxxxxx>

All errors (new ones prefixed by >>):

drivers/vfio/fsl-mc/vfio_fsl_mc.c: In function 'vfio_fsl_mc_bus_notifier':
>> drivers/vfio/fsl-mc/vfio_fsl_mc.c:100:9: error: 'struct fsl_mc_device' has no member named 'driver_override'
mc_dev->driver_override = kasprintf(GFP_KERNEL, "%s",
^~
drivers/vfio/fsl-mc/vfio_fsl_mc.c: In function 'vfio_fsl_mc_init_device':
>> drivers/vfio/fsl-mc/vfio_fsl_mc.c:135:8: error: implicit declaration of function 'dprc_setup'; did you mean 'x2apic_setup'? [-Werror=implicit-function-declaration]
ret = dprc_setup(mc_dev);
^~~~~~~~~~
x2apic_setup
>> drivers/vfio/fsl-mc/vfio_fsl_mc.c:142:8: error: implicit declaration of function 'dprc_scan_container'; did you mean 'init_section_contains'? [-Werror=implicit-function-declaration]
ret = dprc_scan_container(mc_dev, false);
^~~~~~~~~~~~~~~~~~~
init_section_contains
>> drivers/vfio/fsl-mc/vfio_fsl_mc.c:146:3: error: implicit declaration of function 'dprc_cleanup'; did you mean 'pud_clear'? [-Werror=implicit-function-declaration]
dprc_cleanup(mc_dev);
^~~~~~~~~~~~
pud_clear
drivers/vfio/fsl-mc/vfio_fsl_mc.c: In function 'vfio_fsl_mc_device_remove':
drivers/vfio/fsl-mc/vfio_fsl_mc.c:198:14: error: 'struct fsl_mc_device' has no member named 'driver_override'
kfree(mc_dev->driver_override);
^~
drivers/vfio/fsl-mc/vfio_fsl_mc.c:199:8: error: 'struct fsl_mc_device' has no member named 'driver_override'
mc_dev->driver_override = NULL;
^~
cc1: some warnings being treated as errors

vim +100 drivers/vfio/fsl-mc/vfio_fsl_mc.c

88
89 static int vfio_fsl_mc_bus_notifier(struct notifier_block *nb,
90 unsigned long action, void *data)
91 {
92 struct vfio_fsl_mc_device *vdev = container_of(nb,
93 struct vfio_fsl_mc_device, nb);
94 struct device *dev = data;
95 struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
96 struct fsl_mc_device *mc_cont = to_fsl_mc_device(mc_dev->dev.parent);
97
98 if (action == BUS_NOTIFY_ADD_DEVICE &&
99 vdev->mc_dev == mc_cont) {
> 100 mc_dev->driver_override = kasprintf(GFP_KERNEL, "%s",
101 vfio_fsl_mc_ops.name);
102 dev_info(dev, "Setting driver override for device in dprc %s\n",
103 dev_name(&mc_cont->dev));
104 } else if (action == BUS_NOTIFY_BOUND_DRIVER &&
105 vdev->mc_dev == mc_cont) {
106 struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(dev->driver);
107
108 if (mc_drv && mc_drv != &vfio_fsl_mc_driver)
109 dev_warn(dev, "Object %s bound to driver %s while DPRC bound to vfio-fsl-mc\n",
110 dev_name(dev), mc_drv->driver.name);
111 }
112
113 return 0;
114 }
115
116 static int vfio_fsl_mc_init_device(struct vfio_fsl_mc_device *vdev)
117 {
118 struct fsl_mc_device *mc_dev = vdev->mc_dev;
119 int ret = 0;
120
121 /* Non-dprc devices share mc_io from parent */
122 if (!is_fsl_mc_bus_dprc(mc_dev)) {
123 struct fsl_mc_device *mc_cont = to_fsl_mc_device(mc_dev->dev.parent);
124
125 mc_dev->mc_io = mc_cont->mc_io;
126 return 0;
127 }
128
129 vdev->nb.notifier_call = vfio_fsl_mc_bus_notifier;
130 ret = bus_register_notifier(&fsl_mc_bus_type, &vdev->nb);
131 if (ret)
132 return ret;
133
134 /* open DPRC, allocate a MC portal */
> 135 ret = dprc_setup(mc_dev);
136 if (ret < 0) {
137 dev_err(&mc_dev->dev, "Failed to setup DPRC (error = %d)\n", ret);
138 bus_unregister_notifier(&fsl_mc_bus_type, &vdev->nb);
139 return ret;
140 }
141
> 142 ret = dprc_scan_container(mc_dev, false);
143 if (ret < 0) {
144 dev_err(&mc_dev->dev, "Container scanning failed: %d\n", ret);
145 bus_unregister_notifier(&fsl_mc_bus_type, &vdev->nb);
> 146 dprc_cleanup(mc_dev);
147 }
148
149 return 0;
150 }
151

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip