Commit 034e0ab54bfe57bc980452f991d3ab443f1b085a
Committed by
Paul Mackerras
1 parent
cda563fb9c
Exists in
master
and in
7 other branches
[POWERPC] PS3: Make bus_id and dev_id u64
Change the PS3 bus_id and dev_id from type unsigned int to u64. These IDs are 64-bit in the repository, and the special storage notification device has a device ID of ULONG_MAX. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Showing 7 changed files with 31 additions and 36 deletions Side-by-side Diff
arch/powerpc/platforms/ps3/device-init.c
... | ... | @@ -297,7 +297,7 @@ |
297 | 297 | u64 dev_port; |
298 | 298 | } *notify_event; |
299 | 299 | |
300 | - pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id, | |
300 | + pr_debug(" -> %s:%u: (%lu:%lu:%u)\n", __func__, __LINE__, repo->bus_id, | |
301 | 301 | repo->dev_id, repo->dev_type); |
302 | 302 | |
303 | 303 | buf = kzalloc(512, GFP_KERNEL); |
... | ... | @@ -384,7 +384,7 @@ |
384 | 384 | |
385 | 385 | if (notify_event->dev_id == repo->dev_id && |
386 | 386 | notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) { |
387 | - pr_debug("%s:%u: no access: dev_id %u\n", __func__, | |
387 | + pr_debug("%s:%u: no access: dev_id %lu\n", __func__, | |
388 | 388 | __LINE__, repo->dev_id); |
389 | 389 | break; |
390 | 390 | } |
arch/powerpc/platforms/ps3/mm.c
... | ... | @@ -359,7 +359,7 @@ |
359 | 359 | static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r, |
360 | 360 | const char *func, int line) |
361 | 361 | { |
362 | - DBG("%s:%d: dev %u:%u\n", func, line, r->dev->bus_id, | |
362 | + DBG("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, | |
363 | 363 | r->dev->dev_id); |
364 | 364 | DBG("%s:%d: page_size %u\n", func, line, r->page_size); |
365 | 365 | DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); |
... | ... | @@ -394,7 +394,7 @@ |
394 | 394 | static void _dma_dump_chunk (const struct dma_chunk* c, const char* func, |
395 | 395 | int line) |
396 | 396 | { |
397 | - DBG("%s:%d: r.dev %u:%u\n", func, line, | |
397 | + DBG("%s:%d: r.dev %lu:%lu\n", func, line, | |
398 | 398 | c->region->dev->bus_id, c->region->dev->dev_id); |
399 | 399 | DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); |
400 | 400 | DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size); |
... | ... | @@ -658,7 +658,7 @@ |
658 | 658 | BUG_ON(!r); |
659 | 659 | |
660 | 660 | if (!r->dev->bus_id) { |
661 | - pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__, | |
661 | + pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, | |
662 | 662 | r->dev->bus_id, r->dev->dev_id); |
663 | 663 | return 0; |
664 | 664 | } |
... | ... | @@ -724,7 +724,7 @@ |
724 | 724 | BUG_ON(!r); |
725 | 725 | |
726 | 726 | if (!r->dev->bus_id) { |
727 | - pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__, | |
727 | + pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, | |
728 | 728 | r->dev->bus_id, r->dev->dev_id); |
729 | 729 | return 0; |
730 | 730 | } |
arch/powerpc/platforms/ps3/platform.h
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 | |
96 | 96 | int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, |
97 | 97 | u64 *value); |
98 | -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id); | |
98 | +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id); | |
99 | 99 | int ps3_repository_read_bus_type(unsigned int bus_index, |
100 | 100 | enum ps3_bus_type *bus_type); |
101 | 101 | int ps3_repository_read_bus_num_dev(unsigned int bus_index, |
... | ... | @@ -119,7 +119,7 @@ |
119 | 119 | int ps3_repository_read_dev_str(unsigned int bus_index, |
120 | 120 | unsigned int dev_index, const char *dev_str, u64 *value); |
121 | 121 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, |
122 | - unsigned int *dev_id); | |
122 | + u64 *dev_id); | |
123 | 123 | int ps3_repository_read_dev_type(unsigned int bus_index, |
124 | 124 | unsigned int dev_index, enum ps3_dev_type *dev_type); |
125 | 125 | int ps3_repository_read_dev_intr(unsigned int bus_index, |
126 | 126 | |
127 | 127 | |
... | ... | @@ -138,12 +138,12 @@ |
138 | 138 | /* repository bus enumerators */ |
139 | 139 | |
140 | 140 | struct ps3_repository_device { |
141 | - enum ps3_bus_type bus_type; | |
142 | 141 | unsigned int bus_index; |
143 | - unsigned int bus_id; | |
144 | - enum ps3_dev_type dev_type; | |
145 | 142 | unsigned int dev_index; |
146 | - unsigned int dev_id; | |
143 | + enum ps3_bus_type bus_type; | |
144 | + enum ps3_dev_type dev_type; | |
145 | + u64 bus_id; | |
146 | + u64 dev_id; | |
147 | 147 | }; |
148 | 148 | |
149 | 149 | static inline struct ps3_repository_device *ps3_repository_bump_device( |
arch/powerpc/platforms/ps3/repository.c
... | ... | @@ -168,18 +168,15 @@ |
168 | 168 | value, 0); |
169 | 169 | } |
170 | 170 | |
171 | -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id) | |
171 | +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id) | |
172 | 172 | { |
173 | 173 | int result; |
174 | - u64 v1; | |
175 | - u64 v2; /* unused */ | |
176 | 174 | |
177 | 175 | result = read_node(PS3_LPAR_ID_PME, |
178 | 176 | make_first_field("bus", bus_index), |
179 | 177 | make_field("id", 0), |
180 | 178 | 0, 0, |
181 | - &v1, &v2); | |
182 | - *bus_id = v1; | |
179 | + bus_id, NULL); | |
183 | 180 | return result; |
184 | 181 | } |
185 | 182 | |
186 | 183 | |
187 | 184 | |
... | ... | @@ -225,18 +222,16 @@ |
225 | 222 | } |
226 | 223 | |
227 | 224 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, |
228 | - unsigned int *dev_id) | |
225 | + u64 *dev_id) | |
229 | 226 | { |
230 | 227 | int result; |
231 | - u64 v1; | |
232 | 228 | |
233 | 229 | result = read_node(PS3_LPAR_ID_PME, |
234 | 230 | make_first_field("bus", bus_index), |
235 | 231 | make_field("dev", dev_index), |
236 | 232 | make_field("id", 0), |
237 | 233 | 0, |
238 | - &v1, 0); | |
239 | - *dev_id = v1; | |
234 | + dev_id, 0); | |
240 | 235 | return result; |
241 | 236 | } |
242 | 237 | |
... | ... | @@ -332,7 +327,7 @@ |
332 | 327 | return result; |
333 | 328 | } |
334 | 329 | |
335 | - pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %u, num_dev %u\n", | |
330 | + pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n", | |
336 | 331 | __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id, |
337 | 332 | num_dev); |
338 | 333 | |
... | ... | @@ -387,7 +382,7 @@ |
387 | 382 | return result; |
388 | 383 | } |
389 | 384 | |
390 | - pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %u\n", | |
385 | + pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n", | |
391 | 386 | __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id); |
392 | 387 | |
393 | 388 | *repo = tmp; |
... | ... | @@ -1034,7 +1029,7 @@ |
1034 | 1029 | continue; |
1035 | 1030 | } |
1036 | 1031 | |
1037 | - pr_debug("%s:%d (%u:%u): dev_type %u, dev_id %u\n", __func__, | |
1032 | + pr_debug("%s:%d (%u:%u): dev_type %u, dev_id %lu\n", __func__, | |
1038 | 1033 | __LINE__, repo->bus_index, repo->dev_index, |
1039 | 1034 | repo->dev_type, repo->dev_id); |
1040 | 1035 | |
... | ... | @@ -1091,7 +1086,7 @@ |
1091 | 1086 | continue; |
1092 | 1087 | } |
1093 | 1088 | |
1094 | - pr_debug("%s:%d bus_%u: bus_type %u, bus_id %u, num_dev %u\n", | |
1089 | + pr_debug("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n", | |
1095 | 1090 | __func__, __LINE__, repo.bus_index, repo.bus_type, |
1096 | 1091 | repo.bus_id, num_dev); |
1097 | 1092 |
arch/powerpc/platforms/ps3/system-bus.c
... | ... | @@ -42,8 +42,8 @@ |
42 | 42 | int gpu; |
43 | 43 | } static usage_hack; |
44 | 44 | |
45 | -static int ps3_is_device(struct ps3_system_bus_device *dev, | |
46 | - unsigned int bus_id, unsigned int dev_id) | |
45 | +static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id, | |
46 | + u64 dev_id) | |
47 | 47 | { |
48 | 48 | return dev->bus_id == bus_id && dev->dev_id == dev_id; |
49 | 49 | } |
... | ... | @@ -182,8 +182,8 @@ |
182 | 182 | case PS3_MATCH_ID_SYSTEM_MANAGER: |
183 | 183 | pr_debug("%s:%d: unsupported match_id: %u\n", __func__, |
184 | 184 | __LINE__, dev->match_id); |
185 | - pr_debug("%s:%d: bus_id: %u\n", __func__, | |
186 | - __LINE__, dev->bus_id); | |
185 | + pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, | |
186 | + dev->bus_id); | |
187 | 187 | BUG(); |
188 | 188 | return -EINVAL; |
189 | 189 | |
... | ... | @@ -220,8 +220,8 @@ |
220 | 220 | case PS3_MATCH_ID_SYSTEM_MANAGER: |
221 | 221 | pr_debug("%s:%d: unsupported match_id: %u\n", __func__, |
222 | 222 | __LINE__, dev->match_id); |
223 | - pr_debug("%s:%d: bus_id: %u\n", __func__, | |
224 | - __LINE__, dev->bus_id); | |
223 | + pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, | |
224 | + dev->bus_id); | |
225 | 225 | BUG(); |
226 | 226 | return -EINVAL; |
227 | 227 | |
... | ... | @@ -240,7 +240,7 @@ |
240 | 240 | static void _dump_mmio_region(const struct ps3_mmio_region* r, |
241 | 241 | const char* func, int line) |
242 | 242 | { |
243 | - pr_debug("%s:%d: dev %u:%u\n", func, line, r->dev->bus_id, | |
243 | + pr_debug("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, | |
244 | 244 | r->dev->dev_id); |
245 | 245 | pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); |
246 | 246 | pr_debug("%s:%d: len %lxh\n", func, line, r->len); |
drivers/net/ps3_gelic_net.c
... | ... | @@ -58,11 +58,11 @@ |
58 | 58 | { |
59 | 59 | return &card->dev->core; |
60 | 60 | } |
61 | -static inline unsigned int bus_id(struct gelic_net_card *card) | |
61 | +static inline u64 bus_id(struct gelic_net_card *card) | |
62 | 62 | { |
63 | 63 | return card->dev->bus_id; |
64 | 64 | } |
65 | -static inline unsigned int dev_id(struct gelic_net_card *card) | |
65 | +static inline u64 dev_id(struct gelic_net_card *card) | |
66 | 66 | { |
67 | 67 | return card->dev->dev_id; |
68 | 68 | } |
include/asm-powerpc/ps3.h
... | ... | @@ -344,8 +344,8 @@ |
344 | 344 | enum ps3_match_id match_id; |
345 | 345 | enum ps3_system_bus_device_type dev_type; |
346 | 346 | |
347 | - unsigned int bus_id; /* SB */ | |
348 | - unsigned int dev_id; /* SB */ | |
347 | + u64 bus_id; /* SB */ | |
348 | + u64 dev_id; /* SB */ | |
349 | 349 | unsigned int interrupt_id; /* SB */ |
350 | 350 | struct ps3_dma_region *d_region; /* SB, IOC0 */ |
351 | 351 | struct ps3_mmio_region *m_region; /* SB, IOC0*/ |