Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp635246pxf; Wed, 17 Mar 2021 12:05:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcRqs+Cq8iW1H1kozVX15cPVjExQuSg9XJj1ymwUKx1Z+q9Fa7e/+FbYInuJDCyA3GrwRP X-Received: by 2002:a17:906:314f:: with SMTP id e15mr36480982eje.30.1616007923953; Wed, 17 Mar 2021 12:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616007923; cv=none; d=google.com; s=arc-20160816; b=YHCXjtG4tFjJPfePhQvf5775Du1KN49rBv1TyYncTwqJBALNjXSEuCStTmFeTHIK+q SNsOoJbsQ+3ShSTTo62siiRA7FyICOoY6FO2F5qOxW7I/HmatDkVTfeShAVgRRICfM94 sScrehpPK/gV3T+w0+nBAbopK+NNMNAwKLPs2G5sRF1KMHDjGyZc128pMRdtvq150m1o UO9xgg4aIfaFycQlBLVBFHCOSjrAdzYImfF3dXBVmjtSCmvTrfle+Wx2hZbyAJTcUCsX xp5DG3lHpo/cuMUuAfKldR8Igo5FeAbbtFxB7rIaPTCN87r5Z9ZloVLQEuLVHjdBKwtA CZQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ESsVLxnf4TlPgLAADm0Wxwf59Q5GoVa9IQtXq57qDb4=; b=c7dGREZl1rpGAbk/nZrspgXrqjHW8s5ePn4zptIW60EjO3EE5vpyd0mb5ESLLxOiyY CbzuQMGAGFXXJX1tIPJ8cgsqc7+XUuGj9PWNePQhv3rYeOtvclCnPkHnyLlFXC7EFEA3 7ZDo52FkGyXBWPulJ+SaT+05P45xpEjxjDFXFHIwAfwVLiyA3Q4NgXi6gFTUmy8lsxMc ATJqOqZ16/ra8Uuyhf2Bsr3AT024HKLESchhOibPZxraC5OOrn5qtQwP07FURSymSapg Rhiv0On7yx16x/1jhKAnfwRjIOKMYgeP46S0aGvbs1tbw/ZdLSIMcGkn92v6hhd/C8yJ Hpfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i22si6472009edc.112.2021.03.17.12.04.59; Wed, 17 Mar 2021 12:05:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232207AbhCQTCB (ORCPT + 99 others); Wed, 17 Mar 2021 15:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232116AbhCQTBy (ORCPT ); Wed, 17 Mar 2021 15:01:54 -0400 Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [IPv6:2a01:37:3000::53df:4ef0:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09F9DC06174A for ; Wed, 17 Mar 2021 12:01:53 -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 bmailout2.hostsharing.net (Postfix) with ESMTPS id 7DAFC2800B3C3; Wed, 17 Mar 2021 20:01:51 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 6E2D02A294B; Wed, 17 Mar 2021 20:01:51 +0100 (CET) Date: Wed, 17 Mar 2021 20:01:51 +0100 From: Lukas Wunner To: Sathyanarayanan Kuppuswamy Natarajan Cc: Dan Williams , Kuppuswamy Sathyanarayanan , Bjorn Helgaas , Linux PCI , Linux Kernel Mailing List , "Raj, Ashok" , Keith Busch , knsathya@kernel.org, Sinan Kaya Subject: Re: [PATCH v2 1/1] PCI: pciehp: Skip DLLSC handling if DPC is triggered Message-ID: <20210317190151.GA27146@wunner.de> References: <59cb30f5e5ac6d65427ceaadf1012b2ba8dbf66c.1615606143.git.sathyanarayanan.kuppuswamy@linux.intel.com> <20210317041342.GA19198@wunner.de> <20210317053114.GA32370@wunner.de> 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-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 10:54:09AM -0700, Sathyanarayanan Kuppuswamy Natarajan wrote: > Flush of hotplug event after successful recovery, and a simulated > hotplug link down event after link recovery fails should solve the > problems raised by Lukas. I assume Lukas' proposal adds this support. > I will check his patch shortly. Thank you! I'd like to get a better understanding of the issues around hotplug/DPC, specifically I'm wondering: If DPC recovery was successful, what is the desired behavior by pciehp, should it ignore the Link Down/Up or bring the slot down and back up after DPC recovery? If the events are ignored, the driver of the device in the hotplug slot is not unbound and rebound. So the driver must be able to cope with loss of TLPs during DPC recovery and it must be able to cope with whatever state the endpoint device is in after DPC recovery. Is this really safe? How does the nvme driver deal with it? Also, if DPC is handled by firmware, your patch does not ignore the Link Down/Up events, so pciehp brings down the slot when DPC is triggered, then brings it up after succesful recovery. In a code comment, you write that this behavior is okay because there's "no race between hotplug and DPC recovery". However, Sinan wrote in 2018 that one of the issues with hotplug versus DPC is that pciehp may turn off slot power and thereby foil DPC recovery. (Power off = cold reset, whereas DPC recovery = warm reset.) This can occur as well if DPC is handled by firmware. So I guess pciehp should make an attempt to await DPC recovery even if it's handled by firmware? Or am I missing something? We may be able to achieve that by polling the DPC Trigger Status bit and DLLLA bit, but it won't work as perfectly as with native DPC support. Finally, you write in your commit message that there are "a lot of stability issues" if pciehp and DPC are allowed to recover freely without proper serialization. What are these issues exactly? (Beyond the slot power issue mentioned above, and that the endpoint device's driver should presumably not be unbound if DPC recovery was successful.) Thanks! Lukas