Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp699147imm; Mon, 9 Jul 2018 09:03:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSmwUyEs8ptJoGKh66t8h/QvNeYkI3B3N5D0OaswQD51yQ8oeRUoi2/k7mTfp+x/9CtP0A X-Received: by 2002:a17:902:b494:: with SMTP id y20-v6mr20764674plr.136.1531152189883; Mon, 09 Jul 2018 09:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531152189; cv=none; d=google.com; s=arc-20160816; b=UJKYuABJBhH2NfGBL1q9aJJ04lDjCbB0PbxUQNOhS8OnbU7oEuJ12ThKKOVDEivXim Wb0lGWX1MYZn9aP9B3U85xgpZTQPFzsDa3glGjnmDEY53yAJbBInUDdv+duxef2PUUPe 7eW9tiWb5TKrXn6ayYFO6iBo6fs/q3ZtAXrcw9k9xWOEVg7bSw6mWU2TTKQZrcyy5hfO 7B9xu4yZJERaf+ynlS3ICCsqqUl+/7j8PpHvN7Lrt8L5JlutrPqHmlvZYNRIEHG5kLLX 5mytCXjkzo5R7Trpt3Qo2QsxZ5rjHqxt79tv7+xQko/64inGOgpCDzG+bSSLYn0P3O7A TM9Q== 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=Y/GBGKKik14HZXYRNfLLoJsJDT7+w/hP1BKL+XHHoCY=; b=FTNv7XauLOQGP7KQBz72Km5csxTLgPxFJjEaWssWk4wvrSTdFxmIj5PqcdROCGITPs otoDdd5pYQa89Dc0HsgC+eblLXCxH8QjcN4MJbEF76fet16EARwp3kTpX7XmI8rXxGXM 8r3K/YRKNlgpXN8OnXYxLSLRFQt+0Sj5QamvF4vg7Gcrq8dXpriWaJB0Nq6sDmmpc3Hq 5sdnnCD6BhxmgYH7i55UdAUi2fxyjteNxyF1lGhMaZd1trOIOP59HBynGEUnzkgtI+af Oz/PbU5PMrAnshPZZUkQ7uS8j2FqrX09flzlFjc2DVLBupd0awY5+GO8npakkr2MxJKF lZwA== 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 z18-v6si14155055pgg.332.2018.07.09.09.02.55; Mon, 09 Jul 2018 09:03:09 -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 S933676AbeGIQAO (ORCPT + 99 others); Mon, 9 Jul 2018 12:00:14 -0400 Received: from bmailout2.hostsharing.net ([83.223.90.240]:48293 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932902AbeGIQAK (ORCPT ); Mon, 9 Jul 2018 12:00:10 -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 bmailout2.hostsharing.net (Postfix) with ESMTPS id EFD7B2800BB98; Mon, 9 Jul 2018 18:00:08 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 955664A26; Mon, 9 Jul 2018 18:00:08 +0200 (CEST) Date: Mon, 9 Jul 2018 18:00:08 +0200 From: Lukas Wunner To: Sinan Kaya Cc: linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bjorn Helgaas , Oza Pawandeep , Keith Busch , open list Subject: Re: [PATCH V5 3/3] PCI: Mask and unmask hotplug interrupts during reset Message-ID: <20180709160008.GA1490@wunner.de> References: <12fc8de5-ff03-cb00-52cb-25a43c71d03a@codeaurora.org> <20180708171418.GA11476@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 08:48:44AM -0600, Sinan Kaya wrote: > On 7/8/18, Lukas Wunner wrote: > > On Tue, Jul 03, 2018 at 11:43:26AM -0400, Sinan Kaya wrote: > > > My solution doesn't help if link down interrupt is observed before the > > > AER > > > or DPC services. > > > > If pciehp gets an interrupt quicker than dpc/aer, it will (at least with > > my patches) remove all devices, check if the presence bit is set, > > and if so, try to bring the slot up again. > > Hotplug driver should only observe a link down interrupt. Link would > come up in response to a secondary bus reset initiated by the AER > driver. PCIe hotplug doesn't have separate Link Down and Link Up interrupts, there is only a Link State *Changed* event. > Can you point me to the code that would bring up the link in hp code? I was referring to the situation with my recently posted pciehp patches applied, in particular patch [21/32] ("PCI: pciehp: Become resilient to missed events"): https://patchwork.ozlabs.org/patch/930389/ When I get a presence or link changed event, I turn the slot off. That includes removing all devices in the slot. Because even if the slot is still occupied or link is up, there was definitely a change and the safe behavior is to assume that the card in the slot is now a different one than before. Afterwards, I check if the slot is occupied or link is up. If either of those conditions is true, I try to bring the slot up again. Thanks, Lukas