Lines Matching refs:pinstance
142 struct pmcraid_instance *pinstance; in pmcraid_slave_alloc() local
148 pinstance = shost_priv(scsi_dev->host); in pmcraid_slave_alloc()
150 fw_version = be16_to_cpu(pinstance->inq_data->fw_version); in pmcraid_slave_alloc()
157 spin_lock_irqsave(&pinstance->resource_lock, lock_flags); in pmcraid_slave_alloc()
158 list_for_each_entry(temp, &pinstance->used_res_q, queue) { in pmcraid_slave_alloc()
195 spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags); in pmcraid_slave_alloc()
363 struct pmcraid_instance *pinstance in pmcraid_get_free_cmd() argument
370 spin_lock_irqsave(&pinstance->free_pool_lock, lock_flags); in pmcraid_get_free_cmd()
372 if (!list_empty(&pinstance->free_cmd_pool)) { in pmcraid_get_free_cmd()
373 cmd = list_entry(pinstance->free_cmd_pool.next, in pmcraid_get_free_cmd()
377 spin_unlock_irqrestore(&pinstance->free_pool_lock, lock_flags); in pmcraid_get_free_cmd()
394 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_return_cmd() local
397 spin_lock_irqsave(&pinstance->free_pool_lock, lock_flags); in pmcraid_return_cmd()
398 list_add_tail(&cmd->free_list, &pinstance->free_cmd_pool); in pmcraid_return_cmd()
399 spin_unlock_irqrestore(&pinstance->free_pool_lock, lock_flags); in pmcraid_return_cmd()
410 static u32 pmcraid_read_interrupts(struct pmcraid_instance *pinstance) in pmcraid_read_interrupts() argument
412 return (pinstance->interrupt_mode) ? in pmcraid_read_interrupts()
413 ioread32(pinstance->int_regs.ioa_host_msix_interrupt_reg) : in pmcraid_read_interrupts()
414 ioread32(pinstance->int_regs.ioa_host_interrupt_reg); in pmcraid_read_interrupts()
427 struct pmcraid_instance *pinstance, in pmcraid_disable_interrupts() argument
431 u32 gmask = ioread32(pinstance->int_regs.global_interrupt_mask_reg); in pmcraid_disable_interrupts()
434 iowrite32(intrs, pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_disable_interrupts()
435 iowrite32(nmask, pinstance->int_regs.global_interrupt_mask_reg); in pmcraid_disable_interrupts()
436 ioread32(pinstance->int_regs.global_interrupt_mask_reg); in pmcraid_disable_interrupts()
438 if (!pinstance->interrupt_mode) { in pmcraid_disable_interrupts()
440 pinstance->int_regs.ioa_host_interrupt_mask_reg); in pmcraid_disable_interrupts()
441 ioread32(pinstance->int_regs.ioa_host_interrupt_mask_reg); in pmcraid_disable_interrupts()
455 struct pmcraid_instance *pinstance, in pmcraid_enable_interrupts() argument
458 u32 gmask = ioread32(pinstance->int_regs.global_interrupt_mask_reg); in pmcraid_enable_interrupts()
461 iowrite32(nmask, pinstance->int_regs.global_interrupt_mask_reg); in pmcraid_enable_interrupts()
463 if (!pinstance->interrupt_mode) { in pmcraid_enable_interrupts()
465 pinstance->int_regs.ioa_host_interrupt_mask_reg); in pmcraid_enable_interrupts()
466 ioread32(pinstance->int_regs.ioa_host_interrupt_mask_reg); in pmcraid_enable_interrupts()
470 ioread32(pinstance->int_regs.global_interrupt_mask_reg), in pmcraid_enable_interrupts()
471 ioread32(pinstance->int_regs.ioa_host_interrupt_mask_reg)); in pmcraid_enable_interrupts()
483 struct pmcraid_instance *pinstance in pmcraid_clr_trans_op() argument
488 if (!pinstance->interrupt_mode) { in pmcraid_clr_trans_op()
490 pinstance->int_regs.ioa_host_interrupt_mask_reg); in pmcraid_clr_trans_op()
491 ioread32(pinstance->int_regs.ioa_host_interrupt_mask_reg); in pmcraid_clr_trans_op()
493 pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_clr_trans_op()
494 ioread32(pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_clr_trans_op()
497 if (pinstance->reset_cmd != NULL) { in pmcraid_clr_trans_op()
498 del_timer(&pinstance->reset_cmd->timer); in pmcraid_clr_trans_op()
500 pinstance->host->host_lock, lock_flags); in pmcraid_clr_trans_op()
501 pinstance->reset_cmd->cmd_done(pinstance->reset_cmd); in pmcraid_clr_trans_op()
503 pinstance->host->host_lock, lock_flags); in pmcraid_clr_trans_op()
516 static void pmcraid_reset_type(struct pmcraid_instance *pinstance) in pmcraid_reset_type() argument
522 mask = ioread32(pinstance->int_regs.ioa_host_interrupt_mask_reg); in pmcraid_reset_type()
523 intrs = ioread32(pinstance->int_regs.ioa_host_interrupt_reg); in pmcraid_reset_type()
524 alerts = ioread32(pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_reset_type()
530 pinstance->ioa_hard_reset = 1; in pmcraid_reset_type()
535 pinstance->ioa_unit_check = 1; in pmcraid_reset_type()
548 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_bist_done() local
553 rc = pci_read_config_word(pinstance->pdev, PCI_COMMAND, &pci_reg); in pmcraid_bist_done()
565 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_bist_done()
567 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_bist_done()
579 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_start_bist() local
584 pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_start_bist()
585 doorbells = ioread32(pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_start_bist()
586 intrs = ioread32(pinstance->int_regs.ioa_host_interrupt_reg); in pmcraid_start_bist()
605 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_reset_alert_done() local
606 u32 status = ioread32(pinstance->ioa_status); in pmcraid_reset_alert_done()
616 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_reset_alert_done()
618 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_reset_alert_done()
641 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_reset_alert() local
651 rc = pci_read_config_word(pinstance->pdev, PCI_COMMAND, &pci_reg); in pmcraid_reset_alert()
665 pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_reset_alert()
667 ioread32(pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_reset_alert()
671 pinstance->ioa_state = IOA_STATE_IN_HARD_RESET; in pmcraid_reset_alert()
689 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_timeout_handler() local
692 dev_info(&pinstance->pdev->dev, in pmcraid_timeout_handler()
702 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_timeout_handler()
703 if (!pinstance->ioa_reset_in_progress) { in pmcraid_timeout_handler()
704 pinstance->ioa_reset_attempts = 0; in pmcraid_timeout_handler()
705 cmd = pmcraid_get_free_cmd(pinstance); in pmcraid_timeout_handler()
711 spin_unlock_irqrestore(pinstance->host->host_lock, in pmcraid_timeout_handler()
717 pinstance->reset_cmd = cmd; in pmcraid_timeout_handler()
718 pinstance->ioa_reset_in_progress = 1; in pmcraid_timeout_handler()
722 if (pinstance->reset_cmd != cmd) { in pmcraid_timeout_handler()
735 if (cmd == pinstance->reset_cmd) in pmcraid_timeout_handler()
740 if (pinstance->scn.ioa_state != PMC_DEVICE_EVENT_RESET_START && in pmcraid_timeout_handler()
741 pinstance->scn.ioa_state != PMC_DEVICE_EVENT_SHUTDOWN_START) in pmcraid_timeout_handler()
742 pmcraid_notify_ioastate(pinstance, in pmcraid_timeout_handler()
745 pinstance->ioa_state = IOA_STATE_IN_RESET_ALERT; in pmcraid_timeout_handler()
746 scsi_block_requests(pinstance->host); in pmcraid_timeout_handler()
748 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_timeout_handler()
824 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_erp_done() local
835 dma_unmap_single(&pinstance->pdev->dev, cmd->sense_buffer_dma, in pmcraid_erp_done()
859 struct pmcraid_instance *pinstance = cmd->drv_inst; in _pmcraid_fire_command() local
867 spin_lock_irqsave(&pinstance->pending_pool_lock, lock_flags); in _pmcraid_fire_command()
868 list_add_tail(&cmd->free_list, &pinstance->pending_cmd_pool); in _pmcraid_fire_command()
869 spin_unlock_irqrestore(&pinstance->pending_pool_lock, lock_flags); in _pmcraid_fire_command()
870 atomic_inc(&pinstance->outstanding_cmds); in _pmcraid_fire_command()
874 iowrite32(le64_to_cpu(cmd->ioa_cb->ioarcb.ioarcb_bus_addr), pinstance->ioarrin); in _pmcraid_fire_command()
921 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_ioa_shutdown_done() local
924 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_ioa_shutdown_done()
926 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_ioa_shutdown_done()
975 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_get_fwversion_done() local
985 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_get_fwversion_done()
986 pinstance->ioa_state = IOA_STATE_IN_RESET_ALERT; in pmcraid_get_fwversion_done()
988 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_get_fwversion_done()
1006 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_get_fwversion() local
1030 ioadl->address = cpu_to_le64(pinstance->inq_data_baddr); in pmcraid_get_fwversion()
1046 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_identify_hrrq() local
1049 __be64 hrrq_addr = cpu_to_be64(pinstance->hrrq_start_bus_addr[index]); in pmcraid_identify_hrrq()
1056 if (cmd->hrrq_index < pinstance->num_hrrq) { in pmcraid_identify_hrrq()
1122 struct pmcraid_instance *pinstance, in pmcraid_init_hcam() argument
1134 cmd = pmcraid_get_free_cmd(pinstance); in pmcraid_init_hcam()
1144 dma = pinstance->ccn.baddr + PMCRAID_AEN_HDR_SIZE; in pmcraid_init_hcam()
1145 hcam = &pinstance->ccn; in pmcraid_init_hcam()
1149 dma = pinstance->ldn.baddr + PMCRAID_AEN_HDR_SIZE; in pmcraid_init_hcam()
1150 hcam = &pinstance->ldn; in pmcraid_init_hcam()
1191 static void pmcraid_send_hcam(struct pmcraid_instance *pinstance, u8 type) in pmcraid_send_hcam() argument
1193 struct pmcraid_cmd *cmd = pmcraid_init_hcam(pinstance, type); in pmcraid_send_hcam()
1242 struct pmcraid_instance *pinstance; in pmcraid_cancel_hcam() local
1245 pinstance = cmd->drv_inst; in pmcraid_cancel_hcam()
1247 &pinstance->ldn : &pinstance->ccn; in pmcraid_cancel_hcam()
1392 struct pmcraid_instance *pinstance, in pmcraid_notify_aen() argument
1401 aen_msg->hostno = (pinstance->host->unique_id << 16 | in pmcraid_notify_aen()
1402 MINOR(pinstance->cdev.dev)); in pmcraid_notify_aen()
1461 static int pmcraid_notify_ccn(struct pmcraid_instance *pinstance) in pmcraid_notify_ccn() argument
1463 return pmcraid_notify_aen(pinstance, in pmcraid_notify_ccn()
1464 pinstance->ccn.msg, in pmcraid_notify_ccn()
1465 le32_to_cpu(pinstance->ccn.hcam->data_len) + in pmcraid_notify_ccn()
1476 static int pmcraid_notify_ldn(struct pmcraid_instance *pinstance) in pmcraid_notify_ldn() argument
1478 return pmcraid_notify_aen(pinstance, in pmcraid_notify_ldn()
1479 pinstance->ldn.msg, in pmcraid_notify_ldn()
1480 le32_to_cpu(pinstance->ldn.hcam->data_len) + in pmcraid_notify_ldn()
1492 static void pmcraid_notify_ioastate(struct pmcraid_instance *pinstance, u32 evt) in pmcraid_notify_ioastate() argument
1494 pinstance->scn.ioa_state = evt; in pmcraid_notify_ioastate()
1495 pmcraid_notify_aen(pinstance, in pmcraid_notify_ioastate()
1496 &pinstance->scn.msg, in pmcraid_notify_ioastate()
1508 static void pmcraid_handle_config_change(struct pmcraid_instance *pinstance) in pmcraid_handle_config_change() argument
1522 ccn_hcam = (struct pmcraid_hcam_ccn *)pinstance->ccn.hcam; in pmcraid_handle_config_change()
1524 fw_version = be16_to_cpu(pinstance->inq_data->fw_version); in pmcraid_handle_config_change()
1528 le32_to_cpu(pinstance->ccn.hcam->ilid), in pmcraid_handle_config_change()
1529 pinstance->ccn.hcam->op_code, in pmcraid_handle_config_change()
1530 (le32_to_cpu(pinstance->ccn.hcam->timestamp1) | in pmcraid_handle_config_change()
1531 ((le32_to_cpu(pinstance->ccn.hcam->timestamp2) & 0xffffffffLL) << 32)), in pmcraid_handle_config_change()
1532 pinstance->ccn.hcam->notification_type, in pmcraid_handle_config_change()
1533 pinstance->ccn.hcam->notification_lost, in pmcraid_handle_config_change()
1534 pinstance->ccn.hcam->flags, in pmcraid_handle_config_change()
1535 pinstance->host->unique_id, in pmcraid_handle_config_change()
1548 if (pinstance->ccn.hcam->notification_lost) { in pmcraid_handle_config_change()
1549 cfgcmd = pmcraid_get_free_cmd(pinstance); in pmcraid_handle_config_change()
1552 pinstance->reinit_cfg_table = 1; in pmcraid_handle_config_change()
1564 if (pinstance->ccn.hcam->notification_type == in pmcraid_handle_config_change()
1572 spin_lock_irqsave(&pinstance->resource_lock, lock_flags); in pmcraid_handle_config_change()
1573 list_for_each_entry(res, &pinstance->used_res_q, queue) { in pmcraid_handle_config_change()
1586 spin_unlock_irqrestore(&pinstance->resource_lock, in pmcraid_handle_config_change()
1595 if (list_empty(&pinstance->free_res_q)) { in pmcraid_handle_config_change()
1596 spin_unlock_irqrestore(&pinstance->resource_lock, in pmcraid_handle_config_change()
1599 spin_lock_irqsave(pinstance->host->host_lock, in pmcraid_handle_config_change()
1601 pmcraid_send_hcam(pinstance, in pmcraid_handle_config_change()
1603 spin_unlock_irqrestore(pinstance->host->host_lock, in pmcraid_handle_config_change()
1608 res = list_entry(pinstance->free_res_q.next, in pmcraid_handle_config_change()
1614 list_add_tail(&res->queue, &pinstance->used_res_q); in pmcraid_handle_config_change()
1617 memcpy(&res->cfg_entry, cfg_entry, pinstance->config_table_entry_size); in pmcraid_handle_config_change()
1619 if (pinstance->ccn.hcam->notification_type == in pmcraid_handle_config_change()
1629 schedule_work(&pinstance->worker_q); in pmcraid_handle_config_change()
1632 list_move_tail(&res->queue, &pinstance->free_res_q); in pmcraid_handle_config_change()
1636 schedule_work(&pinstance->worker_q); in pmcraid_handle_config_change()
1638 spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags); in pmcraid_handle_config_change()
1644 pmcraid_notify_ccn(pinstance); in pmcraid_handle_config_change()
1646 cmd = pmcraid_init_hcam(pinstance, PMCRAID_HCAM_CODE_CONFIG_CHANGE); in pmcraid_handle_config_change()
1695 static void pmcraid_handle_error_log(struct pmcraid_instance *pinstance) in pmcraid_handle_error_log() argument
1700 hcam_ldn = (struct pmcraid_hcam_ldn *)pinstance->ldn.hcam; in pmcraid_handle_error_log()
1704 pinstance->ldn.hcam->ilid, in pmcraid_handle_error_log()
1705 pinstance->ldn.hcam->op_code, in pmcraid_handle_error_log()
1706 pinstance->ldn.hcam->notification_type, in pmcraid_handle_error_log()
1707 pinstance->ldn.hcam->notification_lost, in pmcraid_handle_error_log()
1708 pinstance->ldn.hcam->flags, in pmcraid_handle_error_log()
1709 pinstance->ldn.hcam->overlay_id); in pmcraid_handle_error_log()
1712 if (pinstance->ldn.hcam->notification_type != in pmcraid_handle_error_log()
1716 if (pinstance->ldn.hcam->notification_lost == in pmcraid_handle_error_log()
1718 dev_info(&pinstance->pdev->dev, "Error notifications lost\n"); in pmcraid_handle_error_log()
1724 dev_info(&pinstance->pdev->dev, in pmcraid_handle_error_log()
1727 pinstance->host, in pmcraid_handle_error_log()
1746 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_process_ccn() local
1750 pinstance->ccn.cmd = NULL; in pmcraid_process_ccn()
1758 atomic_read(&pinstance->ccn.ignore) == 1) { in pmcraid_process_ccn()
1761 dev_info(&pinstance->pdev->dev, in pmcraid_process_ccn()
1763 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_process_ccn()
1764 pmcraid_send_hcam(pinstance, PMCRAID_HCAM_CODE_CONFIG_CHANGE); in pmcraid_process_ccn()
1765 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_process_ccn()
1767 pmcraid_handle_config_change(pinstance); in pmcraid_process_ccn()
1782 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_process_ldn() local
1784 (struct pmcraid_hcam_ldn *)pinstance->ldn.hcam; in pmcraid_process_ldn()
1790 pinstance->ldn.cmd = NULL; in pmcraid_process_ldn()
1798 atomic_read(&pinstance->ccn.ignore) == 1) { in pmcraid_process_ldn()
1801 pmcraid_handle_error_log(pinstance); in pmcraid_process_ldn()
1803 spin_lock_irqsave(pinstance->host->host_lock, in pmcraid_process_ldn()
1805 pmcraid_initiate_reset(pinstance); in pmcraid_process_ldn()
1806 spin_unlock_irqrestore(pinstance->host->host_lock, in pmcraid_process_ldn()
1811 pinstance->timestamp_error = 1; in pmcraid_process_ldn()
1815 dev_info(&pinstance->pdev->dev, in pmcraid_process_ldn()
1820 pmcraid_notify_ldn(pinstance); in pmcraid_process_ldn()
1822 cmd = pmcraid_init_hcam(pinstance, PMCRAID_HCAM_CODE_LOG_DATA); in pmcraid_process_ldn()
1835 static void pmcraid_register_hcams(struct pmcraid_instance *pinstance) in pmcraid_register_hcams() argument
1837 pmcraid_send_hcam(pinstance, PMCRAID_HCAM_CODE_CONFIG_CHANGE); in pmcraid_register_hcams()
1838 pmcraid_send_hcam(pinstance, PMCRAID_HCAM_CODE_LOG_DATA); in pmcraid_register_hcams()
1847 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_unregister_hcams() local
1854 atomic_set(&pinstance->ccn.ignore, 1); in pmcraid_unregister_hcams()
1855 atomic_set(&pinstance->ldn.ignore, 1); in pmcraid_unregister_hcams()
1861 if ((pinstance->force_ioa_reset && !pinstance->ioa_bringdown) || in pmcraid_unregister_hcams()
1862 pinstance->ioa_unit_check) { in pmcraid_unregister_hcams()
1863 pinstance->force_ioa_reset = 0; in pmcraid_unregister_hcams()
1864 pinstance->ioa_unit_check = 0; in pmcraid_unregister_hcams()
1865 pinstance->ioa_state = IOA_STATE_IN_RESET_ALERT; in pmcraid_unregister_hcams()
1885 static int pmcraid_reset_enable_ioa(struct pmcraid_instance *pinstance) in pmcraid_reset_enable_ioa() argument
1889 pmcraid_reinit_buffers(pinstance); in pmcraid_reset_enable_ioa()
1890 intrs = pmcraid_read_interrupts(pinstance); in pmcraid_reset_enable_ioa()
1892 pmcraid_enable_interrupts(pinstance, PMCRAID_PCI_INTERRUPTS); in pmcraid_reset_enable_ioa()
1895 if (!pinstance->interrupt_mode) { in pmcraid_reset_enable_ioa()
1897 pinstance->int_regs. in pmcraid_reset_enable_ioa()
1900 pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_reset_enable_ioa()
1917 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_soft_reset() local
1942 if (pinstance->interrupt_mode) { in pmcraid_soft_reset()
1944 pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_soft_reset()
1945 ioread32(pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_soft_reset()
1948 iowrite32(doorbell, pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_soft_reset()
1949 ioread32(pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_soft_reset()
1950 int_reg = ioread32(pinstance->int_regs.ioa_host_interrupt_reg); in pmcraid_soft_reset()
1953 ioread32(pinstance->int_regs.host_ioa_interrupt_reg), in pmcraid_soft_reset()
1965 static void pmcraid_get_dump(struct pmcraid_instance *pinstance) in pmcraid_get_dump() argument
1982 static void pmcraid_fail_outstanding_cmds(struct pmcraid_instance *pinstance) in pmcraid_fail_outstanding_cmds() argument
1990 spin_lock_irqsave(&pinstance->pending_pool_lock, lock_flags); in pmcraid_fail_outstanding_cmds()
1991 list_for_each_entry_safe(cmd, temp, &pinstance->pending_cmd_pool, in pmcraid_fail_outstanding_cmds()
1994 spin_unlock_irqrestore(&pinstance->pending_pool_lock, in pmcraid_fail_outstanding_cmds()
2032 atomic_dec(&pinstance->outstanding_cmds); in pmcraid_fail_outstanding_cmds()
2033 spin_lock_irqsave(&pinstance->pending_pool_lock, lock_flags); in pmcraid_fail_outstanding_cmds()
2036 spin_unlock_irqrestore(&pinstance->pending_pool_lock, lock_flags); in pmcraid_fail_outstanding_cmds()
2056 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_ioa_reset() local
2059 pinstance->ioa_reset_in_progress = 1; in pmcraid_ioa_reset()
2061 if (pinstance->reset_cmd != cmd) { in pmcraid_ioa_reset()
2063 pinstance->reset_cmd = cmd; in pmcraid_ioa_reset()
2067 pinstance->ioa_state, cmd); in pmcraid_ioa_reset()
2069 switch (pinstance->ioa_state) { in pmcraid_ioa_reset()
2085 pmcraid_disable_interrupts(pinstance, ~0); in pmcraid_ioa_reset()
2086 pinstance->ioa_state = IOA_STATE_IN_RESET_ALERT; in pmcraid_ioa_reset()
2094 scsi_block_requests(pinstance->host); in pmcraid_ioa_reset()
2100 if (pinstance->ioa_hard_reset == 0) { in pmcraid_ioa_reset()
2101 if (ioread32(pinstance->ioa_status) & in pmcraid_ioa_reset()
2104 pinstance->ioa_state = IOA_STATE_IN_BRINGUP; in pmcraid_ioa_reset()
2108 pinstance->ioa_state = IOA_STATE_IN_SOFT_RESET; in pmcraid_ioa_reset()
2115 pinstance->ioa_state = IOA_STATE_IN_RESET_ALERT; in pmcraid_ioa_reset()
2126 pinstance->ioa_state = IOA_STATE_IN_HARD_RESET; in pmcraid_ioa_reset()
2131 pinstance->ioa_reset_attempts++; in pmcraid_ioa_reset()
2134 if (pinstance->ioa_reset_attempts > PMCRAID_RESET_ATTEMPTS) { in pmcraid_ioa_reset()
2135 pinstance->ioa_reset_attempts = 0; in pmcraid_ioa_reset()
2137 pinstance->ioa_state = IOA_STATE_DEAD; in pmcraid_ioa_reset()
2139 if (pinstance->ioa_bringdown) in pmcraid_ioa_reset()
2140 pmcraid_notify_ioastate(pinstance, in pmcraid_ioa_reset()
2143 pmcraid_notify_ioastate(pinstance, in pmcraid_ioa_reset()
2152 pci_restore_state(pinstance->pdev); in pmcraid_ioa_reset()
2155 pmcraid_fail_outstanding_cmds(pinstance); in pmcraid_ioa_reset()
2158 if (pinstance->ioa_unit_check) { in pmcraid_ioa_reset()
2160 pinstance->ioa_unit_check = 0; in pmcraid_ioa_reset()
2161 pmcraid_get_dump(pinstance); in pmcraid_ioa_reset()
2162 pinstance->ioa_reset_attempts--; in pmcraid_ioa_reset()
2163 pinstance->ioa_state = IOA_STATE_IN_RESET_ALERT; in pmcraid_ioa_reset()
2172 if (pinstance->ioa_bringdown) { in pmcraid_ioa_reset()
2174 pinstance->ioa_shutdown_type = SHUTDOWN_NONE; in pmcraid_ioa_reset()
2175 pinstance->ioa_bringdown = 0; in pmcraid_ioa_reset()
2176 pinstance->ioa_state = IOA_STATE_UNKNOWN; in pmcraid_ioa_reset()
2177 pmcraid_notify_ioastate(pinstance, in pmcraid_ioa_reset()
2185 if (pmcraid_reset_enable_ioa(pinstance)) { in pmcraid_ioa_reset()
2186 pinstance->ioa_state = IOA_STATE_IN_BRINGUP; in pmcraid_ioa_reset()
2191 pinstance->ioa_state = IOA_STATE_IN_SOFT_RESET; in pmcraid_ioa_reset()
2202 pinstance->ioa_state = IOA_STATE_IN_BRINGUP; in pmcraid_ioa_reset()
2215 pinstance->ioa_state = IOA_STATE_OPERATIONAL; in pmcraid_ioa_reset()
2226 if (pinstance->ioa_shutdown_type == SHUTDOWN_NONE && in pmcraid_ioa_reset()
2227 pinstance->force_ioa_reset == 0) { in pmcraid_ioa_reset()
2228 pmcraid_notify_ioastate(pinstance, in pmcraid_ioa_reset()
2232 if (pinstance->ioa_shutdown_type != SHUTDOWN_NONE) in pmcraid_ioa_reset()
2233 pinstance->ioa_state = IOA_STATE_IN_BRINGDOWN; in pmcraid_ioa_reset()
2246 pinstance->ioa_reset_in_progress = 0; in pmcraid_ioa_reset()
2247 pinstance->ioa_reset_attempts = 0; in pmcraid_ioa_reset()
2248 pinstance->reset_cmd = NULL; in pmcraid_ioa_reset()
2249 pinstance->ioa_shutdown_type = SHUTDOWN_NONE; in pmcraid_ioa_reset()
2250 pinstance->ioa_bringdown = 0; in pmcraid_ioa_reset()
2256 if (pinstance->ioa_state == IOA_STATE_OPERATIONAL) in pmcraid_ioa_reset()
2257 pmcraid_register_hcams(pinstance); in pmcraid_ioa_reset()
2259 wake_up_all(&pinstance->reset_wait_q); in pmcraid_ioa_reset()
2276 static void pmcraid_initiate_reset(struct pmcraid_instance *pinstance) in pmcraid_initiate_reset() argument
2283 if (!pinstance->ioa_reset_in_progress) { in pmcraid_initiate_reset()
2284 scsi_block_requests(pinstance->host); in pmcraid_initiate_reset()
2285 cmd = pmcraid_get_free_cmd(pinstance); in pmcraid_initiate_reset()
2292 pinstance->ioa_shutdown_type = SHUTDOWN_NONE; in pmcraid_initiate_reset()
2293 pinstance->reset_cmd = cmd; in pmcraid_initiate_reset()
2294 pinstance->force_ioa_reset = 1; in pmcraid_initiate_reset()
2295 pmcraid_notify_ioastate(pinstance, in pmcraid_initiate_reset()
2316 struct pmcraid_instance *pinstance, in pmcraid_reset_reload() argument
2325 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_reset_reload()
2327 if (pinstance->ioa_reset_in_progress) { in pmcraid_reset_reload()
2330 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_reset_reload()
2332 wait_event(pinstance->reset_wait_q, in pmcraid_reset_reload()
2333 !pinstance->ioa_reset_in_progress); in pmcraid_reset_reload()
2335 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_reset_reload()
2337 if (pinstance->ioa_state == IOA_STATE_DEAD) { in pmcraid_reset_reload()
2342 if (pinstance->ioa_state == target_state) { in pmcraid_reset_reload()
2349 scsi_block_requests(pinstance->host); in pmcraid_reset_reload()
2350 reset_cmd = pmcraid_get_free_cmd(pinstance); in pmcraid_reset_reload()
2357 pinstance->ioa_bringdown = 1; in pmcraid_reset_reload()
2359 pinstance->ioa_shutdown_type = shutdown_type; in pmcraid_reset_reload()
2360 pinstance->reset_cmd = reset_cmd; in pmcraid_reset_reload()
2361 pinstance->force_ioa_reset = reset; in pmcraid_reset_reload()
2364 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_reset_reload()
2366 wait_event(pinstance->reset_wait_q, in pmcraid_reset_reload()
2367 !pinstance->ioa_reset_in_progress); in pmcraid_reset_reload()
2370 scsi_unblock_requests(pinstance->host); in pmcraid_reset_reload()
2371 return pinstance->ioa_state != target_state; in pmcraid_reset_reload()
2374 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_reset_reload()
2386 static int pmcraid_reset_bringdown(struct pmcraid_instance *pinstance) in pmcraid_reset_bringdown() argument
2388 return pmcraid_reset_reload(pinstance, in pmcraid_reset_bringdown()
2401 static int pmcraid_reset_bringup(struct pmcraid_instance *pinstance) in pmcraid_reset_bringup() argument
2403 pmcraid_notify_ioastate(pinstance, PMC_DEVICE_EVENT_RESET_START); in pmcraid_reset_bringup()
2405 return pmcraid_reset_reload(pinstance, in pmcraid_reset_bringup()
2583 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_error_handler() local
2631 scsi_report_bus_reset(pinstance->host, in pmcraid_error_handler()
2702 struct pmcraid_instance *pinstance; in pmcraid_reset_device() local
2708 pinstance = in pmcraid_reset_device()
2722 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_reset_device()
2723 if (pinstance->ioa_reset_in_progress || in pmcraid_reset_device()
2724 pinstance->ioa_state == IOA_STATE_DEAD) { in pmcraid_reset_device()
2725 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_reset_device()
2736 cmd = pmcraid_get_free_cmd(pinstance); in pmcraid_reset_device()
2739 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_reset_device()
2768 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_reset_device()
2858 struct pmcraid_instance *pinstance; in pmcraid_abort_cmd() local
2860 pinstance = (struct pmcraid_instance *)cmd->drv_inst; in pmcraid_abort_cmd()
2862 cancel_cmd = pmcraid_get_free_cmd(pinstance); in pmcraid_abort_cmd()
2938 struct pmcraid_instance *pinstance; in pmcraid_eh_abort_handler() local
2947 pinstance = in pmcraid_eh_abort_handler()
2963 spin_lock_irqsave(pinstance->host->host_lock, host_lock_flags); in pmcraid_eh_abort_handler()
2965 if (pinstance->ioa_reset_in_progress || in pmcraid_eh_abort_handler()
2966 pinstance->ioa_state == IOA_STATE_DEAD) { in pmcraid_eh_abort_handler()
2967 spin_unlock_irqrestore(pinstance->host->host_lock, in pmcraid_eh_abort_handler()
2977 spin_lock_irqsave(&pinstance->pending_pool_lock, pending_lock_flags); in pmcraid_eh_abort_handler()
2978 list_for_each_entry(cmd, &pinstance->pending_cmd_pool, free_list) { in pmcraid_eh_abort_handler()
2986 spin_unlock_irqrestore(&pinstance->pending_pool_lock, in pmcraid_eh_abort_handler()
2995 spin_unlock_irqrestore(pinstance->host->host_lock, in pmcraid_eh_abort_handler()
3032 struct pmcraid_instance *pinstance = in pmcraid_eh_bus_reset_handler() local
3043 spin_lock_irqsave(&pinstance->resource_lock, lock_flags); in pmcraid_eh_bus_reset_handler()
3044 list_for_each_entry(temp, &pinstance->used_res_q, queue) { in pmcraid_eh_bus_reset_handler()
3057 spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags); in pmcraid_eh_bus_reset_handler()
3106 struct pmcraid_instance *pinstance = in pmcraid_eh_host_reset_handler() local
3115 if (atomic_read(&pinstance->outstanding_cmds) <= in pmcraid_eh_host_reset_handler()
3121 dev_err(&pinstance->pdev->dev, in pmcraid_eh_host_reset_handler()
3123 return pmcraid_reset_bringup(pinstance) == 0 ? SUCCESS : FAILED; in pmcraid_eh_host_reset_handler()
3184 struct pmcraid_instance *pinstance, in pmcraid_build_ioadl() argument
3247 struct pmcraid_instance *pinstance; in pmcraid_queuecommand_lck() local
3254 pinstance = in pmcraid_queuecommand_lck()
3256 fw_version = be16_to_cpu(pinstance->inq_data->fw_version); in pmcraid_queuecommand_lck()
3263 if (pinstance->ioa_state == IOA_STATE_DEAD) { in pmcraid_queuecommand_lck()
3271 if (pinstance->ioa_reset_in_progress) in pmcraid_queuecommand_lck()
3284 cmd = pmcraid_get_free_cmd(pinstance); in pmcraid_queuecommand_lck()
3302 ioarcb->hrrq_id = atomic_add_return(1, &(pinstance->last_message_id)) % in pmcraid_queuecommand_lck()
3303 pinstance->num_hrrq; in pmcraid_queuecommand_lck()
3324 rc = pmcraid_build_ioadl(pinstance, cmd); in pmcraid_queuecommand_lck()
3328 scsi_cmd->cmnd[0], pinstance->host->unique_id, in pmcraid_queuecommand_lck()
3356 struct pmcraid_instance *pinstance; in DEF_SCSI_QCMD() local
3362 pinstance = container_of(inode->i_cdev, struct pmcraid_instance, cdev); in DEF_SCSI_QCMD()
3363 filep->private_data = pinstance; in DEF_SCSI_QCMD()
3376 struct pmcraid_instance *pinstance; in pmcraid_chr_fasync() local
3379 pinstance = filep->private_data; in pmcraid_chr_fasync()
3380 mutex_lock(&pinstance->aen_queue_lock); in pmcraid_chr_fasync()
3381 rc = fasync_helper(fd, filep, mode, &pinstance->aen_queue); in pmcraid_chr_fasync()
3382 mutex_unlock(&pinstance->aen_queue_lock); in pmcraid_chr_fasync()
3399 struct pmcraid_instance *pinstance, in pmcraid_ioctl_driver() argument
3409 pmcraid_reset_bringup(pinstance); in pmcraid_ioctl_driver()
3466 struct pmcraid_instance *pinstance = NULL; in pmcraid_chr_ioctl() local
3486 pinstance = filep->private_data; in pmcraid_chr_ioctl()
3488 if (!pinstance) { in pmcraid_chr_ioctl()
3498 retval = pmcraid_ioctl_driver(pinstance, cmd, in pmcraid_chr_ioctl()
3542 struct pmcraid_instance *pinstance = in pmcraid_show_log_level() local
3544 return snprintf(buf, PAGE_SIZE, "%d\n", pinstance->current_log_level); in pmcraid_show_log_level()
3565 struct pmcraid_instance *pinstance; in pmcraid_store_log_level() local
3575 pinstance = (struct pmcraid_instance *)shost->hostdata; in pmcraid_store_log_level()
3576 pinstance->current_log_level = val; in pmcraid_store_log_level()
3633 struct pmcraid_instance *pinstance = in pmcraid_show_adapter_id() local
3635 u32 adapter_id = pci_dev_id(pinstance->pdev); in pmcraid_show_adapter_id()
3640 adapter_id, MINOR(pinstance->cdev.dev), aen_group); in pmcraid_show_adapter_id()
3697 struct pmcraid_instance *pinstance; in pmcraid_isr_msix() local
3704 pinstance = hrrq_vector->drv_inst; in pmcraid_isr_msix()
3708 intrs_val = pmcraid_read_interrupts(pinstance); in pmcraid_isr_msix()
3710 ((ioread32(pinstance->int_regs.host_ioa_interrupt_reg) in pmcraid_isr_msix()
3719 pinstance->ioa_unit_check = 1; in pmcraid_isr_msix()
3723 spin_lock_irqsave(pinstance->host->host_lock, in pmcraid_isr_msix()
3725 pmcraid_initiate_reset(pinstance); in pmcraid_isr_msix()
3727 pinstance->host->host_lock, in pmcraid_isr_msix()
3735 pmcraid_clr_trans_op(pinstance); in pmcraid_isr_msix()
3742 pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_isr_msix()
3743 ioread32(pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_isr_msix()
3749 tasklet_schedule(&(pinstance->isr_tasklet[hrrq_id])); in pmcraid_isr_msix()
3766 struct pmcraid_instance *pinstance; in pmcraid_isr() local
3779 pinstance = hrrq_vector->drv_inst; in pmcraid_isr()
3781 intrs = pmcraid_read_interrupts(pinstance); in pmcraid_isr()
3793 pinstance->ioa_unit_check = 1; in pmcraid_isr()
3796 pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_isr()
3800 pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_isr()
3801 spin_lock_irqsave(pinstance->host->host_lock, lock_flags); in pmcraid_isr()
3802 pmcraid_initiate_reset(pinstance); in pmcraid_isr()
3803 spin_unlock_irqrestore(pinstance->host->host_lock, lock_flags); in pmcraid_isr()
3810 pmcraid_clr_trans_op(pinstance); in pmcraid_isr()
3813 pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_isr()
3815 pinstance->int_regs.ioa_host_interrupt_clr_reg); in pmcraid_isr()
3818 &(pinstance->isr_tasklet[hrrq_id])); in pmcraid_isr()
3837 struct pmcraid_instance *pinstance; in pmcraid_worker_function() local
3846 pinstance = container_of(workp, struct pmcraid_instance, worker_q); in pmcraid_worker_function()
3848 if (!atomic_read(&pinstance->expose_resources)) in pmcraid_worker_function()
3851 fw_version = be16_to_cpu(pinstance->inq_data->fw_version); in pmcraid_worker_function()
3853 spin_lock_irqsave(&pinstance->resource_lock, lock_flags); in pmcraid_worker_function()
3854 list_for_each_entry_safe(res, temp, &pinstance->used_res_q, queue) { in pmcraid_worker_function()
3862 spin_lock_irqsave(pinstance->host->host_lock, in pmcraid_worker_function()
3866 pinstance->host->host_lock, in pmcraid_worker_function()
3871 &pinstance->free_res_q); in pmcraid_worker_function()
3873 &pinstance->resource_lock, in pmcraid_worker_function()
3877 spin_lock_irqsave(&pinstance->resource_lock, in pmcraid_worker_function()
3882 pinstance->host->host_lock, in pmcraid_worker_function()
3888 list_for_each_entry(res, &pinstance->used_res_q, queue) { in pmcraid_worker_function()
3912 spin_unlock_irqrestore(&pinstance->resource_lock, in pmcraid_worker_function()
3914 scsi_add_device(pinstance->host, bus, target, lun); in pmcraid_worker_function()
3915 spin_lock_irqsave(&pinstance->resource_lock, in pmcraid_worker_function()
3920 spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags); in pmcraid_worker_function()
3934 struct pmcraid_instance *pinstance; in pmcraid_tasklet_function() local
3943 pinstance = hrrq_vector->drv_inst; in pmcraid_tasklet_function()
3945 lockp = &(pinstance->hrrq_lock[id]); in pmcraid_tasklet_function()
3955 resp = le32_to_cpu(*(pinstance->hrrq_curr[id])); in pmcraid_tasklet_function()
3958 pinstance->host_toggle_bit[id]) { in pmcraid_tasklet_function()
3963 if (pinstance->hrrq_curr[id] < pinstance->hrrq_end[id]) { in pmcraid_tasklet_function()
3964 pinstance->hrrq_curr[id]++; in pmcraid_tasklet_function()
3966 pinstance->hrrq_curr[id] = pinstance->hrrq_start[id]; in pmcraid_tasklet_function()
3967 pinstance->host_toggle_bit[id] ^= 1u; in pmcraid_tasklet_function()
3973 resp = le32_to_cpu(*(pinstance->hrrq_curr[id])); in pmcraid_tasklet_function()
3977 cmd = pinstance->cmd_list[cmd_index]; in pmcraid_tasklet_function()
3980 spin_lock_irqsave(&pinstance->pending_pool_lock, in pmcraid_tasklet_function()
3983 spin_unlock_irqrestore(&pinstance->pending_pool_lock, in pmcraid_tasklet_function()
3986 atomic_dec(&pinstance->outstanding_cmds); in pmcraid_tasklet_function()
3989 spin_lock_irqsave(pinstance->host->host_lock, in pmcraid_tasklet_function()
3992 spin_unlock_irqrestore(pinstance->host->host_lock, in pmcraid_tasklet_function()
3999 resp = le32_to_cpu(*(pinstance->hrrq_curr[id])); in pmcraid_tasklet_function()
4016 void pmcraid_unregister_interrupt_handler(struct pmcraid_instance *pinstance) in pmcraid_unregister_interrupt_handler() argument
4018 struct pci_dev *pdev = pinstance->pdev; in pmcraid_unregister_interrupt_handler()
4021 for (i = 0; i < pinstance->num_hrrq; i++) in pmcraid_unregister_interrupt_handler()
4022 free_irq(pci_irq_vector(pdev, i), &pinstance->hrrq_vector[i]); in pmcraid_unregister_interrupt_handler()
4024 pinstance->interrupt_mode = 0; in pmcraid_unregister_interrupt_handler()
4036 pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance) in pmcraid_register_interrupt_handler() argument
4038 struct pci_dev *pdev = pinstance->pdev; in pmcraid_register_interrupt_handler()
4060 struct pmcraid_isr_param *vec = &pinstance->hrrq_vector[i]; in pmcraid_register_interrupt_handler()
4063 vec->drv_inst = pinstance; in pmcraid_register_interrupt_handler()
4070 pinstance->num_hrrq = num_hrrq; in pmcraid_register_interrupt_handler()
4072 pinstance->interrupt_mode = 1; in pmcraid_register_interrupt_handler()
4074 pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_register_interrupt_handler()
4075 ioread32(pinstance->int_regs.host_ioa_interrupt_reg); in pmcraid_register_interrupt_handler()
4082 free_irq(pci_irq_vector(pdev, i), &pinstance->hrrq_vector[i]); in pmcraid_register_interrupt_handler()
4096 pmcraid_release_cmd_blocks(struct pmcraid_instance *pinstance, int max_index) in pmcraid_release_cmd_blocks() argument
4100 kmem_cache_free(pinstance->cmd_cachep, pinstance->cmd_list[i]); in pmcraid_release_cmd_blocks()
4101 pinstance->cmd_list[i] = NULL; in pmcraid_release_cmd_blocks()
4103 kmem_cache_destroy(pinstance->cmd_cachep); in pmcraid_release_cmd_blocks()
4104 pinstance->cmd_cachep = NULL; in pmcraid_release_cmd_blocks()
4120 struct pmcraid_instance *pinstance, in pmcraid_release_control_blocks() argument
4126 if (pinstance->control_pool == NULL) in pmcraid_release_control_blocks()
4130 dma_pool_free(pinstance->control_pool, in pmcraid_release_control_blocks()
4131 pinstance->cmd_list[i]->ioa_cb, in pmcraid_release_control_blocks()
4132 pinstance->cmd_list[i]->ioa_cb_bus_addr); in pmcraid_release_control_blocks()
4133 pinstance->cmd_list[i]->ioa_cb = NULL; in pmcraid_release_control_blocks()
4134 pinstance->cmd_list[i]->ioa_cb_bus_addr = 0; in pmcraid_release_control_blocks()
4136 dma_pool_destroy(pinstance->control_pool); in pmcraid_release_control_blocks()
4137 pinstance->control_pool = NULL; in pmcraid_release_control_blocks()
4149 static int pmcraid_allocate_cmd_blocks(struct pmcraid_instance *pinstance) in pmcraid_allocate_cmd_blocks() argument
4153 sprintf(pinstance->cmd_pool_name, "pmcraid_cmd_pool_%d", in pmcraid_allocate_cmd_blocks()
4154 pinstance->host->unique_id); in pmcraid_allocate_cmd_blocks()
4157 pinstance->cmd_cachep = kmem_cache_create( in pmcraid_allocate_cmd_blocks()
4158 pinstance->cmd_pool_name, in pmcraid_allocate_cmd_blocks()
4161 if (!pinstance->cmd_cachep) in pmcraid_allocate_cmd_blocks()
4165 pinstance->cmd_list[i] = in pmcraid_allocate_cmd_blocks()
4166 kmem_cache_alloc(pinstance->cmd_cachep, GFP_KERNEL); in pmcraid_allocate_cmd_blocks()
4167 if (!pinstance->cmd_list[i]) { in pmcraid_allocate_cmd_blocks()
4168 pmcraid_release_cmd_blocks(pinstance, i); in pmcraid_allocate_cmd_blocks()
4185 static int pmcraid_allocate_control_blocks(struct pmcraid_instance *pinstance) in pmcraid_allocate_control_blocks() argument
4189 sprintf(pinstance->ctl_pool_name, "pmcraid_control_pool_%d", in pmcraid_allocate_control_blocks()
4190 pinstance->host->unique_id); in pmcraid_allocate_control_blocks()
4192 pinstance->control_pool = in pmcraid_allocate_control_blocks()
4193 dma_pool_create(pinstance->ctl_pool_name, in pmcraid_allocate_control_blocks()
4194 &pinstance->pdev->dev, in pmcraid_allocate_control_blocks()
4198 if (!pinstance->control_pool) in pmcraid_allocate_control_blocks()
4202 pinstance->cmd_list[i]->ioa_cb = in pmcraid_allocate_control_blocks()
4204 pinstance->control_pool, in pmcraid_allocate_control_blocks()
4206 &(pinstance->cmd_list[i]->ioa_cb_bus_addr)); in pmcraid_allocate_control_blocks()
4208 if (!pinstance->cmd_list[i]->ioa_cb) { in pmcraid_allocate_control_blocks()
4209 pmcraid_release_control_blocks(pinstance, i); in pmcraid_allocate_control_blocks()
4225 pmcraid_release_host_rrqs(struct pmcraid_instance *pinstance, int maxindex) in pmcraid_release_host_rrqs() argument
4230 dma_free_coherent(&pinstance->pdev->dev, in pmcraid_release_host_rrqs()
4232 pinstance->hrrq_start[i], in pmcraid_release_host_rrqs()
4233 pinstance->hrrq_start_bus_addr[i]); in pmcraid_release_host_rrqs()
4236 pinstance->hrrq_start[i] = NULL; in pmcraid_release_host_rrqs()
4237 pinstance->hrrq_start_bus_addr[i] = 0; in pmcraid_release_host_rrqs()
4238 pinstance->host_toggle_bit[i] = 0; in pmcraid_release_host_rrqs()
4249 static int pmcraid_allocate_host_rrqs(struct pmcraid_instance *pinstance) in pmcraid_allocate_host_rrqs() argument
4255 for (i = 0; i < pinstance->num_hrrq; i++) { in pmcraid_allocate_host_rrqs()
4256 pinstance->hrrq_start[i] = in pmcraid_allocate_host_rrqs()
4257 dma_alloc_coherent(&pinstance->pdev->dev, buffer_size, in pmcraid_allocate_host_rrqs()
4258 &pinstance->hrrq_start_bus_addr[i], in pmcraid_allocate_host_rrqs()
4260 if (!pinstance->hrrq_start[i]) { in pmcraid_allocate_host_rrqs()
4263 pmcraid_release_host_rrqs(pinstance, i); in pmcraid_allocate_host_rrqs()
4267 pinstance->hrrq_curr[i] = pinstance->hrrq_start[i]; in pmcraid_allocate_host_rrqs()
4268 pinstance->hrrq_end[i] = in pmcraid_allocate_host_rrqs()
4269 pinstance->hrrq_start[i] + PMCRAID_MAX_CMD - 1; in pmcraid_allocate_host_rrqs()
4270 pinstance->host_toggle_bit[i] = 1; in pmcraid_allocate_host_rrqs()
4271 spin_lock_init(&pinstance->hrrq_lock[i]); in pmcraid_allocate_host_rrqs()
4284 static void pmcraid_release_hcams(struct pmcraid_instance *pinstance) in pmcraid_release_hcams() argument
4286 if (pinstance->ccn.msg != NULL) { in pmcraid_release_hcams()
4287 dma_free_coherent(&pinstance->pdev->dev, in pmcraid_release_hcams()
4290 pinstance->ccn.msg, in pmcraid_release_hcams()
4291 pinstance->ccn.baddr); in pmcraid_release_hcams()
4293 pinstance->ccn.msg = NULL; in pmcraid_release_hcams()
4294 pinstance->ccn.hcam = NULL; in pmcraid_release_hcams()
4295 pinstance->ccn.baddr = 0; in pmcraid_release_hcams()
4298 if (pinstance->ldn.msg != NULL) { in pmcraid_release_hcams()
4299 dma_free_coherent(&pinstance->pdev->dev, in pmcraid_release_hcams()
4302 pinstance->ldn.msg, in pmcraid_release_hcams()
4303 pinstance->ldn.baddr); in pmcraid_release_hcams()
4305 pinstance->ldn.msg = NULL; in pmcraid_release_hcams()
4306 pinstance->ldn.hcam = NULL; in pmcraid_release_hcams()
4307 pinstance->ldn.baddr = 0; in pmcraid_release_hcams()
4318 static int pmcraid_allocate_hcams(struct pmcraid_instance *pinstance) in pmcraid_allocate_hcams() argument
4320 pinstance->ccn.msg = dma_alloc_coherent(&pinstance->pdev->dev, in pmcraid_allocate_hcams()
4323 &pinstance->ccn.baddr, GFP_KERNEL); in pmcraid_allocate_hcams()
4325 pinstance->ldn.msg = dma_alloc_coherent(&pinstance->pdev->dev, in pmcraid_allocate_hcams()
4328 &pinstance->ldn.baddr, GFP_KERNEL); in pmcraid_allocate_hcams()
4330 if (pinstance->ldn.msg == NULL || pinstance->ccn.msg == NULL) { in pmcraid_allocate_hcams()
4331 pmcraid_release_hcams(pinstance); in pmcraid_allocate_hcams()
4333 pinstance->ccn.hcam = in pmcraid_allocate_hcams()
4334 (void *)pinstance->ccn.msg + PMCRAID_AEN_HDR_SIZE; in pmcraid_allocate_hcams()
4335 pinstance->ldn.hcam = in pmcraid_allocate_hcams()
4336 (void *)pinstance->ldn.msg + PMCRAID_AEN_HDR_SIZE; in pmcraid_allocate_hcams()
4338 atomic_set(&pinstance->ccn.ignore, 0); in pmcraid_allocate_hcams()
4339 atomic_set(&pinstance->ldn.ignore, 0); in pmcraid_allocate_hcams()
4342 return (pinstance->ldn.msg == NULL) ? -ENOMEM : 0; in pmcraid_allocate_hcams()
4352 static void pmcraid_release_config_buffers(struct pmcraid_instance *pinstance) in pmcraid_release_config_buffers() argument
4354 if (pinstance->cfg_table != NULL && in pmcraid_release_config_buffers()
4355 pinstance->cfg_table_bus_addr != 0) { in pmcraid_release_config_buffers()
4356 dma_free_coherent(&pinstance->pdev->dev, in pmcraid_release_config_buffers()
4358 pinstance->cfg_table, in pmcraid_release_config_buffers()
4359 pinstance->cfg_table_bus_addr); in pmcraid_release_config_buffers()
4360 pinstance->cfg_table = NULL; in pmcraid_release_config_buffers()
4361 pinstance->cfg_table_bus_addr = 0; in pmcraid_release_config_buffers()
4364 if (pinstance->res_entries != NULL) { in pmcraid_release_config_buffers()
4368 list_del(&pinstance->res_entries[i].queue); in pmcraid_release_config_buffers()
4369 kfree(pinstance->res_entries); in pmcraid_release_config_buffers()
4370 pinstance->res_entries = NULL; in pmcraid_release_config_buffers()
4373 pmcraid_release_hcams(pinstance); in pmcraid_release_config_buffers()
4383 static int pmcraid_allocate_config_buffers(struct pmcraid_instance *pinstance) in pmcraid_allocate_config_buffers() argument
4387 pinstance->res_entries = in pmcraid_allocate_config_buffers()
4392 if (NULL == pinstance->res_entries) { in pmcraid_allocate_config_buffers()
4398 list_add_tail(&pinstance->res_entries[i].queue, in pmcraid_allocate_config_buffers()
4399 &pinstance->free_res_q); in pmcraid_allocate_config_buffers()
4401 pinstance->cfg_table = dma_alloc_coherent(&pinstance->pdev->dev, in pmcraid_allocate_config_buffers()
4403 &pinstance->cfg_table_bus_addr, in pmcraid_allocate_config_buffers()
4406 if (NULL == pinstance->cfg_table) { in pmcraid_allocate_config_buffers()
4408 pmcraid_release_config_buffers(pinstance); in pmcraid_allocate_config_buffers()
4412 if (pmcraid_allocate_hcams(pinstance)) { in pmcraid_allocate_config_buffers()
4414 pmcraid_release_config_buffers(pinstance); in pmcraid_allocate_config_buffers()
4429 static void pmcraid_init_tasklets(struct pmcraid_instance *pinstance) in pmcraid_init_tasklets() argument
4432 for (i = 0; i < pinstance->num_hrrq; i++) in pmcraid_init_tasklets()
4433 tasklet_init(&pinstance->isr_tasklet[i], in pmcraid_init_tasklets()
4435 (unsigned long)&pinstance->hrrq_vector[i]); in pmcraid_init_tasklets()
4446 static void pmcraid_kill_tasklets(struct pmcraid_instance *pinstance) in pmcraid_kill_tasklets() argument
4449 for (i = 0; i < pinstance->num_hrrq; i++) in pmcraid_kill_tasklets()
4450 tasklet_kill(&pinstance->isr_tasklet[i]); in pmcraid_kill_tasklets()
4461 static void pmcraid_release_buffers(struct pmcraid_instance *pinstance) in pmcraid_release_buffers() argument
4463 pmcraid_release_config_buffers(pinstance); in pmcraid_release_buffers()
4464 pmcraid_release_control_blocks(pinstance, PMCRAID_MAX_CMD); in pmcraid_release_buffers()
4465 pmcraid_release_cmd_blocks(pinstance, PMCRAID_MAX_CMD); in pmcraid_release_buffers()
4466 pmcraid_release_host_rrqs(pinstance, pinstance->num_hrrq); in pmcraid_release_buffers()
4468 if (pinstance->inq_data != NULL) { in pmcraid_release_buffers()
4469 dma_free_coherent(&pinstance->pdev->dev, in pmcraid_release_buffers()
4471 pinstance->inq_data, in pmcraid_release_buffers()
4472 pinstance->inq_data_baddr); in pmcraid_release_buffers()
4474 pinstance->inq_data = NULL; in pmcraid_release_buffers()
4475 pinstance->inq_data_baddr = 0; in pmcraid_release_buffers()
4478 if (pinstance->timestamp_data != NULL) { in pmcraid_release_buffers()
4479 dma_free_coherent(&pinstance->pdev->dev, in pmcraid_release_buffers()
4481 pinstance->timestamp_data, in pmcraid_release_buffers()
4482 pinstance->timestamp_data_baddr); in pmcraid_release_buffers()
4484 pinstance->timestamp_data = NULL; in pmcraid_release_buffers()
4485 pinstance->timestamp_data_baddr = 0; in pmcraid_release_buffers()
4502 static int pmcraid_init_buffers(struct pmcraid_instance *pinstance) in pmcraid_init_buffers() argument
4506 if (pmcraid_allocate_host_rrqs(pinstance)) { in pmcraid_init_buffers()
4508 pinstance->num_hrrq); in pmcraid_init_buffers()
4512 if (pmcraid_allocate_config_buffers(pinstance)) { in pmcraid_init_buffers()
4514 pmcraid_release_host_rrqs(pinstance, pinstance->num_hrrq); in pmcraid_init_buffers()
4518 if (pmcraid_allocate_cmd_blocks(pinstance)) { in pmcraid_init_buffers()
4520 pmcraid_release_config_buffers(pinstance); in pmcraid_init_buffers()
4521 pmcraid_release_host_rrqs(pinstance, pinstance->num_hrrq); in pmcraid_init_buffers()
4525 if (pmcraid_allocate_control_blocks(pinstance)) { in pmcraid_init_buffers()
4527 pmcraid_release_config_buffers(pinstance); in pmcraid_init_buffers()
4528 pmcraid_release_cmd_blocks(pinstance, PMCRAID_MAX_CMD); in pmcraid_init_buffers()
4529 pmcraid_release_host_rrqs(pinstance, pinstance->num_hrrq); in pmcraid_init_buffers()
4534 pinstance->inq_data = dma_alloc_coherent(&pinstance->pdev->dev, in pmcraid_init_buffers()
4536 &pinstance->inq_data_baddr, GFP_KERNEL); in pmcraid_init_buffers()
4537 if (pinstance->inq_data == NULL) { in pmcraid_init_buffers()
4539 pmcraid_release_buffers(pinstance); in pmcraid_init_buffers()
4544 pinstance->timestamp_data = dma_alloc_coherent(&pinstance->pdev->dev, in pmcraid_init_buffers()
4546 &pinstance->timestamp_data_baddr, in pmcraid_init_buffers()
4548 if (pinstance->timestamp_data == NULL) { in pmcraid_init_buffers()
4551 pmcraid_release_buffers(pinstance); in pmcraid_init_buffers()
4561 struct pmcraid_cmd *cmdp = pinstance->cmd_list[i]; in pmcraid_init_buffers()
4563 cmdp->drv_inst = pinstance; in pmcraid_init_buffers()
4564 list_add_tail(&cmdp->free_list, &pinstance->free_cmd_pool); in pmcraid_init_buffers()
4576 static void pmcraid_reinit_buffers(struct pmcraid_instance *pinstance) in pmcraid_reinit_buffers() argument
4581 for (i = 0; i < pinstance->num_hrrq; i++) { in pmcraid_reinit_buffers()
4582 memset(pinstance->hrrq_start[i], 0, buffer_size); in pmcraid_reinit_buffers()
4583 pinstance->hrrq_curr[i] = pinstance->hrrq_start[i]; in pmcraid_reinit_buffers()
4584 pinstance->hrrq_end[i] = in pmcraid_reinit_buffers()
4585 pinstance->hrrq_start[i] + PMCRAID_MAX_CMD - 1; in pmcraid_reinit_buffers()
4586 pinstance->host_toggle_bit[i] = 1; in pmcraid_reinit_buffers()
4602 struct pmcraid_instance *pinstance = in pmcraid_init_instance() local
4605 pinstance->host = host; in pmcraid_init_instance()
4606 pinstance->pdev = pdev; in pmcraid_init_instance()
4609 pinstance->mapped_dma_addr = mapped_pci_addr; in pmcraid_init_instance()
4613 struct pmcraid_chip_details *chip_cfg = pinstance->chip_cfg; in pmcraid_init_instance()
4614 struct pmcraid_interrupts *pint_regs = &pinstance->int_regs; in pmcraid_init_instance()
4616 pinstance->ioarrin = mapped_pci_addr + chip_cfg->ioarrin; in pmcraid_init_instance()
4632 pinstance->mailbox = mapped_pci_addr + chip_cfg->mailbox; in pmcraid_init_instance()
4633 pinstance->ioa_status = mapped_pci_addr + chip_cfg->ioastatus; in pmcraid_init_instance()
4642 pinstance->ioa_reset_attempts = 0; in pmcraid_init_instance()
4643 init_waitqueue_head(&pinstance->reset_wait_q); in pmcraid_init_instance()
4645 atomic_set(&pinstance->outstanding_cmds, 0); in pmcraid_init_instance()
4646 atomic_set(&pinstance->last_message_id, 0); in pmcraid_init_instance()
4647 atomic_set(&pinstance->expose_resources, 0); in pmcraid_init_instance()
4649 INIT_LIST_HEAD(&pinstance->free_res_q); in pmcraid_init_instance()
4650 INIT_LIST_HEAD(&pinstance->used_res_q); in pmcraid_init_instance()
4651 INIT_LIST_HEAD(&pinstance->free_cmd_pool); in pmcraid_init_instance()
4652 INIT_LIST_HEAD(&pinstance->pending_cmd_pool); in pmcraid_init_instance()
4654 spin_lock_init(&pinstance->free_pool_lock); in pmcraid_init_instance()
4655 spin_lock_init(&pinstance->pending_pool_lock); in pmcraid_init_instance()
4656 spin_lock_init(&pinstance->resource_lock); in pmcraid_init_instance()
4657 mutex_init(&pinstance->aen_queue_lock); in pmcraid_init_instance()
4660 INIT_WORK(&pinstance->worker_q, pmcraid_worker_function); in pmcraid_init_instance()
4663 pinstance->current_log_level = pmcraid_log_level; in pmcraid_init_instance()
4666 pinstance->ioa_state = IOA_STATE_UNKNOWN; in pmcraid_init_instance()
4667 pinstance->reset_cmd = NULL; in pmcraid_init_instance()
4682 struct pmcraid_instance *pinstance = pci_get_drvdata(pdev); in pmcraid_shutdown() local
4683 pmcraid_reset_bringdown(pinstance); in pmcraid_shutdown()
4715 static int pmcraid_setup_chrdev(struct pmcraid_instance *pinstance) in pmcraid_setup_chrdev() argument
4721 cdev_init(&pinstance->cdev, &pmcraid_fops); in pmcraid_setup_chrdev()
4722 pinstance->cdev.owner = THIS_MODULE; in pmcraid_setup_chrdev()
4724 error = cdev_add(&pinstance->cdev, MKDEV(pmcraid_major, minor), 1); in pmcraid_setup_chrdev()
4742 static void pmcraid_release_chrdev(struct pmcraid_instance *pinstance) in pmcraid_release_chrdev() argument
4744 pmcraid_release_minor(MINOR(pinstance->cdev.dev)); in pmcraid_release_chrdev()
4746 MKDEV(pmcraid_major, MINOR(pinstance->cdev.dev))); in pmcraid_release_chrdev()
4747 cdev_del(&pinstance->cdev); in pmcraid_release_chrdev()
4759 struct pmcraid_instance *pinstance = pci_get_drvdata(pdev); in pmcraid_remove() local
4762 pmcraid_release_chrdev(pinstance); in pmcraid_remove()
4765 scsi_remove_host(pinstance->host); in pmcraid_remove()
4768 scsi_block_requests(pinstance->host); in pmcraid_remove()
4773 pmcraid_disable_interrupts(pinstance, ~0); in pmcraid_remove()
4774 flush_work(&pinstance->worker_q); in pmcraid_remove()
4776 pmcraid_kill_tasklets(pinstance); in pmcraid_remove()
4777 pmcraid_unregister_interrupt_handler(pinstance); in pmcraid_remove()
4778 pmcraid_release_buffers(pinstance); in pmcraid_remove()
4779 iounmap(pinstance->mapped_dma_addr); in pmcraid_remove()
4781 scsi_host_put(pinstance->host); in pmcraid_remove()
4796 struct pmcraid_instance *pinstance = pci_get_drvdata(pdev); in pmcraid_suspend() local
4799 pmcraid_disable_interrupts(pinstance, ~0); in pmcraid_suspend()
4800 pmcraid_kill_tasklets(pinstance); in pmcraid_suspend()
4801 pmcraid_unregister_interrupt_handler(pinstance); in pmcraid_suspend()
4815 struct pmcraid_instance *pinstance = pci_get_drvdata(pdev); in pmcraid_resume() local
4816 struct Scsi_Host *host = pinstance->host; in pmcraid_resume()
4831 pmcraid_disable_interrupts(pinstance, ~0); in pmcraid_resume()
4832 atomic_set(&pinstance->outstanding_cmds, 0); in pmcraid_resume()
4833 rc = pmcraid_register_interrupt_handler(pinstance); in pmcraid_resume()
4842 pmcraid_init_tasklets(pinstance); in pmcraid_resume()
4843 pmcraid_enable_interrupts(pinstance, PMCRAID_PCI_INTERRUPTS); in pmcraid_resume()
4848 pinstance->ioa_hard_reset = 1; in pmcraid_resume()
4853 if (pmcraid_reset_bringup(pinstance)) { in pmcraid_resume()
4862 pmcraid_disable_interrupts(pinstance, ~0); in pmcraid_resume()
4863 pmcraid_kill_tasklets(pinstance); in pmcraid_resume()
4864 pmcraid_unregister_interrupt_handler(pinstance); in pmcraid_resume()
4881 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_complete_ioa_reset() local
4884 spin_lock_irqsave(pinstance->host->host_lock, flags); in pmcraid_complete_ioa_reset()
4886 spin_unlock_irqrestore(pinstance->host->host_lock, flags); in pmcraid_complete_ioa_reset()
4887 scsi_unblock_requests(pinstance->host); in pmcraid_complete_ioa_reset()
4888 schedule_work(&pinstance->worker_q); in pmcraid_complete_ioa_reset()
4942 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_set_timestamp() local
4950 pinstance->timestamp_data->timestamp[0] = (__u8)(timestamp); in pmcraid_set_timestamp()
4951 pinstance->timestamp_data->timestamp[1] = (__u8)((timestamp) >> 8); in pmcraid_set_timestamp()
4952 pinstance->timestamp_data->timestamp[2] = (__u8)((timestamp) >> 16); in pmcraid_set_timestamp()
4953 pinstance->timestamp_data->timestamp[3] = (__u8)((timestamp) >> 24); in pmcraid_set_timestamp()
4954 pinstance->timestamp_data->timestamp[4] = (__u8)((timestamp) >> 32); in pmcraid_set_timestamp()
4955 pinstance->timestamp_data->timestamp[5] = (__u8)((timestamp) >> 40); in pmcraid_set_timestamp()
4976 ioadl->address = cpu_to_le64(pinstance->timestamp_data_baddr); in pmcraid_set_timestamp()
4979 if (!pinstance->timestamp_error) { in pmcraid_set_timestamp()
4980 pinstance->timestamp_error = 0; in pmcraid_set_timestamp()
5005 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_init_res_table() local
5013 if (pinstance->cfg_table->flags & MICROCODE_UPDATE_REQUIRED) in pmcraid_init_res_table()
5016 fw_version = be16_to_cpu(pinstance->inq_data->fw_version); in pmcraid_init_res_table()
5022 spin_lock_irqsave(&pinstance->resource_lock, lock_flags); in pmcraid_init_res_table()
5024 list_for_each_entry_safe(res, temp, &pinstance->used_res_q, queue) in pmcraid_init_res_table()
5027 for (i = 0; i < le16_to_cpu(pinstance->cfg_table->num_entries); i++) { in pmcraid_init_res_table()
5028 if (be16_to_cpu(pinstance->inq_data->fw_version) <= in pmcraid_init_res_table()
5030 cfgte = &pinstance->cfg_table->entries[i]; in pmcraid_init_res_table()
5033 &pinstance->cfg_table->entries_ext[i]; in pmcraid_init_res_table()
5048 &pinstance->used_res_q); in pmcraid_init_res_table()
5057 if (list_empty(&pinstance->free_res_q)) { in pmcraid_init_res_table()
5063 res = list_entry(pinstance->free_res_q.next, in pmcraid_init_res_table()
5069 list_move_tail(&res->queue, &pinstance->used_res_q); in pmcraid_init_res_table()
5077 pinstance->config_table_entry_size); in pmcraid_init_res_table()
5094 list_move_tail(&res->queue, &pinstance->used_res_q); in pmcraid_init_res_table()
5096 list_move_tail(&res->queue, &pinstance->free_res_q); in pmcraid_init_res_table()
5101 spin_unlock_irqrestore(&pinstance->resource_lock, lock_flags); in pmcraid_init_res_table()
5119 struct pmcraid_instance *pinstance = cmd->drv_inst; in pmcraid_querycfg() local
5122 if (be16_to_cpu(pinstance->inq_data->fw_version) <= in pmcraid_querycfg()
5124 pinstance->config_table_entry_size = in pmcraid_querycfg()
5127 pinstance->config_table_entry_size = in pmcraid_querycfg()
5153 ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr); in pmcraid_querycfg()
5173 struct pmcraid_instance *pinstance; in pmcraid_probe() local
5255 pinstance = (struct pmcraid_instance *)host->hostdata; in pmcraid_probe()
5256 memset(pinstance, 0, sizeof(*pinstance)); in pmcraid_probe()
5258 pinstance->chip_cfg = in pmcraid_probe()
5268 pci_set_drvdata(pdev, pinstance); in pmcraid_probe()
5271 rc = pci_save_state(pinstance->pdev); in pmcraid_probe()
5278 pmcraid_disable_interrupts(pinstance, ~0); in pmcraid_probe()
5280 rc = pmcraid_register_interrupt_handler(pinstance); in pmcraid_probe()
5287 pmcraid_init_tasklets(pinstance); in pmcraid_probe()
5290 rc = pmcraid_init_buffers(pinstance); in pmcraid_probe()
5298 pmcraid_reset_type(pinstance); in pmcraid_probe()
5300 pmcraid_enable_interrupts(pinstance, PMCRAID_PCI_INTERRUPTS); in pmcraid_probe()
5306 if (pmcraid_reset_bringup(pinstance)) { in pmcraid_probe()
5313 rc = scsi_add_host(pinstance->host, &pdev->dev); in pmcraid_probe()
5319 scsi_scan_host(pinstance->host); in pmcraid_probe()
5321 rc = pmcraid_setup_chrdev(pinstance); in pmcraid_probe()
5332 atomic_set(&pinstance->expose_resources, 1); in pmcraid_probe()
5333 schedule_work(&pinstance->worker_q); in pmcraid_probe()
5340 pmcraid_release_buffers(pinstance); in pmcraid_probe()
5343 pmcraid_kill_tasklets(pinstance); in pmcraid_probe()
5344 pmcraid_unregister_interrupt_handler(pinstance); in pmcraid_probe()