Skip to contentSkip to conversation

thunderbolt: Miscellaneous cleanups

PATCH Superseded Mika Westerberg 3 participants 10 messages Sep 3, 2018 – Sep 6, 2018 Thunderbolt driver

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover thunderbolt: Miscellaneous cleanups

Hi,

Here are a couple of changes which have been in my TODO list some time already but have not had time to make a proper patch out of them until now.

Mika Westerberg (3):
thunderbolt: Make the driver less verbose
thunderbolt: Convert rest of the driver files to use SPDX identifier
thunderbolt: Add Intel as copyright holder

 drivers/thunderbolt/cap.c      |  3 +-
 drivers/thunderbolt/ctl.c      |  9 ++---
 drivers/thunderbolt/ctl.h      |  3 +-
 drivers/thunderbolt/dma_port.c |  5 +--
 drivers/thunderbolt/dma_port.h |  5 +--
 drivers/thunderbolt/domain.c   |  7 ++--
 drivers/thunderbolt/eeprom.c   |  5 +--
 drivers/thunderbolt/icm.c      |  5 +--
 drivers/thunderbolt/nhi.c      | 33 ++++++++++---------
 drivers/thunderbolt/nhi.h      |  3 +-
 drivers/thunderbolt/nhi_regs.h |  1 +
 drivers/thunderbolt/path.c     | 26 +++++++--------
 drivers/thunderbolt/property.c |  5 +--
 drivers/thunderbolt/switch.c   | 60 ++++++++++++++++------------------
 drivers/thunderbolt/tb.c       | 10 +++---
 drivers/thunderbolt/tb.h       |  9 +++--
 drivers/thunderbolt/tb_msgs.h  |  5 +--
 drivers/thunderbolt/tb_regs.h  |  3 +-
 drivers/thunderbolt/xdomain.c  |  5 +--
 include/linux/thunderbolt.h    |  5 +--
 20 files changed, 96 insertions(+), 111 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/3 thunderbolt: Make the driver less verbose

Currently the driver logs quite a lot to the system message buffer even when doing normal operations. This information is not useful for ordinary users and might even annoy some.

For this reason convert most of the logs at info level to happen at debug level instead. The nice output formatting is untouched.

Logging can be easily re-enabled by passing "thunderbolt.dyndbg" in the kernel command line (or using the corresponding control file runtime).

---
 drivers/thunderbolt/ctl.c    |  6 ++--
 drivers/thunderbolt/eeprom.c |  2 +-
 drivers/thunderbolt/nhi.c    | 30 +++++++++----------
 drivers/thunderbolt/path.c   | 26 ++++++++--------
 drivers/thunderbolt/switch.c | 57 +++++++++++++++++-------------------
 drivers/thunderbolt/tb.c     | 10 +++----
 drivers/thunderbolt/tb.h     |  6 ++--
 7 files changed, 68 insertions(+), 69 deletions(-)
drivers/thunderbolt/ctl.c +3 -3
index 37a7f4c735d0..2ab6033a0a3d 100644
@@ -631,7 +631,7 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, event_cb cb, void *cb_data)
 		ctl->rx_packets[i]->frame.callback = tb_ctl_rx_callback;
 	}
 
-	tb_ctl_info(ctl, "control channel created\n");
+	tb_ctl_dbg(ctl, "control channel created\n");
 	return ctl;
 err:
 	tb_ctl_free(ctl);
@@ -673,7 +673,7 @@ void tb_ctl_free(struct tb_ctl *ctl)
 void tb_ctl_start(struct tb_ctl *ctl)
 {
 	int i;
-	tb_ctl_info(ctl, "control channel starting...\n");
+	tb_ctl_dbg(ctl, "control channel starting...\n");
 	tb_ring_start(ctl->tx); /* is used to ack hotplug packets, start first */
 	tb_ring_start(ctl->rx);
 	for (i = 0; i < TB_CTL_RX_PKG_COUNT; i++)
@@ -702,7 +702,7 @@ void tb_ctl_stop(struct tb_ctl *ctl)
 	if (!list_empty(&ctl->request_queue))
 		tb_ctl_WARN(ctl, "dangling request in request_queue\n");
 	INIT_LIST_HEAD(&ctl->request_queue);
-	tb_ctl_info(ctl, "control channel stopped\n");
+	tb_ctl_dbg(ctl, "control channel stopped\n");
 }
 
 /* public interface, commands */
drivers/thunderbolt/eeprom.c +1 -1
index 3e8caf22c294..d2dd40390783 100644
@@ -540,7 +540,7 @@ int tb_drom_read(struct tb_switch *sw)
 		return res;
 	size &= 0x3ff;
 	size += TB_DROM_DATA_START;
-	tb_sw_info(sw, "reading drom (length: %#x)\n", size);
+	tb_sw_dbg(sw, "reading drom (length: %#x)\n", size);
 	if (size < sizeof(*header)) {
 		tb_sw_warn(sw, "drom too small, aborting\n");
 		return -EIO;
drivers/thunderbolt/nhi.c +15 -15
index 5cd6bdfa068f..26d34b76a88f 100644
@@ -95,9 +95,9 @@ static void ring_interrupt_active(struct tb_ring *ring, bool active)
 	else
 		new = old & ~mask;
 
-	dev_info(&ring->nhi->pdev->dev,
-		 "%s interrupt at register %#x bit %d (%#x -> %#x)\n",
-		 active ? "enabling" : "disabling", reg, bit, old, new);
+	dev_dbg(&ring->nhi->pdev->dev,
+		"%s interrupt at register %#x bit %d (%#x -> %#x)\n",
+		active ? "enabling" : "disabling", reg, bit, old, new);
 
 	if (new == old)
 		dev_WARN(&ring->nhi->pdev->dev,
@@ -476,8 +476,9 @@ static struct tb_ring *tb_ring_alloc(struct tb_nhi *nhi, u32 hop, int size,
 				     void *poll_data)
 {
 	struct tb_ring *ring = NULL;
-	dev_info(&nhi->pdev->dev, "allocating %s ring %d of size %d\n",
-		 transmit ? "TX" : "RX", hop, size);
+
+	dev_dbg(&nhi->pdev->dev, "allocating %s ring %d of size %d\n",
+		transmit ? "TX" : "RX", hop, size);
 
 	/* Tx Ring 2 is reserved for E2E workaround */
 	if (transmit && hop == RING_E2E_UNUSED_HOPID)
@@ -585,8 +586,8 @@ void tb_ring_start(struct tb_ring *ring)
 		dev_WARN(&ring->nhi->pdev->dev, "ring already started\n");
 		goto err;
 	}
-	dev_info(&ring->nhi->pdev->dev, "starting %s %d\n",
-		 RING_TYPE(ring), ring->hop);
+	dev_dbg(&ring->nhi->pdev->dev, "starting %s %d\n",
+		RING_TYPE(ring), ring->hop);
 
 	if (ring->flags & RING_FLAG_FRAME) {
 		/* Means 4096 */
@@ -647,8 +648,8 @@ void tb_ring_stop(struct tb_ring *ring)
 {
 	spin_lock_irq(&ring->nhi->lock);
 	spin_lock(&ring->lock);
-	dev_info(&ring->nhi->pdev->dev, "stopping %s %d\n",
-		 RING_TYPE(ring), ring->hop);
+	dev_dbg(&ring->nhi->pdev->dev, "stopping %s %d\n",
+		RING_TYPE(ring), ring->hop);
 	if (ring->nhi->going_away)
 		goto err;
 	if (!ring->running) {
@@ -716,10 +717,8 @@ void tb_ring_free(struct tb_ring *ring)
 	ring->descriptors_dma = 0;
 
 
-	dev_info(&ring->nhi->pdev->dev,
-		 "freeing %s %d\n",
-		 RING_TYPE(ring),
-		 ring->hop);
+	dev_dbg(&ring->nhi->pdev->dev, "freeing %s %d\n", RING_TYPE(ring),
+		ring->hop);
 
 	/**
 	 * ring->work can no longer be scheduled (it is scheduled only
@@ -931,7 +930,8 @@ static int nhi_runtime_resume(struct device *dev)
 static void nhi_shutdown(struct tb_nhi *nhi)
 {
 	int i;
-	dev_info(&nhi->pdev->dev, "shutdown\n");
+
+	dev_dbg(&nhi->pdev->dev, "shutdown\n");
 
 	for (i = 0; i < nhi->hop_count; i++) {
 		if (nhi->tx_rings[i])
@@ -1059,7 +1059,7 @@ static int nhi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return -ENODEV;
 	}
 
-	dev_info(&nhi->pdev->dev, "NHI initialized, starting thunderbolt\n");
+	dev_dbg(&nhi->pdev->dev, "NHI initialized, starting thunderbolt\n");
 
 	res = tb_domain_add(tb);
 	if (res) {
drivers/thunderbolt/path.c +13 -13
index ff49ad880bfd..a11956522bac 100644
@@ -13,19 +13,19 @@
 
 static void tb_dump_hop(struct tb_port *port, struct tb_regs_hop *hop)
 {
-	tb_port_info(port, " Hop through port %d to hop %d (%s)\n",
-		     hop->out_port, hop->next_hop,
-		     hop->enable ? "enabled" : "disabled");
-	tb_port_info(port, "  Weight: %d Priority: %d Credits: %d Drop: %d\n",
-		     hop->weight, hop->priority,
-		     hop->initial_credits, hop->drop_packages);
-	tb_port_info(port, "   Counter enabled: %d Counter index: %d\n",
-		     hop->counter_enable, hop->counter);
-	tb_port_info(port, "  Flow Control (In/Eg): %d/%d Shared Buffer (In/Eg): %d/%d\n",
-		     hop->ingress_fc, hop->egress_fc,
-		     hop->ingress_shared_buffer, hop->egress_shared_buffer);
-	tb_port_info(port, "  Unknown1: %#x Unknown2: %#x Unknown3: %#x\n",
-		     hop->unknown1, hop->unknown2, hop->unknown3);
+	tb_port_dbg(port, " Hop through port %d to hop %d (%s)\n",
+		    hop->out_port, hop->next_hop,
+		    hop->enable ? "enabled" : "disabled");
+	tb_port_dbg(port, "  Weight: %d Priority: %d Credits: %d Drop: %d\n",
+		    hop->weight, hop->priority,
+		    hop->initial_credits, hop->drop_packages);
+	tb_port_dbg(port, "   Counter enabled: %d Counter index: %d\n",
+		    hop->counter_enable, hop->counter);
+	tb_port_dbg(port, "  Flow Control (In/Eg): %d/%d Shared Buffer (In/Eg): %d/%d\n",
+		    hop->ingress_fc, hop->egress_fc,
+		    hop->ingress_shared_buffer, hop->egress_shared_buffer);
+	tb_port_dbg(port, "  Unknown1: %#x Unknown2: %#x Unknown3: %#x\n",
+		    hop->unknown1, hop->unknown2, hop->unknown3);
 }
 
 /**
drivers/thunderbolt/switch.c +27 -30

105 lines not on this page · raw message

drivers/thunderbolt/tb.c +5 -5
index 1424581fd9af..30e02c716f6c 100644
@@ -404,10 +404,10 @@ static int tb_suspend_noirq(struct tb *tb)
 {
 	struct tb_cm *tcm = tb_priv(tb);
 
-	tb_info(tb, "suspending...\n");
+	tb_dbg(tb, "suspending...\n");
 	tb_switch_suspend(tb->root_switch);
 	tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */
-	tb_info(tb, "suspend finished\n");
+	tb_dbg(tb, "suspend finished\n");
 
 	return 0;
 }
@@ -417,7 +417,7 @@ static int tb_resume_noirq(struct tb *tb)
 	struct tb_cm *tcm = tb_priv(tb);
 	struct tb_pci_tunnel *tunnel, *n;
 
-	tb_info(tb, "resuming...\n");
+	tb_dbg(tb, "resuming...\n");
 
 	/* remove any pci devices the firmware might have setup */
 	tb_switch_reset(tb, 0);
@@ -432,12 +432,12 @@ static int tb_resume_noirq(struct tb *tb)
 		 * the pcie links need some time to get going.
 		 * 100ms works for me...
 		 */
-		tb_info(tb, "tunnels restarted, sleeping for 100ms\n");
+		tb_dbg(tb, "tunnels restarted, sleeping for 100ms\n");
 		msleep(100);
 	}
 	 /* Allow tb_handle_hotplug to progress events */
 	tcm->hotplug_active = true;
-	tb_info(tb, "resume finished\n");
+	tb_dbg(tb, "resume finished\n");
 
 	return 0;
 }
drivers/thunderbolt/tb.h +4 -2
index 5067d69d0501..5a99245573c0 100644
@@ -327,7 +327,7 @@ static inline int tb_port_write(struct tb_port *port, const void *buffer,
 #define tb_WARN(tb, fmt, arg...) dev_WARN(&(tb)->nhi->pdev->dev, fmt, ## arg)
 #define tb_warn(tb, fmt, arg...) dev_warn(&(tb)->nhi->pdev->dev, fmt, ## arg)
 #define tb_info(tb, fmt, arg...) dev_info(&(tb)->nhi->pdev->dev, fmt, ## arg)
-
+#define tb_dbg(tb, fmt, arg...) dev_dbg(&(tb)->nhi->pdev->dev, fmt, ## arg)
 
 #define __TB_SW_PRINT(level, sw, fmt, arg...)           \
 	do {                                            \
@@ -338,7 +338,7 @@ static inline int tb_port_write(struct tb_port *port, const void *buffer,
 #define tb_sw_WARN(sw, fmt, arg...) __TB_SW_PRINT(tb_WARN, sw, fmt, ##arg)
 #define tb_sw_warn(sw, fmt, arg...) __TB_SW_PRINT(tb_warn, sw, fmt, ##arg)
 #define tb_sw_info(sw, fmt, arg...) __TB_SW_PRINT(tb_info, sw, fmt, ##arg)
-
+#define tb_sw_dbg(sw, fmt, arg...) __TB_SW_PRINT(tb_dbg, sw, fmt, ##arg)
 
 #define __TB_PORT_PRINT(level, _port, fmt, arg...)                      \
 	do {                                                            \
@@ -352,6 +352,8 @@ static inline int tb_port_write(struct tb_port *port, const void *buffer,
 	__TB_PORT_PRINT(tb_warn, port, fmt, ##arg)
 #define tb_port_info(port, fmt, arg...) \
 	__TB_PORT_PRINT(tb_info, port, fmt, ##arg)
+#define tb_port_dbg(port, fmt, arg...) \
+	__TB_PORT_PRINT(tb_dbg, port, fmt, ##arg)
 
 struct tb *icm_probe(struct tb_nhi *nhi);
 struct tb *tb_probe(struct tb_nhi *nhi);
Signature · 1 line
2.18.0
#2 lore raw

Re: [PATCH 1/3] thunderbolt: Make the driver less verbose

Quoted 3 lines · Mika Westerberg

Currently the driver logs quite a lot to the system message buffer even when doing normal operations. This information is not useful for ordinary users and might even annoy some.

No, the verbose logging is done on purpose to aid us in reverse-engineering the protocol. For example ...

drivers/thunderbolt/path.c line 28

Quoted 2 lines
drivers/thunderbolt/path.c +0 -2
-	tb_port_info(port, "  Unknown1: %#x Unknown2: %#x Unknown3: %#x\n",
-		     hop->unknown1, hop->unknown2, hop->unknown3);

... why do you think we're logging these seemingly stupid unknown bitfields? Because whenever someone posts dmesg output they inadvertantly post the contents of those unknown fields and we can then google the value of those fields on various controllers and machines and deduce their possible meaning.

By muting those messages, you're taking away our reverse enginering aids without having released the spec, which would indeed obviate the need for them. Please don't do that. Release the spec, *then* you can mute the messages. Not the other way round.

Thanks,

Lukas

#3 lore raw

Re: [PATCH 1/3] thunderbolt: Make the driver less verbose

Quoted 8 lines · Lukas Wunner
Quoted 3 lines · Mika Westerberg

Currently the driver logs quite a lot to the system message buffer even when doing normal operations. This information is not useful for ordinary users and might even annoy some.

No, the verbose logging is done on purpose to aid us in reverse-engineering the protocol. For example ...

Quoted 8 lines

drivers/thunderbolt/path.c line 28

Quoted 2 lines
drivers/thunderbolt/path.c +0 -2
-	tb_port_info(port, "  Unknown1: %#x Unknown2: %#x Unknown3: %#x\n",
-		     hop->unknown1, hop->unknown2, hop->unknown3);

... why do you think we're logging these seemingly stupid unknown bitfields? Because whenever someone posts dmesg output they inadvertantly post the contents of those unknown fields and we can then google the value of those fields on various controllers and machines and deduce their possible meaning.

And the majority of people get tons of completely useless messages filling their dmesgs? No, I don't think that's a good thing.

Quoted 4 lines

By muting those messages, you're taking away our reverse enginering aids without having released the spec, which would indeed obviate the need for them. Please don't do that. Release the spec, *then* you can mute the messages. Not the other way round.

All the possible messages are most likely logged already and available by Googling so even if we mute the driver now, you still can find those messages in the wild. Anything running on Alpine Ridge and higher does not require reverse-engineering (even on Apple systems) because those are already supported in the driver.

#4 lore raw

Re: [PATCH 1/3] thunderbolt: Make the driver less verbose

Quoted 18 lines · Mika Westerberg
Quoted 8 lines · Lukas Wunner
Quoted 3 lines · Mika Westerberg

Currently the driver logs quite a lot to the system message buffer even when doing normal operations. This information is not useful for ordinary users and might even annoy some.

No, the verbose logging is done on purpose to aid us in reverse-engineering the protocol. For example ...

Quoted 8 lines

drivers/thunderbolt/path.c line 28

Quoted 2 lines
drivers/thunderbolt/path.c +0 -2
-	tb_port_info(port, "  Unknown1: %#x Unknown2: %#x Unknown3: %#x\n",
-		     hop->unknown1, hop->unknown2, hop->unknown3);

... why do you think we're logging these seemingly stupid unknown bitfields? Because whenever someone posts dmesg output they inadvertantly post the contents of those unknown fields and we can then google the value of those fields on various controllers and machines and deduce their possible meaning.

Quoted 2 lines

And the majority of people get tons of completely useless messages filling their dmesgs? No, I don't think that's a good thing.

As you know the OS-controlled tunnel manager is far from feature complete. I think the "majority of people" are perfectly willing to accept verbose logging if it helps us fill in those gaps.

You make it sound like logfiles are spammed all the time, but messages are in fact only logged on driver initialization and hotplug.

We wouldn't be in this situation if we had a proper Thunderbolt spec. It wasn't *my* idea to keep it under wraps.

So please leave the messages at info level so as not to hinder our work.

As for your claim that the "majority of people" find the messages useless", I rather suspect that you, personally, find them useless because you complained about noisiness of the driver before:

"I don't think we want to log anything with info level to be honest.
The driver currently already is pretty noisy so adding even more information there just makes it worse ;-)
I would rather convert debugging information to use tracepoints and get rid of the tb_*_info() things completely."
https://www.mail-archive.com/[email protected]/msg1401181.html

And guess what I responded:

"The noisiness has value in that it helps with reverse-engineering:
Just google for dmesg output and check what other machines are reporting for unknown registers. :-)
If there was public documentation available or Intel would be okay with answering specific questions (as you've done with the 0x30 attribute id), then the value obviously diminishes."

Quoted 3 lines

Anything running on Alpine Ridge and higher does
not require reverse-engineering (even on Apple systems) because those are already supported in the driver.

Long term it may be worthwhile to move to OS-controlled tunnel management even when ICM-controlled tunnel management is available as the latter might not support features of the former, e.g. correlation of PCI devices with Thunderbolt ports:
https://github.com/l1k/linux/commit/d024c6e7e80e

Thanks,

Lukas

#5 lore raw

Re: [PATCH 1/3] thunderbolt: Make the driver less verbose

Quoted 22 lines · Lukas Wunner
Quoted 18 lines · Mika Westerberg
Quoted 8 lines · Lukas Wunner
Quoted 3 lines · Mika Westerberg

Currently the driver logs quite a lot to the system message buffer even when doing normal operations. This information is not useful for ordinary users and might even annoy some.

No, the verbose logging is done on purpose to aid us in reverse-engineering the protocol. For example ...

Quoted 8 lines

drivers/thunderbolt/path.c line 28

Quoted 2 lines
drivers/thunderbolt/path.c +0 -2
-	tb_port_info(port, "  Unknown1: %#x Unknown2: %#x Unknown3: %#x\n",
-		     hop->unknown1, hop->unknown2, hop->unknown3);

... why do you think we're logging these seemingly stupid unknown bitfields? Because whenever someone posts dmesg output they inadvertantly post the contents of those unknown fields and we can then google the value of those fields on various controllers and machines and deduce their possible meaning.

Quoted 2 lines

And the majority of people get tons of completely useless messages filling their dmesgs? No, I don't think that's a good thing.

Quoted 6 lines

As you know the OS-controlled tunnel manager is far from feature complete. I think the "majority of people" are perfectly willing to accept verbose logging if it helps us fill in those gaps.

You make it sound like logfiles are spammed all the time, but messages are in fact only logged on driver initialization and hotplug.

And every time the controller runtime suspends/resumes. Every suspend/resume. Every time ring gets initialized/teared when you connect cable between computers. It is way too much for a driver that is part of production operating system.

Quoted 2 lines

We wouldn't be in this situation if we had a proper Thunderbolt spec. It wasn't *my* idea to keep it under wraps.

Please don't start that again.

I can't affect when the spec is released, really. I'm just a poor driver guy trying to get this working as good as possible.

Quoted 13 lines

So please leave the messages at info level so as not to hinder our work.

As for your claim that the "majority of people" find the messages useless", I rather suspect that you, personally, find them useless because you complained about noisiness of the driver before:

"I don't think we want to log anything with info level to be honest.
The driver currently already is pretty noisy so adding even more information there just makes it worse ;-)
I would rather convert debugging information to use tracepoints and get rid of the tb_*_info() things completely."
https://www.mail-archive.com/[email protected]/msg1401181.html

Quoted 8 lines

And guess what I responded:

"The noisiness has value in that it helps with reverse-engineering:
Just google for dmesg output and check what other machines are reporting for unknown registers. :-)
If there was public documentation available or Intel would be okay with answering specific questions (as you've done with the 0x30 attribute id), then the value obviously diminishes."

It is not just me, see here:

https://lkml.org/lkml/2017/10/31/864

And I fully agree.

Andreas was fine at the time to silence the driver. I just did not have time to do that until now.

Andreas, let me know if you have objections about this patch.

#6 lore raw

PATCH 2/3 thunderbolt: Convert rest of the driver files to use SPDX identifier

In reply to Mika Westerberg

This gets rid of the licence boilerplate duplicated in each file. While there fix doubled space in domain.c author line.

No functional changes intended.

---
 drivers/thunderbolt/dma_port.c | 5 +----
 drivers/thunderbolt/dma_port.h | 5 +----
 drivers/thunderbolt/domain.c   | 7 ++-----
 drivers/thunderbolt/icm.c      | 5 +----
 drivers/thunderbolt/property.c | 5 +----
 drivers/thunderbolt/tb_msgs.h  | 5 +----
 drivers/thunderbolt/xdomain.c  | 5 +----
 include/linux/thunderbolt.h    | 5 +----
 8 files changed, 9 insertions(+), 33 deletions(-)
drivers/thunderbolt/dma_port.c +1 -4
index f2701194f810..847dd07a7b17 100644
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Thunderbolt DMA configuration based mailbox support
  *
  * Copyright (C) 2017, Intel Corporation
  * Authors: Michael Jamet <[email protected]>
  *          Mika Westerberg <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #include <linux/delay.h>
drivers/thunderbolt/dma_port.h +1 -4
index c4a69e0fbff7..7deadd97ce31 100644
@@ -1,13 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Thunderbolt DMA configuration based mailbox support
  *
  * Copyright (C) 2017, Intel Corporation
  * Authors: Michael Jamet <[email protected]>
  *          Mika Westerberg <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #ifndef DMA_PORT_H_
drivers/thunderbolt/domain.c +2 -5
index 092381e2accf..93e562f18d40 100644
@@ -1,12 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Thunderbolt bus support
  *
  * Copyright (C) 2017, Intel Corporation
- * Author:  Mika Westerberg <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * Author: Mika Westerberg <[email protected]>
  */
 
 #include <linux/device.h>
drivers/thunderbolt/icm.c +1 -4
index 28fc4ce75edb..e3fc920af682 100644
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Internal Thunderbolt Connection Manager. This is a firmware running on
  * the Thunderbolt host controller performing most of the low-level
@@ -6,10 +7,6 @@
  * Copyright (C) 2017, Intel Corporation
  * Authors: Michael Jamet <[email protected]>
  *          Mika Westerberg <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #include <linux/delay.h>
drivers/thunderbolt/property.c +1 -4
index 8fe913a95b4a..b2f0d6386cee 100644
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Thunderbolt XDomain property support
  *
  * Copyright (C) 2017, Intel Corporation
  * Authors: Michael Jamet <[email protected]>
  *          Mika Westerberg <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #include <linux/err.h>
drivers/thunderbolt/tb_msgs.h +1 -4
index 2487e162c885..02c84aa3d018 100644
@@ -1,12 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Thunderbolt control channel messages
  *
  * Copyright (C) 2014 Andreas Noever <[email protected]>
  * Copyright (C) 2017, Intel Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #ifndef _TB_MSGS
drivers/thunderbolt/xdomain.c +1 -4
index db8bece63327..e27dd8beb94b 100644
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Thunderbolt XDomain discovery protocol support
  *
  * Copyright (C) 2017, Intel Corporation
  * Authors: Michael Jamet <[email protected]>
  *          Mika Westerberg <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #include <linux/device.h>
include/linux/thunderbolt.h +1 -4
index a3ed26082bc1..bf6ec83e60ee 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Thunderbolt service API
  *
@@ -5,10 +6,6 @@
  * Copyright (C) 2017, Intel Corporation
  * Authors: Michael Jamet <[email protected]>
  *          Mika Westerberg <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #ifndef THUNDERBOLT_H_
Signature · 1 line
2.18.0
#7 lore raw

PATCH 3/3 thunderbolt: Add Intel as copyright holder

In reply to Mika Westerberg

Intel has done pretty major changes to the driver and we continue to do so in the future as well. Add Intel as copyright holder of the files we have done changes.

While there drop "Cactus Ridge" from the headers because this driver works also with other Thunderbolt controllers.

No functional changes intended.

---
 drivers/thunderbolt/cap.c      | 3 ++-
 drivers/thunderbolt/ctl.c      | 3 ++-
 drivers/thunderbolt/ctl.h      | 3 ++-
 drivers/thunderbolt/eeprom.c   | 3 ++-
 drivers/thunderbolt/nhi.c      | 3 ++-
 drivers/thunderbolt/nhi.h      | 3 ++-
 drivers/thunderbolt/nhi_regs.h | 1 +
 drivers/thunderbolt/switch.c   | 3 ++-
 drivers/thunderbolt/tb.h       | 3 ++-
 drivers/thunderbolt/tb_regs.h  | 3 ++-
 10 files changed, 19 insertions(+), 9 deletions(-)
drivers/thunderbolt/cap.c +2 -1
index c2277b8ee88d..9553305c63ea 100644
@@ -1,8 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Thunderbolt Cactus Ridge driver - capabilities lookup
+ * Thunderbolt driver - capabilities lookup
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #include <linux/slab.h>
drivers/thunderbolt/ctl.c +2 -1
index 2ab6033a0a3d..270fec96c603 100644
@@ -1,8 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Thunderbolt Cactus Ridge driver - control channel and configuration commands
+ * Thunderbolt driver - control channel and configuration commands
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #include <linux/crc32.h>
drivers/thunderbolt/ctl.h +2 -1
index 3062e0b5f71e..2f1a1e111110 100644
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Thunderbolt Cactus Ridge driver - control channel and configuration commands
+ * Thunderbolt driver - control channel and configuration commands
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #ifndef _TB_CFG
drivers/thunderbolt/eeprom.c +2 -1
index d2dd40390783..81e8ac4c5805 100644
@@ -1,8 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Thunderbolt Cactus Ridge driver - eeprom access
+ * Thunderbolt driver - eeprom access
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #include <linux/crc32.h>
drivers/thunderbolt/nhi.c +2 -1
index 26d34b76a88f..9aa44f9762a3 100644
@@ -1,10 +1,11 @@
 /*
- * Thunderbolt Cactus Ridge driver - NHI driver
+ * Thunderbolt driver - NHI driver
  *
  * The NHI (native host interface) is the pci device that allows us to send and
  * receive frames from the thunderbolt bus.
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #include <linux/pm_runtime.h>
drivers/thunderbolt/nhi.h +2 -1
index 1696a4560948..1b5d47ecd3ed 100644
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Thunderbolt Cactus Ridge driver - NHI driver
+ * Thunderbolt driver - NHI driver
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #ifndef DSL3510_H_
drivers/thunderbolt/nhi_regs.h +1 -0
index b3e49d19c01e..a60bd98c1d04 100644
@@ -3,6 +3,7 @@
  * Thunderbolt driver - NHI registers
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #ifndef NHI_REGS_H_
drivers/thunderbolt/switch.c +2 -1
index 81134ee29578..354ecc3b2791 100644
@@ -1,8 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Thunderbolt Cactus Ridge driver - switch/port utility functions
+ * Thunderbolt driver - switch/port utility functions
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #include <linux/delay.h>
drivers/thunderbolt/tb.h +2 -1
index 5a99245573c0..52584c4003e3 100644
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Thunderbolt Cactus Ridge driver - bus logic (NHI independent)
+ * Thunderbolt driver - bus logic (NHI independent)
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #ifndef TB_H_
drivers/thunderbolt/tb_regs.h +2 -1
index 693b0353c3fe..6f1ff04ee195 100644
@@ -1,12 +1,13 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Thunderbolt Cactus Ridge driver - Port/Switch config area registers
+ * Thunderbolt driver - Port/Switch config area registers
  *
  * Every thunderbolt device consists (logically) of a switch with multiple
  * ports. Every port contains up to four config regions (HOPS, PORT, SWITCH,
  * COUNTERS) which are used to configure the device.
  *
  * Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation
  */
 
 #ifndef _TB_REGS
Signature · 1 line
2.18.0
maintainer
#8 lore raw

Re: [PATCH 3/3] thunderbolt: Add Intel as copyright holder

Quoted 2 lines

* Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation

Nitpicking: (c) or (C)?
I can't find anything in the documentation and both are found in various files.

#9 lore raw

Re: [PATCH 3/3] thunderbolt: Add Intel as copyright holder

Quoted 5 lines · Yehezkel Bernat
Quoted 2 lines

* Copyright (c) 2014 Andreas Noever <[email protected]>
+ * Copyright (C) 2018, Intel Corporation

Nitpicking: (c) or (C)?
I can't find anything in the documentation and both are found in various files.

I don't think there are any rules for it. I've been using (C) typically even if it is not "consistent" with other copyrights in the same file.