Hi Scott,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20200706]
[also build test ERROR on v5.8-rc5]
[cannot apply to char-misc/char-misc-testing integrity/next-integrity
driver-core/driver-core-testing linus/master v5.8-rc4 v5.8-rc3 v5.8-rc2]
[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/Scott-Branden/firmware-add-reque...
base: 5680d14d59bddc8bcbc5badf00dbbd4374858497
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
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/misc/bcm-vk/bcm_vk_dev.c:138:5: warning: no previous prototype for
'bcm_vk_intf_ver_chk' [-Wmissing-prototypes]
138 | int bcm_vk_intf_ver_chk(struct bcm_vk *vk)
| ^~~~~~~~~~~~~~~~~~~
drivers/misc/bcm-vk/bcm_vk_dev.c: In function 'bcm_vk_probe':
> drivers/misc/bcm-vk/bcm_vk_dev.c:1161:8: error: implicit
declaration of function 'bcm_vk_sysfs_init'; did you mean
'bcm_vk_msg_init'? [-Werror=implicit-function-declaration]
1161 | err =
bcm_vk_sysfs_init(pdev, misc_device);
| ^~~~~~~~~~~~~~~~~
| bcm_vk_msg_init
drivers/misc/bcm-vk/bcm_vk_dev.c: In function 'bcm_vk_remove':
> drivers/misc/bcm-vk/bcm_vk_dev.c:1266:2: error: implicit
declaration of function 'bcm_vk_sysfs_exit'; did you mean
'bcm_vk_tty_exit'? [-Werror=implicit-function-declaration]
1266 |
bcm_vk_sysfs_exit(pdev, misc_device);
| ^~~~~~~~~~~~~~~~~
| bcm_vk_tty_exit
cc1: some warnings being treated as errors
vim +1161 drivers/misc/bcm-vk/bcm_vk_dev.c
1004
1005 static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1006 {
1007 int err;
1008 int i;
1009 int id;
1010 int irq;
1011 char name[20];
1012 struct bcm_vk *vk;
1013 struct device *dev = &pdev->dev;
1014 struct miscdevice *misc_device;
1015 uint32_t boot_status;
1016
1017 /* allocate vk structure which is tied to kref for freeing */
1018 vk = kzalloc(sizeof(*vk), GFP_KERNEL);
1019 if (!vk)
1020 return -ENOMEM;
1021
1022 kref_init(&vk->kref);
1023 if (nr_ib_sgl_blk > BCM_VK_IB_SGL_BLK_MAX) {
1024 dev_warn(dev, "Inband SGL blk %d limited to max %d\n",
1025 nr_ib_sgl_blk, BCM_VK_IB_SGL_BLK_MAX);
1026 nr_ib_sgl_blk = BCM_VK_IB_SGL_BLK_MAX;
1027 }
1028 vk->ib_sgl_size = nr_ib_sgl_blk * VK_MSGQ_BLK_SIZE;
1029 vk->pdev = pdev;
1030 mutex_init(&vk->mutex);
1031
1032 err = pci_enable_device(pdev);
1033 if (err) {
1034 dev_err(dev, "Cannot enable PCI device\n");
1035 return err;
1036 }
1037
1038 err = pci_request_regions(pdev, DRV_MODULE_NAME);
1039 if (err) {
1040 dev_err(dev, "Cannot obtain PCI resources\n");
1041 goto err_disable_pdev;
1042 }
1043
1044 /* make sure DMA is good */
1045 err = dma_set_mask_and_coherent(&pdev->dev,
1046 DMA_BIT_MASK(BCM_VK_DMA_BITS));
1047 if (err) {
1048 dev_err(dev, "failed to set DMA mask\n");
1049 goto err_disable_pdev;
1050 }
1051
1052 /* The tdma is a scratch area for some DMA testings. */
1053 if (nr_scratch_pages) {
1054 vk->tdma_vaddr = dma_alloc_coherent
1055 (dev,
1056 nr_scratch_pages * PAGE_SIZE,
1057 &vk->tdma_addr, GFP_KERNEL);
1058 if (!vk->tdma_vaddr) {
1059 err = -ENOMEM;
1060 goto err_disable_pdev;
1061 }
1062 }
1063
1064 pci_set_master(pdev);
1065 pci_set_drvdata(pdev, vk);
1066
1067 irq = pci_alloc_irq_vectors(pdev,
1068 1,
1069 VK_MSIX_IRQ_MAX,
1070 PCI_IRQ_MSI | PCI_IRQ_MSIX);
1071
1072 if (irq < VK_MSIX_IRQ_MIN_REQ) {
1073 dev_err(dev, "failed to get min %d MSIX interrupts, irq(%d)\n",
1074 VK_MSIX_IRQ_MIN_REQ, irq);
1075 err = (irq >= 0) ? -EINVAL : irq;
1076 goto err_disable_pdev;
1077 }
1078
1079 dev_info(dev, "Number of IRQs %d allocated - requested(%d).\n",
1080 irq, VK_MSIX_IRQ_MAX);
1081
1082 for (i = 0; i < MAX_BAR; i++) {
1083 /* multiple by 2 for 64 bit BAR mapping */
1084 vk->bar[i] = pci_ioremap_bar(pdev, i * 2);
1085 if (!vk->bar[i]) {
1086 dev_err(dev, "failed to remap BAR%d\n", i);
1087 goto err_iounmap;
1088 }
1089 }
1090
1091 for (vk->num_irqs = 0;
1092 vk->num_irqs < VK_MSIX_MSGQ_MAX;
1093 vk->num_irqs++) {
1094 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs),
1095 bcm_vk_msgq_irqhandler,
1096 IRQF_SHARED, DRV_MODULE_NAME, vk);
1097 if (err) {
1098 dev_err(dev, "failed to request msgq IRQ %d for MSIX %d\n",
1099 pdev->irq + vk->num_irqs, vk->num_irqs + 1);
1100 goto err_irq;
1101 }
1102 }
1103 /* one irq for notification from VK */
1104 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs),
1105 bcm_vk_notf_irqhandler,
1106 IRQF_SHARED, DRV_MODULE_NAME, vk);
1107 if (err) {
1108 dev_err(dev, "failed to request notf IRQ %d for MSIX %d\n",
1109 pdev->irq + vk->num_irqs, vk->num_irqs + 1);
1110 goto err_irq;
1111 }
1112 vk->num_irqs++;
1113
1114 for (i = 0;
1115 (i < VK_MSIX_TTY_MAX) && (vk->num_irqs < irq);
1116 i++, vk->num_irqs++) {
1117 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs),
1118 bcm_vk_tty_irqhandler,
1119 IRQF_SHARED, DRV_MODULE_NAME, vk);
1120 if (err) {
1121 dev_err(dev, "failed request tty IRQ %d for MSIX %d\n",
1122 pdev->irq + vk->num_irqs, vk->num_irqs + 1);
1123 goto err_irq;
1124 }
1125 vk->tty[i].irq_enabled = true;
1126 }
1127
1128 id = ida_simple_get(&bcm_vk_ida, 0, 0, GFP_KERNEL);
1129 if (id < 0) {
1130 err = id;
1131 dev_err(dev, "unable to get id\n");
1132 goto err_irq;
1133 }
1134
1135 vk->misc_devid = id;
1136 snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id);
1137 misc_device = &vk->miscdev;
1138 misc_device->minor = MISC_DYNAMIC_MINOR;
1139 misc_device->name = kstrdup(name, GFP_KERNEL);
1140 if (!misc_device->name) {
1141 err = -ENOMEM;
1142 goto err_ida_remove;
1143 }
1144 misc_device->fops = &bcm_vk_fops,
1145
1146 err = misc_register(misc_device);
1147 if (err) {
1148 dev_err(dev, "failed to register device\n");
1149 goto err_kfree_name;
1150 }
1151
1152 err = bcm_vk_msg_init(vk);
1153 if (err) {
1154 dev_err(dev, "failed to init msg queue info\n");
1155 goto err_misc_deregister;
1156 }
1157
1158 /* sync other info */
1159 bcm_vk_sync_card_info(vk);
1160
1161 err = bcm_vk_sysfs_init(pdev, misc_device);
1162 if
(err)
1163 goto err_misc_deregister;
1164
1165 /* register for panic notifier */
1166 vk->panic_nb.notifier_call = bcm_vk_on_panic;
1167 atomic_notifier_chain_register(&panic_notifier_list,
1168 &vk->panic_nb);
1169
1170 snprintf(name, sizeof(name), KBUILD_MODNAME ".%d_ttyVK", id);
1171 err = bcm_vk_tty_init(vk, name);
1172 if (err)
1173 goto err_unregister_panic_notifier;
1174
1175 /*
1176 * lets trigger an auto download. We don't want to do it serially here
1177 * because at probing time, it is not supposed to block for a long time.
1178 */
1179 boot_status = vkread32(vk, BAR_0, BAR_BOOT_STATUS);
1180 if (auto_load) {
1181 if ((boot_status & BOOT_STATE_MASK) == BROM_RUNNING) {
1182 if (bcm_vk_trigger_autoload(vk))
1183 goto err_bcm_vk_tty_exit;
1184 } else {
1185 dev_info(dev,
1186 "Auto-load skipped - BROM not in proper state (0x%x)\n",
1187 boot_status);
1188 }
1189 }
1190
1191 /* enable hb */
1192 bcm_vk_hb_init(vk);
1193
1194 dev_info(dev, "BCM-VK:%u created, 0x%p\n", id, vk);
1195
1196 return 0;
1197
1198 err_bcm_vk_tty_exit:
1199 bcm_vk_tty_exit(vk);
1200
1201 err_unregister_panic_notifier:
1202 atomic_notifier_chain_unregister(&panic_notifier_list,
1203 &vk->panic_nb);
1204
1205 err_misc_deregister:
1206 misc_deregister(misc_device);
1207
1208 err_kfree_name:
1209 kfree(misc_device->name);
1210 misc_device->name = NULL;
1211
1212 err_ida_remove:
1213 ida_simple_remove(&bcm_vk_ida, id);
1214
1215 err_irq:
1216 for (i = 0; i < vk->num_irqs; i++)
1217 devm_free_irq(dev, pci_irq_vector(pdev, i), vk);
1218
1219 pci_disable_msix(pdev);
1220 pci_disable_msi(pdev);
1221
1222 err_iounmap:
1223 for (i = 0; i < MAX_BAR; i++) {
1224 if (vk->bar[i])
1225 pci_iounmap(pdev, vk->bar[i]);
1226 }
1227 pci_release_regions(pdev);
1228
1229 err_disable_pdev:
1230 pci_free_irq_vectors(pdev);
1231 pci_disable_device(pdev);
1232
1233 return err;
1234 }
1235
1236 void bcm_vk_release_data(struct kref *kref)
1237 {
1238 struct bcm_vk *vk = container_of(kref, struct bcm_vk, kref);
1239
1240 /* use raw print, as dev is gone */
1241 pr_info("BCM-VK:%d release data 0x%p\n", vk->misc_devid, vk);
1242 kfree(vk);
1243 }
1244
1245 static void bcm_vk_remove(struct pci_dev *pdev)
1246 {
1247 int i;
1248 struct bcm_vk *vk = pci_get_drvdata(pdev);
1249 struct miscdevice *misc_device = &vk->miscdev;
1250
1251 bcm_vk_hb_deinit(vk);
1252
1253 /*
1254 * Trigger a reset to card and wait enough time for UCODE to rerun,
1255 * which re-initialize the card into its default state.
1256 * This ensures when driver is re-enumerated it will start from
1257 * a completely clean state.
1258 */
1259 bcm_vk_trigger_reset(vk);
1260 usleep_range(BCM_VK_UCODE_BOOT_US, BCM_VK_UCODE_BOOT_MAX_US);
1261
1262 /* unregister panic notifier */
1263 atomic_notifier_chain_unregister(&panic_notifier_list,
1264 &vk->panic_nb);
1265
1266 bcm_vk_sysfs_exit(pdev, misc_device);
1267
1268 bcm_vk_msg_remove(vk);
1269 bcm_vk_tty_exit(vk);
1270
1271 if (vk->tdma_vaddr)
1272 dma_free_coherent(&pdev->dev, nr_scratch_pages * PAGE_SIZE,
1273 vk->tdma_vaddr, vk->tdma_addr);
1274
1275 /* remove if name is set which means misc dev registered */
1276 if (misc_device->name) {
1277 misc_deregister(misc_device);
1278 kfree(misc_device->name);
1279 ida_simple_remove(&bcm_vk_ida, vk->misc_devid);
1280 }
1281 for (i = 0; i < vk->num_irqs; i++)
1282 devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), vk);
1283
1284 pci_disable_msix(pdev);
1285 pci_disable_msi(pdev);
1286
1287 cancel_work_sync(&vk->wq_work);
1288 destroy_workqueue(vk->wq_thread);
1289 cancel_work_sync(&vk->tty_wq_work);
1290 destroy_workqueue(vk->tty_wq_thread);
1291
1292 for (i = 0; i < MAX_BAR; i++) {
1293 if (vk->bar[i])
1294 pci_iounmap(pdev, vk->bar[i]);
1295 }
1296
1297 dev_info(&pdev->dev, "BCM-VK:%d released\n", vk->misc_devid);
1298
1299 pci_release_regions(pdev);
1300 pci_free_irq_vectors(pdev);
1301 pci_disable_device(pdev);
1302
1303 kref_put(&vk->kref, bcm_vk_release_data);
1304 }
1305
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org