Skip to content
  1. May 28, 2014
    • Nishanth Aravamudan's avatar
      powerpc/numa: Enable CONFIG_HAVE_MEMORYLESS_NODES · 64bb80d8
      Nishanth Aravamudan authored
      
      
      Based off fd1197f1 for ia64, enable CONFIG_HAVE_MEMORYLESS_NODES if
      NUMA. Initialize the local memory node in start_secondary.
      
      With this commit and the preceding to enable
      CONFIG_USER_PERCPU_NUMA_NODE_ID, which is a prerequisite, in a PowerKVM
      guest with the following topology:
      
      numactl --hardware
      available: 3 nodes (0-2)
      node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
      23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
      47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
      71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
      95 96 97 98 99
      node 0 size: 1998 MB
      node 0 free: 521 MB
      node 1 cpus: 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
      115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
      133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
      151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
      169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
      187 188 189 190 191 192 193 194 195 196 197 198 199
      node 1 size: 0 MB
      node 1 free: 0 MB
      node 2 cpus:
      node 2 size: 2039 MB
      node 2 free: 1739 MB
      node distances:
      node   0   1   2
        0:  10  40  40
        1:  40  10  40
        2:  40  40  10
      
      the unreclaimable slab is reduced by close to 130M:
      
      Before:
              Slab:             418176 kB
              SReclaimable:      26624 kB
              SUnreclaim:       391552 kB
      
      After:
              Slab:             298944 kB
              SReclaimable:      31744 kB
              SUnreclaim:       267200 kB
      
      Signed-off-by: default avatarNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      64bb80d8
    • Nishanth Aravamudan's avatar
      powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID · 8c272261
      Nishanth Aravamudan authored
      
      
      Based off 3bccd996 for ia64, convert powerpc to use the generic per-CPU
      topology tracking, specifically:
      
          initialize per cpu numa_node entry in start_secondary
          remove the powerpc cpu_to_node()
          define CONFIG_USE_PERCPU_NUMA_NODE_ID if NUMA
      
      Signed-off-by: default avatarNishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8c272261
    • Srivatsa S. Bhat's avatar
      powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode · 011e4b02
      Srivatsa S. Bhat authored
      
      
      If we try to perform a kexec when the machine is in ST (Single-Threaded) mode
      (ppc64_cpu --smt=off), the kexec operation doesn't succeed properly, and we
      get the following messages during boot:
      
      [    0.089866] POWER8 performance monitor hardware support registered
      [    0.089985] power8-pmu: PMAO restore workaround active.
      [    5.095419] Processor 1 is stuck.
      [   10.097933] Processor 2 is stuck.
      [   15.100480] Processor 3 is stuck.
      [   20.102982] Processor 4 is stuck.
      [   25.105489] Processor 5 is stuck.
      [   30.108005] Processor 6 is stuck.
      [   35.110518] Processor 7 is stuck.
      [   40.113369] Processor 9 is stuck.
      [   45.115879] Processor 10 is stuck.
      [   50.118389] Processor 11 is stuck.
      [   55.120904] Processor 12 is stuck.
      [   60.123425] Processor 13 is stuck.
      [   65.125970] Processor 14 is stuck.
      [   70.128495] Processor 15 is stuck.
      [   75.131316] Processor 17 is stuck.
      
      Note that only the sibling threads are stuck, while the primary threads (0, 8,
      16 etc) boot just fine. Looking closer at the previous step of kexec, we observe
      that kexec tries to wakeup (bring online) the sibling threads of all the cores,
      before performing kexec:
      
      [ 9464.131231] Starting new kernel
      [ 9464.148507] kexec: Waking offline cpu 1.
      [ 9464.148552] kexec: Waking offline cpu 2.
      [ 9464.148600] kexec: Waking offline cpu 3.
      [ 9464.148636] kexec: Waking offline cpu 4.
      [ 9464.148671] kexec: Waking offline cpu 5.
      [ 9464.148708] kexec: Waking offline cpu 6.
      [ 9464.148743] kexec: Waking offline cpu 7.
      [ 9464.148779] kexec: Waking offline cpu 9.
      [ 9464.148815] kexec: Waking offline cpu 10.
      [ 9464.148851] kexec: Waking offline cpu 11.
      [ 9464.148887] kexec: Waking offline cpu 12.
      [ 9464.148922] kexec: Waking offline cpu 13.
      [ 9464.148958] kexec: Waking offline cpu 14.
      [ 9464.148994] kexec: Waking offline cpu 15.
      [ 9464.149030] kexec: Waking offline cpu 17.
      
      Instrumenting this piece of code revealed that the cpu_up() operation actually
      fails with -EBUSY. Thus, only the primary threads of all the cores are online
      during kexec, and hence this is a sure-shot receipe for disaster, as explained
      in commit e8e5c215 (powerpc/kexec: Fix orphaned offline CPUs across kexec),
      as well as in the comment above wake_offline_cpus().
      
      It turns out that cpu_up() was returning -EBUSY because the variable
      'cpu_hotplug_disabled' was set to 1; and this disabling of CPU hotplug was done
      by migrate_to_reboot_cpu() inside kernel_kexec().
      
      Now, migrate_to_reboot_cpu() was originally written with the assumption that
      any further code will not need to perform CPU hotplug, since we are anyway in
      the reboot path. However, kexec is clearly not such a case, since we depend on
      onlining CPUs, atleast on powerpc.
      
      So re-enable cpu-hotplug after returning from migrate_to_reboot_cpu() in the
      kexec path, to fix this regression in kexec on powerpc.
      
      Also, wrap the cpu_up() in powerpc kexec code within a WARN_ON(), so that we
      can catch such issues more easily in the future.
      
      Fixes: c97102ba (kexec: migrate to reboot cpu)
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      011e4b02
    • Guenter Roeck's avatar
      powerpc: Fix 64 bit builds with binutils 2.24 · 7998eb3d
      Guenter Roeck authored
      
      
      With binutils 2.24, various 64 bit builds fail with relocation errors
      such as
      
      arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
      	(.text+0x165ee): relocation truncated to fit: R_PPC64_ADDR16_HI
      	against symbol `interrupt_base_book3e' defined in .text section
      	in arch/powerpc/kernel/built-in.o
      arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
      	(.text+0x16602): relocation truncated to fit: R_PPC64_ADDR16_HI
      	against symbol `interrupt_end_book3e' defined in .text section
      	in arch/powerpc/kernel/built-in.o
      
      The assembler maintainer says:
      
       I changed the ABI, something that had to be done but unfortunately
       happens to break the booke kernel code.  When building up a 64-bit
       value with lis, ori, shl, oris, ori or similar sequences, you now
       should use @high and @higha in place of @h and @ha.  @h and @ha
       (and their associated relocs R_PPC64_ADDR16_HI and R_PPC64_ADDR16_HA)
       now report overflow if the value is out of 32-bit signed range.
       ie. @h and @ha assume you're building a 32-bit value. This is needed
       to report out-of-range -mcmodel=medium toc pointer offsets in @toc@h
       and @toc@ha expressions, and for consistency I did the same for all
       other @h and @ha relocs.
      
      Replacing @h with @high in one strategic location fixes the relocation
      errors. This has to be done conditionally since the assembler either
      supports @h or @high but not both.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7998eb3d
  2. May 22, 2014
    • Scott Wood's avatar
      powerpc/fsl: Add fsl,portid-mapping to corenet1-cf chips · e83eb028
      Scott Wood authored
      
      
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Cc: Diana Craciun <diana.craciun@freescale.com>
      e83eb028
    • Alexander Graf's avatar
      PPC: ePAPR: Fix hypercall on LE guest · 8cb59788
      Alexander Graf authored
      
      
      We get an array of instructions from the hypervisor via device tree that
      we write into a buffer that gets executed whenever we want to make an
      ePAPR compliant hypercall.
      
      However, the hypervisor passes us these instructions in BE order which
      we have to manually convert to LE when we want to run them in LE mode.
      
      With this fixup in place, I can successfully run LE kernels with KVM
      PV enabled on PR KVM.
      
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      8cb59788
    • harninder rai's avatar
      powerpc/mpc85xx: Add BSC9132 QDS Support · 1be62c6c
      harninder rai authored
      
      
      - BSC9132 is an integrated device that targets Femto base station market.
        It combines Power Architecture e500v2 and DSP StarCore SC3850 technologies
        with MAPLE-B2F baseband acceleration processing elements
      
      - BSC9132QDS Overview
           2Gbyte DDR3 (on board DDR)
           32Mbyte 16bit NOR flash
           128Mbyte 2K page size NAND Flash
           256 Kbit M24256 I2C EEPROM
           128 Mbit SPI Flash memory
           SD slot
           eTSEC1: Connected to SGMII PHY
           eTSEC2: Connected to SGMII PHY
           DUART interface: supports one UARTs up to 115200 bps for console display
      
      Signed-off-by: default avatarHarninder Rai <harninder.rai@freescale.com>
      Signed-off-by: default avatarRuchika Gupta <ruchika.gupta@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      1be62c6c
    • Lijun Pan's avatar
      powerpc/mpc85xx: Remove P1023 RDS support · fd7e5b7a
      Lijun Pan authored
      
      
      P1023RDS is no longer supported/manufactured by Freescale while P1023RDB is.
      
      Signed-off-by: default avatarLijun Pan <Lijun.Pan@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      fd7e5b7a
    • Scott Wood's avatar
      powerpc/mpic: Don't init the fsl error int until after mpic init · aa80581d
      Scott Wood authored
      
      
      Besides other potential problems, if MPIC_NO_RESET is  not set,
      the error interrupt will be masked after it is requested.
      
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      aa80581d
    • Prabhakar Kushwaha's avatar
      powerpc/fsl-booke: Add initial T104x_QDS board support · 0c0fc4d3
      Prabhakar Kushwaha authored
      
      
      Add support for T104x board in board file t104x_qds.c, It is common for
       both T1040 and T1042 as they share same QDS board.
      
       T1040QDS board Overview
       -----------------------
       - SERDES Connections, 8 lanes supporting:
            — PCI Express: supporting Gen 1 and Gen 2;
            — SGMII
            — QSGMII
            — SATA 2.0
            — Aurora debug with dedicated connectors (T1040 only)
       - DDR Controller
           - Supports rates of up to 1600 MHz data-rate
           - Supports one DDR3LP UDIMM/RDIMMs, of single-, dual- or quad-rank types.
       -IFC/Local Bus
           - NAND flash: 8-bit, async, up to 2GB.
           - NOR: 8-bit or 16-bit, non-multiplexed, up to 512MB
           - GASIC: Simple (minimal) target within Qixis FPGA
           - PromJET rapid memory download support
       - Ethernet
           - Two on-board RGMII 10/100/1G ethernet ports.
           - PHY #0 remains powered up during deep-sleep (T1040 only)
       - QIXIS System Logic FPGA
       - Clocks
           - System and DDR clock (SYSCLK, “DDRCLK”)
           - SERDES clocks
       - Power Supplies
       - Video
           - DIU supports video at up to 1280x1024x32bpp
       - USB
           - Supports two USB 2.0 ports with integrated PHYs
           — Two type A ports with 5V@1.5A per port.
           — Second port can be converted to OTG mini-AB
       - SDHC
           - SDHC port connects directly to an adapter card slot, featuring:
           - Supporting SD slots for: SD, SDHC (1x, 4x, 8x) and/or MMC
           — Supporting eMMC memory devices
       - SPI
          -  On-board support of 3 different devices and sizes
       - Other IO
          - Two Serial ports
          - ProfiBus port
          - Four I2C ports
      
      Add T104xQDS support in Kconfig and Makefile. Also create device tree.
      Following features are currently not implmented.
        - SerDes: Aurora
        - IFC: GASIC, Promjet
        - QIXIS
        - Ethernet
        - DIU
        - power supplies management
        - ProfiBus
      
      Signed-off-by: default avatarPriyanka Jain <Priyanka.Jain@freescale.com>
      Signed-off-by: default avatarPoonam Aggrwal <poonam.aggrwal@freescale.com>
      Signed-off-by: default avatarPrabhakar Kushwaha <prabhakar@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      0c0fc4d3
    • Prabhakar Kushwaha's avatar
      powerpc/mpc85xx:Add initial device tree support of T104x · fb734eee
      Prabhakar Kushwaha authored
      
      
      The QorIQ T1040/T1042 processor support four integrated 64-bit e5500 PA
      processor cores with high-performance data path acceleration architecture
      and network peripheral interfaces required for networking & telecommunications.
      
      T1042 personality is a reduced personality of T1040 without Integrated 8-port
      Gigabit Ethernet switch.
      
      The T1040/T1042 SoC includes the following function and features:
      
       - Four e5500 cores, each with a private 256 KB L2 cache
       - 256 KB shared L3 CoreNet platform cache (CPC)
       - Interconnect CoreNet platform
       - 32-/64-bit DDR3L/DDR4 SDRAM memory controller with ECC and interleaving
         support
       - Data Path Acceleration Architecture (DPAA) incorporating acceleration
       for the following functions:
          -  Packet parsing, classification, and distribution
          -  Queue management for scheduling, packet sequencing, and congestion
          	management
          -  Cryptography Acceleration (SEC 5.0)
          - RegEx Pattern Matching Acceleration (PME 2.2)
          - IEEE Std 1588 support
          - Hardware buffer management for buffer allocation and deallocation
       - Ethernet interfaces
          - Integrated 8-port Gigabit Ethernet switch (T1040 only)
          - Four 1 Gbps Ethernet controllers
       - Two RGMII interfaces or one RGMII and one MII interfaces
       - High speed peripheral interfaces
         - Four PCI Express 2.0 controllers running at up to 5 GHz
         - Two SATA controllers supporting 1.5 and 3.0 Gb/s operation
         - Upto two QSGMII interface
         - Upto six SGMII interface supporting 1000 Mbps
         - One SGMII interface supporting upto 2500 Mbps
       - Additional peripheral interfaces
         - Two USB 2.0 controllers with integrated PHY
         - SD/eSDHC/eMMC
         -  eSPI controller
         - Four I2C controllers
         - Four UARTs
         - Four GPIO controllers
         - Integrated flash controller (IFC)
         - Change this to  LCD/ HDMI interface (DIU) with 12 bit dual data rate
         - TDM interface
       - Multicore programmable interrupt controller (PIC)
       - Two 8-channel DMA engines
       - Single source clocking implementation
       - Deep Sleep power implementaion (wakeup from GPIO/Timer/Ethernet/USB)
      
      Signed-off-by: default avatarPoonam Aggrwal <poonam.aggrwal@freescale.com>
      Signed-off-by: default avatarPriyanka Jain <Priyanka.Jain@freescale.com>
      Signed-off-by: default avatarVarun Sethi <Varun.Sethi@freescale.com>
      Signed-off-by: default avatarPrabhakar Kushwaha <prabhakar@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      fb734eee
    • Diana Craciun's avatar
      powerpc/fsl: Updated corenet-cf compatible string for corenet1-cf chips · 846c9443
      Diana Craciun authored
      
      
      Updated the device trees according to the corenet-cf
      binding definition.
      
      Signed-off-by: default avatarDiana Craciun <Diana.Craciun@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      846c9443
    • Diana Craciun's avatar
      powerpc/fsl: Updated device trees for platforms with corenet version 2 · f2e7bfbb
      Diana Craciun authored
      
      
      Updated the device trees according to the corenet-cf
      binding definition.
      
      Signed-off-by: default avatarDiana Craciun <Diana.Craciun@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      f2e7bfbb
    • Scott Wood's avatar
      powerpc: Fix unused variable warning for epapr_has_idle · 8067bd8a
      Scott Wood authored
      
      
      This warning can be seen in allyesconfig, and was introduced by commit
      f9eb581c63b2acce827570e105205c0789360650 "powerpc: fix build of
      epapr_paravirt on 64-bit book3s".
      
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      8067bd8a
    • Scott Wood's avatar
      powerpc: fix build of epapr_paravirt on 64-bit book3s · 440d74d1
      Scott Wood authored
      
      
      This fixes an allyesconfig build break introduced by commit
      7762b1ed7aaee223230793fcee80672e2e3aa7a8 "powerpc: move epapr paravirt
      init of power_save to an initcall".
      
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Cc: Stuart Yoder <stuart.yoder@freescale.com>
      440d74d1
    • Stuart Yoder's avatar
      powerpc: move epapr paravirt init of power_save to an initcall · 83e267d7
      Stuart Yoder authored
      
      
      some restructuring of epapr paravirt init resulted in
      ppc_md.power_save being set, and then overwritten to
      NULL during machine_init.  This patch splits the
      initialization of ppc_md.power_save out into a postcore
      init call.
      
      Signed-off-by: default avatarStuart Yoder <stuart.yoder@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      83e267d7
    • Martijn de Gouw's avatar
      powerpc/85xx: Add OCA4080 board support · 2b09c603
      Martijn de Gouw authored
      
      
      OCA4080 overview:
      - 1.466 GHz Freescale QorIQ P4080E Processor
      - 4Gbyte DDR3 on board
      - 8Mbyte Nor flash
      - Serial RapidIO 1.2
      - 1 x 10/100/1000 BASE-T front ethernet
      - 1 x 1000 BASE-BX ethernet on AMC connector
      
      Signed-off-by: default avatarMartijn de Gouw <martijn.de.gouw@prodrive.nl>
      [scottwood@freescale.com: minor conflict-related changes]
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      2b09c603
    • Valentin Longchamp's avatar
      powerpc/mpc85xx: add support for Keymile's kmcoge4 board · 497c8b60
      Valentin Longchamp authored
      
      
      This patch introduces the support for Keymile's kmcoge4 board which is
      the internal reference design for boards based on Freescale's
      P2040/P2041 SoCs. This internal reference design is named kmp204x.
      
      The peripherals used on this board are:
      - SPI NOR Flash as bootloader medium
      - NAND Flash with a ubi partition
      - 2 PCIe busses (hosts 1 and 3)
      - 3 FMAN Ethernet devices (FMAN1 DTSEC1/2/5)
      - 4 Local Bus windows, with one dedicated to the QRIO reset/power mgmt
        CPLD
      - 2 I2C busses
      - last but not least, the mandatory serial port
      
      The patch also adds a defconfig file for this reference design that is
      necessary because of the lowmem option that must be set higher due to
      the number of PCIe devices with big ioremapped mem ranges on the boad.
      
      Signed-off-by: default avatarValentin Longchamp <valentin.longchamp@keymile.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      497c8b60
    • Wang Dongsheng's avatar
      fsl/pci: fix RC cannot detect PME message coming · dd41d514
      Wang Dongsheng authored
      
      
      PCI controller disable PME message report feature, that shouldn't
      have happened. Fix it and enable PME message report feature.
      
      Signed-off-by: default avatarWang Dongsheng <dongsheng.wang@freescale.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      dd41d514
    • Liu Gang's avatar
      powerpc/rmu: Fix the error memory free parameters · 1c075f95
      Liu Gang authored
      
      
      There are error parameters should be corrected when
      calling dma_free_coherent to free rmu rx-ring buffers
      in fsl_open_inb_mbox() function.
      
      Signed-off-by: default avatarLiu Gang <Gang.Liu@freescale.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      1c075f95
    • Scott Wood's avatar
      powerpc/fsl-booke64: Set vmemmap_psize to 4K · e57eeae4
      Scott Wood authored
      
      
      The only way Freescale booke chips support mappings larger than 4K
      is via TLB1.  The only way we support (direct) TLB1 entries is via
      hugetlb, which is not what map_kernel_page() does when given a large
      page size.
      
      Without this, a kernel with CONFIG_SPARSEMEM_VMEMMAP enabled crashes on
      boot with messages such as:
      
      PID hash table entries: 4096 (order: 3, 32768 bytes)
      Sorting __ex_table...
      BUG: Bad page state in process swapper  pfn:00a2f
      page:8000040000023a48 count:0 mapcount:0 mapping:0000040000ffce48 index:0x40000ffbe50
      page flags: 0x40000ffda40(active|arch_1|private|private_2|head|tail|swapcache|mappedtodisk|reclaim|swapbacked|unevictable|mlocked)
      page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
      bad because of flags:
      page flags: 0x311840(active|private|private_2|swapcache|unevictable|mlocked)
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper Not tainted 3.15.0-rc1-00003-g7fa250c #299
      Call Trace:
      [c00000000098ba20] [c000000000008b3c] .show_stack+0x7c/0x1cc (unreliable)
      [c00000000098baf0] [c00000000060aa50] .dump_stack+0x88/0xb4
      [c00000000098bb70] [c0000000000c0468] .bad_page+0x144/0x1a0
      [c00000000098bc10] [c0000000000c0628] .free_pages_prepare+0x164/0x17c
      [c00000000098bcc0] [c0000000000c24cc] .free_hot_cold_page+0x48/0x214
      [c00000000098bd60] [c00000000086c318] .free_all_bootmem+0x1fc/0x354
      [c00000000098be70] [c00000000085da84] .mem_init+0xac/0xdc
      [c00000000098bef0] [c0000000008547b0] .start_kernel+0x21c/0x4d4
      [c00000000098bf90] [c000000000000448] .start_here_common+0x20/0x58
      
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      e57eeae4
  3. May 20, 2014
  4. May 12, 2014
    • Anton Blanchard's avatar
      powerpc: irq work racing with timer interrupt can result in timer interrupt hang · 8050936c
      Anton Blanchard authored
      
      
      I am seeing an issue where a CPU running perf eventually hangs.
      Traces show timer interrupts happening every 4 seconds even
      when a userspace task is running on the CPU. /proc/timer_list
      also shows pending hrtimers have not run in over an hour,
      including the scheduler.
      
      Looking closer, decrementers_next_tb is getting set to
      0xffffffffffffffff, and at that point we will never take
      a timer interrupt again.
      
      In __timer_interrupt() we set decrementers_next_tb to
      0xffffffffffffffff and rely on ->event_handler to update it:
      
              *next_tb = ~(u64)0;
              if (evt->event_handler)
                      evt->event_handler(evt);
      
      In this case ->event_handler is hrtimer_interrupt. This will eventually
      call back through the clockevents code with the next event to be
      programmed:
      
      static int decrementer_set_next_event(unsigned long evt,
                                            struct clock_event_device *dev)
      {
              /* Don't adjust the decrementer if some irq work is pending */
              if (test_irq_work_pending())
                      return 0;
              __get_cpu_var(decrementers_next_tb) = get_tb_or_rtc() + evt;
      
      If irq work came in between these two points, we will return
      before updating decrementers_next_tb and we never process a timer
      interrupt again.
      
      This looks to have been introduced by 0215f7d8 (powerpc: Fix races
      with irq_work). Fix it by removing the early exit and relying on
      code later on in the function to force an early decrementer:
      
             /* We may have raced with new irq work */
             if (test_irq_work_pending())
                     set_dec(1);
      
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Cc: stable@vger.kernel.org # 3.14+
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8050936c
    • Gavin Shan's avatar
      powerpc/powernv: Reset root port in firmware · 372cf124
      Gavin Shan authored
      
      
      Resetting root port has more stuff to do than that for PCIe switch
      ports and we should have resetting root port done in firmware instead
      of the kernel itself. The problem was introduced by commit 5b2e198e
      ("powerpc/powernv: Rework EEH reset").
      
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      372cf124
  5. May 09, 2014
    • Scott Wood's avatar
      powerpc/fsl-rio: Fix fsl_rio_setup error paths and use-after-unmap · a614db9a
      Scott Wood authored
      
      
      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: default avatarScott 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
  6. Apr 30, 2014
  7. Apr 28, 2014
    • Michael Neuling's avatar
      powerpc/tm: Add checking to treclaim/trechkpt · 7f06f21d
      Michael Neuling authored
      
      
      If we do a treclaim and we are not in TM suspend mode, it results in a TM bad
      thing (ie. a 0x700 program check).  Similarly if we do a trechkpt and we have
      an active transaction or TEXASR Failure Summary (FS) is not set, we also take a
      TM bad thing.
      
      This should never happen, but if it does (ie. a kernel bug), the cause is
      almost impossible to debug as the GPR state is mostly userspace and hence we
      don't get a call chain.
      
      This adds some checks in these cases case a BUG_ON() (in asm) in case we ever
      hit these cases.  It moves the register saving around to preserve r1 till later
      also.
      
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7f06f21d
Loading