From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: [RFC PATCH 4/4] Hook into ras epow interrupt handler for hotplug
Date: Tue, 17 Jun 2014 10:47:47 -0500 [thread overview]
Message-ID: <53A06323.3080707@linux.vnet.ibm.com> (raw)
In-Reply-To: <53A061EC.10403@linux.vnet.ibm.com>
This patch hooks into the ras EPOW interrupt handler so that we can
communicate hotplug rtas events to a PowerKVM guest from qemu.
The ras epow interrupt wil lnow check for hotplgu rtas events and
invoke the common handling routine accordingly.
---
arch/powerpc/include/asm/rtas.h | 1 +
arch/powerpc/platforms/pseries/dlpar.c | 2 +-
arch/powerpc/platforms/pseries/pseries.h | 1 +
arch/powerpc/platforms/pseries/ras.c | 12 +++++++++++-
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 26491ae..7313e6f 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -124,6 +124,7 @@ struct rtas_suspend_me_data {
#define RTAS_TYPE_INFO 0xE2
#define RTAS_TYPE_DEALLOC 0xE3
#define RTAS_TYPE_DUMP 0xE4
+#define RTAS_TYPE_HOTPLUG 0xE5
/* I don't add PowerMGM events right now, this is a different topic */
#define RTAS_TYPE_PMGM_POWER_SW_ON 0x60
#define RTAS_TYPE_PMGM_POWER_SW_OFF 0x61
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 53f4fe6..6d3de6e 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -360,7 +360,7 @@ int dlpar_release_drc(u32 drc_index)
return 0;
}
-static int handle_dlpar_errorlog(struct rtas_error_log *error_log)
+int handle_dlpar_errorlog(struct rtas_error_log *error_log)
{
struct pseries_errorlog *pseries_log;
struct pseries_hp_elog *hp_elog;
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 1706215..9b9bd82 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -64,6 +64,7 @@ extern int dlpar_acquire_drc(u32);
extern int dlpar_release_drc(u32);
extern int dlpar_memory(struct pseries_hp_elog *);
extern int dlpar_cpus(struct pseries_hp_elog *);
+extern int handle_dlpar_errorlog(struct rtas_error_log *);
/* PCI root bridge prepare function override for pseries */
struct pci_host_bridge;
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 9c5778e..3cc6a49 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -183,6 +183,7 @@ void rtas_parse_epow_errlog(struct rtas_error_log *log)
/* Handle environmental and power warning (EPOW) interrupts. */
static irqreturn_t ras_epow_interrupt(int irq, void *dev_id)
{
+ struct rtas_error_log *elog;
int status;
int state;
int critical;
@@ -205,7 +206,16 @@ static irqreturn_t ras_epow_interrupt(int irq, void *dev_id)
log_error(ras_log_buf, ERR_TYPE_RTAS_LOG, 0);
- rtas_parse_epow_errlog((struct rtas_error_log *)ras_log_buf);
+ elog = (struct rtas_error_log *)ras_log_buf;
+
+ switch(rtas_error_type(elog)) {
+ case RTAS_TYPE_EPOW:
+ rtas_parse_epow_errlog(elog);
+ break;
+ case RTAS_TYPE_HOTPLUG:
+ handle_dlpar_errorlog(elog);
+ break;
+ }
spin_unlock(&ras_log_buf_lock);
return IRQ_HANDLED;
--
2.0.0.rc3.2.g998f840
prev parent reply other threads:[~2014-06-17 15:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 15:42 [RFC PATCH 0/4] Update hotplug for pseries systems Nathan Fontenot
2014-06-17 15:45 ` [RFC PATCH 1/4] Create interface for rtas hotplug events and move mem hotplug to the kernel Nathan Fontenot
2014-06-17 15:46 ` [RFC PATCH 2/4] Migrate cpu hotplug code to pseries/hotplug-cpu.c Nathan Fontenot
2014-06-17 15:46 ` [RFC PATCH 3/4] Handle cpu hotplug from rtas hotplug events Nathan Fontenot
2014-06-17 15:47 ` Nathan Fontenot [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=53A06323.3080707@linux.vnet.ibm.com \
--to=nfont@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.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 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.