Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp214613ybs; Sun, 24 May 2020 03:04:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu0e0OdFKNKXtmoE6iSTtoDCIujeP2UvW/NZz1sQewPUwSy4ZDtAftXDgy0gtGsLXIWcvg X-Received: by 2002:aa7:d0d9:: with SMTP id u25mr9749118edo.377.1590314679327; Sun, 24 May 2020 03:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590314679; cv=none; d=google.com; s=arc-20160816; b=SmwkZEnGOO3fD5x+mHp6jvQyU609DBEz5q1rCPtt2cCWb/8GAYpuythyod3yBDXtax UQ6Lw21/5VVE1OeV/lQaUXtCdjpWa77iPTE0mwhg5IFVmUtkh8XaILMCfc6CCVDdq0nL xhMYpnxoIE4Fc35wPU5a0jgfIMfprczhR55B/Yi+ZrjNqjjSK1XbINPBheKxhGaQi245 MihGeB+hK6Abp0N0fkmek7GmHo4MQ1x5OFBSZjE+Smn6TAmwDmkLcbHCbDgeramemLOW ILgG0NLuxfRBNMItiboHWReRuqgko08OBglajmJExPd0rOWxlzRMMomwp9vnOQ1rV4fA wuRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oTajmnohfywFupxs957CWHHjqHcvTI6e5RfNGOZbkGc=; b=G5NEfE65V3YOxkdGSSzRl1qetwCxBaiTHC5SiDLtucphXkd+UG8jmcJJbNrK189TlV snN5gu0Vvtw27/Mlh60NqiPCPRaBhiUH7QxlIbYffa2VEy30Vfwux6jBACVWowtOFaQj 6gW6OPF+KziEHlKf7y/RWFl3T00r0gyvQsoJIN4Zu5BxKXasPfuffuHVKbROC2Ou/IJ0 SVyS/nBTyI8BXglCljRlYV/BuyjNCkVv13gub6B64RB+OqWthFv8aMtkHjClUlyTZ/s+ gkMdR0tXkpy9Fthzis5z0F/st6X+nf3jFrFrp2yZfJS/kSvujePlccSfYh1Us0/VMGDj UteQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=YhvL8fVd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oq26si7477211ejb.727.2020.05.24.03.04.16; Sun, 24 May 2020 03:04:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=YhvL8fVd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729343AbgEXKBd (ORCPT + 99 others); Sun, 24 May 2020 06:01:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728704AbgEXKBc (ORCPT ); Sun, 24 May 2020 06:01:32 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B757C05BD43 for ; Sun, 24 May 2020 03:01:32 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id v128so13636067oia.7 for ; Sun, 24 May 2020 03:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oTajmnohfywFupxs957CWHHjqHcvTI6e5RfNGOZbkGc=; b=YhvL8fVdrbh3XfLrAXLRTb2lrsFdJKPZBC6VFogb/a+IDT4r6kXTNEpClNwyN8xzoX PovzcKVQCCTTp5jpI9t388nRIm2CpbShnPhMKTsl833/Zg4Q1qitewLWEkU2FdyShT0z QvgtbKq2j46QJSYyUHZ80XmbHJUMjmUBIqLlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oTajmnohfywFupxs957CWHHjqHcvTI6e5RfNGOZbkGc=; b=GJygv0bmFDdfXFm/GP3+DAFHxZOi66cNHyti/Lk61JzeZbl3Wr8+k+PUgqqtCFpjqq D8T4JkwRjXnxEVp7MoE2k5biYeLB1oCifM8uDyP5H+Pt9AbrEVZsS+usGpWFDQFieMQ+ ew1049gL+FMx5L5n+IL/IyzdJsSL5ibARmmd/a1p0oEBBEXL+zN6uREg3m98NEv6fNtK tKX/zDYt7W3orltdFOG0nAQaBJ7oXl9nU8qg8mWFHDD78/m0mQcI+DZpeGFlCQCW825S Bid53+8Hb+jI6BA4KLLwglmqApfMxXQTdJUhLpRN8hWUjo7Xf0n8KlxaKSkqtiZ+Mwap Td3Q== X-Gm-Message-State: AOAM532bB6sajNJ1yq/ZaS/6wH/joHP8Xfur0NwSMIk0AvvwHcWmcJbq Y/yJSfDG813vw/JgxX0z7iw0kh7EczkHCA1XJr53Ag== X-Received: by 2002:aca:4b91:: with SMTP id y139mr7314961oia.128.1590314491735; Sun, 24 May 2020 03:01:31 -0700 (PDT) MIME-Version: 1.0 References: <20200430161438.17640-1-alpernebiyasak@gmail.com> <20200430161438.17640-2-alpernebiyasak@gmail.com> <20200513053529.GL413@jagdpanzerIV.localdomain> In-Reply-To: <20200513053529.GL413@jagdpanzerIV.localdomain> From: Daniel Vetter Date: Sun, 24 May 2020 12:01:20 +0200 Message-ID: Subject: Re: [RFC PATCH v2 1/3] printk: Add function to set console to preferred console's driver To: Sergey Senozhatsky Cc: Alper Nebi Yasak , Greg Kroah-Hartman , Jiri Slaby , Petr Mladek , linux-serial@vger.kernel.org, Steven Rostedt , Linux ARM , Linux Kernel Mailing List , Andrew Morton , Andy Shevchenko , Arvind Sankar , Benjamin Herrenschmidt , "David S. Miller" , Feng Tang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 7:35 AM Sergey Senozhatsky wrote: > > On (20/04/30 19:14), Alper Nebi Yasak wrote: > [..] > > +int update_console_to_preferred(void) > > +{ > > + struct console_cmdline *c = NULL; > > + struct console *con = NULL; > > + struct console *tmp = NULL; > > + > > + if (preferred_console >= 0) > > + c = &console_cmdline[preferred_console]; > > + > > + if (!c || !c->name[0]) > > + return 0; > > + > > + for_each_console(con) { > > + if (!con->next || !(con->next->flags & CON_ENABLED)) > > + continue; > > + if (strcmp(c->name, con->next->name) != 0) > > + continue; > > This matches the consoles by exact name. Consoles can have aliases, > but matching by alias is rather complex and it has some side effects. > > Let me Cc more people on this. VT has a console takeover logic, > I wonder if we can extend the takeover code somehow. > > Daniel, any thoughts? Apologies for late reply, but nope, no thoughts. I have some ideas for the locking in the console subsystem, but that's just to untangle it from gpu drivers as much as possible. Otherwise I'm trying to stay away from it as far as I can :-) Cheers, Daniel > > https://lore.kernel.org/lkml/20200430161438.17640-1-alpernebiyasak@gmail.com > > -ss -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch