All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Pali Rohár" <pali@kernel.org>
Cc: "Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Andrew Murray" <amurray@thegoodpenguin.co.uk>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Remi Pommarel" <repk@triplefau.lt>,
	"Tomasz Maciej Nowak" <tmn505@gmail.com>,
	Xogium <contact@xogium.me>,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] PCI: aardvark: Don't touch PCIe registers if no card connected
Date: Fri, 10 Jul 2020 15:08:03 -0500	[thread overview]
Message-ID: <20200710200803.GA75998@bjorn-Precision-5520> (raw)
In-Reply-To: <20200710193003.2lt3i5ocy5kk3b3p@pali>

On Fri, Jul 10, 2020 at 09:30:03PM +0200, Pali Rohár wrote:
> On Friday 10 July 2020 11:08:28 Bjorn Helgaas wrote:
> > 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.
> 
> I think this is not ASPM related as card simply disappear just after
> flipping PCI_EXP_LNKCTL_RL bit second time without changing ASPM bits.

Right.  The retrain code in aspm.c doesn't really have anything in
particular to do with ASPM and it should probably be moved elsewhere.
So I think the problem may be related to retrain and the delays after
it in general, not to ASPM.

> There is absolutely nothing regarding to timings in documentation which
> I saw. In documentation are just instructions/steps how to init PCI
> subsystem and it is basically advk_pcie_setup_hw() function.
> 
> > > 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.
> 
> Hm... I cannot find right now pointer to bugzilla, but I have pointer to
> ath9k-devel mailing list with that incorrect device id:
> 
> https://www.mail-archive.com/ath9k-devel@lists.ath9k.org/msg07529.html
> 
> > Is the incorrect device ID 0xffff?
> 
> No, incorrect device ID in that case is 0xabcd and vendor ID is correct
> (Qualcomm).

From a quick look at that thread, it sounds like the device isn't
quite ready yet.  In that case, it's supposed to respond with Config
Request Retry Status, and Linux is supposed to wait longer and retry.
But I don't think Linux does that quite correctly, so it could be
either a hardware problem or Linux being broken.  But I guess that's
not the current problem so I don't want to go down that rathole right
now.

WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Pali Rohár" <pali@kernel.org>
Cc: "Tomasz Maciej Nowak" <tmn505@gmail.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	linux-pci@vger.kernel.org, Xogium <contact@xogium.me>,
	linux-kernel@vger.kernel.org, "Marek Behún" <marek.behun@nic.cz>,
	"Remi Pommarel" <repk@triplefau.lt>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-arm-kernel@lists.infradead.org,
	"Andrew Murray" <amurray@thegoodpenguin.co.uk>
Subject: Re: [PATCH v3] PCI: aardvark: Don't touch PCIe registers if no card connected
Date: Fri, 10 Jul 2020 15:08:03 -0500	[thread overview]
Message-ID: <20200710200803.GA75998@bjorn-Precision-5520> (raw)
In-Reply-To: <20200710193003.2lt3i5ocy5kk3b3p@pali>

On Fri, Jul 10, 2020 at 09:30:03PM +0200, Pali Rohár wrote:
> On Friday 10 July 2020 11:08:28 Bjorn Helgaas wrote:
> > 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.
> 
> I think this is not ASPM related as card simply disappear just after
> flipping PCI_EXP_LNKCTL_RL bit second time without changing ASPM bits.

Right.  The retrain code in aspm.c doesn't really have anything in
particular to do with ASPM and it should probably be moved elsewhere.
So I think the problem may be related to retrain and the delays after
it in general, not to ASPM.

> There is absolutely nothing regarding to timings in documentation which
> I saw. In documentation are just instructions/steps how to init PCI
> subsystem and it is basically advk_pcie_setup_hw() function.
> 
> > > 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.
> 
> Hm... I cannot find right now pointer to bugzilla, but I have pointer to
> ath9k-devel mailing list with that incorrect device id:
> 
> https://www.mail-archive.com/ath9k-devel@lists.ath9k.org/msg07529.html
> 
> > Is the incorrect device ID 0xffff?
> 
> No, incorrect device ID in that case is 0xabcd and vendor ID is correct
> (Qualcomm).

From a quick look at that thread, it sounds like the device isn't
quite ready yet.  In that case, it's supposed to respond with Config
Request Retry Status, and Linux is supposed to wait longer and retry.
But I don't think Linux does that quite correctly, so it could be
either a hardware problem or Linux being broken.  But I guess that's
not the current problem so I don't want to go down that rathole right
now.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-10 20:08 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 14:31 [PATCH] PCI: aardvark: Don't touch PCIe registers if no card connected Pali Rohár
2020-05-28 14:31 ` Pali Rohár
2020-05-28 16:26 ` Bjorn Helgaas
2020-05-28 16:26   ` Bjorn Helgaas
2020-05-28 16:38   ` Pali Rohár
2020-05-28 16:38     ` Pali Rohár
2020-05-28 16:49     ` Bjorn Helgaas
2020-05-28 16:49       ` Bjorn Helgaas
2020-05-29  8:30       ` Pali Rohár
2020-05-29  8:30         ` Pali Rohár
2020-06-30 12:31         ` Pali Rohár
2020-06-30 12:31           ` Pali Rohár
2020-06-30 13:51     ` Bjorn Helgaas
2020-06-30 13:51       ` Bjorn Helgaas
2020-06-30 14:04       ` Pali Rohár
2020-06-30 14:04         ` Pali Rohár
2020-06-30 14:58         ` Bjorn Helgaas
2020-06-30 14:58           ` Bjorn Helgaas
2020-07-01  8:08           ` Pali Rohár
2020-07-01  8:08             ` Pali Rohár
2020-07-01  8:20 ` [PATCH v2] " Pali Rohár
2020-07-01  8:20   ` Pali Rohár
2020-07-01 21:34   ` Bjorn Helgaas
2020-07-01 21:34     ` Bjorn Helgaas
2020-07-02  8:23     ` Pali Rohár
2020-07-02  8:23       ` Pali Rohár
2020-07-02  8:30 ` [PATCH v3] " Pali Rohár
2020-07-02  8:30   ` Pali Rohár
2020-07-09 11:35   ` Lorenzo Pieralisi
2020-07-09 11:35     ` Lorenzo Pieralisi
2020-07-09 12:22     ` Pali Rohár
2020-07-09 12:22       ` Pali Rohár
2020-07-09 14:47       ` Lorenzo Pieralisi
2020-07-09 14:47         ` Lorenzo Pieralisi
2020-07-09 15:09         ` Pali Rohár
2020-07-09 15:09           ` Pali Rohár
2020-07-10  9:18           ` Lorenzo Pieralisi
2020-07-10  9:18             ` Lorenzo Pieralisi
2020-07-10 15:44             ` Pali Rohár
2020-07-10 15:44               ` Pali Rohár
2020-07-10 16:08               ` Bjorn Helgaas
2020-07-10 16:08                 ` Bjorn Helgaas
2020-07-10 19:30                 ` Pali Rohár
2020-07-10 19:30                   ` Pali Rohár
2020-07-10 20:08                   ` Bjorn Helgaas [this message]
2020-07-10 20:08                     ` Bjorn Helgaas
2020-07-13  8:27             ` Pali Rohár
2020-07-13  8:27               ` Pali Rohár
2020-07-13 11:23               ` Lorenzo Pieralisi
2020-07-13 11:23                 ` Lorenzo Pieralisi
2020-07-13 14:50                 ` Pali Rohár
2020-07-13 14:50                   ` Pali Rohár
2020-07-13 16:41                   ` Lorenzo Pieralisi
2020-07-13 16:41                     ` Lorenzo Pieralisi
2020-07-14  7:38                     ` Pali Rohár
2020-07-14  7:38                       ` Pali Rohár
2020-07-15 12:17                 ` Pali Rohár
2020-07-15 12:17                   ` Pali Rohár
2020-07-15 16:21                   ` Lorenzo Pieralisi
2020-07-15 16:21                     ` Lorenzo Pieralisi
2020-07-21  8:57                     ` Pali Rohár
2020-07-21  8:57                       ` Pali Rohár
2020-07-21 10:48                       ` Lorenzo Pieralisi
2020-07-21 10:48                         ` Lorenzo Pieralisi

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=20200710200803.GA75998@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=bhelgaas@google.com \
    --cc=contact@xogium.me \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=repk@triplefau.lt \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tmn505@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.