Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp946938imm; Wed, 26 Sep 2018 09:12:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV61X9dd7sIgKiqVD0Rm72xjsCqRkhT4s6somTNXlzg28/WRWaVAIAw4W8Z2V0N3H1w4alsiK X-Received: by 2002:a17:902:bc44:: with SMTP id t4-v6mr6746737plz.210.1537978321498; Wed, 26 Sep 2018 09:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537978321; cv=none; d=google.com; s=arc-20160816; b=hMe8bqjsbwUoXm8XVuov6H6YO9dYLb68azLX0c1cf66qIB10DNdKjo6yAx0U0ky0rs rJ56ib5m8AA6I4BVg7D2k8ddFKXleu2QbcjyRYLcFmei0AQWuoidstOVOBmX1vFH9B/3 JS+qblnyvxmwZXysxkA9C5or6wLg/iWwvXx5CFgdCV7q38gF/ijUFSf421bDOZ4LpjG+ b8IxXmFw3NJOS0Zjd00IjS2VqooGJL0NbCAp55HoH3DvE8l9dGnvEU5BptWMJFl8OsJc ZwRHgUdPm6Ms1fbtL9Ig6IJDGLBPx+c4cvGRm8mYnO67QC9jIWyrsJsZBKN6vZe/OBjb cuvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=JWMC/yPokhyEXn5GLclZQ6yC4by8YegMbMhhvCPqYLc=; b=n1jfPvu2wLy+8gw4M1icFZ08qIuj93ZMCl/3hCJlBpv/L/f9sB7QsodBX2T+B0ZroI DJJCBq+9Dx8rXazPA8WWuu6ug3xbfmdc1f7ic7P1i2oV1+lKlTUmMWCUZWQHnkLcJaWk l7v2zP9HFEX9xSWH5kok/WCbCNB8afedJXNbHdmIK5OLi2bAu3FbOneW00wa+YRMKPL0 L/54buHm3G7aTsYIjXYsjPpbwDgUbtklvmTMf3Zx2etScmnZh3RaAbw8Xe/6zGz5z5IT eaLeIj8Tr5Qosux8cwD09z/EMNiE837/qlm33DWpYKRlbowjrou8wJiOmEs5xPD5wCTv LwvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dell.com header.s=smtpout header.b=OLGVGS0H; 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=dell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22-v6si5500787pgg.575.2018.09.26.09.11.45; Wed, 26 Sep 2018 09:12:01 -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; dkim=fail header.i=@dell.com header.s=smtpout header.b=OLGVGS0H; 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=dell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728469AbeIZWYq (ORCPT + 99 others); Wed, 26 Sep 2018 18:24:46 -0400 Received: from esa7.dell-outbound.iphmx.com ([68.232.153.96]:10420 "EHLO esa7.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727442AbeIZWYp (ORCPT ); Wed, 26 Sep 2018 18:24:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1537978232; x=1569514232; h=from:to:cc:subject:date:message-id; bh=06OQBzpEygTNfoE2EaoArADsjFWub6dr8IXgjJTaUA0=; b=OLGVGS0HDzw4sSoWNOLvNMizTZ5NpR7KoIJ4qPknig+rEMhDPXN+Pu/8 kCV5IO8Mok15YtnJqPEl7hhZv+NegdGogUD4exuGawZVcLoaqKGHqz2tL 1JlvsPflo+w3nHJ+xCF1ROT/m4ZdVdLzbsH4BcUUpnkWuoNbvinDacj6c E=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EUAABKrqtbhyeV50NaHAEBAQQBAQc?= =?us-ascii?q?EAQGBUYJzfyiMCV+LUphcgT87CyMLhD6EACE0GAEDAQECAQECAQECEAEBAQo?= =?us-ascii?q?LCQgpIwyCNSQBCgRLOzABAQEBAQEBAQEBAQEBAQEaAg1mFmdPbwESIoJ/AYI?= =?us-ascii?q?BD5huiVcBAQGCG4QrAYVkBYYUUTyDWoFYP4EShi0CAhiBEIYPAog2CIYzRo1?= =?us-ascii?q?QBwKCCASEN4lqAhWPMwGLe4hvAgQCBAUCFIFCgg5wgzyCM4NPhRSFXFEBinq?= =?us-ascii?q?CTAEB?= X-IPAS-Result: =?us-ascii?q?A2EUAABKrqtbhyeV50NaHAEBAQQBAQcEAQGBUYJzfyiMC?= =?us-ascii?q?V+LUphcgT87CyMLhD6EACE0GAEDAQECAQECAQECEAEBAQoLCQgpIwyCNSQBC?= =?us-ascii?q?gRLOzABAQEBAQEBAQEBAQEBAQEaAg1mFmdPbwESIoJ/AYIBD5huiVcBAQGCG?= =?us-ascii?q?4QrAYVkBYYUUTyDWoFYP4EShi0CAhiBEIYPAog2CIYzRo1QBwKCCASEN4lqA?= =?us-ascii?q?hWPMwGLe4hvAgQCBAUCFIFCgg5wgzyCM4NPhRSFXFEBinqCTAEB?= Received: from mx0a-00154901.pphosted.com ([67.231.149.39]) by esa7.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 26 Sep 2018 11:10:31 -0500 Received: from pps.filterd (m0133268.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8QG8Uld139047; Wed, 26 Sep 2018 12:11:06 -0400 Received: from esa5.dell-outbound2.iphmx.com (esa5.dell-outbound2.iphmx.com [68.232.153.203]) by mx0a-00154901.pphosted.com with ESMTP id 2mnfyqptpk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 26 Sep 2018 12:11:05 -0400 Received: from ausxippc101.us.dell.com ([143.166.85.207]) by esa5.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 26 Sep 2018 22:11:02 +0600 X-LoopCount0: from 10.173.37.27 X-IronPort-AV: E=Sophos;i="5.54,306,1534827600"; d="scan'208";a="1140620428" From: Mario Limonciello To: dvhart@infradead.org, Andy Shevchenko Cc: LKML , platform-driver-x86@vger.kernel.org, Mika Westerberg , Mario Limonciello Subject: [PATCH] platform/x86: intel-wmi-thunderbolt: Add dynamic debugging Date: Wed, 26 Sep 2018 11:10:58 -0500 Message-Id: <1537978258-2907-1-git-send-email-mario.limonciello@dell.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-26_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=758 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809260152 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some users have been reporting issues with thunderbolt being turned off before fully initialized. This is suspected to be caused by userspace turning off the Thunderbolt controller using intel-wmi-thunderbolt prematurely. Details are available here: https://bugzilla.kernel.org/show_bug.cgi?id=201227 https://bugzilla.kernel.org/show_bug.cgi?id=199631 Userspace has already made some mitigiations for this situation: https://github.com/hughsie/fwupd/commit/ef6f1d76983c9b66 https://github.com/hughsie/fwupd/commit/c07ce5b4889a5384 To allow easier debugging of this situation add output that can be turned on with dynamic debugging to better root cause this problem. Suggested-by: Mika Westerberg Signed-off-by: Mario Limonciello --- drivers/platform/x86/intel-wmi-thunderbolt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/intel-wmi-thunderbolt.c index c2257bd..ce5fbf0 100644 --- a/drivers/platform/x86/intel-wmi-thunderbolt.c +++ b/drivers/platform/x86/intel-wmi-thunderbolt.c @@ -38,12 +38,16 @@ static ssize_t force_power_store(struct device *dev, input.length = sizeof(u8); input.pointer = &mode; mode = hex_to_bin(buf[0]); + dev_dbg(dev, "force_power: storing %#x\n", mode); if (mode == 0 || mode == 1) { status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1, &input, NULL); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status)) { + dev_dbg(dev, "force_power: failed to evaluate ACPI method\n"); return -ENODEV; + } } else { + dev_dbg(dev, "force_power: unsupported mode\n"); return -EINVAL; } return count; -- 2.7.4