Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3653969imm; Mon, 20 Aug 2018 02:24:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPytuvM5e9GqvVahhcPBJFcy5uGVGhPJFnyGjySq4NG1f9rV0jLXXN3BurkmEhIGF80iwY7w X-Received: by 2002:a63:f54c:: with SMTP id e12-v6mr42052691pgk.286.1534757041798; Mon, 20 Aug 2018 02:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534757041; cv=none; d=google.com; s=arc-20160816; b=cn9K7YJaWF1jj3FXMYX/48rlOScP6Tt42SYTDRYoESbHoCm6B9PKMxIsg8fWCs3YhF fNdm2nqUDL3y7ueZmdzmpwKA/8dFZWHsN5iqkv1ImjiY0ftUuWSxzC+PPI4tfp/CpXjB 34tHrq441Z4TPYrdtCZJb5YmMNXN1rq+J5/IEWMcKhmkKkyottnfRM0D+qHk0wnechuP WICGLLl+zYg6Mwg6H+YfkBNsX6LXhGKu7iM9R7BdQT5Kow9eQw1gOTHfHrvZoWglpTIi wTMRUqgQ1soeBSCSvMW5jD00cofTNf801FA4+eam6oU144TxwyhKVdIE4afCsSKnVUxG FpLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=JVS0HHieH2rSi70VaZvINHrGXq76kq2MHhEPi3RM7aE=; b=G8t6kuymWRhnyYAvhaa+eBt+DVYE+F7zg0//Cfih3R4J9HkDq9zEAwUIjSHjgYn9hg qd0KtK6/Q+m23TAo52BbkxG6gE9gyGOTkg+wDvfZXUnjlLle8TxCIQFqxLXFpZgFdAzb VfoOAxl1viaPowJZRU0tx72K1NNaaDMaVahjXdtJNLE6Y8elSHrqEs9bxW42iAiIgzmW uP3oUiaHxn89cp4U768WqVNvqdveXmTw/fEAxpqJ2eg8DAs1HFXs/DVt5r6Opn9xXOSc NPDlv5bHhg2iSqcofprm4Yn2pfcWLreTYbhgAAvKNc4C8eGYFy7/qbQZg6Te2j6P89x3 QTdA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay4-v6si9127854plb.201.2018.08.20.02.23.46; Mon, 20 Aug 2018 02:24:01 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726589AbeHTMhb (ORCPT + 99 others); Mon, 20 Aug 2018 08:37:31 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:48923 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbeHTMhb (ORCPT ); Mon, 20 Aug 2018 08:37:31 -0400 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 "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id E633E300168AA; Mon, 20 Aug 2018 11:22:38 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id C05B3240BB0; Mon, 20 Aug 2018 11:22:38 +0200 (CEST) Date: Mon, 20 Aug 2018 11:22:38 +0200 From: Lukas Wunner To: Sinan Kaya Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Mika Westerberg , Oza Pawandeep , Keith Busch , open list Subject: Re: [PATCH v8 1/2] PCI: pciehp: Ignore link events when there is a fatal error pending Message-ID: <20180820092238.kvktwlovc64oa66e@wunner.de> References: <20180818065126.77912-1-okaya@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180818065126.77912-1-okaya@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 17, 2018 at 11:51:09PM -0700, Sinan Kaya wrote: > --- a/drivers/pci/hotplug/pciehp_ctrl.c > +++ b/drivers/pci/hotplug/pciehp_ctrl.c > @@ -222,9 +222,27 @@ void pciehp_handle_disable_request(struct slot *slot) > void pciehp_handle_presence_or_link_change(struct slot *slot, u32 events) > { > struct controller *ctrl = slot->ctrl; > + struct pci_dev *pdev = ctrl->pcie->port; > bool link_active; > u8 present; > > + /* If a fatal error is pending, wait for AER or DPC to handle it. */ > + if (pcie_fatal_error_pending(pdev)) { > + bool recovered; > + > + recovered = pcie_wait_fatal_error_clear(pdev); > + > + /* If the fatal error is gone and the link is up, return */ > + if (recovered && pcie_wait_for_link(pdev, true)) { > + ctrl_info(ctrl, "Slot(%s): Ignoring Link event due to successful fatal error recovery\n", > + slot_name(slot)); > + return; > + } > + > + ctrl_info(ctrl, "Slot(%s): Fatal error recovery failed for Link event, trying hotplug reset\n", > + slot_name(slot)); > + } > + This differs from v7 of the patch in that *any* fatal error, not just a Surprise Link Down, results in pciehp waiting for the error to clear. I'm wondering if that's safe: Theoretically, the user might quickly swap the card in the slot during, say, a Completion Timeout Error, and with this patch pciehp would carry on as if nothing happened. Thanks, Lukas