From patchwork Wed Sep 26 16:10:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Limonciello, Mario" X-Patchwork-Id: 10616111 X-Patchwork-Delegate: andy.shevchenko@gmail.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4D23112B for ; Wed, 26 Sep 2018 16:11:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADB032B3F2 for ; Wed, 26 Sep 2018 16:11:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1C162B36B; Wed, 26 Sep 2018 16:11:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C51F2B3CE for ; Wed, 26 Sep 2018 16:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbeIZWYq (ORCPT ); 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: A2EUAABKrqtbhyeV50NaHAEBAQQBAQcEAQGBUYJzfyiMCV+LUphcgT87CyMLhD6EACE0GAEDAQECAQECAQECEAEBAQoLCQgpIwyCNSQBCgRLOzABAQEBAQEBAQEBAQEBAQEaAg1mFmdPbwESIoJ/AYIBD5huiVcBAQGCG4QrAYVkBYYUUTyDWoFYP4EShi0CAhiBEIYPAog2CIYzRo1QBwKCCASEN4lqAhWPMwGLe4hvAgQCBAUCFIFCgg5wgzyCM4NPhRSFXFEBinqCTAEB X-IPAS-Result: A2EUAABKrqtbhyeV50NaHAEBAQQBAQcEAQGBUYJzfyiMCV+LUphcgT87CyMLhD6EACE0GAEDAQECAQECAQECEAEBAQoLCQgpIwyCNSQBCgRLOzABAQEBAQEBAQEBAQEBAQEaAg1mFmdPbwESIoJ/AYIBD5huiVcBAQGCG4QrAYVkBYYUUTyDWoFYP4EShi0CAhiBEIYPAog2CIYzRo1QBwKCCASEN4lqAhWPMwGLe4hvAgQCBAUCFIFCgg5wgzyCM4NPhRSFXFEBinqCTAEB 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: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Mika Westerberg --- 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;