]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Mar 2010 15:56:44 +0000 (07:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Mar 2010 15:56:44 +0000 (07:56 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6:
  sparc: Support show_unhandled_signals.
  sparc: use __ratelimit
  sunxvr500: Additional PCI id for sunxvr500 driver
  sparc: use asm-generic/scatterlist.h
  sparc64: If 'slot-names' property exist, create sysfs PCI slot information.
  sparc: remove trailing space in messages
  sparc: remove redundant return statements

1  2 
arch/sparc/kernel/devices.c
arch/sparc/kernel/pci.c
arch/sparc/kernel/pcic.c
arch/sparc/mm/fault_32.c

index b062de9424a484d51e1513e8a0b2ffb86a86faff,89c22a2c085bb345905dd9656b5dea7f7c0d20fc..62dc7a02141332b0dabad5a60c1eb19b7fc89afd
@@@ -59,7 -59,7 +59,7 @@@ static int __cpu_find_by(int (*compare)
  
        cur_inst = 0;
        for_each_node_by_type(dp, "cpu") {
 -              int err = check_cpu_node(dp->node, &cur_inst,
 +              int err = check_cpu_node(dp->phandle, &cur_inst,
                                         compare, compare_arg,
                                         prom_node, mid);
                if (!err) {
@@@ -143,6 -143,4 +143,4 @@@ void __init device_scan(void
  
        if (ARCH_SUN4C)
                sun4c_probe_memerr_reg();
-       return;
  }
diff --combined arch/sparc/kernel/pci.c
index 37b66c60abe32f7d76471bbcca7fbe49f7530749,d7e1cf01dd2844849b36a4c302b70d4fb817d8fc..5ac539a5930f5401239d81f2e1bfff217472a60e
@@@ -722,10 -722,9 +722,10 @@@ void pcibios_update_irq(struct pci_dev 
  {
  }
  
 -void pcibios_align_resource(void *data, struct resource *res,
 -                          resource_size_t size, resource_size_t align)
 +resource_size_t pcibios_align_resource(void *data, const struct resource *res,
 +                              resource_size_t size, resource_size_t align)
  {
 +      return res->start;
  }
  
  int pcibios_enable_device(struct pci_dev *dev, int mask)
@@@ -1095,3 -1094,78 +1095,78 @@@ static int __init pcibios_init(void
        return 0;
  }
  subsys_initcall(pcibios_init);
+ #ifdef CONFIG_SYSFS
+ static void __devinit pci_bus_slot_names(struct device_node *node,
+                                        struct pci_bus *bus)
+ {
+       const struct pci_slot_names {
+               u32     slot_mask;
+               char    names[0];
+       } *prop;
+       const char *sp;
+       int len, i;
+       u32 mask;
+       prop = of_get_property(node, "slot-names", &len);
+       if (!prop)
+               return;
+       mask = prop->slot_mask;
+       sp = prop->names;
+       if (ofpci_verbose)
+               printk("PCI: Making slots for [%s] mask[0x%02x]\n",
+                      node->full_name, mask);
+       i = 0;
+       while (mask) {
+               struct pci_slot *pci_slot;
+               u32 this_bit = 1 << i;
+               if (!(mask & this_bit)) {
+                       i++;
+                       continue;
+               }
+               if (ofpci_verbose)
+                       printk("PCI: Making slot [%s]\n", sp);
+               pci_slot = pci_create_slot(bus, i, sp, NULL);
+               if (IS_ERR(pci_slot))
+                       printk(KERN_ERR "PCI: pci_create_slot returned %ld\n",
+                              PTR_ERR(pci_slot));
+               sp += strlen(sp) + 1;
+               mask &= ~this_bit;
+               i++;
+       }
+ }
+ static int __init of_pci_slot_init(void)
+ {
+       struct pci_bus *pbus = NULL;
+       while ((pbus = pci_find_next_bus(pbus)) != NULL) {
+               struct device_node *node;
+               if (pbus->self) {
+                       struct dev_archdata *sd = pbus->self->sysdata;
+                       /* PCI->PCI bridge */
+                       node = sd->prom_node;
+               } else {
+                       struct pci_pbm_info *pbm = pbus->sysdata;
+                       /* Host PCI controller */
+                       node = pbm->op->node;
+               }
+               pci_bus_slot_names(node, pbus);
+       }
+       return 0;
+ }
+ module_init(of_pci_slot_init);
+ #endif
diff --combined arch/sparc/kernel/pcic.c
index 75e88c00bca397cf7738227a825ebe71f9e60100,0610e2edaa78c00b57adf36938d9afc2c834fc8d..d36a8d391ca0639e6a2bb73defd5b2fd05bb38a2
@@@ -585,8 -585,6 +585,6 @@@ pcic_fill_irq(struct linux_pcic *pcic, 
                        writew(ivec, pcic->pcic_regs+PCI_INT_SELECT_LO);
                }
        }
-       return;
  }
  
  /*
@@@ -768,10 -766,9 +766,10 @@@ char * __devinit pcibios_setup(char *st
        return str;
  }
  
 -void pcibios_align_resource(void *data, struct resource *res,
 -                          resource_size_t size, resource_size_t align)
 +resource_size_t pcibios_align_resource(void *data, const struct resource *res,
 +                              resource_size_t size, resource_size_t align)
  {
 +      return res->start;
  }
  
  int pcibios_enable_device(struct pci_dev *pdev, int mask)
diff --combined arch/sparc/mm/fault_32.c
index 3fa09ba3845f3dafd06e80439e8214785d297f39,ec8f22c681efa747c5543a67c093a77fa1fbda96..bd8601601afab05ffc9f0ff7d06021523355b69f
@@@ -35,6 -35,8 +35,8 @@@
  
  extern int prom_node_root;
  
+ int show_unhandled_signals = 1;
  /* At boot time we determine these two values necessary for setting
   * up the segment maps and page table entries (pte's).
   */
@@@ -149,6 -151,45 +151,45 @@@ asmlinkage int lookup_fault(unsigned lo
        return 0;
  }
  
+ static inline void
+ show_signal_msg(struct pt_regs *regs, int sig, int code,
+               unsigned long address, struct task_struct *tsk)
+ {
+       if (!unhandled_signal(tsk, sig))
+               return;
+       if (!printk_ratelimit())
+               return;
+       printk("%s%s[%d]: segfault at %lx ip %p (rpc %p) sp %p error %x",
+              task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
+              tsk->comm, task_pid_nr(tsk), address,
+              (void *)regs->pc, (void *)regs->u_regs[UREG_I7],
+              (void *)regs->u_regs[UREG_FP], code);
+       print_vma_addr(KERN_CONT " in ", regs->pc);
+       printk(KERN_CONT "\n");
+ }
+ static void __do_fault_siginfo(int code, int sig, struct pt_regs *regs,
+                              unsigned long addr)
+ {
+       siginfo_t info;
+       info.si_signo = sig;
+       info.si_code = code;
+       info.si_errno = 0;
+       info.si_addr = (void __user *) addr;
+       info.si_trapno = 0;
+       if (unlikely(show_unhandled_signals))
+               show_signal_msg(regs, sig, info.si_code,
+                               addr, current);
+       force_sig_info (sig, &info, current);
+ }
  extern unsigned long safe_compute_effective_address(struct pt_regs *,
                                                    unsigned int);
  
@@@ -168,6 -209,14 +209,14 @@@ static unsigned long compute_si_addr(st
        return safe_compute_effective_address(regs, insn);
  }
  
+ static noinline void do_fault_siginfo(int code, int sig, struct pt_regs *regs,
+                                     int text_fault)
+ {
+       unsigned long addr = compute_si_addr(regs, text_fault);
+       __do_fault_siginfo(code, sig, regs, addr);
+ }
  asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
                               unsigned long address)
  {
        struct mm_struct *mm = tsk->mm;
        unsigned int fixup;
        unsigned long g2;
-       siginfo_t info;
        int from_user = !(regs->psr & PSR_PS);
-       int fault;
+       int fault, code;
  
        if(text_fault)
                address = regs->pc;
        if (!ARCH_SUN4C && address >= TASK_SIZE)
                goto vmalloc_fault;
  
-       info.si_code = SEGV_MAPERR;
+       code = SEGV_MAPERR;
  
        /*
         * If we're in an interrupt or have no user
         * we can handle it..
         */
  good_area:
-       info.si_code = SEGV_ACCERR;
+       code = SEGV_ACCERR;
        if(write) {
                if(!(vma->vm_flags & VM_WRITE))
                        goto bad_area;
@@@ -273,18 -321,8 +321,8 @@@ bad_area
  
  bad_area_nosemaphore:
        /* User mode accesses just cause a SIGSEGV */
-       if(from_user) {
- #if 0
-               printk("Fault whee %s [%d]: segfaults at %08lx pc=%08lx\n",
-                      tsk->comm, tsk->pid, address, regs->pc);
- #endif
-               info.si_signo = SIGSEGV;
-               info.si_errno = 0;
-               /* info.si_code set above to make clear whether
-                  this was a SEGV_MAPERR or SEGV_ACCERR fault.  */
-               info.si_addr = (void __user *)compute_si_addr(regs, text_fault);
-               info.si_trapno = 0;
-               force_sig_info (SIGSEGV, &info, tsk);
+       if (from_user) {
+               do_fault_siginfo(code, SIGSEGV, regs, text_fault);
                return;
        }
  
@@@ -335,12 -373,7 +373,7 @@@ out_of_memory
  
  do_sigbus:
        up_read(&mm->mmap_sem);
-       info.si_signo = SIGBUS;
-       info.si_errno = 0;
-       info.si_code = BUS_ADRERR;
-       info.si_addr = (void __user *) compute_si_addr(regs, text_fault);
-       info.si_trapno = 0;
-       force_sig_info (SIGBUS, &info, tsk);
+       do_fault_siginfo(BUS_ADRERR, SIGBUS, regs, text_fault);
        if (!from_user)
                goto no_context;
  
@@@ -378,7 -411,7 +411,7 @@@ asmlinkage void do_sun4c_fault(struct p
                               unsigned long address)
  {
        extern void sun4c_update_mmu_cache(struct vm_area_struct *,
 -                                         unsigned long,pte_t);
 +                                         unsigned long,pte_t *);
        extern pte_t *sun4c_pte_offset_kernel(pmd_t *,unsigned long);
        struct task_struct *tsk = current;
        struct mm_struct *mm = tsk->mm;
                 *       on the CPU and doing a shrink_mmap() on this vma.
                 */
                sun4c_update_mmu_cache (find_vma(current->mm, address), address,
 -                                      *ptep);
 +                                      ptep);
        else
                do_sparc_fault(regs, text_fault, write, address);
  }
@@@ -466,14 -499,10 +499,10 @@@ static void force_user_fault(unsigned l
        struct vm_area_struct *vma;
        struct task_struct *tsk = current;
        struct mm_struct *mm = tsk->mm;
-       siginfo_t info;
+       int code;
  
-       info.si_code = SEGV_MAPERR;
+       code = SEGV_MAPERR;
  
- #if 0
-       printk("wf<pid=%d,wr=%d,addr=%08lx>\n",
-              tsk->pid, write, address);
- #endif
        down_read(&mm->mmap_sem);
        vma = find_vma(mm, address);
        if(!vma)
        if(expand_stack(vma, address))
                goto bad_area;
  good_area:
-       info.si_code = SEGV_ACCERR;
+       code = SEGV_ACCERR;
        if(write) {
                if(!(vma->vm_flags & VM_WRITE))
                        goto bad_area;
        return;
  bad_area:
        up_read(&mm->mmap_sem);
- #if 0
-       printk("Window whee %s [%d]: segfaults at %08lx\n",
-              tsk->comm, tsk->pid, address);
- #endif
-       info.si_signo = SIGSEGV;
-       info.si_errno = 0;
-       /* info.si_code set above to make clear whether
-          this was a SEGV_MAPERR or SEGV_ACCERR fault.  */
-       info.si_addr = (void __user *) address;
-       info.si_trapno = 0;
-       force_sig_info (SIGSEGV, &info, tsk);
+       __do_fault_siginfo(code, SIGSEGV, tsk->thread.kregs, address);
        return;
  
  do_sigbus:
        up_read(&mm->mmap_sem);
-       info.si_signo = SIGBUS;
-       info.si_errno = 0;
-       info.si_code = BUS_ADRERR;
-       info.si_addr = (void __user *) address;
-       info.si_trapno = 0;
-       force_sig_info (SIGBUS, &info, tsk);
+       __do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address);
  }
  
  void window_overflow_fault(void)