From: Simon Marchi <simon.marchi@ericsson.com>
To: Gareth McMullin <gareth@blacksphere.co.nz>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH] PR remote/21188: Fix remote serial timeout
Date: Thu, 02 Mar 2017 16:15:00 -0000 [thread overview]
Message-ID: <630aafbb-8684-5aea-0fa1-f0f538b4eb02@ericsson.com> (raw)
In-Reply-To: <CAL8qUbq2+mJ5OgqTmodR_g4tmQqPGYC_50W4zSBgH9N1Xnje8A@mail.gmail.com>
On 17-02-20 05:52 PM, Gareth McMullin wrote:
> The timeout mechanism in ser-unix.c was changed in commit 048094acc.
>
> In do_hardwire_readchar(), the required timeout is broken into 1
> second intervals and wait_for() is called. Before, wait_for() set
> VTIME and VMIN so the read would block, but now it uses select() to
> block for the specified timeout. If wait_for() returns
> SERIAL_TIMEOUT, do_hardwire_readchar() returns immediately, so the
> timeout is always only 1s.
>
> The attached patch will repeatedly call wait_for() until the full
> timeout has elapsed.
>
> Gareth
>
I think I understand the problem you describe by inspecting the code. However,
I have some difficulty understanding the current and proposed code, so I can't
say if the patch looks correct. It just looks more complicated than necessary.
For example, what's the point of the timeout_remaining field in struct serial? It
seems to ever only be used in this function. If we can remove it, it will be one
less thing to consider. We can probably have just the timeout variable that we
decrement until it's done.
Simon
next prev parent reply other threads:[~2017-03-02 16:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 22:52 Gareth McMullin
2017-03-01 21:52 ` Gareth McMullin
2017-03-02 16:15 ` Simon Marchi [this message]
2017-03-14 1:02 ` Gareth McMullin
2017-03-14 1:40 ` Simon Marchi
2017-03-14 2:13 ` Gareth McMullin
2017-03-14 14:29 ` Pedro Alves
2017-03-17 16:26 ` Pedro Alves
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=630aafbb-8684-5aea-0fa1-f0f538b4eb02@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gareth@blacksphere.co.nz \
--cc=gdb-patches@sourceware.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