Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3348214ybl; Mon, 27 Jan 2020 02:15:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxZEPV8Om/3Wzuv+Ad5LGhZu316GfDkpvlbzCwM6jrWuGChn08D0fZTAXdr/uZOSxjahnF7 X-Received: by 2002:a05:6808:907:: with SMTP id w7mr6910009oih.91.1580120143102; Mon, 27 Jan 2020 02:15:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580120143; cv=none; d=google.com; s=arc-20160816; b=iRxwmuKV2gnfpmQzggl3L8144QbxG/qBYmfUdFt56RygyaY3OWWaHxD+koCIGWNOC0 a7ZFn1Ql2qtBQtH+NxfX5BL4ObyyU7uCTRZQGgZnx8Cr+uOBfD4F5c/MEQIN/kyUJ/yx 1sw2ASXNwXTKYRJAMfYowEbbpnLb7FywfnWIxzJX743BXW9nhfOGi2DrdN6ys92AhMiG AoWXESKyXopgqfmDn35eP4RQXxSWTI4YAL/GeEqDA28yB5FtXGk3r/X/rx1Rp2UF/ykO 2ZzWdK1RmUjP/kBbyElvvpGCX0UabHgveyxgfRpEs/IQCs83bkkL3P4zPXXP8WqaOoDP QK2Q== 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=2Qr7ym9Jre1munTyWC8mYqRCTELgHyMZ9j3404dN5ps=; b=MP0Sg6FEB47w1TCbKTkkht4vfDQ5jmn8j5mDvVoH8Ysle3xZ+0ol8lHeiBcARcS8lB I+vEq5ohXWg0Eca3i72C157n7k0PNDG3P1knBtrTEi/JSTtSzdgkZT6Kb1xLwLjdeNs8 tle1WIAjlQBH/Sz3NQy5FufO8CMNRFR16eMjS6xyaA20D7jh2t0NBDmqpZZLttNPfJoD yuDmY+xdYho04o7RkdWZHrjzs9+shc3ZYZvNXdNavsldT6y7w2XCvGuviKLVZvu+sRUa I+Ywb3BdMDQgapuBC1Yo38Kljs+KDPfc/BwNfAtoLbOuURhFAmFXW6OBN4u74MMdZY2H E3Rw== 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 30si6372689otr.75.2020.01.27.02.15.31; Mon, 27 Jan 2020 02:15:43 -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 S1729765AbgA0Jog (ORCPT + 99 others); Mon, 27 Jan 2020 04:44:36 -0500 Received: from mga06.intel.com ([134.134.136.31]:21727 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729308AbgA0Jog (ORCPT ); Mon, 27 Jan 2020 04:44:36 -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; 27 Jan 2020 01:42:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,369,1574150400"; d="scan'208";a="231376760" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga006.jf.intel.com with ESMTP; 27 Jan 2020 01:42:34 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1iw0uh-0001t3-NU; Mon, 27 Jan 2020 11:42:35 +0200 Date: Mon, 27 Jan 2020 11:42:35 +0200 From: Andy Shevchenko To: Sergey Senozhatsky Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/5] console: Introduce ->exit() callback Message-ID: <20200127094235.GS32742@smile.fi.intel.com> References: <20200124155733.54799-1-andriy.shevchenko@linux.intel.com> <20200124155733.54799-5-andriy.shevchenko@linux.intel.com> <20200127022220.GB100275@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200127022220.GB100275@google.com> 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 Mon, Jan 27, 2020 at 11:22:20AM +0900, Sergey Senozhatsky wrote: > On (20/01/24 17:57), Andy Shevchenko wrote: > [..] > > +++ b/include/linux/console.h > > @@ -148,6 +148,7 @@ struct console { > > struct tty_driver *(*device)(struct console *, int *); > > void (*unblank)(void); > > int (*setup)(struct console *, char *); > > + void (*exit)(struct console *); > > int (*match)(struct console *, char *name, int idx, char *options); > > short flags; > > short index; > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > > index da6a9bdf76b6..0319bb698d05 100644 > > --- a/kernel/printk/printk.c > > +++ b/kernel/printk/printk.c > > @@ -2850,6 +2850,9 @@ int unregister_console(struct console *console) > > if (console_drivers != NULL && console->flags & CON_CONSDEV) > > console_drivers->flags |= CON_CONSDEV; > > > > + if (console->exit) > > + console->exit(console); > > + > > console->flags &= ~CON_ENABLED; > > console_unlock(); > > console_sysfs_notify(); > > Do you need to call ->exit() under console_lock? I think we don't need that lock to be held. -- With Best Regards, Andy Shevchenko