From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 92A821F0872; Mon, 3 Apr 2017 16:42:19 -0400 (EDT) Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by befuddled.reisers.ca (Postfix) with ESMTPS id 13F191F0872 for ; Mon, 3 Apr 2017 16:39:29 -0400 (EDT) Received: by mail-wr0-x242.google.com with SMTP id w43so36727941wrb.1 for ; Mon, 03 Apr 2017 13:39:28 -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=AnDrhBkUqWG5Pt94lCWiQpQR3cpvgMLBYTOCgKdrtnQ=; b=CQ3vHpXJrqK2PF6wGf8dQiB9focnYvKZ6uOyXbeqKYbun/ItniivYpil6nKQPrZZVP 7GWu120OiqowbLtRttF4bhe7ScuP8GWZ7inY69NRluKM7/rk7RizdD7WvaojxM7YCH3q eyffIgsS+aDwkzEeNMDF+Lo7cfrRZ0RMY/ZY1w/K+0Cwm835qcqFV1wY3pOoeNsd7UNh 2nOBQNEFIBvtn1NXNuBbBVHB70pQYVOQOIj1TuzDYOG+6aY+g4QG9NK5Ct5uBuPrtTfb Sqb+iMqrjlNRhA6GxyWLwUmabL1gYcV9dPZI4HTqCcnJtX4qlweyZ64HrrTMvf7M3aeE zF6w== 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=AnDrhBkUqWG5Pt94lCWiQpQR3cpvgMLBYTOCgKdrtnQ=; b=h8T71gHukZoLYfovy63Qp0x+QfYJIxXqMdIBtmo5uXqkIvhkOA/WnqLSuNYt8f2CTB z2ZIRBFvZNj3embMMNk977GMEZxLaa9Z8X5vcqbOap0tKxcq9cG9HshNud6RVGmrngu2 +eFsclE0V9bUAMOC1Y8Nvl0291rGwhLDNIFPqI+QT+lK73vJUUPDx0MLmxFxM3LSoSHU Omq7ws0xtHX/aFP43QX4O8w0PeLXyuIB6ZbL6cxejB5J1OerhBPL5LKPMIxJNr6tafx3 pTKbTVP/8oai9kUx5p0kOIxj1hH6pkew0G+vkjhZISmoJ3/0rZe1cbGb7if23g9vo7Db QEKQ== X-Gm-Message-State: AFeK/H2DJYZxeBSv0TqXpw+Vs71Wcr7Tn8fRnKW8sX/LApY1nqFsJzQs zi03y14LqPAklg== X-Received: by 10.28.154.14 with SMTP id c14mr11174813wme.75.1491251966910; Mon, 03 Apr 2017 13:39:26 -0700 (PDT) Received: from sanghar ([2a00:23c4:7320:5e00:224:d6ff:fe76:7136]) by smtp.gmail.com with ESMTPSA id 127sm15712144wmt.20.2017.04.03.13.39.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 13:39:26 -0700 (PDT) Date: Mon, 3 Apr 2017 21:39:25 +0100 From: Okash Khawaja To: speakup@linux-speakup.org Subject: Re: [patch 0/7] staging: speakup: migrate synths to use TTY-based comms Message-ID: <20170403203925.GA1388@sanghar> References: <20170403202123.194386356@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <20170403202123.194386356@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) 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, 03 Apr 2017 20:42:20 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 03, 2017 at 09:21:23PM +0100, Okash Khawaja wrote: > Hi, > > This patchset migrates synths to use TTY-based comms instead of directly using > serial i/o. The move doesn't cover those synths which do need direct access, > e.g. some which talk over ISA. > > Please note that this patchset applies on top of current staging-next branch of > Greg Kroah-Hartman's tree as that contains some other changes to speakup and > tty drivers that have recently gone in. So the first patch makes ammendments to > TTY code which allows speakup to access and tty device. Next patch adds > spk_ttyio.c which contains TTY-based initialisation and output functionality. > Next patch migrates those synths which only use output: dummy, acntsa, bns and > txprt. Then we add xchar and tiocmset functions. Next we rearrange the code > such that input functionality is grouped under a few methods inside spk_synth > and spk_io_ops structs. That paves the way for simple migration of other synths > to TTY. The final patch does that for apollo, ltlk, audptr, decext, dectlk > and spkout. > > Thanks, > Okash Hi, The staging-next tree wasn't working for me, specially the usb modules. So I took following steps: 1. Switch to kernel versio 4.10.0 (I guess others upto 4.10.8 will be fine) 2. Copy drivers/staging/speakup directory from staging-next tree to overwrite the one in 4.10.0. 3. Use the patch I have attached as the first patch instead of the one in this email series ([patch 1/7] staging: speakup: export tty_open_by_driver). 4. Apply rest of the patches in this patchset. That worked for me. As I have mentioned before, apollo and double talk lt worked fine but I haven't done thorough testing. If you have questions about applying patches, do let me know. Thanks, Okash --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=01_enable_kernel_access_to_tty_device Content-Transfer-Encoding: quoted-printable =1B[32mIndex: linux-stable/drivers/tty/tty_io.c=1B[00m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =1B[32m--- linux-stable.orig/drivers/tty/tty_io.c=1B[00m =1B[32m+++ linux-stable/drivers/tty/tty_io.c=1B[00m =1B[33m@@ -855,7 +855,7 @@=1B[00m=1B[35m=1B[00m =20 int tty_hung_up_p(struct file *filp) { =1B[35m- return (filp->f_op =3D=3D &hung_up_tty_fops);=1B[00m =1B[36m+ return (filp && filp->f_op =3D=3D &hung_up_tty_fops);=1B[00m } =20 EXPORT_SYMBOL(tty_hung_up_p); =1B[33m@@ -1368,7 +1368,10 @@=1B[00m=1B[35m=1B[00m struct tty_struct *tty; =20 if (driver->ops->lookup) =1B[35m- tty =3D driver->ops->lookup(driver, file, idx);=1B[00m =1B[36m+ if (!file)=1B[00m =1B[36m+ tty =3D ERR_PTR(-EIO);=1B[00m =1B[36m+ else=1B[00m =1B[36m+ tty =3D driver->ops->lookup(driver, file, idx);=1B[00m else tty =3D driver->ttys[idx]; =20 =1B[33m@@ -1986,7 +1989,7 @@=1B[00m=1B[35m=1B[00m struct tty_driver *console_driver =3D console_device(index); if (console_driver) { driver =3D tty_driver_kref_get(console_driver); =1B[35m- if (driver) {=1B[00m =1B[36m+ if (driver && filp) {=1B[00m /* Don't let /dev/console block */ filp->f_flags |=3D O_NONBLOCK; break; =1B[33m@@ -2019,7 +2022,7 @@=1B[00m=1B[35m=1B[00m * - concurrent tty driver removal w/ lookup * - concurrent tty removal from driver table */ =1B[35m-static struct tty_struct *tty_open_by_driver(dev_t device, struct i= node *inode,=1B[00m =1B[36m+struct tty_struct *tty_open_by_driver(dev_t device, struct inode *i= node,=1B[00m struct file *filp) { struct tty_struct *tty; =1B[33m@@ -2064,6 +2067,7 @@=1B[00m=1B[35m=1B[00m tty_driver_kref_put(driver); return tty; } =1B[36m+EXPORT_SYMBOL(tty_open_by_driver);=1B[00m =20 /** * tty_open - open a tty device =1B[32mIndex: linux-stable/drivers/tty/tty_port.c=1B[00m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =1B[32m--- linux-stable.orig/drivers/tty/tty_port.c=1B[00m =1B[32m+++ linux-stable/drivers/tty/tty_port.c=1B[00m =1B[33m@@ -335,7 +335,7 @@=1B[00m=1B[35m=1B[00m * tty_port_block_til_ready - Waiting logic for tty open * @port: the tty port being opened * @tty: the tty device being bound =1B[35m- * @filp: the file pointer of the opener=1B[00m =1B[36m+ * @filp: the file pointer of the opener or NULL=1B[00m * * Implement the core POSIX/SuS tty behaviour when opening a tty device. * Handles: =1B[33m@@ -369,7 +369,7 @@=1B[00m=1B[35m=1B[00m tty_port_set_active(port, 1); return 0; } =1B[35m- if (filp->f_flags & O_NONBLOCK) {=1B[00m =1B[36m+ if (filp =3D=3D NULL || filp->f_flags & O_NONBLOCK) {=1B[00m /* Indicate we are open */ if (C_BAUD(tty)) tty_port_raise_dtr_rts(port); =1B[32mIndex: linux-stable/include/linux/tty.h=1B[00m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =1B[32m--- linux-stable.orig/include/linux/tty.h=1B[00m =1B[32m+++ linux-stable/include/linux/tty.h=1B[00m =1B[33m@@ -394,6 +394,8 @@=1B[00m=1B[35m=1B[00m /* tty_io.c */ extern int __init tty_init(void); extern const char *tty_name(const struct tty_struct *tty); =1B[36m+extern struct tty_struct *tty_open_by_driver(dev_t device, struct i= node *inode,=1B[00m =1B[36m+ struct file *filp);=1B[00m #else static inline void console_init(void) { } --zYM0uCDKw75PZbzx--