From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C00A1C636D4 for ; Fri, 17 Feb 2023 12:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbjBQMA2 (ORCPT ); Fri, 17 Feb 2023 07:00:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbjBQMA1 (ORCPT ); Fri, 17 Feb 2023 07:00:27 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB5DE644D2; Fri, 17 Feb 2023 04:00:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676635226; x=1708171226; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=QHzf2w0VmJpptgHR8mvf8UJREC75hhkXhPev1DzraSI=; b=T3Q9/njap4Kr45MVlFQY4ZOMK8ivqIpKSXPl140R6UWMIKMqGoL7UWqu WxrtjRYcKkDM4zvyZjUJ+/RzTRYU8YTToWfCw64ypb0CQPc18hrkhmkjY yHDWnGxT/h6dfQ0Wclh81KO5dtFO3sv4Jz7zhrY2u92/Ai8iWNOr0qWgV XmOoomn4dmEyO85vVjuopjScqAy0/ArNZuff0AA2VBU9eW6oYIuPgblC4 nPDg+SEQX2cuDcm37j+JFhsP5DYGOrO9A8+5chAwhqIGeYLxUMHmyQbA/ eADQVegAo4OH9k3/1dbPkP5OWdrGZSPfwRtGPJbrGJoiIhHOBJqtIyz9K A==; X-IronPort-AV: E=McAfee;i="6500,9779,10623"; a="315685710" X-IronPort-AV: E=Sophos;i="5.97,304,1669104000"; d="scan'208";a="315685710" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2023 04:00:26 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10623"; a="794383610" X-IronPort-AV: E=Sophos;i="5.97,304,1669104000"; d="scan'208";a="794383610" Received: from aleste1x-mobl2.ger.corp.intel.com ([10.252.41.242]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2023 04:00:23 -0800 Date: Fri, 17 Feb 2023 14:00:21 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Biju Das cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial , Geert Uytterhoeven , =?ISO-8859-15?Q?Niklas_S=F6derlund?= , Fabrizio Castro , "linux-renesas-soc@vger.kernel.org" Subject: RE: [PATCH v4 5/6] serial: 8250_em: Use pseudo offset for UART_FCR In-Reply-To: Message-ID: <1e8b1e7-5f3e-61be-dd65-8d5da7ca14d2@linux.intel.com> References: <20230217114255.226517-1-biju.das.jz@bp.renesas.com> <20230217114255.226517-6-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-935927437-1676635226=:3134" Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-935927437-1676635226=:3134 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Fri, 17 Feb 2023, Biju Das wrote: > Hi Ilpo, > > Thanks for the feedback. > > > Subject: Re: [PATCH v4 5/6] serial: 8250_em: Use pseudo offset for UART_FCR > > > > On Fri, 17 Feb 2023, Biju Das wrote: > > > > > UART_FCR shares the same offset with UART_IIR. We cannot use UART_FCR > > > in serial8250_em_serial_in() as it overlaps with UART_IIR. > > > > > > This patch introduces a macro UART_FCR_EM with a high value to avoid > > > overlapping with existing UART_* register defines. > > > > > > This will help us to use UART_FCR_EM consistently in serial8250_em_ > > > serial{_in/_out} function to read/write FCR register. > > > > > > Signed-off-by: Biju Das > > > Suggested-by: Ilpo Järvinen > > > --- > > > v4: > > > * New patch. Used UART_FCR_EM for read/write of FCR register. > > > --- > > > drivers/tty/serial/8250/8250_em.c | 13 ++++++++++++- > > > 1 file changed, 12 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/tty/serial/8250/8250_em.c > > > b/drivers/tty/serial/8250/8250_em.c > > > index 499d7a8847ec..4165fd3bb17a 100644 > > > --- a/drivers/tty/serial/8250/8250_em.c > > > +++ b/drivers/tty/serial/8250/8250_em.c > > > @@ -19,6 +19,13 @@ > > > #define UART_DLL_EM 9 > > > #define UART_DLM_EM 10 > > > > > > +/* > > > + * A high value for UART_FCR_EM avoids overlapping with existing > > > +UART_* > > > + * register defines. UART_FCR_EM_HW is the real HW register offset. > > > + */ > > > +#define UART_FCR_EM 0x10003 > > > +#define UART_FCR_EM_HW 3 > > > + > > > struct serial8250_em_priv { > > > int line; > > > }; > > > @@ -29,12 +36,14 @@ static void serial8250_em_serial_out(struct uart_port > > *p, int offset, int value) > > > case UART_TX: /* TX @ 0x00 */ > > > writeb(value, p->membase); > > > break; > > > - case UART_FCR: /* FCR @ 0x0c (+1) */ > > > > 8250_port wants this to remain in place, I think. Otherwise it's attempts to > > set UART_FCR will end up into wrong destination. > > Oops, next patch has this change. > > + case UART_FCR: > + serial8250_em_reg_update(p, UART_FCR_EM, value); > > I just need to keep UART_FCR for this patch and > remove it from "serial8250_em_serial_out_helper" on the next patch IMHO, the extra layer + _helper seems pretty unnecessary. I don't see any useful thing it achieves over just having to serial_out functions. -- i. --8323329-935927437-1676635226=:3134--