Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2138584yba; Sun, 5 May 2019 23:46:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4n1yw2JthYJ1lE/D9DvAlRzsLgdqEEcW2Cb212bmyeLGhkVaxDy5MtLf4ek3if7UY4209 X-Received: by 2002:a17:902:4603:: with SMTP id o3mr29780603pld.121.1557125205559; Sun, 05 May 2019 23:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557125205; cv=none; d=google.com; s=arc-20160816; b=kULTJ0ZFgNn7M6pPxH/ziY/zCiZbc+RAXQhWl/KHkbMnDxichfRVWi4UpcwryAL/Ui RpkOu+bIME4uJu2gHBkUDM3GFSvaznJmHnCrqesVkgZHtCLUcE5rXwr8+DCfaDszrVzJ 2M7pzj6hoGzx/eU/ETgTqFoPpgQsCS8s41Af90p1h7z7Cqh+CztactrHqjcrwKo8DxYA jHvc6AvbuGTax1HcXFSaOZ371QtcEpOS+jw68ME78JER+qhhPeIwVaf0+cPj6T9AjrC8 iFrVAJ45fEx477mdRRmjx68NGqx8VABEg98m9CNcCLSn/8CyoSXnLv9OHgRUtMsEgwJF DZRA== 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=CVkvF/8Zs60JQ1Pakhtp1jmqbaoGKt5w6RjbjQ/TkvE=; b=jP7yVrg6uXmMS77vijaPS2bDlyOzWVD6Y14zfUrveVxnXx+1D4jl9aruLr4n5f2Y4/ xgvF126Twf0umzGgjt4pjhivBoKUAiN3ekddhscCq2j47ia346G6ZEmVdB3FzcrvKoiK POKwNYd+F6+YgBjB84noOiUuPZNStm21xQkWNSh4rk3U5uUUG2QIBIZ+P4G9qVyF5BLX YZ0nofHCtCyTQkFVouIWByvXaruvgkc2Zu7z+byEd5da5U/WGnEQOhwTFmnFGhucYdAh 13o7Ql+/9euPse5Xn7Jjih8QUPcpOPviQ3WYGmqwGHbuuBuGOOj+To3jQbHOgYDXYjT7 E5fA== 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 f8si6308899pgc.267.2019.05.05.23.46.29; Sun, 05 May 2019 23:46:45 -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 S1726037AbfEFGpk (ORCPT + 99 others); Mon, 6 May 2019 02:45:40 -0400 Received: from mga03.intel.com ([134.134.136.65]:14674 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbfEFGpk (ORCPT ); Mon, 6 May 2019 02:45:40 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2019 23:45:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,437,1549958400"; d="scan'208";a="171109728" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 05 May 2019 23:45:34 -0700 Received: by lahna (sSMTP sendmail emulation); Mon, 06 May 2019 09:45:34 +0300 Date: Mon, 6 May 2019 09:45:34 +0300 From: Mika Westerberg To: Furquan Shaikh Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , "Schmauss, Erik" , mh@mike.franken.de, Lukas Wunner , Takashi Iwai , Bjorn Helgaas , ckellner@redhat.com, Jiri Slaby , Linux Kernel Mailing List , "Rafael J. Wysocki" , ACPI Devel Maling List , Robert Moore Subject: Re: [REGRESSION 5.0.8] Dell thunderbolt dock broken (xhci_hcd and thunderbolt) Message-ID: <20190506064534.GG2895@lahna.fi.intel.com> References: <20190430090021.GF26516@lahna.fi.intel.com> <20190502114839.GC24696@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 03, 2019 at 04:35:02PM -0700, Furquan Shaikh wrote: > Thanks for reporting the issue and apologize for the breakage. When I > pushed the patch, my understanding was that the device drivers do not > depend on stale GPE events to take any action. > > I am curious to understand the behavior for the thunderbolt device > since I do not have one to test with. The failure seems to be a result > of either having a edge-triggered interrupt or a pulse interrupt which > indicates some kind of ready condition to the kernel driver. All the > runtime GPEs seem to be initialized as part of acpi_init before ACPI > bus is scanned. So, is this some special kind of requirement for > thunderbolt that requires GPE enabled before the device can actually > be probed. And so the GPEs going active before being enabled are then > used as a way to call into ACPI Method to enable something which is > essential for probing of device? IIRC the idea is that when you boot with a TBT device connected (this is only for the BIOS assisted/ACPI enumeration mode) the Thunderbolt host router (the device with PCIe switch + xHCI + NHI) is configured in two phases. The basic configuration is done in the ASL code that then waits for a synchronization event (signal) from the SMI hotplug handler that allows it to continue. The GPE which can be either edge or level is then used to call the SMI hotplug handler to initialize the host router and its resources properly. If this is not done the PCI stack finds the host router half-configured causing the failure. > The other question I have is given that handling of GPE events that > were active before being enabled is required at least for some set of > devices (e.g. thunderbolt), what is a good way to solve the original > problem that was being addressed by the patch being reverted i.e. > stale events resulting in spurious wakes on wakeup GPEs. One way I can > think of is clearing the status of GPEs when they are setup for > wake(acpi_setup_gpe_for_wake). What do you think? Sounds good to me.