Skip to contentSkip to conversation

s390 patches for v2.6.31-rc7

GIT PULL Martin Schwidefsky 3 participants 3 messages Aug 23, 2009 – Aug 24, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

please pull from 'for-linus' branch of

	git://git390.marist.edu/pub/scm/linux-2.6.git for-linus

to receive the following updates:

Hendrik Brueckner (1):
[S390] set preferred console based on conmode

Julia Lawall (1):
[S390] drivers/s390: put NULL test before dereference

Sebastian Ott (1):
[S390] cio: fix double free after failed device initialization

 arch/s390/kernel/setup.c  |   25 ++++++++++++++++++-------
 drivers/s390/block/dasd.c |    2 +-
 drivers/s390/cio/device.c |    4 +---
 3 files changed, 20 insertions(+), 11 deletions(-)
arch/s390/kernel/setup.c +18 -7
index 9717717..cbb897b 100644
@@ -154,6 +154,20 @@ static int __init condev_setup(char *str)
 
 __setup("condev=", condev_setup);
 
+static void __init set_preferred_console(void)
+{
+	if (MACHINE_IS_KVM) {
+		add_preferred_console("hvc", 0, NULL);
+		s390_virtio_console_init();
+		return;
+	}
+
+	if (CONSOLE_IS_3215 || CONSOLE_IS_SCLP)
+		add_preferred_console("ttyS", 0, NULL);
+	if (CONSOLE_IS_3270)
+		add_preferred_console("tty3270", 0, NULL);
+}
+
 static int __init conmode_setup(char *str)
 {
 #if defined(CONFIG_SCLP_CONSOLE) || defined(CONFIG_SCLP_VT220_CONSOLE)
@@ -168,6 +182,7 @@ static int __init conmode_setup(char *str)
 	if (strncmp(str, "3270", 5) == 0)
 		SET_CONSOLE_3270;
 #endif
+	set_preferred_console();
         return 1;
 }
 
@@ -780,9 +795,6 @@ static void __init setup_hwcaps(void)
 void __init
 setup_arch(char **cmdline_p)
 {
-	/* set up preferred console */
-	add_preferred_console("ttyS", 0, NULL);
-
         /*
          * print what head.S has found out about the machine
          */
@@ -802,11 +814,9 @@ setup_arch(char **cmdline_p)
 	if (MACHINE_IS_VM)
 		pr_info("Linux is running as a z/VM "
 			"guest operating system in 64-bit mode\n");
-	else if (MACHINE_IS_KVM) {
+	else if (MACHINE_IS_KVM)
 		pr_info("Linux is running under KVM in 64-bit mode\n");
-		add_preferred_console("hvc", 0, NULL);
-		s390_virtio_console_init();
-	} else
+	else
 		pr_info("Linux is running natively in 64-bit mode\n");
 #endif /* CONFIG_64BIT */
 
@@ -851,6 +861,7 @@ setup_arch(char **cmdline_p)
 
         /* Setup default console */
 	conmode_default();
+	set_preferred_console();
 
 	/* Setup zfcpdump support */
 	setup_zfcpdump(console_devno);
drivers/s390/block/dasd.c +1 -1
index 7498366..3f62dd5 100644
@@ -2135,9 +2135,9 @@ static int dasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
 	struct dasd_device *base;
 
 	block = bdev->bd_disk->private_data;
-	base = block->base;
 	if (!block)
 		return -ENODEV;
+	base = block->base;
 
 	if (!base->discipline ||
 	    !base->discipline->fill_geometry)
drivers/s390/cio/device.c +1 -3
index 3c57c1a..d593bc7 100644
@@ -772,10 +772,8 @@ static struct ccw_device * io_subchannel_create_ccwdev(struct subchannel *sch)
 	cdev = io_subchannel_allocate_dev(sch);
 	if (!IS_ERR(cdev)) {
 		ret = io_subchannel_initialize_dev(sch, cdev);
-		if (ret) {
-			kfree(cdev);
+		if (ret)
 			cdev = ERR_PTR(ret);
-		}
 	}
 	return cdev;
 }
#1 lore raw

arch/s390/kernel/setup.c static int __init condev_setup(char *str) · line 163

Quoted 7 lines · Martin Schwidefsky
arch/s390/kernel/setup.c +7 -0
+static void __init set_preferred_console(void)
+{
+	if (MACHINE_IS_KVM) {
+		add_preferred_console("hvc", 0, NULL);
+		s390_virtio_console_init();
+		return;
+	}

Why this early return instead of else if as all options are mutually exclusive? Also why do you init the virtio console here instead of an console_initcall?

Bastian

Signature · 2 lines
Four thousand throats may be cut in one night by a running man.
		-- Klingon Soldier, "Day of the Dove", stardate unknown
#2 lore raw

Bastian,

thanks for your feedback.

Quoted 12 lines · Bastian Blank

arch/s390/kernel/setup.c static int __init condev_setup(char *str) · line 163

Quoted 7 lines · Martin Schwidefsky
arch/s390/kernel/setup.c +7 -0
+static void __init set_preferred_console(void)
+{
+	if (MACHINE_IS_KVM) {
+		add_preferred_console("hvc", 0, NULL);
+		s390_virtio_console_init();
+		return;
+	}

Why this early return instead of else if as all options are mutually exclusive? Also why do you init the virtio console here instead of an console_initcall?

This is a bug fix to set the respective preferred console device for conmode=3270. To make as few changes as possible for -rc7, the console initialization for kvm has been moved to the new function.

You are right that s390_virtio_console_init() should be called from a console_initcall(). I started working on another patch to solve this issue for the next kernel release.

Best regards,
Hendrik