Re: [PATCH net-next] net: thunderbolt: convert comma to semicolon

2020-12-09 Thread Mika Westerberg
On Wed, Dec 09, 2020 at 09:38:52PM +0800, Zheng Yongjun wrote: > Replace a comma between expression statements by a semicolon. > > Signed-off-by: Zheng Yongjun Acked-by: Mika Westerberg

[PATCH v2 03/10] thunderbolt: Create XDomain devices for loops back to the host

2020-11-10 Thread Mika Westerberg
It is perfectly possible to have loops back from the routers to the host, or even from one host port to another. Instead of ignoring these, we create XDomain devices for each. This allows creating services such as DMA traffic test that is used in manufacturing for example. Signed-off-by: Mika

[PATCH v2 05/10] thunderbolt: Add functions for enabling and disabling lane bonding on XDomain

2020-11-10 Thread Mika Westerberg
From: Isaac Hazan These can be used by service drivers to enable and disable lane bonding as needed. Signed-off-by: Isaac Hazan Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- drivers/thunderbolt/switch.c | 24 +++-- drivers/thunderbolt/tb.h | 3 ++ drivers

[PATCH v2 07/10] thunderbolt: Make it possible to allocate one directional DMA tunnel

2020-11-10 Thread Mika Westerberg
With DMA tunnels it is possible that the service using it does not require bi-directional paths so make RX and TX optional (but of course one of them needs to be set). Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- drivers/thunderbolt/tunnel.c | 50

[PATCH v2 02/10] thunderbolt: Find XDomain by route instead of UUID

2020-11-10 Thread Mika Westerberg
might not be populated yet. Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- drivers/thunderbolt/xdomain.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 48907853732a..e436e9efa7e7

[PATCH v2 10/10] MAINTAINERS: Add Isaac as maintainer of Thunderbolt DMA traffic test driver

2020-11-10 Thread Mika Westerberg
From: Isaac Hazan I will be maintaining the Thunderbolt DMA traffic test driver. Signed-off-by: Isaac Hazan Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3da6d8c154e4

[PATCH v2 09/10] thunderbolt: Add DMA traffic test driver

2020-11-10 Thread Mika Westerberg
bug/thunderbolt//dma_test/test The other one for sending: # echo 1000 > /sys/kernel/debug/thunderbolt//dma_test/packets_to_send # echo 1 > /sys/kernel/debug/thunderbolt//dma_test/test Results can be read from both services status attributes. Signed-off-by: Isaac Hazan Signed-of

[PATCH v2 08/10] thunderbolt: Add support for end-to-end flow control

2020-11-10 Thread Mika Westerberg
e2e_tx_hop) used in the credit grant packets. Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- drivers/net/thunderbolt.c | 2 +- drivers/thunderbolt/ctl.c | 4 ++-- drivers/thunderbolt/nhi.c | 36 include/linux/thunderbolt.h | 8 +++

[PATCH v2 00/10] thunderbolt: Add DMA traffic test driver

2020-11-10 Thread Mika Westerberg
: Add Isaac as maintainer of Thunderbolt DMA traffic test driver Mika Westerberg (6): thunderbolt: Do not clear USB4 router protocol adapter IFC and ISE bits thunderbolt: Find XDomain by route instead of UUID thunderbolt: Create XDomain devices for loops back to the host thunderbolt: Create de

[PATCH v2 04/10] thunderbolt: Add link_speed and link_width to XDomain

2020-11-10 Thread Mika Westerberg
From: Isaac Hazan Link speed and link width are needed for checking expected values in case of using a loopback service. Signed-off-by: Isaac Hazan Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- .../ABI/testing/sysfs-bus-thunderbolt | 28 drivers/thunderbolt

[PATCH v2 06/10] thunderbolt: Create debugfs directory automatically for services

2020-11-10 Thread Mika Westerberg
This allows service drivers to use it as parent directory if they need to add their own debugfs entries. Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- drivers/thunderbolt/debugfs.c | 24 drivers/thunderbolt/tb.h | 4 drivers/thunderbolt

[PATCH v2 01/10] thunderbolt: Do not clear USB4 router protocol adapter IFC and ISE bits

2020-11-10 Thread Mika Westerberg
These fields are marked as vendor defined in the USB4 spec and should not be modified by the software, so only clear them when we are dealing with pre-USB4 hardware. Signed-off-by: Mika Westerberg Acked-by: Yehezkel Bernat --- drivers/thunderbolt/path.c | 13 ++--- 1 file changed, 10

Re: [PATCH v2 00/10] thunderbolt: Add DMA traffic test driver

2020-11-10 Thread Mika Westerberg
On Tue, Nov 10, 2020 at 10:30:45AM +0100, Greg Kroah-Hartman wrote: > On Tue, Nov 10, 2020 at 12:19:47PM +0300, Mika Westerberg wrote: > > Hi all, > > > > This series adds a new Thunderbolt service driver that can be used on > > manufacturing floor to test that ea

Re: thunderbolt: How to disconnect without physically unplugging

2020-11-11 Thread Mika Westerberg
Hi, On Thu, Nov 12, 2020 at 07:55:23AM +0100, Christian Eggers wrote: > Hi, > > sorry for asking "user" questions directly to developers. But I didn't find a > better place for asking. > > I own a "hp zbook thunderbolt 3 dock". This docking station has 2 thunderbolt > connectors, the first (prim

[PATCH 04/10] thunderbolt: Add link_speed and link_width to XDomain

2020-11-04 Thread Mika Westerberg
From: Isaac Hazan Link speed and link width are needed for checking expected values in case of using a loopback service. Signed-off-by: Isaac Hazan Signed-off-by: Mika Westerberg --- .../ABI/testing/sysfs-bus-thunderbolt | 28 drivers/thunderbolt/switch.c

[PATCH 05/10] thunderbolt: Add functions for enabling and disabling lane bonding on XDomain

2020-11-04 Thread Mika Westerberg
From: Isaac Hazan These can be used by service drivers to enable and disable lane bonding as needed. Signed-off-by: Isaac Hazan Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 24 +++-- drivers/thunderbolt/tb.h | 3 ++ drivers/thunderbolt/xdomain.c | 66

[PATCH 02/10] thunderbolt: Find XDomain by route instead of UUID

2020-11-04 Thread Mika Westerberg
might not be populated yet. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/xdomain.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index c00ad817042e..e2866248f389 100644 --- a/drivers/thunderbolt

[PATCH 08/10] thunderbolt: Add support for end-to-end flow control

2020-11-04 Thread Mika Westerberg
e2e_tx_hop) used in the credit grant packets. Signed-off-by: Mika Westerberg Cc: David S. Miller --- drivers/net/thunderbolt.c | 2 +- drivers/thunderbolt/ctl.c | 4 ++-- drivers/thunderbolt/nhi.c | 36 include/linux/thunderbolt.h | 8 +++- 4 fil

[PATCH 10/10] MAINTAINERS: Add Isaac as maintainer of Thunderbolt DMA traffic test driver

2020-11-04 Thread Mika Westerberg
From: Isaac Hazan I will be maintaining the Thunderbolt DMA traffic test driver. Signed-off-by: Isaac Hazan Signed-off-by: Mika Westerberg --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b516bb34a8d5..fcd84749defd 100644 --- a

[PATCH 00/10] thunderbolt: Add DMA traffic test driver

2020-11-04 Thread Mika Westerberg
t DMA traffic test driver Mika Westerberg (6): thunderbolt: Do not clear USB4 router protocol adapter IFC and ISE bits thunderbolt: Find XDomain by route instead of UUID thunderbolt: Create XDomain devices for loops back to the host thunderbolt: Create debugfs directory automatically for ser

[PATCH 03/10] thunderbolt: Create XDomain devices for loops back to the host

2020-11-04 Thread Mika Westerberg
It is perfectly possible to have loops back from the routers to the host, or even from one host port to another. Instead of ignoring these, we create XDomain devices for each. This allows creating services such as DMA traffic test that is used in manufacturing for example. Signed-off-by: Mika

[PATCH 01/10] thunderbolt: Do not clear USB4 router protocol adapter IFC and ISE bits

2020-11-04 Thread Mika Westerberg
These fields are marked as vendor defined in the USB4 spec and should not be modified by the software, so only clear them when we are dealing with pre-USB4 hardware. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/path.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions

[PATCH 09/10] thunderbolt: Add DMA traffic test driver

2020-11-04 Thread Mika Westerberg
bug/thunderbolt//dma_test/test The other one for sending: # echo 1000 > /sys/kernel/debug/thunderbolt//dma_test/packets_to_send # echo 1 > /sys/kernel/debug/thunderbolt//dma_test/test Results can be read from both services status attributes. Signed-off-by: Isaac Hazan Signed-of

[PATCH 06/10] thunderbolt: Create debugfs directory automatically for services

2020-11-04 Thread Mika Westerberg
This allows service drivers to use it as parent directory if they need to add their own debugfs entries. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/debugfs.c | 24 drivers/thunderbolt/tb.h | 4 drivers/thunderbolt/xdomain.c | 3 +++ include/linux

[PATCH 07/10] thunderbolt: Make it possible to allocate one directional DMA tunnel

2020-11-04 Thread Mika Westerberg
With DMA tunnels it is possible that the service using it does not require bi-directional paths so make RX and TX optional (but of course one of them needs to be set). Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tunnel.c | 50 ++-- 1 file changed, 31

Re: [PATCH 06/10] thunderbolt: Create debugfs directory automatically for services

2020-11-04 Thread Mika Westerberg
On Wed, Nov 04, 2020 at 03:20:38PM +0100, Greg KH wrote: > > +/** > > + * tb_service_debugfs_remove() - Remove service debugfs directory > > + * @svc: Thunderbolt service pointer > > + * > > + * Removes the previously created debugfs directory for @svc. > > + */ > > +void tb_service_debugfs_remove(

Re: [PATCH 09/10] thunderbolt: Add DMA traffic test driver

2020-11-04 Thread Mika Westerberg
On Wed, Nov 04, 2020 at 08:38:10PM +0200, Yehezkel Bernat wrote: > On Wed, Nov 4, 2020 at 4:00 PM Mika Westerberg > wrote: > > > > +#define DMA_TEST_DATA_PATTERN 0x0123456789abcdefLL > > Have you considered making it configurable? For mem test, for example, there

Re: [PATCH 00/10] thunderbolt: Add DMA traffic test driver

2020-11-04 Thread Mika Westerberg
On Wed, Nov 04, 2020 at 08:39:01PM +0200, Yehezkel Bernat wrote: > On Wed, Nov 4, 2020 at 4:00 PM Mika Westerberg > wrote: > > > > Hi all, > > > > This series adds a new Thunderbolt service driver that can be used on > > manufacturing floor to test that each

Re: [PATCH 00/12] Rid W=1 warnings from Thunderbolt

2021-01-28 Thread Mika Westerberg
Hi Lee, On Wed, Jan 27, 2021 at 11:25:42AM +, Lee Jones wrote: > This set is part of a larger effort attempting to clean-up W=1 > kernel builds, which are currently overwhelmingly riddled with > niggly little warnings. > > Only 1 small set required for Thunderbolt. Pretty good! > > Lee Jone

[PATCH 01/18] thunderbolt: Disable retry logic for intra-domain control packets

2021-03-04 Thread Mika Westerberg
aligns the driver better what the Intel connection manager firmware is doing. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index f1aeaff9f368..875922133782 100644

[PATCH 04/18] Documentation / thunderbolt: Drop speed/lanes entries for XDomain

2021-03-04 Thread Mika Westerberg
These are actually not needed as we already have similar entries that apply to all devices on the Thunderbolt bus. Cc: Isaac Hazan Signed-off-by: Mika Westerberg --- .../ABI/testing/sysfs-bus-thunderbolt | 28 --- 1 file changed, 28 deletions(-) diff --git a

[PATCH 05/18] thunderbolt: Add more logging to XDomain connections

2021-03-04 Thread Mika Westerberg
-off-by: Mika Westerberg --- drivers/thunderbolt/xdomain.c | 34 +++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 7cf8b9c85ab7..584bb5ec06f8 100644 --- a/drivers/thunderbolt/xdomain.c

[PATCH 03/18] thunderbolt: Decrease control channel timeout for software connection manager

2021-03-04 Thread Mika Westerberg
they alloc the domain structure. While there update kernel-doc of struct tb_ctl to match the reality. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/ctl.c| 15 +--- drivers/thunderbolt/ctl.h| 5 ++- drivers/thunderbolt/domain.c | 66

[PATCH 07/18] thunderbolt: Use pseudo-random number as initial property block generation

2021-03-04 Thread Mika Westerberg
As recommended by USB4 inter-domain service spec use pseudo-random value instead of zero as initial XDomain property block generation value. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/xdomain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thunderbolt/xdomain.c b

[PATCH 13/18] thunderbolt: Allow multiple DMA tunnels over a single XDomain connection

2021-03-04 Thread Mika Westerberg
service drivers over to this API. Signed-off-by: Mika Westerberg --- drivers/net/thunderbolt.c | 49 +--- drivers/thunderbolt/dma_test.c | 35 - drivers/thunderbolt/domain.c | 24 -- drivers/thunderbolt/icm.c | 32 +--- drivers/thunderbolt/tb.c | 48

[PATCH 00/18] thunderbolt: Align with USB4 inter-domain and DROM specs

2021-03-04 Thread Mika Westerberg
t includes the device and IDs instead of the generic entries in the Thunderbotl 1-3 DROMs. This series updates the driver to parse this descriptor too. [1] https://www.usb.org/document-library/usb4tm-specification Mika Westerberg (18): thunderbolt: Disable retry logic for intra-domain contr

[PATCH 10/18] thunderbolt: Add support for maxhopid XDomain property

2021-03-04 Thread Mika Westerberg
xpose this maxhopid as an attribute under each XDomain device. While there drop kernel-doc entry for property_lock which seems to be left there when the structure was originally introduced. Signed-off-by: Mika Westerberg --- .../ABI/testing/sysfs-bus-thunderbolt | 7 + drivers/t

[PATCH 15/18] thunderbolt: Add KUnit tests for XDomain properties

2021-03-04 Thread Mika Westerberg
This adds KUnit tests for parsing, formatting and copying of XDomain properties. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/test.c | 252 + 1 file changed, 252 insertions(+) diff --git a/drivers/thunderbolt/test.c b/drivers/thunderbolt/test.c

[PATCH 11/18] thunderbolt: Use dedicated flow control for DMA tunnels

2021-03-04 Thread Mika Westerberg
The USB4 inter-domain service spec recommends using dedicated flow control scheme so update the driver accordingly. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tunnel.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/thunderbolt

[PATCH 08/18] thunderbolt: Align XDomain protocol timeouts with the spec

2021-03-04 Thread Mika Westerberg
The USB4 inter-domain service spec has slightly different recommended timeouts for the XDomain protocol so align the driver with those. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/xdomain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thunderbolt

[PATCH 09/18] thunderbolt: Add tb_property_copy_dir()

2021-03-04 Thread Mika Westerberg
This function takes a deep copy of the properties. We need this in order to support more dynamic properties per XDomain connection as required by the USB4 inter-domain service spec. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/property.c | 71

[PATCH 14/18] net: thunderbolt: Align the driver to the USB4 networking spec

2021-03-04 Thread Mika Westerberg
The USB4 networking spec (USB4NET) recommends different timeouts, and also suggest that the driver sets the 64k frame support flag in the properties block. Make the networking driver to honor this. Signed-off-by: Mika Westerberg --- drivers/net/thunderbolt.c | 7 --- 1 file changed, 4

[PATCH 02/18] thunderbolt: Do not pass timeout for tb_cfg_reset()

2021-03-04 Thread Mika Westerberg
: Mika Westerberg --- drivers/thunderbolt/ctl.c| 6 ++ drivers/thunderbolt/ctl.h| 3 +-- drivers/thunderbolt/switch.c | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 875922133782..b79be1f02d92 100644 --- a

[PATCH 16/18] thunderbolt: Add KUnit tests for DMA tunnels

2021-03-04 Thread Mika Westerberg
Add a couple of tests to check DMA tunneling functionality. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/test.c | 240 + 1 file changed, 240 insertions(+) diff --git a/drivers/thunderbolt/test.c b/drivers/thunderbolt/test.c index 4e1e7ae2d90d

[PATCH 17/18] thunderbolt: Check quirks in tb_switch_add()

2021-03-04 Thread Mika Westerberg
This makes it more visible on the main path of adding router. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/eeprom.c | 1 - drivers/thunderbolt/switch.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c

[PATCH 12/18] thunderbolt: Drop unused tb_port_set_initial_credits()

2021-03-04 Thread Mika Westerberg
This function is not used anymore in the driver so we can remove it. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 22 -- drivers/thunderbolt/tb.h | 1 - 2 files changed, 23 deletions(-) diff --git a/drivers/thunderbolt/switch.c b/drivers

[PATCH 18/18] thunderbolt: Add support for USB4 DROM

2021-03-04 Thread Mika Westerberg
3 it means the router only has USB4 DROM and if it reads 1 it means the router supports TBT3 compatible DROM. For this reason, update the DROM parsing code to support "pure" USB4 DROMs too. While there drop the extra empty line at the end of tb_drom_read(). Signed-off-by: Mika West

[PATCH 06/18] thunderbolt: Do not re-establish XDomain DMA paths automatically

2021-03-04 Thread Mika Westerberg
This step is actually not needed. The service drivers themselves will handle this once they have negotiated the service up and running again with the remote side. Also dropping this makes it easier to add support for multiple DMA tunnels over a single XDomain connection. Signed-off-by: Mika

Re: [BUG] Thunderbolt network package forward speed problem.

2021-03-07 Thread Mika Westerberg
Hi, On Sat, Mar 06, 2021 at 11:33:57PM +0800, Jax Jiang wrote: > Hi! > Authors of Linux thunderbolt-network driver: > > Problem: > > Thunderbolt network <- Software Router(NUC 11) <- 10G NIC Speed is normal= > about 9-10Gbps > Thunderbolt network -> Software Router(NUC 11) -> 10G NIC Speed

Re: [PATCH 00/18] thunderbolt: Align with USB4 inter-domain and DROM specs

2021-03-18 Thread Mika Westerberg
On Thu, Mar 04, 2021 at 03:31:07PM +0300, Mika Westerberg wrote: > Hi all, > > The latest USB4 spec [1] also includes inter-domain (peer-to-peer, XDomain) > and DROM (per-device ROM) specs. There are sligth differences between what > the driver is doing now and what the spec say

[PATCH] thunderbolt: Initialize Thunderbolt bus earlier

2017-10-09 Thread Mika Westerberg
safe side also add a check for properly initialized xdomain_property_dir to tb_register_property_dir(). Reported-by: kernel test robot Signed-off-by: Mika Westerberg --- Hi David, This fixes a crash introduced in the Thunderbolt networking patches, so I'm wondering could you take this to

Re: linux-next: manual merge of the drivers-x86 tree with the net-next tree

2017-10-09 Thread Mika Westerberg
On Mon, Oct 09, 2017 at 06:56:33PM +0100, Mark Brown wrote: > +Networking over Thunderbolt cable > +- > +Thunderbolt technology allows software communication across two hosts > +connected by a Thunderbolt cable. > + > +It is possible to tunnel any kind of traff

Re: linux-next: manual merge of the drivers-x86 tree with the net-next tree

2017-10-10 Thread Mika Westerberg
On Mon, Oct 09, 2017 at 04:18:10PM -0700, Darren Hart wrote: > I'm not sure how we would deal with it in the trees. Best to note this during > the merge window - whichever goes in second. Test merge will identify the > merge > conflict, and we can include a note to Linus on the preference. That

[PATCH v2 11/16] thunderbolt: Use spinlock in ring serialization

2017-09-25 Thread Mika Westerberg
This makes it possible to enqueue frames also from atomic context which is needed for example, when networking packets are sent over a Thunderbolt cable. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- drivers/thunderbolt/nhi.c | 26

[PATCH v2 16/16] net: Add support for networking over Thunderbolt cable

2017-09-25 Thread Mika Westerberg
brought down by user or the driver is unloaded. Signed-off-by: Amir Levy Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat --- Documentation/admin-guide/thunderbolt.rst | 24 + MAINTAINERS |6 + drivers/net/Kconfig

[PATCH v2 13/16] thunderbolt: Add polling mode for rings

2017-09-25 Thread Mika Westerberg
interrupt is triggered. Completed frames can be fetched using tb_ring_poll() and the interrupt can be re-enabled when the caller is finished with polling by using tb_ring_poll_complete(). Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- drivers/thunderbolt

[PATCH v2 14/16] thunderbolt: Add function to retrieve DMA device for the ring

2017-09-25 Thread Mika Westerberg
This is needed when Thunderbolt service drivers need to DMA map memory before it is passed down to the ring. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- include/linux/thunderbolt.h | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH v2 09/16] thunderbolt: Export ring handling functions to modules

2017-09-25 Thread Mika Westerberg
These are used by Thunderbolt services to send and receive frames over the high-speed DMA rings. We also put the functions to tb_ namespace to make sure we do not collide with others and add missing kernel-doc comments for the exported functions. Signed-off-by: Mika Westerberg Reviewed-by

[PATCH v2 05/16] thunderbolt: Move tb_switch_phy_port_from_link() to thunderbolt.h

2017-09-25 Thread Mika Westerberg
() to reflect the fact that it does not take switch as parameter. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- drivers/thunderbolt/icm.c | 2 +- drivers/thunderbolt/tb.h| 7 --- include/linux/thunderbolt.h | 7 +++ 3 files changed, 8

[PATCH v2 12/16] thunderbolt: Use spinlock in NHI serialization

2017-09-25 Thread Mika Westerberg
This is needed because ring polling functionality can be called from atomic contexts when networking and other high-speed traffic is transferred over a Thunderbolt cable. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- drivers/thunderbolt/nhi.c

[PATCH v2 02/16] thunderbolt: Add support for XDomain properties

2017-09-25 Thread Mika Westerberg
these properties and establishes an API drivers can use in addition to the core Thunderbolt driver. This API is exposed in a new header: include/linux/thunderbolt.h. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg

[PATCH v2 06/16] thunderbolt: Add support for XDomain discovery protocol

2017-09-25 Thread Mika Westerberg
information retrieved from the property directory describing the service. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat --- Documentation/ABI/testing/sysfs-bus-thunderbolt | 48 + drivers

[PATCH v2 15/16] thunderbolt: Allocate ring HopID automatically if requested

2017-09-25 Thread Mika Westerberg
HopIDs will be allocated from the range which is not reserved for the Thunderbolt protocol (8 .. hop_count - 1). The allocated HopID can be retrieved from ring->hop field after the ring has been allocated successfully if needed. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Revie

[PATCH v2 10/16] thunderbolt: Move ring descriptor flags to thunderbolt.h

2017-09-25 Thread Mika Westerberg
A Thunderbolt service driver might need to check if there was an error with the descriptor when in frame mode. We also add two Rx specific error flags RING_DESC_CRC_ERROR and RING_DESC_BUFFER_OVERRUN. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat

[PATCH v2 07/16] thunderbolt: Configure interrupt throttling for all interrupts

2017-09-25 Thread Mika Westerberg
This will keep the interrupt delivery rate reasonable. The value used here (128 us) is a recommendation from the hardware people. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat

[PATCH v2 01/16] byteorder: Move {cpu_to_be32,be32_to_cpu}_array() from Thunderbolt to core

2017-09-25 Thread Mika Westerberg
We will be using these when communicating XDomain discovery protocol over Thunderbolt link but they might be useful for other drivers as well. Make them available through byteorder/generic.h. Suggested-by: Andy Shevchenko Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by

[PATCH v2 08/16] thunderbolt: Add support for frame mode

2017-09-25 Thread Mika Westerberg
used for this purpose. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat --- drivers/thunderbolt/ctl.c | 3 +- drivers/thunderbolt/nhi.c | 76

[PATCH v2 03/16] thunderbolt: Move enum tb_cfg_pkg_type to thunderbolt.h

2017-09-25 Thread Mika Westerberg
These will be needed by Thunderbolt services when sending and receiving XDomain control messages. While there change TB_CFG_PKG_PREPARE_TO_SLEEP value to be decimal in order to be consistent with other members. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel

[PATCH v2 04/16] thunderbolt: Move thunderbolt domain structure to thunderbolt.h

2017-09-25 Thread Mika Westerberg
These are needed by Thunderbolt services so move them to thunderbolt.h to make sure they are available outside of drivers/thunderbolt. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- drivers/thunderbolt/tb.h| 42

[PATCH v2 00/16] Thunderbolt networking

2017-09-25 Thread Mika Westerberg
side can locate the networking service and load the corresponding driver). Amir Levy (1): net: Add support for networking over Thunderbolt cable Mika Westerberg (15): byteorder: Move {cpu_to_be32,be32_to_cpu}_array() from Thunderbolt to core thunderbolt: Add support for XDomain properties

Re: [PATCH v2 02/16] thunderbolt: Add support for XDomain properties

2017-09-27 Thread Mika Westerberg
On Tue, Sep 26, 2017 at 09:33:54PM -0700, David Miller wrote: > From: Mika Westerberg > Date: Mon, 25 Sep 2017 14:07:24 +0300 > > > +struct tb_property_entry { > > + u32 key_hi; > > + u32 key_lo; > > + u16 length; > > + u8 reserved; > > +

Re: [PATCH v2 16/16] net: Add support for networking over Thunderbolt cable

2017-09-27 Thread Mika Westerberg
On Tue, Sep 26, 2017 at 09:47:21PM -0700, David Miller wrote: > From: Mika Westerberg > Date: Mon, 25 Sep 2017 14:07:38 +0300 > > > +struct thunderbolt_ip_header { > > + u32 route_hi; > > + u32 route_lo; > > + u32 length_sn; > > + uui

Re: [PATCH v2 16/16] net: Add support for networking over Thunderbolt cable

2017-09-27 Thread Mika Westerberg
On Wed, Sep 27, 2017 at 09:27:09AM -0700, David Miller wrote: > From: Mika Westerberg > Date: Wed, 27 Sep 2017 16:42:38 +0300 > > > Using build_skb() then would require to allocate larger buffer, that > > includes NET_SKB_PAD + SKB_DATA_ALIGN(skb_shared_info) and that exce

[PATCH v3 07/19] thunderbolt: Add support for XDomain discovery protocol

2017-10-02 Thread Mika Westerberg
information retrieved from the property directory describing the service. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko --- Documentation/ABI/testing/sysfs-bus

[PATCH v3 11/19] thunderbolt: Move ring descriptor flags to thunderbolt.h

2017-10-02 Thread Mika Westerberg
A Thunderbolt service driver might need to check if there was an error with the descriptor when in frame mode. We also add two Rx specific error flags RING_DESC_CRC_ERROR and RING_DESC_BUFFER_OVERRUN. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat

[PATCH v3 18/19] net: Add support for networking over Thunderbolt cable

2017-10-02 Thread Mika Westerberg
brought down by user or the driver is unloaded. Signed-off-by: Amir Levy Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko --- Documentation/admin-guide/thunderbolt.rst | 24 + drivers/net/Kconfig

[PATCH v3 05/19] thunderbolt: Move thunderbolt domain structure to thunderbolt.h

2017-10-02 Thread Mika Westerberg
These are needed by Thunderbolt services so move them to thunderbolt.h to make sure they are available outside of drivers/thunderbolt. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko --- drivers/thunderbolt/tb.h| 42

[PATCH v3 06/19] thunderbolt: Move tb_switch_phy_port_from_link() to thunderbolt.h

2017-10-02 Thread Mika Westerberg
() to reflect the fact that it does not take switch as parameter. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko --- drivers/thunderbolt/icm.c | 2 +- drivers/thunderbolt/tb.h| 7 --- include/linux/thunderbolt.h | 7

[PATCH v3 03/19] thunderbolt: Add support for XDomain properties

2017-10-02 Thread Mika Westerberg
these properties and establishes an API drivers can use in addition to the core Thunderbolt driver. This API is exposed in a new header: include/linux/thunderbolt.h. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg

[PATCH v3 16/19] thunderbolt: Allocate ring HopID automatically if requested

2017-10-02 Thread Mika Westerberg
HopIDs will be allocated from the range which is not reserved for the Thunderbolt protocol (8 .. hop_count - 1). The allocated HopID can be retrieved from ring->hop field after the ring has been allocated successfully if needed. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Revie

[PATCH v3 17/19] MAINTAINERS: Add thunderbolt.h to the Thunderbolt driver entry

2017-10-02 Thread Mika Westerberg
The new API header (include/linux/thunderbolt.h) is maintained by the Thunderbolt driver maintainers. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index

[PATCH v3 19/19] MAINTAINERS: Add entry for Thunderbolt network driver

2017-10-02 Thread Mika Westerberg
I will be maintaining the Thunderbolt network driver along with Michael and Yehezkel. Signed-off-by: Michael Jamet Signed-off-by: Yehezkel Bernat Signed-off-by: Mika Westerberg --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index

[PATCH v3 14/19] thunderbolt: Add polling mode for rings

2017-10-02 Thread Mika Westerberg
interrupt is triggered. Completed frames can be fetched using tb_ring_poll() and the interrupt can be re-enabled when the caller is finished with polling by using tb_ring_poll_complete(). Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat Reviewed-by: Andy

[PATCH v3 10/19] thunderbolt: Export ring handling functions to modules

2017-10-02 Thread Mika Westerberg
These are used by Thunderbolt services to send and receive frames over the high-speed DMA rings. We also put the functions to tb_ namespace to make sure we do not collide with others and add missing kernel-doc comments for the exported functions. Signed-off-by: Mika Westerberg Reviewed-by

[PATCH v3 13/19] thunderbolt: Use spinlock in NHI serialization

2017-10-02 Thread Mika Westerberg
This is needed because ring polling functionality can be called from atomic contexts when networking and other high-speed traffic is transferred over a Thunderbolt cable. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko

[PATCH v3 15/19] thunderbolt: Add function to retrieve DMA device for the ring

2017-10-02 Thread Mika Westerberg
This is needed when Thunderbolt service drivers need to DMA map memory before it is passed down to the ring. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko --- include/linux/thunderbolt.h | 13 + 1 file changed

[PATCH v3 04/19] thunderbolt: Move enum tb_cfg_pkg_type to thunderbolt.h

2017-10-02 Thread Mika Westerberg
These will be needed by Thunderbolt services when sending and receiving XDomain control messages. While there change TB_CFG_PKG_PREPARE_TO_SLEEP value to be decimal in order to be consistent with other members. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel

[PATCH v3 09/19] thunderbolt: Add support for frame mode

2017-10-02 Thread Mika Westerberg
used for this purpose. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko --- drivers/thunderbolt/ctl.c | 3 +- drivers/thunderbolt/nhi.c | 76

[PATCH v3 08/19] thunderbolt: Configure interrupt throttling for all interrupts

2017-10-02 Thread Mika Westerberg
This will keep the interrupt delivery rate reasonable. The value used here (128 us) is a recommendation from the hardware people. This code is based on the work done by Amir Levy and Michael Jamet. Signed-off-by: Michael Jamet Signed-off-by: Mika Westerberg Reviewed-by: Yehezkel Bernat

[PATCH v3 00/19] Thunderbolt networking

2017-10-02 Thread Mika Westerberg
have the networking service enabled by default). For Linux to Linux connection one host needs to load the networking driver first (so that the other side can locate the networking service and load the corresponding driver). Amir Levy (1): net: Add support for networking over Thunderbolt cable Mika

[PATCH v3 01/19] byteorder: Move {cpu_to_be32,be32_to_cpu}_array() from Thunderbolt to core

2017-10-02 Thread Mika Westerberg
We will be using these when communicating XDomain discovery protocol over Thunderbolt link but they might be useful for other drivers as well. Make them available through byteorder/generic.h. Suggested-by: Andy Shevchenko Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by

[PATCH v3 12/19] thunderbolt: Use spinlock in ring serialization

2017-10-02 Thread Mika Westerberg
This makes it possible to enqueue frames also from atomic context which is needed for example, when networking packets are sent over a Thunderbolt cable. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat Reviewed-by: Andy Shevchenko --- drivers

[PATCH v3 02/19] thunderbolt: Remove __packed from ICM message structures

2017-10-02 Thread Mika Westerberg
These messages are all 32-byte aligned and they should be packed without the __packed attribute just fine. It also allows compiler to generate better code on some architectures. Signed-off-by: Mika Westerberg Reviewed-by: Michael Jamet Reviewed-by: Yehezkel Bernat --- drivers/thunderbolt

[PATCH net-next] net: thunderbolt: Convert to use SPDX identifier

2018-08-28 Thread Mika Westerberg
This gets rid of the licence boilerblate in favor of SPDX identifier which only takes a single line comment. Signed-off-by: Mika Westerberg --- drivers/net/thunderbolt.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c

[PATCH v4 31/36] thunderbolt: Make tb_switch_alloc() return ERR_PTR()

2019-04-10 Thread Mika Westerberg
hardware when trying to access the possible switch. Convert all the current call sites to handle this properly. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c| 6 +++--- drivers/thunderbolt/switch.c | 36 drivers/thunderbolt/tb.c | 6

[PATCH 18/28] thunderbolt: Scan only valid NULL adapter ports in hotplug

2019-01-29 Thread Mika Westerberg
software connection manager code when hotplug event is handled. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tb.c | 10 ++ drivers/thunderbolt/tb.h | 5 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c

[PATCH 27/28] thunderbolt: Make rest of the logging to happen at debug level

2019-01-29 Thread Mika Westerberg
). Signed-off-by: Mika Westerberg --- drivers/thunderbolt/ctl.c| 2 +- drivers/thunderbolt/icm.c| 2 +- drivers/thunderbolt/path.c | 30 +++--- drivers/thunderbolt/switch.c | 19 +-- drivers/thunderbolt/tb.c | 11 +-- drivers/thunderbolt

[PATCH 25/28] thunderbolt: Make tb_switch_alloc() return ERR_PTR()

2019-01-29 Thread Mika Westerberg
hardware when trying to access the possible switch. Convert all the current call sites to handle this properly. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c| 6 +++--- drivers/thunderbolt/switch.c | 36 drivers/thunderbolt/tb.c | 6

[PATCH 22/28] thunderbolt: Run tb_xdp_handle_request() in system workqueue

2019-01-29 Thread Mika Westerberg
her domain as soon as possible run tb_xdp_handle_request() in system workqueue instead. Since the device can be hot-removed in the middle we need to make sure the domain structure is still around when the function is run so increase reference count before we schedule the reply work. Signed-off-by: M

[PATCH 23/28] thunderbolt: Add XDomain UUID exchange support

2019-01-29 Thread Mika Westerberg
that if the remote domain UUID is not filled in the core will query it first and only then start the normal property exchange flow. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tb_msgs.h | 11 +++ drivers/thunderbolt/xdomain.c | 136 +++--- include/linux

  1   2   >