Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1215429ybh; Sat, 3 Aug 2019 20:49:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgBpVSXj7Uc31M0oNpdswjiLddeePMqRu+0hNr+NmCaecCMUnojawLkuG1v+2PJcLy78qC X-Received: by 2002:aa7:86c6:: with SMTP id h6mr68103075pfo.51.1564890574982; Sat, 03 Aug 2019 20:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564890574; cv=none; d=google.com; s=arc-20160816; b=dSgMJZwueAn/8yxQy2MVumGUDNG1hAGkpZpSlJDiIMneqwvAxbZbDEkn4cgkCcVTU+ 3LREA5S/an2nwV/TC9oGSsrFtA2irTmDbTmKDkra1f1iGjNzxWXOzVQf6ibGv4hJmtPu 1eQ21pud5vumi4iYZgmY2ipAB3Brj0qoivkdffoxCig4tiIUrZW6lkH1mdTJ3UFkdGoK gRAlozfJ8iparsjlwwSpilxZyRw1zmMG4MZ9pt8f4GeUJb9iUpocpHHcaMPm7yn9bSy3 X+0sSZOv1QAyeGlcuPPWT2up/NCjhaRmIG9j07p5EgvPwfFUC0KSHaj5yQ3oXfulfgA9 M1rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FFWycGvH05MSGboWDfIYDKBKXpCg4o5CmsYcTcWJSaY=; b=HRyJTee/PF9kDc3RU0P0ERIPAj9KLV2GnALrAXgSMRzebijtDOAwdJwOLShXc1EbPm snHh8B3zWHZiqLMl24oxTnfbfUcOarw8TLc6fY1Czvh4sYLLXhQez1vrXyWXwwKtF+Tk cq2X8IVBF3zbSrRiLHjziMM3gk62RcFVApi9t/kkKI2iOjj4B/ewcVkSEtb2S5V6F+ci PXIVA+p2/843XzEoBZxPAiE1VZZrW6ZQ1BLSwgRybBP3myCRA+lGn/6NmK3EYsnZyZMp jU/FHPf8SG2SEfGeVdwue9E+knO8t0qwQdxPLtoNXTgETthoPtS49/XJchFMYhO3gsjY TXng== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y92si37048343plb.209.2019.08.03.20.49.20; Sat, 03 Aug 2019 20:49:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727629AbfHCOOD (ORCPT + 99 others); Sat, 3 Aug 2019 10:14:03 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:33509 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbfHCOOD (ORCPT ); Sat, 3 Aug 2019 10:14:03 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 93E09300000AD; Sat, 3 Aug 2019 16:14:01 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 62A5226343; Sat, 3 Aug 2019 16:14:01 +0200 (CEST) Date: Sat, 3 Aug 2019 16:14:01 +0200 From: Lukas Wunner To: Mika Westerberg 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: <20190803141401.bmjo7u723p4wxtqb@wunner.de> References: <20190705095800.43534-1-mika.westerberg@linux.intel.com> <20190705095800.43534-5-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190705095800.43534-5-mika.westerberg@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Lukas