[From nobody Thu Jun 25 05:54:41 2020
Received: from mail-ot0-x244.google.com ([2607:f8b0:4003:c0f::244])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1fRhGO-0002uu-CH
 for openwrt-devel@lists.openwrt.org; Sat, 09 Jun 2018 17:02:54 +0000
Received: by mail-ot0-x244.google.com with SMTP id i19-v6so19257158otk.10
 for &lt;openwrt-devel@lists.openwrt.org&gt;; Sat, 09 Jun 2018 10:02:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=googlemail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=rLmDfGCn2ruUhR7hr3WHKBZp5JJ/lBnFOGQf9uMvu0c=;
 b=OPIxEIekZFKChKoSVdO0YOYaET0giGMU6hiWab3nDYk2Kl4KArwSqod1Ohsxfwl6DY
 1BwLEjHbpzMJMJr2ejSF2ahN69eVsFZiNrELZzHJ15C4ScDG2RDBh53dnyQrFDhJ1dFV
 YT/kiFKpaf05P2QXKszTQK3gw8JxjxitH2flQPiOby9Chr2mtHTBRZQCfECzrjUjL5K8
 SHbX6gwq8h6PnLpymH5jLB+i104j0lqu3ZcToXhNOcE7wXqQhDqDOpaWWxMyyQQEOfc6
 NdpWiIvSEBL6i9llfa5XhL+G1Szd5cSHf19Emw2J/KiEMfoypJzaKoqlSF2YT54je+Qe
 TYmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=rLmDfGCn2ruUhR7hr3WHKBZp5JJ/lBnFOGQf9uMvu0c=;
 b=LuTj5E927isDVgcMLu0lvXiEkyEhXAW0kI47YNw576nFqz/pZHk/0UYnrZy3uKmfOI
 l1QxUHC+Bmj9LIZqsUVAD/3uizfR4hy30W9CjnnUW3KADHjgqZnZIfte+FRgpzkjbShA
 wmgj8syDvrDii+rvYqWZto6ASRHlyMdhVvgX6waI6wgVJwqXyuaBnvID2vHAB91j8uwF
 BXRxbAsB5rJ9pvhDDdVYe+zl1OLEmy+33D0Az90UtBoIHr4GijvmEwDeMLB/L/3SsBxG
 plWWWT1ZPe28vd/hq6tKxBI01xeVgdMLQ+3UZ0rQG5nfgzaD6zQ/sKBlNTylhJGPBrWi
 WH+A==
X-Gm-Message-State: APt69E2rT7gjxcXa5ncnv4hQH6bzJ2Ds5+4OCfhtnlITlOAHW0kSjeDE
 r2X9Kz8RpjEbFHPgqJ0Or11jHvmbL7pZ/R5uou0=
X-Google-Smtp-Source: ADUXVKJtrToL101rQr8xvxmJeMIR9NjZmfSex1hOG1RTZwPA8x1dw4BzP7cKS04ydW+zJt2EJVh5Gb58l26lVKKkEX0=
X-Received: by 2002:a9d:ef7:: with SMTP id
 110-v6mr5755285otj.323.1528563760667; 
 Sat, 09 Jun 2018 10:02:40 -0700 (PDT)
MIME-Version: 1.0
References: &lt;20180609141342.23948-1-tomek_n@o2.pl&gt;
 &lt;20180609141342.23948-2-tomek_n@o2.pl&gt;
In-Reply-To: &lt;20180609141342.23948-2-tomek_n@o2.pl&gt;
From: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Date: Sat, 9 Jun 2018 19:02:29 +0200
Message-ID: &lt;CAFBinCBJteD_FtmFVdM9bBweB3i39jPu--0LhxxY+xxW6J=LBQ@mail.gmail.com&gt;
Subject: Re: [OpenWrt-Devel] [PATCH 2/3] mvebu: reduce speed to gen1 for
 armada 37xx devices pcie
To: tomek_n@o2.pl
Cc: openwrt-devel@lists.openwrt.org
Content-Type: text/plain; charset=&quot;UTF-8&quot;
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20180609_100252_461514_AF23908E 
X-CRM114-Status: GOOD (  10.20  )
X-Spam-Score: -0.1 (/)
X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary:
 Content analysis details:   (-0.1 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [2607:f8b0:4003:c0f:0:0:0:244 listed in] [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (martin.blumenstingl[at]googlemail.com)
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid

On Sat, Jun 9, 2018 at 4:15 PM Tomasz Maciej Nowak &lt;tomek_n@o2.pl&gt; wrote:
&gt;
&gt; Since the beginning there's been an issue with initializing the Atheros
&gt; based MiniPCIe wlan cards. Here's an example of kerenel log:
&gt;
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0x3c
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0x44
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0x4
&gt; ath9k 0000:00:00.0: enabling device (0000 -&gt; 0002)
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0x3c
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0xc
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0x4
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0x40
&gt; ath9k 0000:00:00.0: request_irq failed
&gt; advk-pcie d0070000.pcie: Posted PIO Response Status: CA,0xe00 @ 0x4
&gt; ath9k: probe of 0000:00:00.0 failed with error -22
&gt;
&gt; The same happens for ath5k cards, while ath10k card didn't appear at
&gt; all (not detected). Following the issue on esppressobin.net forum [1]
&gt; the workaround seems to be limiting the speed of PCIe bridge to 1st
&gt; generation. This fixed the initialization of ath5k, ath9k and ath10k
&gt; cards. The change shouldn't affect the performance for wireless cards,
&gt; it could reduce the performance of storage controller cards but since
&gt; OpenWrt focuses on wireless connectivity, fixing compatibility with
&gt; wireless cards should be a priority.
&gt; For the record, the iwlwifi and mt76 cards were not affected by this
&gt; issue.
does this meant that the PCIe link speed depends on the board?

the PCI dt-bindings already specify a &quot;max-link-speed&quot; property, see [0]
there's even a helper function to parse that property: of_pci_get_max_link_speed

this would give you control over the PCIe link speed per board (I am
assuming that the mvebu target uses devicetree).
additionally this would allow you to send the patch upstream so
OpenWrt doesn't have to carry custom patches around forever

what do you think?


Regards
Martin


[0] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/pci/pci.txt

]