summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:56:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:56:58 -0500
commit2bcc673101268dc50e52b83226c5bbf38391e16d (patch)
tree0cdaf6affa8b05d436c2e8b80ff23e8c7f03a30a /drivers/scsi/libfc
parent670310dfbae0eefe7318ff6a61e29e67a7a7bbce (diff)
parentb24591e2fcf852ad7ad2ccf745c8220bf378d312 (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "Yet another big pile of changes: - More year 2038 work from Arnd slowly reaching the point where we need to think about the syscalls themself. - A new timer function which allows to conditionally (re)arm a timer only when it's either not running or the new expiry time is sooner than the armed expiry time. This allows to use a single timer for multiple timeout requirements w/o caring about the first expiry time at the call site. - A new NMI safe accessor to clock real time for the printk timestamp work. Can be used by tracing, perf as well if required. - A large number of timer setup conversions from Kees which got collected here because either maintainers requested so or they simply got ignored. As Kees pointed out already there are a few trivial merge conflicts and some redundant commits which was unavoidable due to the size of this conversion effort. - Avoid a redundant iteration in the timer wheel softirq processing. - Provide a mechanism to treat RTC implementations depending on their hardware properties, i.e. don't inflict the write at the 0.5 seconds boundary which originates from the PC CMOS RTC to all RTCs. No functional change as drivers need to be updated separately. - The usual small updates to core code clocksource drivers. Nothing really exciting" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (111 commits) timers: Add a function to start/reduce a timer pstore: Use ktime_get_real_fast_ns() instead of __getnstimeofday() timer: Prepare to change all DEFINE_TIMER() callbacks netfilter: ipvs: Convert timers to use timer_setup() scsi: qla2xxx: Convert timers to use timer_setup() block/aoe: discover_timer: Convert timers to use timer_setup() ide: Convert timers to use timer_setup() drbd: Convert timers to use timer_setup() mailbox: Convert timers to use timer_setup() crypto: Convert timers to use timer_setup() drivers/pcmcia: omap1: Fix error in automated timer conversion ARM: footbridge: Fix typo in timer conversion drivers/sgi-xp: Convert timers to use timer_setup() drivers/pcmcia: Convert timers to use timer_setup() drivers/memstick: Convert timers to use timer_setup() drivers/macintosh: Convert timers to use timer_setup() hwrng/xgene-rng: Convert timers to use timer_setup() auxdisplay: Convert timers to use timer_setup() sparc/led: Convert timers to use timer_setup() mips: ip22/32: Convert timers to use timer_setup() ...
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r--drivers/scsi/libfc/fc_fcp.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 772c35a5c49e..1a4e701a8449 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -97,7 +97,7 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *);
97static void fc_tm_done(struct fc_seq *, struct fc_frame *, void *); 97static void fc_tm_done(struct fc_seq *, struct fc_frame *, void *);
98static void fc_fcp_error(struct fc_fcp_pkt *, struct fc_frame *); 98static void fc_fcp_error(struct fc_fcp_pkt *, struct fc_frame *);
99static void fc_fcp_recovery(struct fc_fcp_pkt *, u8 code); 99static void fc_fcp_recovery(struct fc_fcp_pkt *, u8 code);
100static void fc_fcp_timeout(unsigned long); 100static void fc_fcp_timeout(struct timer_list *);
101static void fc_fcp_rec(struct fc_fcp_pkt *); 101static void fc_fcp_rec(struct fc_fcp_pkt *);
102static void fc_fcp_rec_error(struct fc_fcp_pkt *, struct fc_frame *); 102static void fc_fcp_rec_error(struct fc_fcp_pkt *, struct fc_frame *);
103static void fc_fcp_rec_resp(struct fc_seq *, struct fc_frame *, void *); 103static void fc_fcp_rec_resp(struct fc_seq *, struct fc_frame *, void *);
@@ -155,8 +155,7 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lport, gfp_t gfp)
155 fsp->lp = lport; 155 fsp->lp = lport;
156 fsp->xfer_ddp = FC_XID_UNKNOWN; 156 fsp->xfer_ddp = FC_XID_UNKNOWN;
157 refcount_set(&fsp->ref_cnt, 1); 157 refcount_set(&fsp->ref_cnt, 1);
158 init_timer(&fsp->timer); 158 timer_setup(&fsp->timer, NULL, 0);
159 fsp->timer.data = (unsigned long)fsp;
160 INIT_LIST_HEAD(&fsp->list); 159 INIT_LIST_HEAD(&fsp->list);
161 spin_lock_init(&fsp->scsi_pkt_lock); 160 spin_lock_init(&fsp->scsi_pkt_lock);
162 } else { 161 } else {
@@ -1215,7 +1214,7 @@ static int fc_fcp_cmd_send(struct fc_lport *lport, struct fc_fcp_pkt *fsp,
1215 fsp->seq_ptr = seq; 1214 fsp->seq_ptr = seq;
1216 fc_fcp_pkt_hold(fsp); /* hold for fc_fcp_pkt_destroy */ 1215 fc_fcp_pkt_hold(fsp); /* hold for fc_fcp_pkt_destroy */
1217 1216
1218 setup_timer(&fsp->timer, fc_fcp_timeout, (unsigned long)fsp); 1217 fsp->timer.function = (TIMER_FUNC_TYPE)fc_fcp_timeout;
1219 if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED) 1218 if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED)
1220 fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp)); 1219 fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp));
1221 1220
@@ -1298,9 +1297,9 @@ static int fc_fcp_pkt_abort(struct fc_fcp_pkt *fsp)
1298 * fc_lun_reset_send() - Send LUN reset command 1297 * fc_lun_reset_send() - Send LUN reset command
1299 * @data: The FCP packet that identifies the LUN to be reset 1298 * @data: The FCP packet that identifies the LUN to be reset
1300 */ 1299 */
1301static void fc_lun_reset_send(unsigned long data) 1300static void fc_lun_reset_send(struct timer_list *t)
1302{ 1301{
1303 struct fc_fcp_pkt *fsp = (struct fc_fcp_pkt *)data; 1302 struct fc_fcp_pkt *fsp = from_timer(fsp, t, timer);
1304 struct fc_lport *lport = fsp->lp; 1303 struct fc_lport *lport = fsp->lp;
1305 1304
1306 if (lport->tt.fcp_cmd_send(lport, fsp, fc_tm_done)) { 1305 if (lport->tt.fcp_cmd_send(lport, fsp, fc_tm_done)) {
@@ -1308,7 +1307,7 @@ static void fc_lun_reset_send(unsigned long data)
1308 return; 1307 return;
1309 if (fc_fcp_lock_pkt(fsp)) 1308 if (fc_fcp_lock_pkt(fsp))
1310 return; 1309 return;
1311 setup_timer(&fsp->timer, fc_lun_reset_send, (unsigned long)fsp); 1310 fsp->timer.function = (TIMER_FUNC_TYPE)fc_lun_reset_send;
1312 fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp)); 1311 fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp));
1313 fc_fcp_unlock_pkt(fsp); 1312 fc_fcp_unlock_pkt(fsp);
1314 } 1313 }
@@ -1334,7 +1333,7 @@ static int fc_lun_reset(struct fc_lport *lport, struct fc_fcp_pkt *fsp,
1334 fsp->wait_for_comp = 1; 1333 fsp->wait_for_comp = 1;
1335 init_completion(&fsp->tm_done); 1334 init_completion(&fsp->tm_done);
1336 1335
1337 fc_lun_reset_send((unsigned long)fsp); 1336 fc_lun_reset_send(&fsp->timer);
1338 1337
1339 /* 1338 /*
1340 * wait for completion of reset 1339 * wait for completion of reset
@@ -1431,9 +1430,9 @@ static void fc_fcp_cleanup(struct fc_lport *lport)
1431 * received we see if data was received recently. If it has been then we 1430 * received we see if data was received recently. If it has been then we
1432 * continue waiting, otherwise, we abort the command. 1431 * continue waiting, otherwise, we abort the command.
1433 */ 1432 */
1434static void fc_fcp_timeout(unsigned long data) 1433static void fc_fcp_timeout(struct timer_list *t)
1435{ 1434{
1436 struct fc_fcp_pkt *fsp = (struct fc_fcp_pkt *)data; 1435 struct fc_fcp_pkt *fsp = from_timer(fsp, t, timer);
1437 struct fc_rport *rport = fsp->rport; 1436 struct fc_rport *rport = fsp->rport;
1438 struct fc_rport_libfc_priv *rpriv = rport->dd_data; 1437 struct fc_rport_libfc_priv *rpriv = rport->dd_data;
1439 1438
@@ -1446,7 +1445,7 @@ static void fc_fcp_timeout(unsigned long data)
1446 if (fsp->lp->qfull) { 1445 if (fsp->lp->qfull) {
1447 FC_FCP_DBG(fsp, "fcp timeout, resetting timer delay %d\n", 1446 FC_FCP_DBG(fsp, "fcp timeout, resetting timer delay %d\n",
1448 fsp->timer_delay); 1447 fsp->timer_delay);
1449 setup_timer(&fsp->timer, fc_fcp_timeout, (unsigned long)fsp); 1448 fsp->timer.function = (TIMER_FUNC_TYPE)fc_fcp_timeout;
1450 fc_fcp_timer_set(fsp, fsp->timer_delay); 1449 fc_fcp_timer_set(fsp, fsp->timer_delay);
1451 goto unlock; 1450 goto unlock;
1452 } 1451 }