linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@kernel.org>
To: Felipe Balbi <felipe.balbi@linux.intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [RFC] PCI: add support for Immediate Readiness
Date: Fri, 3 Aug 2018 13:25:58 -0400	[thread overview]
Message-ID: <407fa9ef-dcbe-e803-f72e-cbea468592bf@kernel.org> (raw)
In-Reply-To: <874lgcufsu.fsf@linux.intel.com>

On 8/3/2018 2:26 AM, Felipe Balbi wrote:
> Sinan Kaya <okaya@kernel.org> writes:
> 
>> On 8/2/2018 7:36 AM, Felipe Balbi wrote:
>>> PCIe GEN4 defines a new bit on Status Register which tells us that, if
>>> Set, a function is immediately ready after a Reset. This means that
>>> all delays after a Conventional or Function Reset can be skipped.
>>
>> Can you give a reference to the section of the specification? or
>> a pointer to the ECN?
> 
> Section 7.5.1.1.4 of PCIe GEN4 spec. Table 7-4:
> 
> Immediate Readiness – This optional bit, when Set, indicates the
> Function is guaranteed to be ready to successfully complete valid
> configuration accesses at any time following any reset that the host is
> capable of issuing Configuration Requests to this Function.
> 
> When this bit is Set, for accesses to this Function, software is exempt
> from all requirements to delay configuration accesses following any type
> of reset, including but not limited to the timing requirements defined
> in Section 6.6.  How this guarantee is established is beyond the scope
> of this document.
> 
> It is permitted that system software/firmware provide mechanisms that
> supersede the indication provided by this bit, however such
> software/firmware mechanisms are outside the scope of this
> specification.
> 

Thanks for the spec reference.

I think the patch is touching the wrong places. pci_dev_wait() is there
to wait for CRS response to finish following reset.

Typical sequences are:
1. Do some kind of reset in another routine
2. Wait reset specific wait time (1sec for secondary bus reset as an
example and 100ms for d3-d0 transition)
3. call pci_dev_wait() after reset to see if device can accept config
transactions.

Since this applies to all resets, I think you also need to get rid of
waits following different reset types in step #2 and return immediately.
I suggest you review callers of pci_dev_wait() and tap in there.

Another thing is that this is a common functionality. Initializing
the flag in pm_init() would not be the best place.

  reply	other threads:[~2018-08-03 19:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02 11:36 [RFC] PCI: add support for Immediate Readiness Felipe Balbi
2018-08-02 11:56 ` Christoph Hellwig
2018-08-02 12:11   ` Felipe Balbi
2018-08-03  6:14 ` Sinan Kaya
2018-08-03  6:26   ` Felipe Balbi
2018-08-03 17:25     ` Sinan Kaya [this message]
2018-09-04 18:11       ` Bjorn Helgaas
2018-09-05  5:18         ` Felipe Balbi
2018-09-05  5:23           ` Felipe Balbi
2018-09-05  5:29             ` Felipe Balbi
2018-09-05 16:49           ` Bjorn Helgaas
2018-09-05 16:54             ` Sinan Kaya
2018-09-06  6:02             ` Felipe Balbi
2018-09-06 14:13               ` Bjorn Helgaas
2018-09-07  6:16                 ` [PATCH v2] " Felipe Balbi
2018-09-20  6:12                   ` Felipe Balbi
2018-09-28 17:57                   ` Bjorn Helgaas
2018-10-01  5:42                     ` Felipe Balbi

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=407fa9ef-dcbe-e803-f72e-cbea468592bf@kernel.org \
    --to=okaya@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=linux-pci@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).