linux/drivers/thunderbolt
Nikunj A. Dadhania 8824d19b45 thunderbolt: Disable ports that are not implemented
Commit 4caf2511ec ("thunderbolt: Add trivial .shutdown") exposes a bug
in the Thunderbolt driver, that frees an unallocated id, resulting in the
following spinlock bad magic bug.

[ 20.633803] BUG: spinlock bad magic on CPU#4, halt/3313
[ 20.640030] lock: 0xffff92e6ad5c97e0, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
[ 20.672139] Call Trace:
[ 20.675032] dump_stack+0x97/0xdb
[ 20.678950] ? spin_bug+0xa5/0xb0
[ 20.682865] do_raw_spin_lock+0x68/0x98
[ 20.687397] _raw_spin_lock_irqsave+0x3f/0x5d
[ 20.692535] ida_destroy+0x4f/0x124
[ 20.696657] tb_switch_release+0x6d/0xfd
[ 20.701295] device_release+0x2c/0x7d
[ 20.705622] kobject_put+0x8e/0xac
[ 20.709637] tb_stop+0x55/0x66
[ 20.713243] tb_domain_remove+0x36/0x62
[ 20.717774] nhi_remove+0x4d/0x58

Fix the issue by disabling ports that are enabled as per the EEPROM, but
not implemented. While at it, update the kernel doc for the disabled
field, to reflect this.

Cc: stable@vger.kernel.org
Fixes: 4caf2511ec ("thunderbolt: Add trivial .shutdown")
Reported-by: Srikanth Nandamuri <srikanth.nandamuri@intel.com>
Signed-off-by: Nikunj A. Dadhania <nikunj.dadhania@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2020-08-25 11:28:03 +03:00
..
cap.c thunderbolt: Make tb_switch_find_cap() available to other files 2019-12-18 15:40:36 +01:00
ctl.c thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
ctl.h thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
dma_port.c thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
dma_port.h thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
domain.c thunderbolt: Split common NVM functionality into a separate file 2020-06-22 19:58:32 +03:00
eeprom.c thunderbolt: Add support for authenticate on disconnect 2020-07-01 13:51:49 +03:00
icm.c thunderbolt: Add support for Intel Tiger Lake 2020-04-23 09:57:59 +03:00
Kconfig thunderbolt: Add KUnit tests for path walking 2020-06-22 19:58:20 +03:00
lc.c thunderbolt: Add support for authenticate on disconnect 2020-07-01 13:51:49 +03:00
Makefile thunderbolt: Add support for authenticate on disconnect 2020-07-01 13:51:49 +03:00
nhi_ops.c thunderbolt: Drop unnecessary read when writing LC command in Ice Lake 2019-10-08 12:08:21 +03:00
nhi_regs.h thunderbolt: Add support for Intel Ice Lake 2019-08-26 12:15:06 +03:00
nhi.c thunderbolt: Get rid of E2E workaround 2020-06-22 19:58:06 +03:00
nhi.h thunderbolt: Add support for Intel Tiger Lake 2020-04-23 09:57:59 +03:00
nvm.c thunderbolt: Add support for separating the flush to SPI and authenticate 2020-07-01 13:51:49 +03:00
path.c thunderbolt: Add USB3 bandwidth management 2020-06-22 19:58:20 +03:00
property.c thunderbolt: property: Fix a missing check of kzalloc 2019-03-28 11:30:47 +03:00
quirks.c thunderbolt: Fix old style declaration warning 2020-07-02 14:50:11 +03:00
retimer.c thunderbolt: Add support for on-board retimers 2020-06-22 19:58:32 +03:00
sb_regs.h thunderbolt: Add support for on-board retimers 2020-06-22 19:58:32 +03:00
switch.c thunderbolt: Disable ports that are not implemented 2020-08-25 11:28:03 +03:00
tb_msgs.h thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
tb_regs.h thunderbolt: Add support for authenticate on disconnect 2020-07-01 13:51:49 +03:00
tb.c thunderbolt: Add support for on-board retimers 2020-06-22 19:58:32 +03:00
tb.h thunderbolt: Disable ports that are not implemented 2020-08-25 11:28:03 +03:00
test.c thunderbolt: merge fix for kunix_resource changes 2020-08-09 11:06:10 -07:00
tmu.c thunderbolt: Add support for Time Management Unit 2019-12-18 15:41:15 +01:00
tunnel.c thunderbolt: Add USB3 bandwidth management 2020-06-22 19:58:20 +03:00
tunnel.h thunderbolt: Add USB3 bandwidth management 2020-06-22 19:58:20 +03:00
usb4.c thunderbolt: Ensure left shift of 512 does not overflow a 32 bit int 2020-07-01 13:46:47 +03:00
xdomain.c thunderbolt: Build initial XDomain property block upon first connect 2020-06-22 19:58:05 +03:00