linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Michael Holzheu <holzheu@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 39/47] Use diag308 subcodes 3 and 6 for reboot and dump when possible.
Date: Thu, 20 Dec 2007 16:20:04 +0100	[thread overview]
Message-ID: <20071220152111.582744811@de.ibm.com> (raw)
In-Reply-To: 20071220151925.405881218@de.ibm.com

[-- Attachment #1: 138-diag308.diff --]
[-- Type: text/plain, Size: 3330 bytes --]

From: Michael Holzheu <holzheu@de.ibm.com>

This patch fixes a problem with the following scenario:
 1. Linux booted from DASD "A"
 2. Reboot from DASD "B" using "/sys/firmware/reipl/ccw/device"
 3. Reboot DASD "B"
Without this patch in step 3 on newer s390 systems under LPAR instead of
DASD "B", DASD "A" will be booted. The reason is that in step 2 we use CCW
reipl and in step 3 we use DIAG308 (subcode 3) reipl. DIAG308 does not
notice the CCW reipl and still thinks that it has to reboot DASD "A".
Before applying this fix, ensure to have MCF RJ9967101E or z9 GA3 base driver
installed.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 arch/s390/kernel/ipl.c |   14 ++++++++------
 include/asm-s390/ipl.h |    4 ++++
 2 files changed, 12 insertions(+), 6 deletions(-)

Index: quilt-2.6/arch/s390/kernel/ipl.c
===================================================================
--- quilt-2.6.orig/arch/s390/kernel/ipl.c
+++ quilt-2.6/arch/s390/kernel/ipl.c
@@ -588,7 +588,9 @@ static int reipl_set_type(enum ipl_type 
 
 	switch(type) {
 	case IPL_TYPE_CCW:
-		if (MACHINE_IS_VM)
+		if (diag308_set_works)
+			reipl_method = REIPL_METHOD_CCW_DIAG;
+		else if (MACHINE_IS_VM)
 			reipl_method = REIPL_METHOD_CCW_VM;
 		else
 			reipl_method = REIPL_METHOD_CCW_CIO;
@@ -650,8 +652,6 @@ void reipl_run(struct shutdown_trigger *
 	switch (reipl_method) {
 	case REIPL_METHOD_CCW_CIO:
 		devid.devno = reipl_block_ccw->ipl_info.ccw.devno;
-		if (ipl_info.type == IPL_TYPE_CCW && devid.devno == ipl_devno)
-			diag308(DIAG308_IPL, NULL);
 		devid.ssid  = 0;
 		reipl_ccw_dev(&devid);
 		break;
@@ -736,6 +736,7 @@ static int __init reipl_ccw_init(void)
 	reipl_block_ccw->hdr.version = IPL_PARM_BLOCK_VERSION;
 	reipl_block_ccw->hdr.blk0_len = IPL_PARM_BLK0_CCW_LEN;
 	reipl_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW;
+	reipl_block_ccw->hdr.flags = DIAG308_FLAGS_LP_VALID;
 	/* check if read scp info worked and set loadparm */
 	if (sclp_ipl_info.is_valid)
 		memcpy(reipl_block_ccw->ipl_info.ccw.load_param,
@@ -744,8 +745,7 @@ static int __init reipl_ccw_init(void)
 		/* read scp info failed: set empty loadparm (EBCDIC blanks) */
 		memset(reipl_block_ccw->ipl_info.ccw.load_param, 0x40,
 		       LOADPARM_LEN);
-	/* FIXME: check for diag308_set_works when enabling diag ccw reipl */
-	if (!MACHINE_IS_VM)
+	if (!MACHINE_IS_VM && !diag308_set_works)
 		sys_reipl_ccw_loadparm_attr.attr.mode = S_IRUGO;
 	if (ipl_info.type == IPL_TYPE_CCW)
 		reipl_block_ccw->ipl_info.ccw.devno = ipl_devno;
@@ -867,7 +867,9 @@ static int dump_set_type(enum dump_type 
 		return -EINVAL;
 	switch (type) {
 	case DUMP_TYPE_CCW:
-		if (MACHINE_IS_VM)
+		if (diag308_set_works)
+			dump_method = DUMP_METHOD_CCW_DIAG;
+		else if (MACHINE_IS_VM)
 			dump_method = DUMP_METHOD_CCW_VM;
 		else
 			dump_method = DUMP_METHOD_CCW_CIO;
Index: quilt-2.6/include/asm-s390/ipl.h
===================================================================
--- quilt-2.6.orig/include/asm-s390/ipl.h
+++ quilt-2.6/include/asm-s390/ipl.h
@@ -143,6 +143,10 @@ enum diag308_opt {
 	DIAG308_IPL_OPT_DUMP	= 0x20,
 };
 
+enum diag308_flags {
+	DIAG308_FLAGS_LP_VALID	= 0x80,
+};
+
 enum diag308_rc {
 	DIAG308_RC_OK	= 1,
 };

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

  parent reply	other threads:[~2007-12-20 15:20 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-20 15:19 [patch 00/47] s390 2.6.25 patch queue Martin Schwidefsky
2007-12-20 15:19 ` [patch 01/47] Cleanup in Documentation/kernel-parameters.txt Martin Schwidefsky
2007-12-20 15:19 ` [patch 02/47] cio: Dump ccw device information in case of timeout Martin Schwidefsky
2007-12-20 15:19 ` [patch 03/47] cio: Use helpers instead of container_of() Martin Schwidefsky
2007-12-20 15:19 ` [patch 04/47] cio: css_driver: Use consistent parameters Martin Schwidefsky
2007-12-20 15:19 ` [patch 05/47] cio: Reset sch->driver Martin Schwidefsky
2007-12-20 15:19 ` [patch 06/47] cio: Add css_driver_{register,unregister} Martin Schwidefsky
2007-12-20 15:19 ` [patch 07/47] cio: Cleanup debug feature usage Martin Schwidefsky
2007-12-20 15:19 ` [patch 08/47] cio: Introduce subchannel->private Martin Schwidefsky
2007-12-20 15:19 ` [patch 09/47] cio: Extend adapter interrupt interface Martin Schwidefsky
2007-12-20 15:19 ` [patch 10/47] cio: I/O subchannel specific fields Martin Schwidefsky
2007-12-20 15:19 ` [patch 11/47] cio: Use dev_{g,s}et_drvdata() Martin Schwidefsky
2007-12-20 15:19 ` [patch 12/47] cio: Set driver->owner on css, ccw and ccwgroup busses Martin Schwidefsky
2007-12-20 15:19 ` [patch 13/47] cio: reduce cpu utilization during device scan Martin Schwidefsky
2007-12-20 15:19 ` [patch 14/47] qdio: Remove double checked value Martin Schwidefsky
2007-12-20 15:19 ` [patch 15/47] qdio: set QDIO_ACTIVATE_TIMEOUT to 5s Martin Schwidefsky
2007-12-20 15:19 ` [patch 16/47] sclp: sysfs interface for SCLP cpi Martin Schwidefsky
2007-12-20 15:19 ` [patch 17/47] Standby cpu activation/deactivation Martin Schwidefsky
2007-12-20 15:19 ` [patch 18/47] sclp: convert channel path configure code to use sync interface Martin Schwidefsky
2007-12-20 15:19 ` [patch 19/47] Optimize reference bit handling Martin Schwidefsky
2007-12-20 15:19 ` [patch 20/47] Fix tlb flushing with idte Martin Schwidefsky
2007-12-20 15:19 ` [patch 21/47] Change vmalloc defintions Martin Schwidefsky
2007-12-20 15:19 ` [patch 22/47] Print kernel version in dump_stack() and show_regs() Martin Schwidefsky
2007-12-20 15:19 ` [patch 23/47] Get rid of HOLES_IN_ZONE requirement Martin Schwidefsky
2007-12-20 15:19 ` [patch 24/47] DEBUG_PAGEALLOC support for s390 Martin Schwidefsky
2007-12-20 15:19 ` [patch 25/47] Remove owner_pc member from raw_spinlock_t Martin Schwidefsky
2007-12-20 15:19 ` [patch 26/47] Use new style spinlock initializer in __RWSEM_INITIALIZER Martin Schwidefsky
2007-12-20 15:19 ` [patch 27/47] Get rid of additional_cpus kernel parameter Martin Schwidefsky
2007-12-20 15:19 ` [patch 28/47] Remove appldata include from sysctl_check.c Martin Schwidefsky
2007-12-20 15:19 ` [patch 29/47] crypto: move s390 Kconfig options Martin Schwidefsky
2007-12-20 15:19 ` [patch 30/47] dasd: fix return value of dasd_generic_probe() Martin Schwidefsky
2007-12-20 15:19 ` [patch 31/47] arch/s390: Add missing "space" Martin Schwidefsky
2007-12-20 15:19 ` [patch 32/47] drivers/s390: " Martin Schwidefsky
2007-12-20 15:19 ` [patch 33/47] kernel: Shutdown Actions Interface Martin Schwidefsky
2007-12-20 15:19 ` [patch 34/47] Load disabled wait psw instead of stopping cpu on halt Martin Schwidefsky
2007-12-20 15:20 ` [patch 35/47] use LIST_HEAD instead of LIST_HEAD_INIT Martin Schwidefsky
2007-12-20 15:20 ` [patch 36/47] Allocate and free cpu lowcores and stacks when needed/possible Martin Schwidefsky
2007-12-20 15:20 ` [patch 37/47] Initialize sclp_ipl_info Martin Schwidefsky
2007-12-20 15:20 ` [patch 38/47] vmemmap: allocate struct pages before 1:1 mapping Martin Schwidefsky
2007-12-20 15:20 ` Martin Schwidefsky [this message]
2007-12-20 15:20 ` [patch 40/47] arch/s390/: Spelling fixes Martin Schwidefsky
2007-12-20 15:20 ` [patch 41/47] include/asm-s390/: " Martin Schwidefsky
2007-12-20 15:20 ` [patch 42/47] drivers/s390/: " Martin Schwidefsky
2007-12-20 15:20 ` [patch 43/47] Move NOTES and BUG_TABLE Martin Schwidefsky
2007-12-20 15:20 ` [patch 44/47] single-step cleanup Martin Schwidefsky
2007-12-20 15:20 ` [patch 45/47] dasd: add hyper PAV support to DASD device driver, part 1 Martin Schwidefsky
2007-12-20 15:20 ` [patch 46/47] dasd: add hyper PAV support to DASD device driver, part 2 Martin Schwidefsky
2007-12-20 15:20 ` [patch 47/47] dasd: add hyper PAV support to DASD device driver, part 3 Martin Schwidefsky

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=20071220152111.582744811@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=holzheu@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@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).