Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3375999pxu; Tue, 15 Dec 2020 05:45:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6E7YGWOeykGP/eAbqWaYgVJMwBPROFX5btJA03CLEx0uC3doRY3v/yoMKbDMy4XXUKOJ1 X-Received: by 2002:a17:906:2ec3:: with SMTP id s3mr26074691eji.133.1608039910687; Tue, 15 Dec 2020 05:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608039910; cv=none; d=google.com; s=arc-20160816; b=Nj5rMfgvt1vGFTAbhDFiNhaW0662AcCDON4nPKuTrQFuxuDhFzGpMKxmQ/o4DCnjJ7 N88X8B178Q2xfqObIXPwe01Pm/GM0fWVeU2h3aY831e3YKCTxjagCuUGOjxzYaYOZTKO ukPslmlyTOsvCUOYndgtiS3XCrqk2CssmZ+5BN4bJMFnKtmu2DyPQjPJ0nkIu4WChkJG 6skDMUo4+VYMGxnb5RoUk4gCfMTiaZ0AYa4j1JD/0HRi+dzwPtSiBa4c6pZdiCITMTm2 fWSubw+VgtZWc4xglxz1kB5IX5GIxadwLAfbVBa8sS+RQWt/jyuksiJbrnsmba+ru2E0 Fe9g== 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:dkim-signature:date; bh=XMHv+5XWg3zxxyo7BekzWTU3litECNIW6F9+NkiEFs8=; b=h4XT7F2q4AJ2NH5tz5TGScKy8ZrHIVo3Bc9nhUGef2aVOx5+wttCwYF0GkwuwajRzi J/uq8pxrQJL3A+YuUFOyWwTOWfIT+lfqipc1g/pzf4pXbbih8L3mPHlnja9ufZXaSoGn yUDR+oW2lXp6adGM4FGyd5mIMyP/Y2v99yeb/EFkOGy4+A7va8raL+CpMWFUCr/HP1/4 mR1GwSjSLGUI/jar+015TrN9FayaWoNPsPADnDnFbaIzWM8DiVwRD6KKVOVms76fRSit mGSAdXwDYIOPKRkq/bB3gL4d7/XOw6pHs0UccK72QArEZ1SqEkO/gBXpxUT6nuAYEoqv k/Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=STwVhRbf; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq1si829952ejc.530.2020.12.15.05.44.47; Tue, 15 Dec 2020 05:45:10 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=STwVhRbf; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727749AbgLONmb (ORCPT + 99 others); Tue, 15 Dec 2020 08:42:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:56020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbgLONmL (ORCPT ); Tue, 15 Dec 2020 08:42:11 -0500 Date: Tue, 15 Dec 2020 14:42:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1608039685; bh=U7sArIse/lC1cpJE43lNUsLHNdapp6/fPV9X9nwe6ZQ=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=STwVhRbf3hb5ELDjzZdd7pppM3CsZAsqPYfz59AkU7Vq67Wj/GxHwB7JSzQgVpT8E ZvxLKL9QVebz5w1laiC7+C0x91AqL4MpBBPiERgnAF41+uuGKYaD9WMMCuhpp5INgg HeGXfwPk1Fy31P1g8TlyOMwAxZ7n5FrEVmKj5iJw= From: Greg Kroah-Hartman To: Flavio Suligoi Cc: Jiri Slaby , "Gustavo A . R . Silva" , Ji-Ze Hong , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name Message-ID: References: <20201214131445.954822-1-f.suligoi@asem.it> 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 Tue, Dec 15, 2020 at 01:35:31PM +0000, Flavio Suligoi wrote: > Hi Greg, > > > > > > > switch (chip) { > > > case CHIP_ID_F81865: > > > + chip_name = "F81865"; > > > + break; > > > case CHIP_ID_F81866: > > > + chip_name = "F81866"; > > > + break; > > > case CHIP_ID_F81966: > > > + chip_name = "F81966"; > > > + break; > > > case CHIP_ID_F81216AD: > > > + chip_name = "F81216AD"; > > > + break; > > > case CHIP_ID_F81216H: > > > + chip_name = "F81216H"; > > > + break; > > > case CHIP_ID_F81216: > > > + chip_name = "F81216"; > > > break; > > > default: > > > return -ENODEV; > > > } > > > > > > pdata->pid = chip; > > > + > > > + pr_info("%s%s%s Fintek %s\n", > > > + uart->port.dev ? dev_name(uart->port.dev) : "", > > > + uart->port.dev ? ": " : "", > > > + uart->port.name, > > > + chip_name); > > > > Drivers, if all goes well, should not print anything to the kernel log. > > This isn't ok. > > > > And even if it was, dev_info() would be the correct thing to do... > > Ok, too many information in the driver. > > But what do you think about the possibility to introduce > a new additional field, in "serial8250_config" structure, > such as "extra_name" or something like this: > > struct serial8250_config { > const char *name; > const char *extra_name; > unsigned short fifo_size; > unsigned short tx_loadsz; > unsigned char fcr; > unsigned char rxtrig_bytes[UART_FCR_R_TRIG_MAX_STATE]; > unsigned int flags; > }; > > In this way, if required, each driver can fill this > additional field, for example adding the name of > the particular uart chip or other useful info. > > As result, for example, the "uart_report_port" function output > could be something like this: > > 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A - Fintek F81216AD > 00:02: ttyS3 at I/O 0x2e8 (irq = 11, base_baud = 115200) is a 16550A - Fintek F81216AD > > where the "extra_name", if not empty, is printed > at the end of the line. > For practical space reasons, the "extra_name" length > can be limited to 16 chars. Why? What tool will use this, and why would userspace care about it? What problem are you trying to solve here? thanks, greg k-h