Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964839AbcJYBat (ORCPT ); Mon, 24 Oct 2016 21:30:49 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:36434 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932496AbcJYBaq (ORCPT ); Mon, 24 Oct 2016 21:30:46 -0400 Subject: Re: Regression in 4.9-rc1 for PPC32 - bisected to commit 05fd007e4629 To: Paul Burton References: <2ccf74f5-5fa2-2f47-ade1-69addc79c40b@lwfinger.net> <12861176.dsDn9QJUZZ@np-p-burton> Cc: Thorsten Leemhuis , LKML , Andrew Morton From: Larry Finger Message-ID: Date: Mon, 24 Oct 2016 20:30:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <12861176.dsDn9QJUZZ@np-p-burton> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3153 Lines: 65 I have a hack that works. Perhaps it will give a bit more understanding so that a proper patch can be created. My changes were applied on top of 4.9-rc1 with the patch from https://www.linux-mips.org/archives/linux-mips/2016-10/msg00130.html, and were as follows: Index: linux/kernel/printk/printk.c =================================================================== --- linux.orig/kernel/printk/printk.c 2016-10-24 12:29:17.838938604 -0500 +++ linux/kernel/printk/printk.c 2016-10-24 19:31:20.012593000 -0500 @@ -2657,7 +2657,9 @@ * didn't select a console we take the first one * that registers here. */ - if (preferred_console < 0 && !of_specified_console) { + pr_info("Before: newcon->device %p, newcon->setup %p\n", newcon->device, newcon->setup); + if ((preferred_console < 0 && !of_specified_console) || + !newcon->setup) { if (newcon->index < 0) newcon->index = 0; if (newcon->setup == NULL || @@ -2670,6 +2672,7 @@ } } + pr_info("After: newcon->device %p, newcon->setup %p\n", newcon->device, newcon->setup); /* * See if this console matches one we selected on * the command line. The changes in commit 05fd007e4629 prevent the body of the 'if ((preferred_console < 0 ...' loop from ever being executed; however, the failure indicates that we do need to go through this code at least once. I tested various quantities, and !newcon->setup was the only one that helped. The outputs from the pr_info statements above and the changes in console as shown by 'dmesg | egrep "console|newcon" are: [ 0.000000] Before: newcon->device (null), newcon->setup (null) Part of the body of if executed [ 0.000000] After: newcon->device (null), newcon->setup (null) [ 0.000000] bootconsole [udbg0] enabled [ 0.001581] Before: newcon->device c0326e34, newcon->setup (null) We now have newcon->device set, Part of body of if executed [ 0.001934] After: newcon->device c0326e34, newcon->setup (null) [ 0.002285] console [tty0] enabled [ 0.002595] bootconsole [udbg0] disabled [ 0.002913] Before: newcon->device c032cc4c, newcon->setup c032cc80 This time the body of if is not executed and will not be executed anymore. [ 0.002925] After: newcon->device c032cc4c, newcon->setup c032cc80 [ 0.002943] Before: newcon->device c0331ad8, newcon->setup c0331c34 [ 0.002956] After: newcon->device c0331ad8, newcon->setup c0331c34 [ 0.003060] Before: newcon->device c0331ad8, newcon->setup c068dbc8 [ 0.003074] After: newcon->device c0331ad8, newcon->setup c068dbc8 [ 0.003322] Before: newcon->device c0331ad8, newcon->setup c068ddc4 [ 0.003335] After: newcon->device c0331ad8, newcon->setup c068ddc4 [ 1.993661] Before: newcon->device c0331ad8, newcon->setup c068dbc8 [ 1.993759] After: newcon->device c0331ad8, newcon->setup c068dbc8 [ 1.994395] Before: newcon->device c0331ad8, newcon->setup c068dbc8 [ 1.994492] After: newcon->device c0331ad8, newcon->setup c068dbc8 Larry