linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Luca Ceresoli <luca@lucaceresoli.net>,
	linux-pci@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH v2] PCI: dra7xx: Fix reset behaviour
Date: Mon, 31 May 2021 18:22:42 +0200	[thread overview]
Message-ID: <20210531162242.jm73yzntzmilsvbg@pali> (raw)
In-Reply-To: <9fdbada4-4902-cec1-f283-0d12e1d4ac64@ti.com>

Hello Kishon!

On Monday 31 May 2021 21:30:30 Kishon Vijay Abraham I wrote:
> I had given the timing mentioned in the specification here
> https://lore.kernel.org/r/023c9b59-70bb-ed8d-a4c0-76eae726b574@ti.com
> 
> The PCI EXPRESS CARD ELECTROMECHANICAL SPECIFICATION defines the Power
> Sequencing and Reset Signal Timings in Table 2-4. Please also refer Figure
> 2-10: Power Up of the CEM.
> 
> ╔═════════════╤══════════════════════════════════════╤═════╤═════╤═══════╗
> ║ Symbol      │ Parameter                            │ Min │ Max │ Units ║
> ╠═════════════╪══════════════════════════════════════╪═════╪═════╪═══════╣
> ║ T PVPERL    │ Power stable to PERST# inactive      │ 100 │     │ ms    ║
> ╟─────────────┼──────────────────────────────────────┼─────┼─────┼───────╢
> ║ T PERST-CLK │ REFCLK stable before PERST# inactive │ 100 │     │ μs    ║
> ╟─────────────┼──────────────────────────────────────┼─────┼─────┼───────╢
> ║ T PERST     │ PERST# active time                   │ 100 │     │ μs    ║
> ╟─────────────┼──────────────────────────────────────┼─────┼─────┼───────╢
> ║ T FAIL      │ Power level invalid to PERST# active │     │ 500 │ ns    ║
> ╟─────────────┼──────────────────────────────────────┼─────┼─────┼───────╢
> ║ T WKRF      │ WAKE# rise – fall time               │     │ 100 │ ns    ║
> ╚═════════════╧══════════════════════════════════════╧═════╧═════╧═══════╝
> 
> The de-assertion of #PERST is w.r.t both power stable and refclk stable.

I think this does not fully answer this problematic question. One thing
is initial power on and second thing is warm reset (when both power and
clock is stable).

On more ARM boards, power is not SW controllable and is automatically
enabled when powering board on. So Tₚᵥₚₑᵣₗ is calculated since
bootloader and therefore not needed to take into account in kernel.

Tₚₑᵣₛₜ₋cₗₖ is only 100 µs and experiments proved that 100 µs not enough
for toggling PERST# GPIO. At least one 1 ms is needed and for some cards
at least 10 ms. Otherwise cards are not detected.

So when you have both power and clock stable and you want to reset card
via PERST# signal, above table does not say how long it is needed to
have PERST# in reset state.

> I'm yet to validate this patch, but IIRC devm_gpiod_get_optional(dev,
> NULL, GPIOD_OUT_HIGH) will already de-assert the PERST line. Please note
> the board here can have various combinations of NOT gate before the gpio
> line is actually connected to the connector.
> 
> Thanks
> Kishon

  reply	other threads:[~2021-05-31 17:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31  9:05 [PATCH v2] PCI: dra7xx: Fix reset behaviour Luca Ceresoli
2021-05-31 13:32 ` Pali Rohár
2021-05-31 13:54   ` Luca Ceresoli
2021-05-31 16:00     ` Kishon Vijay Abraham I
2021-05-31 16:22       ` Pali Rohár [this message]
2021-06-22 10:57         ` Luca Ceresoli
2021-06-22 11:06           ` Pali Rohár
2021-06-22 11:56             ` Lorenzo Pieralisi
2021-06-22 12:16               ` Pali Rohár
2021-06-22 13:31                 ` Luca Ceresoli
2021-06-22 13:57                   ` Kishon Vijay Abraham I
2021-06-22 20:52                     ` Pali Rohár
2021-06-22 21:08                       ` Luca Ceresoli
2021-06-22 21:19                         ` Pali Rohár
2021-06-22 21:36                           ` Luca Ceresoli
2021-06-22 22:23                             ` Pali Rohár
2021-06-24 21:31                               ` Luca Ceresoli
2021-06-24 21:42                                 ` Pali Rohár
2021-06-24 23:18                               ` Linus Walleij
2021-06-24 23:34                                 ` Pali Rohár
2021-06-25  0:09                                   ` Linus Walleij
2021-06-25  8:05                                     ` Luca Ceresoli
2021-06-22 21:04                     ` Luca Ceresoli
2021-06-24 23:11                     ` Linus Walleij
2021-06-25  8:10                       ` Luca Ceresoli
2021-06-22 14:23                 ` Lorenzo Pieralisi
2021-06-22 20:48                   ` Pali Rohár
2021-06-22 20:55                     ` Pali Rohár
2021-06-22 21:13             ` Luca Ceresoli
2021-06-01  9:03       ` Luca Ceresoli

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=20210531162242.jm73yzntzmilsvbg@pali \
    --to=pali@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=luca@lucaceresoli.net \
    --cc=robh@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).