[PATCH v2] staging: speakup: document sysfs attributes

2019-10-01 Thread Okash Khawaja
TODO. Authored-by: Gregory Nowak Submitted-by: Okash Khawaja Signed-off-by: Okash Khawaja --- drivers/staging/speakup/sysfs-driver-speakup | 369 +++ 1 file changed, 369 insertions(+) create mode 100644 drivers/staging/speakup/sysfs-driver-speakup diff --git a/drivers/staging/speakup/

[PATCH] staging: speakup: document sysfs attributes

2019-09-21 Thread Okash Khawaja
TODO. Authored-by: Gregory Nowak Submitted-by: Okash Khawaja --- drivers/staging/speakup/sysfs-driver-speakup | 369 +++ 1 file changed, 369 insertions(+) create mode 100644 drivers/staging/speakup/sysfs-driver-speakup diff --git a/drivers/staging/speakup/sysfs-driver-speakup b/dr

Re: [HELP REQUESTED from the community] Was: Staging status of speakup

2019-09-20 Thread Okash Khawaja
On Fri, Sep 20, 2019 at 8:46 AM Greg Kroah-Hartman wrote: > > On Wed, Sep 18, 2019 at 01:30:33PM -0700, Gregory Nowak wrote: > > > Extra line between each attribute (before the "What:" line) would be > > > nice. > > > > In a previous post above, you wrote: > > On Mon, Sep 16, 2019 at 04:11:00PM +0

Re: Re: [HELP REQUESTED from the community] Was: Staging status of speakup

2019-09-17 Thread Okash Khawaja
Ah it looks like the spaces after Description: need to be converted into tabs. Thanks, Okash On Tue, Sep 17, 2019 at 10:35 PM Okash Khawaja wrote: > > Hi Greg, > > You're right, I got none of those emails. Thanks. Is it all taken care of? > > Best regards, > Okash >

Re: [HELP REQUESTED from the community] Was: Staging status of speakup

2019-09-15 Thread Okash Khawaja
On Sun, Sep 15, 2019 at 2:43 PM Greg Kroah-Hartman wrote: > > On Sat, Sep 14, 2019 at 10:08:35PM +0100, Okash Khawaja wrote: > > On Mon, Sep 9, 2019 at 3:55 AM Gregory Nowak wrote: > > > > > > On Sun, Sep 08, 2019 at 10:43:02AM +0100, Okash Khawaja wrote: > >

Re: [HELP REQUESTED from the community] Was: Staging status of speakup

2019-09-14 Thread Okash Khawaja
On Mon, Sep 9, 2019 at 3:55 AM Gregory Nowak wrote: > > On Sun, Sep 08, 2019 at 10:43:02AM +0100, Okash Khawaja wrote: > > Sorry, I have only now got round to working on this. It's not complete > > yet but I have assimilated the feedback and converted subjective >

Re: [HELP REQUESTED from the community] Was: Staging status of speakup

2019-09-08 Thread Okash Khawaja
step will be to convert the format to match Documentation/ABI/ requirements. Thanks, Okash On Wed, Aug 21, 2019 at 11:23 PM Gregory Nowak wrote: > > On Wed, Aug 21, 2019 at 09:39:25AM -0700, Okash Khawaja wrote: > > Hi Greg N, > > > > Would like to send this as a patch a

Re: [HELP REQUESTED from the community] Was: Staging status of speakup

2019-08-21 Thread Okash Khawaja
On Thu, Jul 25, 2019 at 3:49 AM John Covici wrote: > > I think the program is genmap, I have it in my init sequence, but I > am not sure it does anything at this point. > > On Thu, 25 Jul 2019 00:04:07 -0400, > Chris Brannon wrote: > > > > Gregory Nowak writes: > > > > > keymap > > > I believe t

Re: Staging status of speakup

2019-07-12 Thread Okash Khawaja
On Fri, Jul 12, 2019 at 9:38 AM Greg Kroah-Hartman wrote: > > On Sun, Jul 07, 2019 at 08:57:10AM +0200, Greg Kroah-Hartman wrote: > > On Sat, Jul 06, 2019 at 08:08:57PM +0100, Okash Khawaja wrote: > > > On Fri, 15 Mar 2019 20:18:31 -0700 > > > Greg Kroah-Hartman wr

Re: Staging status of speakup

2019-07-06 Thread Okash Khawaja
On Fri, 15 Mar 2019 20:18:31 -0700 Greg Kroah-Hartman wrote: > On Fri, Mar 15, 2019 at 01:01:27PM +0000, Okash Khawaja wrote: > > Hi, > > > > We have made progress on the items in TODO file of speakup driver in > > staging directory and wanted to get some clarity

[PATCH v2 2/2] staging: speakup: refactor to use existing code in vt

2019-04-17 Thread Okash Khawaja
x27;t get EBUSY forever. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Tested-by: Gregory Nowak --- drivers/staging/speakup/main.c | 1 + drivers/staging/speakup/selection.c | 212 +++- drivers/staging/speakup/speakup.h | 1 + 3 files changed

[PATCH v2 1/2] vt: selection: allow functions to be called from inside kernel

2019-04-17 Thread Okash Khawaja
() and fixing for name change. It also exports set_selection_kernel() and paste_selection(). These changes are used the following patch where speakup's selection functionality calls into the above functions, thereby doing away with parallel implementation. Signed-off-by: Okash Khawaja Review

[PATCH v2 0/2] staging: speakup: factor out selection code

2019-04-17 Thread Okash Khawaja
Hi, The v2 renames set_selection() and do_set_selection() to following more explicit names: set_selection_user() /* includes copying data from user space */ set_selection_kernel() /* no copying from user space */ The patches also update references to set_selection() to be set_selection_user().

[PATCH 1/2] vt: selection: allow functions to be called from inside kernel

2019-04-04 Thread Okash Khawaja
ereby doing away with parallel implementation. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Tested-by: Gregory Nowak --- drivers/tty/vt/selection.c | 37 - include/linux/selection.h | 3 +-- 2 files changed, 25 insertions(+), 15 deletions(-)

[PATCH 0/2] staging: speakup: factor out selection code

2019-04-04 Thread Okash Khawaja
Hi, Speakup's selection functionality parallels that of drivers/tty/vt/selection.c. This patch set replaces speakup's implementation with calls to vt's selection code. This is one of the remaining items in our TODO file and it's needed for moving speakup out of staging. Please note that in speaku

[PATCH 2/2] staging: speakup: refactor to use existing code in vt

2019-04-04 Thread Okash Khawaja
t EBUSY forever. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Tested-by: Gregory Nowak --- drivers/staging/speakup/main.c | 1 + drivers/staging/speakup/selection.c | 212 +++- drivers/staging/speakup/speakup.h | 1 + 3 files changed, 88 insertions(+)

Re: Staging status of speakup

2019-03-20 Thread Okash Khawaja
On Tue, 19 Mar 2019 16:31:21 + Alan Cox wrote: > On Sat, 16 Mar 2019 10:35:43 +0100 > Samuel Thibault wrote: > > > Chris Brannon, le ven. 15 mars 2019 18:19:39 -0700, a ecrit: > > > Okash Khawaja writes: > > > > Finally there is an issue w

Re: Staging status of speakup

2019-03-16 Thread Okash Khawaja
On Fri, 15 Mar 2019 20:18:31 -0700 Greg Kroah-Hartman wrote: > On Fri, Mar 15, 2019 at 01:01:27PM +0000, Okash Khawaja wrote: > > Hi, > > > > We have made progress on the items in TODO file of speakup driver in > > staging directory and wanted to get some clarity

Re: Staging status of speakup

2019-03-16 Thread Okash Khawaja
Hi, On Fri, 15 Mar 2019 18:19:39 -0700 Chris Brannon wrote: > Okash Khawaja writes: > > > Finally there is an issue where text in output buffer sometimes gets > > garbled on SMP systems, but we can continue working on it after the > > driver is moved out of staging, i

Staging status of speakup

2019-03-15 Thread Okash Khawaja
Hi, We have made progress on the items in TODO file of speakup driver in staging directory and wanted to get some clarity on the remaining items. Below is a summary of status of each item along with the quotes from TODO file. 1. "The first issue has to do with the way speakup communicates with se

[patch 1/1] [patch] staging: speakup: fix speakup-r empty line lockup

2017-09-05 Thread Okash Khawaja
ypress inside timer context. When not inside key press notifier callback, the behaviour will remain the same as before this patch. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers/staging/speakup/main.c | 15 --- 1 file changed, 12 insertions(+), 3 del

[patch 0/1] staging: speakup: fix speakup-r empty line lockup

2017-09-05 Thread Okash Khawaja
Hi, This patch fixes kernel lockup shown by lockdep log below. Further details are in patch header. Samuel, please note that I removed initialisation of the static int in_keyboard_notifier to zero as that is not required and reported as error by checkpatch. Thanks, Okash [ 1293.803242] ===

[patch] staging: speakup: fix async usb removal

2017-08-12 Thread Okash Khawaja
ere stopped by speakup. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers/staging/speakup/spk_ttyio.c | 50 1 file changed, 50 insertions(+) --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/speakup/spk_ttyio.c @@ -1

Re: [patch] staging: speakup: remove support for lp*

2017-08-12 Thread Okash Khawaja
Testing has shown that lp* devices don't work correctly with speakup just yet. That will require some additional work. Until then, this patch removes code related to that. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers/staging/speakup/spk_ttyio.c |

[patch] staging: speakup: remove support for lp*

2017-07-20 Thread Okash Khawaja
Testing has shown that lp* devices don't work correctly with speakup just yet. That will require some additional work. Until then, this patch removes code related to that. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/spk_ttyio.c | 23 +-- 1 file chang

[patch v3 0/3] tty contention resulting from tty_open_by_driver export

2017-07-20 Thread Okash Khawaja
Hi, I have updated the patches so that the exclusivity flag is in tty_port. When closing the struct - by calling tty_release_struct - we also need to reset the flag. One way to do that is to reset the flag inside tty_release_struct function, regardless of whether the tty was opened through tty_kop

[patch v3 2/3] staging: speakup: use tty_kopen and tty_kclose

2017-07-20 Thread Okash Khawaja
This patch replaces call to tty_open_by_driver with a tty_kopen and uses tty_kclose instead of tty_release_struct to close it. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/spk_ttyio.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/staging/speakup

[patch v3 1/3] tty: resolve tty contention between kernel and user space

2017-07-20 Thread Okash Khawaja
nicom, picocom and commands like "echo foo > /dev/ttyS0". They all correctly report "Device or resource busy" when the tty is already kernel opened. Signed-off-by: Okash Khawaja --- drivers/tty/tty_io.c | 100 --- include/linu

[patch v3 3/3] tty: undo export of tty_open_by_driver

2017-07-20 Thread Okash Khawaja
Since we have tty_kopen, we no longer need to export tty_open_by_driver. This patch makes this function static. Signed-off-by: Okash Khawaja --- drivers/tty/tty_io.c |3 +-- include/linux/tty.h |5 - 2 files changed, 1 insertion(+), 7 deletions(-) --- a/drivers/tty/tty_io.c +++ b

Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-18 Thread Okash Khawaja
On Tue, Jul 18, 2017 at 03:26:37PM +0300, Dan Carpenter wrote: > > + if (tty) { > > + /* drop kref from tty_driver_lookup_tty() */ > > + tty_kref_put(tty); > > + tty = ERR_PTR(-EBUSY); > > + } else { /* tty_init_dev returns tty with the tty_lock

Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-18 Thread Okash Khawaja
On Mon, Jul 17, 2017 at 11:04:38PM +0100, Alan Cox wrote: > > > Sure. I can fix the tty->count mismatch based on Alan's suggestion. However > > I don't understand why the exclusivity flag should belong to tty_port and > > not tty_struct. It will be good to know why. > > We are trying to move a

[patch v2 0/3] tty contention resulting from tty_open_by_driver export

2017-07-17 Thread Okash Khawaja
Hi, I have reworked the previous patch set. These are the changes: 1. Patch 1 fixes tty->count mismatch reported by check_tty_count when a tty is kopened. 2. Patch 1 incorporates patch 4 in the previous patch set - it returns -ENODEV when tty is not configured. Thanks, Okash

[patch v2 3/3] tty: undo export of tty_open_by_driver

2017-07-17 Thread Okash Khawaja
Since we have tty_kopen, we no longer need to export tty_open_by_driver. This patch makes this function static. Signed-off-by: Okash Khawaja --- drivers/tty/tty_io.c |3 +-- include/linux/tty.h |5 - 2 files changed, 1 insertion(+), 7 deletions(-) --- a/drivers/tty/tty_io.c +++ b

[patch v2 2/3] staging: speakup: use tty_kopen instead of tty_open_by_driver

2017-07-17 Thread Okash Khawaja
This patch replaces call to tty_open_by_driver with a tty_kopen. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/spk_ttyio.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/speakup/spk_ttyio.c @@ -158,7 +158,7

[patch v2 1/3] tty: resolve tty contention between kernel and user space

2017-07-17 Thread Okash Khawaja
0". They all correctly report "Device or resource busy" when the tty is already kernel opened. Signed-off-by: Okash Khawaja --- drivers/tty/tty_io.c | 66 +++ include/linux/tty.h |4 +++ 2 files changed, 65 insertions(+), 5

Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-17 Thread Okash Khawaja
> On 17 Jul 2017, at 13:31, Greg Kroah-Hartman > wrote: > >> On Thu, Jul 13, 2017 at 12:29:54PM +0100, Okash Khawaja wrote: >>> On Wed, Jul 12, 2017 at 07:20:28PM +0100, Alan Cox wrote: >>> >>>> When opening from kernel, we don't use fi

[patch 2/2] staging: speakup: safely register and unregister ldisc

2017-07-16 Thread Okash Khawaja
ed. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/main.c |2 ++ drivers/staging/speakup/spk_ttyio.c |8 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -2315,6 +2315,7 @@ sta

[patch 1/2] staging: speakup: add functions to register and unregister ldisc

2017-07-16 Thread Okash Khawaja
This patch adds the above two functions and makes them available to main.c where they will be called during init and exit functions of main speakup module. Following patch will make use of them. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/spk_priv.h |2 ++ drivers/staging

[patch 0/2] staging: speakup: safely unregister ldisc

2017-07-16 Thread Okash Khawaja
Hi, These patches make sure that N_SPEAKUP is correctly unregistered when all speakup related modules are unloaded, making sure the refcount correctly represents the number of users. Patch 1: simply adds functions to register and unregister ldisc, without changing existing behaviour Patch

[patch v2 0/1] staging: speakup: safely close tty

2017-07-16 Thread Okash Khawaja
Hi, Let's deal with the ldisc refcount problem separately. Purpose of this patch is to close tty safely, so I have removed the call to unregister the ldisc. I will follow this up with a separate patch which addresses the ldisc issue. Thanks, Okash ___ d

[patch v2 1/1] staging: speakup: safely close tty

2017-07-16 Thread Okash Khawaja
calls tty_ldisc_release, so speakup doesn't need to call it. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/spk_ttyio.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/speakup/spk_ttyio.c @@ -300,7 +300

Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-13 Thread Okash Khawaja
On Wed, Jul 12, 2017 at 07:20:28PM +0100, Alan Cox wrote: > > > When opening from kernel, we don't use file pointer. The count mismatch > > is between tty->count and #fd's. So opening from kernel leads to #fd's > > being less than tty->count. I thought this difference is relevant to > > user-space

Re: [patch] staging: speakup: safely close tty

2017-07-13 Thread Okash Khawaja
On Wed, Jul 12, 2017 at 07:25:22PM +0100, Alan Cox wrote: > > spk_ttyio_initialise_ldisc is called separately for each module (e.g. > > speakup_apollo, speakup_ltlk etc) when it is loaded. spk_ttyio_release > > is also called separately for each module when it is unloaded. The ldisc > > stays aroun

Re: [patch] staging: speakup: safely close tty

2017-07-11 Thread Okash Khawaja
Hi, On Mon, Jul 10, 2017 at 12:55:44PM +0100, Alan Cox wrote: > On Fri, 7 Jul 2017 20:13:01 +0100 > Okash Khawaja wrote: > > > Speakup opens tty using tty_open_by_driver. When closing, it calls > > tty_ldisc_release but doesn't close and remove the tty itself. As a &

Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-10 Thread Okash Khawaja
On Mon, Jul 10, 2017 at 01:33:07PM +0100, Okash Khawaja wrote: > > If the tty counts are being misreported then it would be better to fix > > the code to actually manage the counts properly. The core tty code is > > telling you that the tty is not in a valid state. While this

Re: [patch 1/3] tty: resolve tty contention between kernel and user space

2017-07-10 Thread Okash Khawaja
On Mon, Jul 10, 2017 at 06:21:37PM +0300, Andy Shevchenko wrote: > On Mon, Jul 10, 2017 at 11:31 AM, Okash Khawaja > wrote: > > On Sun, Jul 09, 2017 at 06:04:17PM +0300, Andy Shevchenko wrote: > >> On Sun, Jul 9, 2017 at 2:41 PM, Okash Khawaja > >> wrote:

Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-10 Thread Okash Khawaja
On Mon, Jul 10, 2017 at 12:52:33PM +0100, Alan Cox wrote: > On Sun, 09 Jul 2017 12:41:53 +0100 > Okash Khawaja wrote: > > > On Sat, Jul 08, 2017 at 10:38:03AM +0200, Greg Kroah-Hartman wrote: > > > Overall, the idea looks sane to me. Keeping userspace from opening a &

Re: [patch 1/3] tty: resolve tty contention between kernel and user space

2017-07-10 Thread Okash Khawaja
On Sun, Jul 09, 2017 at 06:04:17PM +0300, Andy Shevchenko wrote: > On Sun, Jul 9, 2017 at 2:41 PM, Okash Khawaja wrote: > > > +struct tty_struct *tty_kopen(dev_t device) > > +{ > > + struct tty_struct *tty; > > + struct tty_driver *driver = NU

Re: [patch 1/3] tty: resolve tty contention between kernel and user space

2017-07-09 Thread Okash Khawaja
Hi, On Sun, Jul 09, 2017 at 06:04:17PM +0300, Andy Shevchenko wrote: > Above > 1. take mutex > 2. take reference > > Here: > 1. give mutex back > 2. give reference back > > I think we usually see symmetrical calls, i.e. > > 1. give reference back > 2. give mutex back > > So, what did I miss

[patch 4/3] tty: make tty_kopen return ENODEV in case of no TTY

2017-07-09 Thread Okash Khawaja
When TTY is not built, tty_kopen should return an error. This way calling code remains consistent, regardless of whether tty is built or not. This patch returns -ENODEV when there is no tty. Signed-off-by: Okash Khawaja --- include/linux/tty.h |2 +- 1 file changed, 1 insertion(+), 1

Re: [patch 2/3] staging: speakup: use tty_kopen instead of tty_open_by_driver

2017-07-09 Thread Okash Khawaja
On Sun, Jul 09, 2017 at 01:50:55PM +0200, Greg Kroah-Hartman wrote: > On Sun, Jul 09, 2017 at 12:41:55PM +0100, Okash Khawaja wrote: > > This patch replaces call to tty_open_by_driver with a tty_kopen. > > > > Signed-off-by: Okash Khawaja > > > > --- > &g

[patch 3/3] tty: undo export of tty_open_by_driver

2017-07-09 Thread Okash Khawaja
Since we have tty_kopen, we no longer need to export tty_open_by_driver. This patch makes this function static. Signed-off-by: Okash Khawaja --- drivers/tty/tty_io.c |3 +-- include/linux/tty.h |5 - 2 files changed, 1 insertion(+), 7 deletions(-) --- a/drivers/tty/tty_io.c +++ b

[patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-09 Thread Okash Khawaja
On Sat, Jul 08, 2017 at 10:38:03AM +0200, Greg Kroah-Hartman wrote: > Overall, the idea looks sane to me. Keeping userspace from opening a > tty that the kernel has opened internally makes sense, hopefully > userspace doesn't get too confused when that happens. I don't think we > normally return

[patch 2/3] staging: speakup: use tty_kopen instead of tty_open_by_driver

2017-07-09 Thread Okash Khawaja
This patch replaces call to tty_open_by_driver with a tty_kopen. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/spk_ttyio.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/speakup/spk_ttyio.c @@ -164,7 +164,7

[patch 1/3] tty: resolve tty contention between kernel and user space

2017-07-09 Thread Okash Khawaja
nterface. I have tested this with minicom, picocom and commands like "echo foo > /dev/ttyS0". They all correctly report "Device or resource busy" when the tty is already kernel opened. Signed-off-by: Okash Khawaja --- drivers/tty/tty_io.c | 54 +++

Re: tty contention resulting from tty_open_by_device export

2017-07-08 Thread Okash Khawaja
On Sat, Jul 08, 2017 at 10:38:03AM +0200, Greg Kroah-Hartman wrote: > > + > > +if (tty) { > > +tty_kref_put(tty); /* drop kref from > > tty_driver_lookup_tty() */ > > Put the comment above the line? > Sure > > +tty = ERR_PTR(-EBUSY); > > +} else

tty contention resulting from tty_open_by_device export

2017-07-07 Thread Okash Khawaja
Hi, The commit 12e84c71b7d4ee (tty: export tty_open_by_driver) exports tty_open_by_device to allow tty to be opened from inside kernel which works fine except that it doesn't handle contention with user space or another kernel-space open of the same tty. For example, opening a tty from user space

[patch] staging: speakup: safely close tty

2017-07-07 Thread Okash Khawaja
calls tty_ldisc_release, so speakup doesn't need to call it. This patch also unregisters N_SPEAKUP. It is registered when a speakup module is loaded. Signed-off-by: Okash Khawaja --- drivers/staging/speakup/spk_ttyio.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drive

Re: [PATCH] staging: speakup: make function ser_to_dev static

2017-06-28 Thread Okash Khawaja
d. Should it be static?" Thanks very much! > > Signed-off-by: Colin Ian King Reviewed-by: Okash Khawaja > --- > drivers/staging/speakup/spk_ttyio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/speakup/spk_ttyio.c

[patch v4 1/3] tty: add function to convert device name to number

2017-06-25 Thread Okash Khawaja
The function converts strings like ttyS0 and ttyUSB0 to dev_t like (4, 64) and (188, 0). It does this by scanning tty_drivers list for corresponding device name and index. If the driver is not registered, this function returns -ENODEV. It also acquires tty_mutex. Signed-off-by: Okash Khawaja

[patch v4 2/3] staging: speakup: check and convert dev name or ser to dev_t

2017-06-25 Thread Okash Khawaja
sed in. It currently supports ttyS*, ttyUSB* and, for selected synths, lp*. The patch also introduces a string member variable named 'dev_name' to struct spk_synth. 'dev_name' represents the device name - ttyUSB0 etc - which needs conversion to dev_t. Signed-off-by: Okash Khawaja

[patch v4 3/3] staging: speakup: make ttyio synths use device name

2017-06-25 Thread Okash Khawaja
used. If both are non-default then dev is used. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Reviewed-by: Andy Shevchenko --- drivers/staging/speakup/speakup_acntsa.c |3 +++ drivers/staging/speakup/speakup_apollo.c |3 +++ drivers/staging/speakup/speakup_audptr.c |3

[patch v4 0/3] staging: speakup: support more than ttyS*

2017-06-25 Thread Okash Khawaja
Hi, v3 of this patch set introduced the compiler warning: drivers//tty/tty_io.c:348:11: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] This version fixes that warning in patch 1/3. Thanks, Okash ___ de

Re: [staging:staging-testing 383/386] drivers//tty/tty_io.c:348:11: warning: assignment discards 'const' qualifier from pointer target type

2017-06-25 Thread Okash Khawaja
Hi, On Mon, Jun 26, 2017 at 01:24:43AM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > staging-testing > head: 2a38eb6552c934a13e1f1b8c579147fac9c94efb > commit: 9a71d0257f1f63d64015f7d2c25485272df4d535 [383/386] tty: add function

[patch] staging: speakup: fix synth caching when synth init fails

2017-06-20 Thread Okash Khawaja
removing the cached synth - is never called. Next time the failing synth is added again it succeeds because synth_add finds it cached inside synths[]. This patch fixes this by caching a synth only after do_synth_init succeeds. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers

[patch v3 1/3] tty: add function to convert device name to number

2017-06-19 Thread Okash Khawaja
The function converts strings like ttyS0 and ttyUSB0 to dev_t like (4, 64) and (188, 0). It does this by scanning tty_drivers list for corresponding device name and index. If the driver is not registered, this function returns -ENODEV. It also acquires tty_mutex. Signed-off-by: Okash Khawaja

[patch v3 0/3] staging: speakup: support more than ttyS*

2017-06-19 Thread Okash Khawaja
Hi, I have updated the patches based on feedback. For patch 1, In favour of consistency, I've updated the code which extracts trailing digits so that it is like similar code in tty_find_polling_driver. Also fixed checkpatch warnings. Here's summary of the patches Patch 1 adds functionality to co

[patch v3 3/3] staging: speakup: make ttyio synths use device name

2017-06-19 Thread Okash Khawaja
used. If both are non-default then dev is used. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Reviewed-by: Andy Shevchenko --- drivers/staging/speakup/speakup_acntsa.c |3 +++ drivers/staging/speakup/speakup_apollo.c |3 +++ drivers/staging/speakup/speakup_audptr.c |3

[patch v3 2/3] staging: speakup: check and convert dev name or ser to dev_t

2017-06-19 Thread Okash Khawaja
sed in. It currently supports ttyS*, ttyUSB* and, for selected synths, lp*. The patch also introduces a string member variable named 'dev_name' to struct spk_synth. 'dev_name' represents the device name - ttyUSB0 etc - which needs conversion to dev_t. Signed-off-by: Okash Khawaja

Re: [patch v2 1/3] tty: add function to convert device name to number

2017-06-19 Thread Okash Khawaja
On Sun, Jun 18, 2017 at 04:27:42PM +0300, Andy Shevchenko wrote: > This doesn't have actual parameter name. > Btw, I would drop dev_ suffix completely from parameter (you have it > in function name). Good call, thanks. > > + * Locking: this acquires tty_mutex > > ...and releases. > > Perhap

Re: [patch v2 2/3] staging: speakup: check and convert dev name or ser to dev_t

2017-06-18 Thread Okash Khawaja
On Mon, Jun 19, 2017 at 09:15:33AM +0800, Greg Kroah-Hartman wrote: > > +int ser_to_dev(int ser, dev_t *dev_no) > > +{ > > + if (ser < 0 || ser > (255 - 64)) { > > +pr_err("speakup: Invalid ser param. \ > > + Must be between 0 and 191 inclusive.\n"); > >

Re: [patch v2 2/3] staging: speakup: check and convert dev name or ser to dev_t

2017-06-18 Thread Okash Khawaja
Hi, Thanks for the reviews. Couple of things inlined below. On Sun, Jun 18, 2017 at 04:35:21PM +0300, Andy Shevchenko wrote: > > > +const char *lp_supported[] = { "acntsa", "bns", "dummy", "txprt" }; > > static ? Sure! > > + if (ser < 0 || ser > (255 - 64)) { > > > +pr_e

[patch v2 3/3] staging: speakup: make ttyio synths use device name

2017-06-18 Thread Okash Khawaja
used. If both are non-default then dev is used. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers/staging/speakup/speakup_acntsa.c |3 +++ drivers/staging/speakup/speakup_apollo.c |3 +++ drivers/staging/speakup/speakup_audptr.c |3 +++ drivers/staging/speakup

[patch v2 2/3] staging: speakup: check and convert dev name or ser to dev_t

2017-06-18 Thread Okash Khawaja
sed in. It currently supports ttyS*, ttyUSB* and, for selected synths, lp*. The patch also introduces a string member variable named 'dev_name' to struct spk_synth. 'dev_name' represents the device name - ttyUSB0 etc - which needs conversion to dev_t. Signed-off-by: Okash Khawaja

[patch v2 1/3] tty: add function to convert device name to number

2017-06-18 Thread Okash Khawaja
The function converts strings like ttyS0 and ttyUSB0 to dev_t like (4, 64) and (188, 0). It does this by scanning tty_drivers list for corresponding device name and index. If the driver is not registered, this function returns -ENODEV. It also acquires tty_mutex. Signed-off-by: Okash Khawaja

[patch v2 0/3] staging: speakup: support more than ttyS*

2017-06-18 Thread Okash Khawaja
Hi, The patchset now contains a separate patch for dev name-to-number conversion functionality inside tty_io.c. These patches extend speakup support to ttyUSB* and lp*. They introduce a new module param dev whose function is similar to ser but instead of taking serial port number as argument, it

[patch v2] tty: define tty_open_by_driver when CONFIG_TTY is not defined

2017-06-17 Thread Okash Khawaja
ned-off-by: Okash Khawaja --- include/linux/tty.h |3 +++ 1 file changed, 3 insertions(+) --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -422,6 +422,9 @@ static inline int __init tty_init(void) { return 0; } static inline const char *tty_name(const struct tty_struct *tty) { ret

Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-17 Thread Okash Khawaja
On Sat, Jun 17, 2017 at 12:25:34PM +0200, Greg Kroah-Hartman wrote: > On Sat, Jun 17, 2017 at 11:16:44AM +0100, Okash Khawaja wrote: > > Hi, > > > > On Thu, Jun 15, 2017 at 07:52:51AM +0100, Okash Khawaja wrote: > > > On Wed, Jun 14, 2017 at 03:04:18PM +

Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-17 Thread Okash Khawaja
Hi, On Thu, Jun 15, 2017 at 07:52:51AM +0100, Okash Khawaja wrote: > On Wed, Jun 14, 2017 at 03:04:18PM +0200, Greg Kroah-Hartman wrote: > > The console stuff is odd though, but that is each driver defining the > > name for itself, major/minor does not apply. Also, a separate dr

tty: define tty_open_by_driver when CONFIG_TTY is not defined

2017-06-17 Thread Okash Khawaja
ned-off-by: Okash Khawaja --- include/linux/tty.h |3 +++ 1 file changed, 3 insertions(+) --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -422,6 +422,9 @@ static inline int __init tty_init(void) { return 0; } static inline const char *tty_name(const struct tty_struct *tty) { ret

Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-15 Thread Okash Khawaja
Hi, On Wed, Jun 14, 2017 at 9:23 AM, Dan Carpenter wrote: [...] > > Could you call it "dev_name" instead? I normally expect "dev" to be a > device struct. Thanks for the feedback. Will keep these in mind for next version of the patch. Okash ___ devel

Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Okash Khawaja
Hi, On Wed, Jun 14, 2017 at 03:04:18PM +0200, Greg Kroah-Hartman wrote: > The console stuff is odd though, but that is each driver defining the > name for itself, major/minor does not apply. Also, a separate driver is > not having to figure this all out. I wonder if we could just add a tty > co

[patch 2/2] staging: speakup: make ttyio synths use device name

2017-06-13 Thread okash . khawaja
used. If both are non-default then dev is used. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers/staging/speakup/speakup_acntsa.c |3 +++ drivers/staging/speakup/speakup_apollo.c |3 +++ drivers/staging/speakup/speakup_audptr.c |3 +++ drivers/staging/speakup

[patch 0/2] staging: speakup: support more than ttyS*

2017-06-13 Thread okash . khawaja
Hi, These patches extend speakup support to ttyUSB* and lp*. They introduce a new module param dev whose function is similar to ser but instead of taking serial port number as argument, it takes strings like ttyS0 or ttyUSB0. First patch just adds functionality to convert such strings into dev_t.

[patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-13 Thread okash . khawaja
selected synths, lp*. In order to do this, the patch also introduces a string member variable named 'dev' to struct spk_synth. 'dev' represents the device name - ttyUSB0 etc - which needs conversion to dev_t. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- dri

[patch] staging: speakup: migrate bns to tty

2017-06-07 Thread Okash Khawaja
Migration of bns was missed out in the patch https://patchwork.kernel.org/patch/9727725/. This patch does it by updating relevant function pointers, just like in the patch linked above. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers/staging/speakup/speakup_bns.c |8

Re: [PATCH 0/4] staging: speakup: fix code style

2017-06-07 Thread Okash Khawaja
Hi, On Mon, Jun 05, 2017 at 11:42:59PM -0400, Bo YU wrote: > As checkpatch.pl reported, i fixed these complaint one by one. Maybe > patch 04 depend on patch 02. Thanks for the patches :) I've reviewed them all Okash ___ devel mailing list de...@linuxdr

Re: [PATCH 4/4] staging: speakup: alignment match open parens

2017-06-07 Thread Okash Khawaja
On Mon, Jun 05, 2017 at 11:44:40PM -0400, Bo YU wrote: > I have aligned argument with parenthesis, so checkpatch no check also. > > Signed-off-by: Bo YU Reviewed-by: Okash Khawaja > --- > drivers/staging/speakup/serialio.c |2 +- > 1 file changed, 1 insertion(+), 1 del

Re: [PATCH 3/4] staging: speakup: in serialio.c no over 80 chars long

2017-06-07 Thread Okash Khawaja
On Mon, Jun 05, 2017 at 11:44:26PM -0400, Bo YU wrote: > Fixed the checkpatch.pl warning: > > WARNING: line over 80 characters > > Signed-off-by: Bo YU Reviewed-by: Okash Khawaja > --- > drivers/staging/speakup/serialio.c |6 -- > 1 file changed, 4 in

Re: [PATCH 2/4] staging: speakup: add a space around '|'

2017-06-07 Thread Okash Khawaja
On Mon, Jun 05, 2017 at 11:44:11PM -0400, Bo YU wrote: > Add a space around logical symbol '|' to wipe out checkpatch check > > Signed-off-by: Bo YU Reviewed-by: Okash Khawaja > --- > drivers/staging/speakup/serialio.c |2 +- > 1 file changed, 1 insertion

Re: [PATCH 1/4] staging: speakup: add a missing blank line after declaration

2017-06-07 Thread Okash Khawaja
On Mon, Jun 05, 2017 at 11:43:55PM -0400, Bo YU wrote: > Fixed checkpatch warning by adding a blank line after declare > expression > > Signed-off-by: Bo YU Reviewed-by: Okash Khawaja > --- > drivers/staging/speakup/serialio.c |1 + > 1 file changed, 1 insertion

[patch] staging: speakup: remove unused code

2017-06-01 Thread Okash Khawaja
In spk_ttyio_release we read tty's index but never do anything with it. The patch removes this dead code. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault --- drivers/staging/speakup/spk_ttyio.c |3 --- 1 file changed, 3 deletions(-) --- a/drivers/staging/speakup/spk_tt

[patch] staging: speakup: check for null before calling TTY's flush_buffer

2017-05-31 Thread Okash Khawaja
We should check the flush_buffer method of a tty for null before invoking it. Some drivers such as usbserial don't implement flush_buffer. This will be required for upcoming patches where we expand spk_ttyio to support more than just ttyS*. Signed-off-by: Okash Khawaja Reviewed-by: S

Re: [patch v2 6/6] staging: speakup: flush tty buffers and ensure hardware flow control

2017-05-16 Thread Okash Khawaja
> On 16 May 2017, at 13:28, Greg Kroah-Hartman > wrote: > >> On Tue, May 16, 2017 at 01:19:10PM +0100, Okash Khawaja wrote: >> Hi, >> >> On Tue, May 16, 2017 at 1:00 PM, Greg Kroah-Hartman >> wrote: >>> On Mon, May 15, 2017 at 06:45:37PM +0100

Re: [patch v2 6/6] staging: speakup: flush tty buffers and ensure hardware flow control

2017-05-16 Thread Okash Khawaja
Hi, On Tue, May 16, 2017 at 1:00 PM, Greg Kroah-Hartman wrote: > On Mon, May 15, 2017 at 06:45:37PM +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

[patch v2 4/6] staging: speakup: add send_xchar, tiocmset and input functionality for tty

2017-05-15 Thread Okash Khawaja
_buf2. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Index: linux-staging/drivers/staging/speakup/spk_ttyio.c === --- linux-staging.orig/drivers/staging/speakup/spk_ttyio.c +++ linux-staging/drivers/staging/speakup/spk_tt

[patch v2 3/6] staging: speakup: migrate acntsa, bns, dummy and txprt to ttyio

2017-05-15 Thread Okash Khawaja
This changes the above five synths to TTY-based comms. They were chosen as a first pass because their serial comms are straightforward, i.e. they don't use serial input and don't do internal port knocking. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Index: linux-stagi

[patch v2 6/6] staging: speakup: flush tty buffers and ensure hardware flow control

2017-05-15 Thread Okash Khawaja
synth_flush is called. It also tries to ensure that hardware flow control is enabled, by setting CRTSCTS using tty's termios. Reported-by: John Covici Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Index: linux-staging/drivers/staging/speakup/seria

[patch v2 5/6] staging: speakup: migrate apollo, ltlk, audptr, decext, dectlk and spkout

2017-05-15 Thread Okash Khawaja
This patch simply uses the changes introduced in previous patches and migrates apollo, ltlk, audptr, decext, spkout and dectlk. Migrations are straightforward function pointer updates. Signed-off by: Okash Khawaja Reviewed-by: Samuel Thibault Index: linux-staging/drivers/staging/speakup

[patch v2 2/6] staging: speakup: add tty-based comms functions

2017-05-15 Thread Okash Khawaja
witch to accessing serial ports through the TTY subsystem, whenever appropriate. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Index: linux-staging/drivers/staging/speakup/Makefile === --- linux-staging.orig/drivers/st

  1   2   >