Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1644627 > unrolled thread

[PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

Started byMika Westerberg <mika.westerberg@linux.intel.com>
First post2017-05-18 16:50 +0200
Last post2017-05-23 15:30 +0200
Articles 20 on this page of 23 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    [PATCH 09/24] thunderbolt: Do not fail if DROM data CRC32 is invalid Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    [PATCH 16/24] thunderbolt: Add Thunderbolt 3 PCI IDs Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    [PATCH 03/24] thunderbolt: Do not warn about newer DROM versions Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    [PATCH 13/24] thunderbolt: Expose make_header() to other files Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    [PATCH 12/24] thunderbolt: Expose get_route() to other files Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    [PATCH 24/24] MAINTAINERS: Add maintainers for Thunderbolt driver Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    [PATCH 08/24] thunderbolt: Fail switch adding operation if reading DROM fails Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
    Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-19 19:30 +0200
      RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade <Mario.Limonciello@dell.com> - 2017-05-19 20:00 +0200
        Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-20 10:30 +0200
          Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-22 13:40 +0200
            RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade <Mario.Limonciello@dell.com> - 2017-05-22 22:10 +0200
              RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade "Bernat, Yehezkel" <yehezkel.bernat@intel.com> - 2017-05-22 22:20 +0200
                RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade <Mario.Limonciello@dell.com> - 2017-05-23 02:00 +0200
              Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-22 23:00 +0200
                Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-24 13:20 +0200
                  RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade <Mario.Limonciello@dell.com> - 2017-05-24 21:10 +0200
                    RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade "Jamet, Michael" <michael.jamet@intel.com> - 2017-05-24 21:40 +0200
      Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-19 20:10 +0200
    RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade "Levy, Amir (Jer)" <amir.jer.levy@intel.com> - 2017-05-20 11:20 +0200
      Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade "mika.westerberg@linux.intel.com" <mika.westerberg@linux.intel.com> - 2017-05-21 10:10 +0200
    Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware  upgrade Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-23 15:30 +0200

Page 1 of 2  [1] 2  Next page →


#1644627 — [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tIuKR-3YK-5@gated-at.bofh.it>
Hi all,

This patch series adds support for Thunderbolt security levels, which were
first introduced in Intel Falcon Ridge Thunderbolt controller, to prevent
DMA attacks when PCIe is tunneled over Thunderbolt fabric. This is needed
if there is no IOMMU available for various reasons.

Most PCs out there having Falcon Ridge or newer have security level set to
"user" which means that user authorization is needed before PCIe tunnel is
creaded (the PCIe device appears). This effectively means that without
driver support the user needs to configure security level from BIOS to
"none" to get Thunderbolt devices connected. With these patches the user
can authorize devices using sysfs attributes like:

  # echo 1 > /sys/bus/thunderbolt/devices/0-1/authorized

In addition these patches add support for upgrading NVM firmware running on
a host or device by running something like:

  # dd if=KYK_TBT_FW_0018.bin of=/sys/bus/thunderbolt/devices/0-0/nvm_non_active0/nvmem
  # echo 1 > /sys/bus/thunderbolt/devices/0-0/nvm_authenticate

This is documented with more details in patch [23/24].

This series is based on Amir's networking patches [1] but instead of
splitting the functionality between kernel driver and userspace daemon, we
take advantage of Linux driver core by converting the existing driver to
expose a Linux bus (domain) and devices (switches). Notifications to the
userspace about plugged/unplugged devices is handled by standard uevents
when a device is added to/removed from the Thunderbolt bus.

Since thunderbolt device identification and authorization can be done
directly through sysfs attributes there is no need for userspace daemon.
However, there still should be an application that promps user for unknown
devices and allows selecting between "single connect" and "connect always"
keeping this information in a database or similar persistent storage. This
patch series only provides mechanism for userspace applications to achieve
that.

Where Internal Connection Manager (ICM) firmware is available and usable,
we use it in the driver. This also includes newer Apple Macbooks with
Alpine Ridge. For older Macbooks the driver works as before but in addition
the Thunderbolt bus is available there as well (including possibility to
upgrade NVM firmware of connected devices).

We are also in works of porting Amir's networking driver to work on top of
the new Thunderbolt bus pretty much the same way firewire networking is
currently done. In addition this makes is possible to introduce other
protocols like a char device that allows userspace directly to communicate
accross Thunderbolt domains.

Note for Macs the Linux native PCIe hotplug support does not work well with
the Thunderbolt PCIe topologies where there is need to put all available
resources to the PCIe downstream port where the PCIe chain is extended.
This is something we need to fix. In the mean time is a way to work it
around by passing "pci=hpbussize=10,hpmemsize=2M" or so to the kernel
command line.

These patches use uuid_be from uuid.h but I've learned that there is a work
to remove the type completely in favor of new uuid_t [2]. I'm not sure what
to do regarding that because those patches are not yet in the mainline.

[1] https://lkml.org/lkml/2016/11/9/341
[2] http://git.infradead.org/users/hch/vfs.git/shortlog/refs/heads/uuid-types

Mika Westerberg (24):
  thunderbolt: Use const buffer pointer in write operations
  thunderbolt: Do not try to read UID if DROM offset is read as 0
  thunderbolt: Do not warn about newer DROM versions
  thunderbolt: Add MSI-X support
  thunderbolt: Rework capability handling
  thunderbolt: Introduce thunderbolt bus and connection manager
  thunderbolt: Convert switch to a device
  thunderbolt: Fail switch adding operation if reading DROM fails
  thunderbolt: Do not fail if DROM data CRC32 is invalid
  thunderbolt: Read vendor and device name from DROM
  thunderbolt: Move control channel messages to tb_msgs.h
  thunderbolt: Expose get_route() to other files
  thunderbolt: Expose make_header() to other files
  thunderbolt: Let the connection manager handle all notifications
  thunderbolt: Rework control channel to be more reliable
  thunderbolt: Add Thunderbolt 3 PCI IDs
  thunderbolt: Add support for NHI mailbox
  thunderbolt: Store Thunderbolt generation in the switch structure
  thunderbolt: Add support for DMA configuration based mailbox
  thunderbolt: Do not touch the hardware if the NHI is gone on resume
  thunderbolt: Add support for Internal Connection Manager (ICM)
  thunderbolt: Add support for host and device NVM firmware upgrade
  thunderbolt: Add documentation how Thunderbolt bus can be used
  MAINTAINERS: Add maintainers for Thunderbolt driver

 Documentation/ABI/testing/sysfs-bus-thunderbolt |  108 +++
 Documentation/admin-guide/index.rst             |    1 +
 Documentation/admin-guide/thunderbolt.rst       |  197 ++++
 MAINTAINERS                                     |    3 +
 drivers/thunderbolt/Kconfig                     |   13 +-
 drivers/thunderbolt/Makefile                    |    2 +-
 drivers/thunderbolt/cap.c                       |  169 ++--
 drivers/thunderbolt/ctl.c                       |  655 +++++++++----
 drivers/thunderbolt/ctl.h                       |  105 ++-
 drivers/thunderbolt/dma_port.c                  |  524 +++++++++++
 drivers/thunderbolt/dma_port.h                  |   34 +
 drivers/thunderbolt/domain.c                    |  455 ++++++++++
 drivers/thunderbolt/eeprom.c                    |   84 +-
 drivers/thunderbolt/icm.c                       | 1098 ++++++++++++++++++++++
 drivers/thunderbolt/nhi.c                       |  302 +++++-
 drivers/thunderbolt/nhi.h                       |   91 +-
 drivers/thunderbolt/nhi_regs.h                  |   27 +
 drivers/thunderbolt/switch.c                    | 1109 +++++++++++++++++++++--
 drivers/thunderbolt/tb.c                        |  237 ++---
 drivers/thunderbolt/tb.h                        |  242 ++++-
 drivers/thunderbolt/tb_msgs.h                   |  260 ++++++
 drivers/thunderbolt/tb_regs.h                   |   31 +-
 drivers/thunderbolt/tunnel_pci.c                |   17 +-
 23 files changed, 5213 insertions(+), 551 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-thunderbolt
 create mode 100644 Documentation/admin-guide/thunderbolt.rst
 create mode 100644 drivers/thunderbolt/dma_port.c
 create mode 100644 drivers/thunderbolt/dma_port.h
 create mode 100644 drivers/thunderbolt/domain.c
 create mode 100644 drivers/thunderbolt/icm.c
 create mode 100644 drivers/thunderbolt/tb_msgs.h

-- 
2.11.0

[toc] | [next] | [standalone]


#1644628 — [PATCH 09/24] thunderbolt: Do not fail if DROM data CRC32 is invalid

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 09/24] thunderbolt: Do not fail if DROM data CRC32 is invalid
Message-ID<tIuUz-44c-45@gated-at.bofh.it>
In reply to#1644627
There are devices out there where CRC32 of the DROM is not correct. One
reason for this is that the ICM firmware does not validate it and it
seems that neither does the Apple driver. To be able to support such
devices we continue parsing the DROM contents regardless of whether
CRC32 failed or not. We still keep the warning there.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
---
 drivers/thunderbolt/eeprom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 7e485e3ef27e..e2c1f8a45522 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -485,9 +485,8 @@ int tb_drom_read(struct tb_switch *sw)
 	crc = tb_crc32(sw->drom + TB_DROM_DATA_START, header->data_len);
 	if (crc != header->data_crc32) {
 		tb_sw_warn(sw,
-			"drom data crc32 mismatch (expected: %#x, got: %#x), aborting\n",
+			"drom data crc32 mismatch (expected: %#x, got: %#x), continuing\n",
 			header->data_crc32, crc);
-		goto err;
 	}
 
 	if (header->device_rom_revision > 2)
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1644629 — [PATCH 16/24] thunderbolt: Add Thunderbolt 3 PCI IDs

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 16/24] thunderbolt: Add Thunderbolt 3 PCI IDs
Message-ID<tIuUz-44c-43@gated-at.bofh.it>
In reply to#1644627
Add Intel Alpine Ridge Thunderbolt 3 controller PCI IDs to the list of
supported devices.

This code is based on the work done by Amir Levy and Michael Jamet.

Signed-off-by: Michael Jamet <michael.jamet@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
---
 drivers/thunderbolt/nhi.c    | 11 +++++++++++
 drivers/thunderbolt/nhi.h    | 15 +++++++++++++++
 drivers/thunderbolt/switch.c | 19 ++++++++++++++-----
 3 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index bf69ee42da68..1ebc845163c9 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -789,6 +789,17 @@ static struct pci_device_id nhi_ids[] = {
 		.device = PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI,
 		.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
 	},
+
+	/* Thunderbolt 3 */
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_NHI) },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_NHI) },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_USBONLY_NHI) },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_NHI) },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_USBONLY_NHI) },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_NHI) },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_NHI) },
+	{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_USBONLY_NHI) },
+
 	{ 0,}
 };
 
diff --git a/drivers/thunderbolt/nhi.h b/drivers/thunderbolt/nhi.h
index 630f44140530..8a443ad67133 100644
--- a/drivers/thunderbolt/nhi.h
+++ b/drivers/thunderbolt/nhi.h
@@ -143,4 +143,19 @@ static inline int ring_tx(struct tb_ring *ring, struct ring_frame *frame)
 	return __ring_enqueue(ring, frame);
 }
 
+/*
+ * PCI IDs used in this driver from Alpine Ridge forward. There is no
+ * need for the PCI quirk anymore as we will use ICM also on Apple
+ * hardware.
+ */
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_NHI		0x15bf
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_BRIDGE	0x15c0
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_NHI	0x15d2
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_BRIDGE	0x15d3
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_NHI	0x15d9
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_BRIDGE	0x15da
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_USBONLY_NHI	0x15dc
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_USBONLY_NHI	0x15dd
+#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_USBONLY_NHI	0x15de
+
 #endif
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index b06de0efbdfc..396e00ab7723 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -481,13 +481,22 @@ int tb_switch_configure(struct tb_switch *sw)
 		tb_sw_warn(sw, "unknown switch vendor id %#x\n",
 			   sw->config.vendor_id);
 
-	if (sw->config.device_id != PCI_DEVICE_ID_INTEL_LIGHT_RIDGE &&
-	    sw->config.device_id != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C &&
-	    sw->config.device_id != PCI_DEVICE_ID_INTEL_PORT_RIDGE &&
-	    sw->config.device_id != PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_BRIDGE &&
-	    sw->config.device_id != PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_BRIDGE)
+	switch (sw->config.device_id) {
+	case PCI_DEVICE_ID_INTEL_LIGHT_RIDGE:
+	case PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C:
+	case PCI_DEVICE_ID_INTEL_PORT_RIDGE:
+	case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_BRIDGE:
+	case PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_BRIDGE:
+	case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_BRIDGE:
+	case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_BRIDGE:
+	case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_BRIDGE:
+	case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_BRIDGE:
+		break;
+
+	default:
 		tb_sw_warn(sw, "unsupported switch device id %#x\n",
 			   sw->config.device_id);
+	}
 
 	sw->config.enabled = 1;
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1644630 — [PATCH 03/24] thunderbolt: Do not warn about newer DROM versions

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 03/24] thunderbolt: Do not warn about newer DROM versions
Message-ID<tIuUz-44c-47@gated-at.bofh.it>
In reply to#1644627
DROM version 2 is compatible with the previous generation so no need to
warn about that.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
---
 drivers/thunderbolt/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index e4e64b130514..eb2179c98b09 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -488,7 +488,7 @@ int tb_drom_read(struct tb_switch *sw)
 		goto err;
 	}
 
-	if (header->device_rom_revision > 1)
+	if (header->device_rom_revision > 2)
 		tb_sw_warn(sw, "drom device_rom_revision %#x unknown\n",
 			header->device_rom_revision);
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1644631 — [PATCH 13/24] thunderbolt: Expose make_header() to other files

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 13/24] thunderbolt: Expose make_header() to other files
Message-ID<tIuUz-44c-51@gated-at.bofh.it>
In reply to#1644627
We will be using this function in files introduced in subsequent
patches. While there the function is renamed to tb_cfg_make_header()
following tb_cfg_get_route().

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
---
 drivers/thunderbolt/ctl.c | 19 ++++---------------
 drivers/thunderbolt/ctl.h | 11 +++++++++++
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 86902a4d681e..87880dc53199 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -54,17 +54,6 @@ struct tb_ctl {
 
 /* utility functions */
 
-static struct tb_cfg_header make_header(u64 route)
-{
-	struct tb_cfg_header header = {
-		.route_hi = route >> 32,
-		.route_lo = route,
-	};
-	/* check for overflow, route_hi is not 32 bits! */
-	WARN_ON(tb_cfg_get_route(&header) != route);
-	return header;
-}
-
 static int check_header(struct ctl_pkg *pkg, u32 len, enum tb_cfg_pkg_type type,
 			u64 route)
 {
@@ -497,7 +486,7 @@ int tb_cfg_error(struct tb_ctl *ctl, u64 route, u32 port,
 		 enum tb_cfg_error error)
 {
 	struct cfg_error_pkg pkg = {
-		.header = make_header(route),
+		.header = tb_cfg_make_header(route),
 		.port = port,
 		.error = error,
 	};
@@ -516,7 +505,7 @@ struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route,
 				  int timeout_msec)
 {
 	int err;
-	struct cfg_reset_pkg request = { .header = make_header(route) };
+	struct cfg_reset_pkg request = { .header = tb_cfg_make_header(route) };
 	struct tb_cfg_header reply;
 
 	err = tb_ctl_tx(ctl, &request, sizeof(request), TB_CFG_PKG_RESET);
@@ -538,7 +527,7 @@ struct tb_cfg_result tb_cfg_read_raw(struct tb_ctl *ctl, void *buffer,
 {
 	struct tb_cfg_result res = { 0 };
 	struct cfg_read_pkg request = {
-		.header = make_header(route),
+		.header = tb_cfg_make_header(route),
 		.addr = {
 			.port = port,
 			.space = space,
@@ -575,7 +564,7 @@ struct tb_cfg_result tb_cfg_write_raw(struct tb_ctl *ctl, const void *buffer,
 {
 	struct tb_cfg_result res = { 0 };
 	struct cfg_write_pkg request = {
-		.header = make_header(route),
+		.header = tb_cfg_make_header(route),
 		.addr = {
 			.port = port,
 			.space = space,
diff --git a/drivers/thunderbolt/ctl.h b/drivers/thunderbolt/ctl.h
index 9812b1c86d4f..914da86ec77d 100644
--- a/drivers/thunderbolt/ctl.h
+++ b/drivers/thunderbolt/ctl.h
@@ -43,6 +43,17 @@ static inline u64 tb_cfg_get_route(const struct tb_cfg_header *header)
 	return (u64) header->route_hi << 32 | header->route_lo;
 }
 
+static inline struct tb_cfg_header tb_cfg_make_header(u64 route)
+{
+	struct tb_cfg_header header = {
+		.route_hi = route >> 32,
+		.route_lo = route,
+	};
+	/* check for overflow, route_hi is not 32 bits! */
+	WARN_ON(tb_cfg_get_route(&header) != route);
+	return header;
+}
+
 int tb_cfg_error(struct tb_ctl *ctl, u64 route, u32 port,
 		 enum tb_cfg_error error);
 struct tb_cfg_result tb_cfg_reset(struct tb_ctl *ctl, u64 route,
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1644632 — [PATCH 12/24] thunderbolt: Expose get_route() to other files

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 12/24] thunderbolt: Expose get_route() to other files
Message-ID<tIuUA-44c-57@gated-at.bofh.it>
In reply to#1644627
We are going to use it when we change the connection manager to handle
events itself. Also rename it to follow naming convention used in
functions exposed in ctl.h.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
---
 drivers/thunderbolt/ctl.c | 19 +++++++------------
 drivers/thunderbolt/ctl.h |  4 ++++
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 08bdb7145d89..86902a4d681e 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -54,11 +54,6 @@ struct tb_ctl {
 
 /* utility functions */
 
-static u64 get_route(struct tb_cfg_header header)
-{
-	return (u64) header.route_hi << 32 | header.route_lo;
-}
-
 static struct tb_cfg_header make_header(u64 route)
 {
 	struct tb_cfg_header header = {
@@ -66,7 +61,7 @@ static struct tb_cfg_header make_header(u64 route)
 		.route_lo = route,
 	};
 	/* check for overflow, route_hi is not 32 bits! */
-	WARN_ON(get_route(header) != route);
+	WARN_ON(tb_cfg_get_route(&header) != route);
 	return header;
 }
 
@@ -91,9 +86,9 @@ static int check_header(struct ctl_pkg *pkg, u32 len, enum tb_cfg_pkg_type type,
 	if (WARN(header->unknown != 1 << 9,
 			"header->unknown is %#x\n", header->unknown))
 		return -EIO;
-	if (WARN(route != get_route(*header),
+	if (WARN(route != tb_cfg_get_route(header),
 			"wrong route (expected %llx, got %llx)",
-			route, get_route(*header)))
+			route, tb_cfg_get_route(header)))
 		return -EIO;
 	return 0;
 }
@@ -126,10 +121,10 @@ static struct tb_cfg_result decode_error(struct ctl_pkg *response)
 {
 	struct cfg_error_pkg *pkg = response->buffer;
 	struct tb_cfg_result res = { 0 };
-	res.response_route = get_route(pkg->header);
+	res.response_route = tb_cfg_get_route(&pkg->header);
 	res.response_port = 0;
 	res.err = check_header(response, sizeof(*pkg), TB_CFG_PKG_ERROR,
-			       get_route(pkg->header));
+			       tb_cfg_get_route(&pkg->header));
 	if (res.err)
 		return res;
 
@@ -153,7 +148,7 @@ static struct tb_cfg_result parse_header(struct ctl_pkg *pkg, u32 len,
 		return decode_error(pkg);
 
 	res.response_port = 0; /* will be updated later for cfg_read/write */
-	res.response_route = get_route(*header);
+	res.response_route = tb_cfg_get_route(header);
 	res.err = check_header(pkg, len, type, route);
 	return res;
 }
@@ -294,7 +289,7 @@ static void tb_ctl_handle_plug_event(struct tb_ctl *ctl,
 				     struct ctl_pkg *response)
 {
 	struct cfg_event_pkg *pkg = response->buffer;
-	u64 route = get_route(pkg->header);
+	u64 route = tb_cfg_get_route(&pkg->header);
 
 	if (check_header(response, sizeof(*pkg), TB_CFG_PKG_EVENT, route)) {
 		tb_ctl_warn(ctl, "malformed TB_CFG_PKG_EVENT\n");
diff --git a/drivers/thunderbolt/ctl.h b/drivers/thunderbolt/ctl.h
index 610980e3232f..9812b1c86d4f 100644
--- a/drivers/thunderbolt/ctl.h
+++ b/drivers/thunderbolt/ctl.h
@@ -38,6 +38,10 @@ struct tb_cfg_result {
 	enum tb_cfg_error tb_error; /* valid if err == 1 */
 };
 
+static inline u64 tb_cfg_get_route(const struct tb_cfg_header *header)
+{
+	return (u64) header->route_hi << 32 | header->route_lo;
+}
 
 int tb_cfg_error(struct tb_ctl *ctl, u64 route, u32 port,
 		 enum tb_cfg_error error);
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1644633 — [PATCH 24/24] MAINTAINERS: Add maintainers for Thunderbolt driver

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 24/24] MAINTAINERS: Add maintainers for Thunderbolt driver
Message-ID<tIuUA-44c-59@gated-at.bofh.it>
In reply to#1644627
We will be helping Andreas to maintain the Thunderbolt driver.

Signed-off-by: Michael Jamet <michael.jamet@intel.com>
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 MAINTAINERS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f7d568b8f133..4aa5616a5a78 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11325,6 +11325,9 @@ F:	Documentation/tee.txt
 
 THUNDERBOLT DRIVER
 M:	Andreas Noever <andreas.noever@gmail.com>
+M:	Michael Jamet <michael.jamet@intel.com>
+M:	Mika Westerberg <mika.westerberg@linux.intel.com>
+M:	Yehezkel Bernat <yehezkel.bernat@intel.com>
 S:	Maintained
 F:	drivers/thunderbolt/
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1644636 — [PATCH 08/24] thunderbolt: Fail switch adding operation if reading DROM fails

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-18 16:50 +0200
Subject[PATCH 08/24] thunderbolt: Fail switch adding operation if reading DROM fails
Message-ID<tIuUA-44c-55@gated-at.bofh.it>
In reply to#1644627
All non-root switches are expected to have DROM so if the operation
fails, it might be due the user unlugging the device. There is no point
continuing adding the switch further in that case. Just bail out.

For root switches (hosts) the DROM is either retrieved from a EFI
variable, NVM or hard-coded.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
---
 drivers/thunderbolt/switch.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index a03548763180..4a961d174cad 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -522,8 +522,11 @@ int tb_switch_add(struct tb_switch *sw)
 	int i, ret;
 
 	/* read drom */
-	if (tb_drom_read(sw))
-		tb_sw_warn(sw, "tb_eeprom_read_rom failed, continuing\n");
+	ret = tb_drom_read(sw);
+	if (ret) {
+		tb_sw_warn(sw, "tb_eeprom_read_rom failed\n");
+		return ret;
+	}
 	tb_sw_info(sw, "uid: %#llx\n", sw->uid);
 
 	tb_switch_set_uuid(sw);
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1645783 — Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-19 19:30 +0200
SubjectRe: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tITSW-5kd-7@gated-at.bofh.it>
In reply to#1644627
On Fri, May 19, 2017 at 04:35:01PM +0000, Mario.Limonciello@dell.com wrote:
> Mika,
> 
> Thanks for submitting this series.  
> I've tested security level stuff a little bit, 
> but I'm running into what I think is some odd behavior.

Thanks for testing.

> Here's my setup:
> System: I'm using is an XPS 9350 (Has Alpine Ridge).  It's got NVM 16.0.  BIOS 1.4.13
> TBT Device: Dell TB16 (which has AR in the cable and in dock - both NVM 16.0).
> 
> I created a udev rule that will automatically authorize the dock and cable.
> #dell cable
> ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{vendor}=="0xd4", ATTR{device}=="0xb051", ATTR{authorized}="1"
> #dell dock
> ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{vendor}=="0xd4", ATTR{device}=="0xb054", ATTR{authorized}="1"
> 
> If I boot the system with the dock connected the cable shows up and authorizes but the dock doesn't.
> ---
> [    6.916669] thunderbolt 0000:03:00.0: current switch config:
> [    6.916671] thunderbolt 0000:03:00.0:  Switch: 8086:1576 (Revision: 4, TB Version: 2)
> [    6.916673] thunderbolt 0000:03:00.0:   Max Port Number: 11
> [    6.916673] thunderbolt 0000:03:00.0:   Config:
> [    6.916675] thunderbolt 0000:03:00.0:    Upstream Port Number: 5 Depth: 0 Route String: 0x0 Enabled: 1, PlugEventsDelay: 254ms
> [    6.916676] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> [    6.927293] thunderbolt 0000:03:00.0: 0: uid: 0x8086a3422131ea10
> [    6.927632] thunderbolt 0000:03:00.0:  Port 0: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    6.927633] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> [    6.927634] thunderbolt 0000:03:00.0:   Max counters: 8
> [    6.927635] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [    6.927760] thunderbolt 0000:03:00.0:  Port 1: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    6.927761] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    6.927762] thunderbolt 0000:03:00.0:   Max counters: 16
> [    6.927763] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> [    6.927890] thunderbolt 0000:03:00.0:  Port 2: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    6.927895] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    6.927896] thunderbolt 0000:03:00.0:   Max counters: 16
> [    6.927897] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> [    6.928091] thunderbolt 0000:03:00.0:  Port 3: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    6.928092] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    6.928092] thunderbolt 0000:03:00.0:   Max counters: 16
> [    6.928093] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> [    6.928217] thunderbolt 0000:03:00.0:  Port 4: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    6.928219] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    6.928219] thunderbolt 0000:03:00.0:   Max counters: 16
> [    6.928220] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> [    6.928222] thunderbolt 0000:03:00.0: 0:5: disabled by eeprom
> [    6.928261] thunderbolt 0000:03:00.0:  Port 6: 8086:1576 (Revision: 4, TB Version: 1, Type: PCIe (0x100101))
> [    6.928262] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [    6.928262] thunderbolt 0000:03:00.0:   Max counters: 2
> [    6.928263] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [    6.928304] thunderbolt 0000:03:00.0:  Port 7: 8086:1576 (Revision: 4, TB Version: 1, Type: PCIe (0x100101))
> [    6.928305] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [    6.928306] thunderbolt 0000:03:00.0:   Max counters: 2
> [    6.928306] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [    6.930860] thunderbolt 0000:03:00.0:  Port 8: 8086:1576 (Revision: 4, TB Version: 1, Type: DP/HDMI (0xe0102))
> [    6.930862] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> [    6.930863] thunderbolt 0000:03:00.0:   Max counters: 2
> [    6.930864] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [    6.930865] thunderbolt 0000:03:00.0: 0:9: disabled by eeprom
> [    6.930908] thunderbolt 0000:03:00.0:  Port 10: 8086:1576 (Revision: 4, TB Version: 1, Type: DP/HDMI (0xe0101))
> [    6.930909] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> [    6.930910] thunderbolt 0000:03:00.0:   Max counters: 2
> [    6.930911] thunderbolt 0000:03:00.0:   NFC Credits: 0x1000000
> [    6.930912] thunderbolt 0000:03:00.0: 0:b: disabled by eeprom
> [    6.932249] thunderbolt 0000:03:00.0: current switch config:
> [    6.932252] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB Version: 2)
> [    6.932253] thunderbolt 0000:03:00.0:   Max Port Number: 11
> [    6.932254] thunderbolt 0000:03:00.0:   Config:
> [    6.932255] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 1 Route String: 0x1 Enabled: 1, PlugEventsDelay: 254ms
> [    6.932256] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> [    6.940642] thunderbolt 0000:03:00.0: 1: reading drom (length: 0x6e)
> [    7.040048] thunderbolt 0000:03:00.0: 1: drom data crc32 mismatch (expected: 0xaf438340, got: 0xaf4383c0), continuing
> [    7.040247] thunderbolt 0000:03:00.0: 1: uid: 0xd40f7a7928c300
> [    7.040296] thunderbolt 0000:03:00.0:  Port 0: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    7.040297] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> [    7.040298] thunderbolt 0000:03:00.0:   Max counters: 8
> [    7.040299] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [    7.040574] thunderbolt 0000:03:00.0:  Port 1: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    7.040575] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    7.040576] thunderbolt 0000:03:00.0:   Max counters: 16
> [    7.040577] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> [    7.040711] thunderbolt 0000:03:00.0:  Port 2: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    7.040712] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    7.040713] thunderbolt 0000:03:00.0:   Max counters: 16
> [    7.040714] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> [    7.040848] thunderbolt 0000:03:00.0:  Port 3: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    7.040849] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    7.040850] thunderbolt 0000:03:00.0:   Max counters: 16
> [    7.040851] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> [    7.040987] thunderbolt 0000:03:00.0:  Port 4: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [    7.040988] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [    7.040990] thunderbolt 0000:03:00.0:   Max counters: 16
> [    7.040991] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> [    7.040992] thunderbolt 0000:03:00.0: 1:5: disabled by eeprom
> [    7.041033] thunderbolt 0000:03:00.0:  Port 6: 8086:1578 (Revision: 4, TB Version: 1, Type: PCIe (0x100102))
> [    7.041034] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [    7.041035] thunderbolt 0000:03:00.0:   Max counters: 2
> [    7.041036] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [    7.041078] thunderbolt 0000:03:00.0:  Port 7: 8086:1578 (Revision: 4, TB Version: 1, Type: PCIe (0x100101))
> [    7.041080] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [    7.041080] thunderbolt 0000:03:00.0:   Max counters: 2
> [    7.041081] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [    7.041083] thunderbolt 0000:03:00.0: 1:8: disabled by eeprom
> [    7.041084] thunderbolt 0000:03:00.0: 1:9: disabled by eeprom
> [    7.041085] thunderbolt 0000:03:00.0: 1:a: disabled by eeprom
> [    7.041085] thunderbolt 0000:03:00.0: 1:b: disabled by eeprom
> [    7.041827] thunderbolt 0000:03:00.0: current switch config:
> [    7.041829] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB Version: 2)
> [    7.041829] thunderbolt 0000:03:00.0:   Max Port Number: 11
> [    7.041830] thunderbolt 0000:03:00.0:   Config:
> [    7.041831] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 2 Route String: 0x301 Enabled: 1, PlugEventsDelay: 254ms
> [    7.041832] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> [    7.416678] pci 0000:04:00.0: [8086:1578] type 01 class 0x060400
> [    7.416925] pci 0000:04:00.0: supports D1 D2
> [    7.416926] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold

> [    7.428433] pci_bus 0000:05: [bus 05] partially hidden behind bridge 0000:04 [bus 04]
> [    7.428500] pci_bus 0000:39: busn_res: can not insert [bus 39] under [bus 02-05] (conflicts with (null) [bus 02-05])

These two I've seen before.

> [    7.428503] pcieport 0000:02:02.0: PCI bridge to [bus 39]
> [    7.428512] pcieport 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> [    7.428519] pci_bus 0000:39: [bus 39] partially hidden behind bridge 0000:02 [bus 02-05]

And this.

It happens occasionally when you reboot the machine when a device is
connected but seems to be dependent on the BIOS version. Since it is the
BIOS who is supposed to enumerated these devices, I suspect that it is
either problem in BIOS or our PCI enumeration code does something wrong.

> [    7.428542] pci_bus 0000:02: Allocating resources
> [    7.428544] pcieport 0000:02:02.0: can't claim BAR 14 [mem 0xd9f00000-0xd9ffffff]: no compatible bridge window
> [    7.451018] Bluetooth: RFCOMM TTY layer initialized
> [    7.451022] Bluetooth: RFCOMM socket layer initialized
> [    7.451026] Bluetooth: RFCOMM ver 1.11
> [   11.958457] wlp58s0: authenticate with 50:6a:03:a7:1c:27
> [   11.969167] wlp58s0: send auth to 50:6a:03:a7:1c:27 (try 1/3)
> [   11.975768] wlp58s0: authenticated
> [   11.976386] wlp58s0: associate with 50:6a:03:a7:1c:27 (try 1/3)
> [   11.984817] wlp58s0: RX AssocResp from 50:6a:03:a7:1c:27 (capab=0x1411 status=0 aid=2)
> [   12.001864] wlp58s0: associated
> [   12.001913] IPv6: ADDRCONF(NETDEV_CHANGE): wlp58s0: link becomes ready
> [   27.616672] thunderbolt 0000:03:00.0: timeout reading config space 2 from 0x5
> [   27.616674] thunderbolt 0000:03:00.0: 301: cannot find TB_VSEC_CAP_PLUG_EVENTS aborting
> 
> If I then unplug the cable and plug it back in the dock does show up and authorize properly, but is a traceback
> along the way.
> ---
> [ 1653.226296] pcieport 0000:02:02.0: Refused to change power state, currently in D3
> [ 1653.729116] thunderbolt 0000:03:00.0: stopping RX ring 0
> [ 1653.729130] thunderbolt 0000:03:00.0: disabling interrupt at register 0x38200 bit 12 (0xffffffff -> 0xffffefff)
> [ 1653.729159] thunderbolt 0000:03:00.0: stopping TX ring 0
> [ 1653.729168] thunderbolt 0000:03:00.0: disabling interrupt at register 0x38200 bit 0 (0xffffffff -> 0xfffffffe)
> [ 1653.729195] thunderbolt 0000:03:00.0: control channel stopped
> [ 1653.729362] thunderbolt 0000:03:00.0: freeing RX ring 0
> [ 1653.729381] thunderbolt 0000:03:00.0: freeing TX ring 0
> [ 1653.729407] thunderbolt 0000:03:00.0: shutdown
> [ 1653.753091] pcieport 0000:02:00.0: Refused to change power state, currently in D3
> [ 1653.756383] pci_bus 0000:03: busn_res: [bus 03] is released
> [ 1653.756676] pci_bus 0000:04: busn_res: [bus 04] is released
> [ 1653.757479] pci_bus 0000:02: busn_res: [bus 02-05] is released
> [ 1660.846964] ACPI Error: [SPRT] Namespace lookup failure, AE_ALREADY_EXISTS (20170303/dswload2-330)
> [ 1660.846979] ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20170303/psobject-241)
> [ 1660.846985] ACPI Error: Method parse/execution failed [\_GPE._E42] (Node ffff8ba73016b488), AE_ALREADY_EXISTS (20170303/psparse-543)
> [ 1660.846996] ACPI Error: Method parse/execution failed [\_GPE._E42] (Node ffff8ba73016b488), AE_ALREADY_EXISTS (20170303/psparse-543)
> [ 1660.847009] ACPI Exception: AE_ALREADY_EXISTS, while evaluating GPE method [_E42] (20170303/evgpe-646)
> [ 1660.893399] pci 0000:01:00.0: [8086:1576] type 01 class 0x060400
> [ 1660.893529] pci 0000:01:00.0: supports D1 D2
> [ 1660.893530] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [ 1660.893625] pci 0000:01:00.0: System wakeup disabled by ACPI
> [ 1660.893776] pci 0000:02:00.0: [8086:1576] type 01 class 0x060400
> [ 1660.894047] pci 0000:02:00.0: supports D1 D2
> [ 1660.894049] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [ 1660.894178] pci 0000:02:01.0: [8086:1576] type 01 class 0x060400
> [ 1660.894320] pci 0000:02:01.0: supports D1 D2
> [ 1660.894321] pci 0000:02:01.0: PME# supported from D0 D1 D2 D3hot D3cold
> [ 1660.894409] pci 0000:02:02.0: [8086:1576] type 01 class 0x060400
> [ 1660.894542] pci 0000:02:02.0: supports D1 D2
> [ 1660.894543] pci 0000:02:02.0: PME# supported from D0 D1 D2 D3hot D3cold
> [ 1660.894637] pci 0000:01:00.0: PCI bridge to [bus 02-39]
> [ 1660.894646] pci 0000:01:00.0:   bridge window [mem 0xc4000000-0xda0fffff]
> [ 1660.894652] pci 0000:01:00.0:   bridge window [mem 0xa0000000-0xc1ffffff 64bit pref]
> [ 1660.894716] pci 0000:03:00.0: [8086:1575] type 00 class 0x088000
> [ 1660.894744] pci 0000:03:00.0: reg 0x10: [mem 0xda000000-0xda03ffff]
> [ 1660.894756] pci 0000:03:00.0: reg 0x14: [mem 0xda040000-0xda040fff]
> [ 1660.894910] pci 0000:03:00.0: supports D1 D2
> [ 1660.894911] pci 0000:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [ 1660.895079] pci 0000:02:00.0: PCI bridge to [bus 03]
> [ 1660.895089] pci 0000:02:00.0:   bridge window [mem 0xda000000-0xda0fffff]
> [ 1660.895152] pci 0000:02:01.0: PCI bridge to [bus 04-38]
> [ 1660.895161] pci 0000:02:01.0:   bridge window [mem 0xc4000000-0xd9efffff]
> [ 1660.895168] pci 0000:02:01.0:   bridge window [mem 0xa0000000-0xc1ffffff 64bit pref]
> [ 1660.895222] pci 0000:02:02.0: PCI bridge to [bus 39]
> [ 1660.895231] pci 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> [ 1660.895263] pci_bus 0000:02: Allocating resources
> [ 1660.895296] pci 0000:02:01.0: bridge window [io  0x1000-0x0fff] to [bus 04-38] add_size 1000
> [ 1660.895314] pci 0000:01:00.0: bridge window [io  0x1000-0x0fff] to [bus 02-39] add_size 1000
> [ 1660.895318] pci 0000:01:00.0: BAR 13: assigned [io  0x2000-0x2fff]
> [ 1660.895321] pci 0000:02:01.0: BAR 13: assigned [io  0x2000-0x2fff]
> [ 1660.895322] pci 0000:02:00.0: PCI bridge to [bus 03]
> [ 1660.895329] pci 0000:02:00.0:   bridge window [mem 0xda000000-0xda0fffff]
> [ 1660.895338] pci 0000:02:01.0: PCI bridge to [bus 04-38]
> [ 1660.895341] pci 0000:02:01.0:   bridge window [io  0x2000-0x2fff]
> [ 1660.895346] pci 0000:02:01.0:   bridge window [mem 0xc4000000-0xd9efffff]
> [ 1660.895351] pci 0000:02:01.0:   bridge window [mem 0xa0000000-0xc1ffffff 64bit pref]
> [ 1660.895357] pci 0000:02:02.0: PCI bridge to [bus 39]
> [ 1660.895363] pci 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> [ 1660.895372] pci 0000:01:00.0: PCI bridge to [bus 02-39]
> [ 1660.895374] pci 0000:01:00.0:   bridge window [io  0x2000-0x2fff]
> [ 1660.895379] pci 0000:01:00.0:   bridge window [mem 0xc4000000-0xda0fffff]
> [ 1660.895383] pci 0000:01:00.0:   bridge window [mem 0xa0000000-0xc1ffffff 64bit pref]
> [ 1661.283910] pcieport 0000:01:00.0: enabling device (0006 -> 0007)
> [ 1661.284659] pcieport 0000:02:01.0: enabling device (0006 -> 0007)
> [ 1661.285546] thunderbolt 0000:03:00.0: NHI initialized, starting thunderbolt
> [ 1661.285550] thunderbolt 0000:03:00.0: allocating TX ring 0 of size 10
> [ 1661.285565] thunderbolt 0000:03:00.0: allocating RX ring 0 of size 10
> [ 1661.285582] thunderbolt 0000:03:00.0: control channel created
> [ 1661.285583] thunderbolt 0000:03:00.0: control channel starting...
> [ 1661.285584] thunderbolt 0000:03:00.0: starting TX ring 0
> [ 1661.285591] thunderbolt 0000:03:00.0: enabling interrupt at register 0x38200 bit 0 (0x0 -> 0x1)
> [ 1661.285592] thunderbolt 0000:03:00.0: starting RX ring 0
> [ 1661.285599] thunderbolt 0000:03:00.0: enabling interrupt at register 0x38200 bit 12 (0x1 -> 0x1001)
> [ 1661.731122] ACPI Error: Cannot release Mutex [PATM], not acquired (20170303/exmutex-393)
> [ 1661.731143] ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.ECDV._Q66] (Node ffff8ba73017bf00), AE_AML_MUTEX_NOT_ACQUIRED (20170303/psparse-543)
> [ 1662.538307] thunderbolt 0000:03:00.0: current switch config:
> [ 1662.538315] thunderbolt 0000:03:00.0:  Switch: 8086:1576 (Revision: 4, TB Version: 2)
> [ 1662.538319] thunderbolt 0000:03:00.0:   Max Port Number: 11
> [ 1662.538322] thunderbolt 0000:03:00.0:   Config:
> [ 1662.538329] thunderbolt 0000:03:00.0:    Upstream Port Number: 5 Depth: 0 Route String: 0x0 Enabled: 1, PlugEventsDelay: 254ms
> [ 1662.538333] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> [ 1662.561266] thunderbolt 0000:03:00.0: 0: uid: 0x8086a3422131ea10
> [ 1662.561856] thunderbolt 0000:03:00.0:  Port 0: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.561860] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> [ 1662.561864] thunderbolt 0000:03:00.0:   Max counters: 8
> [ 1662.561868] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [ 1662.562078] thunderbolt 0000:03:00.0:  Port 1: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.562082] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.562086] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.562090] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> [ 1662.562323] thunderbolt 0000:03:00.0:  Port 2: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.562328] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.562331] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.562335] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> [ 1662.562568] thunderbolt 0000:03:00.0:  Port 3: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.562575] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.562579] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.562583] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> [ 1662.562797] thunderbolt 0000:03:00.0:  Port 4: 8086:1576 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.562801] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.562805] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.562808] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> [ 1662.562813] thunderbolt 0000:03:00.0: 0:5: disabled by eeprom
> [ 1662.562873] thunderbolt 0000:03:00.0:  Port 6: 8086:1576 (Revision: 4, TB Version: 1, Type: PCIe (0x100101))
> [ 1662.562877] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [ 1662.562880] thunderbolt 0000:03:00.0:   Max counters: 2
> [ 1662.562884] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [ 1662.562938] thunderbolt 0000:03:00.0:  Port 7: 8086:1576 (Revision: 4, TB Version: 1, Type: PCIe (0x100101))
> [ 1662.562942] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [ 1662.562945] thunderbolt 0000:03:00.0:   Max counters: 2
> [ 1662.562949] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [ 1662.563005] thunderbolt 0000:03:00.0:  Port 8: 8086:1576 (Revision: 4, TB Version: 1, Type: DP/HDMI (0xe0102))
> [ 1662.563009] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> [ 1662.563012] thunderbolt 0000:03:00.0:   Max counters: 2
> [ 1662.563016] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [ 1662.563019] thunderbolt 0000:03:00.0: 0:9: disabled by eeprom
> [ 1662.563082] thunderbolt 0000:03:00.0:  Port 10: 8086:1576 (Revision: 4, TB Version: 1, Type: DP/HDMI (0xe0101))
> [ 1662.563085] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> [ 1662.563089] thunderbolt 0000:03:00.0:   Max counters: 2
> [ 1662.563092] thunderbolt 0000:03:00.0:   NFC Credits: 0x1000000
> [ 1662.563096] thunderbolt 0000:03:00.0: 0:b: disabled by eeprom
> [ 1662.564973] thunderbolt 0000:03:00.0: current switch config:
> [ 1662.564983] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB Version: 2)
> [ 1662.564989] thunderbolt 0000:03:00.0:   Max Port Number: 11
> [ 1662.564994] thunderbolt 0000:03:00.0:   Config:
> [ 1662.565004] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 1 Route String: 0x1 Enabled: 1, PlugEventsDelay: 254ms
> [ 1662.565011] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> [ 1662.586185] thunderbolt 0000:03:00.0: 1: reading drom (length: 0x6e)
> [ 1662.685656] thunderbolt 0000:03:00.0: 1: drom data crc32 mismatch (expected: 0xaf438340, got: 0xaf4383c0), continuing
> [ 1662.685923] thunderbolt 0000:03:00.0: 1: uid: 0xd40f7a7928c300
> [ 1662.685970] thunderbolt 0000:03:00.0:  Port 0: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.685972] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> [ 1662.685974] thunderbolt 0000:03:00.0:   Max counters: 8
> [ 1662.685976] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [ 1662.686163] thunderbolt 0000:03:00.0:  Port 1: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.686165] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.686167] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.686169] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> [ 1662.686346] thunderbolt 0000:03:00.0:  Port 2: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.686348] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.686350] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.686351] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> [ 1662.686520] thunderbolt 0000:03:00.0:  Port 3: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.686522] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.686523] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.686525] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> [ 1662.686697] thunderbolt 0000:03:00.0:  Port 4: 8086:1578 (Revision: 4, TB Version: 1, Type: Port (0x1))
> [ 1662.686698] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> [ 1662.686700] thunderbolt 0000:03:00.0:   Max counters: 16
> [ 1662.686702] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> [ 1662.686704] thunderbolt 0000:03:00.0: 1:5: disabled by eeprom
> [ 1662.686757] thunderbolt 0000:03:00.0:  Port 6: 8086:1578 (Revision: 4, TB Version: 1, Type: PCIe (0x100102))
> [ 1662.686758] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [ 1662.686760] thunderbolt 0000:03:00.0:   Max counters: 2
> [ 1662.686762] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [ 1662.686816] thunderbolt 0000:03:00.0:  Port 7: 8086:1578 (Revision: 4, TB Version: 1, Type: PCIe (0x100101))
> [ 1662.686818] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> [ 1662.686820] thunderbolt 0000:03:00.0:   Max counters: 2
> [ 1662.686822] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> [ 1662.686825] thunderbolt 0000:03:00.0: 1:8: disabled by eeprom
> [ 1662.686827] thunderbolt 0000:03:00.0: 1:9: disabled by eeprom
> [ 1662.686830] thunderbolt 0000:03:00.0: 1:a: disabled by eeprom
> [ 1662.686832] thunderbolt 0000:03:00.0: 1:b: disabled by eeprom
> [ 1662.688262] thunderbolt 0000:03:00.0: current switch config:
> [ 1662.688271] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB Version: 2)
> [ 1662.688273] thunderbolt 0000:03:00.0:   Max Port Number: 11
> [ 1662.688275] thunderbolt 0000:03:00.0:   Config:
> [ 1662.688284] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 2 Route String: 0x301 Enabled: 1, PlugEventsDelay: 254ms
> [ 1662.688287] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> [ 1666.261728] pci 0000:04:00.0: [8086:1578] type 01 class 0x060400
> [ 1666.262033] pci 0000:04:00.0: supports D1 D2
> [ 1666.262034] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [ 1666.262442] sysfs: cannot create duplicate filename '/class/pci_bus/0000:05'

This is probably due the previous problem of the PCI device being hidden
behind a bridge.

If you shutdown the machine and boot it without devices connected and
then when the OS is up, connect the device, do you see the same issue?

Also can you try so that you power off the machine completely, connect
the device and power it on. Do you see the issue?

Thanks.

[toc] | [prev] | [next] | [standalone]


#1645805 — RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

From<Mario.Limonciello@dell.com>
Date2017-05-19 20:00 +0200
SubjectRE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tIUlY-5uX-21@gated-at.bofh.it>
In reply to#1645783
> 
> It happens occasionally when you reboot the machine when a device is
> connected but seems to be dependent on the BIOS version. Since it is the
> BIOS who is supposed to enumerated these devices, I suspect that it is
> either problem in BIOS or our PCI enumeration code does something wrong.
> 

I'm fairly certain it's an issue somewhere with Linux PCI enumeration.  I took 
the exact same HW and switched it out the SSD to one w/ Win10 1607.
I set the dock and cable to "always allow" in TBT settings applet.

I don't reproduce any problems with enumeration with the dock plugged in
on cold boot.  All the devices hanging off the bridge show up properly.

> > [    7.428542] pci_bus 0000:02: Allocating resources
> > [    7.428544] pcieport 0000:02:02.0: can't claim BAR 14 [mem 0xd9f00000-
> 0xd9ffffff]: no compatible bridge window
> > [    7.451018] Bluetooth: RFCOMM TTY layer initialized
> > [    7.451022] Bluetooth: RFCOMM socket layer initialized
> > [    7.451026] Bluetooth: RFCOMM ver 1.11
> > [   11.958457] wlp58s0: authenticate with 50:6a:03:a7:1c:27
> > [   11.969167] wlp58s0: send auth to 50:6a:03:a7:1c:27 (try 1/3)
> > [   11.975768] wlp58s0: authenticated
> > [   11.976386] wlp58s0: associate with 50:6a:03:a7:1c:27 (try 1/3)
> > [   11.984817] wlp58s0: RX AssocResp from 50:6a:03:a7:1c:27 (capab=0x1411
> status=0 aid=2)
> > [   12.001864] wlp58s0: associated
> > [   12.001913] IPv6: ADDRCONF(NETDEV_CHANGE): wlp58s0: link becomes ready
> > [   27.616672] thunderbolt 0000:03:00.0: timeout reading config space 2 from 0x5
> > [   27.616674] thunderbolt 0000:03:00.0: 301: cannot find
> TB_VSEC_CAP_PLUG_EVENTS aborting
> >
> > If I then unplug the cable and plug it back in the dock does show up and authorize
> properly, but is a traceback
> > along the way.
> > ---
> > [ 1653.226296] pcieport 0000:02:02.0: Refused to change power state, currently
> in D3
> > [ 1653.729116] thunderbolt 0000:03:00.0: stopping RX ring 0
> > [ 1653.729130] thunderbolt 0000:03:00.0: disabling interrupt at register 0x38200
> bit 12 (0xffffffff -> 0xffffefff)
> > [ 1653.729159] thunderbolt 0000:03:00.0: stopping TX ring 0
> > [ 1653.729168] thunderbolt 0000:03:00.0: disabling interrupt at register 0x38200
> bit 0 (0xffffffff -> 0xfffffffe)
> > [ 1653.729195] thunderbolt 0000:03:00.0: control channel stopped
> > [ 1653.729362] thunderbolt 0000:03:00.0: freeing RX ring 0
> > [ 1653.729381] thunderbolt 0000:03:00.0: freeing TX ring 0
> > [ 1653.729407] thunderbolt 0000:03:00.0: shutdown
> > [ 1653.753091] pcieport 0000:02:00.0: Refused to change power state, currently
> in D3
> > [ 1653.756383] pci_bus 0000:03: busn_res: [bus 03] is released
> > [ 1653.756676] pci_bus 0000:04: busn_res: [bus 04] is released
> > [ 1653.757479] pci_bus 0000:02: busn_res: [bus 02-05] is released
> > [ 1660.846964] ACPI Error: [SPRT] Namespace lookup failure,
> AE_ALREADY_EXISTS (20170303/dswload2-330)
> > [ 1660.846979] ACPI Exception: AE_ALREADY_EXISTS, During name
> lookup/catalog (20170303/psobject-241)
> > [ 1660.846985] ACPI Error: Method parse/execution failed [\_GPE._E42] (Node
> ffff8ba73016b488), AE_ALREADY_EXISTS (20170303/psparse-543)
> > [ 1660.846996] ACPI Error: Method parse/execution failed [\_GPE._E42] (Node
> ffff8ba73016b488), AE_ALREADY_EXISTS (20170303/psparse-543)
> > [ 1660.847009] ACPI Exception: AE_ALREADY_EXISTS, while evaluating GPE
> method [_E42] (20170303/evgpe-646)
> > [ 1660.893399] pci 0000:01:00.0: [8086:1576] type 01 class 0x060400
> > [ 1660.893529] pci 0000:01:00.0: supports D1 D2
> > [ 1660.893530] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [ 1660.893625] pci 0000:01:00.0: System wakeup disabled by ACPI
> > [ 1660.893776] pci 0000:02:00.0: [8086:1576] type 01 class 0x060400
> > [ 1660.894047] pci 0000:02:00.0: supports D1 D2
> > [ 1660.894049] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [ 1660.894178] pci 0000:02:01.0: [8086:1576] type 01 class 0x060400
> > [ 1660.894320] pci 0000:02:01.0: supports D1 D2
> > [ 1660.894321] pci 0000:02:01.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [ 1660.894409] pci 0000:02:02.0: [8086:1576] type 01 class 0x060400
> > [ 1660.894542] pci 0000:02:02.0: supports D1 D2
> > [ 1660.894543] pci 0000:02:02.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [ 1660.894637] pci 0000:01:00.0: PCI bridge to [bus 02-39]
> > [ 1660.894646] pci 0000:01:00.0:   bridge window [mem 0xc4000000-0xda0fffff]
> > [ 1660.894652] pci 0000:01:00.0:   bridge window [mem 0xa0000000-0xc1ffffff
> 64bit pref]
> > [ 1660.894716] pci 0000:03:00.0: [8086:1575] type 00 class 0x088000
> > [ 1660.894744] pci 0000:03:00.0: reg 0x10: [mem 0xda000000-0xda03ffff]
> > [ 1660.894756] pci 0000:03:00.0: reg 0x14: [mem 0xda040000-0xda040fff]
> > [ 1660.894910] pci 0000:03:00.0: supports D1 D2
> > [ 1660.894911] pci 0000:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [ 1660.895079] pci 0000:02:00.0: PCI bridge to [bus 03]
> > [ 1660.895089] pci 0000:02:00.0:   bridge window [mem 0xda000000-0xda0fffff]
> > [ 1660.895152] pci 0000:02:01.0: PCI bridge to [bus 04-38]
> > [ 1660.895161] pci 0000:02:01.0:   bridge window [mem 0xc4000000-0xd9efffff]
> > [ 1660.895168] pci 0000:02:01.0:   bridge window [mem 0xa0000000-0xc1ffffff
> 64bit pref]
> > [ 1660.895222] pci 0000:02:02.0: PCI bridge to [bus 39]
> > [ 1660.895231] pci 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> > [ 1660.895263] pci_bus 0000:02: Allocating resources
> > [ 1660.895296] pci 0000:02:01.0: bridge window [io  0x1000-0x0fff] to [bus 04-
> 38] add_size 1000
> > [ 1660.895314] pci 0000:01:00.0: bridge window [io  0x1000-0x0fff] to [bus 02-
> 39] add_size 1000
> > [ 1660.895318] pci 0000:01:00.0: BAR 13: assigned [io  0x2000-0x2fff]
> > [ 1660.895321] pci 0000:02:01.0: BAR 13: assigned [io  0x2000-0x2fff]
> > [ 1660.895322] pci 0000:02:00.0: PCI bridge to [bus 03]
> > [ 1660.895329] pci 0000:02:00.0:   bridge window [mem 0xda000000-0xda0fffff]
> > [ 1660.895338] pci 0000:02:01.0: PCI bridge to [bus 04-38]
> > [ 1660.895341] pci 0000:02:01.0:   bridge window [io  0x2000-0x2fff]
> > [ 1660.895346] pci 0000:02:01.0:   bridge window [mem 0xc4000000-0xd9efffff]
> > [ 1660.895351] pci 0000:02:01.0:   bridge window [mem 0xa0000000-0xc1ffffff
> 64bit pref]
> > [ 1660.895357] pci 0000:02:02.0: PCI bridge to [bus 39]
> > [ 1660.895363] pci 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> > [ 1660.895372] pci 0000:01:00.0: PCI bridge to [bus 02-39]
> > [ 1660.895374] pci 0000:01:00.0:   bridge window [io  0x2000-0x2fff]
> > [ 1660.895379] pci 0000:01:00.0:   bridge window [mem 0xc4000000-0xda0fffff]
> > [ 1660.895383] pci 0000:01:00.0:   bridge window [mem 0xa0000000-0xc1ffffff
> 64bit pref]
> > [ 1661.283910] pcieport 0000:01:00.0: enabling device (0006 -> 0007)
> > [ 1661.284659] pcieport 0000:02:01.0: enabling device (0006 -> 0007)
> > [ 1661.285546] thunderbolt 0000:03:00.0: NHI initialized, starting thunderbolt
> > [ 1661.285550] thunderbolt 0000:03:00.0: allocating TX ring 0 of size 1
0
> > [ 1661.285565] thunderbolt 0000:03:00.0: allocating RX ring 0 of size 1
0
> > [ 1661.285582] thunderbolt 0000:03:00.0: control channel created
> > [ 1661.285583] thunderbolt 0000:03:00.0: control channel starting...
> > [ 1661.285584] thunderbolt 0000:03:00.0: starting TX ring 0
> > [ 1661.285591] thunderbolt 0000:03:00.0: enabling interrupt at register 0x38200
> bit 0 (0x0 -> 0x1)
> > [ 1661.285592] thunderbolt 0000:03:00.0: starting RX ring 0
> > [ 1661.285599] thunderbolt 0000:03:00.0: enabling interrupt at register 0x38200
> bit 12 (0x1 -> 0x1001)
> > [ 1661.731122] ACPI Error: Cannot release Mutex [PATM], not acquired
> (20170303/exmutex-393)
> > [ 1661.731143] ACPI Error: Method parse/execution failed
> [\_SB.PCI0.LPCB.ECDV._Q66] (Node ffff8ba73017bf00),
> AE_AML_MUTEX_NOT_ACQUIRED (20170303/psparse-543)
> > [ 1662.538307] thunderbolt 0000:03:00.0: current switch config:
> > [ 1662.538315] thunderbolt 0000:03:00.0:  Switch: 8086:1576 (Revision: 4, TB
> Version: 2)
> > [ 1662.538319] thunderbolt 0000:03:00.0:   Max Port Number: 11
> > [ 1662.538322] thunderbolt 0000:03:00.0:   Config:
> > [ 1662.538329] thunderbolt 0000:03:00.0:    Upstream Port Number: 5 Depth: 0
> Route String: 0x0 Enabled: 1, PlugEventsDelay: 254ms
> > [ 1662.538333] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> > [ 1662.561266] thunderbolt 0000:03:00.0: 0: uid: 0x8086a3422131ea10
> > [ 1662.561856] thunderbolt 0000:03:00.0:  Port 0: 8086:1576 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.561860] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> > [ 1662.561864] thunderbolt 0000:03:00.0:   Max counters: 8
> > [ 1662.561868] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > [ 1662.562078] thunderbolt 0000:03:00.0:  Port 1: 8086:1576 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.562082] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.562086] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.562090] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> > [ 1662.562323] thunderbolt 0000:03:00.0:  Port 2: 8086:1576 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.562328] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.562331] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.562335] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> > [ 1662.562568] thunderbolt 0000:03:00.0:  Port 3: 8086:1576 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.562575] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.562579] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.562583] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> > [ 1662.562797] thunderbolt 0000:03:00.0:  Port 4: 8086:1576 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.562801] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.562805] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.562808] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> > [ 1662.562813] thunderbolt 0000:03:00.0: 0:5: disabled by eeprom
> > [ 1662.562873] thunderbolt 0000:03:00.0:  Port 6: 8086:1576 (Revision: 4, TB
> Version: 1, Type: PCIe (0x100101))
> > [ 1662.562877] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > [ 1662.562880] thunderbolt 0000:03:00.0:   Max counters: 2
> > [ 1662.562884] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > [ 1662.562938] thunderbolt 0000:03:00.0:  Port 7: 8086:1576 (Revision: 4, TB
> Version: 1, Type: PCIe (0x100101))
> > [ 1662.562942] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > [ 1662.562945] thunderbolt 0000:03:00.0:   Max counters: 2
> > [ 1662.562949] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > [ 1662.563005] thunderbolt 0000:03:00.0:  Port 8: 8086:1576 (Revision: 4, TB
> Version: 1, Type: DP/HDMI (0xe0102))
> > [ 1662.563009] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> > [ 1662.563012] thunderbolt 0000:03:00.0:   Max counters: 2
> > [ 1662.563016] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > [ 1662.563019] thunderbolt 0000:03:00.0: 0:9: disabled by eeprom
> > [ 1662.563082] thunderbolt 0000:03:00.0:  Port 10: 8086:1576 (Revision: 4, TB
> Version: 1, Type: DP/HDMI (0xe0101))
> > [ 1662.563085] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> > [ 1662.563089] thunderbolt 0000:03:00.0:   Max counters: 2
> > [ 1662.563092] thunderbolt 0000:03:00.0:   NFC Credits: 0x1000000
> > [ 1662.563096] thunderbolt 0000:03:00.0: 0:b: disabled by eeprom
> > [ 1662.564973] thunderbolt 0000:03:00.0: current switch config:
> > [ 1662.564983] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB
> Version: 2)
> > [ 1662.564989] thunderbolt 0000:03:00.0:   Max Port Number: 11
> > [ 1662.564994] thunderbolt 0000:03:00.0:   Config:
> > [ 1662.565004] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 1
> Route String: 0x1 Enabled: 1, PlugEventsDelay: 254ms
> > [ 1662.565011] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> > [ 1662.586185] thunderbolt 0000:03:00.0: 1: reading drom (length: 0x6e)
> > [ 1662.685656] thunderbolt 0000:03:00.0: 1: drom data crc32 mismatch
> (expected: 0xaf438340, got: 0xaf4383c0), continuing
> > [ 1662.685923] thunderbolt 0000:03:00.0: 1: uid: 0xd40f7a7928c300
> > [ 1662.685970] thunderbolt 0000:03:00.0:  Port 0: 8086:1578 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.685972] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> > [ 1662.685974] thunderbolt 0000:03:00.0:   Max counters: 8
> > [ 1662.685976] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > [ 1662.686163] thunderbolt 0000:03:00.0:  Port 1: 8086:1578 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.686165] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.686167] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.686169] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> > [ 1662.686346] thunderbolt 0000:03:00.0:  Port 2: 8086:1578 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.686348] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.686350] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.686351] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> > [ 1662.686520] thunderbolt 0000:03:00.0:  Port 3: 8086:1578 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.686522] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.686523] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.686525] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> > [ 1662.686697] thunderbolt 0000:03:00.0:  Port 4: 8086:1578 (Revision: 4, TB
> Version: 1, Type: Port (0x1))
> > [ 1662.686698] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > [ 1662.686700] thunderbolt 0000:03:00.0:   Max counters: 16
> > [ 1662.686702] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> > [ 1662.686704] thunderbolt 0000:03:00.0: 1:5: disabled by eeprom
> > [ 1662.686757] thunderbolt 0000:03:00.0:  Port 6: 8086:1578 (Revision: 4, TB
> Version: 1, Type: PCIe (0x100102))
> > [ 1662.686758] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > [ 1662.686760] thunderbolt 0000:03:00.0:   Max counters: 2
> > [ 1662.686762] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > [ 1662.686816] thunderbolt 0000:03:00.0:  Port 7: 8086:1578 (Revision: 4, TB
> Version: 1, Type: PCIe (0x100101))
> > [ 1662.686818] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > [ 1662.686820] thunderbolt 0000:03:00.0:   Max counters: 2
> > [ 1662.686822] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > [ 1662.686825] thunderbolt 0000:03:00.0: 1:8: disabled by eeprom
> > [ 1662.686827] thunderbolt 0000:03:00.0: 1:9: disabled by eeprom
> > [ 1662.686830] thunderbolt 0000:03:00.0: 1:a: disabled by eeprom
> > [ 1662.686832] thunderbolt 0000:03:00.0: 1:b: disabled by eeprom
> > [ 1662.688262] thunderbolt 0000:03:00.0: current switch config:
> > [ 1662.688271] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB
> Version: 2)
> > [ 1662.688273] thunderbolt 0000:03:00.0:   Max Port Number: 11
> > [ 1662.688275] thunderbolt 0000:03:00.0:   Config:
> > [ 1662.688284] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 2
> Route String: 0x301 Enabled: 1, PlugEventsDelay: 254ms
> > [ 1662.688287] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> > [ 1666.261728] pci 0000:04:00.0: [8086:1578] type 01 class 0x060400
> > [ 1666.262033] pci 0000:04:00.0: supports D1 D2
> > [ 1666.262034] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [ 1666.262442] sysfs: cannot create duplicate filename '/class/pci_bus/0000:05'
> 
> This is probably due the previous problem of the PCI device being hidden
> behind a bridge.
> 
> If you shutdown the machine and boot it without devices connected and
> then when the OS is up, connect the device, do you see the same issue?
> 

The kernel traceback doesn't happen in this scenario, but if I follow these steps:
1) Boot
2) Plugin dock, make sure fully enumerated
3) Unplug
4) Replug

I get the trackeback warning about duplicate filenames again.

The second time I unplug I also get tracebacks related to a NULL pointer dereference
In kernfs_find_ns.

> Also can you try so that you power off the machine completely, connect
> the device and power it on. Do you see the issue?
> 

Yes, I do see error from the first syslog snippet about being stuck behind a host bridge.

[toc] | [prev] | [next] | [standalone]


#1646083 — Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-20 10:30 +0200
SubjectRe: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tJ7VU-76D-23@gated-at.bofh.it>
In reply to#1645805
On Fri, May 19, 2017 at 05:54:37PM +0000, Mario.Limonciello@dell.com wrote:
> > 
> > It happens occasionally when you reboot the machine when a device is
> > connected but seems to be dependent on the BIOS version. Since it is the
> > BIOS who is supposed to enumerated these devices, I suspect that it is
> > either problem in BIOS or our PCI enumeration code does something wrong.
> > 
> 
> I'm fairly certain it's an issue somewhere with Linux PCI enumeration.  I took 
> the exact same HW and switched it out the SSD to one w/ Win10 1607.
> I set the dock and cable to "always allow" in TBT settings applet.
> 
> I don't reproduce any problems with enumeration with the dock plugged in
> on cold boot.  All the devices hanging off the bridge show up properly.

You mean in Windows you don't reproduce the problem, right? Even when
you reboot the machine with devices connected.

I tried on Intel Skull Canyon NUC so that I disabled the thunderbolt
driver and after reboot (warm) I can see the PCI scan error about bus
being partially hidden behind a bridge.

When this happens PCIe ports of the thunderbolt device/host seem to be
unconfigured and Linux then decides to reconfigure them which leads to
the problem. When it works we get ACPI hotplug event to the PCIe root
port and the PCIe upstream/downstream ports are properly configured by
the BIOS.

I guess Windows does something differently here than what we do when PCI
devices are enumerated.

> > > [    7.428542] pci_bus 0000:02: Allocating resources
> > > [    7.428544] pcieport 0000:02:02.0: can't claim BAR 14 [mem 0xd9f00000-
> > 0xd9ffffff]: no compatible bridge window
> > > [    7.451018] Bluetooth: RFCOMM TTY layer initialized
> > > [    7.451022] Bluetooth: RFCOMM socket layer initialized
> > > [    7.451026] Bluetooth: RFCOMM ver 1.11
> > > [   11.958457] wlp58s0: authenticate with 50:6a:03:a7:1c:27
> > > [   11.969167] wlp58s0: send auth to 50:6a:03:a7:1c:27 (try 1/3)
> > > [   11.975768] wlp58s0: authenticated
> > > [   11.976386] wlp58s0: associate with 50:6a:03:a7:1c:27 (try 1/3)
> > > [   11.984817] wlp58s0: RX AssocResp from 50:6a:03:a7:1c:27 (capab=0x1411
> > status=0 aid=2)
> > > [   12.001864] wlp58s0: associated
> > > [   12.001913] IPv6: ADDRCONF(NETDEV_CHANGE): wlp58s0: link becomes ready
> > > [   27.616672] thunderbolt 0000:03:00.0: timeout reading config space 2 from 0x5
> > > [   27.616674] thunderbolt 0000:03:00.0: 301: cannot find
> > TB_VSEC_CAP_PLUG_EVENTS aborting
> > >
> > > If I then unplug the cable and plug it back in the dock does show up and authorize
> > properly, but is a traceback
> > > along the way.
> > > ---
> > > [ 1653.226296] pcieport 0000:02:02.0: Refused to change power state, currently
> > in D3
> > > [ 1653.729116] thunderbolt 0000:03:00.0: stopping RX ring 0
> > > [ 1653.729130] thunderbolt 0000:03:00.0: disabling interrupt at register 0x38200
> > bit 12 (0xffffffff -> 0xffffefff)
> > > [ 1653.729159] thunderbolt 0000:03:00.0: stopping TX ring 0
> > > [ 1653.729168] thunderbolt 0000:03:00.0: disabling interrupt at register 0x38200
> > bit 0 (0xffffffff -> 0xfffffffe)
> > > [ 1653.729195] thunderbolt 0000:03:00.0: control channel stopped
> > > [ 1653.729362] thunderbolt 0000:03:00.0: freeing RX ring 0
> > > [ 1653.729381] thunderbolt 0000:03:00.0: freeing TX ring 0
> > > [ 1653.729407] thunderbolt 0000:03:00.0: shutdown
> > > [ 1653.753091] pcieport 0000:02:00.0: Refused to change power state, currently
> > in D3
> > > [ 1653.756383] pci_bus 0000:03: busn_res: [bus 03] is released
> > > [ 1653.756676] pci_bus 0000:04: busn_res: [bus 04] is released
> > > [ 1653.757479] pci_bus 0000:02: busn_res: [bus 02-05] is released
> > > [ 1660.846964] ACPI Error: [SPRT] Namespace lookup failure,
> > AE_ALREADY_EXISTS (20170303/dswload2-330)
> > > [ 1660.846979] ACPI Exception: AE_ALREADY_EXISTS, During name
> > lookup/catalog (20170303/psobject-241)
> > > [ 1660.846985] ACPI Error: Method parse/execution failed [\_GPE._E42] (Node
> > ffff8ba73016b488), AE_ALREADY_EXISTS (20170303/psparse-543)
> > > [ 1660.846996] ACPI Error: Method parse/execution failed [\_GPE._E42] (Node
> > ffff8ba73016b488), AE_ALREADY_EXISTS (20170303/psparse-543)
> > > [ 1660.847009] ACPI Exception: AE_ALREADY_EXISTS, while evaluating GPE
> > method [_E42] (20170303/evgpe-646)
> > > [ 1660.893399] pci 0000:01:00.0: [8086:1576] type 01 class 0x060400
> > > [ 1660.893529] pci 0000:01:00.0: supports D1 D2
> > > [ 1660.893530] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > > [ 1660.893625] pci 0000:01:00.0: System wakeup disabled by ACPI
> > > [ 1660.893776] pci 0000:02:00.0: [8086:1576] type 01 class 0x060400
> > > [ 1660.894047] pci 0000:02:00.0: supports D1 D2
> > > [ 1660.894049] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > > [ 1660.894178] pci 0000:02:01.0: [8086:1576] type 01 class 0x060400
> > > [ 1660.894320] pci 0000:02:01.0: supports D1 D2
> > > [ 1660.894321] pci 0000:02:01.0: PME# supported from D0 D1 D2 D3hot D3cold
> > > [ 1660.894409] pci 0000:02:02.0: [8086:1576] type 01 class 0x060400
> > > [ 1660.894542] pci 0000:02:02.0: supports D1 D2
> > > [ 1660.894543] pci 0000:02:02.0: PME# supported from D0 D1 D2 D3hot D3cold
> > > [ 1660.894637] pci 0000:01:00.0: PCI bridge to [bus 02-39]
> > > [ 1660.894646] pci 0000:01:00.0:   bridge window [mem 0xc4000000-0xda0fffff]
> > > [ 1660.894652] pci 0000:01:00.0:   bridge window [mem 0xa0000000-0xc1ffffff
> > 64bit pref]
> > > [ 1660.894716] pci 0000:03:00.0: [8086:1575] type 00 class 0x088000
> > > [ 1660.894744] pci 0000:03:00.0: reg 0x10: [mem 0xda000000-0xda03ffff]
> > > [ 1660.894756] pci 0000:03:00.0: reg 0x14: [mem 0xda040000-0xda040fff]
> > > [ 1660.894910] pci 0000:03:00.0: supports D1 D2
> > > [ 1660.894911] pci 0000:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > > [ 1660.895079] pci 0000:02:00.0: PCI bridge to [bus 03]
> > > [ 1660.895089] pci 0000:02:00.0:   bridge window [mem 0xda000000-0xda0fffff]
> > > [ 1660.895152] pci 0000:02:01.0: PCI bridge to [bus 04-38]
> > > [ 1660.895161] pci 0000:02:01.0:   bridge window [mem 0xc4000000-0xd9efffff]
> > > [ 1660.895168] pci 0000:02:01.0:   bridge window [mem 0xa0000000-0xc1ffffff
> > 64bit pref]
> > > [ 1660.895222] pci 0000:02:02.0: PCI bridge to [bus 39]
> > > [ 1660.895231] pci 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> > > [ 1660.895263] pci_bus 0000:02: Allocating resources
> > > [ 1660.895296] pci 0000:02:01.0: bridge window [io  0x1000-0x0fff] to [bus 04-
> > 38] add_size 1000
> > > [ 1660.895314] pci 0000:01:00.0: bridge window [io  0x1000-0x0fff] to [bus 02-
> > 39] add_size 1000
> > > [ 1660.895318] pci 0000:01:00.0: BAR 13: assigned [io  0x2000-0x2fff]
> > > [ 1660.895321] pci 0000:02:01.0: BAR 13: assigned [io  0x2000-0x2fff]
> > > [ 1660.895322] pci 0000:02:00.0: PCI bridge to [bus 03]
> > > [ 1660.895329] pci 0000:02:00.0:   bridge window [mem 0xda000000-0xda0fffff]
> > > [ 1660.895338] pci 0000:02:01.0: PCI bridge to [bus 04-38]
> > > [ 1660.895341] pci 0000:02:01.0:   bridge window [io  0x2000-0x2fff]
> > > [ 1660.895346] pci 0000:02:01.0:   bridge window [mem 0xc4000000-0xd9efffff]
> > > [ 1660.895351] pci 0000:02:01.0:   bridge window [mem 0xa0000000-0xc1ffffff
> > 64bit pref]
> > > [ 1660.895357] pci 0000:02:02.0: PCI bridge to [bus 39]
> > > [ 1660.895363] pci 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> > > [ 1660.895372] pci 0000:01:00.0: PCI bridge to [bus 02-39]
> > > [ 1660.895374] pci 0000:01:00.0:   bridge window [io  0x2000-0x2fff]
> > > [ 1660.895379] pci 0000:01:00.0:   bridge window [mem 0xc4000000-0xda0fffff]
> > > [ 1660.895383] pci 0000:01:00.0:   bridge window [mem 0xa0000000-0xc1ffffff
> > 64bit pref]
> > > [ 1661.283910] pcieport 0000:01:00.0: enabling device (0006 -> 0007)
> > > [ 1661.284659] pcieport 0000:02:01.0: enabling device (0006 -> 0007)
> > > [ 1661.285546] thunderbolt 0000:03:00.0: NHI initialized, starting thunderbolt
> > > [ 1661.285550] thunderbolt 0000:03:00.0: allocating TX ring 0 of size 10
> > > [ 1661.285565] thunderbolt 0000:03:00.0: allocating RX ring 0 of size 10
> > > [ 1661.285582] thunderbolt 0000:03:00.0: control channel created
> > > [ 1661.285583] thunderbolt 0000:03:00.0: control channel starting...
> > > [ 1661.285584] thunderbolt 0000:03:00.0: starting TX ring 0
> > > [ 1661.285591] thunderbolt 0000:03:00.0: enabling interrupt at register 0x38200
> > bit 0 (0x0 -> 0x1)
> > > [ 1661.285592] thunderbolt 0000:03:00.0: starting RX ring 0
> > > [ 1661.285599] thunderbolt 0000:03:00.0: enabling interrupt at register 0x38200
> > bit 12 (0x1 -> 0x1001)
> > > [ 1661.731122] ACPI Error: Cannot release Mutex [PATM], not acquired
> > (20170303/exmutex-393)
> > > [ 1661.731143] ACPI Error: Method parse/execution failed
> > [\_SB.PCI0.LPCB.ECDV._Q66] (Node ffff8ba73017bf00),
> > AE_AML_MUTEX_NOT_ACQUIRED (20170303/psparse-543)
> > > [ 1662.538307] thunderbolt 0000:03:00.0: current switch config:
> > > [ 1662.538315] thunderbolt 0000:03:00.0:  Switch: 8086:1576 (Revision: 4, TB
> > Version: 2)
> > > [ 1662.538319] thunderbolt 0000:03:00.0:   Max Port Number: 11
> > > [ 1662.538322] thunderbolt 0000:03:00.0:   Config:
> > > [ 1662.538329] thunderbolt 0000:03:00.0:    Upstream Port Number: 5 Depth: 0
> > Route String: 0x0 Enabled: 1, PlugEventsDelay: 254ms
> > > [ 1662.538333] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> > > [ 1662.561266] thunderbolt 0000:03:00.0: 0: uid: 0x8086a3422131ea10
> > > [ 1662.561856] thunderbolt 0000:03:00.0:  Port 0: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.561860] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> > > [ 1662.561864] thunderbolt 0000:03:00.0:   Max counters: 8
> > > [ 1662.561868] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > > [ 1662.562078] thunderbolt 0000:03:00.0:  Port 1: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.562082] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.562086] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.562090] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> > > [ 1662.562323] thunderbolt 0000:03:00.0:  Port 2: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.562328] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.562331] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.562335] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> > > [ 1662.562568] thunderbolt 0000:03:00.0:  Port 3: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.562575] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.562579] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.562583] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> > > [ 1662.562797] thunderbolt 0000:03:00.0:  Port 4: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.562801] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.562805] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.562808] thunderbolt 0000:03:00.0:   NFC Credits: 0x3c00000
> > > [ 1662.562813] thunderbolt 0000:03:00.0: 0:5: disabled by eeprom
> > > [ 1662.562873] thunderbolt 0000:03:00.0:  Port 6: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: PCIe (0x100101))
> > > [ 1662.562877] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > > [ 1662.562880] thunderbolt 0000:03:00.0:   Max counters: 2
> > > [ 1662.562884] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > > [ 1662.562938] thunderbolt 0000:03:00.0:  Port 7: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: PCIe (0x100101))
> > > [ 1662.562942] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > > [ 1662.562945] thunderbolt 0000:03:00.0:   Max counters: 2
> > > [ 1662.562949] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > > [ 1662.563005] thunderbolt 0000:03:00.0:  Port 8: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: DP/HDMI (0xe0102))
> > > [ 1662.563009] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> > > [ 1662.563012] thunderbolt 0000:03:00.0:   Max counters: 2
> > > [ 1662.563016] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > > [ 1662.563019] thunderbolt 0000:03:00.0: 0:9: disabled by eeprom
> > > [ 1662.563082] thunderbolt 0000:03:00.0:  Port 10: 8086:1576 (Revision: 4, TB
> > Version: 1, Type: DP/HDMI (0xe0101))
> > > [ 1662.563085] thunderbolt 0000:03:00.0:   Max hop id (in/out): 9/9
> > > [ 1662.563089] thunderbolt 0000:03:00.0:   Max counters: 2
> > > [ 1662.563092] thunderbolt 0000:03:00.0:   NFC Credits: 0x1000000
> > > [ 1662.563096] thunderbolt 0000:03:00.0: 0:b: disabled by eeprom
> > > [ 1662.564973] thunderbolt 0000:03:00.0: current switch config:
> > > [ 1662.564983] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB
> > Version: 2)
> > > [ 1662.564989] thunderbolt 0000:03:00.0:   Max Port Number: 11
> > > [ 1662.564994] thunderbolt 0000:03:00.0:   Config:
> > > [ 1662.565004] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 1
> > Route String: 0x1 Enabled: 1, PlugEventsDelay: 254ms
> > > [ 1662.565011] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> > > [ 1662.586185] thunderbolt 0000:03:00.0: 1: reading drom (length: 0x6e)
> > > [ 1662.685656] thunderbolt 0000:03:00.0: 1: drom data crc32 mismatch
> > (expected: 0xaf438340, got: 0xaf4383c0), continuing
> > > [ 1662.685923] thunderbolt 0000:03:00.0: 1: uid: 0xd40f7a7928c300
> > > [ 1662.685970] thunderbolt 0000:03:00.0:  Port 0: 8086:1578 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.685972] thunderbolt 0000:03:00.0:   Max hop id (in/out): 7/7
> > > [ 1662.685974] thunderbolt 0000:03:00.0:   Max counters: 8
> > > [ 1662.685976] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > > [ 1662.686163] thunderbolt 0000:03:00.0:  Port 1: 8086:1578 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.686165] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.686167] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.686169] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> > > [ 1662.686346] thunderbolt 0000:03:00.0:  Port 2: 8086:1578 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.686348] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.686350] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.686351] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> > > [ 1662.686520] thunderbolt 0000:03:00.0:  Port 3: 8086:1578 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.686522] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.686523] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.686525] thunderbolt 0000:03:00.0:   NFC Credits: 0x7800000
> > > [ 1662.686697] thunderbolt 0000:03:00.0:  Port 4: 8086:1578 (Revision: 4, TB
> > Version: 1, Type: Port (0x1))
> > > [ 1662.686698] thunderbolt 0000:03:00.0:   Max hop id (in/out): 15/15
> > > [ 1662.686700] thunderbolt 0000:03:00.0:   Max counters: 16
> > > [ 1662.686702] thunderbolt 0000:03:00.0:   NFC Credits: 0x0
> > > [ 1662.686704] thunderbolt 0000:03:00.0: 1:5: disabled by eeprom
> > > [ 1662.686757] thunderbolt 0000:03:00.0:  Port 6: 8086:1578 (Revision: 4, TB
> > Version: 1, Type: PCIe (0x100102))
> > > [ 1662.686758] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > > [ 1662.686760] thunderbolt 0000:03:00.0:   Max counters: 2
> > > [ 1662.686762] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > > [ 1662.686816] thunderbolt 0000:03:00.0:  Port 7: 8086:1578 (Revision: 4, TB
> > Version: 1, Type: PCIe (0x100101))
> > > [ 1662.686818] thunderbolt 0000:03:00.0:   Max hop id (in/out): 8/8
> > > [ 1662.686820] thunderbolt 0000:03:00.0:   Max counters: 2
> > > [ 1662.686822] thunderbolt 0000:03:00.0:   NFC Credits: 0x800000
> > > [ 1662.686825] thunderbolt 0000:03:00.0: 1:8: disabled by eeprom
> > > [ 1662.686827] thunderbolt 0000:03:00.0: 1:9: disabled by eeprom
> > > [ 1662.686830] thunderbolt 0000:03:00.0: 1:a: disabled by eeprom
> > > [ 1662.686832] thunderbolt 0000:03:00.0: 1:b: disabled by eeprom
> > > [ 1662.688262] thunderbolt 0000:03:00.0: current switch config:
> > > [ 1662.688271] thunderbolt 0000:03:00.0:  Switch: 8086:1578 (Revision: 4, TB
> > Version: 2)
> > > [ 1662.688273] thunderbolt 0000:03:00.0:   Max Port Number: 11
> > > [ 1662.688275] thunderbolt 0000:03:00.0:   Config:
> > > [ 1662.688284] thunderbolt 0000:03:00.0:    Upstream Port Number: 1 Depth: 2
> > Route String: 0x301 Enabled: 1, PlugEventsDelay: 254ms
> > > [ 1662.688287] thunderbolt 0000:03:00.0:    unknown1: 0x0 unknown4: 0x0
> > > [ 1666.261728] pci 0000:04:00.0: [8086:1578] type 01 class 0x060400
> > > [ 1666.262033] pci 0000:04:00.0: supports D1 D2
> > > [ 1666.262034] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > > [ 1666.262442] sysfs: cannot create duplicate filename '/class/pci_bus/0000:05'
> > 
> > This is probably due the previous problem of the PCI device being hidden
> > behind a bridge.
> > 
> > If you shutdown the machine and boot it without devices connected and
> > then when the OS is up, connect the device, do you see the same issue?
> > 
> 
> The kernel traceback doesn't happen in this scenario, but if I follow these steps:
> 1) Boot
> 2) Plugin dock, make sure fully enumerated
> 3) Unplug
> 4) Replug
> 
> I get the trackeback warning about duplicate filenames again.

Can you send me full dmesg when you do the above steps?

> The second time I unplug I also get tracebacks related to a NULL pointer dereference
> In kernfs_find_ns.

Yes, it starts to break down when the PCI device is left there and tried
to be added back after hotplug.

[toc] | [prev] | [next] | [standalone]


#1646772 — Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-22 13:40 +0200
SubjectRe: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tJTQS-56Q-13@gated-at.bofh.it>
In reply to#1646083
On Sat, May 20, 2017 at 11:24:12AM +0300, Mika Westerberg wrote:
> On Fri, May 19, 2017 at 05:54:37PM +0000, Mario.Limonciello@dell.com wrote:
> > > 
> > > It happens occasionally when you reboot the machine when a device is
> > > connected but seems to be dependent on the BIOS version. Since it is the
> > > BIOS who is supposed to enumerated these devices, I suspect that it is
> > > either problem in BIOS or our PCI enumeration code does something wrong.
> > > 
> > 
> > I'm fairly certain it's an issue somewhere with Linux PCI enumeration.  I took 
> > the exact same HW and switched it out the SSD to one w/ Win10 1607.
> > I set the dock and cable to "always allow" in TBT settings applet.
> > 
> > I don't reproduce any problems with enumeration with the dock plugged in
> > on cold boot.  All the devices hanging off the bridge show up properly.
> 
> You mean in Windows you don't reproduce the problem, right? Even when
> you reboot the machine with devices connected.
> 
> I tried on Intel Skull Canyon NUC so that I disabled the thunderbolt
> driver and after reboot (warm) I can see the PCI scan error about bus
> being partially hidden behind a bridge.
> 
> When this happens PCIe ports of the thunderbolt device/host seem to be
> unconfigured and Linux then decides to reconfigure them which leads to
> the problem. When it works we get ACPI hotplug event to the PCIe root
> port and the PCIe upstream/downstream ports are properly configured by
> the BIOS.
> 
> I guess Windows does something differently here than what we do when PCI
> devices are enumerated.

We discussed this with our BIOS/firmware people and there was a firmware
bug that caused many issues around hotplug and reboot flows. Is is
possible for you to try with the latest BIOS and see if the issue
reproduces (or are you already running the latest)?

[toc] | [prev] | [next] | [standalone]


#1647332 — RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

From<Mario.Limonciello@dell.com>
Date2017-05-22 22:10 +0200
SubjectRE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tK1Oq-1JR-23@gated-at.bofh.it>
In reply to#1646772
> -----Original Message-----
> From: Mika Westerberg [mailto:mika.westerberg@linux.intel.com]
> Sent: Monday, May 22, 2017 6:37 AM
> To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com;
> michael.jamet@intel.com; yehezkel.bernat@intel.com; lukas@wunner.de;
> amir.jer.levy@intel.com; luto@kernel.org; Dominguez, Jared
> <Jared_Dominguez@DELL.com>; andriy.shevchenko@linux.intel.com; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
> 
> On Sat, May 20, 2017 at 11:24:12AM +0300, Mika Westerberg wrote:
> > On Fri, May 19, 2017 at 05:54:37PM +0000, Mario.Limonciello@dell.com wrote:
> > > >
> > > > It happens occasionally when you reboot the machine when a device is
> > > > connected but seems to be dependent on the BIOS version. Since it is the
> > > > BIOS who is supposed to enumerated these devices, I suspect that it is
> > > > either problem in BIOS or our PCI enumeration code does something wrong.
> > > >
> > >
> > > I'm fairly certain it's an issue somewhere with Linux PCI enumeration.  I took
> > > the exact same HW and switched it out the SSD to one w/ Win10 1607.
> > > I set the dock and cable to "always allow" in TBT settings applet.
> > >
> > > I don't reproduce any problems with enumeration with the dock plugged in
> > > on cold boot.  All the devices hanging off the bridge show up properly.
> >
> > You mean in Windows you don't reproduce the problem, right? Even when
> > you reboot the machine with devices connected.
> >
> > I tried on Intel Skull Canyon NUC so that I disabled the thunderbolt
> > driver and after reboot (warm) I can see the PCI scan error about bus
> > being partially hidden behind a bridge.
> >
> > When this happens PCIe ports of the thunderbolt device/host seem to be
> > unconfigured and Linux then decides to reconfigure them which leads to
> > the problem. When it works we get ACPI hotplug event to the PCIe root
> > port and the PCIe upstream/downstream ports are properly configured by
> > the BIOS.
> >
> > I guess Windows does something differently here than what we do when PCI
> > devices are enumerated.
> 
> We discussed this with our BIOS/firmware people and there was a firmware
> bug that caused many issues around hotplug and reboot flows. Is is
> possible for you to try with the latest BIOS and see if the issue
> reproduces (or are you already running the latest)?

I was 1 version behind, but I double checked with the latest version (1.1.15)
and the same behavior exists on Linux (still works properly on Win10).

If you have some more details about what the FW guys changed, I can check
with my Dell FW team if they've picked up the same fix.  I'm guessing it's not
the same problem though considering it works properly on Win10?

[toc] | [prev] | [next] | [standalone]


#1647341 — RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

From"Bernat, Yehezkel" <yehezkel.bernat@intel.com>
Date2017-05-22 22:20 +0200
SubjectRE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tK1Y6-1N3-31@gated-at.bofh.it>
In reply to#1647332

> -----Original Message-----
> From: Mario.Limonciello@dell.com [mailto:Mario.Limonciello@dell.com]
> Sent: Monday, May 22, 2017 23:08
> To: mika.westerberg@linux.intel.com
> Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com; Jamet,
> Michael <michael.jamet@intel.com>; Bernat, Yehezkel
> <yehezkel.bernat@intel.com>; lukas@wunner.de; Levy, Amir (Jer)
> <amir.jer.levy@intel.com>; luto@kernel.org; Jared.Dominguez@dell.com;
> andriy.shevchenko@linux.intel.com; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware
> upgrade
> 
> > -----Original Message-----
> > From: Mika Westerberg [mailto:mika.westerberg@linux.intel.com]
> > Sent: Monday, May 22, 2017 6:37 AM
> > To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> > Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com;
> > michael.jamet@intel.com; yehezkel.bernat@intel.com; lukas@wunner.de;
> > amir.jer.levy@intel.com; luto@kernel.org; Dominguez, Jared
> > <Jared_Dominguez@DELL.com>; andriy.shevchenko@linux.intel.com;
> linux-
> > kernel@vger.kernel.org
> > Subject: Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware
> upgrade
> >
> > On Sat, May 20, 2017 at 11:24:12AM +0300, Mika Westerberg wrote:
> > > On Fri, May 19, 2017 at 05:54:37PM +0000, Mario.Limonciello@dell.com
> wrote:
> > > > >
> > > > > It happens occasionally when you reboot the machine when a device
> is
> > > > > connected but seems to be dependent on the BIOS version. Since it is
> the
> > > > > BIOS who is supposed to enumerated these devices, I suspect that it
> is
> > > > > either problem in BIOS or our PCI enumeration code does something
> wrong.
> > > > >
> > > >
> > > > I'm fairly certain it's an issue somewhere with Linux PCI enumeration.  I
> took
> > > > the exact same HW and switched it out the SSD to one w/ Win10 1607.
> > > > I set the dock and cable to "always allow" in TBT settings applet.
> > > >
> > > > I don't reproduce any problems with enumeration with the dock
> plugged in
> > > > on cold boot.  All the devices hanging off the bridge show up properly.
> > >
> > > You mean in Windows you don't reproduce the problem, right? Even
> when
> > > you reboot the machine with devices connected.
> > >
> > > I tried on Intel Skull Canyon NUC so that I disabled the thunderbolt
> > > driver and after reboot (warm) I can see the PCI scan error about bus
> > > being partially hidden behind a bridge.
> > >
> > > When this happens PCIe ports of the thunderbolt device/host seem to
> be
> > > unconfigured and Linux then decides to reconfigure them which leads to
> > > the problem. When it works we get ACPI hotplug event to the PCIe root
> > > port and the PCIe upstream/downstream ports are properly configured
> by
> > > the BIOS.
> > >
> > > I guess Windows does something differently here than what we do when
> PCI
> > > devices are enumerated.
> >
> > We discussed this with our BIOS/firmware people and there was a
> firmware
> > bug that caused many issues around hotplug and reboot flows. Is is
> > possible for you to try with the latest BIOS and see if the issue
> > reproduces (or are you already running the latest)?
> 
> I was 1 version behind, but I double checked with the latest version (1.1.15)
> and the same behavior exists on Linux (still works properly on Win10).
> 
> If you have some more details about what the FW guys changed, I can check
> with my Dell FW team if they've picked up the same fix.  I'm guessing it's not
> the same problem though considering it works properly on Win10?

What about the TBT NVM version?
NVM 16 sounds a bit old to me.

[toc] | [prev] | [next] | [standalone]


#1647503 — RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

From<Mario.Limonciello@dell.com>
Date2017-05-23 02:00 +0200
SubjectRE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tK5p0-3MF-15@gated-at.bofh.it>
In reply to#1647341
> -----Original Message-----
> From: Bernat, Yehezkel [mailto:yehezkel.bernat@intel.com]
> Sent: Monday, May 22, 2017 3:11 PM
> To: Limonciello, Mario <Mario_Limonciello@Dell.com>;
> mika.westerberg@linux.intel.com
> Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com; Jamet, Michael
> <michael.jamet@intel.com>; lukas@wunner.de; Levy, Amir (Jer)
> <amir.jer.levy@intel.com>; luto@kernel.org; Dominguez, Jared
> <Jared_Dominguez@DELL.com>; andriy.shevchenko@linux.intel.com; linux-
> kernel@vger.kernel.org
> Subject: RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
> 
> 
> 
> > -----Original Message-----
> > From: Mario.Limonciello@dell.com [mailto:Mario.Limonciello@dell.com]
> > Sent: Monday, May 22, 2017 23:08
> > To: mika.westerberg@linux.intel.com
> > Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com; Jamet,
> > Michael <michael.jamet@intel.com>; Bernat, Yehezkel
> > <yehezkel.bernat@intel.com>; lukas@wunner.de; Levy, Amir (Jer)
> > <amir.jer.levy@intel.com>; luto@kernel.org; Jared.Dominguez@dell.com;
> > andriy.shevchenko@linux.intel.com; linux-kernel@vger.kernel.org
> > Subject: RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware
> > upgrade
> >
> > > -----Original Message-----
> > > From: Mika Westerberg [mailto:mika.westerberg@linux.intel.com]
> > > Sent: Monday, May 22, 2017 6:37 AM
> > > To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> > > Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com;
> > > michael.jamet@intel.com; yehezkel.bernat@intel.com; lukas@wunner.de;
> > > amir.jer.levy@intel.com; luto@kernel.org; Dominguez, Jared
> > > <Jared_Dominguez@DELL.com>; andriy.shevchenko@linux.intel.com;
> > linux-
> > > kernel@vger.kernel.org
> > > Subject: Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware
> > upgrade
> > >
> > > On Sat, May 20, 2017 at 11:24:12AM +0300, Mika Westerberg wrote:
> > > > On Fri, May 19, 2017 at 05:54:37PM +0000, Mario.Limonciello@dell.com
> > wrote:
> > > > > >
> > > > > > It happens occasionally when you reboot the machine when a device
> > is
> > > > > > connected but seems to be dependent on the BIOS version. Since it is
> > the
> > > > > > BIOS who is supposed to enumerated these devices, I suspect that it
> > is
> > > > > > either problem in BIOS or our PCI enumeration code does something
> > wrong.
> > > > > >
> > > > >
> > > > > I'm fairly certain it's an issue somewhere with Linux PCI enumeration.  I
> > took
> > > > > the exact same HW and switched it out the SSD to one w/ Win10 1607.
> > > > > I set the dock and cable to "always allow" in TBT settings applet.
> > > > >
> > > > > I don't reproduce any problems with enumeration with the dock
> > plugged in
> > > > > on cold boot.  All the devices hanging off the bridge show up properly.
> > > >
> > > > You mean in Windows you don't reproduce the problem, right? Even
> > when
> > > > you reboot the machine with devices connected.
> > > >
> > > > I tried on Intel Skull Canyon NUC so that I disabled the thunderbolt
> > > > driver and after reboot (warm) I can see the PCI scan error about bus
> > > > being partially hidden behind a bridge.
> > > >
> > > > When this happens PCIe ports of the thunderbolt device/host seem to
> > be
> > > > unconfigured and Linux then decides to reconfigure them which leads to
> > > > the problem. When it works we get ACPI hotplug event to the PCIe root
> > > > port and the PCIe upstream/downstream ports are properly configured
> > by
> > > > the BIOS.
> > > >
> > > > I guess Windows does something differently here than what we do when
> > PCI
> > > > devices are enumerated.
> > >
> > > We discussed this with our BIOS/firmware people and there was a
> > firmware
> > > bug that caused many issues around hotplug and reboot flows. Is is
> > > possible for you to try with the latest BIOS and see if the issue
> > > reproduces (or are you already running the latest)?
> >
> > I was 1 version behind, but I double checked with the latest version (1.1.15)
> > and the same behavior exists on Linux (still works properly on Win10).
> >
> > If you have some more details about what the FW guys changed, I can check
> > with my Dell FW team if they've picked up the same fix.  I'm guessing it's not
> > the same problem though considering it works properly on Win10?
> 
> What about the TBT NVM version?
> NVM 16 sounds a bit old to me.

16 is the latest available for the XPS 9350.  I'd guess it's got to do with the stepping
of AR, but I don't know for sure.

[toc] | [prev] | [next] | [standalone]


#1647382 — Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-22 23:00 +0200
SubjectRe: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tK2AO-1ZI-19@gated-at.bofh.it>
In reply to#1647332
On Mon, May 22, 2017 at 08:07:54PM +0000, Mario.Limonciello@dell.com wrote:
> I was 1 version behind, but I double checked with the latest version (1.1.15)
> and the same behavior exists on Linux (still works properly on Win10).
> 
> If you have some more details about what the FW guys changed, I can check
> with my Dell FW team if they've picked up the same fix.  I'm guessing it's not
> the same problem though considering it works properly on Win10?

Can you send me full dmesg preferably so that you have acpiphp.dyndbg in
the kernel command line (you also need to have CONFIG_DYNAMIC_DEBUG=y)?

It is possible that Windows does ACPI hotplug differently, for example
it could add some delay somewhere and that is enough for the firmware to
get the bridges initialized properly where as in Linux we only see the
bridge when it is in the middle of the initialization or so. When it
works properly Linux should see all the PCI bridges configured properly
by the BIOS SMI handler.

[toc] | [prev] | [next] | [standalone]


#1649476 — Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-24 13:20 +0200
SubjectRe: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tKCuC-1DS-5@gated-at.bofh.it>
In reply to#1647382
On Tue, May 23, 2017 at 05:30:43PM +0000, Mario.Limonciello@dell.com wrote:
> (Sorry my email client is not going to wrap these at 80 columns)o

That's fine. It is more readable this way :)

> [    0.467319] pci 0000:00:1c.0: [8086:9d10] type 01 class 0x060400
> [    0.467389] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
> [    0.467513] pci 0000:00:1c.0: System wakeup disabled by ACPI

[...]

> [    0.469363] pci 0000:01:00.0: [8086:1576] type 01 class 0x060400
> [    0.469483] pci 0000:01:00.0: supports D1 D2
> [    0.469484] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    0.469570] pci 0000:01:00.0: System wakeup disabled by ACPI
> [    0.469609] pci 0000:00:1c.0: PCI bridge to [bus 01-39]
> [    0.469614] pci 0000:00:1c.0:   bridge window [mem 0xc4000000-0xda0fffff]
> [    0.469618] pci 0000:00:1c.0:   bridge window [mem 0xa0000000-0xc1ffffff 64bit pref]
> [    0.469621] pci 0000:01:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring

This is the problem. Here the PCIe upstream port (0000:01:00.0) is
visible to Linux but it is not fully configured by the BIOS ->
(primary/secondary/subordinate) is set to 0.

At this point Linux decides to configure the port itself and goes wrong
since our allocation strategy tries to keep resource windows, including
reserved buses as small as possible so that everything we currently find
barely fits there.

This continues few lines below:

> [    0.469670] pci_bus 0000:02: busn_res: can not insert [bus 02-ff] under [bus 01-39] (conflicts with (null) [bus 01-39])
> [    0.469688] pci 0000:02:00.0: [8086:1576] type 01 class 0x060400
> [    0.469809] pci 0000:02:00.0: supports D1 D2
> [    0.469810] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    0.469877] pci 0000:02:01.0: [8086:1576] type 01 class 0x060400
> [    0.470000] pci 0000:02:01.0: supports D1 D2
> [    0.470001] pci 0000:02:01.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    0.470067] pci 0000:02:02.0: [8086:1576] type 01 class 0x060400
> [    0.470188] pci 0000:02:02.0: supports D1 D2
> [    0.470189] pci 0000:02:02.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    0.470277] pci 0000:01:00.0: PCI bridge to [bus 02-ff]
> [    0.470283] pci 0000:01:00.0:   bridge window [io  0x0000-0x0fff]
> [    0.470287] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff]
> [    0.470294] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff 64bit pref]
> [    0.470296] pci 0000:02:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
> [    0.470304] pci 0000:02:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
> [    0.470312] pci 0000:02:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring

Here.

And ends up in failure when we create PCIe tunnels later on.

Now, this is probably where Windows does something else, like it may
skip re-configuring phase which could explain why it works. However, to
me this looks pretty much like a bug in the BIOS/firmware as we are
expecting the BIOS to configure the PCIe devices properly before the OS
is send ACPI hotplug event.

We need to handle this in Linux in the same way Windows does but
currently I have no idea. It is however, more related to our PCI
enumeration code than the patches in question, I think.

I also have a Dell 9350 here so I can reproduce the problem and I'm
going to investigate this further probably involving Linux PCI people.

My testing on the machine shows this behaviour only when the cable is
connected during boot.

If I connect the cable after OS is booted I don't see the problem, even
if I do unplug / plug cycle.

Can you try that also (again)? And if you see the problem, send me the
dmesg? I have the latest BIOS (1.4.17) and NVM 16 so this machine
configuration should match yours if I'm not mistaken.

[toc] | [prev] | [next] | [standalone]


#1649867 — RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

From<Mario.Limonciello@dell.com>
Date2017-05-24 21:10 +0200
SubjectRE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tKJPr-6hN-11@gated-at.bofh.it>
In reply to#1649476
> -----Original Message-----
> From: Mika Westerberg [mailto:mika.westerberg@linux.intel.com]
> Sent: Wednesday, May 24, 2017 6:11 AM
> To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com;
> michael.jamet@intel.com; yehezkel.bernat@intel.com; lukas@wunner.de;
> amir.jer.levy@intel.com; luto@kernel.org; Dominguez, Jared
> <Jared_Dominguez@DELL.com>; andriy.shevchenko@linux.intel.com; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
> 
> On Tue, May 23, 2017 at 05:30:43PM +0000, Mario.Limonciello@dell.com wrote:
> > (Sorry my email client is not going to wrap these at 80 columns)o
> 
> That's fine. It is more readable this way :)
> 
> > [    0.467319] pci 0000:00:1c.0: [8086:9d10] type 01 class 0x060400
> > [    0.467389] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
> > [    0.467513] pci 0000:00:1c.0: System wakeup disabled by ACPI
> 
> [...]
> 
> > [    0.469363] pci 0000:01:00.0: [8086:1576] type 01 class 0x060400
> > [    0.469483] pci 0000:01:00.0: supports D1 D2
> > [    0.469484] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [    0.469570] pci 0000:01:00.0: System wakeup disabled by ACPI
> > [    0.469609] pci 0000:00:1c.0: PCI bridge to [bus 01-39]
> > [    0.469614] pci 0000:00:1c.0:   bridge window [mem 0xc4000000-0xda0fffff]
> > [    0.469618] pci 0000:00:1c.0:   bridge window [mem 0xa0000000-0xc1ffffff
> 64bit pref]
> > [    0.469621] pci 0000:01:00.0: bridge configuration invalid ([bus 00-00]),
> reconfiguring
> 
> This is the problem. Here the PCIe upstream port (0000:01:00.0) is
> visible to Linux but it is not fully configured by the BIOS ->
> (primary/secondary/subordinate) is set to 0.

So at least for me the other difference between a successful run (where you plug
in after boot instead) is that it shows up as instead:
PCI bridge to [bus 02-39]

Same bridge window though.

> 
> At this point Linux decides to configure the port itself and goes wrong
> since our allocation strategy tries to keep resource windows, including
> reserved buses as small as possible so that everything we currently find
> barely fits there.
> 
> This continues few lines below:
> 
> > [    0.469670] pci_bus 0000:02: busn_res: can not insert [bus 02-ff] under [bus 01-
> 39] (conflicts with (null) [bus 01-39])
> > [    0.469688] pci 0000:02:00.0: [8086:1576] type 01 class 0x060400
> > [    0.469809] pci 0000:02:00.0: supports D1 D2
> > [    0.469810] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [    0.469877] pci 0000:02:01.0: [8086:1576] type 01 class 0x060400
> > [    0.470000] pci 0000:02:01.0: supports D1 D2
> > [    0.470001] pci 0000:02:01.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [    0.470067] pci 0000:02:02.0: [8086:1576] type 01 class 0x060400
> > [    0.470188] pci 0000:02:02.0: supports D1 D2
> > [    0.470189] pci 0000:02:02.0: PME# supported from D0 D1 D2 D3hot D3cold
> > [    0.470277] pci 0000:01:00.0: PCI bridge to [bus 02-ff]
> > [    0.470283] pci 0000:01:00.0:   bridge window [io  0x0000-0x0fff]
> > [    0.470287] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff]
> > [    0.470294] pci 0000:01:00.0:   bridge window [mem 0x00000000-0x000fffff
> 64bit pref]
> > [    0.470296] pci 0000:02:00.0: bridge configuration invalid ([bus 00-00]),
> reconfiguring
> > [    0.470304] pci 0000:02:01.0: bridge configuration invalid ([bus 00-00]),
> reconfiguring
> > [    0.470312] pci 0000:02:02.0: bridge configuration invalid ([bus 00-00]),
> reconfiguring
> 
> Here.
> 
> And ends up in failure when we create PCIe tunnels later on.

For what it's worth the XPS 9365 which has a different BIOS core has these
exact same behaviors on Linux if booted with the TBT dock plugged in.

> 
> Now, this is probably where Windows does something else, like it may
> skip re-configuring phase which could explain why it works. However, to
> me this looks pretty much like a bug in the BIOS/firmware as we are
> expecting the BIOS to configure the PCIe devices properly before the OS
> is send ACPI hotplug event.
> 

I'll reach out to the BIOS guys to see if they can give some more comments
from their perspective.

I came across something interesting from browsing MSDN about this topic.
It hasn't been updated in a long time but I think should still be a relevant 
indication of the approach that Windows was taking and why the firmware 
is this way and expecting OS to reconfigure.

"The BIOS cannot preconfigure PCI-to-PCI (P2P) bridges on adapters during 
hot plug. Consequently, the operating system assigns resource windows of 
a default size to a bridge.

I/O window. The default size for the I/O window is 4 KB in Windows 2000, 
Windows XP, and Windows Server 2003.  
Memory window. The configuration for the memory window differs for 
Windows 2000, Windows XP, and Windows Server 2003:
*	For Windows 2000, the default size for the memory window is 2 MB.
*	For Windows XP and Windows Server 2003, the operating system 
first attempts to find a memory window of 32 MB. If it cannot find a 
window of that size, the operating system attempts to find a memory 
window of progressively smaller sizes (16, 8, 4, 2, and finally 1 MB) until
 it finds a size that works."

> We need to handle this in Linux in the same way Windows does but
> currently I have no idea. It is however, more related to our PCI
> enumeration code than the patches in question, I think.
> 

Come to think of it, I have seen the dock have troubles if plugged in at 
boot on Linux even with SL0 before this patch series.

> I also have a Dell 9350 here so I can reproduce the problem and I'm
> going to investigate this further probably involving Linux PCI people.
To clarify are you reproducing it with a TB16 or some other TBT device?

> 
> My testing on the machine shows this behaviour only when the cable is
> connected during boot.

Yep same.

> 
> If I connect the cable after OS is booted I don't see the problem, even
> if I do unplug / plug cycle.
> 
> Can you try that also (again)? And if you see the problem, send me the
> dmesg? I have the latest BIOS (1.4.17) and NVM 16 so this machine
> configuration should match yours if I'm not mistaken.

It does work properly if I boot no cable plugged in and then plug one in.	

[toc] | [prev] | [next] | [standalone]


#1649888 — RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

From"Jamet, Michael" <michael.jamet@intel.com>
Date2017-05-24 21:40 +0200
SubjectRE: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tKKit-6rO-5@gated-at.bofh.it>
In reply to#1649867
> -----Original Message-----
> From: Mario.Limonciello@dell.com [mailto:Mario.Limonciello@dell.com]
> Sent: Wednesday, May 24, 2017 22:07
> To: mika.westerberg@linux.intel.com
> Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com; Jamet,
> Michael <michael.jamet@intel.com>; Bernat, Yehezkel
> <yehezkel.bernat@intel.com>; lukas@wunner.de; Levy, Amir (Jer)
> <amir.jer.levy@intel.com>; luto@kernel.org; Jared.Dominguez@dell.com;
> andriy.shevchenko@linux.intel.com; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH 00/24] Thunderbolt security levels and NVM firmware
> upgrade
> 
> > -----Original Message-----
> > From: Mika Westerberg [mailto:mika.westerberg@linux.intel.com]
> > Sent: Wednesday, May 24, 2017 6:11 AM
> > To: Limonciello, Mario <Mario_Limonciello@Dell.com>
> > Cc: gregkh@linuxfoundation.org; andreas.noever@gmail.com;
> > michael.jamet@intel.com; yehezkel.bernat@intel.com; lukas@wunner.de;
> > amir.jer.levy@intel.com; luto@kernel.org; Dominguez, Jared
> > <Jared_Dominguez@DELL.com>; andriy.shevchenko@linux.intel.com;
> linux-
> > kernel@vger.kernel.org
> > Subject: Re: [PATCH 00/24] Thunderbolt security levels and NVM
> > firmware upgrade
> >
> > On Tue, May 23, 2017 at 05:30:43PM +0000, Mario.Limonciello@dell.com
> wrote:
> > > (Sorry my email client is not going to wrap these at 80 columns)o
> >
> > That's fine. It is more readable this way :)
> >
> > > [    0.467319] pci 0000:00:1c.0: [8086:9d10] type 01 class 0x060400
> > > [    0.467389] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
> > > [    0.467513] pci 0000:00:1c.0: System wakeup disabled by ACPI
> >
> > [...]
> >
> > > [    0.469363] pci 0000:01:00.0: [8086:1576] type 01 class 0x060400
> > > [    0.469483] pci 0000:01:00.0: supports D1 D2
> > > [    0.469484] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot
> D3cold
> > > [    0.469570] pci 0000:01:00.0: System wakeup disabled by ACPI
> > > [    0.469609] pci 0000:00:1c.0: PCI bridge to [bus 01-39]
> > > [    0.469614] pci 0000:00:1c.0:   bridge window [mem 0xc4000000-
> 0xda0fffff]
> > > [    0.469618] pci 0000:00:1c.0:   bridge window [mem 0xa0000000-
> 0xc1ffffff
> > 64bit pref]
> > > [    0.469621] pci 0000:01:00.0: bridge configuration invalid ([bus 00-00]),
> > reconfiguring
> >
> > This is the problem. Here the PCIe upstream port (0000:01:00.0) is
> > visible to Linux but it is not fully configured by the BIOS ->
> > (primary/secondary/subordinate) is set to 0.
> 
> So at least for me the other difference between a successful run (where you
> plug in after boot instead) is that it shows up as instead:
> PCI bridge to [bus 02-39]
> 
> Same bridge window though.

I talked to our BIOS expert today. Here is his advice to debugging further:

It looks like something may have been wrong from system (BIOS, FW, others...) perspective.
On reboot need to enter EFI shell and check resources of 
pci 0000:01:00.0: bridge.
At the EFI shell, this bridge MUST be either configured or absent.

I would start this way, once we have this info, we may circle back to him and look into next debugging step.

/Michael
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

[toc] | [prev] | [next] | [standalone]


#1645816 — Re: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-05-19 20:10 +0200
SubjectRe: [PATCH 00/24] Thunderbolt security levels and NVM firmware upgrade
Message-ID<tIUvE-5Pe-21@gated-at.bofh.it>
In reply to#1645783
On Fri, May 19, 2017 at 08:19:48PM +0300, Mika Westerberg wrote:
> These two I've seen before.
> 
> > [    7.428503] pcieport 0000:02:02.0: PCI bridge to [bus 39]
> > [    7.428512] pcieport 0000:02:02.0:   bridge window [mem 0xd9f00000-0xd9ffffff]
> > [    7.428519] pci_bus 0000:39: [bus 39] partially hidden behind bridge 0000:02 [bus 02-05]
> 
> And this.
> 
> It happens occasionally when you reboot the machine when a device is
> connected but seems to be dependent on the BIOS version. Since it is the
> BIOS who is supposed to enumerated these devices, I suspect that it is
> either problem in BIOS or our PCI enumeration code does something wrong.

I tried on Intel Skull Canyon NUC so that I downgraded the NVM firmware
from 25 to 18. With that I see the exactly same issue. Upgrading it back
to 25 seems to fix it.

Even with version 18 if I plug devices after boot or if the machine is
completely shut down from power button with devices connected, it works.
The problem happens only when the machine is warn booted.

However, since I'm able to reproduce this - I'll try to investigate what
might be the root cause.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web