From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: Shradha Todi <shradha.t@samsung.com>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, lpieralisi@kernel.org,
kw@linux.com, robh@kernel.org, bhelgaas@google.com,
jingoohan1@gmail.com, Jonathan.Cameron@huawei.com,
fan.ni@samsung.com, nifan.cxl@gmail.com,
a.manzanares@samsung.com, pankaj.dubey@samsung.com,
18255117159@163.com, xueshuai@linux.alibaba.com,
renyu.zj@linux.alibaba.com, will@kernel.org,
mark.rutland@arm.com
Subject: Re: [PATCH v7 0/5] Add support for debugfs based RAS DES feature in PCIe DW
Date: Tue, 25 Feb 2025 22:45:01 +0530 [thread overview]
Message-ID: <20250225171501.ahjmawunnpyc7wwa@thinkpad> (raw)
In-Reply-To: <Z73VLYudJVPkdbGN@ryzen>
On Tue, Feb 25, 2025 at 03:35:25PM +0100, Niklas Cassel wrote:
> On Tue, Feb 25, 2025 at 01:58:35PM +0530, Manivannan Sadhasivam wrote:
> > On Mon, Feb 24, 2025 at 06:08:26PM +0100, Niklas Cassel wrote:
> > > Hello Shradha,
> > >
> > > On Fri, Feb 21, 2025 at 06:45:43PM +0530, Shradha Todi wrote:
> > > > DesignWare controller provides a vendor specific extended capability
> > > > called RASDES as an IP feature. This extended capability provides
> > > > hardware information like:
> > > > - Debug registers to know the state of the link or controller.
> > > > - Error injection mechanisms to inject various PCIe errors including
> > > > sequence number, CRC
> > > > - Statistical counters to know how many times a particular event
> > > > occurred
> > > >
> > > > However, in Linux we do not have any generic or custom support to be
> > > > able to use this feature in an efficient manner. This is the reason we
> > > > are proposing this framework. Debug and bring up time of high-speed IPs
> > > > are highly dependent on costlier hardware analyzers and this solution
> > > > will in some ways help to reduce the HW analyzer usage.
> > > >
> > > > The debugfs entries can be used to get information about underlying
> > > > hardware and can be shared with user space. Separate debugfs entries has
> > > > been created to cater to all the DES hooks provided by the controller.
> > > > The debugfs entries interacts with the RASDES registers in the required
> > > > sequence and provides the meaningful data to the user. This eases the
> > > > effort to understand and use the register information for debugging.
> > > >
> > > > This series creates a generic debugfs framework for DesignWare PCIe
> > > > controllers where other debug features apart from RASDES can also be
> > > > added as and when required.
> > > >
> > > > v7:
> > > > - Moved the patches to make finding VSEC IDs common from Mani's patchset [1]
> > > > into this series to remove dependancy as discussed
> > > > - Addressed style related change requests from v6
> > >
> > > I tested this series, and one thing that I noticed:
> > >
> > > # for f in /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/*/counter_enable; do echo 1 > $f; done
> > >
> > > # grep "" /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/*/* | grep Disabled
> > > /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/ctl_skp_os_parity_err/counter_enable:Counter Disabled
> > > /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/deskew_uncompleted_err/counter_enable:Counter Disabled
> > > /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/framing_err_in_l0/counter_enable:Counter Disabled
> > > /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/margin_crc_parity_err/counter_enable:Counter Disabled
> > > /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/retimer_parity_err_1st/counter_enable:Counter Disabled
> > > /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/retimer_parity_err_2nd/counter_enable:Counter Disabled
> > >
> > > that there are some events that cannot be enabled when testing on my platform,
> > > rk3588, perhaps this is because my version of the DWC IP does not have these
> > > events.
> > >
> > > (Because all the other events can be enabled successfully:
> > > # grep "" /sys/kernel/debug/dwc_pcie_a40000000.pcie/rasdes_event_counter/*/* | grep Enabled | wc -l
> > > 29
> > > )
> > >
> > >
> > > So the question is, how do we want to handle that?
> > >
> >
> > This is a really good question.
> >
> > > E.g. counter_enable_write() could theoretically read back the
> > > dw_pcie_readl_dbi(pci, rinfo->ras_cap_offset + RAS_DES_EVENT_COUNTER_CTRL_REG);
> > > register after doing the
> > > ww_pcie_writel_dbi(pci, rinfo->ras_cap_offset + RAS_DES_EVENT_COUNTER_CTRL_REG, val);
> > >
> > > to actually check if it could enable the event.
> > >
> > > If counter_enable_write() could not enable the specific event, should it
> > > perhaps return a failure to user space?
> > >
> >
> > Yes, it would be appropriate to return -EOPNOTSUPP in that case. But I'd like to
> > merge this series asap. So this patch can come on top of this series.
>
> I agree that returning an error is probably the nicest thing.
>
> However, this series has been picked up already :)
>
> Is there anyone who volunteers on implementing the proposed feature?
>
I did and submitted the fix [1].
> If you have time, it would be interesting to see if you see the same behavior
> on QCOM SoCs. (Assuming that your DWC PCIe controller does not implement all
> events that Samsung DWC PCIe controller does.)
>
Yeah, I observed the same behavior on the Qcom platform, though only 2 counters
were not supported. But I also noticed a null ptr dereference due to refclk
dependency, so submitted a fix for that also.
- Mani
[1] https://lore.kernel.org/linux-pci/20250225171239.19574-1-manivannan.sadhasivam@linaro.org/
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2025-02-25 17:35 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250221132011epcas5p4dea1e9ae5c09afaabcd1822f3a7d15c5@epcas5p4.samsung.com>
2025-02-21 13:15 ` [PATCH v7 0/5] Add support for debugfs based RAS DES feature in PCIe DW Shradha Todi
2025-02-21 13:15 ` [PATCH v7 1/5] perf/dwc_pcie: Move common DWC struct definitions to 'pcie-dwc.h' Shradha Todi
2025-02-25 14:47 ` Krzysztof Wilczyński
2025-02-26 1:55 ` Shuai Xue
2025-02-26 6:48 ` Krzysztof Wilczyński
2025-03-03 17:19 ` Fan Ni
2025-02-21 13:15 ` [PATCH v7 2/5] PCI: dwc: Add helper to find the Vendor Specific Extended Capability (VSEC) Shradha Todi
2025-03-03 17:22 ` Fan Ni
2025-02-21 13:15 ` [PATCH v7 3/5] Add debugfs based silicon debug support in DWC Shradha Todi
2025-02-23 8:51 ` Manivannan Sadhasivam
2025-03-03 17:48 ` Fan Ni
2025-03-03 19:46 ` Krzysztof Wilczyński
2025-03-03 20:50 ` Fan Ni
2025-03-04 6:44 ` Krzysztof Wilczyński
2025-03-04 14:54 ` Geert Uytterhoeven
2025-03-04 14:57 ` Geert Uytterhoeven
2025-03-04 15:46 ` Krzysztof Wilczyński
2025-03-04 16:52 ` Shradha Todi
2025-03-05 7:44 ` 'Krzysztof Wilczyński'
2025-03-05 9:04 ` Shradha Todi
2025-03-04 17:11 ` Manivannan Sadhasivam
2025-03-04 17:58 ` Krzysztof Wilczyński
2025-03-05 17:38 ` Bjorn Helgaas
2025-03-05 18:28 ` Manivannan Sadhasivam
2025-03-05 19:09 ` Krzysztof Wilczyński
2025-03-05 21:57 ` Krzysztof Wilczyński
2025-03-06 8:22 ` Geert Uytterhoeven
2025-03-06 9:02 ` Krzysztof Wilczyński
2025-03-07 9:37 ` Shradha Todi
2025-03-04 15:18 ` Manivannan Sadhasivam
2025-02-21 13:15 ` [PATCH v7 4/5] Add debugfs based error injection " Shradha Todi
2025-02-23 8:53 ` Manivannan Sadhasivam
2025-03-03 9:52 ` Krzysztof Wilczyński
2025-03-04 6:50 ` Krzysztof Wilczyński
2025-03-04 15:29 ` Manivannan Sadhasivam
2025-03-04 15:35 ` Krzysztof Wilczyński
2025-03-04 17:00 ` Shradha Todi
2025-03-05 7:26 ` 'Krzysztof Wilczyński'
2025-03-03 17:53 ` Fan Ni
2025-02-21 13:15 ` [PATCH v7 5/5] Add debugfs based statistical counter " Shradha Todi
2025-02-23 8:54 ` Manivannan Sadhasivam
2025-03-03 18:02 ` Fan Ni
2025-03-03 19:42 ` Krzysztof Wilczyński
2025-03-03 21:03 ` Fan Ni
2025-03-04 15:32 ` Manivannan Sadhasivam
2025-03-04 17:10 ` Shradha Todi
2025-03-05 4:26 ` Fan Ni
2025-03-07 9:47 ` Shradha Todi
2025-02-24 17:08 ` [PATCH v7 0/5] Add support for debugfs based RAS DES feature in PCIe DW Niklas Cassel
2025-02-25 8:28 ` Manivannan Sadhasivam
2025-02-25 14:33 ` Krzysztof Wilczyński
2025-02-25 14:35 ` Niklas Cassel
2025-02-25 17:15 ` Manivannan Sadhasivam [this message]
2025-02-25 14:30 ` Krzysztof Wilczyński
2025-03-03 19:51 ` Krzysztof Wilczyński
2025-02-28 11:43 ` Hrishikesh Deleep
2025-03-03 20:00 ` Krzysztof Wilczyński
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=20250225171501.ahjmawunnpyc7wwa@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=18255117159@163.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=a.manzanares@samsung.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=fan.ni@samsung.com \
--cc=jingoohan1@gmail.com \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=nifan.cxl@gmail.com \
--cc=pankaj.dubey@samsung.com \
--cc=renyu.zj@linux.alibaba.com \
--cc=robh@kernel.org \
--cc=shradha.t@samsung.com \
--cc=will@kernel.org \
--cc=xueshuai@linux.alibaba.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