[PATCH] nvme: fabrics: fix ctrl_loss_tmo < 0 to reconnect forever

2018-08-07 Thread Tal Shorer
When the user supplics ctrl_loss_tmo < 0, we warn them that this will cause the fabrics layer to attempt reconnection forever. However, in reality the fabrics layer never attempts to reconnect because the condition to test whether we should reconnect is backwards in this case. Signed-off-by:

[PATCH] nvme: fabrics: fix ctrl_loss_tmo < 0 to reconnect forever

2018-08-07 Thread Tal Shorer
When the user supplics ctrl_loss_tmo < 0, we warn them that this will cause the fabrics layer to attempt reconnection forever. However, in reality the fabrics layer never attempts to reconnect because the condition to test whether we should reconnect is backwards in this case. Signed-off-by:

[PATCH v3 2/2] workqueue: respect isolated cpus when queueing an unbound work

2017-11-03 Thread Tal Shorer
Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- kernel/workqueue.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c

[PATCH v3 2/2] workqueue: respect isolated cpus when queueing an unbound work

2017-11-03 Thread Tal Shorer
Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter. Signed-off-by: Tal Shorer --- kernel/workqueue.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 64d0edf..a355e9d 100644

[PATCH v3 1/2] main: kernel_start: move housekeeping_init() before workqueue_init_early()

2017-11-03 Thread Tal Shorer
This is needed in order to allow the unbound workqueue to take housekeeping cpus into accounty Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- init/main.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init/main.c b/init/main.c index 4610c99..af6ecd0

[PATCH v3 1/2] main: kernel_start: move housekeeping_init() before workqueue_init_early()

2017-11-03 Thread Tal Shorer
This is needed in order to allow the unbound workqueue to take housekeeping cpus into accounty Signed-off-by: Tal Shorer --- init/main.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init/main.c b/init/main.c index 4610c99..af6ecd0 100644 --- a/init/main.c +++ b/init

[PATCH v2] workqueue: respect isolated cpus when queueing an unbound work

2017-10-21 Thread Tal Shorer
Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- kernel/workqueue.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c

[PATCH v2] workqueue: respect isolated cpus when queueing an unbound work

2017-10-21 Thread Tal Shorer
Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter. Signed-off-by: Tal Shorer --- kernel/workqueue.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index ca937b0..0add5d4 100644

Re: [PATCH] workqueue: respect isolated cpus when queueing an unbound work

2017-10-21 Thread Tal Shorer
On Sat, Oct 21, 2017 at 7:04 PM, Tejun Heo <t...@kernel.org> wrote: > On Sat, Oct 21, 2017 at 07:02:21PM +0300, Tal Shorer wrote: >> On Sat, Oct 21, 2017 at 6:49 PM, Tejun Heo <t...@kernel.org> wrote: >> > On Fri, Oct 20, 2017 at 12:44:06AM +0300, Tal

Re: [PATCH] workqueue: respect isolated cpus when queueing an unbound work

2017-10-21 Thread Tal Shorer
On Sat, Oct 21, 2017 at 7:04 PM, Tejun Heo wrote: > On Sat, Oct 21, 2017 at 07:02:21PM +0300, Tal Shorer wrote: >> On Sat, Oct 21, 2017 at 6:49 PM, Tejun Heo wrote: >> > On Fri, Oct 20, 2017 at 12:44:06AM +0300, Tal Shorer wrote: >> >> Initialize wq_unbound_cpu

[PATCH] workqueue: respect isolated cpus when queueing an unbound work

2017-10-19 Thread Tal Shorer
Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index c

[PATCH] workqueue: respect isolated cpus when queueing an unbound work

2017-10-19 Thread Tal Shorer
Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter. Signed-off-by: Tal Shorer --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index ca937b0..25b351d 100644

Re: [PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-15 Thread Tal Shorer
On Wed, Jun 14, 2017 at 4:33 PM, Alan Cox wrote: >> That would cut it, but TIOCPKT is too coupled with having a linked tty. >> I could make acm behave like a pty (accept TIOCPKT and issue the >> ctrl_status bits), but for that I need n_tty to know that packet does >>

Re: [PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-15 Thread Tal Shorer
On Wed, Jun 14, 2017 at 4:33 PM, Alan Cox wrote: >> That would cut it, but TIOCPKT is too coupled with having a linked tty. >> I could make acm behave like a pty (accept TIOCPKT and issue the >> ctrl_status bits), but for that I need n_tty to know that packet does >> not always mean a linked tty

Re: [PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-14 Thread Tal Shorer
On Wed, Jun 14, 2017 at 11:20 AM, Tal Shorer <tal.sho...@gmail.com> wrote: > On Wed, Jun 14, 2017 at 4:15 AM, Alan Cox <gno...@lxorguk.ukuu.org.uk> wrote: >> On Tue, 13 Jun 2017 09:52:07 +0300 >> Tal Shorer <tal.sho...@gmail.com> wrote: >> >>>

Re: [PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-14 Thread Tal Shorer
On Wed, Jun 14, 2017 at 11:20 AM, Tal Shorer wrote: > On Wed, Jun 14, 2017 at 4:15 AM, Alan Cox wrote: >> On Tue, 13 Jun 2017 09:52:07 +0300 >> Tal Shorer wrote: >> >>> If a tty driver wants to notify the user of some exceptional event, >>> such as a u

Re: [PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-14 Thread Tal Shorer
On Wed, Jun 14, 2017 at 4:15 AM, Alan Cox <gno...@lxorguk.ukuu.org.uk> wrote: > On Tue, 13 Jun 2017 09:52:07 +0300 > Tal Shorer <tal.sho...@gmail.com> wrote: > >> If a tty driver wants to notify the user of some exceptional event, >> such as a usb cdc acm devic

Re: [PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-14 Thread Tal Shorer
On Wed, Jun 14, 2017 at 4:15 AM, Alan Cox wrote: > On Tue, 13 Jun 2017 09:52:07 +0300 > Tal Shorer wrote: > >> If a tty driver wants to notify the user of some exceptional event, >> such as a usb cdc acm device set_line_coding event, it needs a way to >> modif

Re: gadgetfs: how to wait for USB device initialization?

2017-06-13 Thread Tal Shorer
On Tue, Jun 13, 2017 at 7:02 PM, Tal Shorer <tal.sho...@gmail.com> wrote: > On Tue, Jun 13, 2017 at 3:21 PM, Andrey Konovalov <andreyk...@google.com> > wrote: >> Hi! >> >> I'm trying to use gadgetfs to fuzz USB device drivers by simply >> connecting

Re: gadgetfs: how to wait for USB device initialization?

2017-06-13 Thread Tal Shorer
On Tue, Jun 13, 2017 at 7:02 PM, Tal Shorer wrote: > On Tue, Jun 13, 2017 at 3:21 PM, Andrey Konovalov > wrote: >> Hi! >> >> I'm trying to use gadgetfs to fuzz USB device drivers by simply >> connecting random devices for now. >> >> What I want to a

Re: gadgetfs: how to wait for USB device initialization?

2017-06-13 Thread Tal Shorer
On Tue, Jun 13, 2017 at 3:21 PM, Andrey Konovalov wrote: > Hi! > > I'm trying to use gadgetfs to fuzz USB device drivers by simply > connecting random devices for now. > > What I want to achieve right now is the following: > > 1. mount gadgetfs > 2. emulate connection of a

Re: gadgetfs: how to wait for USB device initialization?

2017-06-13 Thread Tal Shorer
On Tue, Jun 13, 2017 at 3:21 PM, Andrey Konovalov wrote: > Hi! > > I'm trying to use gadgetfs to fuzz USB device drivers by simply > connecting random devices for now. > > What I want to achieve right now is the following: > > 1. mount gadgetfs > 2. emulate connection of a new USB device > 3.

Re: [PATCH v2 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-13 Thread Tal Shorer
On Tue, Jun 13, 2017 at 12:19 PM, Greg KH <gre...@linuxfoundation.org> wrote: > On Tue, Jun 13, 2017 at 09:52:12AM +0300, Tal Shorer wrote: >> The user can issue USB_F_GET_LINE_CODING to get the current line coding >> as set by the host (or the default if unset yet). >

Re: [PATCH v2 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-13 Thread Tal Shorer
On Tue, Jun 13, 2017 at 12:19 PM, Greg KH wrote: > On Tue, Jun 13, 2017 at 09:52:12AM +0300, Tal Shorer wrote: >> The user can issue USB_F_GET_LINE_CODING to get the current line coding >> as set by the host (or the default if unset yet). >> >> Signed-off-by: Tal Shore

[PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-13 Thread Tal Shorer
will be called in n_tty_poll(). Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/tty/n_tty.c| 2 ++ include/linux/tty_driver.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index bdf0e6e..7af8c29 100644 --- a/drivers/tty/n

[PATCH v2 1/8] tty: add a poll() callback in struct tty_operations

2017-06-13 Thread Tal Shorer
will be called in n_tty_poll(). Signed-off-by: Tal Shorer --- drivers/tty/n_tty.c| 2 ++ include/linux/tty_driver.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index bdf0e6e..7af8c29 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty

[PATCH v2 8/8] usb: gadget: u_serial: remove port_line_config from struct gserial

2017-06-13 Thread Tal Shorer
, the initialized never-used values were invalid, with bDataBits and bCharFormat having each other's value. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/u_serial.c | 22 ++ drivers/usb/gadget/function/u_serial.h | 3 --- 2 files changed, 2 inse

[PATCH v2 8/8] usb: gadget: u_serial: remove port_line_config from struct gserial

2017-06-13 Thread Tal Shorer
, the initialized never-used values were invalid, with bDataBits and bCharFormat having each other's value. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/u_serial.c | 22 ++ drivers/usb/gadget/function/u_serial.h | 3 --- 2 files changed, 2 insertions(+), 23 deletions

[PATCH v2 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-13 Thread Tal Shorer
The user can issue USB_F_GET_LINE_CODING to get the current line coding as set by the host (or the default if unset yet). Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- Documentation/ioctl/ioctl-number.txt | 1 + drivers/usb/gadget/function/f_acm.c | 19 +++ includ

[PATCH v2 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-13 Thread Tal Shorer
The user can issue USB_F_GET_LINE_CODING to get the current line coding as set by the host (or the default if unset yet). Signed-off-by: Tal Shorer --- Documentation/ioctl/ioctl-number.txt | 1 + drivers/usb/gadget/function/f_acm.c | 19 +++ include/uapi/linux/usb/f_acm.h

[PATCH v2 3/8] usb: gadget: f_acm: validate set_line_coding requests

2017-06-13 Thread Tal Shorer
We shouldn't accept malformed set_line_coding requests. All values were taken from table 17 (section 6.3.11) of the cdc1.2 spec available at http://www.usb.org/developers/docs/devclass_docs/ The table is in the file PTSN120.pdf. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drive

[PATCH v2 3/8] usb: gadget: f_acm: validate set_line_coding requests

2017-06-13 Thread Tal Shorer
We shouldn't accept malformed set_line_coding requests. All values were taken from table 17 (section 6.3.11) of the cdc1.2 spec available at http://www.usb.org/developers/docs/devclass_docs/ The table is in the file PTSN120.pdf. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/f_acm.c

[PATCH v2 5/8] usb: gadget: f_acm: initialize port_line_coding when creating an instance

2017-06-13 Thread Tal Shorer
Initialize acm->port_line_coding with something that makes sense so that we can return a valid line coding if the host requests GetLineCoding before requesting SetLineCoding Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/f_acm.c | 6 ++ 1 file c

[PATCH v2 5/8] usb: gadget: f_acm: initialize port_line_coding when creating an instance

2017-06-13 Thread Tal Shorer
Initialize acm->port_line_coding with something that makes sense so that we can return a valid line coding if the host requests GetLineCoding before requesting SetLineCoding Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/f_acm.c | 6 ++ 1 file changed, 6 insertions(+) diff --

[PATCH v2 4/8] usb: gadget: u_serial: propagate ioctl() to the next layer

2017-06-13 Thread Tal Shorer
In order for a serial function to implement its own ioctl() calls, propagate the ioctl() callback to the next layer so it can handle it if it sees fit to do so. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/u_serial.c | 15 +++ drivers/usb/

[PATCH v2 7/8] usb: gadget: f_acm: notify the user on SetLineCoding

2017-06-13 Thread Tal Shorer
Notify the user with a POLLPRI event when the host issues a SetLineCoding request so that they can act upon it, for example by configuring the line coding on a real serial port. The event is cleared when the user reads the line coding using USB_F_ACM_GET_LINE_CODING ioctl() Signed-off-by: Tal

[PATCH v2 4/8] usb: gadget: u_serial: propagate ioctl() to the next layer

2017-06-13 Thread Tal Shorer
In order for a serial function to implement its own ioctl() calls, propagate the ioctl() callback to the next layer so it can handle it if it sees fit to do so. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/u_serial.c | 15 +++ drivers/usb/gadget/function/u_serial.h | 1

[PATCH v2 7/8] usb: gadget: f_acm: notify the user on SetLineCoding

2017-06-13 Thread Tal Shorer
Notify the user with a POLLPRI event when the host issues a SetLineCoding request so that they can act upon it, for example by configuring the line coding on a real serial port. The event is cleared when the user reads the line coding using USB_F_ACM_GET_LINE_CODING ioctl() Signed-off-by: Tal

[PATCH v2 2/8] usb: gadget: u_serial: propagate poll() to the next layer

2017-06-13 Thread Tal Shorer
In order for a serial function to add flags to the poll() mask of their tty files, propagate the poll() callback to the next layer so it can return a mask if it sees fit to do so. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/u_serial.

[PATCH v2 2/8] usb: gadget: u_serial: propagate poll() to the next layer

2017-06-13 Thread Tal Shorer
In order for a serial function to add flags to the poll() mask of their tty files, propagate the poll() callback to the next layer so it can return a mask if it sees fit to do so. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/u_serial.c | 16 drivers/usb/gadget

[PATCH v2 0/8] Allow f_acm gadgets to notify the user about SetLineCoding requests

2017-06-13 Thread Tal Shorer
comment at every turn), it was never used and it was initialized with invalid values. Changes from v1: - patch 5 was messed up, which made patch 6 also messed up. fixed both of these. Tal Shorer (8): tty: add a poll() callback in struct tty_operations usb: gadget: u_serial: propagate poll

[PATCH v2 0/8] Allow f_acm gadgets to notify the user about SetLineCoding requests

2017-06-13 Thread Tal Shorer
comment at every turn), it was never used and it was initialized with invalid values. Changes from v1: - patch 5 was messed up, which made patch 6 also messed up. fixed both of these. Tal Shorer (8): tty: add a poll() callback in struct tty_operations usb: gadget: u_serial: propagate poll

Re: [PATCH 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-12 Thread Tal Shorer
On Mon, Jun 12, 2017 at 9:02 PM, Tal Shorer <tal.sho...@gmail.com> wrote: > On Mon, Jun 12, 2017 at 8:26 PM, Tal Shorer <tal.sho...@gmail.com> wrote: >> The user can issue USB_F_GET_LINE_CODING to get the current line coding >> as set by the host (or the default if u

Re: [PATCH 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-12 Thread Tal Shorer
On Mon, Jun 12, 2017 at 9:02 PM, Tal Shorer wrote: > On Mon, Jun 12, 2017 at 8:26 PM, Tal Shorer wrote: >> The user can issue USB_F_GET_LINE_CODING to get the current line coding >> as set by the host (or the default if unset yet). >> >> Signed-off-by: Tal Sho

Re: [PATCH 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-12 Thread Tal Shorer
On Mon, Jun 12, 2017 at 8:26 PM, Tal Shorer <tal.sho...@gmail.com> wrote: > The user can issue USB_F_GET_LINE_CODING to get the current line coding > as set by the host (or the default if unset yet). > > Signed-off-by: Tal Shorer <tal.sho...@gmail.com> > --- > @@ -7

Re: [PATCH 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-12 Thread Tal Shorer
On Mon, Jun 12, 2017 at 8:26 PM, Tal Shorer wrote: > The user can issue USB_F_GET_LINE_CODING to get the current line coding > as set by the host (or the default if unset yet). > > Signed-off-by: Tal Shorer > --- > @@ -764,10 +783,10 @@ static struct usb_function *acm

[PATCH 2/8] usb: gadget: u_serial: propagate poll() to the next layer

2017-06-12 Thread Tal Shorer
In order for a serial function to add flags to the poll() mask of their tty files, propagate the poll() callback to the next layer so it can return a mask if it sees fit to do so. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/u_serial.

[PATCH 2/8] usb: gadget: u_serial: propagate poll() to the next layer

2017-06-12 Thread Tal Shorer
In order for a serial function to add flags to the poll() mask of their tty files, propagate the poll() callback to the next layer so it can return a mask if it sees fit to do so. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/u_serial.c | 16 drivers/usb/gadget

[PATCH 7/8] usb: gadget: f_acm: notify the user on SetLineCoding

2017-06-12 Thread Tal Shorer
Notify the user with a POLLPRI event when the host issues a SetLineCoding request so that they can act upon it, for example by configuring the line coding on a real serial port. The event is cleared when the user reads the line coding using USB_F_ACM_GET_LINE_CODING ioctl() Signed-off-by: Tal

[PATCH 7/8] usb: gadget: f_acm: notify the user on SetLineCoding

2017-06-12 Thread Tal Shorer
Notify the user with a POLLPRI event when the host issues a SetLineCoding request so that they can act upon it, for example by configuring the line coding on a real serial port. The event is cleared when the user reads the line coding using USB_F_ACM_GET_LINE_CODING ioctl() Signed-off-by: Tal

[PATCH 3/8] usb: gadget: f_acm: validate set_line_coding requests

2017-06-12 Thread Tal Shorer
We shouldn't accept malformed set_line_coding requests. All values were taken from table 17 (section 6.3.11) of the cdc1.2 spec available at http://www.usb.org/developers/docs/devclass_docs/ The table is in the file PTSN120.pdf. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drive

[PATCH 3/8] usb: gadget: f_acm: validate set_line_coding requests

2017-06-12 Thread Tal Shorer
We shouldn't accept malformed set_line_coding requests. All values were taken from table 17 (section 6.3.11) of the cdc1.2 spec available at http://www.usb.org/developers/docs/devclass_docs/ The table is in the file PTSN120.pdf. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/f_acm.c

[PATCH 5/8] usb: gadget: f_acm: initialize port_line_coding when creating an instance

2017-06-12 Thread Tal Shorer
Initialize acm->port_line_coding with something that makes sense so that we can return a valid line coding if the host requests GetLineCoding before requesting SetLineCoding Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/f_acm.c | 6 ++ 1 file c

[PATCH 5/8] usb: gadget: f_acm: initialize port_line_coding when creating an instance

2017-06-12 Thread Tal Shorer
Initialize acm->port_line_coding with something that makes sense so that we can return a valid line coding if the host requests GetLineCoding before requesting SetLineCoding Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/f_acm.c | 6 ++ 1 file changed, 6 insertions(+) diff --

[PATCH 8/8] usb: gadget: u_serial: remove port_line_config from struct gserial

2017-06-12 Thread Tal Shorer
, the initialized never-used values were invalid, with bDataBits and bCharFormat having each other's value. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/u_serial.c | 22 ++ drivers/usb/gadget/function/u_serial.h | 3 --- 2 files changed, 2 inse

[PATCH 8/8] usb: gadget: u_serial: remove port_line_config from struct gserial

2017-06-12 Thread Tal Shorer
, the initialized never-used values were invalid, with bDataBits and bCharFormat having each other's value. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/u_serial.c | 22 ++ drivers/usb/gadget/function/u_serial.h | 3 --- 2 files changed, 2 insertions(+), 23 deletions

[PATCH 4/8] usb: gadget: u_serial: propagate ioctl() to the next layer

2017-06-12 Thread Tal Shorer
In order for a serial function to implement its own ioctl() calls, propagate the ioctl() callback to the next layer so it can handle it if it sees fit to do so. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/gadget/function/u_serial.c | 15 +++ drivers/usb/

[PATCH 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-12 Thread Tal Shorer
The user can issue USB_F_GET_LINE_CODING to get the current line coding as set by the host (or the default if unset yet). Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- Documentation/ioctl/ioctl-number.txt | 1 + drivers/usb/gadget/function/f_acm.c

[PATCH 4/8] usb: gadget: u_serial: propagate ioctl() to the next layer

2017-06-12 Thread Tal Shorer
In order for a serial function to implement its own ioctl() calls, propagate the ioctl() callback to the next layer so it can handle it if it sees fit to do so. Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/u_serial.c | 15 +++ drivers/usb/gadget/function/u_serial.h | 1

[PATCH 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

2017-06-12 Thread Tal Shorer
The user can issue USB_F_GET_LINE_CODING to get the current line coding as set by the host (or the default if unset yet). Signed-off-by: Tal Shorer --- Documentation/ioctl/ioctl-number.txt | 1 + drivers/usb/gadget/function/f_acm.c | 27 +++ include/uapi/linux/usb

[PATCH 1/8] tty: add a poll() callback in struct tty_operations

2017-06-12 Thread Tal Shorer
will be called in n_tty_poll(). Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/tty/n_tty.c| 2 ++ include/linux/tty_driver.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index bdf0e6e..7af8c29 100644 --- a/drivers/tty/n

[PATCH 1/8] tty: add a poll() callback in struct tty_operations

2017-06-12 Thread Tal Shorer
will be called in n_tty_poll(). Signed-off-by: Tal Shorer --- drivers/tty/n_tty.c| 2 ++ include/linux/tty_driver.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index bdf0e6e..7af8c29 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty

[PATCH 0/8] Allow f_acm gadgets to notify the user about SetLineCoding requests

2017-06-12 Thread Tal Shorer
comment at every turn), it was never used and it was initialized with invalid values. Tal Shorer (8): tty: add a poll() callback in struct tty_operations usb: gadget: u_serial: propagate poll() to the next layer usb: gadget: f_acm: validate set_line_coding requests usb: gadget: u_serial

[PATCH 0/8] Allow f_acm gadgets to notify the user about SetLineCoding requests

2017-06-12 Thread Tal Shorer
comment at every turn), it was never used and it was initialized with invalid values. Tal Shorer (8): tty: add a poll() callback in struct tty_operations usb: gadget: u_serial: propagate poll() to the next layer usb: gadget: f_acm: validate set_line_coding requests usb: gadget: u_serial

Re: [PATCH v3] usb: hcd.h: construct hub class request constants from simpler constants

2016-12-03 Thread Tal Shorer
On Fri, Nov 18, 2016 at 2:17 PM, Tal Shorer <tal.sho...@gmail.com> wrote: > Currently, each hub class request constant is defined by a line like: > #define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE) > > The "magic" number for the high byte is one of 0x20,

Re: [PATCH v3] usb: hcd.h: construct hub class request constants from simpler constants

2016-12-03 Thread Tal Shorer
On Fri, Nov 18, 2016 at 2:17 PM, Tal Shorer wrote: > Currently, each hub class request constant is defined by a line like: > #define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE) > > The "magic" number for the high byte is one of 0x20, 0xa0, 0x23, 0xa3. >

[PATCH v3] usb: hcd.h: construct hub class request constants from simpler constants

2016-11-18 Thread Tal Shorer
CIP_DEVICE) and that USB_RT_PORT is defined as (USB_TYPE_CLASS | USB_RECIP_OTHER). Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- include/linux/usb/hcd.h | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/usb/hcd.h b/include/linux

[PATCH v3] usb: hcd.h: construct hub class request constants from simpler constants

2016-11-18 Thread Tal Shorer
CIP_DEVICE) and that USB_RT_PORT is defined as (USB_TYPE_CLASS | USB_RECIP_OTHER). Signed-off-by: Tal Shorer --- include/linux/usb/hcd.h | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 66fc137..40ed

[PATCH v2] usb: hcd.h: construct hub class request conastants from simpler constants

2016-11-18 Thread Tal Shorer
TYPE_CLASS | USB_RECIP_OTHER). Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- include/linux/usb/hcd.h | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 66fc137..76159fb 100644 --- a/include/linux/usb/hcd

[PATCH v2] usb: hcd.h: construct hub class request conastants from simpler constants

2016-11-18 Thread Tal Shorer
TYPE_CLASS | USB_RECIP_OTHER). Signed-off-by: Tal Shorer --- include/linux/usb/hcd.h | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 66fc137..76159fb 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux

[PATCH] usb: hcd.h: construct hub class request conastants from simpler constants

2016-11-18 Thread Tal Shorer
TYPE_CLASS | USB_RECIP_OTHER). Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- include/linux/usb/hcd.h | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 66fc137..2405853 100644 --- a/include

[PATCH] usb: hcd.h: construct hub class request conastants from simpler constants

2016-11-18 Thread Tal Shorer
TYPE_CLASS | USB_RECIP_OTHER). Signed-off-by: Tal Shorer --- include/linux/usb/hcd.h | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 66fc137..2405853 100644 --- a/include/linux/usb/hcd.h +++ b/include

[PATCH v3 7/8] usb: ulpi: make ops struct constant

2016-08-16 Thread Tal Shorer
None of the core ulpi functions perform any changes to the operations struct, and logically as a struct that contains function pointers there's no reason it shouldn't be constant. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 3 ++- include/linu

[PATCH v3 6/8] usb: ulpi: remove "dev" field from struct ulpi_ops

2016-08-16 Thread Tal Shorer
Operations now use ulpi->dev.parent directly instead of via the ulpi_ops struct, making this field unused. Remove it. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 1 - include/linux/ulpi/interface.h | 3 +-- 2 files changed, 1 insertion(+), 3

[PATCH v3 7/8] usb: ulpi: make ops struct constant

2016-08-16 Thread Tal Shorer
None of the core ulpi functions perform any changes to the operations struct, and logically as a struct that contains function pointers there's no reason it shouldn't be constant. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 3 ++- include/linux/ulpi/driver.h| 2

[PATCH v3 6/8] usb: ulpi: remove "dev" field from struct ulpi_ops

2016-08-16 Thread Tal Shorer
Operations now use ulpi->dev.parent directly instead of via the ulpi_ops struct, making this field unused. Remove it. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 1 - include/linux/ulpi/interface.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/driv

[PATCH v3 2/8] usb: ulpi: add new api functions, {read|write}_dev()

2016-08-16 Thread Tal Shorer
. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 8 ++-- include/linux/ulpi/interface.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c index c6ce92b..15e4a14

[PATCH v3 5/8] usb: ulpi: rename operations {read|write}_dev to simply {read|write}

2016-08-16 Thread Tal Shorer
With the removal of the old {read|write} operations, we can now safely rename the new api operations {read|write}_dev to use the shorter and clearer names {read|write}, respectively. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 4 ++-- drivers/us

[PATCH v3 8/8] usb: dwc3: ulpi: make dwc3_ulpi_ops constant

2016-08-16 Thread Tal Shorer
ulpi_register_interface() accepts a const struct ulpi_ops and dwc3 doesn't perform any changes to this struct at runtime, so there's no reason it shouldn't be constant. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/dwc3/ulpi.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH v3 2/8] usb: ulpi: add new api functions, {read|write}_dev()

2016-08-16 Thread Tal Shorer
. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 8 ++-- include/linux/ulpi/interface.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c index c6ce92b..15e4a14 100644 --- a/drivers/usb/common/ulpi.c

[PATCH v3 5/8] usb: ulpi: rename operations {read|write}_dev to simply {read|write}

2016-08-16 Thread Tal Shorer
With the removal of the old {read|write} operations, we can now safely rename the new api operations {read|write}_dev to use the shorter and clearer names {read|write}, respectively. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 4 ++-- drivers/usb/dwc3/ulpi.c| 4

[PATCH v3 8/8] usb: dwc3: ulpi: make dwc3_ulpi_ops constant

2016-08-16 Thread Tal Shorer
ulpi_register_interface() accepts a const struct ulpi_ops and dwc3 doesn't perform any changes to this struct at runtime, so there's no reason it shouldn't be constant. Signed-off-by: Tal Shorer --- drivers/usb/dwc3/ulpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 1/8] usb: ulpi: move setting of ulpi->dev parent up in ulpi_register()

2016-08-16 Thread Tal Shorer
Once ulpi operations use the parent device directly, this will be needed during the operations used in ulpi_register() itself, so set the parent field before calling any ulpi operations. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 3 ++- 1 file chan

[PATCH v3 1/8] usb: ulpi: move setting of ulpi->dev parent up in ulpi_register()

2016-08-16 Thread Tal Shorer
Once ulpi operations use the parent device directly, this will be needed during the operations used in ulpi_register() itself, so set the parent field before calling any ulpi operations. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH v3 3/8] usb: dwc3: ulpi: use new api

2016-08-16 Thread Tal Shorer
The old read, write callbacks in struct ulpi_ops have been deprecated in favor of new callbacks that pass the parent device directly. Replace the used callbacks in dwc3's ulpi component with the new api. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/dwc3/ulpi.

[PATCH v3 0/8] usb: ulpi: remove "dev" field from struct ulpi_ops

2016-08-16 Thread Tal Shorer
s 5 and 6 (now patch 4) * Remove comment documenting the removed dev field in struct ulpi_ops Tal Shorer (8): usb: ulpi: move setting of ulpi->dev parent up in ulpi_register() usb: ulpi: add new api functions, {read|write}_dev() usb: dwc3: ulpi: use new api usb: ulpi: remove calls to o

[PATCH v3 4/8] usb: ulpi: remove calls to old api callbacks

2016-08-16 Thread Tal Shorer
Now that all users use the new api callbacks, remove the old api callbacks and force new interface drivers to use the new api. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 4 include/linux/ulpi/interface.h | 2 -- 2 files changed, 6 del

[PATCH v3 3/8] usb: dwc3: ulpi: use new api

2016-08-16 Thread Tal Shorer
The old read, write callbacks in struct ulpi_ops have been deprecated in favor of new callbacks that pass the parent device directly. Replace the used callbacks in dwc3's ulpi component with the new api. Signed-off-by: Tal Shorer --- drivers/usb/dwc3/ulpi.c | 12 ++-- 1 file changed, 6

[PATCH v3 0/8] usb: ulpi: remove "dev" field from struct ulpi_ops

2016-08-16 Thread Tal Shorer
s 5 and 6 (now patch 4) * Remove comment documenting the removed dev field in struct ulpi_ops Tal Shorer (8): usb: ulpi: move setting of ulpi->dev parent up in ulpi_register() usb: ulpi: add new api functions, {read|write}_dev() usb: dwc3: ulpi: use new api usb: ulpi: remove calls to o

[PATCH v3 4/8] usb: ulpi: remove calls to old api callbacks

2016-08-16 Thread Tal Shorer
Now that all users use the new api callbacks, remove the old api callbacks and force new interface drivers to use the new api. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 4 include/linux/ulpi/interface.h | 2 -- 2 files changed, 6 deletions(-) diff --git a/drivers/usb

Re: [PATCH v2 00/10] usb: ulpi: remove "dev" field from struct ulpi_ops

2016-08-09 Thread Tal Shorer
On Tue, Aug 9, 2016 at 5:04 PM, Greg KH <gre...@linuxfoundation.org> wrote: > On Mon, Aug 01, 2016 at 09:15:48PM +0300, Tal Shorer wrote: >> struct ulpi_ops is defined as follows: >> >> struct ulpi_ops { >> struct device *dev; >> in

Re: [PATCH v2 00/10] usb: ulpi: remove "dev" field from struct ulpi_ops

2016-08-09 Thread Tal Shorer
On Tue, Aug 9, 2016 at 5:04 PM, Greg KH wrote: > On Mon, Aug 01, 2016 at 09:15:48PM +0300, Tal Shorer wrote: >> struct ulpi_ops is defined as follows: >> >> struct ulpi_ops { >> struct device *dev; >> int (*read)(struct ulpi_ops *ops, u8 addr

[PATCH v2 04/10] usb: dwc3: ulpi: use new api

2016-08-01 Thread Tal Shorer
The old read, write callbacks in struct ulpi_ops have been deprecated in favor of new callbacks that pass the parent device directly. Replace the used callbacks in dwc3's ulpi component with the new api. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/dwc3/ulpi.

[PATCH v2 09/10] usb: ulpi: make ops struct constant

2016-08-01 Thread Tal Shorer
None of the core ulpi functions perform any changes to the operations struct, and logically as a struct that contains function pointers there's no reason it shouldn't be constant. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 3 ++- include/linu

[PATCH v2 03/10] usb: ulpi: use new api functions if available

2016-08-01 Thread Tal Shorer
If the registered has the new api callbacks {read|write}_dev, call these instead of the deprecated read, write functions. If the registered does not support the new callbacks, revert to calling the old ones as before. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/

[PATCH v2 04/10] usb: dwc3: ulpi: use new api

2016-08-01 Thread Tal Shorer
The old read, write callbacks in struct ulpi_ops have been deprecated in favor of new callbacks that pass the parent device directly. Replace the used callbacks in dwc3's ulpi component with the new api. Signed-off-by: Tal Shorer --- drivers/usb/dwc3/ulpi.c | 12 ++-- 1 file changed, 6

[PATCH v2 09/10] usb: ulpi: make ops struct constant

2016-08-01 Thread Tal Shorer
None of the core ulpi functions perform any changes to the operations struct, and logically as a struct that contains function pointers there's no reason it shouldn't be constant. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 3 ++- include/linux/ulpi/driver.h| 2

[PATCH v2 03/10] usb: ulpi: use new api functions if available

2016-08-01 Thread Tal Shorer
If the registered has the new api callbacks {read|write}_dev, call these instead of the deprecated read, write functions. If the registered does not support the new callbacks, revert to calling the old ones as before. Signed-off-by: Tal Shorer --- drivers/usb/common/ulpi.c | 8 ++-- 1 file

[PATCH v2 01/10] usb: ulpi: move setting of ulpi->dev parent up in ulpi_register()

2016-08-01 Thread Tal Shorer
Once ulpi operations use the parent device directly, this will be needed during the operations used in ulpi_register() itself, so set the parent field before calling any ulpi operations. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- drivers/usb/common/ulpi.c | 3 ++- 1 file chan

[PATCH v2 06/10] usb: ulpi: remove old api callbacks from struct ulpi_ops

2016-08-01 Thread Tal Shorer
The old api callbacks, read() and write(), are not referenced anywhere. Remove them. Signed-off-by: Tal Shorer <tal.sho...@gmail.com> --- include/linux/ulpi/interface.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/ulpi/interface.h b/include/linux/ulpi/interface.h

  1   2   3   >