Lines Matching +full:short +full:- +full:press +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright 2018-2020 Broadcom.
7 #include <linux/dma-mapping.h>
49 {VK_IMAGE_TYPE_BOOT1, {"vk_a0-boot1.bin", "vk-boot1.bin"}},
50 {VK_IMAGE_TYPE_BOOT2, {"vk_a0-boot2.bin", "vk-boot2.bin"}}
53 {VK_IMAGE_TYPE_BOOT1, {"vk_b0-boot1.bin", "vk-boot1.bin"}},
54 {VK_IMAGE_TYPE_BOOT2, {"vk_b0-boot2.bin", "vk-boot2.bin"}}
58 {VK_IMAGE_TYPE_BOOT1, {"vp-boot1.bin", ""}},
59 {VK_IMAGE_TYPE_BOOT2, {"vp-boot2.bin", ""}}
74 /* 1ms wait for checking the transfer complete status */
110 "Number of in-band msg blks for short SGL.\n");
143 dev_err(&vk->pdev->dev, in bcm_vk_notf_irqhandler()
149 if (test_and_set_bit(BCM_VK_WQ_NOTF_PEND, vk->wq_offload) == 0) in bcm_vk_notf_irqhandler()
150 queue_work(vk->wq_thread, &vk->wq_work); in bcm_vk_notf_irqhandler()
158 struct device *dev = &vk->pdev->dev; in bcm_vk_intf_ver_chk()
169 * if major number is 0, it is pre-release and it would be allowed in bcm_vk_intf_ver_chk()
173 dev_warn(dev, "Pre-release major.minor=%d.%d - drv %d.%d\n", in bcm_vk_intf_ver_chk()
177 "Intf major.minor=%d.%d rejected - drv %d.%d\n", in bcm_vk_intf_ver_chk()
180 ret = -EPFNOSUPPORT; in bcm_vk_intf_ver_chk()
183 "Intf major.minor=%d.%d passed - drv %d.%d\n", in bcm_vk_intf_ver_chk()
199 struct device *dev = &vk->pdev->dev; in bcm_vk_log_notf()
203 masked_val = entry->mask & alert->notfs; in bcm_vk_log_notf()
204 latched_val = entry->mask & alert->flags; in bcm_vk_log_notf()
215 if ((uecc_mem_err != vk->alert_cnts.uecc) && in bcm_vk_log_notf()
218 "ALERT! %s.%d uecc RAISED - ErrCnt %d\n", in bcm_vk_log_notf()
219 DRV_MODULE_NAME, vk->devid, in bcm_vk_log_notf()
221 vk->alert_cnts.uecc = uecc_mem_err; in bcm_vk_log_notf()
227 if ((ecc_mem_err != vk->alert_cnts.ecc) && in bcm_vk_log_notf()
229 dev_info(dev, "ALERT! %s.%d ecc RAISED - ErrCnt %d\n", in bcm_vk_log_notf()
230 DRV_MODULE_NAME, vk->devid, in bcm_vk_log_notf()
232 vk->alert_cnts.ecc = ecc_mem_err; in bcm_vk_log_notf()
236 DRV_MODULE_NAME, vk->devid, entry->str, in bcm_vk_log_notf()
245 struct bcm_vk_peer_log *log_info = &vk->peerlog_info; in bcm_vk_dump_peer_log()
248 struct device *dev = &vk->pdev->dev; in bcm_vk_dump_peer_log()
251 memcpy_fromio(&log, vk->bar[BAR_2] + vk->peerlog_off, sizeof(log)); in bcm_vk_dump_peer_log()
256 if (!log_info->buf_size) { in bcm_vk_dump_peer_log()
257 dev_err(dev, "Peer log dump disabled - skipped!\n"); in bcm_vk_dump_peer_log()
262 if ((log.rd_idx > log_info->mask) || in bcm_vk_dump_peer_log()
263 (log.wr_idx > log_info->mask) || in bcm_vk_dump_peer_log()
264 (log.buf_size != log_info->buf_size) || in bcm_vk_dump_peer_log()
265 (log.mask != log_info->mask)) { in bcm_vk_dump_peer_log()
268 log_info->buf_size, log.buf_size, in bcm_vk_dump_peer_log()
269 log_info->mask, log.mask, in bcm_vk_dump_peer_log()
275 data_offset = vk->peerlog_off + sizeof(struct bcm_vk_peer_log); in bcm_vk_dump_peer_log()
276 loc_buf[BCM_VK_PEER_LOG_LINE_MAX - 1] = '\0'; in bcm_vk_dump_peer_log()
281 (cnt == (BCM_VK_PEER_LOG_LINE_MAX - 1))) { in bcm_vk_dump_peer_log()
291 vk->peerlog_off + offsetof(struct bcm_vk_peer_log, rd_idx)); in bcm_vk_dump_peer_log()
305 vk->peer_alert.notfs = reg; in bcm_vk_handle_notf()
306 bcm_vk_log_notf(vk, &vk->peer_alert, bcm_vk_peer_err, in bcm_vk_handle_notf()
308 vk->peer_alert.flags = vk->peer_alert.notfs; in bcm_vk_handle_notf()
315 spin_lock_irqsave(&vk->host_alert_lock, flags); in bcm_vk_handle_notf()
317 vk->host_alert.notfs |= ERR_LOG_HOST_PCIE_DWN; in bcm_vk_handle_notf()
319 alert = vk->host_alert; in bcm_vk_handle_notf()
320 vk->host_alert.flags = vk->host_alert.notfs; in bcm_vk_handle_notf()
321 spin_unlock_irqrestore(&vk->host_alert_lock, flags); in bcm_vk_handle_notf()
332 ((vk->host_alert.flags & ERR_LOG_HOST_HB_FAIL) || in bcm_vk_handle_notf()
333 (vk->peer_alert.flags & ERR_LOG_SYS_FAULT))) in bcm_vk_handle_notf()
341 struct device *dev = &vk->pdev->dev; in bcm_vk_wait()
357 dev_err(dev, "Boot Err 0x%x, progress 0x%x after %d ms\n", in bcm_vk_wait()
360 jiffies_to_msecs(jiffies - start_time)); in bcm_vk_wait()
361 return -EFAULT; in bcm_vk_wait()
365 return -ETIMEDOUT; in bcm_vk_wait()
376 struct device *dev = &vk->pdev->dev; in bcm_vk_get_card_info()
380 struct bcm_vk_card_info *info = &vk->card_info; in bcm_vk_get_card_info()
384 offset &= (pci_resource_len(vk->pdev, BAR_2 * 2) - 1); in bcm_vk_get_card_info()
399 dev_dbg(dev, CARD_INFO_LOG_FMT, info->version, info->os_tag, in bcm_vk_get_card_info()
400 info->cmpt_tag, info->cpu_freq_mhz, info->cpu_scale[0], in bcm_vk_get_card_info()
401 info->cpu_scale[MAX_OPP - 1], info->ddr_freq_mhz, in bcm_vk_get_card_info()
402 info->ddr_size_MB, info->video_core_freq_mhz); in bcm_vk_get_card_info()
409 vk->peerlog_off = offset; in bcm_vk_get_card_info()
410 memcpy_fromio(&vk->peerlog_info, vk->bar[BAR_2] + vk->peerlog_off, in bcm_vk_get_card_info()
411 sizeof(vk->peerlog_info)); in bcm_vk_get_card_info()
418 if ((vk->peerlog_info.buf_size > BCM_VK_PEER_LOG_BUF_MAX) || in bcm_vk_get_card_info()
419 (vk->peerlog_info.mask != (vk->peerlog_info.buf_size - 1)) || in bcm_vk_get_card_info()
420 (vk->peerlog_info.rd_idx > vk->peerlog_info.mask) || in bcm_vk_get_card_info()
421 (vk->peerlog_info.wr_idx > vk->peerlog_info.mask)) { in bcm_vk_get_card_info()
422 dev_err(dev, "Peer log disabled - range error: Size 0x%x(0x%x), [Rd Wr] = [%d %d]\n", in bcm_vk_get_card_info()
423 vk->peerlog_info.buf_size, in bcm_vk_get_card_info()
424 vk->peerlog_info.mask, in bcm_vk_get_card_info()
425 vk->peerlog_info.rd_idx, in bcm_vk_get_card_info()
426 vk->peerlog_info.wr_idx); in bcm_vk_get_card_info()
427 memset(&vk->peerlog_info, 0, sizeof(vk->peerlog_info)); in bcm_vk_get_card_info()
430 vk->peerlog_info.buf_size, in bcm_vk_get_card_info()
431 vk->peerlog_info.mask, in bcm_vk_get_card_info()
432 vk->peerlog_info.rd_idx, in bcm_vk_get_card_info()
433 vk->peerlog_info.wr_idx); in bcm_vk_get_card_info()
439 struct device *dev = &vk->pdev->dev; in bcm_vk_get_proc_mon_info()
440 struct bcm_vk_proc_mon_info *mon = &vk->proc_mon_info; in bcm_vk_get_proc_mon_info()
446 vk->peerlog_off in bcm_vk_get_proc_mon_info()
448 offset = vk->peerlog_off + sizeof(struct bcm_vk_peer_log) in bcm_vk_get_proc_mon_info()
461 mon->num = num; in bcm_vk_get_proc_mon_info()
462 mon->entry_size = entry_size; in bcm_vk_get_proc_mon_info()
464 vk->proc_mon_off = offset; in bcm_vk_get_proc_mon_info()
467 dst = (u8 *)&mon->entries[0]; in bcm_vk_get_proc_mon_info()
469 memcpy_fromio(dst, vk->bar[BAR_2] + offset, num * entry_size); in bcm_vk_get_proc_mon_info()
478 return (rdy_marker == VK_BAR1_DIAG_RDY_MARKER ? 0 : -EINVAL); in bcm_vk_sync_card_info()
485 if (vk->tdma_addr) { in bcm_vk_sync_card_info()
486 vkwrite32(vk, (u64)vk->tdma_addr >> 32, BAR_1, in bcm_vk_sync_card_info()
488 vkwrite32(vk, (u32)vk->tdma_addr, BAR_1, in bcm_vk_sync_card_info()
512 spin_lock(&vk->ctx_lock); in bcm_vk_blk_drv_access()
515 atomic_set(&vk->msgq_inited, 0); in bcm_vk_blk_drv_access()
520 list_for_each_entry(ctx, &vk->pid_ht[i].head, node) { in bcm_vk_blk_drv_access()
521 if (ctx->pid != vk->reset_pid) { in bcm_vk_blk_drv_access()
522 dev_dbg(&vk->pdev->dev, in bcm_vk_blk_drv_access()
524 ctx->pid); in bcm_vk_blk_drv_access()
525 kill_pid(find_vpid(ctx->pid), SIGKILL, 1); in bcm_vk_blk_drv_access()
530 spin_unlock(&vk->ctx_lock); in bcm_vk_blk_drv_access()
547 struct device *dev = &vk->pdev->dev; in bcm_vk_load_image_by_type()
577 dev_err(dev, "boot1 wait SRAM err - ret(%d)\n", ret); in bcm_vk_load_image_by_type()
587 ret = -ENOMEM; in bcm_vk_load_image_by_type()
598 dev_err(dev, "boot2 wait DDR open error - ret(%d)\n", in bcm_vk_load_image_by_type()
609 ret = -ENOMEM; in bcm_vk_load_image_by_type()
616 ret = -EINVAL; in bcm_vk_load_image_by_type()
628 dev_dbg(dev, "size=0x%zx\n", fw->size); in bcm_vk_load_image_by_type()
630 memcpy_toio(vk->bar[BAR_1] + BAR1_CODEPUSH_BASE_BOOT1, in bcm_vk_load_image_by_type()
632 fw->size); in bcm_vk_load_image_by_type()
651 "Timeout %ld ms waiting for boot1 to come up - ret(%d)\n", in bcm_vk_load_image_by_type()
663 dev_err(dev, "Timeout %ld ms - Boot1 standalone failure\n", in bcm_vk_load_image_by_type()
665 ret = -EINVAL; in bcm_vk_load_image_by_type()
688 } else if (ret == -EFAULT) { in bcm_vk_load_image_by_type()
696 ret = -ETIMEDOUT; in bcm_vk_load_image_by_type()
718 dev_dbg(dev, "size=0x%zx\n", fw->size); in bcm_vk_load_image_by_type()
725 } else if (ret == -EFAULT) { in bcm_vk_load_image_by_type()
737 dev_err(dev, "Boot2 not ready - ret(%d)\n", ret); in bcm_vk_load_image_by_type()
757 ret = -EIO; in bcm_vk_load_image_by_type()
795 dev_info(&vk->pdev->dev, in bcm_vk_next_boot_image()
796 "boot-status value for next image: 0x%x : fw-status 0x%x\n", in bcm_vk_next_boot_image()
804 struct pci_dev *pdev = vk->pdev; in get_soc_idx()
809 switch (pdev->device) { in get_soc_idx()
811 /* get the chip id to decide sub-class */ in get_soc_idx()
818 dev_warn(&pdev->dev, in get_soc_idx()
829 dev_err(&pdev->dev, "no images for 0x%x\n", pdev->device); in get_soc_idx()
838 struct device *dev = &vk->pdev->dev; in get_load_fw_name()
846 entry->image_name[i], in get_load_fw_name()
852 return entry->image_name[i]; in get_load_fw_name()
859 int i, ret = -1; in bcm_vk_auto_load_all_images()
861 struct device *dev = &vk->pdev->dev; in bcm_vk_auto_load_all_images()
870 dev_dbg(dev, "Load All for device %d\n", vk->devid); in bcm_vk_auto_load_all_images()
879 ret = -ENOENT; in bcm_vk_auto_load_all_images()
901 if (test_and_set_bit(BCM_VK_WQ_DWNLD_PEND, vk->wq_offload) != 0) in bcm_vk_trigger_autoload()
902 return -EPERM; in bcm_vk_trigger_autoload()
904 set_bit(BCM_VK_WQ_DWNLD_AUTO, vk->wq_offload); in bcm_vk_trigger_autoload()
905 queue_work(vk->wq_thread, &vk->wq_work); in bcm_vk_trigger_autoload()
916 struct device *dev = &vk->pdev->dev; in bcm_vk_wq_handler()
920 if (test_bit(BCM_VK_WQ_NOTF_PEND, vk->wq_offload)) { in bcm_vk_wq_handler()
922 clear_bit(BCM_VK_WQ_NOTF_PEND, vk->wq_offload); in bcm_vk_wq_handler()
925 if (test_bit(BCM_VK_WQ_DWNLD_AUTO, vk->wq_offload)) { in bcm_vk_wq_handler()
932 clear_bit(BCM_VK_WQ_DWNLD_AUTO, vk->wq_offload); in bcm_vk_wq_handler()
933 clear_bit(BCM_VK_WQ_DWNLD_PEND, vk->wq_offload); in bcm_vk_wq_handler()
948 struct device *dev = &vk->pdev->dev; in bcm_vk_load_image()
954 int ret = -EPERM; in bcm_vk_load_image()
957 return -EACCES; in bcm_vk_load_image()
977 if (test_and_set_bit(BCM_VK_WQ_DWNLD_PEND, vk->wq_offload) != 0) { in bcm_vk_load_image()
990 image_idx = image.type - VK_IMAGE_TYPE_BOOT1; in bcm_vk_load_image()
995 ret = -ENOENT; in bcm_vk_load_image()
1000 image.filename[sizeof(image.filename) - 1] = '\0'; in bcm_vk_load_image()
1005 clear_bit(BCM_VK_WQ_DWNLD_PEND, vk->wq_offload); in bcm_vk_load_image()
1012 struct device *dev = &vk->pdev->dev; in bcm_vk_reset_successful()
1014 int ret = -EAGAIN; in bcm_vk_reset_successful()
1022 * i) & ii) - no status bits will be updated. If vkboot1 in bcm_vk_reset_successful()
1025 * iii) - reboot reason match + deinit done. in bcm_vk_reset_successful()
1045 ret = -EAGAIN; in bcm_vk_reset_successful()
1082 memset(&vk->card_info, 0, sizeof(vk->card_info)); in bcm_vk_trigger_reset()
1083 memset(&vk->peerlog_info, 0, sizeof(vk->peerlog_info)); in bcm_vk_trigger_reset()
1084 memset(&vk->proc_mon_info, 0, sizeof(vk->proc_mon_info)); in bcm_vk_trigger_reset()
1085 memset(&vk->alert_cnts, 0, sizeof(vk->alert_cnts)); in bcm_vk_trigger_reset()
1097 dev_info(&vk->pdev->dev, in bcm_vk_trigger_reset()
1110 if (vk->peer_alert.flags & ERR_LOG_RAMDUMP) { in bcm_vk_trigger_reset()
1114 * is important - simply use special reset in bcm_vk_trigger_reset()
1119 dev_info(&vk->pdev->dev, "Hard reset on Standalone mode"); in bcm_vk_trigger_reset()
1124 /* reset fw_status with proper reason, and press db */ in bcm_vk_trigger_reset()
1131 memset(&vk->host_alert, 0, sizeof(vk->host_alert)); in bcm_vk_trigger_reset()
1132 memset(&vk->peer_alert, 0, sizeof(vk->peer_alert)); in bcm_vk_trigger_reset()
1134 bitmap_clear(vk->bmap, 0, VK_MSG_ID_BITMAP_SIZE); in bcm_vk_trigger_reset()
1141 struct device *dev = &vk->pdev->dev; in bcm_vk_reset()
1148 return -EFAULT; in bcm_vk_reset()
1150 /* check if any download is in-progress, if so return error */ in bcm_vk_reset()
1151 if (test_and_set_bit(BCM_VK_WQ_DWNLD_PEND, vk->wq_offload) != 0) { in bcm_vk_reset()
1152 dev_err(dev, "Download operation pending - skip reset.\n"); in bcm_vk_reset()
1153 return -EPERM; in bcm_vk_reset()
1156 ramdump_reset = vk->peer_alert.flags & ERR_LOG_RAMDUMP; in bcm_vk_reset()
1162 * - send card level graceful shut down in bcm_vk_reset()
1163 * - wait enough time for VK to handle its business, stopping DMA etc in bcm_vk_reset()
1164 * - kill host apps in bcm_vk_reset()
1165 * - Trigger interrupt with DB in bcm_vk_reset()
1169 spin_lock(&vk->ctx_lock); in bcm_vk_reset()
1170 if (!vk->reset_pid) { in bcm_vk_reset()
1171 vk->reset_pid = task_pid_nr(current); in bcm_vk_reset()
1174 vk->reset_pid); in bcm_vk_reset()
1175 ret = -EACCES; in bcm_vk_reset()
1177 spin_unlock(&vk->ctx_lock); in bcm_vk_reset()
1194 ret = -EFAULT; in bcm_vk_reset()
1200 clear_bit(BCM_VK_WQ_DWNLD_PEND, vk->wq_offload); in bcm_vk_reset()
1206 struct bcm_vk_ctx *ctx = file->private_data; in bcm_vk_mmap()
1207 struct bcm_vk *vk = container_of(ctx->miscdev, struct bcm_vk, miscdev); in bcm_vk_mmap()
1213 pg_size = ((pci_resource_len(vk->pdev, VK_MMAPABLE_BAR) - 1) in bcm_vk_mmap()
1215 if (vma->vm_pgoff + vma_pages(vma) > pg_size) in bcm_vk_mmap()
1216 return -EINVAL; in bcm_vk_mmap()
1218 vma->vm_pgoff += (pci_resource_start(vk->pdev, VK_MMAPABLE_BAR) in bcm_vk_mmap()
1220 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); in bcm_vk_mmap()
1222 return io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, in bcm_vk_mmap()
1223 vma->vm_end - vma->vm_start, in bcm_vk_mmap()
1224 vma->vm_page_prot); in bcm_vk_mmap()
1229 long ret = -EINVAL; in bcm_vk_ioctl()
1230 struct bcm_vk_ctx *ctx = file->private_data; in bcm_vk_ioctl()
1231 struct bcm_vk *vk = container_of(ctx->miscdev, struct bcm_vk, miscdev); in bcm_vk_ioctl()
1234 dev_dbg(&vk->pdev->dev, in bcm_vk_ioctl()
1238 mutex_lock(&vk->mutex); in bcm_vk_ioctl()
1253 mutex_unlock(&vk->mutex); in bcm_vk_ioctl()
1287 struct device *dev = &pdev->dev; in bcm_vk_probe()
1294 return -ENOMEM; in bcm_vk_probe()
1296 kref_init(&vk->kref); in bcm_vk_probe()
1302 vk->ib_sgl_size = nr_ib_sgl_blk * VK_MSGQ_BLK_SIZE; in bcm_vk_probe()
1303 mutex_init(&vk->mutex); in bcm_vk_probe()
1310 vk->pdev = pci_dev_get(pdev); in bcm_vk_probe()
1319 err = dma_set_mask_and_coherent(&pdev->dev, in bcm_vk_probe()
1328 vk->tdma_vaddr = dma_alloc_coherent in bcm_vk_probe()
1331 &vk->tdma_addr, GFP_KERNEL); in bcm_vk_probe()
1332 if (!vk->tdma_vaddr) { in bcm_vk_probe()
1333 err = -ENOMEM; in bcm_vk_probe()
1349 err = (irq >= 0) ? -EINVAL : irq; in bcm_vk_probe()
1354 dev_warn(dev, "Number of IRQs %d allocated - requested(%d).\n", in bcm_vk_probe()
1359 vk->bar[i] = pci_ioremap_bar(pdev, i * 2); in bcm_vk_probe()
1360 if (!vk->bar[i]) { in bcm_vk_probe()
1362 err = -ENOMEM; in bcm_vk_probe()
1367 for (vk->num_irqs = 0; in bcm_vk_probe()
1368 vk->num_irqs < VK_MSIX_MSGQ_MAX; in bcm_vk_probe()
1369 vk->num_irqs++) { in bcm_vk_probe()
1370 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs), in bcm_vk_probe()
1375 pdev->irq + vk->num_irqs, vk->num_irqs + 1); in bcm_vk_probe()
1380 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs), in bcm_vk_probe()
1385 pdev->irq + vk->num_irqs, vk->num_irqs + 1); in bcm_vk_probe()
1388 vk->num_irqs++; in bcm_vk_probe()
1391 (i < VK_MSIX_TTY_MAX) && (vk->num_irqs < irq); in bcm_vk_probe()
1392 i++, vk->num_irqs++) { in bcm_vk_probe()
1393 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs), in bcm_vk_probe()
1398 pdev->irq + vk->num_irqs, vk->num_irqs + 1); in bcm_vk_probe()
1411 vk->devid = id; in bcm_vk_probe()
1413 misc_device = &vk->miscdev; in bcm_vk_probe()
1414 misc_device->minor = MISC_DYNAMIC_MINOR; in bcm_vk_probe()
1415 misc_device->name = kstrdup(name, GFP_KERNEL); in bcm_vk_probe()
1416 if (!misc_device->name) { in bcm_vk_probe()
1417 err = -ENOMEM; in bcm_vk_probe()
1420 misc_device->fops = &bcm_vk_fops, in bcm_vk_probe()
1428 INIT_WORK(&vk->wq_work, bcm_vk_wq_handler); in bcm_vk_probe()
1431 vk->wq_thread = create_singlethread_workqueue(name); in bcm_vk_probe()
1432 if (!vk->wq_thread) { in bcm_vk_probe()
1434 err = -ENOMEM; in bcm_vk_probe()
1448 vk->panic_nb.notifier_call = bcm_vk_on_panic; in bcm_vk_probe()
1450 &vk->panic_nb); in bcm_vk_probe()
1473 "Auto-load skipped - BROM not in proper state (0x%x)\n", in bcm_vk_probe()
1481 dev_dbg(dev, "BCM-VK:%u created\n", id); in bcm_vk_probe()
1490 &vk->panic_nb); in bcm_vk_probe()
1493 destroy_workqueue(vk->wq_thread); in bcm_vk_probe()
1499 kfree(misc_device->name); in bcm_vk_probe()
1500 misc_device->name = NULL; in bcm_vk_probe()
1506 for (i = 0; i < vk->num_irqs; i++) in bcm_vk_probe()
1514 if (vk->bar[i]) in bcm_vk_probe()
1515 pci_iounmap(pdev, vk->bar[i]); in bcm_vk_probe()
1520 if (vk->tdma_vaddr) in bcm_vk_probe()
1521 dma_free_coherent(&pdev->dev, nr_scratch_pages * PAGE_SIZE, in bcm_vk_probe()
1522 vk->tdma_vaddr, vk->tdma_addr); in bcm_vk_probe()
1537 struct pci_dev *pdev = vk->pdev; in bcm_vk_release_data()
1539 dev_dbg(&pdev->dev, "BCM-VK:%d release data 0x%p\n", vk->devid, vk); in bcm_vk_release_data()
1548 struct miscdevice *misc_device = &vk->miscdev; in bcm_vk_remove()
1554 * which re-initialize the card into its default state. in bcm_vk_remove()
1555 * This ensures when driver is re-enumerated it will start from in bcm_vk_remove()
1563 &vk->panic_nb); in bcm_vk_remove()
1568 if (vk->tdma_vaddr) in bcm_vk_remove()
1569 dma_free_coherent(&pdev->dev, nr_scratch_pages * PAGE_SIZE, in bcm_vk_remove()
1570 vk->tdma_vaddr, vk->tdma_addr); in bcm_vk_remove()
1573 if (misc_device->name) { in bcm_vk_remove()
1575 kfree(misc_device->name); in bcm_vk_remove()
1576 ida_free(&bcm_vk_ida, vk->devid); in bcm_vk_remove()
1578 for (i = 0; i < vk->num_irqs; i++) in bcm_vk_remove()
1579 devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), vk); in bcm_vk_remove()
1584 cancel_work_sync(&vk->wq_work); in bcm_vk_remove()
1585 destroy_workqueue(vk->wq_thread); in bcm_vk_remove()
1589 if (vk->bar[i]) in bcm_vk_remove()
1590 pci_iounmap(pdev, vk->bar[i]); in bcm_vk_remove()
1593 dev_dbg(&pdev->dev, "BCM-VK:%d released\n", vk->devid); in bcm_vk_remove()
1599 kref_put(&vk->kref, bcm_vk_release_data); in bcm_vk_remove()
1622 * sync up the bootstatus properly so that on reboot-back-up, in bcm_vk_shutdown()