linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] [RFC] serial: sh-sci: fix register alocation in h8300.
Date: Thu, 12 Jul 2018 09:44:39 +0000	[thread overview]
Message-ID: <87lgagpz3s.wl-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <20180711114121.10735-1-ysato@users.sourceforge.jp>

On Wed, 11 Jul 2018 21:53:30 +0900,
Geert Uytterhoeven wrote:
> 
> Hi Sato-san,
> 
> CC Laurent
> 
> On Wed, Jul 11, 2018 at 2:38 PM Yoshinori Sato
> <ysato@users.sourceforge.jp> wrote:
> > h8300's SCI registers aligned byte address.
> > Although it may be appropriate to put it in sci_port_params,
> > because I can not think of a good way, I did it like this.
> >
> > Signei-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> 
> Thanks for your patch!
> 
> Fixes: dfc80387aefb7816 ("serial: sh-sci: Compute the regshift value
> for SCI ports")
> 
> > --- a/drivers/tty/serial/sh-sci.c
> > +++ b/drivers/tty/serial/sh-sci.c
> > @@ -2862,12 +2862,16 @@ static int sci_init_single(struct platform_device *dev,
> >         port->flags             = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF | p->flags;
> >         port->fifosize          = sci_port->params->fifosize;
> >
> > +#if !defined(CONFIG_H8300)
> >         if (port->type = PORT_SCI) {
> >                 if (sci_port->reg_size >= 0x20)
> >                         port->regshift = 2;
> >                 else
> >                         port->regshift = 1;
> >         }
> > +#else
> > +       port->regshift = 0;
> > +#endif
> 
> What about using reg_size instead?
> 
>         if (sci_port->reg_size >= 0x20)
>                 port->regshift = 2;
>         else if (sci_port->reg_size >= 0x10)
>                 port->regshift = 1;
>         else
>                 port->regshift = 0;
> 
> >         /*
> >          * The UART port needs an IRQ value, so we peg this to the RX IRQ
> 

It looks more better fix.
And works fine of h8300.

Thanks.

> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

      parent reply	other threads:[~2018-07-12  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 11:41 [PATCH] [RFC] serial: sh-sci: fix register alocation in h8300 Yoshinori Sato
2018-07-11 12:53 ` Geert Uytterhoeven
2018-07-12  9:44 ` Yoshinori Sato [this message]

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=87lgagpz3s.wl-ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=linux-sh@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).