aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/sbp2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/sbp2.c')
-rw-r--r--drivers/firewire/sbp2.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c
index 98dbbda3ad41..ca264f2fdf0c 100644
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -820,20 +820,25 @@ static void sbp2_release_target(struct kref *kref)
820 fw_device_put(device); 820 fw_device_put(device);
821} 821}
822 822
823static struct workqueue_struct *sbp2_wq; 823static void sbp2_target_get(struct sbp2_target *tgt)
824{
825 kref_get(&tgt->kref);
826}
824 827
825static void sbp2_target_put(struct sbp2_target *tgt) 828static void sbp2_target_put(struct sbp2_target *tgt)
826{ 829{
827 kref_put(&tgt->kref, sbp2_release_target); 830 kref_put(&tgt->kref, sbp2_release_target);
828} 831}
829 832
833static struct workqueue_struct *sbp2_wq;
834
830/* 835/*
831 * Always get the target's kref when scheduling work on one its units. 836 * Always get the target's kref when scheduling work on one its units.
832 * Each workqueue job is responsible to call sbp2_target_put() upon return. 837 * Each workqueue job is responsible to call sbp2_target_put() upon return.
833 */ 838 */
834static void sbp2_queue_work(struct sbp2_logical_unit *lu, unsigned long delay) 839static void sbp2_queue_work(struct sbp2_logical_unit *lu, unsigned long delay)
835{ 840{
836 kref_get(&lu->tgt->kref); 841 sbp2_target_get(lu->tgt);
837 if (!queue_delayed_work(sbp2_wq, &lu->work, delay)) 842 if (!queue_delayed_work(sbp2_wq, &lu->work, delay))
838 sbp2_target_put(lu->tgt); 843 sbp2_target_put(lu->tgt);
839} 844}
@@ -1009,7 +1014,8 @@ static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry)
1009 return 0; 1014 return 0;
1010} 1015}
1011 1016
1012static int sbp2_scan_logical_unit_dir(struct sbp2_target *tgt, u32 *directory) 1017static int sbp2_scan_logical_unit_dir(struct sbp2_target *tgt,
1018 const u32 *directory)
1013{ 1019{
1014 struct fw_csr_iterator ci; 1020 struct fw_csr_iterator ci;
1015 int key, value; 1021 int key, value;
@@ -1022,7 +1028,7 @@ static int sbp2_scan_logical_unit_dir(struct sbp2_target *tgt, u32 *directory)
1022 return 0; 1028 return 0;
1023} 1029}
1024 1030
1025static int sbp2_scan_unit_dir(struct sbp2_target *tgt, u32 *directory, 1031static int sbp2_scan_unit_dir(struct sbp2_target *tgt, const u32 *directory,
1026 u32 *model, u32 *firmware_revision) 1032 u32 *model, u32 *firmware_revision)
1027{ 1033{
1028 struct fw_csr_iterator ci; 1034 struct fw_csr_iterator ci;
@@ -1566,7 +1572,7 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
1566 sdev->start_stop_pwr_cond = 1; 1572 sdev->start_stop_pwr_cond = 1;
1567 1573
1568 if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS) 1574 if (lu->tgt->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
1569 blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512); 1575 blk_queue_max_hw_sectors(sdev->request_queue, 128 * 1024 / 512);
1570 1576
1571 blk_queue_max_segment_size(sdev->request_queue, SBP2_MAX_SEG_SIZE); 1577 blk_queue_max_segment_size(sdev->request_queue, SBP2_MAX_SEG_SIZE);
1572 1578