Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp815523pxb; Thu, 15 Apr 2021 07:16:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA8JJ4vg09kgMd1QvDxvSPWn6i06+8HfPS0+44dca5LNMMTzS0hGBtDSlgQkXlk65qG2tR X-Received: by 2002:a63:c450:: with SMTP id m16mr3575849pgg.333.1618496202019; Thu, 15 Apr 2021 07:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618496202; cv=none; d=google.com; s=arc-20160816; b=l3yJJhW4y6xaQaLeVuKDfYdkrSaNq3hpeDH+wvsGDifpWehJtwHp//KgkUrtgHYFN2 8wzhm0QrLQNDEtFJDivWsdhwh5hUPCtd++ddmNdOyAwd9kURSwrTQhr5XKGzgyD4DJtq DgDHeU7K++8774Iu9Z5EP6vturN2FF8c7AcSyv5ktTWFEVBn8Gw3rmlnJ2HLpHOQfSrC l4DOJ5gaOr/iY9XL8WQuXSXw0T4Aq2CQwzuAaSSG6xO1hqhdFhPAd5VM35Bw8/fQ3qDg QZtO64zv0Pw7a7WTfrjrPuZe0ppZDBIsKE1zgwRWau2Ycg4D1+tGdFtxmMGK9ryeNapO nqtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4LBp7101dmY2zNfjuyvbHfVnUfy2AxDH+Qz4rZhFisk=; b=g7W7jkIC1wd1AsVQ/SfAQAopjfoVLIt5Ou5qEyTsivWyQA695QUHRJqXCXv3tX51eL 17dSvB61pEzVKrYoS7/SL+RsnWtjSfzBilxQEBvTdHbBRR3sTO+z7Q9vX73aojOfVbQ4 peK4xF4VGlohDYAK00FYtgi8qKToEMOGVOsoWKKeEg4HfyUPbZu7a7gmyr7OU6KdbPtx a5va9MqXfg7GYpU2kcnalagSuUOPK8984Trew7L7Q0FnZiQdGhcNA6TD/u/mFCpSuyR/ ILFPOx/2K4GcazVU2MlnjV7j6yz+muPRE0Wg8XE/CLuk8IEEmStE109q6u7/ZbrWHjLB YUhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kfgqJWsF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si11479plh.131.2021.04.15.07.16.29; Thu, 15 Apr 2021 07:16:41 -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=@kernel.org header.s=k20201202 header.b=kfgqJWsF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233289AbhDOOPA (ORCPT + 99 others); Thu, 15 Apr 2021 10:15:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:58728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233324AbhDOOO4 (ORCPT ); Thu, 15 Apr 2021 10:14:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 89B53611F1; Thu, 15 Apr 2021 14:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618496073; bh=yNptOTNB9XNO8218LdPcrvhxfXswOzhpZVCSbvOxAmU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kfgqJWsF5tn6cUwRDWluNMjgXy/U11l0WL8ddQrP7nWLp2Qajgwne6uMUVSgy5Qil RjGFs3iXZ+a+GmuJcNlyaQ9Kp4cP2UHwQkiA2Im5vOzZpW+nVaC88/tLn7eiME3FAT oLWFMQZ2Sk9+ZcsRUZiq9QbYkVYP89vomzLoYPPR5hFjyYmMqg1iN324KafucmZ0M8 wtnO8aU2O5M6QIIMS4lTqwMTreWJKCmjBfkepBz3oxaQJ0Tyxz1q2G93MYx/GLrU2i ++VqlH+fuBb/Yxpsx+PMm1MH3/AgAo4jnt+VOh7TzKJdMr3aNycEWABMHJdova9cmU oCoW19/SmKidA== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lX2lN-0000PF-Jy; Thu, 15 Apr 2021 16:14:33 +0200 Date: Thu, 15 Apr 2021 16:14:33 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Tetsuo Handa , Jiri Slaby Subject: Re: [PATCH 00/13] tty.h cleanups Message-ID: References: <20210408125134.3016837-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 10:21:54AM +0200, Greg Kroah-Hartman wrote: > On Fri, Apr 09, 2021 at 09:32:45AM +0200, Johan Hovold wrote: > > On Thu, Apr 08, 2021 at 08:01:08PM +0200, Greg Kroah-Hartman wrote: > > > On Thu, Apr 08, 2021 at 04:25:22PM +0200, Johan Hovold wrote: > > > > On Thu, Apr 08, 2021 at 02:51:21PM +0200, Greg Kroah-Hartman wrote: > > > > > Turns out there is a lot of tty-internal stuff in include/linux/tty.h > > > > > that do not belong there. Create a internal-to-the-tty-layer .h file > > > > > for these types of things and move function prototypes to it instead of > > > > > being in the system-wide header file. > > > > > > > > > > Along the way clean up the use of some old tty-only debugging macros and > > > > > use the in-kernel dev_*() calls instead. > > > > > > > > I'm afraid that's not a good idea since not all ttys have a > > > > corresponding class device. Notable exception include pseudo terminals > > > > and serdev. > > > > > > > > While dev_printk() can handle a NULL device argument without crashing, > > > > we'll actually lose log information by removing the tty printk helpers. > > > > > > I think the same info will be printed here as before, just some NULL > > > information at the beginning, right? And the benifits overall (for real > > > tty devices), should outweigh the few devices that do not have this > > > information. > > > > No, you'll only be losing information (tty driver and tty name). Here's > > a pty example, where the first line in each pair use dev_info() and the > > second tty_info(): > > > > [ 10.235331] (NULL device *): tty_get_device > > [ 10.235441] ptm ptm0: tty_get_device > > > > [ 10.235586] (NULL device *): tty_get_device > > [ 10.235674] pts pts0: tty_get_device > > > > and similar for serdev, which is becoming more and more common. > > Ok, good point, I'll go apply only the first 2 patches in this series > (moving the macros out of tty.h and removing the unused one) and then > will redo this set of patches again. Perhaps no harm in leaving the tty_info() on in there for consistency. We have users of the _ratelimited() flavour of it (even if there's no dependency). > I think a better tty_msg() macro is warrented so that we can provide > dev_*() output if we have a device, otherwise fall back to the old > style to preserve functionality. Possibly, but the dev_printk() for the tty class devices wouldn't provide any more info than what's already there (i.e. driver name + tty name). (And associating ttys with other devices and drivers (e.g. a serdev client and its driver) might not be what we want since you lose the connection to the underlying tty driver.) Johan