Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5682042imu; Wed, 30 Jan 2019 01:37:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN61Kr/dQ7SixpT0EoiniplfbWOTf6N5CJCz3QkiPPBNLIB00EOVIDln6P2d+lGfUTbXmP2o X-Received: by 2002:a17:902:7481:: with SMTP id h1mr30049118pll.341.1548841058717; Wed, 30 Jan 2019 01:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548841058; cv=none; d=google.com; s=arc-20160816; b=xgbqZZU17mRLNWf5ryBtWiQ5LeMnWiUQoiJA6aCtYfw+5rHcdxSzkACftgkZ8fuj/I RZ6JBMlGMRCiyQ1IK5G+8OhSF6aBIa5EKSQr6tgP8WvjfzV3X9Pf29Nbu2hUvw1iDbrQ +ogR9anmZ3ZCZP5Eow/0BcxsBISSpF50jDD65doiHqmpmDUuUL2shQ7+LPgd9Z4XZbnK DnbJGFMMnSoMC+O1scTkrcJpHpSTnG4C0p6nCP+bLm9o7swH4C3oJxz6IS/zCKTy0kOK JMEswGQNYFdVzO4OaVZYHF048eq8EIGYyt8Fr6afZqpkhwa7DUfSbvsSfOWWvIeBgBQY ma2g== 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=DKN8viretjM199xLeLysmA6K7QluWhSUJi6Y+j6xx28=; b=MwTtXw7NEzTF++jouGqqNmPjS20mgX0NB7W5iZvk0GlMnsc/SLutcC6fbOo1tohyL1 Vjc8rRZlZCNT1XUO2ETxUF1vCHKZlNisFIgH9hm+CrlBYVOcVAcvdvmgfVKug1vWV9BI R5Vul/0ftJ+GCckv7gMfPtp1U6nXe3aMvWEp9xAckYySjF0JQcQ/1tCO/WNf6ehDpBTb wrKx7Hqutmrc+EG5CDCx1lBentaaCHBiesf33gBofJ/hLy5zd1KhL1MIvhs6/PphW88i WzQ5jrDOAONX65u2jPU6xz79ty6FOlHM+jHhKSNHb3MJT34Z5sLJCu7hgXGghkdvYRNZ aQ3A== 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 m2si1021240pgs.96.2019.01.30.01.37.22; Wed, 30 Jan 2019 01:37:38 -0800 (PST) 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 S1729227AbfA3JhJ (ORCPT + 99 others); Wed, 30 Jan 2019 04:37:09 -0500 Received: from mga05.intel.com ([192.55.52.43]:14777 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbfA3JhI (ORCPT ); Wed, 30 Jan 2019 04:37:08 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2019 01:37:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="316091199" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga005.fm.intel.com with SMTP; 30 Jan 2019 01:37:05 -0800 Received: by lahna (sSMTP sendmail emulation); Wed, 30 Jan 2019 11:37:05 +0200 Date: Wed, 30 Jan 2019 11:37:05 +0200 From: Mika Westerberg To: Lukas Wunner Cc: linux-kernel@vger.kernel.org, Michael Jamet , Yehezkel Bernat , Andreas Noever , Andy Shevchenko Subject: Re: [PATCH 03/28] thunderbolt: Enable TMU access when accessing port space on legacy devices Message-ID: <20190130093705.GF7875@lahna.fi.intel.com> References: <20190129150143.12681-1-mika.westerberg@linux.intel.com> <20190129150143.12681-4-mika.westerberg@linux.intel.com> <20190129215858.c2yws2ce76d7qm62@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190129215858.c2yws2ce76d7qm62@wunner.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 10:58:58PM +0100, Lukas Wunner wrote: > On Tue, Jan 29, 2019 at 06:01:18PM +0300, Mika Westerberg wrote: > > + if (enable) > > + value |= BIT(20); > > Can we have a macro for this bit? Sure. > > +int tb_port_find_cap(struct tb_port *port, enum tb_port_cap cap) > > +{ > > + int ret; > > + > > + ret = tb_port_enable_tmu(port, true); > > + if (ret) > > + return ret; > > + > > + ret = __tb_port_find_cap(port, cap); > > + > > + tb_port_enable_tmu(port, false); > > + > > + return ret; > > +} > > Would there be a downside to setting the TMU bit on all ports all the time > (e.g. on switch enumeration)? You mean turn it on once and keep it like that? Quick experimentation with a couple of LR devices did not show any side-effects so I guess we could just turn it on once during the enumeration in affected devices. Main reason it is now in cap.c is because we only need it to be enabled during the cap walk and that allows keeping both workarounds in the same file close to the place where it is used.