Commit c256f4b9598c71afd8eb0b7d3d3790a38734cf43
Committed by
Paul Mackerras
1 parent
81bbbe9294
Exists in
master
and in
7 other branches
[PATCH] powerpc: remove io_page_mask
Cleanup patch which removes the io_page_mask. It fixes the reset on some e1000 devices which is needed for clean kexec reboots. The legacy devices which broke with this patch (parallel port and PC speaker) have now been fixed in Linus' tree. Signed-off-by: Anton Blanchard <anton@samba.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Showing 7 changed files with 6 additions and 56 deletions Side-by-side Diff
arch/powerpc/kernel/iomap.c
arch/powerpc/kernel/pci_64.c
... | ... | @@ -42,14 +42,6 @@ |
42 | 42 | unsigned long pci_probe_only = 1; |
43 | 43 | int pci_assign_all_buses = 0; |
44 | 44 | |
45 | -/* | |
46 | - * legal IO pages under MAX_ISA_PORT. This is to ensure we don't touch | |
47 | - * devices we don't have access to. | |
48 | - */ | |
49 | -unsigned long io_page_mask; | |
50 | - | |
51 | -EXPORT_SYMBOL(io_page_mask); | |
52 | - | |
53 | 45 | #ifdef CONFIG_PPC_MULTIPLATFORM |
54 | 46 | static void fixup_resource(struct resource *res, struct pci_dev *dev); |
55 | 47 | static void do_bus_setup(struct pci_bus *bus); |
... | ... | @@ -1104,8 +1096,6 @@ |
1104 | 1096 | pci_process_ISA_OF_ranges(isa_dn, hose->io_base_phys, |
1105 | 1097 | hose->io_base_virt); |
1106 | 1098 | of_node_put(isa_dn); |
1107 | - /* Allow all IO */ | |
1108 | - io_page_mask = -1; | |
1109 | 1099 | } |
1110 | 1100 | } |
1111 | 1101 | |
1112 | 1102 | |
... | ... | @@ -1232,27 +1222,13 @@ |
1232 | 1222 | static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) |
1233 | 1223 | { |
1234 | 1224 | struct pci_controller *hose = pci_bus_to_host(dev->bus); |
1235 | - unsigned long start, end, mask, offset; | |
1225 | + unsigned long offset; | |
1236 | 1226 | |
1237 | 1227 | if (res->flags & IORESOURCE_IO) { |
1238 | 1228 | offset = (unsigned long)hose->io_base_virt - pci_io_base; |
1239 | 1229 | |
1240 | - start = res->start += offset; | |
1241 | - end = res->end += offset; | |
1242 | - | |
1243 | - /* Need to allow IO access to pages that are in the | |
1244 | - ISA range */ | |
1245 | - if (start < MAX_ISA_PORT) { | |
1246 | - if (end > MAX_ISA_PORT) | |
1247 | - end = MAX_ISA_PORT; | |
1248 | - | |
1249 | - start >>= PAGE_SHIFT; | |
1250 | - end >>= PAGE_SHIFT; | |
1251 | - | |
1252 | - /* get the range of pages for the map */ | |
1253 | - mask = ((1 << (end+1)) - 1) ^ ((1 << start) - 1); | |
1254 | - io_page_mask |= mask; | |
1255 | - } | |
1230 | + res->start += offset; | |
1231 | + res->end += offset; | |
1256 | 1232 | } else if (res->flags & IORESOURCE_MEM) { |
1257 | 1233 | res->start += hose->pci_mem_offset; |
1258 | 1234 | res->end += hose->pci_mem_offset; |
arch/powerpc/platforms/iseries/pci.c
... | ... | @@ -45,8 +45,6 @@ |
45 | 45 | #include "call_pci.h" |
46 | 46 | #include "iommu.h" |
47 | 47 | |
48 | -extern unsigned long io_page_mask; | |
49 | - | |
50 | 48 | /* |
51 | 49 | * Forward declares of prototypes. |
52 | 50 | */ |
... | ... | @@ -277,7 +275,6 @@ |
277 | 275 | { |
278 | 276 | iomm_table_initialize(); |
279 | 277 | find_and_init_phbs(); |
280 | - io_page_mask = -1; | |
281 | 278 | } |
282 | 279 | |
283 | 280 | /* |
arch/powerpc/platforms/maple/pci.c
arch/powerpc/platforms/powermac/pci.c
include/asm-powerpc/eeh.h
... | ... | @@ -293,8 +293,6 @@ |
293 | 293 | static inline u8 eeh_inb(unsigned long port) |
294 | 294 | { |
295 | 295 | u8 val; |
296 | - if (!_IO_IS_VALID(port)) | |
297 | - return ~0; | |
298 | 296 | val = in_8((u8 __iomem *)(port+pci_io_base)); |
299 | 297 | if (EEH_POSSIBLE_ERROR(val, u8)) |
300 | 298 | return eeh_check_failure((void __iomem *)(port), val); |
301 | 299 | |
... | ... | @@ -303,15 +301,12 @@ |
303 | 301 | |
304 | 302 | static inline void eeh_outb(u8 val, unsigned long port) |
305 | 303 | { |
306 | - if (_IO_IS_VALID(port)) | |
307 | - out_8((u8 __iomem *)(port+pci_io_base), val); | |
304 | + out_8((u8 __iomem *)(port+pci_io_base), val); | |
308 | 305 | } |
309 | 306 | |
310 | 307 | static inline u16 eeh_inw(unsigned long port) |
311 | 308 | { |
312 | 309 | u16 val; |
313 | - if (!_IO_IS_VALID(port)) | |
314 | - return ~0; | |
315 | 310 | val = in_le16((u16 __iomem *)(port+pci_io_base)); |
316 | 311 | if (EEH_POSSIBLE_ERROR(val, u16)) |
317 | 312 | return eeh_check_failure((void __iomem *)(port), val); |
318 | 313 | |
... | ... | @@ -320,15 +315,12 @@ |
320 | 315 | |
321 | 316 | static inline void eeh_outw(u16 val, unsigned long port) |
322 | 317 | { |
323 | - if (_IO_IS_VALID(port)) | |
324 | - out_le16((u16 __iomem *)(port+pci_io_base), val); | |
318 | + out_le16((u16 __iomem *)(port+pci_io_base), val); | |
325 | 319 | } |
326 | 320 | |
327 | 321 | static inline u32 eeh_inl(unsigned long port) |
328 | 322 | { |
329 | 323 | u32 val; |
330 | - if (!_IO_IS_VALID(port)) | |
331 | - return ~0; | |
332 | 324 | val = in_le32((u32 __iomem *)(port+pci_io_base)); |
333 | 325 | if (EEH_POSSIBLE_ERROR(val, u32)) |
334 | 326 | return eeh_check_failure((void __iomem *)(port), val); |
... | ... | @@ -337,8 +329,7 @@ |
337 | 329 | |
338 | 330 | static inline void eeh_outl(u32 val, unsigned long port) |
339 | 331 | { |
340 | - if (_IO_IS_VALID(port)) | |
341 | - out_le32((u32 __iomem *)(port+pci_io_base), val); | |
332 | + out_le32((u32 __iomem *)(port+pci_io_base), val); | |
342 | 333 | } |
343 | 334 | |
344 | 335 | /* in-string eeh macros */ |
include/asm-powerpc/io.h
... | ... | @@ -37,12 +37,6 @@ |
37 | 37 | |
38 | 38 | extern unsigned long isa_io_base; |
39 | 39 | extern unsigned long pci_io_base; |
40 | -extern unsigned long io_page_mask; | |
41 | - | |
42 | -#define MAX_ISA_PORT 0x10000 | |
43 | - | |
44 | -#define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) \ | |
45 | - & io_page_mask) | |
46 | 40 | |
47 | 41 | #ifdef CONFIG_PPC_ISERIES |
48 | 42 | /* __raw_* accessors aren't supported on iSeries */ |