From: Greg Kroah-Hartman Date: Wed, 28 Feb 2018 15:35:44 +0000 (+0100) Subject: Merge 4.4.119 into android-4.4 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e2c1313a4794efd28cd34e8c1ae668183254dfd7;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git Merge 4.4.119 into android-4.4 Changes in 4.4.119 netfilter: drop outermost socket lock in getsockopt() powerpc/64s: Fix RFI flush dependency on HARDLOCKUP_DETECTOR PCI: keystone: Fix interrupt-controller-node lookup ip_tunnel: replace dst_cache with generic implementation ip_tunnel: fix preempt warning in ip tunnel creation/updating scsi: ibmvfc: fix misdefined reserved field in ibmvfc_fcp_rsp_info cfg80211: fix cfg80211_beacon_dup iio: buffer: check if a buffer has been set up when poll is called iio: adis_lib: Initialize trigger before requesting interrupt x86/oprofile: Fix bogus GCC-8 warning in nmi_setup() irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq() usb: ohci: Proper handling of ed_rm_list to handle race condition between usb_kill_urb() and finish_unlinks() arm64: Disable unhandled signal log messages by default Add delay-init quirk for Corsair K70 RGB keyboards drm/edid: Add 6 bpc quirk for CPT panel in Asus UX303LA usb: dwc3: gadget: Set maxpacket size for ep0 IN usb: ldusb: add PIDs for new CASSY devices supported by this driver usb: gadget: f_fs: Process all descriptors during bind usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path drm/amdgpu: Avoid leaking PM domain on driver unbind (v2) binder: add missing binder_unlock() Linux 4.4.119 Change-Id: Ie2b40ffed3554beef8db7b0e41d2a17d12f1a12c Signed-off-by: Greg Kroah-Hartman --- e2c1313a4794efd28cd34e8c1ae668183254dfd7 diff --cc drivers/android/binder.c index 7286cf9a726b,260ce0e60187..9270da81939b --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@@ -4571,23 -2617,34 +4571,25 @@@ static unsigned int binder_poll(struct { struct binder_proc *proc = filp->private_data; struct binder_thread *thread = NULL; - int wait_for_proc_work; - - binder_lock(__func__); + bool wait_for_proc_work; thread = binder_get_thread(proc); - if (!thread) + if (!thread) { + binder_unlock(__func__); return POLLERR; + } - wait_for_proc_work = thread->transaction_stack == NULL && - list_empty(&thread->todo) && thread->return_error == BR_OK; + binder_inner_proc_lock(thread->proc); + thread->looper |= BINDER_LOOPER_STATE_POLL; + wait_for_proc_work = binder_available_for_proc_work_ilocked(thread); - binder_unlock(__func__); + binder_inner_proc_unlock(thread->proc); + + poll_wait(filp, &thread->wait, wait); + + if (binder_has_work(thread, wait_for_proc_work)) + return POLLIN; - if (wait_for_proc_work) { - if (binder_has_proc_work(proc, thread)) - return POLLIN; - poll_wait(filp, &proc->wait, wait); - if (binder_has_proc_work(proc, thread)) - return POLLIN; - } else { - if (binder_has_thread_work(thread)) - return POLLIN; - poll_wait(filp, &thread->wait, wait); - if (binder_has_thread_work(thread)) - return POLLIN; - } return 0; }