diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-09-28 12:00:15 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-28 14:16:57 -0400 |
commit | 957670a57eb63b932b09b444ad44192ad9ee9382 (patch) | |
tree | 915a2c61198f96fc8c479b9af827742bfdf3885f | |
parent | 8d0208cb59a43bf867e16b977c34c4d6cd618f59 (diff) |
IB/ipath: Call mtrr_del with correct arguments
We were passing 0 for base and length, which worked on older kernels,
but it doesn't seem to any longer.
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_kernel.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_wc_x86_64.c | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index 2a0e9a430634..02134cb3e944 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -336,6 +336,8 @@ struct ipath_devdata { | |||
336 | u8 ipath_ht_slave_off; | 336 | u8 ipath_ht_slave_off; |
337 | /* for write combining settings */ | 337 | /* for write combining settings */ |
338 | unsigned long ipath_wc_cookie; | 338 | unsigned long ipath_wc_cookie; |
339 | unsigned long ipath_wc_base; | ||
340 | unsigned long ipath_wc_len; | ||
339 | /* ref count for each pkey */ | 341 | /* ref count for each pkey */ |
340 | atomic_t ipath_pkeyrefs[4]; | 342 | atomic_t ipath_pkeyrefs[4]; |
341 | /* shadow copy of all exptids physaddr; used only by funcsim */ | 343 | /* shadow copy of all exptids physaddr; used only by funcsim */ |
diff --git a/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c b/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c index f8f9e2e8cbdd..04696e62da87 100644 --- a/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c +++ b/drivers/infiniband/hw/ipath/ipath_wc_x86_64.c | |||
@@ -123,6 +123,8 @@ int ipath_enable_wc(struct ipath_devdata *dd) | |||
123 | ipath_cdbg(VERBOSE, "Set mtrr for chip to WC, " | 123 | ipath_cdbg(VERBOSE, "Set mtrr for chip to WC, " |
124 | "cookie is %d\n", cookie); | 124 | "cookie is %d\n", cookie); |
125 | dd->ipath_wc_cookie = cookie; | 125 | dd->ipath_wc_cookie = cookie; |
126 | dd->ipath_wc_base = (unsigned long) pioaddr; | ||
127 | dd->ipath_wc_len = (unsigned long) piolen; | ||
126 | } | 128 | } |
127 | } | 129 | } |
128 | 130 | ||
@@ -136,9 +138,16 @@ int ipath_enable_wc(struct ipath_devdata *dd) | |||
136 | void ipath_disable_wc(struct ipath_devdata *dd) | 138 | void ipath_disable_wc(struct ipath_devdata *dd) |
137 | { | 139 | { |
138 | if (dd->ipath_wc_cookie) { | 140 | if (dd->ipath_wc_cookie) { |
141 | int r; | ||
139 | ipath_cdbg(VERBOSE, "undoing WCCOMB on pio buffers\n"); | 142 | ipath_cdbg(VERBOSE, "undoing WCCOMB on pio buffers\n"); |
140 | mtrr_del(dd->ipath_wc_cookie, 0, 0); | 143 | r = mtrr_del(dd->ipath_wc_cookie, dd->ipath_wc_base, |
141 | dd->ipath_wc_cookie = 0; | 144 | dd->ipath_wc_len); |
145 | if (r < 0) | ||
146 | dev_info(&dd->pcidev->dev, | ||
147 | "mtrr_del(%lx, %lx, %lx) failed: %d\n", | ||
148 | dd->ipath_wc_cookie, dd->ipath_wc_base, | ||
149 | dd->ipath_wc_len, r); | ||
150 | dd->ipath_wc_cookie = 0; /* even on failure */ | ||
142 | } | 151 | } |
143 | } | 152 | } |
144 | 153 | ||