All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] serial: mxs-auart: Fix mxs_auart_set_ldisc()
@ 2014-11-12 22:32 Fabio Estevam
  2014-11-14 22:53 ` Janusz Użycki
  2014-11-15 17:35 ` Janusz Użycki
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-11-12 22:32 UTC (permalink / raw)
  To: gregkh; +Cc: j.uzycki, linux-serial, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Commit 732a84a037a4 ("serial: core: Pass termios to set_ldisc() notifications")
changed the set_ldisc prototype.

At the time of this commit the mxs_auart driver did not implement set_ldisc,
so that's why it has not been converted.

Adapt also mxs_auart_set_ldisc() so that the following build warning can be
fixed:

drivers/tty/serial/mxs-auart.c:962:2: warning: initialization from
incompatible pointer type
  .set_ldisc      = mxs_auart_set_ldisc,
  ^
drivers/tty/serial/mxs-auart.c:962:2: warning: (near initialization
for 'mxs_auart_ops.set_ldisc')

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Fix the explanation for the error

Janusz,

This is build-tested only. Please test it on real hardware, if possible.

 drivers/tty/serial/mxs-auart.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 3784920..a6d2bb9f4 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -784,9 +784,10 @@ static void mxs_auart_settermios(struct uart_port *u,
 		mxs_auart_disable_ms(u);
 }
 
-static void mxs_auart_set_ldisc(struct uart_port *port, int new)
+static void mxs_auart_set_ldisc(struct uart_port *port,
+				struct ktermios *termios)
 {
-	if (new == N_PPS) {
+	if (termios->c_line == N_PPS) {
 		port->flags |= UPF_HARDPPS_CD;
 		mxs_auart_enable_ms(port);
 	} else {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] serial: mxs-auart: Fix mxs_auart_set_ldisc()
  2014-11-12 22:32 [PATCH v2] serial: mxs-auart: Fix mxs_auart_set_ldisc() Fabio Estevam
@ 2014-11-14 22:53 ` Janusz Użycki
  2014-11-15 15:51   ` Fabio Estevam
  2014-11-15 17:35 ` Janusz Użycki
  1 sibling, 1 reply; 4+ messages in thread
From: Janusz Użycki @ 2014-11-14 22:53 UTC (permalink / raw)
  To: Fabio Estevam, gregkh
  Cc: linux-serial, Fabio Estevam, linux-gpio, Linus Walleij,
	Alexandre Courbot

Hi,

Procedure of the test:
* PPS source connected to a DCD line of the driver (gpio)
* ldattach PPS /dev/ttyAPPn
* watch -n 1 cat /sys/class/pps/pps0/assert
* watch -n 1 cat /sys/class/pps/pps0/clear

I just tested and finally it works on my hardware and 
3.18.0-rc4-next-20141114+.
Before I applied the your patch-fix and 2 others which were missed (I 
apologize you here):
"[PATCH] serial: mxs-auart: fix gpio change detection on interrupt"
"[PATCH] gpio: mxs: implement get_direction callback"

I submitted them as separate patches because the first fixes tty-next 
and the second
concerns gpio-next (gpiolib in fact).
I hope they could be picked up for linux-next.

My next step for the mxs-auart driver will be:
* RFC patch for spinlocks in the driver, I hope it helps here:
    http://thread.gmane.org/gmane.linux.serial/16795
    It wasn't continued here:
    http://www.spinics.net/lists/linux-serial/msg10887.html
    "By the way, where did the spinlocks go in this driver?"
* sync the driver to commit d41510ce2f071c9ccb1903d7a5135443a57dbe4e:
   ( "serial: Take uart port lock for direct *_enable_ms()")
* sync the driver to commit cab68f89546ba5a04bf28aaeaca841d4ccc2fd52:
   ( "serial: Test/disable MSIs if switching from N_PPS")
* tx_empty() fix like here with better explanation:
   http://comments.gmane.org/gmane.linux.ports.arm.kernel/283882

have a nice weekend
Janusz

W dniu 2014-11-12 o 23:32, Fabio Estevam pisze:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Commit 732a84a037a4 ("serial: core: Pass termios to set_ldisc() notifications")
> changed the set_ldisc prototype.
>
> At the time of this commit the mxs_auart driver did not implement set_ldisc,
> so that's why it has not been converted.
>
> Adapt also mxs_auart_set_ldisc() so that the following build warning can be
> fixed:
>
> drivers/tty/serial/mxs-auart.c:962:2: warning: initialization from
> incompatible pointer type
>    .set_ldisc      = mxs_auart_set_ldisc,
>    ^
> drivers/tty/serial/mxs-auart.c:962:2: warning: (near initialization
> for 'mxs_auart_ops.set_ldisc')
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v1:
> - Fix the explanation for the error
>
> Janusz,
>
> This is build-tested only. Please test it on real hardware, if possible.
>
>   drivers/tty/serial/mxs-auart.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
> index 3784920..a6d2bb9f4 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -784,9 +784,10 @@ static void mxs_auart_settermios(struct uart_port *u,
>   		mxs_auart_disable_ms(u);
>   }
>   
> -static void mxs_auart_set_ldisc(struct uart_port *port, int new)
> +static void mxs_auart_set_ldisc(struct uart_port *port,
> +				struct ktermios *termios)
>   {
> -	if (new == N_PPS) {
> +	if (termios->c_line == N_PPS) {
>   		port->flags |= UPF_HARDPPS_CD;
>   		mxs_auart_enable_ms(port);
>   	} else {


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] serial: mxs-auart: Fix mxs_auart_set_ldisc()
  2014-11-14 22:53 ` Janusz Użycki
@ 2014-11-15 15:51   ` Fabio Estevam
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-11-15 15:51 UTC (permalink / raw)
  To: Janusz Użycki
  Cc: Greg Kroah-Hartman, linux-serial@vger.kernel.org, Fabio Estevam,
	linux-gpio@vger.kernel.org, Linus Walleij, Alexandre Courbot

Hi Janusz,

On Fri, Nov 14, 2014 at 8:53 PM, Janusz Użycki <j.uzycki@elproma.com.pl> wrote:
> Hi,
>
> Procedure of the test:
> * PPS source connected to a DCD line of the driver (gpio)
> * ldattach PPS /dev/ttyAPPn
> * watch -n 1 cat /sys/class/pps/pps0/assert
> * watch -n 1 cat /sys/class/pps/pps0/clear
>
> I just tested and finally it works on my hardware and
> 3.18.0-rc4-next-20141114+.

In this case, can you provide your Tested-by tag in reply to my patch? Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] serial: mxs-auart: Fix mxs_auart_set_ldisc()
  2014-11-12 22:32 [PATCH v2] serial: mxs-auart: Fix mxs_auart_set_ldisc() Fabio Estevam
  2014-11-14 22:53 ` Janusz Użycki
@ 2014-11-15 17:35 ` Janusz Użycki
  1 sibling, 0 replies; 4+ messages in thread
From: Janusz Użycki @ 2014-11-15 17:35 UTC (permalink / raw)
  To: Fabio Estevam, gregkh; +Cc: linux-serial, Fabio Estevam


W dniu 2014-11-12 o 23:32, Fabio Estevam pisze:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Commit 732a84a037a4 ("serial: core: Pass termios to set_ldisc() notifications")
> changed the set_ldisc prototype.
>
> At the time of this commit the mxs_auart driver did not implement set_ldisc,
> so that's why it has not been converted.
>
> Adapt also mxs_auart_set_ldisc() so that the following build warning can be
> fixed:
>
> drivers/tty/serial/mxs-auart.c:962:2: warning: initialization from
> incompatible pointer type
>    .set_ldisc      = mxs_auart_set_ldisc,
>    ^
> drivers/tty/serial/mxs-auart.c:962:2: warning: (near initialization
> for 'mxs_auart_ops.set_ldisc')
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v1:
> - Fix the explanation for the error
>
> Janusz,
>
> This is build-tested only. Please test it on real hardware, if possible.
>
>   drivers/tty/serial/mxs-auart.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
> index 3784920..a6d2bb9f4 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -784,9 +784,10 @@ static void mxs_auart_settermios(struct uart_port *u,
>   		mxs_auart_disable_ms(u);
>   }
>   
> -static void mxs_auart_set_ldisc(struct uart_port *port, int new)
> +static void mxs_auart_set_ldisc(struct uart_port *port,
> +				struct ktermios *termios)
>   {
> -	if (new == N_PPS) {
> +	if (termios->c_line == N_PPS) {
>   		port->flags |= UPF_HARDPPS_CD;
>   		mxs_auart_enable_ms(port);
>   	} else {

Tested-by: Janusz Uzycki <j.uzycki@elproma.com.pl>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-15 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12 22:32 [PATCH v2] serial: mxs-auart: Fix mxs_auart_set_ldisc() Fabio Estevam
2014-11-14 22:53 ` Janusz Użycki
2014-11-15 15:51   ` Fabio Estevam
2014-11-15 17:35 ` Janusz Użycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.