linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Gavin Shan <gwshan@linux.vnet.ibm.com>, linuxppc-dev@ozlabs.org
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>,
	fbarrat@linux.vnet.ibm.com, andonnel@au1.ibm.com
Subject: Re: powerpc/powernv: Fix crash on releasing compound PE
Date: Thu,  8 Sep 2016 19:47:53 +1000 (AEST)	[thread overview]
Message-ID: <3sVFr91zSvz9s8x@ozlabs.org> (raw)
In-Reply-To: <1473135404-32631-1-git-send-email-gwshan@linux.vnet.ibm.com>

On Tue, 2016-06-09 at 04:16:44 UTC, Gavin Shan wrote:
> The compound PE is created to accommodate the devices attached to
> one specific PCI bus that consume multiple M64 segments. The compound
> PE is made up of one master PE and possibly multiple slave PEs. The
> slave PEs should be destroyed when releasing the master PE. A kernel
> crash happens when derferencing @pe->pdev on releasing the slave PE
> in pnv_ioda_deconfigure_pe().
> 
>   # echo 0 > /sys/bus/pci/slots/C7/power
>   iommu: Removing device 0000:01:00.1 from group 0
>   iommu: Removing device 0000:01:00.0 from group 0
>   Unable to handle kernel paging request for data at address 0x00000010
>   Faulting instruction address: 0xc00000000005d898
>   cpu 0x1: Vector: 300 (Data Access) at [c000000fe8217620]
>       pc: c00000000005d898: pnv_ioda_release_pe+0x288/0x610
>       lr: c00000000005dbdc: pnv_ioda_release_pe+0x5cc/0x610
>       sp: c000000fe82178a0
>      msr: 9000000000009033
>      dar: 10
>    dsisr: 40000000
>     current = 0xc000000fe815ab80
>     paca    = 0xc00000000ff00400	 softe: 0	 irq_happened: 0x01
>       pid   = 2709, comm = sh
>   Linux version 4.8.0-rc5-gavin-00006-g745efdb (gwshan@gwshan) \
>   (gcc version 4.9.3 (Buildroot 2016.02-rc2-00093-g5ea3bce) ) #586 SMP \
>   Tue Sep 6 13:37:29 AEST 2016
>   enter ? for help
>   [c000000fe8217940] c00000000005d684 pnv_ioda_release_pe+0x74/0x610
>   [c000000fe82179e0] c000000000034460 pcibios_release_device+0x50/0x70
>   [c000000fe8217a10] c0000000004aba80 pci_release_dev+0x50/0xa0
>   [c000000fe8217a40] c000000000704898 device_release+0x58/0xf0
>   [c000000fe8217ac0] c000000000470510 kobject_release+0x80/0xf0
>   [c000000fe8217b00] c000000000704dd4 put_device+0x24/0x40
>   [c000000fe8217b20] c0000000004af94c pci_remove_bus_device+0x12c/0x150
>   [c000000fe8217b60] c000000000034244 pci_hp_remove_devices+0x94/0xd0
>   [c000000fe8217ba0] c0000000004ca444 pnv_php_disable_slot+0x64/0xb0
>   [c000000fe8217bd0] c0000000004c88c0 power_write_file+0xa0/0x190
>   [c000000fe8217c50] c0000000004c248c pci_slot_attr_store+0x3c/0x60
>   [c000000fe8217c70] c0000000002d6494 sysfs_kf_write+0x94/0xc0
>   [c000000fe8217cb0] c0000000002d50f0 kernfs_fop_write+0x180/0x260
>   [c000000fe8217d00] c0000000002334a0 __vfs_write+0x40/0x190
>   [c000000fe8217d90] c000000000234738 vfs_write+0xc8/0x240
>   [c000000fe8217de0] c000000000236250 SyS_write+0x60/0x110
>   [c000000fe8217e30] c000000000009524 system_call+0x38/0x108
> 
> It fixes the kernel crash by bypassing releasing resources (DMA,
> IO and memory segments, PELTM) because there are no resources assigned
> to the slave PE.
> 
> Fixes: c5f7700bbd2e ("powerpc/powernv: Dynamically release PE")
> Reported-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/b314427a52fd8daa1215d30e56

cheers

      reply	other threads:[~2016-09-08  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06  4:16 [PATCH] powerpc/powernv: Fix crash on releasing compound PE Gavin Shan
2016-09-08  9:47 ` Michael Ellerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3sVFr91zSvz9s8x@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=andonnel@au1.ibm.com \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).