1. 02 Oct, 2012 40 commits
    • Eric Dumazet's avatar
      drop_monitor: dont sleep in atomic context · 81cee4e9
      Eric Dumazet authored
      commit bec4596b upstream.
      
      drop_monitor calls several sleeping functions while in atomic context.
      
       BUG: sleeping function called from invalid context at mm/slub.c:943
       in_atomic(): 1, irqs_disabled(): 0, pid: 2103, name: kworker/0:2
       Pid: 2103, comm: kworker/0:2 Not tainted 3.5.0-rc1+ #55
       Call Trace:
        [<ffffffff810697ca>] __might_sleep+0xca/0xf0
        [<ffffffff811345a3>] kmem_cache_alloc_node+0x1b3/0x1c0
        [<ffffffff8105578c>] ? queue_delayed_work_on+0x11c/0x130
        [<ffffffff815343fb>] __alloc_skb+0x4b/0x230
        [<ffffffffa00b0360>] ? reset_per_cpu_data+0x160/0x160 [drop_monitor]
        [<ffffffffa00b022f>] reset_per_cpu_data+0x2f/0x160 [drop_monitor]
        [<ffffffffa00b03ab>] send_dm_alert+0x4b/0xb0 [drop_monitor]
        [<ffffffff810568e0>] process_one_work+0x130/0x4c0
        [<ffffffff81058249>] worker_thread+0x159/0x360
        [<ffffffff810580f0>] ? manage_workers.isra.27+0x240/0x240
        [<ffffffff8105d403>] kthread+0x93/0xa0
        [<ffffffff816be6d4>] kernel_thread_helper+0x4/0x10
        [<ffffffff8105d370>] ? kthread_freezable_should_stop+0x80/0x80
        [<ffffffff816be6d0>] ? gs_change+0xb/0xb
      
      Rework the logic to call the sleeping functions in right context.
      
      Use standard timer/workqueue api to let system chose any cpu to perform
      the allocation and netlink send.
      
      Also avoid a loop if reset_per_cpu_data() cannot allocate memory :
      use mod_timer() to wait 1/10 second before next try.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Reviewed-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      81cee4e9
    • Neil Horman's avatar
      drop_monitor: prevent init path from scheduling on the wrong cpu · 2c51de7f
      Neil Horman authored
      commit 4fdcfa12 upstream.
      
      I just noticed after some recent updates, that the init path for the drop
      monitor protocol has a minor error.  drop monitor maintains a per cpu structure,
      that gets initalized from a single cpu.  Normally this is fine, as the protocol
      isn't in use yet, but I recently made a change that causes a failed skb
      allocation to reschedule itself .  Given the current code, the implication is
      that this workqueue reschedule will take place on the wrong cpu.  If drop
      monitor is used early during the boot process, its possible that two cpus will
      access a single per-cpu structure in parallel, possibly leading to data
      corruption.
      
      This patch fixes the situation, by storing the cpu number that a given instance
      of this per-cpu data should be accessed from.  In the case of a need for a
      reschedule, the cpu stored in the struct is assigned the rescheule, rather than
      the currently executing cpu
      
      Tested successfully by myself.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c51de7f
    • Neil Horman's avatar
      drop_monitor: Make updating data->skb smp safe · b2f89a7c
      Neil Horman authored
      commit 3885ca78 upstream.
      
      Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
      its smp protections.  Specifically, its possible to replace data->skb while its
      being written.  This patch corrects that by making data->skb an rcu protected
      variable.  That will prevent it from being overwritten while a tracepoint is
      modifying it.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: David Miller <davem@davemloft.net>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2f89a7c
    • Neil Horman's avatar
      drop_monitor: fix sleeping in invalid context warning · 34c0bc42
      Neil Horman authored
      commit cde2e9a6 upstream.
      
      Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
      
      [   38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
      [   38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
      [   38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
      [   38.352582] Call Trace:
      [   38.352592]  [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
      [   38.352599]  [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
      [   38.352606]  [<ffffffff81655b16>] mutex_lock+0x26/0x50
      [   38.352610]  [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
      [   38.352616]  [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
      [   38.352621]  [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
      [   38.352625]  [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
      [   38.352630]  [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
      [   38.352636]  [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
      [   38.352640]  [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
      [   38.352645]  [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
      [   38.352649]  [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
      [   38.352653]  [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
      [   38.352658]  [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
      [   38.352663]  [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
      [   38.352668]  [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
      [   38.352673]  [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
      [   38.352677]  [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
      [   38.352682]  [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
      [   38.352687]  [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
      [   38.352693]  [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
      [   38.352699]  [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
      [   38.352703]  [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
      [   38.352708]  [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
      [   38.352713]  [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
      
      It stems from holding a spinlock (trace_state_lock) while attempting to register
      or unregister tracepoint hooks, making in_atomic() true in this context, leading
      to the warning when the tracepoint calls might_sleep() while its taking a mutex.
      Since we only use the trace_state_lock to prevent trace protocol state races, as
      well as hardware stat list updates on an rcu write side, we can just convert the
      spinlock to a mutex to avoid this problem.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Reported-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: David Miller <davem@davemloft.net>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      34c0bc42
    • Jarod Wilson's avatar
      media: lirc_sir: make device registration work · ae04311e
      Jarod Wilson authored
      commit 4b71ca6b upstream.
      
      For one, the driver device pointer needs to be filled in, or the lirc core
      will refuse to load the driver. And we really need to wire up all the
      platform_device bits. This has been tested via the lirc sourceforge tree
      and verified to work, been sitting there for months, finally getting
      around to sending it. :\
      Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      CC: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ae04311e
    • Peter Zijlstra's avatar
      sched: Fix race in task_group() · 64ac72f8
      Peter Zijlstra authored
      commit 8323f26c upstream.
      
      Stefan reported a crash on a kernel before a3e5d109 ("sched:
      Don't call task_group() too many times in set_task_rq()"), he
      found the reason to be that the multiple task_group()
      invocations in set_task_rq() returned different values.
      
      Looking at all that I found a lack of serialization and plain
      wrong comments.
      
      The below tries to fix it using an extra pointer which is
      updated under the appropriate scheduler locks. Its not pretty,
      but I can't really see another way given how all the cgroup
      stuff works.
      Reported-and-tested-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1340364965.18025.71.camel@twinsSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64ac72f8
    • Thomas Renninger's avatar
      cpufreq / ACPI: Fix not loading acpi-cpufreq driver regression · cf0a7166
      Thomas Renninger authored
      commit c4686c71 upstream.
      
      Commit d640113f introduced a regression on SMP
      systems where the processor core with ACPI id zero is disabled
      (typically should be the case because of hyperthreading).
      The regression got spread through stable kernels.
      On 3.0.X it got introduced via 3.0.18.
      
      Such platforms may be rare, but do exist.
      Look out for a disabled processor with acpi_id 0 in dmesg:
      ACPI: LAPIC (acpi_id[0x00] lapic_id[0x10] disabled)
      
      This problem has been observed on a:
      HP Proliant BL280c G6 blade
      
      This patch restricts the introduced workaround to platforms
      with nr_cpu_ids <= 1.
      Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cf0a7166
    • Daniel J Blueman's avatar
      libata: Prevent interface errors with Seagate FreeAgent GoFlex · 894682fd
      Daniel J Blueman authored
      commit c531077f upstream.
      
      When using my Seagate FreeAgent GoFlex eSATAp external disk enclosure,
      interface errors are always seen until 1.5Gbps is negotiated [1]. This
      occurs using any disk in the enclosure, and when the disk is connected
      directly with a generic passive eSATAp cable, we see stable 3Gbps
      operation as expected.
      
      Blacklist 3Gbps mode to avoid dataloss and the ~30s delay bus reset
      and renegotiation incurs.
      Signed-off-by: default avatarDaniel J Blueman <daniel@quora.org>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      894682fd
    • Weiping Pan's avatar
      rds: set correct msg_namelen · 25dee10e
      Weiping Pan authored
      commit 06b6a1cf upstream.
      
      Jay Fenlason (fenlason@redhat.com) found a bug,
      that recvfrom() on an RDS socket can return the contents of random kernel
      memory to userspace if it was called with a address length larger than
      sizeof(struct sockaddr_in).
      rds_recvmsg() also fails to set the addr_len paramater properly before
      returning, but that's just a bug.
      There are also a number of cases wher recvfrom() can return an entirely bogus
      address. Anything in rds_recvmsg() that returns a non-negative value but does
      not go through the "sin = (struct sockaddr_in *)msg->msg_name;" code path
      at the end of the while(1) loop will return up to 128 bytes of kernel memory
      to userspace.
      
      And I write two test programs to reproduce this bug, you will see that in
      rds_server, fromAddr will be overwritten and the following sock_fd will be
      destroyed.
      Yes, it is the programmer's fault to set msg_namelen incorrectly, but it is
      better to make the kernel copy the real length of address to user space in
      such case.
      
      How to run the test programs ?
      I test them on 32bit x86 system, 3.5.0-rc7.
      
      1 compile
      gcc -o rds_client rds_client.c
      gcc -o rds_server rds_server.c
      
      2 run ./rds_server on one console
      
      3 run ./rds_client on another console
      
      4 you will see something like:
      server is waiting to receive data...
      old socket fd=3
      server received data from client:data from client
      msg.msg_namelen=32
      new socket fd=-1067277685
      sendmsg()
      : Bad file descriptor
      
      /***************** rds_client.c ********************/
      
      int main(void)
      {
      	int sock_fd;
      	struct sockaddr_in serverAddr;
      	struct sockaddr_in toAddr;
      	char recvBuffer[128] = "data from client";
      	struct msghdr msg;
      	struct iovec iov;
      
      	sock_fd = socket(AF_RDS, SOCK_SEQPACKET, 0);
      	if (sock_fd < 0) {
      		perror("create socket error\n");
      		exit(1);
      	}
      
      	memset(&serverAddr, 0, sizeof(serverAddr));
      	serverAddr.sin_family = AF_INET;
      	serverAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
      	serverAddr.sin_port = htons(4001);
      
      	if (bind(sock_fd, (struct sockaddr*)&serverAddr, sizeof(serverAddr)) < 0) {
      		perror("bind() error\n");
      		close(sock_fd);
      		exit(1);
      	}
      
      	memset(&toAddr, 0, sizeof(toAddr));
      	toAddr.sin_family = AF_INET;
      	toAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
      	toAddr.sin_port = htons(4000);
      	msg.msg_name = &toAddr;
      	msg.msg_namelen = sizeof(toAddr);
      	msg.msg_iov = &iov;
      	msg.msg_iovlen = 1;
      	msg.msg_iov->iov_base = recvBuffer;
      	msg.msg_iov->iov_len = strlen(recvBuffer) + 1;
      	msg.msg_control = 0;
      	msg.msg_controllen = 0;
      	msg.msg_flags = 0;
      
      	if (sendmsg(sock_fd, &msg, 0) == -1) {
      		perror("sendto() error\n");
      		close(sock_fd);
      		exit(1);
      	}
      
      	printf("client send data:%s\n", recvBuffer);
      
      	memset(recvBuffer, '\0', 128);
      
      	msg.msg_name = &toAddr;
      	msg.msg_namelen = sizeof(toAddr);
      	msg.msg_iov = &iov;
      	msg.msg_iovlen = 1;
      	msg.msg_iov->iov_base = recvBuffer;
      	msg.msg_iov->iov_len = 128;
      	msg.msg_control = 0;
      	msg.msg_controllen = 0;
      	msg.msg_flags = 0;
      	if (recvmsg(sock_fd, &msg, 0) == -1) {
      		perror("recvmsg() error\n");
      		close(sock_fd);
      		exit(1);
      	}
      
      	printf("receive data from server:%s\n", recvBuffer);
      
      	close(sock_fd);
      
      	return 0;
      }
      
      /***************** rds_server.c ********************/
      
      int main(void)
      {
      	struct sockaddr_in fromAddr;
      	int sock_fd;
      	struct sockaddr_in serverAddr;
      	unsigned int addrLen;
      	char recvBuffer[128];
      	struct msghdr msg;
      	struct iovec iov;
      
      	sock_fd = socket(AF_RDS, SOCK_SEQPACKET, 0);
      	if(sock_fd < 0) {
      		perror("create socket error\n");
      		exit(0);
      	}
      
      	memset(&serverAddr, 0, sizeof(serverAddr));
      	serverAddr.sin_family = AF_INET;
      	serverAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
      	serverAddr.sin_port = htons(4000);
      	if (bind(sock_fd, (struct sockaddr*)&serverAddr, sizeof(serverAddr)) < 0) {
      		perror("bind error\n");
      		close(sock_fd);
      		exit(1);
      	}
      
      	printf("server is waiting to receive data...\n");
      	msg.msg_name = &fromAddr;
      
      	/*
      	 * I add 16 to sizeof(fromAddr), ie 32,
      	 * and pay attention to the definition of fromAddr,
      	 * recvmsg() will overwrite sock_fd,
      	 * since kernel will copy 32 bytes to userspace.
      	 *
      	 * If you just use sizeof(fromAddr), it works fine.
      	 * */
      	msg.msg_namelen = sizeof(fromAddr) + 16;
      	/* msg.msg_namelen = sizeof(fromAddr); */
      	msg.msg_iov = &iov;
      	msg.msg_iovlen = 1;
      	msg.msg_iov->iov_base = recvBuffer;
      	msg.msg_iov->iov_len = 128;
      	msg.msg_control = 0;
      	msg.msg_controllen = 0;
      	msg.msg_flags = 0;
      
      	while (1) {
      		printf("old socket fd=%d\n", sock_fd);
      		if (recvmsg(sock_fd, &msg, 0) == -1) {
      			perror("recvmsg() error\n");
      			close(sock_fd);
      			exit(1);
      		}
      		printf("server received data from client:%s\n", recvBuffer);
      		printf("msg.msg_namelen=%d\n", msg.msg_namelen);
      		printf("new socket fd=%d\n", sock_fd);
      		strcat(recvBuffer, "--data from server");
      		if (sendmsg(sock_fd, &msg, 0) == -1) {
      			perror("sendmsg()\n");
      			close(sock_fd);
      			exit(1);
      		}
      	}
      
      	close(sock_fd);
      	return 0;
      }
      Signed-off-by: default avatarWeiping Pan <wpan@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      25dee10e
    • Li Zhong's avatar
      Fix a dead loop in async_synchronize_full() · 45516ddc
      Li Zhong authored
      [Fixed upstream by commits 2955b47d and
      a4683487 from Dan Williams, but they are much
      more intrusive than this tiny fix, according to Andrew - gregkh]
      
      This patch tries to fix a dead loop in  async_synchronize_full(), which
      could be seen when preemption is disabled on a single cpu machine. 
      
      void async_synchronize_full(void)
      {
              do {
                      async_synchronize_cookie(next_cookie);
              } while (!list_empty(&async_running) || !
      list_empty(&async_pending));
      }
      
      async_synchronize_cookie() calls async_synchronize_cookie_domain() with
      &async_running as the default domain to synchronize. 
      
      However, there might be some works in the async_pending list from other
      domains. On a single cpu system, without preemption, there is no chance
      for the other works to finish, so async_synchronize_full() enters a dead
      loop. 
      
      It seems async_synchronize_full() wants to synchronize all entries in
      all running lists(domains), so maybe we could just check the entry_count
      to know whether all works are finished. 
      
      Currently, async_synchronize_cookie_domain() expects a non-NULL running
      list ( if NULL, there would be NULL pointer dereference ), so maybe a
      NULL pointer could be used as an indication for the functions to
      synchronize all works in all domains. 
      Reported-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarLi Zhong <zhong@linux.vnet.ibm.com>
      Tested-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Tested-by: default avatarChristian Kujau <lists@nerdbynature.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dan Williams <dan.j.williams@gmail.com>
      Cc: Christian Kujau <lists@nerdbynature.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45516ddc
    • Rustad, Mark D's avatar
      net: Statically initialize init_net.dev_base_head · b64295e8
      Rustad, Mark D authored
      commit 734b6541 upstream.
      
      This change eliminates an initialization-order hazard most
      recently seen when netprio_cgroup is built into the kernel.
      
      With thanks to Eric Dumazet for catching a bug.
      Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b64295e8
    • Henrik Rydberg's avatar
      Bluetooth: Add support for Apple vendor-specific devices · 41ed10ac
      Henrik Rydberg authored
      commit 1fa6535f upstream.
      
      As pointed out by Gustavo and Marcel, all Apple-specific Broadcom
      devices seen so far have the same interface class, subclass and
      protocol numbers. This patch adds an entry which matches all of them,
      using the new USB_VENDOR_AND_INTERFACE_INFO() macro.
      
      In particular, this patch adds support for the MacBook Pro Retina
      (05ac:8286), which is not in the present list.
      Signed-off-by: default avatarHenrik Rydberg <rydberg@euromail.se>
      Tested-by: default avatarShea Levy <shea@shealevy.com>
      Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      41ed10ac
    • Gustavo Padovan's avatar
      Bluetooth: Use USB_VENDOR_AND_INTERFACE() for Broadcom devices · 4d94c8ce
      Gustavo Padovan authored
      commit 92c385f4 upstream.
      
      Many Broadcom devices has a vendor specific devices class, with this rule
      we match all existent and future controllers with this behavior.
      
      We also remove old rules to that matches product id for Broadcom devices.
      Tested-by: default avatarJohn Hommel <john.hommel@hp.com>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4d94c8ce
    • Manoj Iyer's avatar
      Bluetooth: btusb: Add vendor specific ID (0a5c:21f4) BCM20702A0 · d10d2f0a
      Manoj Iyer authored
      commit 61c964ba upstream.
      
      Patch adds support for BCM20702A0 device id (0a5c:21f4).
      
      usb-devices after patch was applied:
      T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
      D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
      P: Vendor=0a5c ProdID=21f4 Rev=01.12
      S: Manufacturer=Broadcom Corp
      S: Product=BCM20702A0
      S: SerialNumber=E4D53DF154D6
      C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
      I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      
      usb-devices before patch was applied:
      T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
      D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
      P: Vendor=0a5c ProdID=21f4 Rev=01.12
      S: Manufacturer=Broadcom Corp
      S: Product=BCM20702A0
      S: SerialNumber=E4D53DF154D6
      C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
      I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      Signed-off-by: default avatarManoj Iyer <manoj.iyer@canonical.com>
      Tested-by: default avatarChris Gagnon <chris.gagnon@canonical.com>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d10d2f0a
    • Alan Cox's avatar
      x86: Fix boot on Twinhead H12Y · b69eba70
      Alan Cox authored
      commit 80b3e557 upstream.
      
      Despite lots of investigation into why this is needed we don't
      know or have an elegant cure. The only answer found on this
      laptop is to mark a problem region as used so that Linux doesn't
      put anything there.
      
      Currently all the users add reserve= command lines and anyone
      not knowing this needs to find the magic page that documents it.
      Automate it instead.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Tested-and-bugfixed-by: default avatarArne Fitzenreiter <arne@fitzenreiter.de>
      Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=10231
      Link: http://lkml.kernel.org/r/20120515174347.5109.94551.stgit@bluebookSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b69eba70
    • Lai Jiangshan's avatar
      workqueue: UNBOUND -> REBIND morphing in rebind_workers() should be atomic · bc713e26
      Lai Jiangshan authored
      commit 96e65306 upstream.
      
      The compiler may compile the following code into TWO write/modify
      instructions.
      
      	worker->flags &= ~WORKER_UNBOUND;
      	worker->flags |= WORKER_REBIND;
      
      so the other CPU may temporarily see worker->flags which doesn't have
      either WORKER_UNBOUND or WORKER_REBIND set and perform local wakeup
      prematurely.
      
      Fix it by using single explicit assignment via ACCESS_ONCE().
      
      Because idle workers have another WORKER_NOT_RUNNING flag, this bug
      doesn't exist for them; however, update it to use the same pattern for
      consistency.
      
      tj: Applied the change to idle workers too and updated comments and
          patch description a bit.
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bc713e26
    • Wang Xingchao's avatar
      drm/i915: HDMI - Clear Audio Enable bit for Hot Plug · e2471ec3
      Wang Xingchao authored
      commit b98b6016 upstream.
      
      Clear Audio Enable bit to trigger unsolicated event to notify Audio
      Driver part the HDMI hot plug change. The patch fixed the bug when
      remove HDMI cable the bit was not cleared correctly.
      
      In intel_hdmi_dpms(), if intel_hdmi->has_audio been true, the "Audio enable bit" will
      be set to trigger unsolicated event to notify Alsa driver the change.
      
      intel_hdmi->has_audio will be reset to false from intel_hdmi_detect() after
      remove the hdmi cable, here's debug log:
      
      [  187.494153] [drm:output_poll_execute], [CONNECTOR:17:HDMI-A-1] status updated from 1 to 2
      [  187.525349] [drm:intel_hdmi_detect], HDMI: has_audio = 0
      
      so when comes back to intel_hdmi_dpms(), the "Audio enable bit" will not be cleared. And this
      cause the eld infomation and pin presence doesnot update accordingly in alsa driver side.
      
      This patch will also trigger unsolicated event to alsa driver to notify the hot plug event:
      
      [  187.853159] ALSA sound/pci/hda/patch_hdmi.c:772 HDMI hot plug event: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=1
      [  187.853268] ALSA sound/pci/hda/patch_hdmi.c:990 HDMI status: Codec=3 Pin=5 Presence_Detect=0 ELD_Valid=0
      Signed-off-by: default avatarWang Xingchao <xingchao.wang@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2471ec3
    • AceLan Kao's avatar
      asus-nb-wmi: add some video toggle keys · 7693ca13
      AceLan Kao authored
      commit 3766054f upstream.
      
      There are some new video switch keys that used by newer machines.
      0xA0 - SDSP HDMI only
      0xA1 - SDSP LCD + HDMI
      0xA2 - SDSP CRT + HDMI
      0xA3 - SDSP TV + HDMI
      But in Linux, there is no suitable userspace application to handle this,
      so, mapping them all to KEY_SWITCHVIDEOMODE.
      Signed-off-by: default avatarAceLan Kao <acelan.kao@canonical.com>
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      Cc: Tim Gardner <tim.gardner@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7693ca13
    • Corentin Chary's avatar
    • Tvrtko Ursulin's avatar
      drm/radeon/kms: extend the Fujitsu D3003-S2 board connector quirk to cover later silicon stepping · 062a59ee
      Tvrtko Ursulin authored
      commit 52e9b39d upstream.
      
      There is a more recent APU stepping with a new PCI ID
      shipping in the same board by Fujitsu which needs the
      same quirk to correctly mark the back plane connectors.
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      062a59ee
    • Dave Airlie's avatar
      fbcon: fix race condition between console lock and cursor timer (v1.1) · eafd7bd3
      Dave Airlie authored
      commit d8636a27 upstream.
      
      So we've had a fair few reports of fbcon handover breakage between
      efi/vesafb and i915 surface recently, so I dedicated a couple of
      days to finding the problem.
      
      Essentially the last thing we saw was the conflicting framebuffer
      message and that was all.
      
      So after much tracing with direct netconsole writes (printks
      under console_lock not so useful), I think I found the race.
      
      Thread A (driver load)    Thread B (timer thread)
        unbind_con_driver ->              |
        bind_con_driver ->                |
        vc->vc_sw->con_deinit ->          |
        fbcon_deinit ->                   |
        console_lock()                    |
            |                             |
            |                       fbcon_flashcursor timer fires
            |                       console_lock() <- blocked for A
            |
            |
      fbcon_del_cursor_timer ->
        del_timer_sync
        (BOOM)
      
      Of course because all of this is under the console lock,
      we never see anything, also since we also just unbound the active
      console guess what we never see anything.
      
      Hopefully this fixes the problem for anyone seeing vesafb->kms
      driver handoff.
      
      v1.1: add comment suggestion from Alan.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
      Tested-by: default avatarJosh Boyer <jwboyer@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eafd7bd3
    • Robin Holt's avatar
      drivers/misc/sgi-xp/xpc_uv.c: SGI XPC fails to load when cpu 0 is out of IRQ resources · 9b3746b3
      Robin Holt authored
      commit 7838f994 upstream.
      
      On many of our larger systems, CPU 0 has had all of its IRQ resources
      consumed before XPC loads.  Worst cases on machines with multiple 10
      GigE cards and multiple IB cards have depleted the entire first socket
      of IRQs.
      
      This patch makes selecting the node upon which IRQs are allocated (as
      well as all the other GRU Message Queue structures) specifiable as a
      module load param and has a default behavior of searching all nodes/cpus
      for an available resources.
      
      [akpm@linux-foundation.org: fix build: include cpu.h and module.h]
      Signed-off-by: default avatarRobin Holt <holt@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b3746b3
    • Rafael J. Wysocki's avatar
      PM / Runtime: Clear power.deferred_resume on success in rpm_suspend() · d6163c4d
      Rafael J. Wysocki authored
      commit 58a34de7 upstream.
      
      The power.deferred_resume can only be set if the runtime PM status
      of device is RPM_SUSPENDING and it should be cleared after its
      status has been changed, regardless of whether or not the runtime
      suspend has been successful.  However, it only is cleared on
      suspend failure, while it may remain set on successful suspend and
      is happily leaked to rpm_resume() executed in that case.
      
      That shouldn't happen, so if power.deferred_resume is set in
      rpm_suspend() after the status has been changed to RPM_SUSPENDED,
      clear it before calling rpm_resume().  Then, it doesn't need to be
      cleared before changing the status to RPM_SUSPENDING any more,
      because it's always cleared after the status has been changed to
      either RPM_SUSPENDED (on success) or RPM_ACTIVE (on failure).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6163c4d
    • Rafael J. Wysocki's avatar
      PM / Runtime: Fix rpm_resume() return value for power.no_callbacks set · 5af14b89
      Rafael J. Wysocki authored
      commit 7f321c26 upstream.
      
      For devices whose power.no_callbacks flag is set, rpm_resume()
      should return 1 if the device's parent is already active, so that
      the callers of pm_runtime_get() don't think that they have to wait
      for the device to resume (asynchronously) in that case (the core
      won't queue up an asynchronous resume in that case, so there's
      nothing to wait for anyway).
      
      Modify the code accordingly (and make sure that an idle notification
      will be queued up on success, even if 1 is to be returned).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5af14b89
    • Atsushi Nemoto's avatar
      drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode · f20560e8
      Atsushi Nemoto authored
      commit 7dbfb315 upstream.
      
      Correct the offset by subtracting 20 from tm_hour before taking the
      modulo 12.
      
      [ "Why 20?" I hear you ask. Or at least I did.
      
        Here's the reason why: RS5C348_BIT_PM is 32, and is - stupidly -
        included in the RS5C348_HOURS_MASK define.  So it's really subtracting
        out that bit to get "hour+12".  But then because it does things modulo
        12, it needs to add the 12 in again afterwards anyway.
      
        This code is confused.  It would be much clearer if RS5C348_HOURS_MASK
        just didn't include the RS5C348_BIT_PM bit at all, then it wouldn't
        need to do the silly subtract either.
      
        Whatever. It's all just math, the end result is the same.   - Linus ]
      Reported-by: default avatarJames Nute <newten82@gmail.com>
      Tested-by: default avatarJames Nute <newten82@gmail.com>
      Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f20560e8
    • Will Deacon's avatar
      mutex: Place lock in contended state after fastpath_lock failure · d0179ca8
      Will Deacon authored
      commit 0bce9c46 upstream.
      
      ARM recently moved to asm-generic/mutex-xchg.h for its mutex
      implementation after the previous implementation was found to be missing
      some crucial memory barriers. However, this has revealed some problems
      running hackbench on SMP platforms due to the way in which the
      MUTEX_SPIN_ON_OWNER code operates.
      
      The symptoms are that a bunch of hackbench tasks are left waiting on an
      unlocked mutex and therefore never get woken up to claim it. This boils
      down to the following sequence of events:
      
              Task A        Task B        Task C        Lock value
      0                                                     1
      1       lock()                                        0
      2                     lock()                          0
      3                     spin(A)                         0
      4       unlock()                                      1
      5                                   lock()            0
      6                     cmpxchg(1,0)                    0
      7                     contended()                    -1
      8       lock()                                        0
      9       spin(C)                                       0
      10                                  unlock()          1
      11      cmpxchg(1,0)                                  0
      12      unlock()                                      1
      
      At this point, the lock is unlocked, but Task B is in an uninterruptible
      sleep with nobody to wake it up.
      
      This patch fixes the problem by ensuring we put the lock into the
      contended state if we fail to acquire it on the fastpath, ensuring that
      any blocked waiters are woken up when the mutex is released.
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Reviewed-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-6e9lrw2avczr0617fzl5vqb8@git.kernel.orgSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0179ca8
    • Sarah Sharp's avatar
      xhci: Fix bug after deq ptr set to link TRB. · e3439be1
      Sarah Sharp authored
      commit 50d0206f upstream.
      
      This patch fixes a particularly nasty bug that was revealed by the ring
      expansion patches.  The bug has been present since the very beginning of
      the xHCI driver history, and could have caused general protection faults
      from bad memory accesses.
      
      The first thing to note is that a Set TR Dequeue Pointer command can
      move the dequeue pointer to a link TRB, if the canceled or stalled
      transfer TD ended just before a link TRB.  The function to increment the
      dequeue pointer, inc_deq, was written before cancellation and stall
      support was added.  It assumed that the dequeue pointer could never
      point to a link TRB.  It would unconditionally increment the dequeue
      pointer at the start of the function, check if the pointer was now on a
      link TRB, and move it to the top of the next segment if so.
      
      This means that if a Set TR Dequeue Point command moved the dequeue
      pointer to a link TRB, a subsequent call to inc_deq() would move the
      pointer off the segment and into la-la-land.  It would then read from
      that memory to determine if it was a link TRB.  Other functions would
      often call inc_deq() until the dequeue pointer matched some other
      pointer, which means this function would quite happily read all of
      system memory before wrapping around to the right pointer value.
      
      Often, there would be another endpoint segment from a different ring
      allocated from the same DMA pool, which would be contiguous to the
      segment inc_deq just stepped off of.  inc_deq would eventually find the
      link TRB in that segment, and blindly move the dequeue pointer back to
      the top of the correct ring segment.
      
      The only reason the original code worked at all is because there was
      only one ring segment.  With the ring expansion patches, the dequeue
      pointer would eventually wrap into place, but the dequeue segment would
      be out-of-sync.  On the second TD after the dequeue pointer was moved to
      a link TRB, trb_in_td() would fail (because the dequeue pointer and
      dequeue segment were out-of-sync), and this message would appear:
      
      ERROR Transfer event TRB DMA ptr not part of current TD
      
      This fixes bugzilla entry 4333 (option-based modem unhappy on USB 3.0
      port: "Transfer event TRB DMA ptr not part of current TD", "rejecting
      I/O to offline device"),
      
      	https://bugzilla.kernel.org/show_bug.cgi?id=43333
      
      and possibly other general protection fault bugs as well.
      
      This patch should be backported to kernels as old as 2.6.31.  A separate
      patch will be created for kernels older than 3.4, since inc_deq was
      modified in 3.4 and this patch will not apply.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: default avatarJames Ettle <theholyettlz@googlemail.com>
      Tested-by: default avatarMatthew Hall <mhall@mhcomputing.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3439be1
    • Moiz Sonasath's avatar
      usb: host: xhci: fix compilation error for non-PCI based stacks · d8ec66c5
      Moiz Sonasath authored
      commit 29636578 upstream.
      
      For non PCI-based stacks, this function call
      usb_disable_xhci_ports(to_pci_dev(hcd->self.controller));
      made from xhci_shutdown is not applicable.
      
      Ideally, we wouldn't have any PCI-specific code on
      a generic driver such as the xHCI stack, but it looks
      like we should just stub usb_disable_xhci_ports() out
      for non-PCI devices.
      
      [ balbi@ti.com: slight improvement to commit log ]
      
      This patch should be backported to kernels as old as 3.0, since the
      commit it fixes (e95829f4 "xhci: Switch
      PPT ports to EHCI on shutdown.") was marked for stable.
      
      Signed-off-by: Moiz Sonasath<m-sonasath@ti.com>
      Signed-off-by: default avatarRuchika Kharwar <ruchika@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d8ec66c5
    • Manoj Iyer's avatar
      xhci: Recognize USB 3.0 devices as superspeed at powerup · b1e81baa
      Manoj Iyer authored
      commit 29d21457 upstream.
      
      On Intel Panther Point chipset USB 3.0 devices show up as
      high-speed devices on powerup, but after an s3 cycle they are
      correctly recognized as SuperSpeed. At powerup switch the port
      to xHCI so that USB 3.0 devices are correctly recognized.
      
      BugLink: http://bugs.launchpad.net/bugs/1000424
      
      This patch should be backported to kernels as old as 3.0, that contain
      commit ID 69e848c2 "Intel xhci: Support
      EHCI/xHCI port switching."
      Signed-off-by: default avatarManoj Iyer <manoj.iyer@canonical.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1e81baa
    • Matthew Garrett's avatar
      xhci: Make handover code more robust · f78e6ad4
      Matthew Garrett authored
      commit e955a1cd upstream.
      
      My test platform (Intel DX79SI) boots reliably under BIOS, but frequently
      crashes when booting via UEFI. I finally tracked this down to the xhci
      handoff code. It seems that reads from the device occasionally just return
      0xff, resulting in xhci_find_next_cap_offset generating a value that's
      larger than the resource region. We then oops when attempting to read the
      value. Sanity checking that value lets us avoid the crash.
      
      I've no idea what's causing the underlying problem, and xhci still doesn't
      actually *work* even with this, but the machine at least boots which will
      probably make further debugging easier.
      
      This should be backported to kernels as old as 2.6.31, that contain the
      commit 66d4eadd "USB: xhci: BIOS handoff
      and HW initialization."
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f78e6ad4
    • Dan Carpenter's avatar
      xhci: Fix a logical vs bitwise AND bug · c0a168c0
      Dan Carpenter authored
      commit 052c7f9f upstream.
      
      The intent was to test whether the flag was set.
      
      This patch should be backported to stable kernels as old as 3.0, since
      it fixes a bug in commit e95829f4 "xhci:
      Switch PPT ports to EHCI on shutdown.", which was marked for stable.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0a168c0
    • Keng-Yu Lin's avatar
      Intel xhci: Only switch the switchable ports · 4a4c06b8
      Keng-Yu Lin authored
      commit a96874a2 upstream.
      
      With a previous patch to enable the EHCI/XHCI port switching, it switches
      all the available ports.
      
      The assumption is not correct because the BIOS may expect some ports
      not switchable by the OS.
      
      There are two more registers that contains the information of the switchable
      and non-switchable ports.
      
      This patch adds the checking code for the two register so that only the
      switchable ports are altered.
      
      This patch should be backported to kernels as old as 3.0, that contain
      commit ID 69e848c2 "Intel xhci: Support
      EHCI/xHCI port switching."
      Signed-off-by: default avatarKeng-Yu Lin <kengyu@canonical.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a4c06b8
    • Alan Stern's avatar
      USB: add device quirk for Joss Optical touchboard · d515ad3c
      Alan Stern authored
      commit 92fc7a8b upstream.
      
      This patch (as1604) adds a CONFIG_INTF_STRINGS quirk for the Joss
      infrared touchboard device.  The device doesn't like to be asked for
      its interface strings.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avataradam ? <adam3337@wp.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d515ad3c
    • Éric Piel's avatar
      USB: ftdi-sio: add support for more Physik Instrumente devices · 15e87566
      Éric Piel authored
      commit dafc4f7b upstream.
      
      Commit b69cc672 added support for the E-861.  After acquiring a C-867, I
      realised that every Physik Instrumente's device has a different PID. They are
      listed in the Windows device driver's .inf file. So here are all PIDs for the
      current (and probably future) USB devices from Physik Instrumente.
      
      Compiled, but only actually tested on the E-861 and C-867.
      Signed-off-by: default avatarÉric Piel <piel@delmic.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      15e87566
    • Bjørn Mork's avatar
      USB: ftdi_sio: do not claim CDC ACM function · 0c361a31
      Bjørn Mork authored
      commit f08dea73 upstream.
      
      The Microchip vid:pid 04d8:000a is used for their CDC ACM
      demo firmware application.  This is a device with a single
      function conforming to the CDC ACM specification and with
      the intention of demonstrating CDC ACM class firmware and
      driver interaction.  The demo is used on a number of
      development boards, and may also be used unmodified by
      vendors using Microchip hardware.
      
      Some vendors have re-used this vid:pid for other types of
      firmware, emulating FTDI chips. Attempting to continue to
      support such devices without breaking class based
      applications that by matching on interface
      class/subclass/proto being ff/ff/00.  I have no information
      about the actual device or interface descriptors, but this
      will at least make the proper CDC ACM devices work again.
      Anyone having details of the offending device's descriptors
      should update this entry with the details.
      Reported-by: default avatarFlorian Wöhrl <fw@woehrl.biz>
      Reported-by: default avatarXiaofan Chen <xiaofanc@gmail.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Bruno Thomsen <bruno.thomsen@gmail.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0c361a31
    • Horst Schirmeier's avatar
      USB: ftdi_sio: PID for NZR SEM 16+ USB · a16bd7c7
      Horst Schirmeier authored
      commit 26a538b9 upstream.
      
      This adds the USB PID for the NZR SEM 16+ USB energy monitor device
      <http://www.nzr.de>.  It works perfectly with the GPL software on
      <http://schou.dk/linux/sparometer/>.
      Signed-off-by: default avatarHorst Schirmeier <horst@schirmeier.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a16bd7c7
    • Pavankumar Kondeti's avatar
      EHCI: Update qTD next pointer in QH overlay region during unlink · ebf16a5b
      Pavankumar Kondeti authored
      commit 3d037774 upstream.
      
      There is a possibility of QH overlay region having reference to a stale
      qTD pointer during unlink.
      
      Consider an endpoint having two pending qTD before unlink process begins.
      The endpoint's QH queue looks like this.
      
      qTD1 --> qTD2 --> Dummy
      
      To unlink qTD2, QH is removed from asynchronous list and Asynchronous
      Advance Doorbell is programmed.  The qTD1's next qTD pointer is set to
      qTD2'2 next qTD pointer and qTD2 is retired upon controller's doorbell
      interrupt.  If QH's current qTD pointer points to qTD1, transfer overlay
      region still have reference to qTD2. But qtD2 is just unlinked and freed.
      This may cause EHCI system error.  Fix this by updating qTD next pointer
      in QH overlay region with the qTD next pointer of the current qTD.
      Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebf16a5b
    • Weston Andros Adamson's avatar
      NFS: return error from decode_getfh in decode open · 863f36bf
      Weston Andros Adamson authored
      commit 01913b49 upstream.
      
      If decode_getfh failed, nfs4_xdr_dec_open would return 0 since the last
      decode_* call must have succeeded.
      Signed-off-by: default avatarWeston Andros Adamson <dros@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      863f36bf
    • Trond Myklebust's avatar
      NFS: Fix a problem with the legacy binary mount code · d351ebe9
      Trond Myklebust authored
      commit 872ece86 upstream.
      
      Apparently, am-utils is still using the legacy binary mountdata interface,
      and is having trouble parsing /proc/mounts due to the 'port=' field being
      incorrectly set.
      
      The following patch should fix up the regression.
      Reported-by: default avatarMarius Tolzmann <tolzmann@molgen.mpg.de>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d351ebe9
    • Trond Myklebust's avatar
      NFS: Fix the initialisation of the readdir 'cookieverf' array · 839e17b7
      Trond Myklebust authored
      commit c3f52af3 upstream.
      
      When the NFS_COOKIEVERF helper macro was converted into a static
      inline function in commit 99fadcd7 (nfs: convert NFS_*(inode)
      helpers to static inline), we broke the initialisation of the
      readdir cookies, since that depended on doing a memset with an
      argument of 'sizeof(NFS_COOKIEVERF(inode))' which therefore
      changed from sizeof(be32 cookieverf[2]) to sizeof(be32 *).
      
      At this point, NFS_COOKIEVERF seems to be more of an obfuscation
      than a helper, so the best thing would be to just get rid of it.
      
      Also see: https://bugzilla.kernel.org/show_bug.cgi?id=46881Reported-by: default avatarAndi Kleen <andi@firstfloor.org>
      Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      839e17b7