Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp232787pxa; Tue, 4 Aug 2020 04:20:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKQrF7a1QnhHbLNgzfQ+m5tCybXsXBB2qr9Q1D+ENKLWcDAdDStQm1bCZCVhu7VtUyZWBF X-Received: by 2002:a17:906:8608:: with SMTP id o8mr22173334ejx.156.1596540034926; Tue, 04 Aug 2020 04:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596540034; cv=none; d=google.com; s=arc-20160816; b=IvHPlrQw1GdyOTams5ANMqUsa71/i+jMBMaY4j1LCuaF6Ju3SiPil/L1XHS5j4QhoF XAv8HZ8qS8ATYGg4MsRiyn9aLldTBuPV5cdj1kj1kyqW1bwXuer36j8El1hpj4jc6M6e vpxSVgGFy9rGHl363PD/EZ7H7+N3MYmAcRigxA5qHh4d7iXMnaya1ivxh6ZcTsBiVG02 x/zwGxzGhWn84yEKqQ2KOaOv2WKqx8JL3Om2P1ul661PIV//zk+8dtlQSbUCsqVMDfdb /r/872fojtf95bJhPpXLSNwEDwHEnh7QXOyiV8URPSlIBKXw2Ojdw7ewpar3obBG3bBd O/Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date; bh=yQ1CTJEACcGDWckEBwuhX4/ZvZZ5wU4ImqkZI2/WO+U=; b=v58d+pZH7eHKxWZDb5Pi0S8T80to+HL1HHjrL7ZCLVeE/OdAs6pZ2n7oHJ3iGU0id+ 3ae3O5lmUw6fffy02DnqqRLQODZ+mBER3TYrDQ7yYsmBeEge2YN2+ANZzSxxGyrd+BU1 xvjRcnxeAhmnOT9xIRTpWYvIN710JvGY29goRPqpLLyj3K1kt2sWkJfM8vPKwoqE/NMW 0LU4++QO7dNqekkIwfKNUb8YkFjAEbzvKcT7n7JmeJhe7aRfjZW+naKnioSqf0ddyuQz giCrDedVaSJQ12VvEgx7MM48b2otYKro0rDXt0WR/TLGP99RwA4feuj1ZIhFh1LFU+b1 GFbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o2si7166471ejm.676.2020.08.04.04.20.10; Tue, 04 Aug 2020 04:20:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730035AbgHDLTr (ORCPT + 99 others); Tue, 4 Aug 2020 07:19:47 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:46408 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730000AbgHDLOU (ORCPT ); Tue, 4 Aug 2020 07:14:20 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 382F1DB4F; Tue, 4 Aug 2020 13:12:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5f8jKIz8z6hR; Tue, 4 Aug 2020 13:12:48 +0200 (CEST) Received: from function (lfbn-bor-1-797-11.w86-234.abo.wanadoo.fr [86.234.239.11]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 416091866; Tue, 4 Aug 2020 13:12:48 +0200 (CEST) Received: from samy by function with local (Exim 4.94) (envelope-from ) id 1k2usB-001aIz-7l; Tue, 04 Aug 2020 13:12:47 +0200 Date: Tue, 4 Aug 2020 13:12:47 +0200 From: Samuel Thibault To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, speakup@linux-speakup.org Subject: [PATCH 1/2] speakup: Fix wait_for_xmitr for ttyio case Message-ID: <20200804111247.sqx7g74lpaemgw4k@function> Mail-Followup-To: Samuel Thibault , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, speakup@linux-speakup.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This was missed while introducing the tty-based serial access. The only remaining use of wait_for_xmitr with tty-based access is in spk_synth_is_alive_restart to check whether the synth can be restarted. With tty-based this is up to the tty layer to cope with the buffering etc. so we can just say yes. Signed-off-by: Samuel Thibault Index: linux-2.6/drivers/accessibility/speakup/serialio.c =================================================================== --- linux-2.6.orig/drivers/accessibility/speakup/serialio.c +++ linux-2.6/drivers/accessibility/speakup/serialio.c @@ -32,6 +32,7 @@ static void spk_serial_tiocmset(unsigned static unsigned char spk_serial_in(void); static unsigned char spk_serial_in_nowait(void); static void spk_serial_flush_buffer(void); +static int spk_serial_wait_for_xmitr(struct spk_synth *in_synth); struct spk_io_ops spk_serial_io_ops = { .synth_out = spk_serial_out, @@ -40,6 +41,7 @@ struct spk_io_ops spk_serial_io_ops = { .synth_in = spk_serial_in, .synth_in_nowait = spk_serial_in_nowait, .flush_buffer = spk_serial_flush_buffer, + .wait_for_xmitr = spk_serial_wait_for_xmitr, }; EXPORT_SYMBOL_GPL(spk_serial_io_ops); @@ -211,7 +213,7 @@ void spk_stop_serial_interrupt(void) } EXPORT_SYMBOL_GPL(spk_stop_serial_interrupt); -int spk_wait_for_xmitr(struct spk_synth *in_synth) +static int spk_serial_wait_for_xmitr(struct spk_synth *in_synth) { int tmout = SPK_XMITR_TIMEOUT; Index: linux-2.6/drivers/accessibility/speakup/spk_priv.h =================================================================== --- linux-2.6.orig/drivers/accessibility/speakup/spk_priv.h +++ linux-2.6/drivers/accessibility/speakup/spk_priv.h @@ -34,7 +34,6 @@ const struct old_serial_port *spk_serial_init(int index); void spk_stop_serial_interrupt(void); -int spk_wait_for_xmitr(struct spk_synth *in_synth); void spk_serial_release(void); void spk_ttyio_release(void); void spk_ttyio_register_ldisc(void); Index: linux-2.6/drivers/accessibility/speakup/spk_ttyio.c =================================================================== --- linux-2.6.orig/drivers/accessibility/speakup/spk_ttyio.c +++ linux-2.6/drivers/accessibility/speakup/spk_ttyio.c @@ -116,6 +116,7 @@ static void spk_ttyio_tiocmset(unsigned static unsigned char spk_ttyio_in(void); static unsigned char spk_ttyio_in_nowait(void); static void spk_ttyio_flush_buffer(void); +static int spk_ttyio_wait_for_xmitr(struct spk_synth *in_synth); struct spk_io_ops spk_ttyio_ops = { .synth_out = spk_ttyio_out, @@ -125,6 +126,7 @@ struct spk_io_ops spk_ttyio_ops = { .synth_in = spk_ttyio_in, .synth_in_nowait = spk_ttyio_in_nowait, .flush_buffer = spk_ttyio_flush_buffer, + .wait_for_xmitr = spk_ttyio_wait_for_xmitr, }; EXPORT_SYMBOL_GPL(spk_ttyio_ops); @@ -286,6 +288,11 @@ static void spk_ttyio_tiocmset(unsigned mutex_unlock(&speakup_tty_mutex); } +static int spk_ttyio_wait_for_xmitr(struct spk_synth *in_synth) +{ + return 1; +} + static unsigned char ttyio_in(int timeout) { struct spk_ldisc_data *ldisc_data = speakup_tty->disc_data; Index: linux-2.6/drivers/accessibility/speakup/spk_types.h =================================================================== --- linux-2.6.orig/drivers/accessibility/speakup/spk_types.h +++ linux-2.6/drivers/accessibility/speakup/spk_types.h @@ -158,6 +158,7 @@ struct spk_io_ops { unsigned char (*synth_in)(void); unsigned char (*synth_in_nowait)(void); void (*flush_buffer)(void); + int (*wait_for_xmitr)(struct spk_synth *synth); }; struct spk_synth { Index: linux-2.6/drivers/accessibility/speakup/synth.c =================================================================== --- linux-2.6.orig/drivers/accessibility/speakup/synth.c +++ linux-2.6/drivers/accessibility/speakup/synth.c @@ -159,7 +159,7 @@ int spk_synth_is_alive_restart(struct sp { if (synth->alive) return 1; - if (spk_wait_for_xmitr(synth) > 0) { + if (synth->io_ops->wait_for_xmitr(synth) > 0) { /* restart */ synth->alive = 1; synth_printf("%s", synth->init);