From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750986AbdE1IkW (ORCPT ); Sun, 28 May 2017 04:40:22 -0400 Received: from mga06.intel.com ([134.134.136.31]:35832 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdE1IkV (ORCPT ); Sun, 28 May 2017 04:40:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,408,1491289200"; d="scan'208";a="1135547351" Date: Sun, 28 May 2017 11:40:15 +0300 From: Mika Westerberg To: Andy Shevchenko Cc: Greg Kroah-Hartman , Andreas Noever , Michael Jamet , Yehezkel Bernat , Lukas Wunner , Amir Levy , Andy Lutomirski , Mario Limonciello , Jared.Dominguez@dell.com, Andy Shevchenko , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 09/27] thunderbolt: Convert switch to a device Message-ID: <20170528084015.GG2784@lahna.fi.intel.com> References: <20170526160936.54265-1-mika.westerberg@linux.intel.com> <20170526160936.54265-10-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 27, 2017 at 06:45:24PM +0300, Andy Shevchenko wrote: > On Fri, May 26, 2017 at 7:09 PM, Mika Westerberg > 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. OK, I'll update the comment here and also reword the attribute description in sysfs-bus-thunderbolt.