From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Message-ID: Subject: Re: [PATCH 1/1] PCI/AER: prevent pcie_do_fatal_recovery from using device after it is removed From: Benjamin Herrenschmidt To: Keith Busch Cc: Sinan Kaya , poza@codeaurora.org, Bjorn Helgaas , Thomas Tai , bhelgaas@google.com, linux-pci@vger.kernel.org, linux-pci-owner@vger.kernel.org, Sam Bobroff Date: Tue, 21 Aug 2018 08:19:52 +1000 In-Reply-To: <20180820221351.GA16932@localhost.localdomain> References: <5027d857bb59edfd33442003aa618ece1bc9cd52.camel@kernel.crashing.org> <2ecd1fd6d763810d45697f846fa876b58a193b1b.camel@kernel.crashing.org> <20180820155325.GA16148@localhost.localdomain> <6aa71d74-e4dc-c627-1496-981278388bce@kernel.org> <20180820213544.GA16805@localhost.localdomain> <0193e0c5a52d8f2e93958f0683f3acc81cef2bc9.camel@kernel.crashing.org> <44195c0d7159ce4cd01b660002b2f5af5d53678b.camel@kernel.crashing.org> <20180820221351.GA16932@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 List-ID: On Mon, 2018-08-20 at 16:13 -0600, Keith Busch wrote: > > There might be some potential here. > > There actualy is a Slot Status Presence Detect State (PDS), but it isn't > latched. The link and presence change (PDC) are latched. > > A potential problem may be a PDC event handling observes PDS set to the > last known state if the remove + add happens fast enough, and then no > action is taken in the current implementation. > > The DPC capability learned from such issues, and they will latch the > status until acknowledged so those sorts of races are not possible. > > But anyway, maybe we can change pciehp to ignore PDS and always > re-enumerate when PDC is observed, and that may very well simplify a lot > of this. That sounds reasonable to me. Cheers, Ben.