From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] serial: 8250_dw: Rework ->serial_out() LCR write retry logic
Date: Wed, 29 Jun 2022 12:40:01 +0300 (EEST) [thread overview]
Message-ID: <bc54d67-e573-9ecc-1650-7e7fc35f7897@linux.intel.com> (raw)
In-Reply-To: <CAHp75VevfptcsTTkFvCRsJRxuKX6aJ2zQ5LyH0O8wP+aB4xXHw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]
On Wed, 29 Jun 2022, Andy Shevchenko wrote:
> On Wed, Jun 29, 2022 at 10:47 AM Ilpo Järvinen
> <ilpo.jarvinen@linux.intel.com> wrote:
> > On Tue, 28 Jun 2022, Andy Shevchenko wrote:
> > > On Tue, Jun 28, 2022 at 3:43 PM Ilpo Järvinen
> > > <ilpo.jarvinen@linux.intel.com> wrote:
> > > >
> > > > Currently dw8250_verify_write() (was dw8250_check_lcr()) nullifies the
> > > > benefit from differentiated ->serial_out() by having big if tree to
> > > > select correct write type.
> > > >
> > > > Rework the logic such that the LCR write can be retried within the
> > > > relevant ->serial_out() handler:
> > > > 1. Move retries counter on the caller level and pass as pointer to
> > > > dw8250_verify_write()
> > > > 2. Make dw8250_verify_write() return bool
> > > > 3. Retry the write on caller level (if needed)
> > >
> > > I'm wondering if it's possible to utilize one of iopoll.h macro here
> > > instead of copying retries and that not-so-obvious IO poll write.
> >
> > Eh, are you suggesting I should do write as a side-effect inside one of
> > the iopoll.h macros? Because those available seem to only read?
> >
> > Or should I create another macro there which writes too?
>
> It seems to me that it would be a macro on top of iopoll's one which
> will take an op read and op write arguments depending on the case.
The thing is those iopoll macros don't return until the timeout is
exhausted so I don't think I can reuse them easily for this task ("on top
of iopoll's one")? That is, w/o some major side-effect hack (which is
IMHO a no-go).
--
i.
> Note, for that special case you would need a custom write op instead
> of simple __raw_writeq().
>
> Try and if it looks better, convert, otherwise it would be nice to
> hear why it won't fly in your opinion.
next prev parent reply other threads:[~2022-06-29 9:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 13:42 [PATCH 0/4] serial: 8250_dw: Rework ->serial_out() & LCR retry logic Ilpo Järvinen
2022-06-28 13:42 ` [PATCH 1/4] serial: 8250_dw: Use dw8250_serial_out() in dw8250_serial_out38x() Ilpo Järvinen
2022-06-28 13:42 ` [PATCH 2/4] serial: 8250_dw: Rename offset to reg_offset Ilpo Järvinen
2022-06-28 21:25 ` Andy Shevchenko
2022-06-29 7:47 ` Ilpo Järvinen
2022-06-29 9:38 ` Andy Shevchenko
2022-06-28 13:42 ` [PATCH 3/4] serial: 8250_dw: Move 16550 compatible & LCR checks to dw8250_verify_write() Ilpo Järvinen
2022-06-28 20:06 ` Andy Shevchenko
2022-06-28 13:42 ` [PATCH 4/4] serial: 8250_dw: Rework ->serial_out() LCR write retry logic Ilpo Järvinen
2022-06-28 20:11 ` Andy Shevchenko
2022-06-29 8:47 ` Ilpo Järvinen
2022-06-29 9:33 ` Andy Shevchenko
2022-06-29 9:40 ` Ilpo Järvinen [this message]
2022-06-29 9:51 ` Andy Shevchenko
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=bc54d67-e573-9ecc-1650-7e7fc35f7897@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@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 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.