Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4072789imm; Mon, 17 Sep 2018 07:48:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYEViGF/IzfEUPeSLpRSBU3lA3xMIxLfUa42vozSyWzaU3F2lghfCKJ+onZCsalPNh4aLkO X-Received: by 2002:a62:234d:: with SMTP id j74-v6mr25955320pfj.106.1537195686753; Mon, 17 Sep 2018 07:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537195686; cv=none; d=google.com; s=arc-20160816; b=rnPazGy99e4aiB3hLoy9lANZybpY3jqJ5uewEV3linytM3csZqYovfL7DT7VR79YYd E3RlX5iRoy5IR4498lAqVBcRqnZUYmFJoOeDUCIEHAGXfl4Y+KezfuqTCGB3b0Gwo9Xp rvkgLaW1MZQfnfnkEhk5LxUPkO2XINfN1nWAqIM6VdsSTzeAUOVyH0rGcI2MMnud1Inq q9V3sOD7PAAFeJCYm6beTAPs6LpuyPsrO3jh/sAIIcIBGYZ9IjDXOsRpQZTtLO5KlbU/ lUtq2eXXt14C02C4LL1FzPRyGG2eNyOPROZz8sa5tTT7OEMaU7IiV9R6oXfFuDOuehNT /+mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=06HiVwPL+J3QEOamA9ql8xU34qUP46goz68JuFWbVso=; b=1LeLAEy+E1cPFZldTKCEuVdDzIcol5JnBF7ilmIFwrO+ZCxyb8jZIfGlxhe3Fy/avV boGLSqZElRO+qdMv1d1wZnLpe9pUHG20JKFmHu18DOxABbik9peWWo7VodkUQdkcnolP IJSfQK53YuJlIKjH/Hrp6reGJ0SFWThpzqeK1IykirUBdhBh/KspIaLT8obanpxRECMC lnZdbRhuKyXe8olIS0rLWn8jZ4AAl9jGIAa2ozh3T+IyxK33T7tzIsipaK6DrBg5ZgMJ 9fCBkFAm/rcJuW0IoxPOfAw/oSThOAX21UU6gV8nFhTiby23/h1HtdZkBTHC8Z+vRPNY e7kw== 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 1-v6si15290198pfx.293.2018.09.17.07.47.41; Mon, 17 Sep 2018 07:48:06 -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 S1728848AbeIQUOs (ORCPT + 99 others); Mon, 17 Sep 2018 16:14:48 -0400 Received: from mga05.intel.com ([192.55.52.43]:5525 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727052AbeIQUOs (ORCPT ); Mon, 17 Sep 2018 16:14:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2018 07:47:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,385,1531810800"; d="scan'208";a="70657958" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 17 Sep 2018 07:43:35 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 15DBF1AA; Mon, 17 Sep 2018 17:43:35 +0300 (EEST) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Andreas Noever , Michael Jamet , Mika Westerberg , Yehezkel Bernat , Lukas Wunner , Anthony Wong Subject: [PATCH v2 2/4] thunderbolt: Print connected devices Date: Mon, 17 Sep 2018 17:43:32 +0300 Message-Id: <20180917144334.18367-3-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180917144334.18367-1-mika.westerberg@linux.intel.com> References: <20180917144334.18367-1-mika.westerberg@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The previous patch made the driver less verbose meanining that all the switch structures and ports are now logged as debug level. However, we have been missing similar output that USB for intance prints when a new USB device is connected and disconnected. This information is useful for end users as well as developers because it immediately shows the actual device that was connected. This patch adds printing of the actual connected devices to the driver. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 81134ee29578..9f44a2924dac 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -1402,6 +1402,14 @@ int tb_switch_add(struct tb_switch *sw) if (ret) return ret; + if (tb_route(sw)) { + dev_info(&sw->dev, "new device found, vendor=%#x device=%#x\n", + sw->vendor, sw->device); + if (sw->vendor_name && sw->device_name) + dev_info(&sw->dev, "%s %s\n", sw->vendor_name, + sw->device_name); + } + ret = tb_switch_nvm_add(sw); if (ret) { device_del(&sw->dev); @@ -1453,6 +1461,9 @@ void tb_switch_remove(struct tb_switch *sw) tb_plug_events_active(sw, false); tb_switch_nvm_remove(sw); + + if (tb_route(sw)) + dev_info(&sw->dev, "device disconnected\n"); device_unregister(&sw->dev); } -- 2.18.0