1. 22 10月, 2015 1 次提交
  2. 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
  3. 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
  4. 27 8月, 2015 1 次提交
  5. 20 8月, 2015 4 次提交
  6. 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
  7. 18 8月, 2015 5 次提交
  8. 14 8月, 2015 1 次提交
  9. 06 8月, 2015 4 次提交
  10. 30 7月, 2015 2 次提交
    • A
      powerpc/eeh-powernv: Fix unbalanced IRQ warning · b8d65e96
      Alistair Popple 提交于
      pnv_eeh_next_error() re-enables the eeh opal event interrupt but it
      gets called from a loop if there are more outstanding events to
      process, resulting in a warning due to enabling an already enabled
      interrupt. Instead the interrupt should only be re-enabled once the
      last outstanding event has been processed.
      Tested-by: NDaniel Axtens <dja@axtens.net>
      Reported-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NAlistair Popple <alistair@popple.id.au>
      Acked-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b8d65e96
    • M
      genirq/irqdomain: Allow irq domain aliasing · ad3aedfb
      Marc Zyngier 提交于
      It is not uncommon (at least with the ARM stuff) to have a piece
      of hardware that implements different flavours of "interrupts".
      A typical example of this is the GICv3 ITS, which implements
      standard PCI/MSI support, but also some form of "generic MSI".
      
      So far, the PCI/MSI domain is registered using the ITS device_node,
      so that irq_find_host can return it. On the contrary, the raw MSI
      domain is not registered with an device_node, making it impossible
      to be looked up by another subsystem (obviously, using the same
      device_node twice would only result in confusion, as it is not
      defined which one irq_find_host would return).
      
      A solution to this is to "type" domains that may be aliasing, and
      to be able to lookup an device_node that matches a given type.
      For this, we introduce irq_find_matching_host() as a superset
      of irq_find_host:
      
      struct irq_domain *irq_find_matching_host(struct device_node *node,
                                      enum irq_domain_bus_token bus_token);
      
      where bus_token is the "type" we want to match the domain against
      (so far, only DOMAIN_BUS_ANY is defined). This result in some
      moderately invasive changes on the PPC side (which is the only
      user of the .match method).
      
      This has otherwise no functionnal change.
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: <linux-arm-kernel@lists.infradead.org>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Ma Jun <majun258@huawei.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Duc Dang <dhdang@apm.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/1438091186-10244-2-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      ad3aedfb
  11. 23 7月, 2015 4 次提交
    • A
      powerpc/powernv/ioda2: Fix calculation for memory allocated for TCE table · 3ba3a73e
      Alexey Kardashevskiy 提交于
      The existing code stores the amount of memory allocated for a TCE table.
      At the moment it uses @offset which is a virtual offset in the TCE table
      which is only correct for a one level tables and it does not include
      memory allocated for intermediate levels. When multilevel TCE table is
      requested, WARN_ON in tce_iommu_create_table() prints a warning.
      
      This adds an additional counter to pnv_pci_ioda2_table_do_alloc_pages()
      to count actually allocated memory.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      3ba3a73e
    • P
      powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_* · 01c9348c
      Paul Mackerras 提交于
      The hardware RNG on POWER8 and POWER7+ can be relatively slow, since
      it can only supply one 64-bit value per microsecond.  Currently we
      read it in arch_get_random_long(), but that slows down reading from
      /dev/urandom since the code in random.c calls arch_get_random_long()
      for every longword read from /dev/urandom.
      
      Since the hardware RNG supplies high-quality entropy on every read, it
      matches the semantics of arch_get_random_seed_long() better than those
      of arch_get_random_long().  Therefore this commit makes the code use
      the POWER8/7+ hardware RNG only for arch_get_random_seed_{long,int}
      and not for arch_get_random_{long,int}.
      
      This won't affect any other PowerPC-based platforms because none of
      them currently support a hardware RNG.  To make it clear that the
      ppc_md function pointer is used for arch_get_random_seed_*, we rename
      it from get_random_long to get_random_seed.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      01c9348c
    • T
      powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers · 1c2cb594
      Thomas Huth 提交于
      The EPOW interrupt handler uses rtas_get_sensor(), which in turn
      uses rtas_busy_delay() to wait for RTAS becoming ready in case it
      is necessary. But rtas_busy_delay() is annotated with might_sleep()
      and thus may not be used by interrupts handlers like the EPOW handler!
      This leads to the following BUG when CONFIG_DEBUG_ATOMIC_SLEEP is
      enabled:
      
       BUG: sleeping function called from invalid context at arch/powerpc/kernel/rtas.c:496
       in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/1
       CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.2.0-rc2-thuth #6
       Call Trace:
       [c00000007ffe7b90] [c000000000807670] dump_stack+0xa0/0xdc (unreliable)
       [c00000007ffe7bc0] [c0000000000e1f14] ___might_sleep+0x134/0x180
       [c00000007ffe7c20] [c00000000002aec0] rtas_busy_delay+0x30/0xd0
       [c00000007ffe7c50] [c00000000002bde4] rtas_get_sensor+0x74/0xe0
       [c00000007ffe7ce0] [c000000000083264] ras_epow_interrupt+0x44/0x450
       [c00000007ffe7d90] [c000000000120260] handle_irq_event_percpu+0xa0/0x300
       [c00000007ffe7e70] [c000000000120524] handle_irq_event+0x64/0xc0
       [c00000007ffe7eb0] [c000000000124dbc] handle_fasteoi_irq+0xec/0x260
       [c00000007ffe7ef0] [c00000000011f4f0] generic_handle_irq+0x50/0x80
       [c00000007ffe7f20] [c000000000010f3c] __do_irq+0x8c/0x200
       [c00000007ffe7f90] [c0000000000236cc] call_do_irq+0x14/0x24
       [c00000007e6f39e0] [c000000000011144] do_IRQ+0x94/0x110
       [c00000007e6f3a30] [c000000000002594] hardware_interrupt_common+0x114/0x180
      
      Fix this issue by introducing a new rtas_get_sensor_fast() function
      that does not use rtas_busy_delay() - and thus can only be used for
      sensors that do not cause a BUSY condition - known as "fast" sensors.
      
      The EPOW sensor is defined to be "fast" in sPAPR - mpe.
      
      Fixes: 587f83e8 ("powerpc/pseries: Use rtas_get_sensor in RAS code")
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      1c2cb594
    • J
      powerpc/PCI: Use for_pci_msi_entry() to access MSI device list · 2921d179
      Jiang Liu 提交于
      Use accessor for_each_pci_msi_entry() to access MSI device list, so we
      could easily move msi_list from struct pci_dev into struct device
      later.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Stuart Yoder <stuart.yoder@freescale.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
      Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Wei Yang <weiyang@linux.vnet.ibm.com>
      Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Cc: Alexander Gordeev <agordeev@redhat.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Laurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Tudor Laurentiu <b10716@freescale.com>
      Cc: Hongtao Jia <hongtao.jia@freescale.com>
      Link: http://lkml.kernel.org/r/1436428847-8886-4-git-send-email-jiang.liu@linux.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      2921d179
  12. 21 7月, 2015 3 次提交
  13. 16 7月, 2015 1 次提交
  14. 13 7月, 2015 7 次提交
  15. 06 7月, 2015 2 次提交
  16. 24 6月, 2015 1 次提交