From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Wunner Subject: Re: [PATCH V5 3/3] PCI: Mask and unmask hotplug interrupts during reset Date: Sun, 29 Jul 2018 14:32:51 +0200 Message-ID: <20180729123251.GB4364@wunner.de> References: <1530571967-19099-1-git-send-email-okaya@codeaurora.org> <1530571967-19099-4-git-send-email-okaya@codeaurora.org> <20180703083447.GA2689@wunner.de> <8b6ce0f415858463d1c0588c29e30415@codeaurora.org> <9e871cc3978fbdca12ccf8a91f34ad07@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <9e871cc3978fbdca12ccf8a91f34ad07@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org To: poza@codeaurora.org Cc: okaya@codeaurora.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bjorn Helgaas , Keith Busch , open list List-Id: linux-arm-msm@vger.kernel.org On Tue, Jul 03, 2018 at 06:41:33PM +0530, poza@codeaurora.org wrote: > pciehp_unconfigure_device doing little more than enumeration to quiescence > the bus. > > /* > * Ensure that no new Requests will be generated from > * the device. > */ > if (presence) { > pci_read_config_word(dev, PCI_COMMAND, &command); > command &= ~(PCI_COMMAND_MASTER | PCI_COMMAND_SERR); > command |= PCI_COMMAND_INTX_DISABLE; > pci_write_config_word(dev, PCI_COMMAND, command); > } That piece of code is supposed to be executed on safe removal via sysfs or an Attention Button press: The card remains in the slot, even though the slot is brought down. So the card is quiesced. However IIUC, on fatal error the link goes down and for pciehp, that's essentially a surprise removal. In that case, the above code is not intended to be executed, rather the devices below the hotplug bridge are marked disconnected. See this patch I posted yesterday: https://www.spinics.net/lists/linux-pci/msg74763.html Thanks, Lukas