1. 06 7月, 2010 7 次提交
    • G
      of/device: Merge of_platform_bus_probe() · 5fd200f3
      Grant Likely 提交于
      Merge common code between PowerPC and microblaze.  This patch merges
      the code that scans the tree and registers devices.  The functions
      merged are of_platform_bus_probe(), of_platform_bus_create(), and
      of_platform_device_create().
      
      This patch also move the of_default_bus_ids[] table out of a Microblaze
      header file and makes it non-static.  The device ids table isn't merged
      because powerpc and microblaze use different default data.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      5fd200f3
    • G
      of/device: merge of_device_uevent · dd27dcda
      Grant Likely 提交于
      Merge common code between powerpc and microblaze
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Wolfram Sang <w.sang@pengutronix.de>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      dd27dcda
    • G
      of/address: Merge all of the bus translation code · dbbdee94
      Grant Likely 提交于
      Microblaze and PowerPC share a large chunk of code for translating
      OF device tree data into usable addresses.  Differences between the two
      consist of cosmetic differences, and the addition of dma-ranges support
      code to powerpc but not microblaze.  This patch moves the powerpc
      version into common code and applies many of the cosmetic (non-functional)
      changes from the microblaze version.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Wolfram Sang <w.sang@pengutronix.de>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      dbbdee94
    • G
      of/address: merge of_address_to_resource() · 1f5bef30
      Grant Likely 提交于
      Merge common code between PowerPC and Microblaze.  This patch also
      moves the prototype of pci_address_to_pio() out of pci-bridge.h and
      into prom.h because the only user of pci_address_to_pio() is
      of_address_to_resource().
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      1f5bef30
    • G
      of/address: merge of_iomap() · 6b884a8d
      Grant Likely 提交于
      Merge common code between Microblaze and PowerPC.  This patch creates
      new of_address.h and address.c files to containing address translation
      and mapping routines.  First routine to be moved it of_iomap()
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      6b884a8d
    • G
      of/irq: merge irq mapping code · 7dc2e113
      Grant Likely 提交于
      Merge common irq mapping code between PowerPC and Microblaze.
      
      This patch merges of_irq_find_parent(), of_irq_map_raw() and
      of_irq_map_one().  The functions are dependent on one another, so all
      three are merged in a single patch.  Other than cosmetic difference
      (ie. DBG() vs. pr_debug()), the implementations are identical.
      
      of_irq_to_resource() is also merged, but in this case the
      implementations are different.  This patch drops the microblaze version
      and uses the powerpc implementation unchanged.  The microblaze version
      essentially open-coded irq_of_parse_and_map() which it does not need
      to do.  Therefore the powerpc version is safe to adopt.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      7dc2e113
    • G
      of/powerpc: Move Powermac irq quirk code into powermac pic driver code · b83da291
      Grant Likely 提交于
      The code that figures out what is wrong with the powermac irq device
      tree data belongs with the rest of the powermac irq code.  This patch
      moves it out of prom_parse.c and into powermac/pic.c so that it is only
      compiled in when actually needed.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      b83da291
  2. 29 6月, 2010 1 次提交
  3. 12 6月, 2010 1 次提交
  4. 02 6月, 2010 1 次提交
  5. 31 5月, 2010 1 次提交
  6. 28 5月, 2010 1 次提交
  7. 25 5月, 2010 3 次提交
  8. 22 5月, 2010 3 次提交
  9. 21 5月, 2010 17 次提交
    • A
      powerpc/fsl-booke: Add hibernation support for FSL BookE processors · 90103f93
      Anton Vorontsov 提交于
      This is started as swsusp_32.S modifications, but the amount of #ifdefs
      made the whole file horribly unreadable, so let's put the support into
      its own separate file.
      
      The code should be relatively easy to modify to support 44x BookEs as
      well, but since I don't have any 44x to test, let's confine the code to
      FSL BookE. (The only FSL-specific part so far is 'flush_dcache_L1'.)
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Acked-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      90103f93
    • S
      powerpc/e500mc: Implement machine check handler. · fe04b112
      Scott Wood 提交于
      Most of the MSCR bit assigments are different in e500mc versus
      e500, and they are now write-one-to-clear.
      
      Some e500mc machine check conditions are made recoverable (as long as
      they aren't stuck on), most notably L1 instruction cache parity errors.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      fe04b112
    • F
      powerpc: Remove unused 'protect4gb' boot parameter · 99ec28f1
      FUJITA Tomonori 提交于
      'protect4gb' boot parameter was introduced to avoid allocating dma
      space acrossing 4GB boundary in 2007 (the commit
      56997559).
      
      In 2008, the IOMMU was fixed to use the boundary_mask parameter per
      device properly. So 'protect4gb' workaround was removed (the
      383af952). But somehow I messed the
      'protect4gb' boot parameter that was used to enable the
      workaround.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      99ec28f1
    • A
      powerpc: Use smt_snooze_delay=-1 to always busy loop · b878dc00
      Anton Blanchard 提交于
      Right now if we want to busy loop and not give up any time to the hypervisor
      we put a very large value into smt_snooze_delay. This is sometimes useful
      when running a single partition and you want to avoid any latencies due
      to the hypervisor or CPU power state transitions. While this works, it's a bit
      ugly - how big a number is enough now we have NO_HZ and can be idle for a very
      long time.
      
      The patch below makes smt_snooze_delay signed, and a negative value means loop
      forever:
      
      echo -1 > /sys/devices/system/cpu/cpu0/smt_snooze_delay
      
      This change shouldn't affect the existing userspace tools (eg ppc64_cpu), but
      I'm cc-ing Nathan just to be sure.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b878dc00
    • A
      powerpc: Remove check of ibm,smt-snooze-delay OF property · dd04c63c
      Anton Blanchard 提交于
      I'm not sure why we have code for parsing an ibm,smt-snooze-delay OF
      property. Since we have a smt-snooze-delay= boot option and we can
      also set it at runtime via sysfs, it should be safe to get rid of
      this code.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      dd04c63c
    • M
      powerpc/kdump: Fix race in kdump shutdown · 60adec62
      Michael Neuling 提交于
      When we are crashing, the crashing/primary CPU IPIs the secondaries to
      turn off IRQs, go into real mode and wait in kexec_wait.  While this
      is happening, the primary tears down all the MMU maps.  Unfortunately
      the primary doesn't check to make sure the secondaries have entered
      real mode before doing this.
      
      On PHYP machines, the secondaries can take a long time shutting down
      the IRQ controller as RTAS calls are need.  These RTAS calls need to
      be serialised which resilts in the secondaries contending in
      lock_rtas() and hence taking a long time to shut down.
      
      We've hit this on large POWER7 machines, where some secondaries are
      still waiting in lock_rtas(), when the primary tears down the HPTEs.
      
      This patch makes sure all secondaries are in real mode before the
      primary tears down the MMU.  It uses the new kexec_state entry in the
      paca.  It times out if the secondaries don't reach real mode after
      10sec.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      60adec62
    • M
      powerpc/kexec: Fix race in kexec shutdown · 1fc711f7
      Michael Neuling 提交于
      In kexec_prepare_cpus, the primary CPU IPIs the secondary CPUs to
      kexec_smp_down().  kexec_smp_down() calls kexec_smp_wait() which sets
      the hw_cpu_id() to -1.  The primary does this while leaving IRQs on
      which means the primary can take a timer interrupt which can lead to
      the IPIing one of the secondary CPUs (say, for a scheduler re-balance)
      but since the secondary CPU now has a hw_cpu_id = -1, we IPI CPU
      -1... Kaboom!
      
      We are hitting this case regularly on POWER7 machines.
      
      There is also a second race, where the primary will tear down the MMU
      mappings before knowing the secondaries have entered real mode.
      
      Also, the secondaries are clearing out any pending IPIs before
      guaranteeing that no more will be received.
      
      This changes kexec_prepare_cpus() so that we turn off IRQs in the
      primary CPU much earlier.  It adds a paca flag to say that the
      secondaries have entered the kexec_smp_down() IPI and turned off IRQs,
      rather than overloading hw_cpu_id with -1.  This new paca flag is
      again used to in indicate when the secondaries has entered real mode.
      
      It also ensures that all CPUs have their IRQs off before we clear out
      any pending IPI requests (in kexec_cpu_down()) to ensure there are no
      trailing IPIs left unacknowledged.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1fc711f7
    • A
      powerpc: Use more accurate limit for first segment memory allocations · 095c7965
      Anton Blanchard 提交于
      Author: Milton Miller <miltonm@bga.com>
      
      On large machines we are running out of room below 256MB. In some cases we
      only need to ensure the allocation is in the first segment, which may be
      256MB or 1TB.
      
      Add slb0_limit and use it to specify the upper limit for the irqstack and
      emergency stacks.
      
      On a large ppc64 box, this fixes a panic at boot when the crashkernel=
      option is specified (previously we would run out of memory below 256MB).
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      095c7965
    • A
      powerpc/kdump: Use chip->shutdown to disable IRQs · 5d7a8721
      Anton Blanchard 提交于
      I saw this in a kdump kernel:
      
      IOMMU table initialized, virtual merging enabled
      Interrupt 155954 (real) is invalid, disabling it.
      Interrupt 155953 (real) is invalid, disabling it.
      
      ie we took some spurious interrupts. default_machine_crash_shutdown tries
      to disable all interrupt sources but uses chip->disable which maps to
      the default action of:
      
      static void default_disable(unsigned int irq)
      {
      }
      
      If we use chip->shutdown, then we actually mask the IRQ:
      
      static void default_shutdown(unsigned int irq)
      {
              struct irq_desc *desc = irq_to_desc(irq);
      
              desc->chip->mask(irq);
              desc->status |= IRQ_MASKED;
      }
      
      Not sure why we don't implement a ->disable action for xics.c, or why
      default_disable doesn't mask the interrupt.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5d7a8721
    • A
      powerpc/kdump: CPUs assume the context of the oopsing CPU · 06440794
      Anton Blanchard 提交于
      We wrap the crash_shutdown_handles[] calls with longjmp/setjmp, so if any
      of them fault we can recover. The problem is we add a hook to the debugger
      fault handler hook which calls longjmp unconditionally.
      
      This first part of kdump is run before we marshall the other CPUs, so there
      is a very good chance some CPU on the box is going to page fault. And when
      it does it hits the longjmp code and assumes the context of the oopsing CPU.
      The machine gets very confused when it has 10 CPUs all with the same stack,
      all thinking they have the same CPU id. I get even more confused trying
      to debug it.
      
      The patch below adds crash_shutdown_cpu and uses it to specify which cpu is
      in the protected region. Since it can only be -1 or the oopsing CPU, we don't
      need to use memory barriers since it is only valid on the local CPU - no other
      CPU will ever see a value that matches it's local CPU id.
      
      Eventually we should switch the order and marshall all CPUs before doing the
      crash_shutdown_handles[] calls, but that is a bigger fix.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      06440794
    • M
    • S
      powerpc/pci: Check devices status property when scanning OF tree · 5b339bdf
      Sonny Rao 提交于
      We ran into an issue where it looks like we're not properly ignoring a
      pci device with a non-good status property when we walk the device tree
      and instanciate the Linux side PCI devices.
      
      However, the EEH init code does look for the property and disables EEH
      on these devices. This leaves us in an inconsistent where we are poking
      at a supposedly bad piece of hardware and RTAS will block our config
      cycles because EEH isn't enabled anyway.
      Signed-of-by: NSonny Rao <sonnyrao@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5b339bdf
    • B
      powerpc/vio: Switch VIO Bus PM to use generic helpers · a1263c71
      Brian King 提交于
      Switch to use the generic power management helpers.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a1263c71
    • M
      powerpc: Use common cpu_die (fixes SMP+SUSPEND build) · abb17f9c
      Milton Miller 提交于
      Configuring a powerpc 32 bit kernel for both SMP and SUSPEND turns on
      CPU_HOTPLUG to enable disable_nonboot_cpus to be called by the common
      suspend code.  Previously the definition of cpu_die for ppc32 was in
      the powermac platform code, causing it to be undefined if that platform
      as not selected.
      
      arch/powerpc/kernel/built-in.o: In function 'cpu_idle':
      arch/powerpc/kernel/idle.c:98: undefined reference to 'cpu_die'
      
      Move the code from setup_64 to smp.c and rename the power mac
      versions to their specific names.
      
      Note that this does not setup the cpu_die pointers in either
      smp_ops (request a given cpu die) or ppc_md (make this cpu die),
      for other platforms but there are generic versions in smp.c.
      Reported-by: NMatt Sealey <matt@genesi-usa.com>
      Reported-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      abb17f9c
    • M
      powerpc/rtasd: Don't start event scan if scan rate is zero · 7358650e
      Michael Ellerman 提交于
      There appear to be Pegasos systems which have the rtas-event-scan
      RTAS tokens, but on which the event scan always fails. They also
      have an event-scan-rate property containing 0, which means call
      event scan 0 times per minute.
      
      So interpret a scan rate of 0 to mean don't scan at all. This fixes
      the problem on the Pegasos machines and makes sense as well.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7358650e
    • J
      powerpc,kgdb: Introduce low level trap catching · ba797b28
      Jason Wessel 提交于
      The only way the debugger can handle a trap in inside rcu_lock,
      notify_die, or atomic_notifier_call_chain without a recursive fault is
      to allow the kernel debugger to handle the exception first in
      program_check_exception().
      
      The other change here is to make sure that kgdb_handle_exception() is
      called with correct parameters when catching an oops, because kdb
      needs to know if the entry was an oops, single step, or breakpoint
      exception.
      
      [benh@kernel.crashing.org: move debugger_bpt instead of #ifdef]
      
      CC: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ba797b28
    • J
      kgdb: core changes to support kdb · dcc78711
      Jason Wessel 提交于
      These are the minimum changes to the kgdb core in order to enable an
      API to connect a new front end (kdb) to the debug core.
      
      This patch introduces the dbg_kdb_mode variable controls where the
      user level I/O is routed.  It will be routed to the gdbstub (kgdb) or
      to the kdb front end which is a simple shell available over the kgdboc
      connection.
      
      You can switch back and forth between kdb or the gdb stub mode of
      operation dynamically.  From gdb stub mode you can blindly type
      "$3#33", or from the kdb mode you can enter "kgdb" to switch to the
      gdb stub.
      
      The logic in the debug core depends on kdb to look for the typical gdb
      connection sequences and return immediately with KGDB_PASS_EVENT if a
      gdb serial command sequence is detected.  That should allow a
      reasonably seamless transition between kdb -> gdb without leaving the
      kernel exception state.  The two gdb serial queries that kdb is
      responsible for detecting are the "?" and "qSupported" packets.
      
      CC: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Acked-by: NMartin Hicks <mort@sgi.com>
      dcc78711
  10. 19 5月, 2010 2 次提交
  11. 17 5月, 2010 3 次提交
    • K
      powerpc/fsl-booke: Move loadcam_entry back to asm code to fix SMP ftrace · 78f62237
      Kumar Gala 提交于
      When we build with ftrace enabled its possible that loadcam_entry would
      have used the stack pointer (even though the code doesn't need it).  We
      call loadcam_entry in __secondary_start before the stack is setup.  To
      ensure that loadcam_entry doesn't use the stack pointer the easiest
      solution is to just have it in asm code.
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      78f62237
    • L
      powerpc/fsl-booke: Fix InstructionTLBError execute permission check · 78e2e68a
      Li Yang 提交于
      In CONFIG_PTE_64BIT the PTE format has unique permission bits for user
      and supervisor execute.  However on !CONFIG_PTE_64BIT we overload the
      supervisor bit to imply user execute with _PAGE_USER set.  This allows
      us to use the same permission check mask for user or supervisor code on
      !CONFIG_PTE_64BIT.
      
      However, on CONFIG_PTE_64BIT we map _PAGE_EXEC to _PAGE_BAP_UX so we
      need a different permission mask based on the fault coming from a kernel
      address or user space.
      
      Without unique permission masks we see issues like the following with
      modules:
      
      Unable to handle kernel paging request for instruction fetch
      Faulting instruction address: 0xf938d040
      Oops: Kernel access of bad area, sig: 11 [#1]
      Signed-off-by: NLi Yang <leoli@freescale.com>
      Signed-off-by: NJin Qing <b24347@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      78e2e68a
    • A
      KVM: PPC: Find HTAB ourselves · 251585b5
      Alexander Graf 提交于
      For KVM we need to find the location of the HTAB. We can either rely
      on internal data structures of the kernel or ask the hardware.
      
      Ben issued complaints about the internal data structure method, so
      let's switch it to our own inquiry of the HTAB. Now we're fully
      independend :-).
      
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      251585b5