From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04030C388F9 for ; Wed, 11 Nov 2020 13:55:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87C282074B for ; Wed, 11 Nov 2020 13:55:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="MmgmHT3+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727131AbgKKNzV (ORCPT ); Wed, 11 Nov 2020 08:55:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:33754 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727019AbgKKNzM (ORCPT ); Wed, 11 Nov 2020 08:55:12 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1605102911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=n7osxaBOy/mjei5z0b2nj94AHyccmDW0Rw8P9uQpbXE=; b=MmgmHT3+cSWwLQk+pJ4jogk8fV4g+2I7/M4GsUpXzqC2zLVwsNPGzNQ2vgg7yIH2yUwUR4 YTHPg7n8/JJh9ccHv7RWdrDJY9exww3K4gFiPH2WZtQ8aBE72Z4g0wTXU/X84a7myGad6U igRxRY0wiPrRo8djcyI1kf85aixw5Bk= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7B93EABD1; Wed, 11 Nov 2020 13:55:11 +0000 (UTC) From: Petr Mladek To: Sergey Senozhatsky , Steven Rostedt , John Ogness Cc: Linus Torvalds , Guenter Roeck , Shreyas Joshi , shreyasjoshi15@gmail.com, Greg Kroah-Hartman , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 0/2] printk/console: Use ttynull when no console is available or wanted Date: Wed, 11 Nov 2020 14:54:48 +0100 Message-Id: <20201111135450.11214-1-pmladek@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is another attempt to solve regression caused by the commit 48021f98130880dd74 ("printk: handle blank console arguments passed in."). It prevented a crash caused by empty console= parameter. But it caused performance problems on Chromebooks because they use it to disable all consoles, see see https://lore.kernel.org/r/20201006025935.GA597@jagdpanzerIV.localdomain Solve both problems by using ttynull console driver that was crated exactly for this purpose. The 1st patch should prevent the crash for any invalid console name. The 2nd patch allows to used the ttynull driver also with the widely used console= and console=null parameters. Best Regards, Petr Petr Mladek (2): init/console: Use ttynull as a fallback when there is no console printk/console: Allow to disable console output by using console="" or console=null drivers/tty/Kconfig | 14 -------------- drivers/tty/Makefile | 3 +-- drivers/tty/ttynull.c | 18 ++++++++++++++++++ include/linux/console.h | 3 +++ init/main.c | 10 ++++++++-- kernel/printk/printk.c | 9 ++++++++- 6 files changed, 38 insertions(+), 19 deletions(-) -- 2.26.2