Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1740980ybl; Thu, 30 Jan 2020 05:16:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyolvX/bN159SgJHpCrtHhits8EZKbSPDT7h1AEF60TuKtb7LNey3srkEekXLSpG1c825qc X-Received: by 2002:aca:d4ca:: with SMTP id l193mr2888786oig.133.1580390208604; Thu, 30 Jan 2020 05:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580390208; cv=none; d=google.com; s=arc-20160816; b=LVqXGk3krOh8IzLMc/P0n/pkB/wf3lTQar765CgEg5EhuF+shjGH1C6Nj5hx2viBFh ONaeAgcBySWFH3H99TI2VheEX5KymscLZwEZdQR/i5yf6sOHTdyuTyboqxkElug+duFE f9SBtFKGu5xQXhgZDKnvMjxZHHAiCjyr/jW0T7Gdj14WnKkY9xcOim1f/bzYEaAghTOS H3ViS9+a1KZQtg1yu7wD1BoD45DBZ5NUulznlE7+Rohto9nVKSNDuDdJ/Sis4hsbK7Lt gdiXVKuhDN4P5uSTOWr5x3JsdrxsOZv5IyFC18uLvkngV70Dn3XiGIdyC+gO6R/D6RPj HA+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kAIRdGS+c76YWcNKHypg3kw4AbZNqqc3YGod7rk6Uvc=; b=OK55p3PvtiA//GAUfWs3oZIuY7YvWOPlyQrU+Ze9IWEJ/lWVpWiIEnolwOSPzg6Xnc hKCeOvt17D3W4DIo742RjvtJzY3ZQvz5xyYNfM3cySlEJEB8MhFDqWXF2UgOM0k23pI4 DM8Ln6oylEj73l/K1ZLINCiWwZymonbCL0pJgKpYhRM69rlOl66TEUaQamddjJkM/KU+ ZNV+Lyd2tVFMlitpEP8ycilG9XkFDI4nP4JxivvUkyQcBA+UC2KpMSnkrKqT2PjciAXu /THOYWJm96NST9E9I5abn2bWt+541+lstr6If+gQN2U9QlTsl68fzYq3BGz4+uuVkkuv lkjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si1990665otp.168.2020.01.30.05.16.35; Thu, 30 Jan 2020 05:16:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727270AbgA3NPh (ORCPT + 99 others); Thu, 30 Jan 2020 08:15:37 -0500 Received: from mga06.intel.com ([134.134.136.31]:37750 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726980AbgA3NPh (ORCPT ); Thu, 30 Jan 2020 08:15:37 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2020 05:14:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,382,1574150400"; d="scan'208";a="232923285" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga006.jf.intel.com with ESMTP; 30 Jan 2020 05:14:26 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1ix9eN-0006n1-MV; Thu, 30 Jan 2020 15:14:27 +0200 Date: Thu, 30 Jan 2020 15:14:27 +0200 From: Andy Shevchenko To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Petr Mladek , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 5/5] console: Introduce ->exit() callback Message-ID: <20200130131427.GZ32742@smile.fi.intel.com> References: <20200127114719.69114-1-andriy.shevchenko@linux.intel.com> <20200127114719.69114-5-andriy.shevchenko@linux.intel.com> <20200128051711.GB115889@google.com> <20200128094418.GY32742@smile.fi.intel.com> <20200129134141.GA537@jagdpanzerIV.localdomain> <20200129142558.GF32742@smile.fi.intel.com> <20200129151243.GA488@jagdpanzerIV.localdomain> <20200129165053.GA392@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200129165053.GA392@jagdpanzerIV.localdomain> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 30, 2020 at 01:50:53AM +0900, Sergey Senozhatsky wrote: > On (20/01/30 00:12), Sergey Senozhatsky wrote: > > On (20/01/29 16:25), Andy Shevchenko wrote: > > > I understand. Seems the ->setup() has to be idempotent. We can tell the same > > > for ->exit() in some comment. > > > > > > Can you describe, btw, struct console in kernel doc format? > > > It will be very helpful! > > > > We probably need some documentation. > > > > > > > In both cases we will get the console to have CON_ENABLED flag set. > > > > > > > > And there are sneaky consoles that have CON_ENABLED before we even > > > > register them. > > > > > > So, taking into consideration my comment to the previous patch, what would be > > > suggested guard here? > > > > > > For a starter something like this? > > > > > > if ((console->flags & CON_ENABLED) && console->exit) > > > console->exit(console); > > > > This will work if we also add something like this > > No, wait... This will not work, console can be suspended, yet > still registered. I think the only criteria is "the console is > on the list". Okay, I guess we need to drop CON_ENABLE bits from this patch and rely on the res value instead. -- With Best Regards, Andy Shevchenko