Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19219156rwd; Wed, 28 Jun 2023 06:41:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+NvY9NCxvNu3tQunrke4kXTb7HmwebcOIdLTkSnbBouOd8Z0HuEnbKsjtGT3TyxfzO9jB X-Received: by 2002:a05:6a20:3ca8:b0:12c:6a4a:7b4d with SMTP id b40-20020a056a203ca800b0012c6a4a7b4dmr926535pzj.51.1687959661520; Wed, 28 Jun 2023 06:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687959661; cv=none; d=google.com; s=arc-20160816; b=yDIJmOigC/LLHwMLX1oxsO0ScBvWIqXVuDslPd1MgIpLKpysdneiC5jL1PKrh6/8Wx TTNRC7ja6isWA/1LCTnI2YNPR02a0rK+ysETnACdhnRZG+QkPAc9yKnDwGxZ98+CGi9Y lSZjw93GTmvLYq3a0E1YtG4ojr6Y8+yZETx6Hno8TtA20KiQRi8jZmeR/2VMaUWN4czu Wndl9AAy9nmHzUQQPLjoc7xRJ1uyA0gQFHlNgAcnYH4ryKtGEzRdvkG0zMkxAs9FVY5W U22Sjz6xULpzfbw3gbcUrraURfW/zZVdX9tvKSNWmTxfBQEHpgfPAuv7yNruTAvUyjb8 d2IA== 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=aqU+2b8Tm5IsWvKJ+2qKpClfeU04p27GmaPebB0FKic=; fh=jHWxj9HPRdoV69PSef0I8J/QyDeKR1F76Epa9lnycN4=; b=Pr4nKUkb83B49tvHkajgpg/n8HrOE2/0pkVd2o6yN+H/EW4yvv4B7KQAJlSd5jyqFp rtF5IvWoasUN9/gUUH94tZTnvRpJZxHQ6N+GVMV41Qby74eK+8wdhrNvEp5YzUy5UZYw lOMfskyKnuA3EU/KhmgT9aUxScsGELuHI9jE8175F0qhHjXxuS6pQuE8k5IM9G2hj8oA pE/A4l23uq6I6BckTvxqgpEPMsr3e0fJ9XrC0rsxeVAzlKArkHAnKZ0sq66MYxvWd/YT uibg03GDLb+Yyqvkts7o/1uIJGEa61DNhJz2Y7nojX7FKwjzq1IOfhCoghMqvNIzxZdY sCLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a056a0014ca00b00666ad95e625si9435949pfu.337.2023.06.28.06.40.48; Wed, 28 Jun 2023 06:41:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232484AbjF1Nak (ORCPT + 99 others); Wed, 28 Jun 2023 09:30:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232182AbjF1N3r (ORCPT ); Wed, 28 Jun 2023 09:29:47 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D47CC129; Wed, 28 Jun 2023 06:29:46 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 040DE30004510; Wed, 28 Jun 2023 15:29:45 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id EBCC743C12D; Wed, 28 Jun 2023 15:29:44 +0200 (CEST) Date: Wed, 28 Jun 2023 15:29:44 +0200 From: Lukas Wunner To: Smita Koralahalli Cc: Sathyanarayanan Kuppuswamy , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , oohall@gmail.com, Mahesh J Salgaonkar , Yazen Ghannam , Fontenot Nathan Subject: Re: [PATCH v3 1/2] PCI: pciehp: Add support for async hotplug with native AER and DPC/EDR Message-ID: <20230628132944.GB14276@wunner.de> References: <20230621185152.105320-1-Smita.KoralahalliChannabasappa@amd.com> <20230621185152.105320-2-Smita.KoralahalliChannabasappa@amd.com> 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) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 27, 2023 at 10:48:37AM -0700, Smita Koralahalli wrote: > On 6/22/2023 4:22 PM, Sathyanarayanan Kuppuswamy wrote: > > On 6/21/23 11:51 AM, Smita Koralahalli wrote: > > > +static void dpc_handle_surprise_removal(struct pci_dev *pdev) > > > +{ > > > + if (pdev->dpc_rp_extensions && dpc_wait_rp_inactive(pdev)) { > > > + pci_err(pdev, "failed to retrieve DPC root port on async remove\n"); > > > + goto out; > > > + } > > > + > > > + pci_aer_raw_clear_status(pdev); > > > + pci_clear_surpdn_errors(pdev); > > > + > > > + pci_write_config_word(pdev, pdev->dpc_cap + PCI_EXP_DPC_STATUS, > > > + PCI_EXP_DPC_STATUS_TRIGGER); > > > > Don't you need to wait for the link to go down? > > Yes will include, pcie_wait_for_link().. > > Should this check be here or at the beginning of the function before we > check pdev->dpc_rp_extensions? I'd just use the same order as dpc_reset_link(), i.e. checking for !pcie_wait_for_link() happens before the check for pdev->dpc_rp_extensions. Thanks, Lukas