1. 15 10月, 2015 3 次提交
    • M
      powerpc/pseries: Move PCI objects to obj-y · 44f2aecf
      Michael Ellerman 提交于
      Make it entirely clear in the Makefile that we always build the pci
      related files by moving them to obj-y.
      
      Note that CONFIG_EEH is now always enabled on pseries, because it
      depends on PSERIES && PCI.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      44f2aecf
    • M
      powerpc/pseries: Remove use of CONFIG_PCI · 84eb9e61
      Michael Ellerman 提交于
      Now that we always have CONFIG_PCI=y for pseries, we can stop guarding
      code with CONFIG_PCI ifdefs.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      84eb9e61
    • M
      powerpc/pseries: Make PCI non-optional · 4c9cd468
      Michael Ellerman 提交于
      The pseries build with PCI=n looks to have been broken for at least 5
      years, and no one's noticed or cared.
      
      Following the obvious breakages backward, the first commit I can find
      that builds is the parent of 2eb4afb6 ("powerpc/pci: Move pseries
      code into pseries platform specific area") from April 2009.
      
      A distro would never ship a PCI=n kernel, so it is only useful for folks
      building custom kernels. Also on KVM the virtio devices appear on PCI,
      so it would only be useful if you were building kernels specifically to
      run on PowerVM and with no PCI devices.
      
      The added code complexity, and testing load (which we've clearly not
      been doing), is not justified by the small reduction in kernel size for
      such a niche use case.
      
      So just make PCI non-optional on pseries.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      4c9cd468
  2. 09 10月, 2015 1 次提交
  3. 06 10月, 2015 1 次提交
  4. 05 10月, 2015 5 次提交
  5. 29 9月, 2015 1 次提交
    • B
      powerpc: Kconfig: remove BE-only platforms from LE kernel build · e5e16d8f
      Boqun Feng 提交于
      Currently, little endian is only supported on powernv and pseries,
      however, Kconfigs still allow us to include other platforms in a LE
      kernel, this may result in space wasting or even build error if some
      BE-only platforms always assume they are built for a BE kernel. So just
      modify the Kconfigs of BE-only platforms to remove them from being built
      for a LE kernel.
      
      For 32bit only platforms, nothing needs to be done, because
      CPU_LITTLE_ENDIAN depends on PPC64. For 64bit supported platforms, add
      CPU_BIG_ENDIAN to dependencies explicitly, so that these platforms will
      be disabled for LE [Suggested-by: Cédric Le Goater <clg@fr.ibm.com>].
      Signed-off-by: NBoqun Feng <boqun.feng@gmail.com>
      Acked-by: NGeoff Levand <geoff@infradead.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e5e16d8f
  6. 16 9月, 2015 2 次提交
    • T
      genirq: Remove irq argument from irq flow handlers · bd0b9ac4
      Thomas Gleixner 提交于
      Most interrupt flow handlers do not use the irq argument. Those few
      which use it can retrieve the irq number from the irq descriptor.
      
      Remove the argument.
      
      Search and replace was done with coccinelle and some extra helper
      scripts around it. Thanks to Julia for her help!
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      bd0b9ac4
    • T
      powerpc/mpc52xx: Use irq_set_handler_locked() · 6b83bd94
      Thomas Gleixner 提交于
      Use irq_set_handler_locked() as it avoids a redundant lookup of the
      irq descriptor.
      
      Search and replacement was done with coccinelle:
      
      @@
      struct irq_data *d;
      expression E1;
      @@
      
      -__irq_set_handler_locked(d->irq, E1);
      +irq_set_handler_locked(d, E1);
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Julia Lawall <julia.lawall@lip6.fr>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: linuxppc-dev@lists.ozlabs.org
      6b83bd94
  7. 14 9月, 2015 3 次提交
    • T
      powerpc/cell: Prepare irq handler for irq argument removal · 391de7f9
      Thomas Gleixner 提交于
      The irq argument of most interrupt flow handlers is unused or merily
      used instead of a local variable. The handlers which need the irq
      argument can retrieve the irq number from the irq descriptor.
          
      Search and update was done with coccinelle and the invaluable help of
      Julia Lawall.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: linuxppc-dev@lists.ozlabs.org
      391de7f9
    • T
      powerpc/85xx: Prepare irq handlers for irq argument removal · 0a0dbd92
      Thomas Gleixner 提交于
      The irq argument of most interrupt flow handlers is unused or merily
      used instead of a local variable. The handlers which need the irq
      argument can retrieve the irq number from the irq descriptor.
          
      Search and update was done with coccinelle and the invaluable help of
      Julia Lawall.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      0a0dbd92
    • T
      powerpc/mpc5121_ads_cpld: Prepare irq handler for irq argument removal · 5aac2d33
      Thomas Gleixner 提交于
      The irq argument of most interrupt flow handlers is unused or merily
      used instead of a local variable. The handlers which need the irq
      argument can retrieve the irq number from the irq descriptor.
          
      Search and update was done with coccinelle and the invaluable help of
      Julia Lawall.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: linuxppc-dev@lists.ozlabs.org
      5aac2d33
  8. 10 9月, 2015 1 次提交
    • P
      powerpc/MSI: Fix race condition in tearing down MSI interrupts · e297c939
      Paul Mackerras 提交于
      This fixes a race which can result in the same virtual IRQ number
      being assigned to two different MSI interrupts.  The most visible
      consequence of that is usually a warning and stack trace from the
      sysfs code about an attempt to create a duplicate entry in sysfs.
      
      The race happens when one CPU (say CPU 0) is disposing of an MSI
      while another CPU (say CPU 1) is setting up an MSI.  CPU 0 calls
      (for example) pnv_teardown_msi_irqs(), which calls
      msi_bitmap_free_hwirqs() to indicate that the MSI (i.e. its
      hardware IRQ number) is no longer in use.  Then, before CPU 0 gets
      to calling irq_dispose_mapping() to free up the virtal IRQ number,
      CPU 1 comes in and calls msi_bitmap_alloc_hwirqs() to allocate an
      MSI, and gets the same hardware IRQ number that CPU 0 just freed.
      CPU 1 then calls irq_create_mapping() to get a virtual IRQ number,
      which sees that there is currently a mapping for that hardware IRQ
      number and returns the corresponding virtual IRQ number (which is
      the same virtual IRQ number that CPU 0 was using).  CPU 0 then
      calls irq_dispose_mapping() and frees that virtual IRQ number.
      Now, if another CPU comes along and calls irq_create_mapping(), it
      is likely to get the virtual IRQ number that was just freed,
      resulting in the same virtual IRQ number apparently being used for
      two different hardware interrupts.
      
      To fix this race, we just move the call to msi_bitmap_free_hwirqs()
      to after the call to irq_dispose_mapping().  Since virq_to_hw()
      doesn't work for the virtual IRQ number after irq_dispose_mapping()
      has been called, we need to call it before irq_dispose_mapping() and
      remember the result for the msi_bitmap_free_hwirqs() call.
      
      The pattern of calling msi_bitmap_free_hwirqs() before
      irq_dispose_mapping() appears in 5 places under arch/powerpc, and
      appears to have originated in commit 05af7bd2 ("[POWERPC] MPIC
      U3/U4 MSI backend") from 2007.
      
      Fixes: 05af7bd2 ("[POWERPC] MPIC U3/U4 MSI backend")
      Cc: stable@vger.kernel.org # v2.6.22+
      Reported-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e297c939
  9. 09 9月, 2015 1 次提交
    • V
      mm: rename alloc_pages_exact_node() to __alloc_pages_node() · 96db800f
      Vlastimil Babka 提交于
      alloc_pages_exact_node() was introduced in commit 6484eb3e ("page
      allocator: do not check NUMA node ID when the caller knows the node is
      valid") as an optimized variant of alloc_pages_node(), that doesn't
      fallback to current node for nid == NUMA_NO_NODE.  Unfortunately the
      name of the function can easily suggest that the allocation is
      restricted to the given node and fails otherwise.  In truth, the node is
      only preferred, unless __GFP_THISNODE is passed among the gfp flags.
      
      The misleading name has lead to mistakes in the past, see for example
      commits 5265047a ("mm, thp: really limit transparent hugepage
      allocation to local node") and b360edb4 ("mm, mempolicy:
      migrate_to_node should only migrate to node").
      
      Another issue with the name is that there's a family of
      alloc_pages_exact*() functions where 'exact' means exact size (instead
      of page order), which leads to more confusion.
      
      To prevent further mistakes, this patch effectively renames
      alloc_pages_exact_node() to __alloc_pages_node() to better convey that
      it's an optimized variant of alloc_pages_node() not intended for general
      usage.  Both functions get described in comments.
      
      It has been also considered to really provide a convenience function for
      allocations restricted to a node, but the major opinion seems to be that
      __GFP_THISNODE already provides that functionality and we shouldn't
      duplicate the API needlessly.  The number of users would be small
      anyway.
      
      Existing callers of alloc_pages_exact_node() are simply converted to
      call __alloc_pages_node(), with the exception of sba_alloc_coherent()
      which open-codes the check for NUMA_NO_NODE, so it is converted to use
      alloc_pages_node() instead.  This means it no longer performs some
      VM_BUG_ON checks, and since the current check for nid in
      alloc_pages_node() uses a 'nid < 0' comparison (which includes
      NUMA_NO_NODE), it may hide wrong values which would be previously
      exposed.
      
      Both differences will be rectified by the next patch.
      
      To sum up, this patch makes no functional changes, except temporarily
      hiding potentially buggy callers.  Restricting the checks in
      alloc_pages_node() is left for the next patch which can in turn expose
      more existing buggy callers.
      Signed-off-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: NRobin Holt <robinmholt@gmail.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NChristoph Lameter <cl@linux.com>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Cliff Whickman <cpw@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96db800f
  10. 08 9月, 2015 1 次提交
  11. 07 9月, 2015 2 次提交
    • N
      powerpc/powernv/pci-ioda: fix kdump with non-power-of-2 crashkernel= · fa144869
      Nishanth Aravamudan 提交于
      The 32-bit TCE table initialization relies on the DMA window having a
      size equal to a power of 2 (and checks for it explicitly). But
      crashkernel= has no constraint that requires a power-of-2 be specified.
      This causes the kdump kernel to fail to boot as none of the PCI devices
      (including the disk controller) are successfully initialized.
      
      After this change, the PCI devices successfully set up the 32-bit TCE
      table and kdump succeeds.
      
      Fixes: aca6913f ("powerpc/powernv/ioda2: Introduce helpers to allocate TCE pages")
      Signed-off-by: NNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org # 4.2
      Tested-by: NJan Stancek <jstancek@redhat.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      fa144869
    • N
      powerpc/powernv/pci-ioda: fix 32-bit TCE table init in kdump kernel · bb005455
      Nishanth Aravamudan 提交于
      When attempting to kdump with the 4.2 kernel, we see for each PCI
      device:
      
       pci 0003:01     : [PE# 000] Assign DMA32 space
       pci 0003:01     : [PE# 000] Setting up 32-bit TCE table at 0..80000000
       pci 0003:01     : [PE# 000] Failed to create 32-bit TCE table, err -22
       PCI: Domain 0004 has 8 available 32-bit DMA segments
       PCI: 4 PE# for a total weight of 70
       pci 0004:01     : [PE# 002] Assign DMA32 space
       pci 0004:01     : [PE# 002] Setting up 32-bit TCE table at 0..80000000
       pci 0004:01     : [PE# 002] Failed to create 32-bit TCE table, err -22
       pci 0004:0d     : [PE# 005] Assign DMA32 space
       pci 0004:0d     : [PE# 005] Setting up 32-bit TCE table at 0..80000000
       pci 0004:0d     : [PE# 005] Failed to create 32-bit TCE table, err -22
       pci 0004:0e     : [PE# 006] Assign DMA32 space
       pci 0004:0e     : [PE# 006] Setting up 32-bit TCE table at 0..80000000
       pci 0004:0e     : [PE# 006] Failed to create 32-bit TCE table, err -22
       pci 0004:10     : [PE# 008] Assign DMA32 space
       pci 0004:10     : [PE# 008] Setting up 32-bit TCE table at 0..80000000
       pci 0004:10     : [PE# 008] Failed to create 32-bit TCE table, err -22
      
      and eventually the kdump kernel fails to boot as none of the PCI devices
      (including the disk controller) are successfully initialized.
      
      The EINVAL response is because the DMA window (the 2GB base window) is
      larger than the kdump kernel's reserved memory (crashkernel=, in this
      case specified to be 1024M). The check in question,
      
       if ((window_size > memory_hotplug_max()) || !is_power_of_2(window_size))
      
      is a valid sanity check for pnv_pci_ioda2_table_alloc_pages(), so adjust
      the caller to pass in a smaller window size if our maximum memory value
      is smaller than the DMA window.
      
      After this change, the PCI devices successfully set up the 32-bit TCE
      table and kdump succeeds.
      
      The problem was seen on a Firestone machine originally.
      
      Fixes: aca6913f ("powerpc/powernv/ioda2: Introduce helpers to allocate TCE pages")
      Cc: stable@vger.kernel.org # 4.2
      Signed-off-by: NNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      [mpe: Coding style pedantry, use u64, change the indentation]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      bb005455
  12. 28 8月, 2015 2 次提交
    • G
      powerpc/pseries: Cleanup on pci_dn_reconfig_notifier() · ea0f8acf
      Gavin Shan 提交于
      This applies cleanup on pci_dn_reconfig_notifier(), no functional
      changes:
      
         * Rename variable "pci" to "pdn" to indicate its purpose clearly.
         * The parent node can be released at any time. So it should be
           hold with of_get_parent() before accessing it.
         * The device node doesn't have to have parent node in theory.
           More check on this.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ea0f8acf
    • G
      powerpc/pseries: Fix corrupted pdn list · 590c7567
      Gavin Shan 提交于
      Commit cca87d30 ("powerpc/pci: Refactor pci_dn") introduced pdn
      list for SRIOV VFs. It means the pdn is be put into the child list
      of its parent pdn when the pdn is created. When doing PCI hot
      unplugging on pSeries, the PCI device node as well as its pdn are
      released through procfs entry "powerpc/ofdt". Some one else grabs
      the memory chunk of the pdn and update it accordingly. At the same
      time, the pdn is still tracked in the child list of parent pdn. It
      leads to corrupted child list in the parent pdn.
      
      This fixes above issue by removing the pdn from the child list of
      its parent pdn when the device node is detached from the system.
      Note the pdn is free'd when the device node is released if the
      device node is dynamic one. Otherwise, the device node as well
      as the pdn won't be released.
      
      Fixes: cca87d30 ("powerpc/pci: Refactor pci_dn")
      Cc: stable@vger.kernel.org # 4.1+
      Reported-by: NSantwana Samantray <santwana.samantray@in.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      590c7567
  13. 27 8月, 2015 1 次提交
  14. 20 8月, 2015 4 次提交
  15. 19 8月, 2015 1 次提交
    • G
      powerpc/512x: silence a USB Kconfig dependency warning · acf6cec8
      Gerhard Sittig 提交于
      the PPC_MPC512x config automatically selected USB_EHCI_BIG_ENDIAN_*
      switches, which made Kconfig warn about "unmet direct dependencies":
      
        scripts/kconfig/conf --silentoldconfig Kconfig
        warning: (PPC_MPC512x && 440EPX) selects USB_EHCI_BIG_ENDIAN_DESC which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
        warning: (PPC_MPC512x && PPC_PS3 && PPC_CELLEB && 440EPX) selects USB_EHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
        warning: (PPC_MPC512x && 440EPX) selects USB_EHCI_BIG_ENDIAN_DESC which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
        warning: (PPC_MPC512x && PPC_PS3 && PPC_CELLEB && 440EPX) selects USB_EHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
      
      make the selected entries additionally depend on USB_EHCI_HCD which
      silences the warning
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      acf6cec8
  16. 18 8月, 2015 5 次提交
  17. 14 8月, 2015 1 次提交
  18. 06 8月, 2015 4 次提交
  19. 30 7月, 2015 1 次提交