Received: by 10.192.165.156 with SMTP id m28csp2230028imm; Thu, 12 Apr 2018 10:42:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+UHj6SAzOcFisSYm3c2XgisGcyM/pYPOMztc0x+oh8G66GY3MNePTd+GVhvUm/O0byoxw2 X-Received: by 2002:a17:902:8606:: with SMTP id f6-v6mr2061979plo.258.1523554974611; Thu, 12 Apr 2018 10:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523554974; cv=none; d=google.com; s=arc-20160816; b=cIa79VFAEZcjQyJNX6b5WJk1/3bmHqHMpYaG8G1ZgiIKvs06w/BGXWznd29eBpun0p 1p8B0rxzIB/wp9k2Tlao+yzGj1OH+C3gvAsTXhxHHLVNBnMRnf2kzzV3XvGY22Vhomjr E6XQsu1BnPxRRB6hQN31GsFOzChvDbpfqqj95yiZ1HauQozPFL1gR/5liQYnHOov0ZiM Zg428staov1CdTgq82kcdp9RdNTdugKHDQ95fzmwZh4NTAdwtHJZHu5Q4/8LSTLLyu0K sfNlp867Gmhtb6jkuJVB840SZBob0NktkA/GDjSal4+I/+ytvTcYfbz/LORTP7srerY5 x4zA== 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=62S4LFGYEyOcjtH2EQulj5W9h9IhEU5Sv8aUTsNxqYI=; b=Smkza2AXEJAR1kKzmw7VCIKbW5sECK9Q+xAvK72zstWklROXF98/a0cJA9IDZTKBzX XEOXhDI9YwOAW0+wN9eXJKKuo/YGln/BzaWvsv3PFBinASWklC+PeGfoEKgDWmpNujgb D1mLjPFrQoAprexmhfc7rZlNeNaxC5TLTOmFgmUGxEKHocLEXuTycIbmbUF4e91LFKDr NsxDEAe9djmfUlh8+mQDeZmrcqLdCyz6SO7VS/RrgNjEYt70YgUEhZmoYCzk5jLfa5Ix XQmQe4XyaEJgPpkYG6sOFe0jmqOGGC9D7TkwjlSxsXp52nfglTv/qqA/LTIIXOIUdH/6 f/Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VfcfzAOM; dkim=pass header.i=@codeaurora.org header.s=default header.b=aMY74+In; 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 i133si2506287pgc.299.2018.04.12.10.42.39; Thu, 12 Apr 2018 10:42:54 -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=VfcfzAOM; dkim=pass header.i=@codeaurora.org header.s=default header.b=aMY74+In; 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 S1752794AbeDLRla (ORCPT + 99 others); Thu, 12 Apr 2018 13:41:30 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34420 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437AbeDLRl3 (ORCPT ); Thu, 12 Apr 2018 13:41:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D6C866081C; Thu, 12 Apr 2018 17:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523554888; bh=b8h7GWSHRfIGJr4QYxcBlUmXk+k4T6LuGM5Rlpk4fz4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=VfcfzAOML5bi9yYAAshnolSCzo9GtGTnzE9I61IVyro+Q7ejHw3ourjYf2pfFT+hl LAFgoTcZihT4RIEaonn0W7lrwkC61YWROKo1ZI8eIQOkRUDiClMXkownd+RPi/YzlQ d46jhV41uw4rdXjgmXrMK8tJv7ZzNmJxrNqZiRdw= 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 [10.235.228.150] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (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 34E5C607EF; Thu, 12 Apr 2018 17:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523554887; bh=b8h7GWSHRfIGJr4QYxcBlUmXk+k4T6LuGM5Rlpk4fz4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=aMY74+In2Wmanbmf/IG36jRtwoCAREdJlPMhc5DKG/nnkirdZLBnjwbjco9Cb3WzF pZEuU+smC5pCjJVK85yozNx+3tl4rbMYhcWzpOaGtmYBIuvDLl9GY4Cy8rq4HqIMfJ LVkDS28ZdHc8Ei/CM47cmI+j1Y8c3HSG9zdccMWo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 34E5C607EF 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 Cc: Bjorn Helgaas , 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: Thu, 12 Apr 2018 13:41:25 -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: <20180412170911.GA6424@localhost.localdomain> 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 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. -- 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.