]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[S390] qdio: dont convert timestamps to microseconds
authorJan Glauber <jang@linux.vnet.ibm.com>
Mon, 17 May 2010 08:00:17 +0000 (10:00 +0200)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Mon, 17 May 2010 08:00:17 +0000 (10:00 +0200)
Don't convert timestamps to microseconds, use timestamps returned by
get_clock() directly.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/qdio.h
drivers/s390/cio/qdio_main.c

index da80e9b95e451cb39676f17fe7e5750b176c179d..f0037eefd44e62532c5b5c23be9cd30100bd7999 100644 (file)
@@ -13,8 +13,8 @@
 #include <asm/debug.h>
 #include "chsc.h"
 
-#define QDIO_BUSY_BIT_PATIENCE         100     /* 100 microseconds */
-#define QDIO_INPUT_THRESHOLD           500     /* 500 microseconds */
+#define QDIO_BUSY_BIT_PATIENCE         (100 << 12)     /* 100 microseconds */
+#define QDIO_INPUT_THRESHOLD           (500 << 12)     /* 500 microseconds */
 
 /*
  * if an asynchronous HiperSockets queue runs full, the 10 seconds timer wait
@@ -370,11 +370,6 @@ static inline int multicast_outbound(struct qdio_q *q)
               (q->nr == q->irq_ptr->nr_output_qs - 1);
 }
 
-static inline unsigned long long get_usecs(void)
-{
-       return monotonic_clock() >> 12;
-}
-
 #define pci_out_supported(q) \
        (q->irq_ptr->qib.ac & QIB_AC_OUTBOUND_PCI_SUPPORTED)
 #define is_qebsm(q)                    (q->irq_ptr->sch_token != 0)
index f4fd6cd4dc08fddbc7bfaa74f18c54dd07804441..dafb3e5bdad72cbe6188481064e71c377bd70ab4 100644 (file)
@@ -336,10 +336,10 @@ again:
                WARN_ON(queue_type(q) != QDIO_IQDIO_QFMT || cc != 2);
 
                if (!start_time) {
-                       start_time = get_usecs();
+                       start_time = get_clock();
                        goto again;
                }
-               if ((get_usecs() - start_time) < QDIO_BUSY_BIT_PATIENCE)
+               if ((get_clock() - start_time) < QDIO_BUSY_BIT_PATIENCE)
                        goto again;
        }
        return cc;
@@ -536,7 +536,7 @@ static int qdio_inbound_q_moved(struct qdio_q *q)
        if ((bufnr != q->last_move) || q->qdio_error) {
                q->last_move = bufnr;
                if (!is_thinint_irq(q->irq_ptr) && MACHINE_IS_LPAR)
-                       q->u.in.timestamp = get_usecs();
+                       q->u.in.timestamp = get_clock();
                return 1;
        } else
                return 0;
@@ -567,7 +567,7 @@ static inline int qdio_inbound_q_done(struct qdio_q *q)
         * At this point we know, that inbound first_to_check
         * has (probably) not moved (see qdio_inbound_processing).
         */
-       if (get_usecs() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) {
+       if (get_clock() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) {
                DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%02x",
                              q->first_to_check);
                return 1;