linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: linux-pci@vger.kernel.org, "Bjorn Helgaas" <bhelgaas@google.com>,
	"Mahesh J Salgaonkar" <mahesh@linux.ibm.com>,
	"Oliver O'Halloran" <oohall@gmail.com>,
	"Lukas Wunner" <lukas@wunner.de>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v6 6/8] PCI: Add TLP Prefix reading into pcie_read_tlp_log()
Date: Thu, 12 Dec 2024 18:12:18 +0200 (EET)	[thread overview]
Message-ID: <e4f907ad-ab87-ac42-7428-93e16f070f74@linux.intel.com> (raw)
In-Reply-To: <20241211164904.00007a02@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 2667 bytes --]

On Wed, 11 Dec 2024, Jonathan Cameron wrote:

> On Fri, 13 Sep 2024 17:36:30 +0300
> Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> wrote:
> 
> > pcie_read_tlp_log() handles only 4 Header Log DWORDs but TLP Prefix Log
> > (PCIe r6.1 secs 7.8.4.12 & 7.9.14.13) may also be present.
> > 
> > Generalize pcie_read_tlp_log() and struct pcie_tlp_log to handle also
> > TLP Prefix Log. The relevant registers are formatted identically in AER
> > and DPC Capability, but has these variations:
> > 
> > a) The offsets of TLP Prefix Log registers vary.
> > b) DPC RP PIO TLP Prefix Log register can be < 4 DWORDs.
> > 
> > Therefore callers must pass the offset of the TLP Prefix Log register
> > and the entire length to pcie_read_tlp_log() to be able to read the
> > correct number of TLP Prefix DWORDs from the correct offset.
> > 
> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> 
> Trivial comments below
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Would have been nice if they'd just made the formats have the
> same sized holes etc!

That's not even the worst problem.

They managed to copy-paste most of the stuff into DPC (copy-paste is 
really obvious because the text still refers to AER in a DPC section :-)) 
but forgot to add a few capability fields into the DPC capability, most 
importantly, the bit that indicates whether TLP was logged in Flit mode
or not And now we get to keep the pieces how to interpret the Log 
Registers (relates to the follow up series). :-(

> > diff --git a/drivers/pci/pcie/tlp.c b/drivers/pci/pcie/tlp.c
> > index 65ac7b5d8a87..def9dd7b73e8 100644
> > --- a/drivers/pci/pcie/tlp.c
> > +++ b/drivers/pci/pcie/tlp.c
> > @@ -11,26 +11,65 @@
> 
> >  /**
> >   * pcie_read_tlp_log - read TLP Header Log
> Maybe update this to read TLP Header and Prefix Logs
> >   * @dev: PCIe device
> >   * @where: PCI Config offset of TLP Header Log
> > + * @where2: PCI Config offset of TLP Prefix Log
> 
> Is it worth giving it a more specific name than where2?
> Possibly renaming where as well!

Sure, why not.

-- 
 i.

> > + * @tlp_len: TLP Log length (Header Log + TLP Prefix Log in DWORDs)
> >   * @log: TLP Log structure to fill
> >   *
> >   * Fill @log from TLP Header Log registers, e.g., AER or DPC.
> >   *
> >   * Return: 0 on success and filled TLP Log structure, <0 on error.
> >   */
> > -int pcie_read_tlp_log(struct pci_dev *dev, int where,
> > -		      struct pcie_tlp_log *log)
> > +int pcie_read_tlp_log(struct pci_dev *dev, int where, int where2,
> > +		      unsigned int tlp_len, struct pcie_tlp_log *log)
> >  {


  reply	other threads:[~2024-12-12 16:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 14:36 [PATCH v6 0/8] PCI: Consolidate TLP Log reading and printing Ilpo Järvinen
2024-09-13 14:36 ` [PATCH v6 1/8] PCI: Don't expose pcie_read_tlp_log() outside of PCI subsystem Ilpo Järvinen
2024-12-11 16:22   ` Jonathan Cameron
2024-09-13 14:36 ` [PATCH v6 2/8] PCI: Move TLP Log handling to own file Ilpo Järvinen
2024-12-11 16:25   ` Jonathan Cameron
2024-09-13 14:36 ` [PATCH v6 3/8] PCI: Make pcie_read_tlp_log() signature same Ilpo Järvinen
2024-12-11 16:26   ` Jonathan Cameron
2024-09-13 14:36 ` [PATCH v6 4/8] PCI: Use unsigned int i in pcie_read_tlp_log() Ilpo Järvinen
2024-12-11 16:58   ` Jonathan Cameron
2024-09-13 14:36 ` [PATCH v6 5/8] PCI: Store # of supported End-End TLP Prefixes Ilpo Järvinen
2024-12-11 16:36   ` Jonathan Cameron
2024-12-12 18:03     ` Ilpo Järvinen
2024-09-13 14:36 ` [PATCH v6 6/8] PCI: Add TLP Prefix reading into pcie_read_tlp_log() Ilpo Järvinen
2024-12-11 16:49   ` Jonathan Cameron
2024-12-12 16:12     ` Ilpo Järvinen [this message]
2024-12-12 18:48       ` Ilpo Järvinen
2024-12-13 15:54         ` Jonathan Cameron
2024-09-13 14:36 ` [PATCH v6 7/8] PCI: Create helper to print TLP Header and Prefix Log Ilpo Järvinen
2024-12-11 16:56   ` Jonathan Cameron
2024-09-13 14:36 ` [PATCH v6 8/8] PCI/AER: Add prefixes to printouts Ilpo Järvinen
2024-12-11 16:58   ` Jonathan Cameron
2024-10-23  8:27 ` [PATCH v6 0/8] PCI: Consolidate TLP Log reading and printing Ilpo Järvinen
2024-12-10 18:19   ` Ilpo Järvinen

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=e4f907ad-ab87-ac42-7428-93e16f070f74@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lukas@wunner.de \
    --cc=mahesh@linux.ibm.com \
    --cc=oohall@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 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).