1. 03 11月, 2014 1 次提交
    • A
      powerpc: Convert power off logic to pm_power_off · 9178ba29
      Alexander Graf 提交于
      The generic Linux framework to power off the machine is a function pointer
      called pm_power_off. The trick about this pointer is that device drivers can
      potentially implement it rather than board files.
      
      Today on powerpc we set pm_power_off to invoke our generic full machine power
      off logic which then calls ppc_md.power_off to invoke machine specific power
      off.
      
      However, when we want to add a power off GPIO via the "gpio-poweroff" driver,
      this card house falls apart. That driver only registers itself if pm_power_off
      is NULL to ensure it doesn't override board specific logic. However, since we
      always set pm_power_off to the generic power off logic (which will just not
      power off the machine if no ppc_md.power_off call is implemented), we can't
      implement power off via the generic GPIO power off driver.
      
      To fix this up, let's get rid of the ppc_md.power_off logic and just always use
      pm_power_off as was intended. Then individual drivers such as the GPIO power off
      driver can implement power off logic via that function pointer.
      
      With this patch set applied and a few patches on top of QEMU that implement a
      power off GPIO on the virt e500 machine, I can successfully turn off my virtual
      machine after halt.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      [mpe: Squash into one patch and update changelog based on cover letter]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      9178ba29
  2. 15 10月, 2014 2 次提交
  3. 08 10月, 2014 1 次提交
    • I
      powerpc/msi: Improve IRQ bitmap allocator · b0345bbc
      Ian Munsie 提交于
      Currently msi_bitmap_alloc_hwirqs() will round up any IRQ allocation requests
      to the nearest power of 2. eg. ask for 5 IRQs and you'll get 8. This wastes a
      lot of IRQs which can be a scarce resource.
      
      For cxl we may require multiple IRQs for every context that is attached to the
      accelerator. There may be 1000s of contexts attached, hence we can easily run
      out of IRQs, especially if we are needlessly wasting them.
      
      This changes the msi_bitmap_alloc_hwirqs() to allocate only the required number
      of IRQs, hence avoiding this wastage. It keeps the natural alignment
      requirement though.
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b0345bbc
  4. 02 10月, 2014 1 次提交
  5. 25 9月, 2014 4 次提交
    • P
      powerpc/powernv: Don't call generic code on offline cpus · d6a4f709
      Paul Mackerras 提交于
      On PowerNV platforms, when a CPU is offline, we put it into nap mode.
      It's possible that the CPU wakes up from nap mode while it is still
      offline due to a stray IPI.  A misdirected device interrupt could also
      potentially cause it to wake up.  In that circumstance, we need to clear
      the interrupt so that the CPU can go back to nap mode.
      
      In the past the clearing of the interrupt was accomplished by briefly
      enabling interrupts and allowing the normal interrupt handling code
      (do_IRQ() etc.) to handle the interrupt.  This has the problem that
      this code calls irq_enter() and irq_exit(), which call functions such
      as account_system_vtime() which use RCU internally.  Use of RCU is not
      permitted on offline CPUs and will trigger errors if RCU checking is
      enabled.
      
      To avoid calling into any generic code which might use RCU, we adopt
      a different method of clearing interrupts on offline CPUs.  Since we
      are on the PowerNV platform, we know that the system interrupt
      controller is a XICS being driven directly (i.e. not via hcalls) by
      the kernel.  Hence this adds a new icp_native_flush_interrupt()
      function to the native-mode XICS driver and arranges to call that
      when an offline CPU is woken from nap.  This new function reads the
      interrupt from the XICS.  If it is an IPI, it clears the IPI; if it
      is a device interrupt, it prints a warning and disables the source.
      Then it does the end-of-interrupt processing for the interrupt.
      
      The other thing that briefly enabling interrupts did was to check and
      clear the irq_happened flag in this CPU's PACA.  Therefore, after
      flushing the interrupt from the XICS, we also clear all bits except
      the PACA_IRQ_HARD_DIS (interrupts are hard disabled) bit from the
      irq_happened flag.  The PACA_IRQ_HARD_DIS flag is set by power7_nap()
      and is left set to indicate that interrupts are hard disabled.  This
      means we then have to ignore that flag in power7_nap(), which is
      reasonable since it doesn't indicate that any interrupt event needs
      servicing.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      d6a4f709
    • U
      powerpc: make of_device_ids const · ce6d73c9
      Uwe Kleine-König 提交于
      of_device_ids (i.e. compatible strings and the respective data) are not
      supposed to change at runtime. All functions working with of_device_ids
      provided by <linux/of.h> work with const of_device_ids. This allows to
      mark all struct of_device_id const, too.
      
      While touching these line also put the __init annotation at the right
      position where necessary.
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ce6d73c9
    • P
      powerpc: Export dcr_ind_lock to fix build error · 22e55fcf
      Pranith Kumar 提交于
      Fix build error caused by missing export:
      
      ERROR: "dcr_ind_lock" [drivers/net/ethernet/ibm/emac/ibm_emac.ko] undefined!
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      22e55fcf
    • A
      powerpc: Make a bunch of things static · e51df2c1
      Anton Blanchard 提交于
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e51df2c1
  6. 20 9月, 2014 1 次提交
  7. 05 9月, 2014 4 次提交
    • T
      powerpc/fsl_msi: spread msi ints across different MSIRs · c822e737
      Tudor Laurentiu 提交于
      Allocate msis such that each time a new interrupt is requested,
      the SRS (MSIR register select) to be used is allocated in a
      round-robin fashion.
      The end result is that the msi interrupts will be spread across
      distinct MSIRs with the main benefit that now users can set
      affinity to each msi int through the mpic irq backing up the
      MSIR register.
      This is achieved with the help of a newly introduced msi bitmap
      api that allows specifying the starting point when searching
      for a free msi interrupt.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      c822e737
    • T
      powerpc/fsl_msi: show more meaningful names in /proc/interrupts · de99f53d
      Tudor Laurentiu 提交于
      Rename the irq controller associated with a MSI
      interrupt to fsl-msi-<V>, where <V> is the virq
      of the cascade irq backing up this MSI interrupt.
      This way, one can set the affinity of a MSI
      through the cascade irq associated with said MSI
      interrupt.
      Given this example /proc/interrupts snippet:
      
                 CPU0       CPU1       CPU2       CPU3
       16:          0          0          0          0   OpenPIC    16 Edge      mpic-error-int
       17:          0          4          0          0  fsl-msi-224   0 Edge      eth0-rx-0
       18:          0          5          0          0  fsl-msi-225   1 Edge      eth0-tx-0
       19:          0          2          0          0  fsl-msi-226   2 Edge      eth0
       [...]
      224:          0         11          0          0   OpenPIC   224 Edge      fsl-msi-cascade
      225:          0          0          0          0   OpenPIC   225 Edge      fsl-msi-cascade
      226:          0          0          0          0   OpenPIC   226 Edge      fsl-msi-cascade
       [...]
      
      To change the affinity of MSI interrupt 17
      (having the irq controller named "fsl-msi-224")
      instead of writing /proc/irq/17/smp_affinity, use
      the associated MSI cascade irq, in this case,
      interrupt 224, e.g.:
      
         echo 6 > /proc/irq/224/smp_affinity
      
      Note that a MSI cascade irq covers several MSI
      interrupts, so changing the affinity on the
      cascade will impact all of the associated MSI
      interrupts.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      de99f53d
    • T
      powerpc/fsl_msi: change the irq handler from chained to normal · 543c043c
      Tudor Laurentiu 提交于
      As we do for other fsl-mpic related cascaded irqchips
      (e.g. error ints, mpic timers), use a normal irq handler
      for msi irqs too.
      This brings some advantages such as mask/unmask/ack/eoi
      and irq state taken care behind the scenes, kstats
      updates a.s.o plus access to features provided by mpic,
      such as affinity.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      543c043c
    • T
      powerpc/fsl_msi: reorganize structs to improve clarity and flexibility · 83495231
      Tudor Laurentiu 提交于
      Store cascade_data in an array inside the driver
      data for later use.
      Get rid of the msi_virq array since now we can
      encapsulate the virqs in the cascade_data
      directly and access them through the array
      mentioned earlier.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      83495231
  8. 04 9月, 2014 2 次提交
    • A
      powerpc: fsl_pci: Add forced PCI Agent enumeration · 00406e87
      Aaron Sierra 提交于
      The following commit prevents the MPC8548E on the XPedite5200 PrPMC
      module from enumerating its PCI/PCI-X bus:
      
          powerpc/fsl-pci: use 'Header Type' to identify PCIE mode
      
      The previous patch prevents any Freescale PCI-X bridge from enumerating
      the bus, if it is hardware strapped into Agent mode.
      
      In PCI-X, the Host is responsible for driving the PCI-X initialization
      pattern to devices on the bus, so that they know whether to operate in
      conventional PCI or PCI-X mode as well as what the bus timing will be.
      For a PCI-X PrPMC, the pattern is driven by the mezzanine carrier it is
      installed onto. Therefore, PrPMCs are PCI-X Agents, but one per system
      may still enumerate the bus.
      
      This patch causes the device node of any PCI/PCI-X bridge strapped into
      Agent mode to be checked for the fsl,pci-agent-force-enum property. If
      the property is present in the node, the bridge will be allowed to
      enumerate the bus.
      
      Cc: Minghuan Lian <Minghuan.Lian@freescale.com>
      Signed-off-by: NAaron Sierra <asierra@xes-inc.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      00406e87
    • T
      powerpc/fsl_msi: support vmpic msi with mpic 4.3 · 67e35c3a
      Tudor Laurentiu 提交于
      The new MSI block in MPIC 4.3 added the MSIIR1 register,
      with a different layout, in order to support 16 MSIR
      registers. The msi binding was also updated so that
      the "reg" reflects the newly introduced MSIIR1 register.
      Virtual machines advertise these msi nodes by using the
      compatible "fsl,vmpic-msi-v4.3" so add support for it.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      67e35c3a
  9. 27 8月, 2014 2 次提交
    • T
      Revert "powerpc: Replace __get_cpu_var uses" · 23f66e2d
      Tejun Heo 提交于
      This reverts commit 5828f666 due to
      build failure after merging with pending powerpc changes.
      
      Link: http://lkml.kernel.org/g/20140827142243.6277eaff@canb.auug.org.auSigned-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      23f66e2d
    • C
      powerpc: Replace __get_cpu_var uses · 5828f666
      Christoph Lameter 提交于
      __get_cpu_var() is used for multiple purposes in the kernel source. One of
      them is address calculation via the form &__get_cpu_var(x).  This calculates
      the address for the instance of the percpu variable of the current processor
      based on an offset.
      
      Other use cases are for storing and retrieving data from the current
      processors percpu area.  __get_cpu_var() can be used as an lvalue when
      writing data or on the right side of an assignment.
      
      __get_cpu_var() is defined as :
      
      #define __get_cpu_var(var) (*this_cpu_ptr(&(var)))
      
      __get_cpu_var() always only does an address determination. However, store
      and retrieve operations could use a segment prefix (or global register on
      other platforms) to avoid the address calculation.
      
      this_cpu_write() and this_cpu_read() can directly take an offset into a
      percpu area and use optimized assembly code to read and write per cpu
      variables.
      
      This patch converts __get_cpu_var into either an explicit address
      calculation using this_cpu_ptr() or into a use of this_cpu operations that
      use the offset.  Thereby address calculations are avoided and less registers
      are used when code is generated.
      
      At the end of the patch set all uses of __get_cpu_var have been removed so
      the macro is removed too.
      
      The patch set includes passes over all arches as well. Once these operations
      are used throughout then specialized macros can be defined in non -x86
      arches as well in order to optimize per cpu access by f.e.  using a global
      register that may be set to the per cpu base.
      
      Transformations done to __get_cpu_var()
      
      1. Determine the address of the percpu instance of the current processor.
      
      	DEFINE_PER_CPU(int, y);
      	int *x = &__get_cpu_var(y);
      
          Converts to
      
      	int *x = this_cpu_ptr(&y);
      
      2. Same as #1 but this time an array structure is involved.
      
      	DEFINE_PER_CPU(int, y[20]);
      	int *x = __get_cpu_var(y);
      
          Converts to
      
      	int *x = this_cpu_ptr(y);
      
      3. Retrieve the content of the current processors instance of a per cpu
      variable.
      
      	DEFINE_PER_CPU(int, y);
      	int x = __get_cpu_var(y)
      
         Converts to
      
      	int x = __this_cpu_read(y);
      
      4. Retrieve the content of a percpu struct
      
      	DEFINE_PER_CPU(struct mystruct, y);
      	struct mystruct x = __get_cpu_var(y);
      
         Converts to
      
      	memcpy(&x, this_cpu_ptr(&y), sizeof(x));
      
      5. Assignment to a per cpu variable
      
      	DEFINE_PER_CPU(int, y)
      	__get_cpu_var(y) = x;
      
         Converts to
      
      	__this_cpu_write(y, x);
      
      6. Increment/Decrement etc of a per cpu variable
      
      	DEFINE_PER_CPU(int, y);
      	__get_cpu_var(y)++
      
         Converts to
      
      	__this_cpu_inc(y)
      
      tj: Folded a fix patch.
          http://lkml.kernel.org/g/alpine.DEB.2.11.1408172143020.9652@gentwo.org
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      5828f666
  10. 30 7月, 2014 2 次提交
  11. 26 6月, 2014 1 次提交
    • S
      powerpc/8xx: Remove empty asm/mpc8xx.h · 087dfae3
      Scott Wood 提交于
      m8xx_pcmcia_ops was the only thing in this file (other than a comment
      that describes a usage that doesn't match the file's contents); now
      that m8xx_pcmcia_ops is gone, remove the empty file.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Cc: Pantelis Antoniou <pantelis.antoniou@gmail.com>
      Cc: Vitaly Bordug <vitb@kernel.crashing.org>
      Cc: netdev@vger.kernel.org
      087dfae3
  12. 24 6月, 2014 1 次提交
  13. 11 6月, 2014 1 次提交
  14. 23 5月, 2014 5 次提交
  15. 10 5月, 2014 1 次提交
    • S
      powerpc/fsl-rio: Fix fsl_rio_setup error paths and use-after-unmap · a614db9a
      Scott Wood 提交于
      Several of the error paths from fsl_rio_setup are missing error
      messages.
      
      Worse, fsl_rio_setup initializes several global pointers and does not
      NULL them out after freeing/unmapping on error.  This caused
      fsl_rio_mcheck_exception() to crash when accessing rio_regs_win which
      was non-NULL but had been unmapped.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Cc: Liu Gang <Gang.Liu@freescale.com>
      ---
      Liu Gang, are you sure all of these error conditions are fatal?  Why
      does the rio driver fail if rmu is not present (e.g.  on t4240)?
      a614db9a
  16. 01 5月, 2014 2 次提交
  17. 28 4月, 2014 1 次提交
    • A
      powerpc/4xx: Fix section mismatch in ppc4xx_pci.c · e4565362
      Alistair Popple 提交于
      This patch fixes this section mismatch:
      
      WARNING: vmlinux.o(.text+0x1efc4): Section mismatch in reference from
      the function apm821xx_pciex_init_port_hw() to the function
      .init.text:ppc4xx_pciex_wait_on_sdr.isra.9()
      
      The function apm821xx_pciex_init_port_hw() references the function
      __init ppc4xx_pciex_wait_on_sdr.isra.9().  This is often because
      apm821xx_pciex_init_port_hw lacks a __init annotation or the
      annotation of ppc4xx_pciex_wait_on_sdr.isra.9 is wrong.
      
      apm821xx_pciex_init_port_hw is only referenced by a struct in
      __initdata, so it should be safe to add __init to
      apm821xx_pciex_init_port_hw.
      Signed-off-by: NAlistair Popple <alistair@popple.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e4565362
  18. 09 4月, 2014 1 次提交
    • L
      powerpc: Use of_node_init() for the fakenode in msi_bitmap.c · e47ff70a
      Li Zhong 提交于
      This patch uses of_node_init() to initialize the kobject in the fake
      node used in test_of_node(), to avoid following kobject warning.
      
      [    0.897654] kobject: '(null)' (c0000007ca183a08): is not initialized, yet kobject_put() is being called.
      [    0.897682] ------------[ cut here ]------------
      [    0.897688] WARNING: at lib/kobject.c:670
      [    0.897692] Modules linked in:
      [    0.897701] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 3.14.0+ #1
      [    0.897708] task: c0000007ca100000 ti: c0000007ca180000 task.ti: c0000007ca180000
      [    0.897715] NIP: c00000000046a1f0 LR: c00000000046a1ec CTR: 0000000001704660
      [    0.897721] REGS: c0000007ca1835c0 TRAP: 0700   Not tainted  (3.14.0+)
      [    0.897727] MSR: 8000000000029032 <SF,EE,ME,IR,DR,RI>  CR: 28000024  XER: 0000000d
      [    0.897749] CFAR: c0000000008ef4ec SOFTE: 1
      GPR00: c00000000046a1ec c0000007ca183840 c0000000014c59b8 000000000000005c
      GPR04: 0000000000000001 c000000000129770 0000000000000000 0000000000000001
      GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000003fef
      GPR12: 0000000000000000 c00000000f221200 c00000000000c350 0000000000000000
      GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      GPR24: 0000000000000000 c00000000144e808 c000000000c56f20 00000000000000d8
      GPR28: c000000000cd5058 0000000000000000 c000000001454ca8 c0000007ca183a08
      [    0.897856] NIP [c00000000046a1f0] .kobject_put+0xa0/0xb0
      [    0.897863] LR [c00000000046a1ec] .kobject_put+0x9c/0xb0
      [    0.897868] Call Trace:
      [    0.897874] [c0000007ca183840] [c00000000046a1ec] .kobject_put+0x9c/0xb0 (unreliable)
      [    0.897885] [c0000007ca1838c0] [c000000000743f9c] .of_node_put+0x2c/0x50
      [    0.897894] [c0000007ca183940] [c000000000c83954] .test_of_node+0x1dc/0x208
      [    0.897902] [c0000007ca183b80] [c000000000c839a4] .msi_bitmap_selftest+0x24/0x38
      [    0.897913] [c0000007ca183bf0] [c00000000000bb34] .do_one_initcall+0x144/0x200
      [    0.897922] [c0000007ca183ce0] [c000000000c748e4] .kernel_init_freeable+0x2b4/0x394
      [    0.897931] [c0000007ca183db0] [c00000000000c374] .kernel_init+0x24/0x130
      [    0.897940] [c0000007ca183e30] [c00000000000a2f4] .ret_from_kernel_thread+0x5c/0x68
      [    0.897947] Instruction dump:
      [    0.897952] 7fe3fb78 38210080 e8010010 ebe1fff8 7c0803a6 4800014c e89f0000 3c62ff6e
      [    0.897971] 7fe5fb78 3863a950 48485279 60000000 <0fe00000> 39000000 393f0038 4bffff80
      [    0.897992] ---[ end trace 1eeffdb9f825a556 ]---
      Signed-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e47ff70a
  19. 08 4月, 2014 1 次提交
    • A
      rapidio: rework device hierarchy and introduce mport class of devices · 2aaf308b
      Alexandre Bounine 提交于
      This patch removes an artificial RapidIO bus root device and establishes
      actual device hierarchy by providing reference to real parent devices.
      It also introduces device class for RapidIO controller devices (on-chip
      or an eternal bridge, known as "mport").
      
      Existing implementation was sufficient for SoC-based platforms that have
      a single RapidIO controller.  With introduction of devices using
      multiple RapidIO controllers and PCIe-to-RapidIO bridges the old scheme
      is very limiting or does not work at all.  The implemented changes allow
      to properly reference platform's local RapidIO mport devices and provide
      device details needed for upper layers.
      
      This change to RapidIO device hierarchy does not break any known
      existing kernel or user space interfaces.
      Signed-off-by: NAlexandre Bounine <alexandre.bounine@idt.com>
      Cc: Matt Porter <mporter@kernel.crashing.org>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
      Cc: Stef van Os <stef.van.os@prodrive-technologies.com>
      Cc: Jerry Jacobs <jerry.jacobs@prodrive-technologies.com>
      Cc: Arno Tiemersma <arno.tiemersma@prodrive-technologies.com>
      Cc: Rob Landley <rob@landley.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2aaf308b
  20. 20 3月, 2014 2 次提交
    • W
      fsl/pci: The new pci suspend/resume implementation · 48b16180
      Wang Dongsheng 提交于
      If we do nothing in suspend/resume, some platform PCIe ip-block
      can't guarantee the link back to L0 state from sleep, then, when
      we read the EP device will hang. Only we send pme turnoff message
      in pci controller suspend, and send pme exit message in resume, the
      link state will be normal.
      
      When we send pme turnoff message in pci controller suspend, the
      links will into l2/l3 ready, then, host cannot communicate with
      ep device, but pci-driver will call back EP device to save them
      state. So we need to change platform_driver->suspend/resume to
      syscore->suspend/resume.
      
      So the new suspend/resume implementation, send pme turnoff message
      in suspend, and send pme exit message in resume. And add a PME handler,
      to response PME & message interrupt.
      
      Change platform_driver->suspend/resume to syscore->suspend/resume.
      pci-driver will call back EP device, to save EP state in
      pci_pm_suspend_noirq, so we need to keep the link, until
      pci_pm_suspend_noirq finish.
      Signed-off-by: NWang Dongsheng <dongsheng.wang@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      48b16180
    • M
      powerpc/pci: Fix IMMRBAR address · a424b97b
      Minghuan Lian 提交于
      For PEXCSRBAR, bit 3-0 indicate prefetchable and address type.
      So when getting base address, these bits should be masked,
      otherwise we may get incorrect base address.
      Signed-off-by: NMinghuan Lian <Minghuan.Lian@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      a424b97b
  21. 12 3月, 2014 1 次提交
    • G
      of: Make device nodes kobjects so they show up in sysfs · 75b57ecf
      Grant Likely 提交于
      Device tree nodes are already treated as objects, and we already want to
      expose them to userspace which is done using the /proc filesystem today.
      Right now the kernel has to do a lot of work to keep the /proc view in
      sync with the in-kernel representation. If device_nodes are switched to
      be kobjects then the device tree code can be a whole lot simpler. It
      also turns out that switching to using /sysfs from /proc results in
      smaller code and data size, and the userspace ABI won't change if
      /proc/device-tree symlinks to /sys/firmware/devicetree/base.
      
      v7: Add missing sysfs_bin_attr_init()
      v6: Add __of_add_property() early init fixes from Pantelis
      v5: Rename firmware/ofw to firmware/devicetree
          Fix updating property values in sysfs
      v4: Fixed build error on Powerpc
          Fixed handling of dynamic nodes on powerpc
      v3: Fixed handling of duplicate attribute and child node names
      v2: switch to using sysfs bin_attributes which solve the problem of
          reporting incorrect property size.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NSascha Hauer <s.hauer@pengutronix.de>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
      75b57ecf
  22. 05 3月, 2014 1 次提交
    • T
      powerpc:eVh_pic: Kill irq_desc abuse · c866cda4
      Thomas Gleixner 提交于
      I'm really grumpy about this one. The line:
      
      #include "../../../kernel/irq/settings.h"
      
      should have been an alarm sign for all people who added their SOB to
      this trainwreck.
      
      When I cleaned up the mess people made with interrupt descriptors a
      few years ago, I warned that I'm going to hunt down new offenders and
      treat them with stinking trouts. In this case I'll use frozen shark
      for a better educational value.
      
      The whole idiocy which was done there could have been avoided with two
      lines of perfectly fine code. And do not complain about the lack of
      correct examples in tree.
      
      The solution is simple:
      
        Remove the brainfart and use the proper functions, which should
        have been used in the first place
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ashish Kalra <ashish.kalra@freescale.com>
      Cc: Timur Tabi <timur@freescale.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: ppc <linuxppc-dev@lists.ozlabs.org>
      Link: http://lkml.kernel.org/r/20140223212736.451970660@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      c866cda4
  23. 19 2月, 2014 1 次提交
  24. 11 2月, 2014 1 次提交
    • P
      powerpc: Fix build failure in sysdev/mpic.c for MPIC_WEIRD=y · 0215b4aa
      Paul Gortmaker 提交于
      Commit 446f6d06 ("powerpc/mpic: Properly
      set default triggers") breaks the mpc7447_hpc_defconfig as follows:
      
        CC      arch/powerpc/sysdev/mpic.o
      arch/powerpc/sysdev/mpic.c: In function 'mpic_set_irq_type':
      arch/powerpc/sysdev/mpic.c:886:9: error: case label does not reduce to an integer constant
      arch/powerpc/sysdev/mpic.c:890:9: error: case label does not reduce to an integer constant
      arch/powerpc/sysdev/mpic.c:894:9: error: case label does not reduce to an integer constant
      arch/powerpc/sysdev/mpic.c:898:9: error: case label does not reduce to an integer constant
      
      Looking at the cpp output (gcc 4.7.3), I see:
      
         case mpic->hw_set[MPIC_IDX_VECPRI_SENSE_EDGE] |
              mpic->hw_set[MPIC_IDX_VECPRI_POLARITY_POSITIVE]:
      
      The pointer into an array appears because CONFIG_MPIC_WEIRD=y is set
      for this platform, thus enabling the following:
      
        -------------------
        #ifdef CONFIG_MPIC_WEIRD
        static u32 mpic_infos[][MPIC_IDX_END] = {
              [0] = { /* Original OpenPIC compatible MPIC */
      
        [...]
      
        #define MPIC_INFO(name) mpic->hw_set[MPIC_IDX_##name]
      
        #else /* CONFIG_MPIC_WEIRD */
      
        #define MPIC_INFO(name) MPIC_##name
      
        #endif /* CONFIG_MPIC_WEIRD */
        -------------------
      
      Here we convert the case section to if/else if, and also add
      the equivalent of a default case to warn about unknown types.
      Boot tested on sbc8548, build tested on all defconfigs.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0215b4aa