Re: [PATCH v4 3/5] PCI: brcmstb: Set PCIe transaction completion timeout

From: Jim Quinlan
Date: Wed May 03 2023 - 10:07:15 EST


On Mon, May 1, 2023 at 4:55 PM Lukas Wunner <lukas@xxxxxxxxx> wrote:
>
> On Sun, Apr 30, 2023 at 05:24:26PM -0400, Jim Quinlan wrote:
> > I've been maintaining this driver for over eight years or so and we've
> > done fine with the HW default completion timeout value.
> > Only recently has a major customer requested that this timeout value
> > be changed, and their reason was so they could
> > avoid a CPU abort when using L1SS.
> >
> > Now we could set this value to a big number for all cases and not
> > require "brcm,completion-timeout-us". I cannot see any
> > downsides, other than another customer coming along asking us to
> > double the default or lessen it.
>
> The Completion Timeout is configurable in the Device Control 2 Register
> (PCIe r2.1 sec 7.8.16). Your controller does expose that register:
>
> DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR+ OBFF Disabled, ARIFwd-
> AtomicOpsCtl: ReqEn- EgressBlck-
>
> Why does your controller allow configuration of the timeout in a
> proprietary register in addition to DevCtl2?
>
> If you make the Completion Timeout configurable, please do so in
> a spec-compliant way, i.e. via DevCtl2, so that it works for
> other products as well.
>
> If the proprietary register has advantages over DevCtl2 (e.g.
> finer granularity), perhaps you can divert accesses to the
> Completion Timeout Value in DevCtl2 to your proprietary register.

Hello Lukas & Bjorn,

Yes, you are right. I was under the (mis)understanding that writing
this register is (a) necessary for long L1SS periods and (b) overrides
or updates the value in the CFG register you mentioned. It turns out
that only (a) is true.

After communicating with the HW engineer, it appears this register is
for an internal bus timeout. Further, this bus timeout can occur when
there is no PCIe access involved. However, the error appears as a
completion timeout, which I also am investigating.

At any rate, I am dropping the "brcm,completion-timeout-usec" property
completely and V5 will just set this internal timeout to a higher
default if the "brcm,enable-l1ss" is present.

Thanks & regards,
Jim




>
> Thanks,
>
> Lukas

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature