Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2755077ybh; Mon, 5 Aug 2019 06:20:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnv0aszyCf9YFQ14jErnaqzSbX5cq+zSfB84oavcFgGQMWCuKEM1U1bLH5uLMSVSZN9I2J X-Received: by 2002:a17:90a:1a0d:: with SMTP id 13mr17318941pjk.99.1565011218859; Mon, 05 Aug 2019 06:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011218; cv=none; d=google.com; s=arc-20160816; b=ILcTltJd62VgJYavaiF1bMM5GMNKeUWKL/evQhVtVNnO9nkxvFHuBOb3magujJdwu3 bcS35KHAQ4RjPjSa7NynB1EG1jotuWh9Txh7velALBa9rf9T5dnHL/sg5BPenl7lnoO0 OQ2BNsMX+l6csml0YAnAQQwbfmoGqvjdvPeviPPacomB4uAw9YMHI1WStq1fgF8uJXwl dskH9wPqRoV2/Gs2HA9Qf87yxJVZUQjFmqz9OQO9xyXgHB9XcxMXAtqJjeapGT02Qmoq 9maNmMndH5K8eja65cqJMu6KBNHWb5jIwoNU3hjW8wPbSkD1BIXswI1IEXUBeJohtrjR WRBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/UB14UaDCZjvwBPR+OBb6jVwcZ7VCs6yh+S9QFm5Gy8=; b=Gr6QM+p7CGmjbeS7TltvFALoYkT/dmvvFnBZzv26xp4O6xVTuS2PSn6D6MbE6KYJnT +saNtXuqmkdzRuNdVJXtGXxME5w+Ns9kpAZavTJ7gZVD3H0md+/EA81q+3ODbQtDSdCL 8Ia8Z8cetR3WD9s+cUXbadgExb3H0zbOpi6MxA/icQiUH//mAQcDkT/hrsZyRNZtIP5M kwooLtjBu2Z1g8adUEoruPzIWOjv69V+J9PDpE0k4mZ46t1R00adtUMiFtXEdnoEWmoQ CZzXT5DCbn1Rytr6dfE9LXxw6tFiSfQIcsNNssg3GAVfBqihAcEHnnTZgbzU5l8Ozzw3 kPwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si42532058pgp.421.2019.08.05.06.20.03; Mon, 05 Aug 2019 06:20:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729482AbfHENSN (ORCPT + 99 others); Mon, 5 Aug 2019 09:18:13 -0400 Received: from mga03.intel.com ([134.134.136.65]:48668 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbfHENSM (ORCPT ); Mon, 5 Aug 2019 09:18:12 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 06:17:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,350,1559545200"; d="scan'208";a="192418646" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 05 Aug 2019 06:17:44 -0700 Received: by lahna (sSMTP sendmail emulation); Mon, 05 Aug 2019 16:17:43 +0300 Date: Mon, 5 Aug 2019 16:17:43 +0300 From: Mika Westerberg To: Lukas Wunner Cc: linux-kernel@vger.kernel.org, Andreas Noever , Michael Jamet , Yehezkel Bernat Subject: Re: [PATCH 4/8] thunderbolt: Do not fail adding switch if some port is not implemented Message-ID: <20190805131743.GS2640@lahna.fi.intel.com> References: <20190705095800.43534-1-mika.westerberg@linux.intel.com> <20190705095800.43534-5-mika.westerberg@linux.intel.com> <20190803141401.bmjo7u723p4wxtqb@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190803141401.bmjo7u723p4wxtqb@wunner.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 03, 2019 at 04:14:01PM +0200, Lukas Wunner wrote: > On Fri, Jul 05, 2019 at 12:57:56PM +0300, Mika Westerberg wrote: > > There are two ways to mark a port as unimplemented. Typical way is to > > return port type as TB_TYPE_INACTIVE when its config space is read. > > Alternatively if the port is not physically present (such as ports 10 > > and 11 in ICL) reading from port config space returns > > TB_CFG_ERROR_INVALID_CONFIG_SPACE instead. Currently the driver bails > > out from adding the switch if it receives any error during port > > inititialization which is wrong. > > > > Handle this properly and just leave the port as TB_TYPE_INACTIVE before > > continuing to the next port. > > Your patch may also cause this snippet in eeprom.c to become obsolete: > > /* Port 5 is inaccessible on this gen 1 controller */ > if (sw->config.device_id == PCI_DEVICE_ID_INTEL_LIGHT_RIDGE) > sw->ports[5].disabled = true; > > To verify this hypothesis, one needs to comment out the call to > tb_drom_copy_efi() as well as the above-quoted snippet and boot > on a Mac with Light Ridge. The driver should hit an error without > your patch and it may work correctly with your patch. Indeed. I'll check this - as I have Mac with LR, and update the patch accordingly (e.g drop the check if the error does not appear).