1. 29 Apr, 2013 10 commits
    • Vasant Hegde's avatar
      powerpc/rtas_flash: Fix bad memory access · fb4696c3
      Vasant Hegde authored
      We use kmem_cache_alloc() to allocate memory to hold the new firmware
      which will be flashed. kmem_cache_alloc() calls rtas_block_ctor() to
      set memory to NULL. But these constructor is called only for newly
      allocated slabs.
      If we run below command multiple time without rebooting, allocator may
      allocate memory from the area which was free'd by kmem_cache_free and
      it will not call constructor. In this situation we may hit kernel oops.
      dd if=<fw image> of=/proc/ppc64/rtas/firmware_flash bs=4096
      oops message:
      [ 1602.399755] Oops: Kernel access of bad area, sig: 11 [#1]
      [ 1602.399772] SMP NR_CPUS=1024 NUMA pSeries
      [ 1602.399779] Modules linked in: rtas_flash nfsd lockd auth_rpcgss nfs_acl sunrpc fuse loop dm_mod sg ipv6 ses enclosure ehea ehci_pci ohci_hcd ehci_hcd usbcore sd_mod usb_common crc_t10dif scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw scsi_dh_rdac scsi_dh ipr libata scsi_mod
      [ 1602.399817] NIP: d00000000a170b9c LR: d00000000a170b64 CTR: c00000000079cd58
      [ 1602.399823] REGS: c0000003b9937930 TRAP: 0300   Not tainted  (3.9.0-rc4-0.27-ppc64)
      [ 1602.399828] MSR: 8000000000009032 <SF,EE,ME,IR,DR,RI>  CR: 22000428  XER: 20000000
      [ 1602.399841] SOFTE: 1
      [ 1602.399844] CFAR: c000000000005f24
      [ 1602.399848] DAR: 8c2625a820631fef, DSISR: 40000000
      [ 1602.399852] TASK = c0000003b4520760[3655] 'dd' THREAD: c0000003b9934000 CPU: 3
      GPR00: 8c2625a820631fe7 c0000003b9937bb0 d00000000a179f28 d00000000a171f08
      GPR04: 0000000010040000 0000000000001000 c0000003b9937df0 c0000003b5fb2080
      GPR08: c0000003b58f7200 d00000000a179f28 c0000003b40058d4 c00000000079cd58
      GPR12: d00000000a171450 c000000007f40900 0000000000000005 0000000010178d20
      GPR16: 00000000100cb9d8 000000000000001d 0000000000000000 000000001003ffff
      GPR20: 0000000000000001 0000000000000000 00003fffa0b50d30 000000001001f010
      GPR24: 0000000010020888 0000000010040000 d00000000a171f08 d00000000a172808
      GPR28: 0000000000001000 0000000010040000 c0000003b4005880 8c2625a820631fe7
      [ 1602.399924] NIP [d00000000a170b9c] .rtas_flash_write+0x7c/0x1e8 [rtas_flash]
      [ 1602.399930] LR [d00000000a170b64] .rtas_flash_write+0x44/0x1e8 [rtas_flash]
      [ 1602.399934] Call Trace:
      [ 1602.399939] [c0000003b9937bb0] [d00000000a170b64] .rtas_flash_write+0x44/0x1e8 [rtas_flash] (unreliable)
      [ 1602.399948] [c0000003b9937c60] [c000000000282830] .proc_reg_write+0x90/0xe0
      [ 1602.399955] [c0000003b9937ce0] [c0000000001ff374] .vfs_write+0x114/0x238
      [ 1602.399961] [c0000003b9937d80] [c0000000001ff5d8] .SyS_write+0x70/0xe8
      [ 1602.399968] [c0000003b9937e30] [c000000000009cdc] syscall_exit+0x0/0xa0
      [ 1602.399973] Instruction dump:
      [ 1602.399977] eb698010 801b0028 2f80dcd6 419e00a4 2fbc0000 419e009c ebfb0030 2fbf0000
      [ 1602.399989] 409e0010 480000d8 60000000 7c1f0378 <e81f0008> 2fa00000 409efff4 e81f0000
      [ 1602.400012] ---[ end trace b4136d115dc31dac ]---
      [ 1602.402178]
      [ 1602.402185] Sending IPI to other CPUs
      [ 1602.403329] IPI complete
      This patch uses kmem_cache_zalloc() instead of kmem_cache_alloc() to
      allocate memory, which makes sure memory is set to 0 before using.
      Also removes rtas_block_ctor(), which is no longer required.
      Signed-off-by: default avatarVasant Hegde <hegdevasant@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    • Stephen Rothwell's avatar
      powerpc: Fix build failure after merge of the cgroup tree · 9f3a90e8
      Stephen Rothwell authored
      After merging the cgroup tree, today's linux-next build (powerpc
      ppc64_defconfig) failed like this:
      arch/powerpc/mm/numa.c: In function 'arch_update_cpu_topology':
      arch/powerpc/mm/numa.c:1465:2: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration]
      arch/powerpc/mm/numa.c:1465:10: error: assignment makes pointer from integer without a cast [-Werror]
      arch/powerpc/mm/numa.c:1497:2: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]
      Caused by commit 30c05350 ("powerpc/pseries: Use stop machine to
      update cpu maps") from the powerpc tree interacting with (probably)
      commit ff794dea
       ("cpuset: remove include of cgroup.h from cpuset.h")
      from the cgroup tree.  Removing includes from header files is fraught
      with danger ...
      The former should have added an include of linux/slab.h to
      I have added the following merge fix patch for today (but it should be
      applied to the powerpc tree ASAP).
      From: Stephen Rothwell <sfr@canb.auug.org.au>
      Date: Mon, 29 Apr 2013 14:01:44 +1000
      Subject: [PATCH] powerpc: numa.c: using kzalloc/kfree requires including
      fixes these build errors:
      arch/powerpc/mm/numa.c: In function 'arch_update_cpu_topology':
      arch/powerpc/mm/numa.c:1465:2: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration]
      arch/powerpc/mm/numa.c:1465:10: error: assignment makes pointer from integer without a cast [-Werror]
      arch/powerpc/mm/numa.c:1497:2: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration]
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    • Michael Neuling's avatar
      powerpc: Fix usage of setup_pci_atmu() · d5bbe659
      Michael Neuling authored
      Linux next is currently failing to compile mpc85xx_defconfig with:
        arch/powerpc/sysdev/fsl_pci.c:944:2: error: too many arguments to function 'setup_pci_atmu'
      This is caused by (from Kumar's next branch):
        commit 34642bbb
        Author: Kumar Gala <galak@kernel.crashing.org>
        powerpc/fsl-pci: Keep PCI SoC controller registers in pci_controller
      Which changed definition of setup_pci_atmu() but didn't update one of
      the callers.  Below fixes this.
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Reviewed-by: default avatarKim Phillips <kim.phillips@freescale.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    • Benjamin Herrenschmidt's avatar
      Merge remote-tracking branch 'kumar/next' into next · bc23100a
      Benjamin Herrenschmidt authored
      From Kumar Gala:
      Add support for T4 and B4 SoC families from Freescale, e6500 altivec
      support, some various board fixes and other minor cleanups.
    • Benjamin Herrenschmidt's avatar
      Merge remote-tracking branch 'agust/next' into next · 28bf41a1
      Benjamin Herrenschmidt authored
      From Anatolij Gustschin:
      There are some changes for mpc5121 generic platform code
      to support mpc5125 SoC and DTS files for ac14xx and
      MPC5125-TWR boards.
    • Michel Lespinasse's avatar
      mm: use vm_unmapped_area() on powerpc architecture · fba2369e
      Michel Lespinasse authored
      Update the powerpc slice_get_unmapped_area function to make use of
      vm_unmapped_area() instead of implementing a brute force search.
      Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Tested-by: default avatar"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    • Michel Lespinasse's avatar
      mm: remove free_area_cache use in powerpc architecture · 34d07177
      Michel Lespinasse authored
      As all other architectures have been converted to use vm_unmapped_area(),
      we are about to retire the free_area_cache.
      This change simply removes the use of that cache in
      slice_get_unmapped_area(), which will most certainly have a
      performance cost. Next one will convert that function to use the
      vm_unmapped_area() infrastructure and regain the performance.
      Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
      Acked-by: default avatarRik van Riel <riel@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    • Kevin Hao's avatar
      powerpc/fsl-booke: add the reg prop for pci bridge device node for T4/B4 · 9e2ecdbb
      Kevin Hao authored
      The reg property in the pci bridge device node is used to bind this
      device node to the pci bridge device. Then all the pci devices under
      this bridge could use the interrupt maps defined in this device node
      to do the irq translation. So if this property is missed, the pci
      traditional irq mechanism will not work.
      Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
    • Kevin Hao's avatar
      powerpc/fsl-pci: don't unmap the PCI SoC controller registers in setup_pci_atmu · 04aa99cd
      Kevin Hao authored
      In patch 34642bbb
       (powerpc/fsl-pci: Keep PCI SoC controller registers in
      pci_controller) we choose to keep the map of the PCI SoC controller
      registers. But we missed to delete the unmap in setup_pci_atmu
      function. This will cause the following call trace once we access
      the PCI SoC controller registers later.
      Unable to handle kernel paging request for data at address 0x8000080080040f14
      Faulting instruction address: 0xc00000000002ea58
      Oops: Kernel access of bad area, sig: 11 [#1]
      SMP NR_CPUS=24 T4240 QDS
      Modules linked in:
      NIP: c00000000002ea58 LR: c00000000002eaf4 CTR: c00000000002eac0
      REGS: c00000017e10b4a0 TRAP: 0300   Not tainted  (3.9.0-rc1-00052-gfa3529f-dirty)
      MSR: 0000000080029000 <CE,EE,ME>  CR: 28adbe22  XER: 00000000
      SOFTE: 0
      DEAR: 8000080080040f14, ESR: 0000000000000000
      TASK = c00000017e100000[1] 'swapper/0' THREAD: c00000017e108000 CPU: 2
      GPR00: 0000000000000000 c00000017e10b720 c0000000009928d8 c00000017e578e00
      GPR04: 0000000000000000 000000000000000c 0000000000000001 c00000017e10bb40
      GPR08: 0000000000000000 8000080080040000 0000000000000000 0000000000000016
      GPR12: 0000000088adbe22 c00000000fffa800 c000000000001ba0 0000000000000000
      GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      GPR20: 0000000000000000 0000000000000000 0000000000000000 c0000000008a5b70
      GPR24: c0000000008af938 c0000000009a28d8 c0000000009bb5dc c00000017e10bb40
      GPR28: c00000017e32a400 c00000017e10bc00 c00000017e32a400 c00000017e578e00
      NIP [c00000000002ea58] .fsl_pcie_check_link+0x88/0xf0
      LR [c00000000002eaf4] .fsl_indirect_read_config+0x34/0xb0
      Call Trace:
      [c00000017e10b720] [c00000017e10b7a0] 0xc00000017e10b7a0 (unreliable)
      [c00000017e10ba30] [c00000000002eaf4] .fsl_indirect_read_config+0x34/0xb0
      [c00000017e10bad0] [c00000000033aa08] .pci_bus_read_config_byte+0x88/0xd0
      [c00000017e10bb90] [c00000000088d708] .pci_apply_final_quirks+0x9c/0x18c
      [c00000017e10bc40] [c0000000000013dc] .do_one_initcall+0x5c/0x1f0
      [c00000017e10bcf0] [c00000000086ebac] .kernel_init_freeable+0x180/0x26c
      [c00000017e10bdb0] [c000000000001bbc] .kernel_init+0x1c/0x460
      [c00000017e10be30] [c000000000000880] .ret_from_kernel_thread+0x64/0xe4
      Instruction dump:
      38210310 2b800015 4fdde842 7c600026 5463fffe e8010010 7c0803a6 4e800020
      60000000 60000000 e92301d0 7c0004ac <80690f14> 0c030000 4c00012c 38210310
      ---[ end trace 7a8fe0cbccb7d992 ]---
      Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
      Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
      Acked-by: default avatarRoy Zang <tie-fei.zang@freescale.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
    • Zhicheng Fan's avatar
      powerpc/dts: Fix the dts for p1025rdb 36bit · 9aa171fb
      Zhicheng Fan authored
      Fix the following errors:
      Error: p1025rdb.dtsi:326.2-3 label or path, 'qe', not found
      Error: p1021si-post.dtsi:242.2-3 label or path, 'qe', not found
      FATAL ERROR: Syntax error parsing input tree
      Signed-off-by: default avatarZhicheng Fan <B32736@freescale.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
  2. 26 Apr, 2013 30 commits