1. 01 7月, 2016 3 次提交
  2. 30 6月, 2016 13 次提交
  3. 29 6月, 2016 20 次提交
  4. 28 6月, 2016 4 次提交
    • A
      connector: fix out-of-order cn_proc netlink message delivery · ab8ed951
      Aaron Campbell 提交于
      The proc connector messages include a sequence number, allowing userspace
      programs to detect lost messages.  However, performing this detection is
      currently more difficult than necessary, since netlink messages can be
      delivered to the application out-of-order.  To fix this, leave pre-emption
      disabled during cn_netlink_send(), and use GFP_NOWAIT.
      
      The following was written as a test case.  Building the kernel w/ make -j32
      proved a reliable way to generate out-of-order cn_proc messages.
      
      int
      main(int argc, char *argv[])
      {
      	static uint32_t last_seq[CPU_SETSIZE], seq;
      	int cpu, fd;
      	struct sockaddr_nl sa;
      	struct __attribute__((aligned(NLMSG_ALIGNTO))) {
      		struct nlmsghdr nl_hdr;
      		struct __attribute__((__packed__)) {
      			struct cn_msg cn_msg;
      			struct proc_event cn_proc;
      		};
      	} rmsg;
      	struct __attribute__((aligned(NLMSG_ALIGNTO))) {
      		struct nlmsghdr nl_hdr;
      		struct __attribute__((__packed__)) {
      			struct cn_msg cn_msg;
      			enum proc_cn_mcast_op cn_mcast;
      		};
      	} smsg;
      
      	fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
      	if (fd < 0) {
      		perror("socket");
      	}
      
      	sa.nl_family = AF_NETLINK;
      	sa.nl_groups = CN_IDX_PROC;
      	sa.nl_pid = getpid();
      	if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
      		perror("bind");
      	}
      
      	memset(&smsg, 0, sizeof(smsg));
      	smsg.nl_hdr.nlmsg_len = sizeof(smsg);
      	smsg.nl_hdr.nlmsg_pid = getpid();
      	smsg.nl_hdr.nlmsg_type = NLMSG_DONE;
      	smsg.cn_msg.id.idx = CN_IDX_PROC;
      	smsg.cn_msg.id.val = CN_VAL_PROC;
      	smsg.cn_msg.len = sizeof(enum proc_cn_mcast_op);
      	smsg.cn_mcast = PROC_CN_MCAST_LISTEN;
      	if (send(fd, &smsg, sizeof(smsg), 0) != sizeof(smsg)) {
      		perror("send");
      	}
      
      	while (recv(fd, &rmsg, sizeof(rmsg), 0) == sizeof(rmsg)) {
      		cpu = rmsg.cn_proc.cpu;
      		if (cpu < 0) {
      			continue;
      		}
      		seq = rmsg.cn_msg.seq;
      		if ((last_seq[cpu] != 0) && (seq != last_seq[cpu] + 1)) {
      			printf("out-of-order seq=%d on cpu=%d\n", seq, cpu);
      		}
      		last_seq[cpu] = seq;
      	}
      
      	/* NOTREACHED */
      
      	perror("recv");
      
      	return -1;
      }
      Signed-off-by: NAaron Campbell <aaron@monkey.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab8ed951
    • A
      HID: multitouch: enable palm rejection for Windows Precision Touchpad · 6dd2e27a
      Allen Hung 提交于
      The usage Confidence is mandary to Windows Precision Touchpad devices. If
      it is examined in input_mapping on a WIndows Precision Touchpad, a new add
      quirk MT_QUIRK_CONFIDENCE desgned for such devices will be applied to the
      device. A touch with the confidence bit is not set is determined as
      invalid.
      
      Tested on Dell XPS13 9343
      
      Cc: stable@vger.kernel.org # v4.5+
      Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Tested-by: Andy Lutomirski <luto@kernel.org> # XPS 13 9350, BIOS 1.4.3
      Signed-off-by: NAllen Hung <allen_hung@dell.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      6dd2e27a
    • A
      Revert "HID: multitouch: enable palm rejection if device implements confidence usage" · 62630ea7
      Allen Hung 提交于
      This reverts commit 25a84db1 ("HID: multitouch: enable palm rejection
      if device implements confidence usage")
      
      The commit enables palm rejection for Win8 Precision Touchpad devices but
      the quirk MT_QUIRK_VALID_IS_CONFIDENCE it is using is not working very
      properly. This quirk is originally designed for some WIn7 touchscreens. Use
      of this for a Win8 Precision Touchpad will cause unexpected pointer jumping
      problem.
      
      Cc: stable@vger.kernel.org # v4.5+
      Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Tested-by: Andy Lutomirski <luto@kernel.org> # XPS 13 9350, BIOS 1.4.3
      Signed-off-by: NAllen Hung <allen_hung@dell.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      62630ea7
    • W
      net/mlx5: use mlx5_buf_alloc_node instead of mlx5_buf_alloc in mlx5_wq_ll_create · f299a02d
      Wang Sheng-Hui 提交于
      Commit 311c7c71 ("net/mlx5e: Allocate DMA coherent memory on
      reader NUMA node") introduced mlx5_*_alloc_node() but missed changing
      some calling and warn messages. This patch introduces 2 changes:
      	* Use mlx5_buf_alloc_node() instead of mlx5_buf_alloc() in
      	  mlx5_wq_ll_create()
      	* Update the failure warn messages with _node postfix for
      	  mlx5_*_alloc function names
      
      Fixes: 311c7c71 ("net/mlx5e: Allocate DMA coherent memory on reader NUMA node")
      Signed-off-by: NWang Sheng-Hui <shhuiw@foxmail.com>
      Acked-By: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f299a02d