From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6262C4320A for ; Sat, 14 Aug 2021 06:51:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA41D6103A for ; Sat, 14 Aug 2021 06:51:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236139AbhHNGvz (ORCPT ); Sat, 14 Aug 2021 02:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232021AbhHNGvz (ORCPT ); Sat, 14 Aug 2021 02:51:55 -0400 X-Greylist: delayed 583 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 13 Aug 2021 23:51:27 PDT Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30DD4C06175F; Fri, 13 Aug 2021 23:51:26 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 38F883000E426; Sat, 14 Aug 2021 08:41:42 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 2CDBE4F16; Sat, 14 Aug 2021 08:41:42 +0200 (CEST) Date: Sat, 14 Aug 2021 08:41:42 +0200 From: Lukas Wunner To: Rajat Jain Cc: linux-pci , Linux PM , linux-usb@vger.kernel.org, Bjorn Helgaas , Mika Westerberg , "Rafael J. Wysocki" , Alex Levin , Madhusudanarao Amara , Prashant Malani , "abhijeet.rao@intel.com" Subject: Re: PCIe device (thunderbolt tunneled) runtime suspended while driver wants to attach. Message-ID: <20210814064142.GB25723@wunner.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Fri, Aug 13, 2021 at 10:26:06PM -0700, Rajat Jain wrote: > 2) Is my understanding correct that any device should NOT be runtime > suspended while a driver is trying to attach to the device? Where is > this ensured (for e.g. for NVMEs)? Is this ensured by the driver core, > or a device driver that is trying to probe a PCI device needs to > ensure this? For some reason the driver core only runtime resumes a device on unbind (in __device_release_driver()), but not on bind (in driver_probe_device()). However, the PCI core makes up for that by runtime resuming the device in local_pci_probe(). > 3) So all downstream devices of a PCI bridge need to be suspended > before it can be suspended (and vice versa for resume)? In other > words, is ita bug if I notice that a PCI bridge is runtime suspended > while any of its downstream devices are not? Yes to both questions. > 4) Any suggestions for me to try? Could you try to bisect the issue? Thanks, Lukas