~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/scsi/scsi_transport_fc.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
422
422
 
423
423
        snprintf(fc_host->work_q_name, sizeof(fc_host->work_q_name),
424
424
                 "fc_wq_%d", shost->host_no);
425
 
        fc_host->work_q = create_singlethread_workqueue(
426
 
                                        fc_host->work_q_name);
 
425
        fc_host->work_q = alloc_workqueue(fc_host->work_q_name, 0, 0);
427
426
        if (!fc_host->work_q)
428
427
                return -ENOMEM;
429
428
 
431
430
        snprintf(fc_host->devloss_work_q_name,
432
431
                 sizeof(fc_host->devloss_work_q_name),
433
432
                 "fc_dl_%d", shost->host_no);
434
 
        fc_host->devloss_work_q = create_singlethread_workqueue(
435
 
                                        fc_host->devloss_work_q_name);
 
433
        fc_host->devloss_work_q =
 
434
                        alloc_workqueue(fc_host->devloss_work_q_name, 0, 0);
436
435
        if (!fc_host->devloss_work_q) {
437
436
                destroy_workqueue(fc_host->work_q);
438
437
                fc_host->work_q = NULL;
2378
2377
 * fc_remove_host - called to terminate any fc_transport-related elements for a scsi host.
2379
2378
 * @shost:      Which &Scsi_Host
2380
2379
 *
2381
 
 * This routine is expected to be called immediately preceeding the
 
2380
 * This routine is expected to be called immediately preceding the
2382
2381
 * a driver's call to scsi_remove_host().
2383
2382
 *
2384
2383
 * WARNING: A driver utilizing the fc_transport, which fails to call
2458
2457
}
2459
2458
 
2460
2459
/**
2461
 
 * fc_starget_delete - called to delete the scsi decendents of an rport
 
2460
 * fc_starget_delete - called to delete the scsi descendants of an rport
2462
2461
 * @work:       remote port to be operated on.
2463
2462
 *
2464
2463
 * Deletes target and all sdevs.
2489
2488
        unsigned long flags;
2490
2489
        int do_callback = 0;
2491
2490
 
 
2491
        fc_terminate_rport_io(rport);
 
2492
 
2492
2493
        /*
2493
2494
         * if a scan is pending, flush the SCSI Host work_q so that
2494
2495
         * that we can reclaim the rport scan work element.
2496
2497
        if (rport->flags & FC_RPORT_SCAN_PENDING)
2497
2498
                scsi_flush_work(shost);
2498
2499
 
2499
 
        fc_terminate_rport_io(rport);
2500
 
 
2501
2500
        /*
2502
2501
         * Cancel any outstanding timers. These should really exist
2503
2502
         * only when rmmod'ing the LLDD and we're asking for
3816
3815
static void
3817
3816
fc_bsg_goose_queue(struct fc_rport *rport)
3818
3817
{
3819
 
        int flagset;
3820
 
        unsigned long flags;
3821
 
 
3822
3818
        if (!rport->rqst_q)
3823
3819
                return;
3824
3820
 
 
3821
        /*
 
3822
         * This get/put dance makes no sense
 
3823
         */
3825
3824
        get_device(&rport->dev);
3826
 
 
3827
 
        spin_lock_irqsave(rport->rqst_q->queue_lock, flags);
3828
 
        flagset = test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags) &&
3829
 
                  !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags);
3830
 
        if (flagset)
3831
 
                queue_flag_set(QUEUE_FLAG_REENTER, rport->rqst_q);
3832
 
        __blk_run_queue(rport->rqst_q, false);
3833
 
        if (flagset)
3834
 
                queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q);
3835
 
        spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags);
3836
 
 
 
3825
        blk_run_queue_async(rport->rqst_q);
3837
3826
        put_device(&rport->dev);
3838
3827
}
3839
3828
 
3840
 
 
3841
3829
/**
3842
3830
 * fc_bsg_rport_dispatch - process rport bsg requests and dispatch to LLDD
3843
3831
 * @q:          rport request queue
3913
3901
        if (!get_device(dev))
3914
3902
                return;
3915
3903
 
3916
 
        while (!blk_queue_plugged(q)) {
 
3904
        while (1) {
3917
3905
                if (rport && (rport->port_state == FC_PORTSTATE_BLOCKED) &&
3918
3906
                    !(rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT))
3919
3907
                        break;