[PATCH v2] staging: speakup: document sysfs attributes

2019-10-01 Thread Okash Khawaja
. 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/sysfs

[PATCH] staging: speakup: document sysfs attributes

2019-09-21 Thread Okash Khawaja
. 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/drivers

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

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
Next 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 as Gre

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

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 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

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

2019-04-17 Thread Okash Khawaja
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

[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 Reviewed

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

2019-04-04 Thread Okash Khawaja
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(-) diff

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

2019-04-04 Thread Okash Khawaja
. 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(+), 126 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

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

[PATCH bpf 0/1] bpf: btf: Fix endianness of bitfields

2018-07-08 Thread Okash Khawaja
Hi, This patch fixes endianness bug in btf_int_bits_seq_show(). Jakub Kicinski pointed out in a separate patch review for bpftool ("bpf: btf: add btf print functionality") that parsing of bitfield might not work on big endian machine. Similar parsing is performed in btf_int_bits_seq_show() and

[PATCH bpf 0/1] bpf: btf: Fix endianness of bitfields

2018-07-08 Thread Okash Khawaja
Hi, This patch fixes endianness bug in btf_int_bits_seq_show(). Jakub Kicinski pointed out in a separate patch review for bpftool ("bpf: btf: add btf print functionality") that parsing of bitfield might not work on big endian machine. Similar parsing is performed in btf_int_bits_seq_show() and

[PATCH bpf 1/1] bpf: btf: Fix bitfield extraction for big endian

2018-07-08 Thread Okash Khawaja
for the help in navigating potential pitfalls when dealing with endianess and for the final solution. Fixes: b00b8daec828 ("bpf: btf: Add pretty print capability for data with BTF type info") Signed-off-by: Okash Khawaja --- kernel/bpf/btf.c | 32 +++---

[PATCH bpf 1/1] bpf: btf: Fix bitfield extraction for big endian

2018-07-08 Thread Okash Khawaja
for the help in navigating potential pitfalls when dealing with endianess and for the final solution. Fixes: b00b8daec828 ("bpf: btf: Add pretty print capability for data with BTF type info") Signed-off-by: Okash Khawaja --- kernel/bpf/btf.c | 32 +++---

[PATCH bpf-next v3 0/3] bpf: btf: print bpftool map data with btf

2018-07-08 Thread Okash Khawaja
Hi, This v3 contains incorporates feedback from v2, including a fix for big endian when extracting bitfields. Below is a summary of all changes. patch 1: - use kernel integer types instead of stdint patch 2: - change stdint types to kernel equivalents - remove variable ret from

[PATCH bpf-next v3 0/3] bpf: btf: print bpftool map data with btf

2018-07-08 Thread Okash Khawaja
Hi, This v3 contains incorporates feedback from v2, including a fix for big endian when extracting bitfields. Below is a summary of all changes. patch 1: - use kernel integer types instead of stdint patch 2: - change stdint types to kernel equivalents - remove variable ret from

[PATCH bpf-next v3 2/3] bpf: btf: add btf print functionality

2018-07-08 Thread Okash Khawaja
} ] This patch uses json's {} and [] to imply struct/union and array. More explicit information can be added later. For example, a command line option can be introduced to print whether a key or value is struct or union, name of a struct etc. This will however come at the expense of duplicating info

[PATCH bpf-next v3 3/3] bpf: btf: print map dump and lookup with btf info

2018-07-08 Thread Okash Khawaja
mper introduced in previous patch to accomplish the above. Indeed, btf-ful info is only displayed if btf data for the given map is available. Otherwise existing output is displayed as-is. Signed-off-by: Okash Khawaja --- tools/bpf/bpftool/map.c | 207

[PATCH bpf-next v3 2/3] bpf: btf: add btf print functionality

2018-07-08 Thread Okash Khawaja
} ] This patch uses json's {} and [] to imply struct/union and array. More explicit information can be added later. For example, a command line option can be introduced to print whether a key or value is struct or union, name of a struct etc. This will however come at the expense of duplicating info

[PATCH bpf-next v3 3/3] bpf: btf: print map dump and lookup with btf info

2018-07-08 Thread Okash Khawaja
mper introduced in previous patch to accomplish the above. Indeed, btf-ful info is only displayed if btf data for the given map is available. Otherwise existing output is displayed as-is. Signed-off-by: Okash Khawaja --- tools/bpf/bpftool/map.c | 207

Re: [PATCH bpf-next 3/3] bpf: btf: json print map dump with btf info

2018-06-21 Thread Okash Khawaja
On Thu, Jun 21, 2018 at 12:22:52AM +0100, Song Liu wrote: > > > > On Jun 20, 2018, at 1:30 PM, Okash Khawaja wrote: > > > > This patch modifies `bpftool map dump [-j|-p] id ` to json- > > print and pretty-json-print map dump. It calls btf_dumper introduced in &g

Re: [PATCH bpf-next 3/3] bpf: btf: json print map dump with btf info

2018-06-21 Thread Okash Khawaja
On Thu, Jun 21, 2018 at 12:22:52AM +0100, Song Liu wrote: > > > > On Jun 20, 2018, at 1:30 PM, Okash Khawaja wrote: > > > > This patch modifies `bpftool map dump [-j|-p] id ` to json- > > print and pretty-json-print map dump. It calls btf_dumper introduced in &g

[PATCH bpf-next 3/3] bpf: btf: json print map dump with btf info

2018-06-20 Thread Okash Khawaja
the usual debug-less output is printed. Signed-off-by: Okash Khawaja Acked-by: Martin KaFai Lau --- tools/bpf/bpftool/map.c | 94 ++-- 1 file changed, 91 insertions(+), 3 deletions(-) --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c

[PATCH bpf-next 3/3] bpf: btf: json print map dump with btf info

2018-06-20 Thread Okash Khawaja
the usual debug-less output is printed. Signed-off-by: Okash Khawaja Acked-by: Martin KaFai Lau --- tools/bpf/bpftool/map.c | 94 ++-- 1 file changed, 91 insertions(+), 3 deletions(-) --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c

[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 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 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 <okash.khaw...@gmail.com> Reviewed-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- drivers/staging/spe

[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] staging: speakup: fix async usb removal

2017-08-12 Thread Okash Khawaja
ere stopped by speakup. Signed-off-by: Okash Khawaja <okash.khaw...@gmail.com> Reviewed-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- drivers/staging/speakup/spk_ttyio.c | 50 1 file changed, 50 insertions(+) --- a/drivers/staging/spea

[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 <okash.khaw...@gmail.com> Reviewed-by: Samuel Thibault <samuel.thiba...@ens

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 | 23

[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 <okash.khaw...@gmail.com> --- 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 changed, 1

[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 <okash.khaw...@gmail.com> --- drivers/staging/speakup/spk_ttyio.c |4 ++-- 1 file changed, 2 insertions(+), 2 del

[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 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

[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

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

2017-07-20 Thread Okash Khawaja
ommands 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 <okash.khaw...@gmail.com> --- drivers/tty/tty_io.c | 100 --- incl

[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 <okash.khaw...@gmail.com> --- drivers/tty/tty_io.c |3 +-- include/linux/tty.h |5 - 2 files changed, 1 insertion(+), 7 del

[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

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

2017-07-20 Thread Okash Khawaja
ommands 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/linux/tty.h | 21

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

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

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

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

[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 <okash.khaw...@gmail.com> --- drivers/staging/speakup/spk_ttyio.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/s

[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
correctly report "Device or resource busy" when the tty is already kernel opened. Signed-off-by: Okash Khawaja <okash.khaw...@gmail.com> --- drivers/tty/tty_io.c | 66 +++ include/linux/tty.h |4 +++ 2 files changed, 65 inserti

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

2017-07-17 Thread Okash Khawaja
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 deletions(-) --- 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 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 <okash.khaw...@gmail.com> --- drivers/tty/tty_io.c |3 +-- include/linux/tty.h |5 - 2 files changed, 1 insertion(+), 7 del

[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

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 <gre...@linuxfoundation.org> > 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 openin

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 file po

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

2017-07-16 Thread Okash Khawaja
-by: Okash Khawaja <okash.khaw...@gmail.com> --- 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 +

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

2017-07-16 Thread Okash Khawaja
-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 @@ static void __exit

[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 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 <okash.khaw...@gmail.com> --- drivers/staging/speakup/spk_

[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 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 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

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

2017-07-16 Thread Okash Khawaja
tty_ldisc_release, so speakup doesn't need to call it. Signed-off-by: Okash Khawaja <okash.khaw...@gmail.com> --- 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 @@

[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

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

2017-07-16 Thread Okash Khawaja
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,7 @@ void

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 > >

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 > >

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

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

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 <okash.khaw...@gmail.com> wrote: > > > Speakup opens tty using tty_open_by_driver. When closing, it calls > > tty_ldisc_release but doesn't clos

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 thi

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 thi

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 <okash.khaw...@gmail.com> > wrote: > > On Sun, Jul 09, 2017 at 06:04:17PM +0300, Andy Shevchenko wrote: > >> On Sun, Jul 9, 2017 at 2:41 PM, Okash Khawa

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 <okash.khaw...@gmail.com> wrote: > > > On Sat, Jul 08, 2017 at 10:38:03AM +0200, Greg Kroah-Hartman wrote: > > > Overall, the idea looks sane to me.

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 <okash.khaw...@gmail.com> wrote: > > > +struct tty_struct *tty_kopen(dev_t device) > > +{ > > + struct tty_struct *tty; > > +

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

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

[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 <okash.khaw...@gmail.com> --- include/linux/tty.h |2 +- 1 file c

[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 <okash.khaw...@gmail.com>

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 1/3] tty: resolve tty contention between kernel and user space

2017-07-09 Thread Okash Khawaja
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 <okash.khaw...@gmail.com>

[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 <okash.khaw...@gmail.com> --- drivers/tty/tty_io.c |3 +-- include/linux/tty.h |5 - 2 files changed, 1 insertion(+), 7 del

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

2017-07-09 Thread Okash Khawaja
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 +

[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

  1   2   3   4   >