patches: use old locking for struct tty_struct
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 28 Jun 2015 18:00:29 +0000 (20:00 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 28 Jun 2015 21:50:55 +0000 (23:50 +0200)
With kernel 3.12 a new locking was added to struct tty_struct. This
patch makes the code use the old locking.

The new locking was added in this commit:
commit 6a1c0680cf3ba94356ecd58833e1540c93472a57
Author: Peter Hurley <peter@hurleysoftware.com>
Date:   Sat Jun 15 09:14:23 2013 -0400

    tty: Convert termios_mutex to termios_rwsem

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/collateral-evolutions/network/0061-termios_rwsem/INFO [new file with mode: 0644]
patches/collateral-evolutions/network/0061-termios_rwsem/nfc.patch [new file with mode: 0644]

diff --git a/patches/collateral-evolutions/network/0061-termios_rwsem/INFO b/patches/collateral-evolutions/network/0061-termios_rwsem/INFO
new file mode 100644 (file)
index 0000000..296b219
--- /dev/null
@@ -0,0 +1,11 @@
+use old locking for struct tty_struct
+
+With kernel 3.12 a new locking was added to struct tty_struct. This
+patch makes the code use the old locking.
+
+The new locking was added in this commit:
+commit 6a1c0680cf3ba94356ecd58833e1540c93472a57
+Author: Peter Hurley <peter@hurleysoftware.com>
+Date:   Sat Jun 15 09:14:23 2013 -0400
+
+    tty: Convert termios_mutex to termios_rwsem
diff --git a/patches/collateral-evolutions/network/0061-termios_rwsem/nfc.patch b/patches/collateral-evolutions/network/0061-termios_rwsem/nfc.patch
new file mode 100644 (file)
index 0000000..4829bee
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/net/nfc/nci/uart.c
++++ b/net/nfc/nci/uart.c
+@@ -446,9 +446,17 @@ void nci_uart_set_config(struct nci_uart
+       if (!nu->tty)
+               return;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
+       down_read(&nu->tty->termios_rwsem);
++#else
++      mutex_lock(&nu->tty->termios_mutex);
++#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) */
+       new_termios = nu->tty->termios;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
+       up_read(&nu->tty->termios_rwsem);
++#else
++      mutex_unlock(&nu->tty->termios_mutex);
++#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) */
+       tty_termios_encode_baud_rate(&new_termios, baudrate, baudrate);
+       if (flow_ctrl)