Re: [PATCH v3] cdc-acm: ensure that termios get set when the port is activated

2014-10-30 Thread Johan Hovold
On Wed, Oct 29, 2014 at 08:53:14PM -0400, Jim Paris wrote:
> The driver wasn't properly configuring the hardware for the current
> termios settings under all conditions.  Ensure that termios are
> written to the device when the port is activated.
> 
> Signed-off-by: Jim Paris 
> ---
> 
> Switched to Johan's suggestion of using a prototype rather than moving
> acm_tty_set_termios.  This depends on his patch in order to get proper
> DTR handling.
> 
> Thanks,
> Jim 
> 
> ---
>  drivers/usb/class/cdc-acm.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> index e934e19f49f5..d2cd1b6d02a7 100644
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -58,6 +58,9 @@ static struct usb_driver acm_driver;
>  static struct tty_driver *acm_tty_driver;
>  static struct acm *acm_table[ACM_TTY_MINORS];
>  
> +static void acm_tty_set_termios(struct tty_struct *tty,
> + struct ktermios *termios_old);
> +

Nit: Would you mind placing the prototype after all data declarations
(i.e. below acm_table_lock)?

>  static DEFINE_MUTEX(acm_table_lock);

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] cdc-acm: ensure that termios get set when the port is activated

2014-10-30 Thread Johan Hovold
On Wed, Oct 29, 2014 at 08:53:14PM -0400, Jim Paris wrote:
 The driver wasn't properly configuring the hardware for the current
 termios settings under all conditions.  Ensure that termios are
 written to the device when the port is activated.
 
 Signed-off-by: Jim Paris j...@jtan.com
 ---
 
 Switched to Johan's suggestion of using a prototype rather than moving
 acm_tty_set_termios.  This depends on his patch in order to get proper
 DTR handling.
 
 Thanks,
 Jim 
 
 ---
  drivers/usb/class/cdc-acm.c | 5 +
  1 file changed, 5 insertions(+)
 
 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
 index e934e19f49f5..d2cd1b6d02a7 100644
 --- a/drivers/usb/class/cdc-acm.c
 +++ b/drivers/usb/class/cdc-acm.c
 @@ -58,6 +58,9 @@ static struct usb_driver acm_driver;
  static struct tty_driver *acm_tty_driver;
  static struct acm *acm_table[ACM_TTY_MINORS];
  
 +static void acm_tty_set_termios(struct tty_struct *tty,
 + struct ktermios *termios_old);
 +

Nit: Would you mind placing the prototype after all data declarations
(i.e. below acm_table_lock)?

  static DEFINE_MUTEX(acm_table_lock);

Thanks,
Johan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] cdc-acm: ensure that termios get set when the port is activated

2014-10-29 Thread Jim Paris
The driver wasn't properly configuring the hardware for the current
termios settings under all conditions.  Ensure that termios are
written to the device when the port is activated.

Signed-off-by: Jim Paris 
---

Switched to Johan's suggestion of using a prototype rather than moving
acm_tty_set_termios.  This depends on his patch in order to get proper
DTR handling.

Thanks,
Jim 

---
 drivers/usb/class/cdc-acm.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index e934e19f49f5..d2cd1b6d02a7 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -58,6 +58,9 @@ static struct usb_driver acm_driver;
 static struct tty_driver *acm_tty_driver;
 static struct acm *acm_table[ACM_TTY_MINORS];
 
+static void acm_tty_set_termios(struct tty_struct *tty,
+   struct ktermios *termios_old);
+
 static DEFINE_MUTEX(acm_table_lock);
 
 /*
@@ -554,6 +557,8 @@ static int acm_port_activate(struct tty_port *port, struct 
tty_struct *tty)
goto error_submit_urb;
}
 
+   acm_tty_set_termios(tty, NULL);
+
/*
 * Unthrottle device in case the TTY was closed while throttled.
 */
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] cdc-acm: ensure that termios get set when the port is activated

2014-10-29 Thread Jim Paris
The driver wasn't properly configuring the hardware for the current
termios settings under all conditions.  Ensure that termios are
written to the device when the port is activated.

Signed-off-by: Jim Paris j...@jtan.com
---

Switched to Johan's suggestion of using a prototype rather than moving
acm_tty_set_termios.  This depends on his patch in order to get proper
DTR handling.

Thanks,
Jim 

---
 drivers/usb/class/cdc-acm.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index e934e19f49f5..d2cd1b6d02a7 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -58,6 +58,9 @@ static struct usb_driver acm_driver;
 static struct tty_driver *acm_tty_driver;
 static struct acm *acm_table[ACM_TTY_MINORS];
 
+static void acm_tty_set_termios(struct tty_struct *tty,
+   struct ktermios *termios_old);
+
 static DEFINE_MUTEX(acm_table_lock);
 
 /*
@@ -554,6 +557,8 @@ static int acm_port_activate(struct tty_port *port, struct 
tty_struct *tty)
goto error_submit_urb;
}
 
+   acm_tty_set_termios(tty, NULL);
+
/*
 * Unthrottle device in case the TTY was closed while throttled.
 */
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/