lkml.org 
[lkml]   [2020]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v3] PCI: aardvark: Don't touch PCIe registers if no card connected
    On Fri, Jul 10, 2020 at 05:44:58PM +0200, Pali Rohár wrote:
    > I can reproduce following issue: Connect Compex WLE900VX card, configure
    > aardvark to gen2 mode. And then card is detected only after the first
    > link training. If kernel tries to retrain link again (e.g. via ASPM
    > code) then card is not detected anymore.

    Somebody should go over the ASPM retrain link code and the PCIe spec
    with a fine-toothed comb. Maybe we're doing something wrong there.
    Or maybe aardvark has some hardware issue and we need some sort of
    quirk to work around it.

    > Another issue which happens for WLE900VX, WLE600VX and WLE1216VS-20 (but
    > not for WLE200VX): Linux kernel can detect these cards only if it issues
    > card reset via PERST# signal and start link training (via standard pcie
    > endpoint register PCI_EXP_LNKCTL/PCI_EXP_LNKCTL_RL)

    I think you mean "downstream port" (not "endpoint") register?
    PCI_EXP_LNKCTL_RL is only applicable to *downstream ports* (root ports
    or switch downstream ports) and is reserved for endpoints.

    > immediately after
    > enable link training in aardvark (via aardvark specific LINK_TRAINING_EN
    > bit). If there is e.g. 100ms delay between enabling link training and
    > setting PCI_EXP_LNKCTL_RL bit then these cards are not detected.

    This sounds problematic. Hardware should not be dependent on the
    software being "fast enough". In general we should be able to insert
    arbitrary delays at any point without breaking anything.

    But I have the impression that aardvark requires more software
    hand-holding that most hardware does. If it imposes timing
    requirements on the software, that *should* be documented in the
    aardvark spec.

    > I read in kernel bugzilla that WLE600VX and WLE900VX cards are buggy and
    > more people have problems with them. But issues described in kernel
    > bugzilla (like card is reporting incorrect PCI device id) I'm not
    > observing.

    Pointer? Is the incorrect device ID 0xffff? That could be a symptom
    of a PCIe error. If we read a device ID that's something other than
    0, 0xffff, or the correct ID, that would be really weird. Even 0
    would be really strange.

    I suspect these wifi cards are a little special because they probably
    play unusual games with power for airplane mode and the like.

    Bjorn

    \
     
     \ /
      Last update: 2020-07-10 18:09    [W:4.058 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site