Commit bbad3e50e8ed2d48294c141e687d411430cacbcf

Authored by Cody P Schafer
Committed by Benjamin Herrenschmidt
1 parent 1ee9fcc1a0

powerpc/perf/hv-24x7: Catalog version number is be64, not be32

The catalog version number was changed from a be32 (with proceeding
32bits of padding) to a be64, update the code to treat it as a be64

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Showing 1 changed file with 7 additions and 6 deletions Side-by-side Diff

arch/powerpc/perf/hv-24x7.c
... ... @@ -171,7 +171,7 @@
171 171 }
172 172  
173 173 static unsigned long h_get_24x7_catalog_page(char page[],
174   - u32 version, u32 index)
  174 + u64 version, u32 index)
175 175 {
176 176 return h_get_24x7_catalog_page_(virt_to_phys(page),
177 177 version, index);
... ... @@ -185,7 +185,7 @@
185 185 ssize_t ret = 0;
186 186 size_t catalog_len = 0, catalog_page_len = 0, page_count = 0;
187 187 loff_t page_offset = 0;
188   - uint32_t catalog_version_num = 0;
  188 + uint64_t catalog_version_num = 0;
189 189 void *page = kmem_cache_alloc(hv_page_cache, GFP_USER);
190 190 struct hv_24x7_catalog_page_0 *page_0 = page;
191 191 if (!page)
... ... @@ -197,7 +197,7 @@
197 197 goto e_free;
198 198 }
199 199  
200   - catalog_version_num = be32_to_cpu(page_0->version);
  200 + catalog_version_num = be64_to_cpu(page_0->version);
201 201 catalog_page_len = be32_to_cpu(page_0->length);
202 202 catalog_len = catalog_page_len * 4096;
203 203  
... ... @@ -220,8 +220,9 @@
220 220 page, 4096, page_offset * 4096);
221 221 e_free:
222 222 if (hret)
223   - pr_err("h_get_24x7_catalog_page(ver=%d, page=%lld) failed: rc=%ld\n",
224   - catalog_version_num, page_offset, hret);
  223 + pr_err("h_get_24x7_catalog_page(ver=%lld, page=%lld) failed:"
  224 + " rc=%ld\n",
  225 + catalog_version_num, page_offset, hret);
225 226 kfree(page);
226 227  
227 228 pr_devel("catalog_read: offset=%lld(%lld) count=%zu(%zu) catalog_len=%zu(%zu) => %zd\n",
... ... @@ -255,7 +256,7 @@
255 256 static DEVICE_ATTR_RO(_name)
256 257  
257 258 PAGE_0_ATTR(catalog_version, "%lld\n",
258   - (unsigned long long)be32_to_cpu(page_0->version));
  259 + (unsigned long long)be64_to_cpu(page_0->version));
259 260 PAGE_0_ATTR(catalog_len, "%lld\n",
260 261 (unsigned long long)be32_to_cpu(page_0->length) * 4096);
261 262 static BIN_ATTR_RO(catalog, 0/* real length varies */);