Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-2.6:
parisc: hppb.c - fix printk format strings
parisc: parisc-agp.c - use correct page_mask function
parisc: sticore.c - check return values
parisc: dino.c - check return value of pci_assign_resource()
parisc: hp_sdc_mlc.c - check return value of down_trylock()
parisc: includecheck fix for ccio-dma.c
parisc: Set correct bit in protection flags
parisc: isa-eeprom - Fix loff_t usage
parisc: fixed faulty check in lba_pci
parisc: Fix read buffer overflow in pdc_stable driver
parisc: Fix GOT overflow during module load on 64bit kernel

+65 -18
+1 -1
arch/parisc/kernel/entry.S
··· 553 553 * on most of those machines only handles cache transactions. 554 554 */ 555 555 extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0 556 - depi 1,12,1,\prot 556 + depdi 1,12,1,\prot 557 557 558 558 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ 559 559 convert_for_tlb_insert20 \pte
+45 -5
arch/parisc/kernel/module.c
··· 86 86 * the bottom of the table, which has a maximum signed displacement of 87 87 * 0x3fff; however, since we're only going forward, this becomes 88 88 * 0x1fff, and thus, since each GOT entry is 8 bytes long we can have 89 - * at most 1023 entries */ 90 - #define MAX_GOTS 1023 89 + * at most 1023 entries. 90 + * To overcome this 14bit displacement with some kernel modules, we'll 91 + * use instead the unusal 16bit displacement method (see reassemble_16a) 92 + * which gives us a maximum positive displacement of 0x7fff, and as such 93 + * allows us to allocate up to 4095 GOT entries. */ 94 + #define MAX_GOTS 4095 91 95 92 96 /* three functions to determine where in the module core 93 97 * or init pieces the location is */ ··· 149 145 /* The reassemble_* functions prepare an immediate value for 150 146 insertion into an opcode. pa-risc uses all sorts of weird bitfields 151 147 in the instruction to hold the value. */ 148 + static inline int sign_unext(int x, int len) 149 + { 150 + int len_ones; 151 + 152 + len_ones = (1 << len) - 1; 153 + return x & len_ones; 154 + } 155 + 156 + static inline int low_sign_unext(int x, int len) 157 + { 158 + int sign, temp; 159 + 160 + sign = (x >> (len-1)) & 1; 161 + temp = sign_unext(x, len-1); 162 + return (temp << 1) | sign; 163 + } 164 + 152 165 static inline int reassemble_14(int as14) 153 166 { 154 167 return (((as14 & 0x1fff) << 1) | 155 168 ((as14 & 0x2000) >> 13)); 156 169 } 170 + 171 + static inline int reassemble_16a(int as16) 172 + { 173 + int s, t; 174 + 175 + /* Unusual 16-bit encoding, for wide mode only. */ 176 + t = (as16 << 1) & 0xffff; 177 + s = (as16 & 0x8000); 178 + return (t ^ s ^ (s >> 1)) | (s >> 15); 179 + } 180 + 157 181 158 182 static inline int reassemble_17(int as17) 159 183 { ··· 439 407 enum elf_stub_type stub_type, Elf_Addr loc0, unsigned int targetsec) 440 408 { 441 409 struct stub_entry *stub; 410 + int __maybe_unused d; 442 411 443 412 /* initialize stub_offset to point in front of the section */ 444 413 if (!me->arch.section[targetsec].stub_offset) { ··· 493 460 */ 494 461 switch (stub_type) { 495 462 case ELF_STUB_GOT: 496 - stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */ 463 + d = get_got(me, value, addend); 464 + if (d <= 15) { 465 + /* Format 5 */ 466 + stub->insns[0] = 0x0f6010db; /* ldd 0(%dp),%dp */ 467 + stub->insns[0] |= low_sign_unext(d, 5) << 16; 468 + } else { 469 + /* Format 3 */ 470 + stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */ 471 + stub->insns[0] |= reassemble_16a(d); 472 + } 497 473 stub->insns[1] = 0x53610020; /* ldd 10(%dp),%r1 */ 498 474 stub->insns[2] = 0xe820d000; /* bve (%r1) */ 499 475 stub->insns[3] = 0x537b0030; /* ldd 18(%dp),%dp */ 500 - 501 - stub->insns[0] |= reassemble_14(get_got(me, value, addend) & 0x3fff); 502 476 break; 503 477 case ELF_STUB_MILLI: 504 478 stub->insns[0] = 0x20200000; /* ldil 0,%r1 */
+1 -1
drivers/char/agp/parisc-agp.c
··· 225 225 .configure = parisc_agp_configure, 226 226 .fetch_size = parisc_agp_fetch_size, 227 227 .tlb_flush = parisc_agp_tlbflush, 228 - .mask_memory = parisc_agp_mask_memory, 228 + .mask_memory = parisc_agp_page_mask_memory, 229 229 .masks = parisc_agp_masks, 230 230 .agp_enable = parisc_agp_enable, 231 231 .cache_flush = global_cache_flush,
+1 -1
drivers/input/serio/hp_sdc_mlc.c
··· 296 296 priv->tseq[3] = 0; 297 297 if (mlc->opacket & HIL_CTRL_APE) { 298 298 priv->tseq[3] |= HP_SDC_LPC_APE_IPF; 299 - down_trylock(&mlc->csem); 299 + BUG_ON(down_trylock(&mlc->csem)); 300 300 } 301 301 enqueue: 302 302 hp_sdc_enqueue_transaction(&priv->trans);
-1
drivers/parisc/ccio-dma.c
··· 70 70 #undef CCIO_COLLECT_STATS 71 71 #endif 72 72 73 - #include <linux/proc_fs.h> 74 73 #include <asm/runway.h> /* for proc_runway_root */ 75 74 76 75 #ifdef DEBUG_CCIO_INIT
+1 -1
drivers/parisc/dino.c
··· 614 614 dev_name(&bus->self->dev), i, 615 615 bus->self->resource[i].start, 616 616 bus->self->resource[i].end); 617 - pci_assign_resource(bus->self, i); 617 + WARN_ON(pci_assign_resource(bus->self, i)); 618 618 DBG("DEBUG %s after assign %d [0x%lx,0x%lx]\n", 619 619 dev_name(&bus->self->dev), i, 620 620 bus->self->resource[i].start,
+1 -1
drivers/parisc/eisa_eeprom.c
··· 55 55 ssize_t ret; 56 56 int i; 57 57 58 - if (*ppos >= HPEE_MAX_LENGTH) 58 + if (*ppos < 0 || *ppos >= HPEE_MAX_LENGTH) 59 59 return 0; 60 60 61 61 count = *ppos + count < HPEE_MAX_LENGTH ? count : HPEE_MAX_LENGTH - *ppos;
+6 -3
drivers/parisc/hppb.c
··· 62 62 } 63 63 card = card->next; 64 64 } 65 - printk(KERN_INFO "Found GeckoBoa at 0x%x\n", dev->hpa.start); 65 + printk(KERN_INFO "Found GeckoBoa at 0x%llx\n", 66 + (unsigned long long) dev->hpa.start); 66 67 67 68 card->hpa = dev->hpa.start; 68 69 card->mmio_region.name = "HP-PB Bus"; ··· 74 73 75 74 status = ccio_request_resource(dev, &card->mmio_region); 76 75 if(status < 0) { 77 - printk(KERN_ERR "%s: failed to claim HP-PB bus space (%08x, %08x)\n", 78 - __FILE__, card->mmio_region.start, card->mmio_region.end); 76 + printk(KERN_ERR "%s: failed to claim HP-PB " 77 + "bus space (0x%08llx, 0x%08llx)\n", 78 + __FILE__, (unsigned long long) card->mmio_region.start, 79 + (unsigned long long) card->mmio_region.end); 79 80 } 80 81 81 82 return 0;
+1 -1
drivers/parisc/lba_pci.c
··· 992 992 return; 993 993 994 994 io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL); 995 - if (!pa_pdc_cell) { 995 + if (!io_pdc_cell) { 996 996 kfree(pa_pdc_cell); 997 997 return; 998 998 }
+1 -1
drivers/parisc/pdc_stable.c
··· 370 370 if (!i) /* entry is not ready */ 371 371 return -ENODATA; 372 372 373 - for (i = 0; devpath->layers[i] && (likely(i < 6)); i++) 373 + for (i = 0; i < 6 && devpath->layers[i]; i++) 374 374 out += sprintf(out, "%u ", devpath->layers[i]); 375 375 376 376 out += sprintf(out, "\n");
+7 -2
drivers/video/console/sticore.c
··· 957 957 #ifdef CONFIG_PCI 958 958 unsigned long fb_base, rom_base; 959 959 unsigned int fb_len, rom_len; 960 + int err; 960 961 struct sti_struct *sti; 961 962 962 - pci_enable_device(pd); 963 + err = pci_enable_device(pd); 964 + if (err < 0) { 965 + dev_err(&pd->dev, "Cannot enable PCI device\n"); 966 + return err; 967 + } 963 968 964 969 fb_base = pci_resource_start(pd, 0); 965 970 fb_len = pci_resource_len(pd, 0); ··· 1053 1048 1054 1049 /* Register drivers for native & PCI cards */ 1055 1050 register_parisc_driver(&pa_sti_driver); 1056 - pci_register_driver(&pci_sti_driver); 1051 + WARN_ON(pci_register_driver(&pci_sti_driver)); 1057 1052 1058 1053 /* if we didn't find the given default sti, take the first one */ 1059 1054 if (!default_sti)