linux-stable/drivers
Daniel Vetter 0391359ddf drm/dp-mst: Remove branches before dropping the reference
When we unplug a dp mst branch we unreference the entire tree from
the root towards the leaves. Which is ok, since that's the way the
pointers and so also the refcounts go.

But when we drop the reference we must make sure that we remove the
branches/ports from the lists/pointers before dropping the reference.
Otherwise the get_validated functions will still return it instead
of returning NULL (which indicates a potentially on-going unplug).

The mst branch destroy gets this right for ports: First it deletes
the port from the ports list, then it unrefs. But the ports destroy
function gets it wrong: First it unrefs, then it drops the ref. Which
means a zombie mst branch can still be validate with get_validated_mstb_ref
when it shouldn't.

Fix this.

This should address a backtrace Dave dug out somewhere on unplug:

 [<ffffffffa00cc262>] drm_dp_mst_get_validated_mstb_ref_locked+0x92/0xa0 [drm_kms_helper]
 [<ffffffffa00cc211>] drm_dp_mst_get_validated_mstb_ref_locked+0x41/0xa0 [drm_kms_helper]
 [<ffffffffa00cc2aa>] drm_dp_get_validated_mstb_ref+0x3a/0x60 [drm_kms_helper]
 [<ffffffffa00cc2fb>] drm_dp_payload_send_msg.isra.14+0x2b/0x100 [drm_kms_helper]
 [<ffffffffa00cc547>] drm_dp_update_payload_part1+0x177/0x360 [drm_kms_helper]
 [<ffffffffa015c52e>] intel_mst_disable_dp+0x3e/0x80 [i915]
 [<ffffffffa013d60b>] haswell_crtc_disable+0x1cb/0x340 [i915]
 [<ffffffffa0136739>] intel_crtc_control+0x49/0x100 [i915]
 [<ffffffffa0136857>] intel_crtc_update_dpms+0x67/0x80 [i915]
 [<ffffffffa013fa59>] intel_connector_dpms+0x59/0x70 [i915]
 [<ffffffffa015c752>] intel_dp_destroy_mst_connector+0x32/0xc0 [i915]
 [<ffffffffa00cb44b>] drm_dp_destroy_port+0x6b/0xa0 [drm_kms_helper]
 [<ffffffffa00cb588>] drm_dp_destroy_mst_branch_device+0x108/0x130 [drm_kms_helper]
 [<ffffffffa00cb3cd>] drm_dp_port_teardown_pdt+0x3d/0x50 [drm_kms_helper]
 [<ffffffffa00cdb79>] drm_dp_mst_handle_up_req+0x499/0x540 [drm_kms_helper]
 [<ffffffff810d9ead>] ? trace_hardirqs_on_caller+0x15d/0x200 [<ffffffffa00cdc73>]
 drm_dp_mst_hpd_irq+0x53/0xa00 [drm_kms_helper] [<ffffffffa00c7dfb>]
 ? drm_dp_dpcd_read+0x1b/0x20 [drm_kms_helper] [<ffffffffa0153ed8>]
 ? intel_dp_dpcd_read_wake+0x38/0x70 [i915] [<ffffffffa015a225>]
 intel_dp_check_mst_status+0xb5/0x250 [i915] [<ffffffffa015ac71>]
 intel_dp_hpd_pulse+0x181/0x210 [i915] [<ffffffffa01104f6>]
 i915_digport_work_func+0x96/0x120 [i915]

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-12-09 09:56:45 +10:00
..
accessibility
acpi ACPI / video: update condition to check if device is in _DOD list 2014-12-01 02:09:18 +01:00
amba PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h 2014-09-30 01:16:44 +02:00
ata ahci: disable MSI on SAMSUNG 0xa800 SSD 2014-12-04 13:18:55 -05:00
atm solos-pci: fix error return code 2014-11-23 14:29:44 -05:00
auxdisplay
base Merge branches 'pm-domains', 'pm-sleep' and 'pm-cpufreq' 2014-11-14 15:17:32 +01:00
bcma bcma: add another PCI ID of device with BCM43228 2014-10-23 14:02:06 -04:00
block zram: avoid kunmap_atomic() of a NULL pointer 2014-11-13 16:17:05 -08:00
bluetooth Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2014-10-13 11:28:42 +02:00
bus ARM: SoC driver updates for 3.18 2014-10-08 17:37:16 -04:00
cdrom
char Linux 3.18-rc7 2014-12-02 10:58:33 +10:00
clk clk: pxa: fix pxa27x CCCR bit usage 2014-11-17 11:25:29 -08:00
clocksource clockevent: sun4i: Fix race condition in the probe code 2014-11-19 10:43:51 +01:00
connector
cpufreq cpufreq: Avoid crash in resume on SMP without OPP 2014-11-08 02:10:04 +01:00
cpuidle Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-10-24 12:48:47 -07:00
crypto crypto: caam - fix missing dma unmap on error path 2014-11-06 23:10:20 +08:00
dca
devfreq PM / devfreq: exynos: Enable building exynos PPMU as module 2014-09-29 20:22:36 +09:00
dio
dma Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma 2014-11-21 16:24:27 -08:00
dma-buf dma-buf: don't open-code atomic_long_read() 2014-10-09 02:39:07 -04:00
edac e7xxx_edac: Report CE events properly 2014-10-22 22:59:00 +02:00
eisa
extcon extcon: gpio: Fix code cleanup 2014-09-22 16:48:47 +09:00
firewire firewire: cdev: prevent kernel stack leaking into ioctl arguments 2014-11-14 12:10:13 +01:00
firmware Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-23 14:45:09 -07:00
fmc
gpio This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
gpu drm/dp-mst: Remove branches before dropping the reference 2014-12-09 09:56:45 +10:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2014-11-13 16:19:14 -08:00
hsi
hv Drivers: hv: vmbus: Enable interrupt driven flow control 2014-09-23 23:31:22 -07:00
hwmon hwmon: (g762) fix call to devm_hwmon_device_register_with_groups() 2014-11-19 14:06:47 -08:00
hwspinlock
i2c i2c: cadence: Set the hardware time-out register to maximum value 2014-12-04 19:25:41 +01:00
ide Merge branch 'for-3.18/drivers' of git://git.kernel.dk/linux-block 2014-10-18 12:12:45 -07:00
idle
iio iio: accel: bmc150: set low default thresholds 2014-11-16 20:25:00 +00:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2014-11-21 16:28:45 -08:00
input drivers/input/evdev.c: don't kfree() a vmalloc address 2014-12-03 09:35:38 -08:00
iommu Merge branch 'drm_iommu_v15' of https://github.com/markyzq/kernel-drm-rockchip into drm-next 2014-12-08 13:45:18 +10:00
ipack ipoctal: clear break interrupt as soon as it occurs 2014-09-23 23:26:42 -07:00
irqchip irqchip: brcmstb-l2: Fix error handling of irq_of_parse_and_map 2014-11-26 06:28:42 +00:00
isdn isdn/gigaset: fix usb_gigaset write_cmd result race 2014-10-14 15:05:35 -04:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2014-10-21 08:18:38 -07:00
lguest
macintosh powerpc: Move via-cuda symbol exports next to function definitions 2014-09-25 23:14:37 +10:00
mailbox Merge branch 'mailbox-for-linus' of git://git.linaro.org/landing-teams/working/fujitsu/integration 2014-10-21 11:21:19 -07:00
mcb
md One fix for md for 3.18. 2014-11-16 15:34:31 -08:00
media [media] rc-core: fix toggle handling in the rc6 decoder 2014-11-21 15:57:47 -02:00
memory
memstick memstick: r592: fix build warnings for !PM_SLEEP 2014-10-14 02:18:22 +02:00
message SCSI for-linus on 20141007 2014-10-07 21:29:18 -04:00
mfd mfd: twl4030-power: Fix poweroff with PM configuration enabled 2014-11-10 15:22:04 +00:00
misc cxl: Fix PSL error due to duplicate segment table entries 2014-10-28 19:52:52 +11:00
mmc mmc: core: fix card detection regression 2014-11-05 09:28:48 +01:00
mtd Three main MTD fixes for 3.18: 2014-11-02 14:45:52 -08:00
net cxgb4: Fill in supported link mode for SFP modules 2014-12-02 19:57:49 -08:00
nfc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2014-10-07 14:48:29 -04:00
ntb ntb: Adding split BAR support for Haswell platforms 2014-10-17 07:08:51 -04:00
nubus
of of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap 2014-11-26 12:35:52 +00:00
oprofile
parisc Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-13 16:23:15 +02:00
parport parport: parport_pc: Implement architecture and device check to cut off false-positives 2014-09-23 23:14:28 -07:00
pci PCI update for v3.18: 2014-12-03 14:24:10 -08:00
pcmcia
phy phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly 2014-11-05 14:34:06 -08:00
pinctrl pinctrl: baytrail: show output gpio state correctly on Intel Baytrail 2014-10-28 11:16:26 +01:00
platform platform: hp_accel: Add SERIO_I8042 as a dependency since it now includes i8042.h/serio.h 2014-11-10 21:16:15 -08:00
pnp PNP: replace strnicmp with strncasecmp 2014-10-14 02:18:25 +02:00
power power supply and reset changes for the v3.18-rc 2014-11-15 15:22:51 -08:00
powercap
pps
ps3
ptp
pwm pwm: Changes for v3.18-rc1 2014-10-21 08:17:43 -07:00
rapidio
ras
regulator Merge remote-tracking branches 'regulator/fix/max1586', 'regulator/fix/max77686', 'regulator/fix/max77693', 'regulator/fix/max77802', 'regulator/fix/max8860' and 'regulator/fix/s2mpa01' into regulator-linus 2014-11-05 14:59:25 +00:00
remoteproc
reset
rpmsg
rtc drivers/rtc/rtc-bq32k.c: fix register value 2014-10-29 16:33:14 -07:00
s390 KVM: s390: virtio_ccw: remove unused variable 2014-11-03 10:43:00 +01:00
sbus
scsi SCSI fixes on 20141128 2014-11-29 10:15:31 -08:00
sfi
sh
sn
soc soc/tegra: fuse: export tegra_sku_info 2014-12-02 15:43:37 +10:00
spi Merge remote-tracking branches 'spi/fix/dw' and 'spi/fix/sirf' into spi-linus 2014-11-26 19:05:25 +00:00
spmi
ssb This is the bulk of GPIO changes for the v3.18 development 2014-10-09 14:58:15 -04:00
staging Linux 3.18-rc7 2014-12-02 10:58:33 +10:00
target target: return CONFLICT only when SA key unmatched 2014-11-02 22:04:57 -08:00
tc
thermal thermal: Exynos: Deletion of unnecessary checks before two function calls 2014-11-21 15:20:17 -04:00
thunderbolt
tty Revert "serial: of-serial: add PM suspend/resume support" 2014-11-25 12:46:39 -08:00
uio uio: Export definition of struct uio_device 2014-10-02 21:35:54 -07:00
usb usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000 2014-11-24 17:01:55 -08:00
uwb uwb: add an ASIE sysfs attribute to uwb_rc devices 2014-09-23 22:05:26 -07:00
vfio IOMMU Updates for Linux v3.18 2014-10-15 07:23:49 +02:00
vhost vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT 2014-10-28 13:54:16 -07:00
video Merge branch '3.18/omapdss-fixes' into 3.18/fbdev-fixes 2014-10-30 14:53:49 +02:00
virt
virtio One cc: stable commit, the rest are a series of minor cleanups which have 2014-10-18 10:25:09 -07:00
vlynq
vme
w1
watchdog watchdog: s3c2410_wdt: Fix the mask bit offset for Exynos7 2014-12-05 20:21:35 +01:00
xen xen/pci: Allocate memory for physdev_pci_device_add's optarr 2014-10-23 16:24:02 +01:00
zorro
Kconfig soc: ti: add Keystone Navigator QMSS driver 2014-09-24 09:49:14 -04:00
Makefile