From: linas@austin.ibm.com (Linas Vepstas)
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH 4/11] ppc64: EEH: support ibm,get-config-addr-info2 RTAS call
Date: Mon, 19 Mar 2007 14:54:21 -0500 [thread overview]
Message-ID: <20070319195421.GD11532@austin.ibm.com> (raw)
In-Reply-To: <20070319194349.GT5151@austin.ibm.com>
Provide support for the new ibm,get-config-addr-info2 RTAS token,
whenever it is actually available.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----
arch/powerpc/platforms/pseries/eeh.c | 44 +++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 9 deletions(-)
Index: linux-2.6.21-rc4-git4/arch/powerpc/platforms/pseries/eeh.c
===================================================================
--- linux-2.6.21-rc4-git4.orig/arch/powerpc/platforms/pseries/eeh.c 2007-03-19 13:19:30.000000000 -0500
+++ linux-2.6.21-rc4-git4/arch/powerpc/platforms/pseries/eeh.c 2007-03-19 13:20:31.000000000 -0500
@@ -83,6 +83,7 @@ static int ibm_read_slot_reset_state;
static int ibm_read_slot_reset_state2;
static int ibm_slot_error_detail;
static int ibm_get_config_addr_info;
+static int ibm_get_config_addr_info2;
static int ibm_configure_bridge;
int eeh_subsystem_enabled;
@@ -744,6 +745,38 @@ struct eeh_early_enable_info {
unsigned int buid_lo;
};
+static int get_pe_addr (int config_addr,
+ struct eeh_early_enable_info *info)
+{
+ unsigned int rets[3];
+ int ret;
+
+ /* Use latest config-addr token on power6 */
+ if (ibm_get_config_addr_info2 != RTAS_UNKNOWN_SERVICE) {
+ /* Make sure we have a PE in hand */
+ ret = rtas_call (ibm_get_config_addr_info2, 4, 2, rets,
+ config_addr, info->buid_hi, info->buid_lo, 1);
+ if (ret || (rets[0]==0))
+ return 0;
+
+ ret = rtas_call (ibm_get_config_addr_info2, 4, 2, rets,
+ config_addr, info->buid_hi, info->buid_lo, 0);
+ if (ret)
+ return 0;
+ return rets[0];
+ }
+
+ /* Use older config-addr token on power5 */
+ if (ibm_get_config_addr_info != RTAS_UNKNOWN_SERVICE) {
+ ret = rtas_call (ibm_get_config_addr_info, 4, 2, rets,
+ config_addr, info->buid_hi, info->buid_lo, 0);
+ if (ret)
+ return 0;
+ return rets[0];
+ }
+ return 0;
+}
+
/* Enable eeh for the given device node. */
static void *early_enable_eeh(struct device_node *dn, void *data)
{
@@ -810,15 +843,7 @@ static void *early_enable_eeh(struct dev
/* If the newer, better, ibm,get-config-addr-info is supported,
* then use that instead. */
- pdn->eeh_pe_config_addr = 0;
- if (ibm_get_config_addr_info != RTAS_UNKNOWN_SERVICE) {
- ret = rtas_call (ibm_get_config_addr_info, 4, 2, rets,
- pdn->eeh_config_addr,
- info->buid_hi, info->buid_lo,
- 0);
- if (ret == 0)
- pdn->eeh_pe_config_addr = rets[0];
- }
+ pdn->eeh_pe_config_addr = get_pe_addr(pdn->eeh_config_addr, info);
/* Some older systems (Power4) allow the
* ibm,set-eeh-option call to succeed even on nodes
@@ -889,6 +914,7 @@ void __init eeh_init(void)
ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state");
ibm_slot_error_detail = rtas_token("ibm,slot-error-detail");
ibm_get_config_addr_info = rtas_token("ibm,get-config-addr-info");
+ ibm_get_config_addr_info2 = rtas_token("ibm,get-config-addr-info2");
ibm_configure_bridge = rtas_token ("ibm,configure-bridge");
if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE)
next prev parent reply other threads:[~2007-03-19 19:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-19 19:43 [PATCH 0/11] ppc64: EEH: modifications, fixes Linas Vepstas
2007-03-19 19:51 ` [PATCH 1/11] ppc64: EEH: modify order of EEH state checking Linas Vepstas
2007-03-19 19:52 ` [PATCH 2/11] ppc64: EEH: Add clarifying messages Linas Vepstas
2007-03-20 18:26 ` Brian King
2007-03-21 17:59 ` Linas Vepstas
2007-03-19 19:53 ` [PATCH 3/11] ppc64: EEH: Tolerate high mmio Linas Vepstas
2007-03-21 1:25 ` Olof Johansson
2007-03-21 19:20 ` Linas Vepstas
2007-03-19 19:54 ` Linas Vepstas [this message]
2007-03-19 19:55 ` [PATCH 5/11] ppc64: EEH: hotplug recovery bugfix Linas Vepstas
2007-03-19 19:55 ` [PATCH 6/11] ppc64: EEH: multifunction " Linas Vepstas
2007-03-19 19:56 ` [PATCH 7/11] ppc64: EEH: handle reset state high Linas Vepstas
2007-03-19 19:58 ` [PATCH 8/11] ppc64: EEH: wait for slot status Linas Vepstas
2007-03-19 19:59 ` [PATCH 9/11] ppc64: EEH: rm un-needed data Linas Vepstas
2007-03-19 19:59 ` [PATCH 10/11] ppc64: EEH: verify state change Linas Vepstas
2007-03-19 20:01 ` [PATCH 11/11] ppc64: EEH: restructure multi-function support Linas Vepstas
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=20070319195421.GD11532@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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).