aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad_im.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bfa/bfad_im.c')
-rw-r--r--drivers/scsi/bfa/bfad_im.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 5b7cf539e50b..678120b70460 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -554,7 +554,7 @@ bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port,
554 im_port->shost->transportt = 554 im_port->shost->transportt =
555 bfad_im_scsi_vport_transport_template; 555 bfad_im_scsi_vport_transport_template;
556 556
557 error = scsi_add_host(im_port->shost, dev); 557 error = scsi_add_host_with_dma(im_port->shost, dev, &bfad->pcidev->dev);
558 if (error) { 558 if (error) {
559 printk(KERN_WARNING "scsi_add_host failure %d\n", error); 559 printk(KERN_WARNING "scsi_add_host failure %d\n", error);
560 goto out_fc_rel; 560 goto out_fc_rel;
@@ -567,6 +567,7 @@ bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port,
567 567
568out_fc_rel: 568out_fc_rel:
569 scsi_host_put(im_port->shost); 569 scsi_host_put(im_port->shost);
570 im_port->shost = NULL;
570out_free_idr: 571out_free_idr:
571 mutex_lock(&bfad_mutex); 572 mutex_lock(&bfad_mutex);
572 idr_remove(&bfad_im_port_index, im_port->idr_id); 573 idr_remove(&bfad_im_port_index, im_port->idr_id);
@@ -597,10 +598,12 @@ bfad_im_port_delete_handler(struct work_struct *work)
597{ 598{
598 struct bfad_im_port_s *im_port = 599 struct bfad_im_port_s *im_port =
599 container_of(work, struct bfad_im_port_s, port_delete_work); 600 container_of(work, struct bfad_im_port_s, port_delete_work);
601 struct bfad_s *bfad = im_port->bfad;
600 602
601 if (im_port->port->pvb_type != BFAD_PORT_PHYS_BASE) { 603 if (im_port->port->pvb_type != BFAD_PORT_PHYS_BASE) {
602 im_port->flags |= BFAD_PORT_DELETE; 604 im_port->flags |= BFAD_PORT_DELETE;
603 fc_vport_terminate(im_port->fc_vport); 605 fc_vport_terminate(im_port->fc_vport);
606 atomic_dec(&bfad->wq_reqcnt);
604 } 607 }
605 608
606} 609}
@@ -633,8 +636,11 @@ bfad_im_port_delete(struct bfad_s *bfad, struct bfad_port_s *port)
633{ 636{
634 struct bfad_im_port_s *im_port = port->im_port; 637 struct bfad_im_port_s *im_port = port->im_port;
635 638
636 queue_work(bfad->im->drv_workq, 639 if (im_port->port->pvb_type != BFAD_PORT_PHYS_BASE) {
640 atomic_inc(&bfad->wq_reqcnt);
641 queue_work(bfad->im->drv_workq,
637 &im_port->port_delete_work); 642 &im_port->port_delete_work);
643 }
638} 644}
639 645
640void 646void
@@ -695,12 +701,27 @@ void
695bfad_im_probe_undo(struct bfad_s *bfad) 701bfad_im_probe_undo(struct bfad_s *bfad)
696{ 702{
697 if (bfad->im) { 703 if (bfad->im) {
704 while (atomic_read(&bfad->wq_reqcnt)) {
705 printk(KERN_INFO "bfa %s: waiting workq processing,"
706 " wq_reqcnt:%x\n", bfad->pci_name,
707 atomic_read(&bfad->wq_reqcnt));
708 schedule_timeout_uninterruptible(HZ);
709 }
698 bfad_os_destroy_workq(bfad->im); 710 bfad_os_destroy_workq(bfad->im);
699 kfree(bfad->im); 711 kfree(bfad->im);
700 bfad->im = NULL; 712 bfad->im = NULL;
701 } 713 }
702} 714}
703 715
716/**
717 * Call back function to handle IO redirection state change
718 */
719void
720bfa_cb_ioredirect_state_change(void *hcb_bfad, bfa_boolean_t ioredirect)
721{
722 /* Do nothing */
723}
724
704struct Scsi_Host * 725struct Scsi_Host *
705bfad_os_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad) 726bfad_os_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad)
706{ 727{
@@ -1204,9 +1225,9 @@ int
1204bfad_os_get_linkup_delay(struct bfad_s *bfad) 1225bfad_os_get_linkup_delay(struct bfad_s *bfad)
1205{ 1226{
1206 1227
1207 u8 nwwns = 0; 1228 u8 nwwns = 0;
1208 wwn_t *wwns; 1229 wwn_t wwns[BFA_PREBOOT_BOOTLUN_MAX];
1209 int ldelay; 1230 int ldelay;
1210 1231
1211 /* 1232 /*
1212 * Querying for the boot target port wwns 1233 * Querying for the boot target port wwns
@@ -1215,7 +1236,7 @@ bfad_os_get_linkup_delay(struct bfad_s *bfad)
1215 * else => local boot machine set bfa_linkup_delay = 10 1236 * else => local boot machine set bfa_linkup_delay = 10
1216 */ 1237 */
1217 1238
1218 bfa_iocfc_get_bootwwns(&bfad->bfa, &nwwns, &wwns); 1239 bfa_iocfc_get_bootwwns(&bfad->bfa, &nwwns, wwns);
1219 1240
1220 if (nwwns > 0) { 1241 if (nwwns > 0) {
1221 /* If boot over SAN; linkup_delay = 30sec */ 1242 /* If boot over SAN; linkup_delay = 30sec */