Received: by 10.213.65.68 with SMTP id h4csp121208imn; Mon, 12 Mar 2018 08:35:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELswhQK9lNHqhCJEmVM+8Krsw1QIITpB3flm0F0ehtImKo3hxS/zTXKCGjVSODTEXButFlDw X-Received: by 2002:a17:902:7e87:: with SMTP id c7-v6mr8445031plm.138.1520868958559; Mon, 12 Mar 2018 08:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520868958; cv=none; d=google.com; s=arc-20160816; b=x6wlpDejVxwcONH3vS5NsM4oHyOG7EPuhcQGNKdV+pA56pLPqfAB/22d4QxJFtmb9L ER9T9n5cYck1lidHChZY5hnl0EsDNUD2fm1aCMAYcVgYX1bEA4Y4EtSdlcRqOwYW5XI1 c4k75+FLtbOc6gsxhQV4pV42ub79p7xbWYteJreMIBiKJ/ARDltLupn+dzyNCVLLjOeO Zd3j5HplDJF4Aqmao8w5JgC6Qbb4dX69oYNJNq1/oJzj9j7XL7pLeO6NPbOgovq0tE+U Za+A24S2y0Y5Pbp4N07Vumtc+1SSByi5QWP7dLPOgqzTOOahBf8c1JOsNI9vFfJ42ZQF S6rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=VECrUoFAS86F7iqhgbMuGa3Ga7zFy2uj22cT92w7wWk=; b=Bo/fYmZDaP4JCGr/Pk/a7ONqWorNRM5O0wVBhvXcFPWpD+XOsuA3zuNSwD4JpvCxfe ge8xNXYwzmMiGyrxuN7pIJjszOra7WkQpFah+mcsssX5bJZ0NX6++wxT9Ck3qq0xQ/X2 MetrIMYJ5HVmQ120VVdBpFkGI7faNJvq5l/6Ck4ultUTNp08Xfqj4HvrFS6tPewwwCUD myJny96k5I2axi5o3MpfmyNVxLqQErkS/SMbW3Y0ejK1kSamDTWG8+EhuPvrJim1bD9W DNF9ofOJg0ZTtde79b1XvMeBW3FTKYei5P/EWTycd0/4nWHsbJAnyHQcdZWnEHeOF0P9 EmEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=gMHnD2eG; dkim=pass header.i=@codeaurora.org header.s=default header.b=BnzC/yWL; 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 h1-v6si6123108pln.216.2018.03.12.08.35.43; Mon, 12 Mar 2018 08:35:58 -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=gMHnD2eG; dkim=pass header.i=@codeaurora.org header.s=default header.b=BnzC/yWL; 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 S932266AbeCLPeu (ORCPT + 99 others); Mon, 12 Mar 2018 11:34:50 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57494 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751255AbeCLPes (ORCPT ); Mon, 12 Mar 2018 11:34:48 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3450460848; Mon, 12 Mar 2018 15:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520868888; bh=BqCknt+e2pay3H+eazyqGMtq0X6hcV0pTdVrlQOAqtE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gMHnD2eG/L2XoZcBuLR376+yV1Z3WTgbJ+hcnZvt3tWu/hYE0Ubeq1xPCyw4MLgGD gDe0SZsQWFCA8GXRstFb3h/9OLWhLZ78jJ79TiVIYCcAUgCNmnc/rX9S9i/pK7HB7V MTYP2zX70OpaJh4clRe891p6MiLtgeD44RRhe0gA= 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 mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 14CE4601D2; Mon, 12 Mar 2018 15:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520868887; bh=BqCknt+e2pay3H+eazyqGMtq0X6hcV0pTdVrlQOAqtE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BnzC/yWLoWaHD4FIdS1UJOhwu+NAuNlshANSDNHN7TO2WVfVI3VJMauXcjtBJ5UcM E6hptuRW56d5Sq7U5D1x7E1C9sRQ+luTSCVSKY5z3Lyrveqm9x84ACSgmhum4Jmdvz tRDRxznxeFQqwb6VTatp6VDS5PAGjD0rS5VCzj6M= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 12 Mar 2018 21:04:47 +0530 From: poza@codeaurora.org To: Keith Busch Cc: Sinan Kaya , Bjorn Helgaas , 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 , linux-pci-owner@vger.kernel.org Subject: Re: [PATCH v12 0/6] Address error and recovery for AER and DPC In-Reply-To: <20180312145823.GC18494@localhost.localdomain> References: <1519837457-3596-1-git-send-email-poza@codeaurora.org> <20180311220337.GA194000@bhelgaas-glaptop.roam.corp.google.com> <04ade52e-d1ea-fe67-bb26-246621d159e6@codeaurora.org> <20180312142551.GB18494@localhost.localdomain> <3e1a2036675de6b8456145a022640f3d@codeaurora.org> <20180312145823.GC18494@localhost.localdomain> Message-ID: X-Sender: poza@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-03-12 20:28, Keith Busch wrote: > On Mon, Mar 12, 2018 at 08:16:38PM +0530, poza@codeaurora.org wrote: >> On 2018-03-12 19:55, Keith Busch wrote: >> > On Sun, Mar 11, 2018 at 11:03:58PM -0400, Sinan Kaya wrote: >> > > On 3/11/2018 6:03 PM, Bjorn Helgaas wrote: >> > > > On Wed, Feb 28, 2018 at 10:34:11PM +0530, Oza Pawandeep wrote: >> > > >> > > > That difference has been there since the beginning of DPC, so it has >> > > > nothing to do with *this* series EXCEPT for the fact that it really >> > > > complicates the logic you're adding to reset_link() and >> > > > broadcast_error_message(). >> > > > >> > > > We ought to be able to simplify that somehow because the only real >> > > > difference between AER and DPC should be that DPC automatically >> > > > disables the link and AER does it in software. >> > > >> > > I agree this should be possible. Code execution path should be almost >> > > identical to fatal error case. >> > > >> > > Is there any reason why you went to stop driver path, Keith? >> > >> > The fact is the link is truly down during a DPC event. When the link >> > is enabled again, you don't know at that point if the device(s) on the >> > other side have changed. Calling a driver's error handler for the wrong >> > device in an unknown state may have undefined results. Enumerating the >> > slot from scratch should be safe, and will assign resources, tune bus >> > settings, and bind to the matching driver. >> > >> > Per spec, DPC is the recommended way for handling surprise removal >> > events and even recommends DPC capable slots *not* set 'Surprise' >> > in Slot Capabilities so that removals are always handled by DPC. This >> > service driver was developed with that use in mind. >> >> Now it begs the question, that >> >> after DPC trigger >> >> should we enumerate the devices, ? >> or >> error handling callbacks, followed by stop devices followed by >> enumeration ? >> or >> error handling callbacks, followed by enumeration ? (no stop devices) > > I'm not sure I understand. The link is disabled while DPC is triggered, > so if anything, you'd want to un-enumerate everything below the > contained > port (that's what it does today). > > After releasing a slot from DPC, the link is allowed to retrain. If > there > is a working device on the other side, a link up event occurs. That > event is handled by the pciehp driver, and that schedules enumeration > no matter what you do to the DPC driver. yes, that is what i current, but this patch-set makes DPC aware of error handling driver callbacks. besides, in absence of pciehp there is nobody to do enumeration. And, I was talking about pci_stop_and_remove_bus_device() in dpc. if DPC calls driver's error callbacks, is it required to stop the devices ?