All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	alan@lxorguk.ukuu.org.uk, Alexey Kardashevskiy <aik@ozlabs.ru>,
	Gavin Shan <shangw@linux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [ 018/133] powerpc/eeh: Fix crash on converting OF node to edev
Date: Thu, 11 Oct 2012 07:50:44 +0900	[thread overview]
Message-ID: <20121010224857.729632794@linuxfoundation.org> (raw)
In-Reply-To: <20121010224854.313159132@linuxfoundation.org>

3.5-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gavin Shan <shangw@linux.vnet.ibm.com>

commit 1e38b7140185e384da216aff66a711df09b5afc9 upstream.

The kernel crash was reported by Alexy. He was testing some feature
with private kernel, in which Alexy added some code in pci_pm_reset()
to read the CSR after writting it. The bug could be reproduced on
Fiber Channel card (Fibre Channel: Emulex Corporation Saturn-X:
LightPulse Fibre Channel Host Adapter (rev 03)) by the following
commands.

	# echo 1 > /sys/devices/pci0004:01/0004:01:00.0/reset
	# rmmod lpfc
	# modprobe lpfc

The history behind the test case is that those additional config
space reading operations in pci_pm_reset() would cause EEH error,
but we didn't detect EEH error until "modprobe lpfc". For the case,
all the PCI devices on PCI bus (0004:01) were removed and added after
PE reset. Then the EEH devices would be figured out again based on
the OF nodes. Unfortunately, there were some child OF nodes under
PCI device (0004:01:00.0), but they didn't have attached PCI_DN since
they're invisible from PCI domain. However, we were still trying to
convert OF node to EEH device without checking on the attached PCI_DN.
Eventually, it caused the kernel crash as follows:

Unable to handle kernel paging request for data at address 0x00000030
Faulting instruction address: 0xc00000000004d888
cpu 0x0: Vector: 300 (Data Access) at [c000000fc797b950]
    pc: c00000000004d888: .eeh_add_device_tree_early+0x78/0x140
    lr: c00000000004d880: .eeh_add_device_tree_early+0x70/0x140
    sp: c000000fc797bbd0
   msr: 8000000000009032
   dar: 30
 dsisr: 40000000
  current = 0xc000000fc78d9f70
  paca    = 0xc00000000edb0000   softe: 0        irq_happened: 0x00
    pid   = 2951, comm = eehd
enter ? for help
[c000000fc797bc50] c00000000004d848 .eeh_add_device_tree_early+0x38/0x140
[c000000fc797bcd0] c00000000004d848 .eeh_add_device_tree_early+0x38/0x140
[c000000fc797bd50] c000000000051b54 .pcibios_add_pci_devices+0x34/0x190
[c000000fc797bde0] c00000000004fb10 .eeh_reset_device+0x100/0x160
[c000000fc797be70] c0000000000502dc .eeh_handle_event+0x19c/0x300
[c000000fc797bf00] c000000000050570 .eeh_event_handler+0x130/0x1a0
[c000000fc797bf90] c000000000020138 .kernel_thread+0x54/0x70

The patch changes of_node_to_eeh_dev() and just returns NULL if the
passed OF node doesn't have attached PCI_DN.

Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/include/asm/pci-bridge.h |    8 ++++++++
 arch/powerpc/platforms/pseries/eeh.c  |    2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -181,6 +181,14 @@ static inline int pci_device_from_OF_nod
 #if defined(CONFIG_EEH)
 static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn)
 {
+	/*
+	 * For those OF nodes whose parent isn't PCI bridge, they
+	 * don't have PCI_DN actually. So we have to skip them for
+	 * any EEH operations.
+	 */
+	if (!dn || !PCI_DN(dn))
+		return NULL;
+
 	return PCI_DN(dn)->edev;
 }
 #endif
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1029,7 +1029,7 @@ static void eeh_add_device_early(struct
 {
 	struct pci_controller *phb;
 
-	if (!dn || !of_node_to_eeh_dev(dn))
+	if (!of_node_to_eeh_dev(dn))
 		return;
 	phb = of_node_to_eeh_dev(dn)->phb;
 



  parent reply	other threads:[~2012-10-10 22:53 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-10 22:50 [ 000/133] 3.5.7-stable review Greg Kroah-Hartman
2012-10-10 22:50 ` [ 001/133] Revert dyndbg: fix for SOH in logging messages Greg Kroah-Hartman
2012-10-10 22:50 ` [ 002/133] mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it Greg Kroah-Hartman
2012-10-10 22:50 ` [ 003/133] kbuild: make: fix if_changed when command contains backslashes Greg Kroah-Hartman
2012-10-10 22:50 ` [ 004/133] kbuild: Fix gcc -x syntax Greg Kroah-Hartman
2012-10-10 22:50 ` [ 005/133] slab: fix the DEADLOCK issue on l3 alien lock Greg Kroah-Hartman
2012-10-10 22:50 ` [ 006/133] intel-iommu: Default to non-coherent for domains unattached to iommus Greg Kroah-Hartman
2012-10-10 22:50 ` [ 007/133] ARM: 7548/1: include linux/sched.h in syscall.h Greg Kroah-Hartman
2012-10-10 22:50 ` [ 008/133] em28xx: Make all em28xx extensions to be initialized asynchronously Greg Kroah-Hartman
2012-10-10 22:50 ` [ 009/133] media: rc: ite-cir: Initialise ite_dev::rdev earlier Greg Kroah-Hartman
2012-10-10 22:50 ` [ 010/133] media: gspca_pac7302: add support for device 1ae7:2001 Speedlink Snappy Microphone SL-6825-SBK Greg Kroah-Hartman
2012-10-10 22:50 ` [ 011/133] ACPI: run _OSC after ACPI_FULL_INITIALIZATION Greg Kroah-Hartman
2012-10-10 22:50 ` [ 012/133] PCI: acpiphp: check whether _ADR evaluation succeeded Greg Kroah-Hartman
2012-10-10 22:50 ` [ 014/133] lib/gcd.c: prevent possible div by 0 Greg Kroah-Hartman
2012-10-10 22:50 ` [ 015/133] kernel/sys.c: call disable_nonboot_cpus() in kernel_restart() Greg Kroah-Hartman
2012-10-10 22:50 ` [ 016/133] drivers/scsi/atp870u.c: fix bad use of udelay Greg Kroah-Hartman
2012-10-10 22:50 ` [ 017/133] lguest: fix occasional crash in example launcher Greg Kroah-Hartman
2012-10-10 22:50 ` Greg Kroah-Hartman [this message]
2012-10-10 22:50 ` [ 019/133] ixgbe: fix PTP ethtool timestamping function Greg Kroah-Hartman
2012-10-10 22:50 ` [ 020/133] rapidio/rionet: fix multicast packet transmit logic Greg Kroah-Hartman
2012-10-10 22:50 ` [ 021/133] PM / Sleep: use resume event when call dpm_resume_early Greg Kroah-Hartman
2012-10-10 22:50 ` [ 022/133] workqueue: add missing smp_wmb() in process_one_work() Greg Kroah-Hartman
2012-10-10 22:50 ` [ 023/133] jbd2: dont write superblock when if its empty Greg Kroah-Hartman
2012-10-10 22:50 ` [ 024/133] localmodconfig: Fix localyesconfig to set to y not m Greg Kroah-Hartman
2012-10-10 22:50 ` [ 025/133] bnx2x: fix rx checksum validation for IPv6 Greg Kroah-Hartman
2012-10-10 22:50 ` [ 026/133] tcp: fix regression in urgent data handling Greg Kroah-Hartman
2012-10-10 22:50 ` [ 027/133] xfrm: Workaround incompatibility of ESN and async crypto Greg Kroah-Hartman
2012-10-10 22:50 ` [ 028/133] xfrm_user: return error pointer instead of NULL Greg Kroah-Hartman
2012-10-10 22:50 ` [ 029/133] xfrm_user: return error pointer instead of NULL #2 Greg Kroah-Hartman
2012-10-10 22:50 ` [ 030/133] xfrm: fix a read lock imbalance in make_blackhole Greg Kroah-Hartman
2012-10-10 22:50 ` [ 031/133] xfrm_user: fix info leak in copy_to_user_auth() Greg Kroah-Hartman
2012-10-10 22:50 ` [ 032/133] xfrm_user: fix info leak in copy_to_user_state() Greg Kroah-Hartman
2012-10-10 22:50 ` [ 033/133] xfrm_user: fix info leak in copy_to_user_policy() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 034/133] xfrm_user: fix info leak in copy_to_user_tmpl() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 035/133] xfrm_user: dont copy esn replay window twice for new states Greg Kroah-Hartman
2012-10-10 22:51 ` [ 036/133] net: ethernet: davinci_cpdma: decrease the desc count when cleaning up the remaining packets Greg Kroah-Hartman
2012-10-10 22:51 ` [ 037/133] ixp4xx_hss: fix build failure due to missing linux/module.h inclusion Greg Kroah-Hartman
2012-10-10 22:51 ` [ 038/133] netxen: check for root bus in netxen_mask_aer_correctable Greg Kroah-Hartman
2012-10-10 22:51 ` [ 039/133] net-sched: sch_cbq: avoid infinite loop Greg Kroah-Hartman
2012-10-10 22:51 ` [ 040/133] pkt_sched: fix virtual-start-time update in QFQ Greg Kroah-Hartman
2012-10-10 22:51 ` [ 041/133] sierra_net: Endianess bug fix Greg Kroah-Hartman
2012-10-10 22:51 ` [ 042/133] 8021q: fix mac_len recomputation in vlan_untag() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 043/133] batman-adv: make batadv_test_bit() return 0 or 1 only Greg Kroah-Hartman
2012-10-10 22:51 ` [ 044/133] ipv6: release reference of ip6_null_entrys dst entry in __ip6_del_rt Greg Kroah-Hartman
2012-10-10 22:51 ` [ 045/133] ipv6: del unreachable route when an addr is deleted on lo Greg Kroah-Hartman
2012-10-10 22:51 ` [ 046/133] ipv6: fix return value check in fib6_add() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 047/133] tcp: flush DMA queue before sk_wait_data if rcv_wnd is zero Greg Kroah-Hartman
2012-10-10 22:51 ` [ 048/133] sctp: Dont charge for data in sndbuf again when transmitting packet Greg Kroah-Hartman
2012-10-10 22:51 ` [ 049/133] pppoe: drop PPPOX_ZOMBIEs in pppoe_release Greg Kroah-Hartman
2012-10-10 22:51 ` [ 050/133] net: small bug on rxhash calculation Greg Kroah-Hartman
2012-10-10 22:51 ` [ 051/133] net: guard tcp_set_keepalive() to tcp sockets Greg Kroah-Hartman
2012-10-10 22:51 ` [ 052/133] ipv4: raw: fix icmp_filter() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 053/133] ipv6: raw: fix icmpv6_filter() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 054/133] ipv6: mip6: fix mip6_mh_filter() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 055/133] l2tp: fix a typo in l2tp_eth_dev_recv() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 056/133] netrom: copy_datagram_iovec can fail Greg Kroah-Hartman
2012-10-10 22:51 ` [ 057/133] net: do not disable sg for packets requiring no checksum Greg Kroah-Hartman
2012-10-10 22:51 ` [ 058/133] aoe: assert AoE packets marked as " Greg Kroah-Hartman
2012-10-10 22:51 ` [ 059/133] drm/savage: re-add busmaster enable, regression fix Greg Kroah-Hartman
2012-10-10 22:51 ` [ 060/133] SCSI: zfcp: Adapt to new FC_PORTSPEED semantics Greg Kroah-Hartman
2012-10-10 22:51 ` [ 061/133] SCSI: zfcp: Make trace record tags unique Greg Kroah-Hartman
2012-10-10 22:51 ` [ 062/133] SCSI: zfcp: Bounds checking for deferred error trace Greg Kroah-Hartman
2012-10-10 22:51 ` [ 063/133] SCSI: zfcp: Do not wakeup while suspended Greg Kroah-Hartman
2012-10-10 22:51 ` [ 064/133] SCSI: zfcp: remove invalid reference to list iterator variable Greg Kroah-Hartman
2012-10-10 22:51 ` [ 065/133] SCSI: zfcp: restore refcount check on port_remove Greg Kroah-Hartman
2012-10-10 22:51 ` [ 066/133] SCSI: zfcp: only access zfcp_scsi_dev for valid scsi_device Greg Kroah-Hartman
2012-10-10 22:51 ` [ 067/133] PCI: Check P2P bridge for invalid secondary/subordinate range Greg Kroah-Hartman
2012-10-10 22:51 ` [ 068/133] ext4: ignore last group w/o enough space when resizing instead of BUGing Greg Kroah-Hartman
2012-10-10 22:51 ` [ 069/133] ext4: dont copy non-existent gdt blocks when resizing Greg Kroah-Hartman
2012-10-10 22:51 ` [ 070/133] ext4: avoid duplicate writes of the backup bg descriptor blocks Greg Kroah-Hartman
2012-10-10 22:51 ` [ 071/133] ext4: fix potential deadlock in ext4_nonda_switch() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 072/133] ext4: fix crash when accessing /proc/mounts concurrently Greg Kroah-Hartman
2012-10-10 22:51 ` [ 073/133] ext4: move_extent code cleanup Greg Kroah-Hartman
2012-10-10 22:51 ` [ 074/133] ext4: online defrag is not supported for journaled files Greg Kroah-Hartman
2012-10-10 22:51 ` [ 075/133] ext4: always set i_op in ext4_mknod() Greg Kroah-Hartman
2012-10-10 22:51 ` [ 076/133] ext4: fix fdatasync() for files with only i_size changes Greg Kroah-Hartman
2012-10-10 22:51 ` [ 077/133] xfrm_user: ensure user supplied esn replay window is valid Greg Kroah-Hartman
2012-10-10 22:51 ` [ 078/133] ASoC: wm_hubs: Ensure volume updates are handled during class W startup Greg Kroah-Hartman
2012-10-10 22:51 ` [ 079/133] ASoC: wm9712: Fix name of Capture Switch Greg Kroah-Hartman
2012-10-10 22:51 ` [ 080/133] kpageflags: fix wrong KPF_THP on non-huge compound pages Greg Kroah-Hartman
2012-10-10 22:51 ` [ 081/133] hugetlb: do not use vma_hugecache_offset() for vma_prio_tree_foreach Greg Kroah-Hartman
2012-10-10 22:51 ` [ 082/133] mm: fix invalidate_complete_page2() lock ordering Greg Kroah-Hartman
2012-10-10 22:51 ` [ 083/133] mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP Greg Kroah-Hartman
2012-10-10 22:51 ` [ 084/133] MIPS: ath79: use correct fractional dividers for {CPU,DDR}_PLL on AR934x Greg Kroah-Hartman
2012-10-10 22:51 ` [ 085/133] drm/i915: prevent possible pin leak on error path Greg Kroah-Hartman
2012-10-10 22:51 ` [ 086/133] ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310 Greg Kroah-Hartman
2012-10-10 22:51 ` [ 087/133] ALSA: aloop - add locking to timer access Greg Kroah-Hartman
2012-10-10 22:51 ` [ 088/133] ALSA: hda/realtek - Fix detection of ALC271X codec Greg Kroah-Hartman
2012-10-10 22:51 ` [ 089/133] ALSA: hda - limit internal mic boost for Asus X202E Greg Kroah-Hartman
2012-10-10 22:51 ` [ 090/133] ALSA: usb - disable broken hw volume for Tenx TP6911 Greg Kroah-Hartman
2012-10-10 22:51 ` [ 091/133] ALSA: USB: Support for (original) Xbox Communicator Greg Kroah-Hartman
2012-10-10 22:51 ` [ 092/133] drm/nvc0/fence: restore pre-suspend fence buffer context on resume Greg Kroah-Hartman
2012-10-10 22:51 ` [ 093/133] drm: Destroy the planes prior to destroying the associated CRTC Greg Kroah-Hartman
2012-10-10 22:52 ` [ 094/133] drm/radeon: only adjust default clocks on NI GPUs Greg Kroah-Hartman
2012-10-10 22:52 ` [ 095/133] drm/radeon: Add MSI quirk for gateway RS690 Greg Kroah-Hartman
2012-10-10 22:52 ` [ 096/133] drm/radeon: force MSIs on RS690 asics Greg Kroah-Hartman
2012-10-10 22:52 ` [ 097/133] drm/i915: Flush the pending flips on the CRTC before modification Greg Kroah-Hartman
2012-10-10 22:52 ` [ 098/133] drm/i915: call drm_handle_vblank before finish_page_flip Greg Kroah-Hartman
2012-10-10 22:52 ` [ 099/133] drm/i915: Fix GT_MODE default value Greg Kroah-Hartman
2012-10-10 22:52 ` [ 100/133] ia64: Add missing RCU idle APIs on idle loop Greg Kroah-Hartman
2012-10-10 22:52 ` [ 101/133] h8300: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 102/133] parisc: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 103/133] xtensa: " Greg Kroah-Hartman
2012-10-11  0:25   ` Chris Zankel
2012-10-10 22:52 ` [ 104/133] frv: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 105/133] mn10300: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 106/133] m68k: " Greg Kroah-Hartman
2012-10-10 22:52   ` Greg Kroah-Hartman
2012-10-10 22:52 ` [ 107/133] alpha: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 108/133] cris: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 109/133] m32r: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 110/133] score: " Greg Kroah-Hartman
2012-10-10 22:52 ` [ 111/133] rcu: Fix day-one dyntick-idle stall-warning bug Greg Kroah-Hartman
2012-10-10 22:52 ` [ 112/133] revert "mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages" Greg Kroah-Hartman
2012-10-10 22:52 ` [ 113/133] mempolicy: remove mempolicy sharing Greg Kroah-Hartman
2012-10-10 22:52 ` [ 114/133] mempolicy: fix a race in shared_policy_replace() Greg Kroah-Hartman
2012-10-10 22:52 ` [ 115/133] mempolicy: fix refcount leak in mpol_set_shared_policy() Greg Kroah-Hartman
2012-10-10 22:52 ` [ 116/133] mempolicy: fix a memory corruption by refcount imbalance in alloc_pages_vma() Greg Kroah-Hartman
2012-10-10 22:52 ` [ 117/133] Revert "KVM: VMX: Fix KVM_SET_SREGS with big real mode segments" Greg Kroah-Hartman
2012-10-10 22:52 ` [ 118/133] efi: Build EFI stub with EFI-appropriate options Greg Kroah-Hartman
2012-10-10 22:52 ` [ 119/133] efi: initialize efi.runtime_version to make query_variable_info/update_capsule workable Greg Kroah-Hartman
2012-10-10 22:52 ` [ 120/133] CPU hotplug, cpusets, suspend: Dont modify cpusets during suspend/resume Greg Kroah-Hartman
2012-10-10 22:52 ` [ 121/133] Revert "drm/i915: correctly order the ring init sequence" Greg Kroah-Hartman
2012-10-10 22:52 ` [ 122/133] mtd: mtdpart: break it as soon as we parse out the partitions Greg Kroah-Hartman
2012-10-10 22:52 ` [ 123/133] mtd: autcpu12-nvram: Fix compile breakage Greg Kroah-Hartman
2012-10-10 22:52 ` [ 124/133] mtd: nandsim: bugfix: fail if overridesize is too big Greg Kroah-Hartman
2012-10-10 22:52 ` [ 125/133] mtd: nand: Use the mirror BBT descriptor when reading its version Greg Kroah-Hartman
2012-10-10 22:52 ` [ 126/133] mtd: omap2: fix omap_nand_remove segfault Greg Kroah-Hartman
2012-10-10 22:52 ` [ 127/133] mtd: omap2: fix module loading Greg Kroah-Hartman
2012-10-10 22:52 ` [ 128/133] mmc: omap_hsmmc: Pass on the suspend failure to the PM core Greg Kroah-Hartman
2012-10-10 22:52 ` [ 129/133] mmc: sh-mmcif: avoid oops on spurious interrupts Greg Kroah-Hartman
2012-10-10 22:52 ` [ 130/133] JFFS2: fix unmount regression Greg Kroah-Hartman
2012-10-10 22:52 ` [ 131/133] JFFS2: dont fail on bitflips in OOB Greg Kroah-Hartman
2012-10-10 22:52 ` [ 132/133] cifs: reinstate the forcegid option Greg Kroah-Hartman
2012-10-10 22:52 ` [ 133/133] Convert properly UTF-8 to UTF-16 Greg Kroah-Hartman

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=20121010224857.729632794@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=aik@ozlabs.ru \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shangw@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.