aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_def.h2
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c11
2 files changed, 6 insertions, 7 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index cc98eead2c3c..7da2fad8f515 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -438,7 +438,7 @@ struct zfcp_qdio {
438 struct zfcp_qdio_queue req_q; 438 struct zfcp_qdio_queue req_q;
439 spinlock_t stat_lock; 439 spinlock_t stat_lock;
440 spinlock_t req_q_lock; 440 spinlock_t req_q_lock;
441 ktime_t req_q_time; 441 unsigned long long req_q_time;
442 u64 req_q_util; 442 u64 req_q_util;
443 atomic_t req_q_full; 443 atomic_t req_q_full;
444 wait_queue_head_t req_q_wq; 444 wait_queue_head_t req_q_wq;
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 2b499e28ff1f..6c5228b627fc 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -56,16 +56,15 @@ static void zfcp_qdio_zero_sbals(struct qdio_buffer *sbal[], int first, int cnt)
56} 56}
57 57
58/* this needs to be called prior to updating the queue fill level */ 58/* this needs to be called prior to updating the queue fill level */
59static void zfcp_qdio_account(struct zfcp_qdio *qdio) 59static inline void zfcp_qdio_account(struct zfcp_qdio *qdio)
60{ 60{
61 ktime_t now; 61 unsigned long long now, span;
62 s64 span;
63 int free, used; 62 int free, used;
64 63
65 spin_lock(&qdio->stat_lock); 64 spin_lock(&qdio->stat_lock);
66 now = ktime_get(); 65 now = get_clock_monotonic();
67 span = ktime_us_delta(now, qdio->req_q_time); 66 span = (now - qdio->req_q_time) >> 12;
68 free = max(0, atomic_read(&qdio->req_q.count)); 67 free = atomic_read(&qdio->req_q.count);
69 used = QDIO_MAX_BUFFERS_PER_Q - free; 68 used = QDIO_MAX_BUFFERS_PER_Q - free;
70 qdio->req_q_util += used * span; 69 qdio->req_q_util += used * span;
71 qdio->req_q_time = now; 70 qdio->req_q_time = now;