From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935501AbdEVUkq (ORCPT ); Mon, 22 May 2017 16:40:46 -0400 Received: from mga02.intel.com ([134.134.136.20]:61748 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933464AbdEVUkn (ORCPT ); Mon, 22 May 2017 16:40:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,379,1491289200"; d="scan'208";a="90407450" Date: Mon, 22 May 2017 23:38:18 +0300 From: Mika Westerberg To: Andreas Noever Cc: Greg Kroah-Hartman , Michael Jamet , Yehezkel Bernat , Lukas Wunner , Amir Levy , Andy Lutomirski , Mario.Limonciello@dell.com, Jared.Dominguez@dell.com, Andy Shevchenko , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset is read as 0 Message-ID: <20170522203818.GG8541@lahna.fi.intel.com> References: <20170518143914.60902-1-mika.westerberg@linux.intel.com> <20170518143914.60902-3-mika.westerberg@linux.intel.com> <20170522084005.GS8541@lahna.fi.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 Mon, May 22, 2017 at 08:41:22PM +0200, Andreas Noever wrote: > Yes there is a check for the root switch, but also one that checks the > return code of tb_drom_read_uid_only :) > > err = tb_drom_read_uid_only(sw, &uid); > if (err) { > tb_sw_warn(sw, "uid read failed\n"); > return err; > } > if (sw != sw->tb->root_switch && sw->uid != uid) { > > > The reason it works on the Mac is because drom_offset is not 0, so the > new branch in tb_drom_read_uid_only is not taken. Probably this is the > case for all Cactus Ridge models and Alpine Ridge doesn't go there > since it uses the ICM? Yes in case of ICM we don't call the function at all. > Still it wouldn't hurt to only read the uid if > sw != root_switch, the value is not used if sw == root_switch. I agree. I'll update the code so that it will only read and check UID when we are not dealing with the root switch.