[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1429648676-17755-3-git-send-email-mcgrof@do-not-panic.com>
Date: Tue, 21 Apr 2015 13:37:55 -0700
From: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
To: infinipath@...el.com, roland@...nel.org, sean.hefty@...el.com,
hal.rosenstock@...il.com, linux-rdma@...r.kernel.org
Cc: luto@...capital.net, mst@...hat.com, cocci@...teme.lip6.fr,
"Luis R. Rodriguez" <mcgrof@...e.com>,
Toshi Kani <toshi.kani@...com>,
Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
Mike Marciniszyn <mike.marciniszyn@...el.com>,
Roland Dreier <roland@...estorage.com>,
Dennis Dalessandro <dennis.dalessandro@...el.com>,
Suresh Siddha <sbsiddha@...il.com>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Juergen Gross <jgross@...e.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Dave Airlie <airlied@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Antonino Daplas <adaplas@...il.com>,
Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
Tomi Valkeinen <tomi.valkeinen@...com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>,
Stefan Bader <stefan.bader@...onical.com>,
konrad.wilk@...cle.com, ville.syrjala@...ux.intel.com,
david.vrabel@...rix.com, jbeulich@...e.com,
Roger Pau Monné <roger.pau@...rix.com>,
linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
xen-devel@...ts.xensource.com
Subject: [PATCH v3 2/3] IB/qib: use arch_phys_wc_add()
From: "Luis R. Rodriguez" <mcgrof@...e.com>
This driver already makes use of ioremap_wc() on PIO buffers,
so convert it to use arch_phys_wc_add().
Cc: Toshi Kani <toshi.kani@...com>
Cc: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: Mike Marciniszyn <mike.marciniszyn@...el.com>
Cc: Roland Dreier <roland@...estorage.com>
Cc: Sean Hefty <sean.hefty@...el.com>
Cc: Hal Rosenstock <hal.rosenstock@...il.com>
Cc: Dennis Dalessandro <dennis.dalessandro@...el.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Suresh Siddha <sbsiddha@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Juergen Gross <jgross@...e.com>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: Dave Airlie <airlied@...hat.com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Antonino Daplas <adaplas@...il.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@...com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Michael S. Tsirkin <mst@...hat.com>
Cc: Stefan Bader <stefan.bader@...onical.com>
Cc: konrad.wilk@...cle.com
Cc: ville.syrjala@...ux.intel.com
Cc: david.vrabel@...rix.com
Cc: jbeulich@...e.com
Cc: Roger Pau Monné <roger.pau@...rix.com>
Cc: infinipath@...el.com
Cc: linux-rdma@...r.kernel.org
Cc: linux-fbdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: xen-devel@...ts.xensource.com
Signed-off-by: Luis R. Rodriguez <mcgrof@...e.com>
---
drivers/infiniband/hw/qib/qib_wc_x86_64.c | 31 ++++---------------------------
1 file changed, 4 insertions(+), 27 deletions(-)
diff --git a/drivers/infiniband/hw/qib/qib_wc_x86_64.c b/drivers/infiniband/hw/qib/qib_wc_x86_64.c
index fe0850a..6d61ef9 100644
--- a/drivers/infiniband/hw/qib/qib_wc_x86_64.c
+++ b/drivers/infiniband/hw/qib/qib_wc_x86_64.c
@@ -116,21 +116,9 @@ int qib_enable_wc(struct qib_devdata *dd)
}
if (!ret) {
- int cookie;
-
- cookie = mtrr_add(pioaddr, piolen, MTRR_TYPE_WRCOMB, 1);
- if (cookie < 0) {
- {
- qib_devinfo(dd->pcidev,
- "mtrr_add() WC for PIO bufs failed (%d)\n",
- cookie);
- ret = -EINVAL;
- }
- } else {
- dd->wc_cookie = cookie;
- dd->wc_base = (unsigned long) pioaddr;
- dd->wc_len = (unsigned long) piolen;
- }
+ dd->wc_cookie = arch_phys_wc_add(pioaddr, piolen);
+ if (dd->wc_cookie < 0)
+ ret = -EINVAL;
}
return ret;
@@ -142,18 +130,7 @@ int qib_enable_wc(struct qib_devdata *dd)
*/
void qib_disable_wc(struct qib_devdata *dd)
{
- if (dd->wc_cookie) {
- int r;
-
- r = mtrr_del(dd->wc_cookie, dd->wc_base,
- dd->wc_len);
- if (r < 0)
- qib_devinfo(dd->pcidev,
- "mtrr_del(%lx, %lx, %lx) failed: %d\n",
- dd->wc_cookie, dd->wc_base,
- dd->wc_len, r);
- dd->wc_cookie = 0; /* even on failure */
- }
+ arch_phys_wc_del(dd->wc_cookie);
}
/**
--
2.3.2.209.gd67f9d5.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists