Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: linux-serial <linux-serial@vger.kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	William Hubbs <w.d.hubbs@gmail.com>,
	Chris Brannon <chris@the-brannons.com>,
	Kirk Reiser <kirk@reisers.ca>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-mips@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	speakup@linux-speakup.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH v2 6/6] serial: Consolidate BOTH_EMPTY use
Date: Sat, 25 Jun 2022 00:09:33 +0300 (EEST)	[thread overview]
Message-ID: <616c8221-fc6e-1b73-626c-3427c87dddbf@linux.intel.com> (raw)
In-Reply-To: <03467516-3962-4ff2-23d2-2b3a1d647c5a@kernel.org>

On Thu, 23 Jun 2022, Jiri Slaby wrote:

> > --- a/arch/mips/ath79/early_printk.c
> > +++ b/arch/mips/ath79/early_printk.c
> > @@ -29,15 +30,15 @@ static inline void prom_putchar_wait(void __iomem *reg,
> > u32 mask, u32 val)
> >   	} while (1);
> >   }
> >   -#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
> > -
> >   static void prom_putchar_ar71xx(char ch)
> >   {
> >   	void __iomem *base = (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE));
> >   -	prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY);
> > +	prom_putchar_wait(base + UART_LSR * 4, UART_LSR_BOTH_EMPTY,
> > +			  UART_LSR_BOTH_EMPTY);
> >   	__raw_writel((unsigned char)ch, base + UART_TX * 4);
> > -	prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY);
> > +	prom_putchar_wait(base + UART_LSR * 4, UART_LSR_BOTH_EMPTY,
> > +			  UART_LSR_BOTH_EMPTY);
> 
> Two observations apart from this patch:
> * prom_putchar_wait()'s last two parameters are always the same.
>   One should be removed, i.e. all this simplified.

I noticed this myself but I'm also looking into generalizing wait for tx 
empty somehow if possible (it might not help much here though as this 
seems to be on "early" side of things).

-- 
 i.


> * prom_putchar_wait() should be implemented using
>   read_poll_timeout_atomic(), incl. failure/timeout handling.
> 
> thanks,
> 


      parent reply	other threads:[~2022-06-24 21:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220621124958.3342-1-ilpo.jarvinen@linux.intel.com>
2022-06-21 12:49 ` [PATCH v2 6/6] serial: Consolidate BOTH_EMPTY use Ilpo Järvinen
2022-06-23  7:41   ` Jiri Slaby
     [not found]     ` <CAHp75VeKhY6dN7j_yXQXUMhOqRwqQ2yN_qF95U9wU6K4uKPdaQ@mail.gmail.com>
2022-06-23  8:24       ` Jiri Slaby
2022-06-23 10:15         ` Andy Shevchenko
2022-06-23 10:17           ` Andy Shevchenko
2022-07-04  6:59             ` Jiri Slaby
2022-06-24 21:09     ` Ilpo Järvinen [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=616c8221-fc6e-1b73-626c-3427c87dddbf@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=chris@the-brannons.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kirk@reisers.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=speakup@linux-speakup.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=w.d.hubbs@gmail.com \
    /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