From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Gavin Shan <shangw@linux.vnet.ibm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 3.13 32/46] powerpc/powernv: Dump PHB diag-data immediately
Date: Fri, 28 Mar 2014 10:32:16 -0700 [thread overview]
Message-ID: <20140328173139.045806269@linuxfoundation.org> (raw)
In-Reply-To: <20140328173134.630198216@linuxfoundation.org>
3.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Shan <shangw@linux.vnet.ibm.com>
commit 947166043732b69878123bf31f51933ad0316080 upstream.
The PHB diag-data is important to help locating the root cause for
EEH errors such as frozen PE or fenced PHB. However, the EEH core
enables IO path by clearing part of HW registers before collecting
this data causing it to be corrupted.
This patch fixes this by dumping the PHB diag-data immediately when
frozen/fenced state on PE or PHB is detected for the first time in
eeh_ops::get_state() or next_error() backend.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/platforms/powernv/eeh-ioda.c | 99 +++++++++++++-----------------
1 file changed, 43 insertions(+), 56 deletions(-)
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -114,6 +114,7 @@ DEFINE_SIMPLE_ATTRIBUTE(ioda_eeh_inbB_db
ioda_eeh_inbB_dbgfs_set, "0x%llx\n");
#endif /* CONFIG_DEBUG_FS */
+
/**
* ioda_eeh_post_init - Chip dependent post initialization
* @hose: PCI controller
@@ -221,6 +222,22 @@ static int ioda_eeh_set_option(struct ee
return ret;
}
+static void ioda_eeh_phb_diag(struct pci_controller *hose)
+{
+ struct pnv_phb *phb = hose->private_data;
+ long rc;
+
+ rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob,
+ PNV_PCI_DIAG_BUF_SIZE);
+ if (rc != OPAL_SUCCESS) {
+ pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n",
+ __func__, hose->global_number, rc);
+ return;
+ }
+
+ pnv_pci_dump_phb_diag_data(hose, phb->diag.blob);
+}
+
/**
* ioda_eeh_get_state - Retrieve the state of PE
* @pe: EEH PE
@@ -272,6 +289,9 @@ static int ioda_eeh_get_state(struct eeh
result |= EEH_STATE_DMA_ACTIVE;
result |= EEH_STATE_MMIO_ENABLED;
result |= EEH_STATE_DMA_ENABLED;
+ } else if (!(pe->state & EEH_PE_ISOLATED)) {
+ eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
+ ioda_eeh_phb_diag(hose);
}
return result;
@@ -315,6 +335,15 @@ static int ioda_eeh_get_state(struct eeh
__func__, fstate, hose->global_number, pe_no);
}
+ /* Dump PHB diag-data for frozen PE */
+ if (result != EEH_STATE_NOT_SUPPORT &&
+ (result & (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE)) !=
+ (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE) &&
+ !(pe->state & EEH_PE_ISOLATED)) {
+ eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
+ ioda_eeh_phb_diag(hose);
+ }
+
return result;
}
@@ -530,45 +559,6 @@ static int ioda_eeh_reset(struct eeh_pe
}
/**
- * ioda_eeh_get_log - Retrieve error log
- * @pe: EEH PE
- * @severity: Severity level of the log
- * @drv_log: buffer to store the log
- * @len: space of the log buffer
- *
- * The function is used to retrieve error log from P7IOC.
- */
-static int ioda_eeh_get_log(struct eeh_pe *pe, int severity,
- char *drv_log, unsigned long len)
-{
- s64 ret;
- unsigned long flags;
- struct pci_controller *hose = pe->phb;
- struct pnv_phb *phb = hose->private_data;
-
- spin_lock_irqsave(&phb->lock, flags);
-
- ret = opal_pci_get_phb_diag_data2(phb->opal_id,
- phb->diag.blob, PNV_PCI_DIAG_BUF_SIZE);
- if (ret) {
- spin_unlock_irqrestore(&phb->lock, flags);
- pr_warning("%s: Can't get log for PHB#%x-PE#%x (%lld)\n",
- __func__, hose->global_number, pe->addr, ret);
- return -EIO;
- }
-
- /*
- * FIXME: We probably need log the error in somewhere.
- * Lets make it up in future.
- */
- /* pr_info("%s", phb->diag.blob); */
-
- spin_unlock_irqrestore(&phb->lock, flags);
-
- return 0;
-}
-
-/**
* ioda_eeh_configure_bridge - Configure the PCI bridges for the indicated PE
* @pe: EEH PE
*
@@ -649,22 +639,6 @@ static void ioda_eeh_hub_diag(struct pci
}
}
-static void ioda_eeh_phb_diag(struct pci_controller *hose)
-{
- struct pnv_phb *phb = hose->private_data;
- long rc;
-
- rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob,
- PNV_PCI_DIAG_BUF_SIZE);
- if (rc != OPAL_SUCCESS) {
- pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n",
- __func__, hose->global_number, rc);
- return;
- }
-
- pnv_pci_dump_phb_diag_data(hose, phb->diag.blob);
-}
-
static int ioda_eeh_get_phb_pe(struct pci_controller *hose,
struct eeh_pe **pe)
{
@@ -827,6 +801,20 @@ static int ioda_eeh_next_error(struct ee
}
/*
+ * EEH core will try recover from fenced PHB or
+ * frozen PE. In the time for frozen PE, EEH core
+ * enable IO path for that before collecting logs,
+ * but it ruins the site. So we have to dump the
+ * log in advance here.
+ */
+ if ((ret == EEH_NEXT_ERR_FROZEN_PE ||
+ ret == EEH_NEXT_ERR_FENCED_PHB) &&
+ !((*pe)->state & EEH_PE_ISOLATED)) {
+ eeh_pe_state_mark(*pe, EEH_PE_ISOLATED);
+ ioda_eeh_phb_diag(hose);
+ }
+
+ /*
* If we have no errors on the specific PHB or only
* informative error there, we continue poking it.
* Otherwise, we need actions to be taken by upper
@@ -844,7 +832,6 @@ struct pnv_eeh_ops ioda_eeh_ops = {
.set_option = ioda_eeh_set_option,
.get_state = ioda_eeh_get_state,
.reset = ioda_eeh_reset,
- .get_log = ioda_eeh_get_log,
.configure_bridge = ioda_eeh_configure_bridge,
.next_error = ioda_eeh_next_error
};
next prev parent reply other threads:[~2014-03-28 17:32 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 17:31 [PATCH 3.13 00/46] 3.13.8-stable review Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 01/46] HID: hidraw: fix warning destroying hidraw device files after parent Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 02/46] ALSA: compress: Pass through return value of open ops callback Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 03/46] clocksource: vf_pit_timer: use complement for sched_clock reading Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 04/46] drm/i915: Fix PSR programming Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 05/46] drm/i915: Dont enable display error interrupts from the start Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 06/46] drm/i915: Disable stolen memory when DMAR is active Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 07/46] tracing: Fix array size mismatch in format string Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 08/46] partly revert commit 8a10bc9: parisc/sti_console: prefer Linux fonts over built-in ROM fonts Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 09/46] net: davinci_emac: Replace devm_request_irq with request_irq Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 10/46] NFSv4: Use the correct net namespace in nfs4_update_server Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 11/46] media: cxusb: unlock on error in cxusb_i2c_xfer() Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 12/46] media: dw2102: some missing unlocks on error Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 13/46] media: cx18: check for allocation failure in cx18_read_eeprom() Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 14/46] libceph: block I/O when PAUSE or FULL osd map flags are set Greg Kroah-Hartman
2014-03-28 17:31 ` [PATCH 3.13 15/46] libceph: resend all writes after the osdmap loses the full flag Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 16/46] ASoC: max98090: make REVISION_ID readable Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 17/46] stop_machine: Fix^2 race between stop_two_cpus() and stop_cpus() Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 18/46] sfc: Use the correct maximum TX DMA ring size for SFC9100 Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 19/46] ARM: 7941/2: Fix incorrect FDT initrd parameter override Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 20/46] SUNRPC: Fix a pipe_version reference leak Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 21/46] x86: bpf_jit: support negative offsets Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 22/46] printk: fix syslog() overflowing user buffer Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 23/46] Fix uses of dma_max_pfn() when converting to a limiting address Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 24/46] perf tools: Fix AAAAARGH64 memory barriers Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 25/46] deb-pkg: Fix building for MIPS big-endian or ARM OABI Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 26/46] deb-pkg: Fix cross-building linux-headers package Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 27/46] MIPS: Fix build error seen in some configurations Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 28/46] p54: clamp properly instead of just truncating Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 29/46] regulator: core: Replace direct ops->disable usage Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 30/46] powerpc/powernv: Move PHB-diag dump functions around Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 31/46] powerpc/eeh: Handle multiple EEH errors Greg Kroah-Hartman
2014-03-28 17:32 ` Greg Kroah-Hartman [this message]
2014-03-28 17:32 ` [PATCH 3.13 33/46] powerpc/powernv: Refactor PHB diag-data dump Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 34/46] fs/proc/proc_devtree.c: remove empty /proc/device-tree when no openfirmware exists Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 35/46] Input: elantech - improve clickpad detection Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 36/46] KVM: MMU: handle invalid root_hpa at __direct_map Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 37/46] KVM: x86: handle invalid root_hpa everywhere Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 38/46] KVM: VMX: fix use after free of vmx->loaded_vmcs Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 39/46] Input: wacom - make sure touch_max is set for touch devices Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 40/46] Input: wacom - add support for three new Intuos devices Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 41/46] Input: wacom - add reporting of SW_MUTE_DEVICE events Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 42/46] xhci: Fix resume issues on Renesas chips in Samsung laptops Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 43/46] e100: Fix "disabling already-disabled device" warning Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 44/46] libceph: rename ceph_msg::front_max to front_alloc_len Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 45/46] libceph: rename front to front_len in get_reply() Greg Kroah-Hartman
2014-03-28 17:32 ` [PATCH 3.13 46/46] libceph: fix preallocation check " Greg Kroah-Hartman
2014-03-29 1:12 ` [PATCH 3.13 00/46] 3.13.8-stable review Guenter Roeck
2014-03-29 1:28 ` Greg Kroah-Hartman
2014-03-29 12:19 ` Satoru Takeuchi
2014-03-29 17:01 ` Greg Kroah-Hartman
2014-03-30 1:25 ` Shuah Khan
2014-03-30 2:49 ` 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=20140328173139.045806269@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--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 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).