Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp157361lqb; Tue, 16 Apr 2024 11:30:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3l74NV6EWkBil5QCSRIF7piPIGfAPHCdTg9bjl6WVpzWn151s5iPvFms76VSOOcQ8uatF8gooUxuSxh9PpFGaGkIWJoi2NjBt6CI1oQ== X-Google-Smtp-Source: AGHT+IHWoPxY2JBI75tYzKIOhbLsUhZNJ6kIdOeHc/73Nr5i3IIeMNJwYrvCmpmw2XNMVE2wXCKj X-Received: by 2002:a17:903:124d:b0:1e7:b6f4:2d75 with SMTP id u13-20020a170903124d00b001e7b6f42d75mr4628075plh.6.1713292239262; Tue, 16 Apr 2024 11:30:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713292239; cv=pass; d=google.com; s=arc-20160816; b=SLJxjrn8gjQ7OSdP18tNiabZClhsXZZ4ZIjId7/lKwfaQ5NLXT/9shPbKIfyzPxC5m w6pvc2+dvWQzlTEsXuuXBRjojXzBRh1wTLyXxzRM7At2dlDDtCyDI3gH7uEa9Mf5pGnp acwoOmH5e3agncZ9EwGJpsTplDEmU6f3OGL7/lkcMf1sbBoR60Aqhh6DvDsjds8f+P1b Ea5R4HIaGjn36JMRWqCi2wJKp1BT46rBgNxpCEVtwEhQnxipI434hV3Q8/GUNrgQT7JG uVVZYzmvfY97xSkAhE+ofjONscu+7Yo4PWdpoQLur+uWKM2BeDg88yGw+V7j6fxpd9+D 5cig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=62YpHOvZnZ8olaQOV9AE7phGelntP6xtyhEl8JdkA54=; fh=YdUSswXC5mJ2xg94FpOMeF/EMgqf5AA86Gep/RT4GVU=; b=zeFYXF/3Ysb/3RcOVMtUZSZ7xNuKVuKWIuwWzL8l1mnB+C3SgAAgmab9JvvlAv0gYH AYfqGjl1FtDqj45lyuy215dDjTe4X62iHkW4mHLRfEeFn47UEHcm2s2TvMiGI9kUJ8GG 6oJw1xsIWpGHNy9yHm0+vi4QcI0QNNc30OT2CowSLNdwvPwerPYaQFOunFn+U1/pqRog w3NpYul3xHZ1WqZYWelb9IYahOcx/RPdz9lPMrhAVhsFoUTH7Kj54UOYHhjmESkaEOcu 1bAT0MN3KvTIPMVEY3zjF0eXYW4hhUBLKlJbp159xHXXmpwoKIarH8N76IzTRQDvi2/6 m63w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b=Wg4PaEEn; arc=pass (i=1 spf=pass spfdomain=pm.me dkim=pass dkdomain=pm.me dmarc=pass fromdomain=pm.me); spf=pass (google.com: domain of linux-kernel+bounces-147386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q16-20020a170902789000b001e4621295c7si9681486pll.344.2024.04.16.11.30.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 11:30:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b=Wg4PaEEn; arc=pass (i=1 spf=pass spfdomain=pm.me dkim=pass dkdomain=pm.me dmarc=pass fromdomain=pm.me); spf=pass (google.com: domain of linux-kernel+bounces-147386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0ADDAB21E18 for ; Tue, 16 Apr 2024 18:30:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F74C136E0C; Tue, 16 Apr 2024 18:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="Wg4PaEEn" Received: from mail-40131.protonmail.ch (mail-40131.protonmail.ch [185.70.40.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4C2D2C6A3; Tue, 16 Apr 2024 18:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713292229; cv=none; b=FVNreKo/6EBc30QB7Pjn3v9jme7no77Xv1cb1NOeTsqHka4eeB3XaRrwfkBHri96u1KPIjnytY6XJp1sReS5s8tQ8wl553obsv2l3QfTDIvakIDGLLE+fUc6MfD9xuRPn4kkOayY2ZTArrkTJ3C61tOGRqKo/NOp+hf3HiJMbaU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713292229; c=relaxed/simple; bh=BOgkAFFdf2wnO9hL/ivSNkM9DBF2bbinKHnkCviT4l8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FiH4wni/L5MfstRP6f8Q5YSvkgp4lt7gvjXhV+toA+oCEeRXr/Dab6oydIP4ob83Us520dZJjWzmtywomEpSplGJ9AzIXbLr3pNBoiJbqFOXgsU67wJ5qHRUm0iUQ+T83nWxkKh/0N65FYpCivcn5POlm8eXbad4ySBxzN2vVKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=Wg4PaEEn; arc=none smtp.client-ip=185.70.40.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1713292225; x=1713551425; bh=62YpHOvZnZ8olaQOV9AE7phGelntP6xtyhEl8JdkA54=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Wg4PaEEnIx5Lk0zDGjMn6BASw1bt7to6J/Otm4Qg5gGACUkF2rEBqmcYuHbduwckQ H1eo4AJvG3DCpM9CG0k90JV04Y95S8+grRhuFgIlKPdbbC7n44ZULp+QPalg+XNLE0 By9mcXrdmEjIw0e41WckW7a/gmG3c5RRA9bNKkfaeuNIIGFAssv+jM1995X88Mgm/N A/sID5Ok081/ygln9wjKqztDlG21Rm6msq3y/xotQbnVtCAQXlK4v5kYzlj+A9mgla qhJNgvAlLImKeJAI7VVqwLilQfcatPe1Sk/FYo5r7zrxe/g0QpIhyB1cVmU2Yh/Xt5 OgauEt/0LlMRw== Date: Tue, 16 Apr 2024 18:29:56 +0000 To: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby From: Michael Pratt Cc: Wander Lairson Costa , =?utf-8?Q?Ilpo_J=C3=A4rvinen?= , Andy Shevchenko , Vamshi Gajjela , Michael Pratt Subject: [PATCH v2 2/3] serial: 8250: Store whether fifo device is enabled Message-ID: <20240416182741.22514-3-mcpratt@pm.me> In-Reply-To: <20240416182741.22514-1-mcpratt@pm.me> References: <20240416182741.22514-1-mcpratt@pm.me> Feedback-ID: 27397442:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Currently, there are 7 checks for whether to enable the internal fifo device of a 8250/16550 type uart. Instead of checking all 7 values again whenever we need to know whether we have the fifo device enabled, store the result as a struct member of uart_8250_port. This can, for example, lessen the amount of calculations done during a write operation. Signed-off-by: Michael Pratt --- V1 -> V2: new commit drivers/tty/serial/8250/8250_port.c | 2 ++ include/linux/serial_8250.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/= 8250_port.c index fc9dd5d45295..5b0cfe6bc98c 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -3392,6 +3392,8 @@ void serial8250_console_write(struct uart_8250_port *= up, const char *s, =09=09 */ =09=09!(up->port.flags & UPF_CONS_FLOW); =20 +=09up->fifo_enable =3D use_fifo; + =09if (likely(use_fifo)) =09=09serial8250_console_fifo_write(up, s, count); =09else diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index fd59ed2cca53..017429f0e743 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -127,6 +127,7 @@ struct uart_8250_port { =09struct list_head=09list;=09=09/* ports on this IRQ */ =09u32=09=09=09capabilities;=09/* port capabilities */ =09u16=09=09=09bugs;=09=09/* port bugs */ +=09unsigned int=09=09fifo_enable;=09/* fifo enabled if capable */ =09unsigned int=09=09tx_loadsz;=09/* transmit fifo load size */ =09unsigned char=09=09acr; =09unsigned char=09=09fcr; --=20 2.30.2