Received: by 10.192.165.156 with SMTP id m28csp1902049imm; Sat, 14 Apr 2018 08:57:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4//xv6fAjTLUuHcpImmUE5Xk1WsHJZoZitVSvTl3EKOljOiNc+YVn0hlh+bZld/aTxTn4Ph X-Received: by 10.99.107.8 with SMTP id g8mr7608191pgc.271.1523721442786; Sat, 14 Apr 2018 08:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523721442; cv=none; d=google.com; s=arc-20160816; b=wt1omfPYoleDmVwdJceeiaG7jfh87A3Iv9X8i5SDepPdsjCA0Vrn/Y1/BDWeKRBvoz i/apQQwHyUeofbvzHP4EC75F4lnAZXrpjeII2V0csgW5Xb/Jty7V7rPdFk5r8jrR8b7+ eFbibbcxMPIiDR8RBeuxNUDwquB38YxW6Rq3bG1+/5eRxfl2pe0/WB3hLi1x8UKUqKQu JNSLBc1jS3J+4/3MPlnoaDFxdU2xHFWHH9ih8KZYh9m48S0vAErtaoVt0Daq5iUpZ1G6 0bkU4yzHatmsnKZ1jpvv2rpdj176a5xaHQUp2/uCjGVHHFAz2pIUFykvPFtOsdSgKfpw KyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=fM8FYRHHhcV2DRQRoqqnCg8IdpYoWKxinBGKQzluerw=; b=zWWLSzJ4l6+e96AZfL00e8L+qKBUFvG3BSpZezFjcuIGSyhI9b6omY7vYu7Ym+3RL7 4GDzVRGFjacMS1jmsoGzMeKHKEp3UoEnYiNnPGFfCbS0LoZiR4cAuRbbW9dRqxrebZDX AKhoiYNmSRC/4RSf3Wq7uMfyiw7S5Ljnj+PRqtzpcuYcwxLdOhpzSMnA48qYARjqM2VO iPU6Cya07gk3vDrlqo8KHMjXWyNYhujKZ9x6NvmQVnHKmlFYIbGbPPwMkszSxMoav3cv fELtRldopx/FGlprk+uzLqdhf9s45SLtd4X+vBaWgLu9Ogu2VuxCs2tyBQ3hMncEghXb PvaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dOyD7AxR; dkim=pass header.i=@codeaurora.org header.s=default header.b=jEi2qjUO; 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 i72si3815394pgd.65.2018.04.14.08.56.37; Sat, 14 Apr 2018 08:57:22 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=dOyD7AxR; dkim=pass header.i=@codeaurora.org header.s=default header.b=jEi2qjUO; 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 S1751349AbeDNPxZ (ORCPT + 99 others); Sat, 14 Apr 2018 11:53:25 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57626 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbeDNPxX (ORCPT ); Sat, 14 Apr 2018 11:53:23 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D37E160F78; Sat, 14 Apr 2018 15:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523721202; bh=fS0xd3oVjHh9s/tJy/ihV+mfeW52/yd7H2o/PS40giQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dOyD7AxR61un2s4SxeQebC5wkleVLKv4no5oVOAK+XXoQWLfklg3ZkJo3oUWw9WJa r/ao/qra8IvF3MaKYbD93f/nJdWN2AV6jpxFsoUThyq3LfaD3+atSpPiYHQXj0Qxei a3yApPDJyYLtaVF8s3s071QI1gcLtfW9OmyOl63g= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.105] (cpe-174-109-247-98.nc.res.rr.com [174.109.247.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B0E1C600ED; Sat, 14 Apr 2018 15:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523721200; bh=fS0xd3oVjHh9s/tJy/ihV+mfeW52/yd7H2o/PS40giQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jEi2qjUOPKRD8vnjm/xOwRSQKui0gjiv50I4OE1O5c3y3kTNbgkY35tRyYRi3bIPb PegZZU8OXTK0R28ZesviZyxJEtOltaJ7FZRFqyNI60djSwdXwVo6ECxR4SwsulLI3k 9jIZgxTtq6hdMjPYIx0rRdt8sbKkBH1EGgOfiZ/0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B0E1C600ED Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH v13 6/6] PCI/DPC: Do not do recovery for hotplug enabled system To: Keith Busch , Bjorn Helgaas Cc: Oza Pawandeep , Bjorn Helgaas , Philippe Ombredanne , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Dongdong Liu , Wei Zhang , Timur Tabi , Alex Williamson References: <1523284914-2037-1-git-send-email-poza@codeaurora.org> <1523284914-2037-7-git-send-email-poza@codeaurora.org> <20180410210349.GG54986@bhelgaas-glaptop.roam.corp.google.com> <13efe2e8-74c8-acb4-ec58-f79b14a1f182@codeaurora.org> <20180412140648.GD145698@bhelgaas-glaptop.roam.corp.google.com> <20180412143954.GB4810@localhost.localdomain> <20180412150231.GD4810@localhost.localdomain> <20180412170911.GA6424@localhost.localdomain> From: Sinan Kaya Message-ID: Date: Sat, 14 Apr 2018 11:53:17 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Keith, Bjorn; On 4/12/2018 1:41 PM, Sinan Kaya wrote: > On 4/12/2018 1:09 PM, Keith Busch wrote: >> On Thu, Apr 12, 2018 at 12:27:20PM -0400, Sinan Kaya wrote: >>> On 4/12/2018 11:02 AM, Keith Busch wrote: >>>> >>>> Also, I thought the plan was to keep hotplug and non-hotplug the same, >>>> except for the very end: if not a hotplug bridge, initiate the rescan >>>> automatically after releasing from containment, otherwise let pciehp >>>> handle it when the link reactivates. >>>> >>> >>> Hmm... >>> >>> AER driver doesn't do stop and rescan approach for fatal errors. AER driver >>> makes an error callback followed by secondary bus reset and finally driver >>> the resume callback on the endpoint only if link recovery is successful. >>> Otherwise, AER driver bails out with recovery unsuccessful message. >> >> I'm not sure if that's necessarily true. People have reported AER >> handling triggers PCIe hotplug events, and creates some interesting race >> conditions: > > By reading the code, I don't see a stop and rescan in the AER error recovery > path. > > As both logs indicate, stop and rescan is initiated in response to link down > and link up interrupts triggered by the secondary bus reset. > The SW entity handling these is not AER driver. It is the hotplug driver > running asynchronous to the AER driver. > > AER driver should have tried a slot reset before attempting to do a secondary > bus reset. > > /** > * pci_reset_slot - reset a PCI slot > * @slot: PCI slot to reset > * > * A PCI bus may host multiple slots, each slot may support a reset mechanism > * independent of other slots. For instance, some slots may support slot power > * control. In the case of a 1:1 bus to slot architecture, this function may > * wrap the bus reset to avoid spurious slot related events such as hotplug. > * Generally a slot reset should be attempted before a bus reset. All of the > * function of the slot and any subordinate buses behind the slot are reset > * through this function. PCI config space of all devices in the slot and > * behind the slot is saved before and restored after reset. > * > * Return 0 on success, non-zero on error. > */ > int pci_reset_slot(struct pci_slot *slot) > > Slot reset is there to mask hotplug interrupts before the reset and unmask them > after reset. > >> >> https://marc.info/?l=linux-pci&m=152336615707640&w=2 >> >> https://www.spinics.net/lists/linux-pci/msg70614.html >> >>> Why do we need an additional rescan in the DPC driver if the link is up >>> and driver resumes operation? >> >> I thought the plan was to have DPC always go through the removal path >> to ensure all devices are properly configured when containment is >> released. In order to reconfigure those, you'll need to initiate the >> rescan from somewhere. >> > > This is where the contradiction is. > > Bjorn is asking for a unified error handling for both AER and DPC. > > Current AER error recovery framework is error callback + secondary > bus reset + resume callback. > > How does this stop + rescan model fit? > > Do we want to change the error recovery framework? I suppose this will > become a bigger conversation as there are more customers of this. > I also want to highlight that the PCI Error recovery sequence is well documented here. https://www.kernel.org/doc/Documentation/PCI/pci-error-recovery.txt We don't really have to guess what Linux does. IMO, the hotplug issues Keith is seeing are orthogonal and needs to be addressed independent of this series by following the pci slot reset procedure. Hotplug driver handles link up/down events due to insertion/removal. Hotplug driver is expected to do the re-enumeration. I don't understand why we need to do another re-enumeration if system observes a PCIe error handled by the AER/DPC driver. These two are independent events. PCIe error recovery framework does the reset callback + SBR + resume behavior today. Bjorn, You indicated that you want to unify the AER and DPC behavior. Let's settle on what we want to do one more time. We have been going forth and back on the direction. We are on V13. I hope we won't hit V20 :) Sinan -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.