All of lore.kernel.org
 help / color / mirror / Atom feed
From: poza@codeaurora.org
To: Lukas Wunner <lukas@wunner.de>
Cc: Sinan Kaya <okaya@kernel.org>,
	linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Keith Busch <keith.busch@intel.com>,
	linux-pci-owner@vger.kernel.org
Subject: Re: [PATCH v7 1/1] PCI: pciehp: Ignore link events when there is a fatal error pending
Date: Mon, 06 Aug 2018 20:25:48 +0530	[thread overview]
Message-ID: <2b4c23a2e97f61a124c95c49d604a853@codeaurora.org> (raw)
In-Reply-To: <20180806092614.GA28462@wunner.de>

On 2018-08-06 14:56, Lukas Wunner wrote:
> On Mon, Aug 06, 2018 at 01:21:03PM +0530, poza@codeaurora.org wrote:
>> On 2018-08-06 04:21, Sinan Kaya wrote:
>> >+bool pcie_wait_fatal_error_clear(struct pci_dev *pdev, u32 usrmask)
>> >+{
>> >+	int timeout = 1000;
>> >+	bool ret;
>> >+
>> >+	for (;;) {
>> >+		ret = pcie_fatal_error_pending(pdev, usrmask);
>> >+		if (ret == false)
>> >+			return true;
>> >+		if (timeout <= 0)
>> >+			break;
>> >+		msleep(20);
>> >+		timeout -= 20;
>> I assume that this timeout will come into effect if
>> 1) AER/DPC takes longer time than 1 sec for recovery.
>> 2) Lets us say both AER and DPC are disabled....are we going to wait 
>> for
>> this timeout before HP can take over ?
> 
> If CONFIG_PCIEAER is disabled, pdev->aer_cap will not be set because
> it is populated in pci_aer_init().
> 
> pcie_fatal_error_pending(), as introduced by this patch, returns false
> if pdev->aer_cap is not set.  So pciehp will fall back to a cold reset
> if CONFIG_PCIEAER is disabled.
> 
> I'm not seeing a similar check for CONFIG_PCIE_DPC=n in this patch,
> but I'm not familiar enough with PCIe error recovery to know if such
> a check is at all needed.
> 

Either AER or DPC would get triggered, not both.
in that case, if AER is disabled, then this code will return false 
thinking HP needs to handle it.
but it might be that DPC would be triggering as well.
but I dont see DPC check anywhere, rather we are relying on 
PCI_EXP_DEVSTA
and following condition:
if (!pdev->aer_cap)
       return false;
so here we dont check anything with respect to DPC capability (although 
there is no such thing as dpc_cap)
(except If I missed something)

> Thanks,
> 
> Lukas

  reply	other threads:[~2018-08-06 17:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-05 22:51 [PATCH v7 0/1] PCI: Handle conflict between hotplug and error handling Sinan Kaya
2018-08-05 22:51 ` [PATCH v7 1/1] PCI: pciehp: Ignore link events when there is a fatal error pending Sinan Kaya
2018-08-06  7:51   ` poza
2018-08-06  9:26     ` Lukas Wunner
2018-08-06 14:55       ` poza [this message]
2018-08-06 15:04         ` Sinan Kaya
2018-08-06 15:06           ` Sinan Kaya
2018-08-06 15:12             ` poza
2018-08-06 16:34               ` Sinan Kaya
2018-08-06 16:44             ` Lukas Wunner
2018-08-06 16:49               ` Sinan Kaya
2018-08-06 17:03                 ` Sinan Kaya
2018-08-06 17:05                 ` Lukas Wunner
2018-08-06 17:09                   ` Sinan Kaya
2018-08-06  9:30   ` Lukas Wunner
2018-09-04 18:18 ` [PATCH v7 0/1] PCI: Handle conflict between hotplug and error handling Bjorn Helgaas
2018-09-04 18:28   ` Sinan Kaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b4c23a2e97f61a124c95c49d604a853@codeaurora.org \
    --to=poza@codeaurora.org \
    --cc=bhelgaas@google.com \
    --cc=keith.busch@intel.com \
    --cc=linux-pci-owner@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mika.westerberg@linux.intel.com \
    --cc=okaya@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.