Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp216711pxu; Wed, 7 Oct 2020 00:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDXzUSOUp3ZtKUdHPzRjbqCFwaKpYKwJzZNMhdowxSSR5wZ/ITF4AKbw7MTCUbZpaeod10 X-Received: by 2002:a05:6402:699:: with SMTP id f25mr2172690edy.372.1602057033538; Wed, 07 Oct 2020 00:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602057033; cv=none; d=google.com; s=arc-20160816; b=e1HzKzw/kcwNEqNwvG3cDg2i9BTeHDRlZNuc95001oiu2lKa9bmbOM2UnPjtEfRtjO rNFnmUQZjH0gGsqL/3tnbMTMuw/+RxUnLoRJz1zatrr1ZL6nr+yAfPPWM98aVHJpCPvt VxxLZe3Gs9G4ihRiZ/LTTrW7fck8aFmYZ+LUk4svT3LpCN37BZ2We7bdQy1+wgqnCBsf A+zQe8kesh5mKFmQ/vUB8PTxiEg7/XZK9p7kQALPEChi3Op8Sb5HNfUOS5N37nf3Eccg cax7BpTsOGhriruthdqDAXJ5olwh6yQYJkreLIBVIpHJZMJPlQE1SbVzXgvsWYMHnV50 D3gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aIxS3a1/Usr8Ax4oAxdfAOqWyGV3Kir87fjE4KL3SWA=; b=snIZ/aAMlDrkxkfnjPZsgFrqDKYknMZe/+3BIMkvjGiFFfE3DPxiK9/CXFkO/fg66U jpcKfxrqyGlyu9LKW+PTw9bP4Q/CtmXtEhjiuh3bO7G2eWOM8olz1B28Y/+L3kRlXb1a r3kTFJWAbWHMANurIJ569+EjSN5DnL/2gWHFLllNcikillRwHVUstcFB4Gv4azJwk7Av FvEK7EUaWQg0l3xZ8266STu/YNSJLzSaODjjxIZ9LWzbJOM/OVpTkXPwSqrT6GzBKoG+ XW2i/z5VKg6E7Mc6f7fBzdQ72q4NdtwgmIWg/98Wc1wEk1szd5bL9pzGxxl9AtVIIDoE 4hoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zkp2OT1d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz13si1071262ejb.120.2020.10.07.00.50.10; Wed, 07 Oct 2020 00:50:33 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zkp2OT1d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727759AbgJGHsa (ORCPT + 99 others); Wed, 7 Oct 2020 03:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbgJGHsa (ORCPT ); Wed, 7 Oct 2020 03:48:30 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B1D4C061755; Wed, 7 Oct 2020 00:48:30 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id l17so1109349edq.12; Wed, 07 Oct 2020 00:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aIxS3a1/Usr8Ax4oAxdfAOqWyGV3Kir87fjE4KL3SWA=; b=Zkp2OT1dBxSRUm4UBunol1MkXZDcFD/RX1FhRudN2vPdQItuQfLLBD3IMuvchLOMGo 2l3/52w502E1A9Vumv8M3LN2i/KKNZKr9OFE/7GUmTIW3iU7/MCyGd2/1x9X/BhT4QqT bhkaqv5wjJIYoxKxZt1b9KCCcbf+Q0s0hIlWSClE3lzP2+pDq15tkVXZv4agKtxnA2b+ F4q6R2X7yWm+3XPDnoKFp1lMjcoOwdYbLiFvkFzrga9MwWiOjjcRTCd8+nYbDLu1IGia yIPZbwRBcdrcONxBt9ekMT0Q7X3NJnFTCo77i8W6IQ/Bg9l/85Di3yFpNJZbmrT8XGCn sgZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aIxS3a1/Usr8Ax4oAxdfAOqWyGV3Kir87fjE4KL3SWA=; b=Ljo3/a/+jyhGOok6Lj6PRkctxPCJUVR97Gl84H1SZDOywveAPFhAgRJtmF1ExX3MLR AAPS4IqwfkcSyWqYkmJteNmZethl1VBI2T0CVx1XOIeOu6zHZSJCfAywIX3wP31XMQE7 9m+/y77QFp8lnAGOEKrv+9XAxO2XBkFzNfpkoYpr3U3x6Qni0Mvo3wwyO4D51YJxN3Pe vYIgqBFg4YYRv22xsa6oRtDVWahmmGKuYh0sh58fZmods5WWsnzMo03j7/T/ILgx89sA Axwr42mwXD9TBS5VVlc1WQ6KTrmQ/6Iop6cvZGuiaWw7KVok2ZUwmSNGH7a5kGxF4scz 91kg== X-Gm-Message-State: AOAM531YZ58Rws49P2aCNOtr78O/Fz7T5FBLMlBEtaehJxWLILgJj+D6 j9MeU/wSMv3DV7AaeK/iD3wOqEWBZxn6Iu7FQmA= X-Received: by 2002:a50:b063:: with SMTP id i90mr2229989edd.187.1602056909027; Wed, 07 Oct 2020 00:48:29 -0700 (PDT) MIME-Version: 1.0 References: <20201003075514.32935-1-haifeng.zhao@intel.com> <20201003075514.32935-4-haifeng.zhao@intel.com> <20201004191329.GA27962@wunner.de> In-Reply-To: <20201004191329.GA27962@wunner.de> From: Ethan Zhao Date: Wed, 7 Oct 2020 15:48:17 +0800 Message-ID: Subject: Re: [PATCH v7 3/5] PCI: pciehp: check and wait port status out of DPC before handling DLLSC and PDC To: Lukas Wunner Cc: Ethan Zhao , Bjorn Helgaas , Oliver , ruscur@russell.cc, Andy Shevchenko , Stuart Hayes , Alexandru Gagniuc , Mika Westerberg , linux-pci , Linux Kernel Mailing List , "Raj, Ashok" , Sathyanarayanan Kuppuswamy Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lukas, On Mon, Oct 5, 2020 at 3:13 AM Lukas Wunner wrote: > > On Sat, Oct 03, 2020 at 03:55:12AM -0400, Ethan Zhao wrote: > > When root port has DPC capability and it is enabled, then triggered by > > errors, DPC DLLSC and PDC etc interrupts will be sent to DPC driver, pciehp > > drivers almost at the same time. > > Do the DLLSC and PDC events occur as a result of handling the error > or do they occur independently? They could happen independently if links were recovered then the card was removed. They could happen as a result of handling the errors the same time. So don't assume DLLSC and PDC all occur at the same time. > > If the latter, I don't see how we can tell whether the card in the > slot is still the same. If PDC happens, the card in the slot might not be the same. so hot-removal /hot -plugin handling follows the PDC event. > > If the former, holding the hotplug slot's reset_lock and doing something > along the lines of pciehp_reset_slot() (or calling it directly) might > solve the race. DPC reset is done by hardware, only AER calls pciehp_reset_slot() as recovery handling initiated by software. Thanks, Ethan > > Thanks, > > Lukas