From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 096BD1EFF2B; Mon, 1 May 2017 14:04:20 -0400 (EDT) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by befuddled.reisers.ca (Postfix) with ESMTPS id 92EF71F00AA for ; Mon, 1 May 2017 14:03:41 -0400 (EDT) Received: by mail-wm0-x241.google.com with SMTP id u65so24617030wmu.3 for ; Mon, 01 May 2017 11:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nO/WCEMavwtG849pze7DS19IqFOowEXXPePz3tIMgkM=; b=gAi87EGuoij1+LrkIYNfM5OXs6eF4xUhWiGKYNb07D9VK/SsIhKWAbHGHAWWILacTI kOxZ3cCJQjZ6hfKJ6xY9BPwnDhA7MiTEPE+sRMes3waxQzTVn4dCc4IU7nYLJuIwEA4K GHFTNtVinz/eKjsj5SQ0JaHDJj/m9FSKlCzo3Nhqknb4WKWkdJTNqLMCTiJ48XFzdDJL C2yAypXWj+86GU+sfIFV8a2xMcIFh4vU/4xFa86J150VORM1FLlRbyyDERmddc4ej+OK 1BRBfo9At5ToPcCCUtEX7LJu+WQdvKBzyI+mLEhwBoJLNaqU5fua7siRjhI4tfomnSqX 2yWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nO/WCEMavwtG849pze7DS19IqFOowEXXPePz3tIMgkM=; b=FhM4aGLrA2kvniprDkr6aNQazLUlwHWGX0dcArFq2gX9PuM+ShvyWtan5dhSyiuGyh e5igw+wixhH8fxHaI84jv/m/eMTqK1em3/am7AeIfeWz7u/TyEamwGTpt8ZAOLEbC93m tHbP97/MD/9R835oKUcgjDdB0NzzL5ttiCn3PRRw0DprIioXxlatYx3UEuxrfQof0JcG 3r0tsylNiMP9m8/tqobW9mIM4kR3eZRWtnsq98rA3LyHvbEvHCRibrXvn9NrIIpErdhK l0wxPtBKcmaQgMIQqhi5wsNY5EPKJgIa3ksvH5ebAx2Yh6PHoUBcCngVfweCnWqXEn56 2bsg== X-Gm-Message-State: AN3rC/7Ik5aQID8uAswAZkm9mdl7e8VhwcgIUi4d1EqDqI/ZOKj8+7N8 SIhEM/j9/C2WsA== X-Received: by 10.28.28.8 with SMTP id c8mr6841872wmc.27.1493661817922; Mon, 01 May 2017 11:03:37 -0700 (PDT) Received: from sanghar ([2a00:23c4:7320:5e00:224:d6ff:fe76:7136]) by smtp.gmail.com with ESMTPSA id j44sm6850592wre.67.2017.05.01.11.03.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 May 2017 11:03:37 -0700 (PDT) Date: Mon, 1 May 2017 19:03:35 +0100 From: Okash Khawaja To: Samuel Thibault , John Covici Cc: speakup@linux-speakup.org Subject: Re: staging: speakup: flush tty buffers Message-ID: <20170501180335.GA4211@sanghar> References: <20170501093320.fqjvxcoz6zloa4eg@var.youpi.perso.aquilenet.fr> <20170501180208.GA4197@sanghar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170501180208.GA4197@sanghar> User-Agent: Mutt/1.8.2 (2017-04-18) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 18:04:22 -0000 Hi, For testing, I have updated the github repo [1]. I will test this on apollo. Thanks, Okash [1] https://github.com/bytefire/speakup-decext On Mon, May 01, 2017 at 07:02:08PM +0100, Okash Khawaja wrote: > This patch fixes the issue where TTY-migrated synths would take a while > to shut up after hitting numpad enter key. When calling synth_flush, even > though XOFF character is sent as high priority, data buffered in TTY layer > is still sent to the synth. This patch flushes that buffered data when > synth_flush is called. > > Reported-by: John Covici > Signed-off-by: Okash Khawaja > > Index: linux-staging/drivers/staging/speakup/serialio.c > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/serialio.c > +++ linux-staging/drivers/staging/speakup/serialio.c > @@ -30,6 +30,7 @@ > static void spk_serial_tiocmset(unsigned int set, unsigned int clear); > static unsigned char spk_serial_in(void); > static unsigned char spk_serial_in_nowait(void); > +static void spk_serial_flush_buffer(void); > > struct spk_io_ops spk_serial_io_ops = { > .synth_out = spk_serial_out, > @@ -37,6 +38,7 @@ > .tiocmset = spk_serial_tiocmset, > .synth_in = spk_serial_in, > .synth_in_nowait = spk_serial_in_nowait, > + .flush_buffer = spk_serial_flush_buffer, > }; > EXPORT_SYMBOL_GPL(spk_serial_io_ops); > > @@ -268,6 +270,11 @@ > return inb_p(speakup_info.port_tts + UART_RX); > } > > +static void spk_serial_flush_buffer(void) > +{ > + /* TODO: flush the UART 16550 buffer */ > +} > + > static int spk_serial_out(struct spk_synth *in_synth, const char ch) > { > if (in_synth->alive && spk_wait_for_xmitr(in_synth)) { > Index: linux-staging/drivers/staging/speakup/spk_ttyio.c > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/spk_ttyio.c > +++ linux-staging/drivers/staging/speakup/spk_ttyio.c > @@ -85,6 +85,7 @@ > static void spk_ttyio_tiocmset(unsigned int set, unsigned int clear); > static unsigned char spk_ttyio_in(void); > static unsigned char spk_ttyio_in_nowait(void); > +static void spk_ttyio_flush_buffer(void); > > struct spk_io_ops spk_ttyio_ops = { > .synth_out = spk_ttyio_out, > @@ -92,6 +93,7 @@ > .tiocmset = spk_ttyio_tiocmset, > .synth_in = spk_ttyio_in, > .synth_in_nowait = spk_ttyio_in_nowait, > + .flush_buffer = spk_ttyio_flush_buffer, > }; > EXPORT_SYMBOL_GPL(spk_ttyio_ops); > > @@ -201,6 +203,11 @@ > return (rv == 0xff) ? 0 : rv; > } > > +static void spk_ttyio_flush_buffer(void) > +{ > + speakup_tty->ops->flush_buffer(speakup_tty); > +} > + > int spk_ttyio_synth_probe(struct spk_synth *synth) > { > int rv = spk_ttyio_initialise_ldisc(synth->ser); > Index: linux-staging/drivers/staging/speakup/spk_types.h > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/spk_types.h > +++ linux-staging/drivers/staging/speakup/spk_types.h > @@ -154,6 +154,7 @@ > void (*tiocmset)(unsigned int set, unsigned int clear); > unsigned char (*synth_in)(void); > unsigned char (*synth_in_nowait)(void); > + void (*flush_buffer)(void); > }; > > struct spk_synth { > Index: linux-staging/drivers/staging/speakup/speakup_audptr.c > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/speakup_audptr.c > +++ linux-staging/drivers/staging/speakup/speakup_audptr.c > @@ -127,6 +127,7 @@ > > static void synth_flush(struct spk_synth *synth) > { > + synth->io_ops->flush_buffer(); > synth->io_ops->send_xchar(SYNTH_CLEAR); > synth->io_ops->synth_out(synth, PROCSPEECH); > } > Index: linux-staging/drivers/staging/speakup/speakup_decext.c > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/speakup_decext.c > +++ linux-staging/drivers/staging/speakup/speakup_decext.c > @@ -221,6 +221,7 @@ > static void synth_flush(struct spk_synth *synth) > { > in_escape = 0; > + synth->io_ops->flush_buffer(); > synth->synth_immediate(synth, "\033P;10z\033\\"); > } > > Index: linux-staging/drivers/staging/speakup/speakup_dectlk.c > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/speakup_dectlk.c > +++ linux-staging/drivers/staging/speakup/speakup_dectlk.c > @@ -293,6 +293,7 @@ > synth->io_ops->synth_out(synth, ']'); > in_escape = 0; > is_flushing = 1; > + synth->io_ops->flush_buffer(); > synth->io_ops->synth_out(synth, SYNTH_CLEAR); > } > > Index: linux-staging/drivers/staging/speakup/speakup_spkout.c > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/speakup_spkout.c > +++ linux-staging/drivers/staging/speakup/speakup_spkout.c > @@ -125,6 +125,7 @@ > > static void synth_flush(struct spk_synth *synth) > { > + synth->io_ops->flush_buffer(); > synth->io_ops->send_xchar(SYNTH_CLEAR); > } > > Index: linux-staging/drivers/staging/speakup/synth.c > =================================================================== > --- linux-staging.orig/drivers/staging/speakup/synth.c > +++ linux-staging/drivers/staging/speakup/synth.c > @@ -120,6 +120,7 @@ > > void spk_synth_flush(struct spk_synth *synth) > { > + synth->io_ops->flush_buffer(); > synth->io_ops->synth_out(synth, synth->clear); > } > EXPORT_SYMBOL_GPL(spk_synth_flush);