android_kernel_oneplus_msm8998/drivers
Dmitry Safonov d93216e51e tty/ldsem: Wake up readers after timed out down_write()
commit 231f8fd0cca078bd4396dd7e380db813ac5736e2 upstream.

ldsem_down_read() will sleep if there is pending writer in the queue.
If the writer times out, readers in the queue should be woken up,
otherwise they may miss a chance to acquire the semaphore until the last
active reader will do ldsem_up_read().

There was a couple of reports where there was one active reader and
other readers soft locked up:
  Showing all locks held in the system:
  2 locks held by khungtaskd/17:
   #0:  (rcu_read_lock){......}, at: watchdog+0x124/0x6d1
   #1:  (tasklist_lock){.+.+..}, at: debug_show_all_locks+0x72/0x2d3
  2 locks held by askfirst/123:
   #0:  (&tty->ldisc_sem){.+.+.+}, at: ldsem_down_read+0x46/0x58
   #1:  (&ldata->atomic_read_lock){+.+...}, at: n_tty_read+0x115/0xbe4

Prevent readers wait for active readers to release ldisc semaphore.

Link: lkml.kernel.org/r/20171121132855.ajdv4k6swzhvktl6@wfg-t540p.sh.intel.com
Link: lkml.kernel.org/r/20180907045041.GF1110@shao2-debian
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-26 09:42:45 +01:00
..
accessibility
acpi ACPI: power: Skip duplicate power resource references in _PRx 2019-01-16 22:16:12 +01:00
amba ARM: amba: Don't read past the end of sysfs "driver_override" buffer 2018-05-02 07:53:42 -07:00
android binder: add missing binder_unlock() 2018-02-28 10:17:23 +01:00
ata libata: whitelist all SAMSUNG MZ7KM* solid-state disks 2018-12-21 14:09:53 +01:00
atm atm: zatm: Fix potential Spectre v1 2018-07-22 14:25:52 +02:00
auxdisplay
base PM / core: Clear the direct_complete flag on errors 2018-10-13 09:11:32 +02:00
bcma
block zram: close udev startup race condition as default groups 2018-11-27 16:08:01 +01:00
bluetooth Revert "Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV" 2018-11-27 16:08:01 +01:00
bus bus: brcmstb_gisb: correct support for 64-bit address output 2018-04-13 19:50:05 +02:00
cdrom cdrom: fix improper type cast, which can leat to information leak. 2018-11-21 09:27:39 +01:00
char tpm: Restore functionality to xen vtpm driver. 2018-11-21 09:27:33 +01:00
clk clk: mmp: Off by one in mmp_clk_add() 2018-12-21 14:09:53 +01:00
clocksource clockevents/drivers/i8253: Add support for PIT shutdown quirk 2018-11-21 09:27:42 +01:00
connector
cpufreq cpufreq: imx6q: add return value check for voltage scale 2018-12-01 09:46:34 +01:00
cpuidle cpuidle: powernv: Fix promotion from snooze if next state disabled 2018-07-03 11:21:29 +02:00
crypto crypto: mxs-dcp - Fix wait logic on chan threads 2018-10-10 08:52:13 +02:00
dca
devfreq PM / devfreq: tegra: fix error return code in tegra_devfreq_probe() 2018-11-10 07:41:40 -08:00
dio
dma dmaengine: at_hdmac: fix module unloading 2018-12-13 09:21:27 +01:00
dma-buf
edac EDAC, i7core: Fix memleaks and use-after-free on probe and remove 2018-10-10 08:52:06 +02:00
eisa
extcon
firewire firewire-ohci: work around oversized DMA reads on JMicron controllers 2018-05-30 07:48:52 +02:00
firmware efi/libstub/arm64: Set -fpie when building the EFI stub 2018-11-27 16:07:58 +01:00
fmc
fpga
gpio gpio: max7301: fix driver for use with CONFIG_VMAP_STACK 2019-01-13 10:05:27 +01:00
gpu drm/ioctl: Fix Spectre v1 vulnerabilities 2019-01-13 10:05:27 +01:00
hid HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges 2018-11-27 16:08:02 +01:00
hsi HSI: ssi_protocol: double free in ssip_pn_xmit() 2018-03-24 10:58:42 +01:00
hv Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels 2019-01-13 10:05:27 +01:00
hwmon hwmon: (w83795) temp4_type has writable permission 2018-12-17 21:55:10 +01:00
hwspinlock
hwtracing intel_th: msu: Fix an off-by-one in attribute store 2019-01-13 10:05:33 +01:00
i2c i2c: dev: prevent adapter retries and timeout being set as minus value 2019-01-16 22:16:12 +01:00
ide ide: pmac: add of_node_put() 2018-12-21 14:09:52 +01:00
idle idle: i7300: add PCI dependency 2018-02-25 11:03:51 +01:00
iio iio: adc: at91: fix wrong channel number in triggered buffer mode 2018-11-21 09:27:35 +01:00
infiniband mm: replace get_user_pages() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
input Input: omap-keypad - fix idle configuration to not block SoC idle states 2019-01-13 10:05:32 +01:00
iommu iommu/vt-d: Handle domain agaw being less than iommu agaw 2019-01-13 10:05:33 +01:00
ipack
irqchip irqchip/gic: Make interrupt ID 1020 invalid 2018-09-15 09:40:41 +02:00
isdn isdn: fix kernel-infoleak in capi_unlocked_ioctl 2019-01-13 10:05:28 +01:00
leds leds: leds-gpio: Fix return value check in create_gpio_led() 2018-12-13 09:21:31 +01:00
lguest
lightnvm
macintosh macintosh/via-pmu: Add missing mmio accessors 2018-09-19 22:48:57 +02:00
mailbox
mcb
md MD: fix invalid stored role for a disk - try2 2018-11-21 09:27:38 +01:00
media media: vivid: free bitmap_cap when updating std/timings/etc. 2019-01-13 10:05:30 +01:00
memory memory: tegra: Apply interrupts mask per SoC 2018-08-06 16:24:38 +02:00
memstick
message scsi: mptfusion: Add bounds check in mptctl_hp_targetinfo() 2018-05-30 07:48:58 +02:00
mfd thermal: allow u8500-thermal driver to be a module 2018-11-10 07:41:36 -08:00
misc genwqe: Fix size check 2019-01-13 10:05:33 +01:00
mmc mmc: omap_hsmmc: fix DMA API warning 2019-01-13 10:05:27 +01:00
mtd mtd: docg3: don't set conflicting BCH_CONST_PARAMS option 2018-11-21 09:27:42 +01:00
net b43: Fix error in cordic routine 2019-01-13 10:05:33 +01:00
nfc NFC: nfcmrvl_uart: fix OF child-node lookup 2018-12-01 09:46:35 +01:00
ntb ntb_transport: Fix bug with max_mw_size parameter 2018-05-30 07:48:55 +02:00
nubus
nvdimm libnvdimm: Hold reference on parent while scheduling async init 2018-11-21 09:27:34 +01:00
nvme nvme-pci: initialize queue memory before interrupts 2018-07-11 16:03:47 +02:00
nvmem
of of: add helper to lookup compatible child node 2018-12-01 09:46:35 +01:00
oprofile
parisc parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode 2018-05-30 07:49:10 +02:00
parport parport: sunbpp: fix error return code 2018-09-26 08:35:09 +02:00
pci PCI: altera: Move retrain from fixup to altera_pcie_host_init() 2019-01-16 22:16:11 +01:00
pcmcia pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-11-21 09:27:30 +01:00
perf drivers/perf: arm_pmu: handle no platform_device 2018-03-22 09:23:26 +01:00
phy
pinctrl pinctrl: sunxi: a83t: Fix IRQ offset typo for PH11 2018-12-21 14:09:49 +01:00
platform platform/x86: acerhdf: Add BIOS entry for Gateway LT31 v1.3307 2018-11-27 16:08:00 +01:00
pnp
power power: supply: olpc_battery: correct the temperature units 2019-01-13 10:05:34 +01:00
powercap PowerCap: Fix an error code in powercap_register_zone() 2018-04-13 19:50:05 +02:00
pps
ps3
ptp ptp: fix Spectre v1 vulnerability 2018-11-10 07:41:42 -08:00
pwm pwm: tiehrpwm: Fix disabling of output of PWMs 2018-09-09 20:04:35 +02:00
rapidio
ras
regulator regulator: pfuze100: add .is_enable() for pfuze100_swb_regulator_ops 2018-08-06 16:24:35 +02:00
remoteproc
reset
rpmsg
rtc rtc: snvs: Add timeouts to avoid kernel lockups 2018-12-21 14:09:53 +01:00
s390 scsi: zfcp: fix posting too many status read buffers leading to adapter shutdown 2019-01-13 10:05:32 +01:00
sbus drivers/sbus/char: add of_node_put() 2018-12-21 14:09:52 +01:00
scsi scsi: bnx2fc: Fix NULL dereference in error handling 2019-01-13 10:05:31 +01:00
sfi
sh
sn
soc soc/tegra: pmc: Fix child-node lookup 2018-11-21 09:27:37 +01:00
spi spi: bcm2835: Unbreak the build of esoteric configs 2019-01-13 10:05:31 +01:00
spmi
ssb ssb: mark ssb_bus_register as __maybe_unused 2018-02-25 11:03:44 +01:00
staging staging: speakup: Replace strncpy with memcpy 2018-12-17 21:55:17 +01:00
target scsi: target: iscsi: Use bin2hex instead of a re-implementation 2018-10-10 08:52:08 +02:00
tc TC: Set DMA masks for devices 2018-11-21 09:27:36 +01:00
thermal thermal: allow u8500-thermal driver to be a module 2018-11-10 07:41:36 -08:00
thunderbolt thunderbolt: Resume control channel after hibernation image is created 2018-04-24 09:32:07 +02:00
tty tty/ldsem: Wake up readers after timed out down_write() 2019-01-26 09:42:45 +01:00
uio uio: Fix an Oops on load 2018-11-27 16:08:02 +01:00
usb USB: Add USB_QUIRK_DELAY_CTRL_MSG quirk for Corsair K70 RGB 2019-01-16 22:16:10 +01:00
uwb uwb: hwa-rc: fix memory leak at probe 2018-10-10 08:52:04 +02:00
vfio vfio/pci: Virtualize Maximum Read Request Size 2018-04-24 09:32:09 +02:00
vhost vhost: make sure used idx is seen before log in vhost_add_used_n() 2019-01-13 10:05:28 +01:00
video matroxfb: fix size of memcpy 2018-12-17 21:55:17 +01:00
virt mm: replace get_user_pages() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
virtio virtio_balloon: fix another race between migration and ballooning 2018-08-06 16:24:42 +02:00
vlynq
vme
w1 w1: omap-hdq: fix missing bus unregister at removal 2018-11-21 09:27:35 +01:00
watchdog watchdog: f71808e_wdt: Fix magic close handling 2018-05-30 07:49:03 +02:00
xen xen: xlate_mmu: add missing header to fix 'W=1' warning 2018-12-17 21:55:11 +01:00
zorro zorro: Set up z->dev.dma_mask for the DMA API 2018-05-30 07:49:11 +02:00
Kconfig
Makefile usb: build drivers/usb/common/ when USB_SUPPORT is set 2018-02-25 11:03:38 +01:00