All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	linux-serial <linux-serial@vger.kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH v4 5/6] serial: 8250_em: Use pseudo offset for UART_FCR
Date: Fri, 17 Feb 2023 14:00:21 +0200 (EET)	[thread overview]
Message-ID: <1e8b1e7-5f3e-61be-dd65-8d5da7ca14d2@linux.intel.com> (raw)
In-Reply-To: <OS0PR01MB5922EA33B354EB2B31680AB686A19@OS0PR01MB5922.jpnprd01.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

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 <biju.das.jz@bp.renesas.com>
> > > Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> > > ---
> > > 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.

  reply	other threads:[~2023-02-17 12:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 11:42 [PATCH v4 0/6] Update Renesas {EMMA mobile, RZ/V2M} UART Port type Biju Das
2023-02-17 11:42 ` [PATCH v4 1/6] serial: 8250_em: Use dev_err_probe() Biju Das
2023-02-17 14:03   ` Andy Shevchenko
2023-02-17 14:14     ` Biju Das
2023-02-17 11:42 ` [PATCH v4 2/6] serial: 8250_em: Drop slab.h Biju Das
2023-02-17 14:05   ` Andy Shevchenko
2023-02-17 14:30     ` Biju Das
2023-02-17 15:13       ` Andy Shevchenko
2023-02-17 15:17         ` Biju Das
2023-02-17 11:42 ` [PATCH v4 3/6] serial: 8250_em: Use devm_clk_get_enabled() Biju Das
2023-02-17 11:42 ` [PATCH v4 4/6] serial: 8250_em: Update port type as PORT_16750 Biju Das
2023-02-17 14:06   ` Andy Shevchenko
2023-02-17 14:53     ` Biju Das
2023-02-17 11:42 ` [PATCH v4 5/6] serial: 8250_em: Use pseudo offset for UART_FCR Biju Das
2023-02-17 11:46   ` Ilpo Järvinen
2023-02-17 11:56     ` Biju Das
2023-02-17 12:00       ` Ilpo Järvinen [this message]
2023-02-17 12:11         ` Biju Das
2023-02-17 12:42           ` Ilpo Järvinen
2023-02-17 12:58             ` Biju Das
2023-02-17 13:03               ` Ilpo Järvinen
2023-02-17 11:42 ` [PATCH v4 6/6] serial: 8250_em: Add serial8250_em_{reg_update(),out_helper()} Biju Das
2023-02-17 14:14   ` Andy Shevchenko
2023-02-17 14:35     ` Biju Das
2023-02-17 15:15       ` Andy Shevchenko
2023-02-17 15:24         ` Biju Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e8b1e7-5f3e-61be-dd65-8d5da7ca14d2@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.