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


Groups > linux.kernel > #1651901

Re: [PATCH v2 09/27] thunderbolt: Convert switch to a device

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 09/27] thunderbolt: Convert switch to a device
Date 2017-05-27 17:50 +0200
Message-ID <tLM8x-5Sc-7@gated-at.bofh.it> (permalink)
References <tLq81-87A-5@gated-at.bofh.it> <tLq82-87A-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, May 26, 2017 at 7:09 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> Thunderbolt domain consists of switches that are connected to each
> other, forming a bus. This will convert each switch into a real Linux
> device structure and adds them to the domain. The advantage here is
> that we get all the goodies from the driver core, like reference
> counting and sysfs hierarchy for free.
>
> Also expose device identification information to the userspace via new
> sysfs attributes.
>
> In order to support internal connection manager (ICM) we separate switch
> configuration into its own function (tb_switch_configure()) which is
> only called by the existing native connection manager implementation
> used on Macs.

> +       /*
> +        * The newer controllers include fused UUID as part of link
> +        * controller specific registers
> +        */
> +       cap = tb_switch_find_vsec_cap(sw, TB_VSEC_CAP_LINK_CONTROLLER);
> +       if (cap > 0) {
> +               tb_sw_read(sw, uuid, TB_CFG_SWITCH, cap + 3, 4);
> +       } else {
> +               /*
> +                * By default the UUID will be based on UID where upper two
> +                * dwords are filled with ones.
> +                */
> +               uuid[0] = sw->uid & 0xffffffff;
> +               uuid[1] = (sw->uid >> 32) & 0xffffffff;
> +               uuid[2] = 0xffffffff;
> +               uuid[3] = 0xffffffff;
> +       }

It might make sense to add some comment as we discussed earlier
(privately) about (non-)compatibiliness with UUID by spec and why 0xff
are used.

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 09/27] thunderbolt: Convert switch to a device Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-26 18:20 +0200
  Re: [PATCH v2 09/27] thunderbolt: Convert switch to a device Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 17:50 +0200
    Re: [PATCH v2 09/27] thunderbolt: Convert switch to a device Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-28 10:50 +0200

csiph-web