]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 20:58:30 +0000 (13:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 20:58:30 +0000 (13:58 -0700)
added patches:
clk-qcom-fix-clk_rcg2_is_enabled-check.patch
clk-qcom-fix-mmcc-8974-s-pll-configurations.patch
netfilter-ctnetlink-fix-dumping-of-dying-unconfirmed-conntracks.patch
netfilter-ctnetlink-fix-refcnt-leak-in-dying-unconfirmed-list-dumper.patch
netfilter-nf_nat-fix-oops-on-netns-removal.patch
serial-fix-ignbrk-handling.patch
tty-correct-inpck-handling.patch

queue-3.15/clk-qcom-fix-clk_rcg2_is_enabled-check.patch [new file with mode: 0644]
queue-3.15/clk-qcom-fix-mmcc-8974-s-pll-configurations.patch [new file with mode: 0644]
queue-3.15/netfilter-ctnetlink-fix-dumping-of-dying-unconfirmed-conntracks.patch [new file with mode: 0644]
queue-3.15/netfilter-ctnetlink-fix-refcnt-leak-in-dying-unconfirmed-list-dumper.patch [new file with mode: 0644]
queue-3.15/netfilter-nf_nat-fix-oops-on-netns-removal.patch [new file with mode: 0644]
queue-3.15/serial-fix-ignbrk-handling.patch [new file with mode: 0644]
queue-3.15/series
queue-3.15/tty-correct-inpck-handling.patch [new file with mode: 0644]

diff --git a/queue-3.15/clk-qcom-fix-clk_rcg2_is_enabled-check.patch b/queue-3.15/clk-qcom-fix-clk_rcg2_is_enabled-check.patch
new file mode 100644 (file)
index 0000000..a9dca43
--- /dev/null
@@ -0,0 +1,32 @@
+From aa014149ba002155a084ec1e9328e95b70167cbb Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd@codeaurora.org>
+Date: Fri, 16 May 2014 16:07:08 -0700
+Subject: clk: qcom: Fix clk_rcg2_is_enabled() check
+
+From: Stephen Boyd <sboyd@codeaurora.org>
+
+commit aa014149ba002155a084ec1e9328e95b70167cbb upstream.
+
+If the bit is set the clock is off so we should be checking for
+a clear bit, not a set bit. Invert the logic.
+
+Fixes: bcd61c0f535a (clk: qcom: Add support for root clock generators (RCGs))
+Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+Signed-off-by: Mike Turquette <mturquette@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/clk/qcom/clk-rcg2.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/clk/qcom/clk-rcg2.c
++++ b/drivers/clk/qcom/clk-rcg2.c
+@@ -55,7 +55,7 @@ static int clk_rcg2_is_enabled(struct cl
+       if (ret)
+               return ret;
+-      return (cmd & CMD_ROOT_OFF) != 0;
++      return (cmd & CMD_ROOT_OFF) == 0;
+ }
+ static u8 clk_rcg2_get_parent(struct clk_hw *hw)
diff --git a/queue-3.15/clk-qcom-fix-mmcc-8974-s-pll-configurations.patch b/queue-3.15/clk-qcom-fix-mmcc-8974-s-pll-configurations.patch
new file mode 100644 (file)
index 0000000..618a4e5
--- /dev/null
@@ -0,0 +1,83 @@
+From 437ae6a1b8f2eedebfbf0f6572e19ca5c58a3f71 Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd@codeaurora.org>
+Date: Fri, 16 May 2014 16:07:09 -0700
+Subject: clk: qcom: Fix mmcc-8974's PLL configurations
+
+From: Stephen Boyd <sboyd@codeaurora.org>
+
+commit 437ae6a1b8f2eedebfbf0f6572e19ca5c58a3f71 upstream.
+
+We forgot to add the status bit for the PLLs and we were using
+the wrong register and masks for configuration, leading to
+unexpected PLL configurations. Fix this.
+
+Fixes: d8b212014e69 (clk: qcom: Add support for MSM8974's multimedia clock controller (MMCC))
+Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
+Signed-off-by: Mike Turquette <mturquette@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/clk/qcom/mmcc-msm8974.c |   13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+--- a/drivers/clk/qcom/mmcc-msm8974.c
++++ b/drivers/clk/qcom/mmcc-msm8974.c
+@@ -169,6 +169,7 @@ static struct clk_pll mmpll0 = {
+       .config_reg = 0x0014,
+       .mode_reg = 0x0000,
+       .status_reg = 0x001c,
++      .status_bit = 17,
+         .clkr.hw.init = &(struct clk_init_data){
+                 .name = "mmpll0",
+                 .parent_names = (const char *[]){ "xo" },
+@@ -192,9 +193,10 @@ static struct clk_pll mmpll1 = {
+       .l_reg = 0x0044,
+       .m_reg = 0x0048,
+       .n_reg = 0x004c,
+-      .config_reg = 0x0054,
++      .config_reg = 0x0050,
+       .mode_reg = 0x0040,
+       .status_reg = 0x005c,
++      .status_bit = 17,
+         .clkr.hw.init = &(struct clk_init_data){
+                 .name = "mmpll1",
+                 .parent_names = (const char *[]){ "xo" },
+@@ -218,7 +220,7 @@ static struct clk_pll mmpll2 = {
+       .l_reg = 0x4104,
+       .m_reg = 0x4108,
+       .n_reg = 0x410c,
+-      .config_reg = 0x4114,
++      .config_reg = 0x4110,
+       .mode_reg = 0x4100,
+       .status_reg = 0x411c,
+         .clkr.hw.init = &(struct clk_init_data){
+@@ -233,9 +235,10 @@ static struct clk_pll mmpll3 = {
+       .l_reg = 0x0084,
+       .m_reg = 0x0088,
+       .n_reg = 0x008c,
+-      .config_reg = 0x0094,
++      .config_reg = 0x0090,
+       .mode_reg = 0x0080,
+       .status_reg = 0x009c,
++      .status_bit = 17,
+         .clkr.hw.init = &(struct clk_init_data){
+                 .name = "mmpll3",
+                 .parent_names = (const char *[]){ "xo" },
+@@ -2318,7 +2321,7 @@ static const struct pll_config mmpll1_co
+       .vco_val = 0x0,
+       .vco_mask = 0x3 << 20,
+       .pre_div_val = 0x0,
+-      .pre_div_mask = 0x3 << 12,
++      .pre_div_mask = 0x7 << 12,
+       .post_div_val = 0x0,
+       .post_div_mask = 0x3 << 8,
+       .mn_ena_mask = BIT(24),
+@@ -2332,7 +2335,7 @@ static struct pll_config mmpll3_config =
+       .vco_val = 0x0,
+       .vco_mask = 0x3 << 20,
+       .pre_div_val = 0x0,
+-      .pre_div_mask = 0x3 << 12,
++      .pre_div_mask = 0x7 << 12,
+       .post_div_val = 0x0,
+       .post_div_mask = 0x3 << 8,
+       .mn_ena_mask = BIT(24),
diff --git a/queue-3.15/netfilter-ctnetlink-fix-dumping-of-dying-unconfirmed-conntracks.patch b/queue-3.15/netfilter-ctnetlink-fix-dumping-of-dying-unconfirmed-conntracks.patch
new file mode 100644 (file)
index 0000000..9f995e1
--- /dev/null
@@ -0,0 +1,58 @@
+From 266155b2de8fb721ae353688529b2f8bcdde2f90 Mon Sep 17 00:00:00 2001
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+Date: Thu, 5 Jun 2014 14:28:44 +0200
+Subject: netfilter: ctnetlink: fix dumping of dying/unconfirmed conntracks
+
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+
+commit 266155b2de8fb721ae353688529b2f8bcdde2f90 upstream.
+
+The dumping prematurely stops, it seems the callback argument that
+indicates that all entries have been dumped is set after iterating
+on the first cpu list. The dumping also may stop before the entire
+per-cpu list content is also dumped.
+
+With this patch, conntrack -L dying now shows the dying list content
+again.
+
+Fixes: b7779d06 ("netfilter: conntrack: spinlock per cpu to protect special lists.")
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/nf_conntrack_netlink.c |    8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+--- a/net/netfilter/nf_conntrack_netlink.c
++++ b/net/netfilter/nf_conntrack_netlink.c
+@@ -1163,9 +1163,6 @@ ctnetlink_dump_list(struct sk_buff *skb,
+       if (cb->args[2])
+               return 0;
+-      if (cb->args[0] == nr_cpu_ids)
+-              return 0;
+-
+       for (cpu = cb->args[0]; cpu < nr_cpu_ids; cpu++) {
+               struct ct_pcpu *pcpu;
+@@ -1194,6 +1191,7 @@ restart:
+                       rcu_read_unlock();
+                       if (res < 0) {
+                               nf_conntrack_get(&ct->ct_general);
++                              cb->args[0] = cpu;
+                               cb->args[1] = (unsigned long)ct;
+                               spin_unlock_bh(&pcpu->lock);
+                               goto out;
+@@ -1202,10 +1200,10 @@ restart:
+               if (cb->args[1]) {
+                       cb->args[1] = 0;
+                       goto restart;
+-              } else
+-                      cb->args[2] = 1;
++              }
+               spin_unlock_bh(&pcpu->lock);
+       }
++      cb->args[2] = 1;
+ out:
+       if (last)
+               nf_ct_put(last);
diff --git a/queue-3.15/netfilter-ctnetlink-fix-refcnt-leak-in-dying-unconfirmed-list-dumper.patch b/queue-3.15/netfilter-ctnetlink-fix-refcnt-leak-in-dying-unconfirmed-list-dumper.patch
new file mode 100644 (file)
index 0000000..6ae6af9
--- /dev/null
@@ -0,0 +1,63 @@
+From cd5f336f1780cb20e83146cde64d3d5779e175e6 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Sun, 8 Jun 2014 11:41:23 +0200
+Subject: netfilter: ctnetlink: fix refcnt leak in dying/unconfirmed list dumper
+
+From: Florian Westphal <fw@strlen.de>
+
+commit cd5f336f1780cb20e83146cde64d3d5779e175e6 upstream.
+
+'last' keeps track of the ct that had its refcnt bumped during previous
+dump cycle.  Thus it must not be overwritten until end-of-function.
+
+Another (unrelated, theoretical) issue: Don't attempt to bump refcnt of a conntrack
+whose reference count is already 0.  Such conntrack is being destroyed
+right now, its memory is freed once we release the percpu dying spinlock.
+
+Fixes: b7779d06 ('netfilter: conntrack: spinlock per cpu to protect special lists.')
+Signed-off-by: Florian Westphal <fw@strlen.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/nf_conntrack_netlink.c |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/net/netfilter/nf_conntrack_netlink.c
++++ b/net/netfilter/nf_conntrack_netlink.c
+@@ -1150,7 +1150,7 @@ static int ctnetlink_done_list(struct ne
+ static int
+ ctnetlink_dump_list(struct sk_buff *skb, struct netlink_callback *cb, bool dying)
+ {
+-      struct nf_conn *ct, *last = NULL;
++      struct nf_conn *ct, *last;
+       struct nf_conntrack_tuple_hash *h;
+       struct hlist_nulls_node *n;
+       struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
+@@ -1163,6 +1163,8 @@ ctnetlink_dump_list(struct sk_buff *skb,
+       if (cb->args[2])
+               return 0;
++      last = (struct nf_conn *)cb->args[1];
++
+       for (cpu = cb->args[0]; cpu < nr_cpu_ids; cpu++) {
+               struct ct_pcpu *pcpu;
+@@ -1171,7 +1173,6 @@ ctnetlink_dump_list(struct sk_buff *skb,
+               pcpu = per_cpu_ptr(net->ct.pcpu_lists, cpu);
+               spin_lock_bh(&pcpu->lock);
+-              last = (struct nf_conn *)cb->args[1];
+               list = dying ? &pcpu->dying : &pcpu->unconfirmed;
+ restart:
+               hlist_nulls_for_each_entry(h, n, list, hnnode) {
+@@ -1190,7 +1191,8 @@ restart:
+                                                 ct);
+                       rcu_read_unlock();
+                       if (res < 0) {
+-                              nf_conntrack_get(&ct->ct_general);
++                              if (!atomic_inc_not_zero(&ct->ct_general.use))
++                                      continue;
+                               cb->args[0] = cpu;
+                               cb->args[1] = (unsigned long)ct;
+                               spin_unlock_bh(&pcpu->lock);
diff --git a/queue-3.15/netfilter-nf_nat-fix-oops-on-netns-removal.patch b/queue-3.15/netfilter-nf_nat-fix-oops-on-netns-removal.patch
new file mode 100644 (file)
index 0000000..93a1ec8
--- /dev/null
@@ -0,0 +1,96 @@
+From 945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Sat, 7 Jun 2014 21:17:04 +0200
+Subject: netfilter: nf_nat: fix oops on netns removal
+
+From: Florian Westphal <fw@strlen.de>
+
+commit 945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f upstream.
+
+Quoting Samu Kallio:
+
+ Basically what's happening is, during netns cleanup,
+ nf_nat_net_exit gets called before ipv4_net_exit. As I understand
+ it, nf_nat_net_exit is supposed to kill any conntrack entries which
+ have NAT context (through nf_ct_iterate_cleanup), but for some
+ reason this doesn't happen (perhaps something else is still holding
+ refs to those entries?).
+
+ When ipv4_net_exit is called, conntrack entries (including those
+ with NAT context) are cleaned up, but the
+ nat_bysource hashtable is long gone - freed in nf_nat_net_exit. The
+ bug happens when attempting to free a conntrack entry whose NAT hash
+ 'prev' field points to a slot in the freed hash table (head for that
+ bin).
+
+We ignore conntracks with null nat bindings.  But this is wrong,
+as these are in bysource hash table as well.
+
+Restore nat-cleaning for the netns-is-being-removed case.
+
+bug:
+https://bugzilla.kernel.org/show_bug.cgi?id=65191
+
+Fixes: c2d421e1718 ('netfilter: nf_nat: fix race when unloading protocol modules')
+Reported-by: Samu Kallio <samu.kallio@aberdeencloud.com>
+Debugged-by: Samu Kallio <samu.kallio@aberdeencloud.com>
+Signed-off-by: Florian Westphal <fw@strlen.de>
+Tested-by: Samu Kallio <samu.kallio@aberdeencloud.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netfilter/nf_nat_core.c |   35 ++++++++++++++++++++++++++++++++++-
+ 1 file changed, 34 insertions(+), 1 deletion(-)
+
+--- a/net/netfilter/nf_nat_core.c
++++ b/net/netfilter/nf_nat_core.c
+@@ -517,6 +517,39 @@ static int nf_nat_proto_remove(struct nf
+       return i->status & IPS_NAT_MASK ? 1 : 0;
+ }
++static int nf_nat_proto_clean(struct nf_conn *ct, void *data)
++{
++      struct nf_conn_nat *nat = nfct_nat(ct);
++
++      if (nf_nat_proto_remove(ct, data))
++              return 1;
++
++      if (!nat || !nat->ct)
++              return 0;
++
++      /* This netns is being destroyed, and conntrack has nat null binding.
++       * Remove it from bysource hash, as the table will be freed soon.
++       *
++       * Else, when the conntrack is destoyed, nf_nat_cleanup_conntrack()
++       * will delete entry from already-freed table.
++       */
++      if (!del_timer(&ct->timeout))
++              return 1;
++
++      spin_lock_bh(&nf_nat_lock);
++      hlist_del_rcu(&nat->bysource);
++      ct->status &= ~IPS_NAT_DONE_MASK;
++      nat->ct = NULL;
++      spin_unlock_bh(&nf_nat_lock);
++
++      add_timer(&ct->timeout);
++
++      /* don't delete conntrack.  Although that would make things a lot
++       * simpler, we'd end up flushing all conntracks on nat rmmod.
++       */
++      return 0;
++}
++
+ static void nf_nat_l4proto_clean(u8 l3proto, u8 l4proto)
+ {
+       struct nf_nat_proto_clean clean = {
+@@ -787,7 +820,7 @@ static void __net_exit nf_nat_net_exit(s
+ {
+       struct nf_nat_proto_clean clean = {};
+-      nf_ct_iterate_cleanup(net, &nf_nat_proto_remove, &clean, 0, 0);
++      nf_ct_iterate_cleanup(net, nf_nat_proto_clean, &clean, 0, 0);
+       synchronize_rcu();
+       nf_ct_free_hashtable(net->ct.nat_bysource, net->ct.nat_htable_size);
+ }
diff --git a/queue-3.15/serial-fix-ignbrk-handling.patch b/queue-3.15/serial-fix-ignbrk-handling.patch
new file mode 100644 (file)
index 0000000..3bb6ac9
--- /dev/null
@@ -0,0 +1,515 @@
+From ef8b9ddcb45fa3b1e11acd72be2398001e807d14 Mon Sep 17 00:00:00 2001
+From: Peter Hurley <peter@hurleysoftware.com>
+Date: Mon, 16 Jun 2014 08:10:41 -0400
+Subject: serial: Fix IGNBRK handling
+
+From: Peter Hurley <peter@hurleysoftware.com>
+
+commit ef8b9ddcb45fa3b1e11acd72be2398001e807d14 upstream.
+
+If IGNBRK is set without either BRKINT or PARMRK set, some uart
+drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the
+line discipline, when it should send either nothing or the TTYBREAK flag
+set. This happens because the read_status_mask masks out the BI
+condition, which uart_insert_char() then interprets as a normal 0x00 byte.
+
+SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General
+Terminal Interface - Input Modes, states:
+  "If IGNBRK is set, a break condition detected on input shall be ignored;
+   that is, not put on the input queue and therefore not read by any
+   process."
+
+Fix read_status_mask to include the BI bit if IGNBRK is set; the
+lsr status retains the BI bit if a BREAK is recv'd, which is
+subsequently ignored in uart_insert_char() when masked with the
+ignore_status_mask.
+
+Affected drivers:
+8250 - all
+serial_txx9
+mfd
+amba-pl010
+amba-pl011
+atmel_serial
+bfin_uart
+dz
+ip22zilog
+max310x
+mxs-auart
+netx-serial
+pnx8xxx_uart
+pxa
+sb1250-duart
+sccnxp
+serial_ks8695
+sirfsoc_uart
+st-asc
+vr41xx_siu
+zs
+sunzilog
+fsl_lpuart
+sunsab
+ucc_uart
+bcm63xx_uart
+sunsu
+efm32-uart
+pmac_zilog
+mpsc
+msm_serial
+m32r_sio
+
+Unaffected drivers:
+omap-serial
+rp2
+sa1100
+imx
+icom
+
+Annotated for fixes:
+altera_uart
+mcf
+
+Drivers without break detection:
+21285
+xilinx-uartps
+altera_jtaguart
+apbuart
+arc-uart
+clps711x
+max3100
+uartlite
+msm_serial_hs
+nwpserial
+lantiq
+vt8500_serial
+
+Unknown:
+samsung
+mpc52xx_uart
+bfin_sport_uart
+cpm_uart/core
+
+Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag'
+Reported-by: Ivan <athlon_@mail.ru>
+Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_core.c |    2 +-
+ drivers/tty/serial/altera_uart.c    |    6 ++++++
+ drivers/tty/serial/amba-pl010.c     |    2 +-
+ drivers/tty/serial/amba-pl011.c     |    2 +-
+ drivers/tty/serial/atmel_serial.c   |    2 +-
+ drivers/tty/serial/bcm63xx_uart.c   |    2 +-
+ drivers/tty/serial/bfin_uart.c      |    2 +-
+ drivers/tty/serial/dz.c             |    2 +-
+ drivers/tty/serial/efm32-uart.c     |    2 +-
+ drivers/tty/serial/fsl_lpuart.c     |    2 +-
+ drivers/tty/serial/ip22zilog.c      |    2 +-
+ drivers/tty/serial/m32r_sio.c       |    2 +-
+ drivers/tty/serial/max310x.c        |    2 +-
+ drivers/tty/serial/mcf.c            |    6 ++++++
+ drivers/tty/serial/mfd.c            |    2 +-
+ drivers/tty/serial/mpsc.c           |    2 +-
+ drivers/tty/serial/msm_serial.c     |    2 +-
+ drivers/tty/serial/mxs-auart.c      |    2 +-
+ drivers/tty/serial/netx-serial.c    |    2 +-
+ drivers/tty/serial/pmac_zilog.c     |    2 +-
+ drivers/tty/serial/pnx8xxx_uart.c   |    2 +-
+ drivers/tty/serial/pxa.c            |    2 +-
+ drivers/tty/serial/sb1250-duart.c   |    2 +-
+ drivers/tty/serial/sccnxp.c         |    2 +-
+ drivers/tty/serial/serial_ks8695.c  |    2 +-
+ drivers/tty/serial/serial_txx9.c    |    2 +-
+ drivers/tty/serial/sirfsoc_uart.c   |    2 +-
+ drivers/tty/serial/st-asc.c         |    2 +-
+ drivers/tty/serial/sunsab.c         |    2 +-
+ drivers/tty/serial/sunsu.c          |    2 +-
+ drivers/tty/serial/sunzilog.c       |    2 +-
+ drivers/tty/serial/ucc_uart.c       |    2 +-
+ drivers/tty/serial/vr41xx_siu.c     |    2 +-
+ drivers/tty/serial/zs.c             |    2 +-
+ 34 files changed, 44 insertions(+), 32 deletions(-)
+
+--- a/drivers/tty/serial/8250/8250_core.c
++++ b/drivers/tty/serial/8250/8250_core.c
+@@ -2360,7 +2360,7 @@ serial8250_do_set_termios(struct uart_po
+       port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= UART_LSR_BI;
+       /*
+--- a/drivers/tty/serial/altera_uart.c
++++ b/drivers/tty/serial/altera_uart.c
+@@ -185,6 +185,12 @@ static void altera_uart_set_termios(stru
+       uart_update_timeout(port, termios->c_cflag, baud);
+       altera_uart_writel(port, baudclk, ALTERA_UART_DIVISOR_REG);
+       spin_unlock_irqrestore(&port->lock, flags);
++
++      /*
++       * FIXME: port->read_status_mask and port->ignore_status_mask
++       * need to be initialized based on termios settings for
++       * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT
++       */
+ }
+ static void altera_uart_rx_chars(struct altera_uart *pp)
+--- a/drivers/tty/serial/amba-pl010.c
++++ b/drivers/tty/serial/amba-pl010.c
+@@ -420,7 +420,7 @@ pl010_set_termios(struct uart_port *port
+       uap->port.read_status_mask = UART01x_RSR_OE;
+       if (termios->c_iflag & INPCK)
+               uap->port.read_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               uap->port.read_status_mask |= UART01x_RSR_BE;
+       /*
+--- a/drivers/tty/serial/amba-pl011.c
++++ b/drivers/tty/serial/amba-pl011.c
+@@ -1744,7 +1744,7 @@ pl011_set_termios(struct uart_port *port
+       port->read_status_mask = UART011_DR_OE | 255;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= UART011_DR_FE | UART011_DR_PE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= UART011_DR_BE;
+       /*
+--- a/drivers/tty/serial/atmel_serial.c
++++ b/drivers/tty/serial/atmel_serial.c
+@@ -1784,7 +1784,7 @@ static void atmel_set_termios(struct uar
+       port->read_status_mask = ATMEL_US_OVRE;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE);
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= ATMEL_US_RXBRK;
+       if (atmel_use_pdc_rx(port))
+--- a/drivers/tty/serial/bcm63xx_uart.c
++++ b/drivers/tty/serial/bcm63xx_uart.c
+@@ -567,7 +567,7 @@ static void bcm_uart_set_termios(struct
+               port->read_status_mask |= UART_FIFO_FRAMEERR_MASK;
+               port->read_status_mask |= UART_FIFO_PARERR_MASK;
+       }
+-      if (new->c_iflag & (BRKINT))
++      if (new->c_iflag & (IGNBRK | BRKINT))
+               port->read_status_mask |= UART_FIFO_BRKDET_MASK;
+       port->ignore_status_mask = 0;
+--- a/drivers/tty/serial/bfin_uart.c
++++ b/drivers/tty/serial/bfin_uart.c
+@@ -833,7 +833,7 @@ bfin_serial_set_termios(struct uart_port
+       port->read_status_mask = OE;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= (FE | PE);
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= BI;
+       /*
+--- a/drivers/tty/serial/dz.c
++++ b/drivers/tty/serial/dz.c
+@@ -625,7 +625,7 @@ static void dz_set_termios(struct uart_p
+       dport->port.read_status_mask = DZ_OERR;
+       if (termios->c_iflag & INPCK)
+               dport->port.read_status_mask |= DZ_FERR | DZ_PERR;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               dport->port.read_status_mask |= DZ_BREAK;
+       /* characters to ignore */
+--- a/drivers/tty/serial/efm32-uart.c
++++ b/drivers/tty/serial/efm32-uart.c
+@@ -407,7 +407,7 @@ static void efm32_uart_set_termios(struc
+       if (new->c_iflag & INPCK)
+               port->read_status_mask |=
+                       UARTn_RXDATAX_FERR | UARTn_RXDATAX_PERR;
+-      if (new->c_iflag & (BRKINT | PARMRK))
++      if (new->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= SW_UARTn_RXDATAX_BERR;
+       port->ignore_status_mask = 0;
+--- a/drivers/tty/serial/fsl_lpuart.c
++++ b/drivers/tty/serial/fsl_lpuart.c
+@@ -902,7 +902,7 @@ lpuart_set_termios(struct uart_port *por
+       sport->port.read_status_mask = 0;
+       if (termios->c_iflag & INPCK)
+               sport->port.read_status_mask |= (UARTSR1_FE | UARTSR1_PE);
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               sport->port.read_status_mask |= UARTSR1_FE;
+       /* characters to ignore */
+--- a/drivers/tty/serial/ip22zilog.c
++++ b/drivers/tty/serial/ip22zilog.c
+@@ -850,7 +850,7 @@ ip22zilog_convert_to_zs(struct uart_ip22
+       up->port.read_status_mask = Rx_OVR;
+       if (iflag & INPCK)
+               up->port.read_status_mask |= CRC_ERR | PAR_ERR;
+-      if (iflag & (BRKINT | PARMRK))
++      if (iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= BRK_ABRT;
+       up->port.ignore_status_mask = 0;
+--- a/drivers/tty/serial/m32r_sio.c
++++ b/drivers/tty/serial/m32r_sio.c
+@@ -737,7 +737,7 @@ static void m32r_sio_set_termios(struct
+       up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+       if (termios->c_iflag & INPCK)
+               up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= UART_LSR_BI;
+       /*
+--- a/drivers/tty/serial/max310x.c
++++ b/drivers/tty/serial/max310x.c
+@@ -835,7 +835,7 @@ static void max310x_set_termios(struct u
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= MAX310X_LSR_RXPAR_BIT |
+                                         MAX310X_LSR_FRERR_BIT;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= MAX310X_LSR_RXBRK_BIT;
+       /* Set status ignore mask */
+--- a/drivers/tty/serial/mcf.c
++++ b/drivers/tty/serial/mcf.c
+@@ -248,6 +248,12 @@ static void mcf_set_termios(struct uart_
+               mr1 |= MCFUART_MR1_PARITYNONE;
+       }
++      /*
++       * FIXME: port->read_status_mask and port->ignore_status_mask
++       * need to be initialized based on termios settings for
++       * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT
++       */
++
+       if (termios->c_cflag & CSTOPB)
+               mr2 |= MCFUART_MR2_STOP2;
+       else
+--- a/drivers/tty/serial/mfd.c
++++ b/drivers/tty/serial/mfd.c
+@@ -977,7 +977,7 @@ serial_hsu_set_termios(struct uart_port
+       up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+       if (termios->c_iflag & INPCK)
+               up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= UART_LSR_BI;
+       /* Characters to ignore */
+--- a/drivers/tty/serial/mpsc.c
++++ b/drivers/tty/serial/mpsc.c
+@@ -1458,7 +1458,7 @@ static void mpsc_set_termios(struct uart
+               pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_PE
+                       | SDMA_DESC_CMDSTAT_FR;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_BR;
+       /* Characters/events to ignore */
+--- a/drivers/tty/serial/msm_serial.c
++++ b/drivers/tty/serial/msm_serial.c
+@@ -583,7 +583,7 @@ static void msm_set_termios(struct uart_
+       port->read_status_mask = 0;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= UART_SR_PAR_FRAME_ERR;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= UART_SR_RX_BREAK;
+       uart_update_timeout(port, termios->c_cflag, baud);
+--- a/drivers/tty/serial/mxs-auart.c
++++ b/drivers/tty/serial/mxs-auart.c
+@@ -604,7 +604,7 @@ static void mxs_auart_settermios(struct
+       if (termios->c_iflag & INPCK)
+               u->read_status_mask |= AUART_STAT_PERR;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               u->read_status_mask |= AUART_STAT_BERR;
+       /*
+--- a/drivers/tty/serial/netx-serial.c
++++ b/drivers/tty/serial/netx-serial.c
+@@ -419,7 +419,7 @@ netx_set_termios(struct uart_port *port,
+       }
+       port->read_status_mask = 0;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= SR_BE;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= SR_PE | SR_FE;
+--- a/drivers/tty/serial/pmac_zilog.c
++++ b/drivers/tty/serial/pmac_zilog.c
+@@ -1092,7 +1092,7 @@ static void pmz_convert_to_zs(struct uar
+       uap->port.read_status_mask = Rx_OVR;
+       if (iflag & INPCK)
+               uap->port.read_status_mask |= CRC_ERR | PAR_ERR;
+-      if (iflag & (BRKINT | PARMRK))
++      if (iflag & (IGNBRK | BRKINT | PARMRK))
+               uap->port.read_status_mask |= BRK_ABRT;
+       uap->port.ignore_status_mask = 0;
+--- a/drivers/tty/serial/pnx8xxx_uart.c
++++ b/drivers/tty/serial/pnx8xxx_uart.c
+@@ -477,7 +477,7 @@ pnx8xxx_set_termios(struct uart_port *po
+               sport->port.read_status_mask |=
+                       FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) |
+                       FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR);
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               sport->port.read_status_mask |=
+                       ISTAT_TO_SM(PNX8XXX_UART_INT_BREAK);
+--- a/drivers/tty/serial/pxa.c
++++ b/drivers/tty/serial/pxa.c
+@@ -492,7 +492,7 @@ serial_pxa_set_termios(struct uart_port
+       up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+       if (termios->c_iflag & INPCK)
+               up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= UART_LSR_BI;
+       /*
+--- a/drivers/tty/serial/sb1250-duart.c
++++ b/drivers/tty/serial/sb1250-duart.c
+@@ -596,7 +596,7 @@ static void sbd_set_termios(struct uart_
+       if (termios->c_iflag & INPCK)
+               uport->read_status_mask |= M_DUART_FRM_ERR |
+                                          M_DUART_PARITY_ERR;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               uport->read_status_mask |= M_DUART_RCVD_BRK;
+       uport->ignore_status_mask = 0;
+--- a/drivers/tty/serial/sccnxp.c
++++ b/drivers/tty/serial/sccnxp.c
+@@ -667,7 +667,7 @@ static void sccnxp_set_termios(struct ua
+       port->read_status_mask = SR_OVR;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= SR_PE | SR_FE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= SR_BRK;
+       /* Set status ignore mask */
+--- a/drivers/tty/serial/serial_ks8695.c
++++ b/drivers/tty/serial/serial_ks8695.c
+@@ -437,7 +437,7 @@ static void ks8695uart_set_termios(struc
+       port->read_status_mask = URLS_URROE;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= (URLS_URFE | URLS_URPE);
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= URLS_URBI;
+       /*
+--- a/drivers/tty/serial/serial_txx9.c
++++ b/drivers/tty/serial/serial_txx9.c
+@@ -702,7 +702,7 @@ serial_txx9_set_termios(struct uart_port
+               TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS;
+       if (termios->c_iflag & INPCK)
+               up->port.read_status_mask |= TXX9_SIDISR_UFER | TXX9_SIDISR_UPER;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= TXX9_SIDISR_UBRK;
+       /*
+--- a/drivers/tty/serial/sirfsoc_uart.c
++++ b/drivers/tty/serial/sirfsoc_uart.c
+@@ -907,7 +907,7 @@ static void sirfsoc_uart_set_termios(str
+               if (termios->c_iflag & INPCK)
+                       port->read_status_mask |= uint_en->sirfsoc_frm_err_en;
+       }
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+                       port->read_status_mask |= uint_en->sirfsoc_rxd_brk_en;
+       if (sirfport->uart_reg->uart_type == SIRF_REAL_UART) {
+               if (termios->c_iflag & IGNPAR)
+--- a/drivers/tty/serial/st-asc.c
++++ b/drivers/tty/serial/st-asc.c
+@@ -547,7 +547,7 @@ static void asc_set_termios(struct uart_
+       ascport->port.read_status_mask = ASC_RXBUF_DUMMY_OE;
+       if (termios->c_iflag & INPCK)
+               ascport->port.read_status_mask |= ASC_RXBUF_FE | ASC_RXBUF_PE;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               ascport->port.read_status_mask |= ASC_RXBUF_DUMMY_BE;
+       /*
+--- a/drivers/tty/serial/sunsab.c
++++ b/drivers/tty/serial/sunsab.c
+@@ -719,7 +719,7 @@ static void sunsab_convert_to_sab(struct
+       if (iflag & INPCK)
+               up->port.read_status_mask |= (SAB82532_ISR0_PERR |
+                                             SAB82532_ISR0_FERR);
+-      if (iflag & (BRKINT | PARMRK))
++      if (iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= (SAB82532_ISR1_BRK << 8);
+       /*
+--- a/drivers/tty/serial/sunsu.c
++++ b/drivers/tty/serial/sunsu.c
+@@ -834,7 +834,7 @@ sunsu_change_speed(struct uart_port *por
+       up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+       if (iflag & INPCK)
+               up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+-      if (iflag & (BRKINT | PARMRK))
++      if (iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= UART_LSR_BI;
+       /*
+--- a/drivers/tty/serial/sunzilog.c
++++ b/drivers/tty/serial/sunzilog.c
+@@ -915,7 +915,7 @@ sunzilog_convert_to_zs(struct uart_sunzi
+       up->port.read_status_mask = Rx_OVR;
+       if (iflag & INPCK)
+               up->port.read_status_mask |= CRC_ERR | PAR_ERR;
+-      if (iflag & (BRKINT | PARMRK))
++      if (iflag & (IGNBRK | BRKINT | PARMRK))
+               up->port.read_status_mask |= BRK_ABRT;
+       up->port.ignore_status_mask = 0;
+--- a/drivers/tty/serial/ucc_uart.c
++++ b/drivers/tty/serial/ucc_uart.c
+@@ -936,7 +936,7 @@ static void qe_uart_set_termios(struct u
+       port->read_status_mask = BD_SC_EMPTY | BD_SC_OV;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= BD_SC_FR | BD_SC_PR;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= BD_SC_BR;
+       /*
+--- a/drivers/tty/serial/vr41xx_siu.c
++++ b/drivers/tty/serial/vr41xx_siu.c
+@@ -559,7 +559,7 @@ static void siu_set_termios(struct uart_
+       port->read_status_mask = UART_LSR_THRE | UART_LSR_OE | UART_LSR_DR;
+       if (c_iflag & INPCK)
+               port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
+-      if (c_iflag & (BRKINT | PARMRK))
++      if (c_iflag & (IGNBRK | BRKINT | PARMRK))
+               port->read_status_mask |= UART_LSR_BI;
+       port->ignore_status_mask = 0;
+--- a/drivers/tty/serial/zs.c
++++ b/drivers/tty/serial/zs.c
+@@ -923,7 +923,7 @@ static void zs_set_termios(struct uart_p
+       uport->read_status_mask = Rx_OVR;
+       if (termios->c_iflag & INPCK)
+               uport->read_status_mask |= FRM_ERR | PAR_ERR;
+-      if (termios->c_iflag & (BRKINT | PARMRK))
++      if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
+               uport->read_status_mask |= Rx_BRK;
+       uport->ignore_status_mask = 0;
index 3fc5d8aeaac85e60c9459cbf004cf81a4328be6b..b154ac9ad1b939589b48cd70617a091029cb0cda 100644 (file)
@@ -111,3 +111,10 @@ irqchip-spear_shirq-fix-interrupt-offset.patch
 arc-fix-build-breakage-for-config_arc_dw2_unwind.patch
 mlx4_core-fix-incorrect-flags1-bitmap-test-in-mlx4_query_func_cap.patch
 net-mlx4_core-keep-only-one-driver-entry-release-mlx4_priv.patch
+clk-qcom-fix-clk_rcg2_is_enabled-check.patch
+clk-qcom-fix-mmcc-8974-s-pll-configurations.patch
+serial-fix-ignbrk-handling.patch
+tty-correct-inpck-handling.patch
+netfilter-ctnetlink-fix-dumping-of-dying-unconfirmed-conntracks.patch
+netfilter-nf_nat-fix-oops-on-netns-removal.patch
+netfilter-ctnetlink-fix-refcnt-leak-in-dying-unconfirmed-list-dumper.patch
diff --git a/queue-3.15/tty-correct-inpck-handling.patch b/queue-3.15/tty-correct-inpck-handling.patch
new file mode 100644 (file)
index 0000000..ad6da0b
--- /dev/null
@@ -0,0 +1,63 @@
+From 66528f90669691c85c73bea4f0c9f4a5857c4cab Mon Sep 17 00:00:00 2001
+From: Peter Hurley <peter@hurleysoftware.com>
+Date: Mon, 16 Jun 2014 08:10:42 -0400
+Subject: tty: Correct INPCK handling
+
+From: Peter Hurley <peter@hurleysoftware.com>
+
+commit 66528f90669691c85c73bea4f0c9f4a5857c4cab upstream.
+
+If INPCK is not set, input parity detection should be disabled. This means
+parity errors should not be received from the tty driver, and the data
+received should be treated normally.
+
+SUS v3, 11.2.2, General Terminal Interface - Input Modes, states:
+  "If INPCK is set, input parity checking shall be enabled. If INPCK is
+   not set, input parity checking shall be disabled, allowing output parity
+   generation without input parity errors. Note that whether input parity
+   checking is enabled or disabled is independent of whether parity detection
+   is enabled or disabled (see Control Modes). If parity detection is enabled
+   but input parity checking is disabled, the hardware to which the terminal
+   is connected shall recognize the parity bit, but the terminal special file
+   shall not check whether or not this bit is correctly set."
+
+Ignore parity errors reported by the tty driver when INPCK is not set, and
+handle the received data normally.
+
+Fixes: Bugzilla #71681, 'Improvement of n_tty_receive_parity_error from n_tty.c'
+Reported-by: Ivan <athlon_@mail.ru>
+Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/n_tty.c |   19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+--- a/drivers/tty/n_tty.c
++++ b/drivers/tty/n_tty.c
+@@ -1214,15 +1214,16 @@ static void n_tty_receive_parity_error(s
+ {
+       struct n_tty_data *ldata = tty->disc_data;
+-      if (I_IGNPAR(tty))
+-              return;
+-      if (I_PARMRK(tty)) {
+-              put_tty_queue('\377', ldata);
+-              put_tty_queue('\0', ldata);
+-              put_tty_queue(c, ldata);
+-      } else  if (I_INPCK(tty))
+-              put_tty_queue('\0', ldata);
+-      else
++      if (I_INPCK(tty)) {
++              if (I_IGNPAR(tty))
++                      return;
++              if (I_PARMRK(tty)) {
++                      put_tty_queue('\377', ldata);
++                      put_tty_queue('\0', ldata);
++                      put_tty_queue(c, ldata);
++              } else
++                      put_tty_queue('\0', ldata);
++      } else
+               put_tty_queue(c, ldata);
+       if (waitqueue_active(&tty->read_wait))
+               wake_up_interruptible(&tty->read_wait);