mbox series

[0/4] PCI: replace dublicated MRRS limit quirks

Message ID 20210619063952.2008746-1-art@khadas.com (mailing list archive)
Headers show
Series PCI: replace dublicated MRRS limit quirks | expand

Message

Artem Lapkin June 19, 2021, 6:39 a.m. UTC
Replace dublicated MRRS limit quirks by mrrs_limit_quirk from core
* drivers/pci/controller/dwc/pci-keystone.c
* drivers/pci/controller/pci-loongson.c

Both ks_pcie_quirk loongson_mrrs_quirk was rewritten without any
functionality changes by one mrrs_limit_quirk

Added DesignWare PCI controller which need same quirk for
* drivers/pci/controller/dwc/pci-meson.c (PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3)

This quirk can solve some issue for Khadas VIM3/VIM3L(Amlogic)
with HDMI scrambled picture and nvme devices at intensive writing...

come from:
* https://lore.kernel.org/linux-pci/20210618063821.1383357-1-art@khadas.com/

Artem Lapkin (4):
 PCI: move Keystone and Loongson device IDs to pci_ids
 PCI: core: quirks: add mrrs_limit_quirk
 PCI: keystone move mrrs quirk to core
 PCI: loongson move mrrs quirk to core

Comments

Bjorn Helgaas July 1, 2021, 3:46 p.m. UTC | #1
[+cc Huacai]

On Sat, Jun 19, 2021 at 02:39:48PM +0800, Artem Lapkin wrote:
> Replace dublicated MRRS limit quirks by mrrs_limit_quirk from core
> * drivers/pci/controller/dwc/pci-keystone.c
> * drivers/pci/controller/pci-loongson.c

s/dublicated/duplicated/ (several occurrences)

Capitalize subject lines.

Use "git log --online" to learn conventions and follow them.

Add "()" after function names.

Capitalize acronyms appropriately (NVMe, MRRS, PCI, etc).

End sentences with periods.

A "move" patch must include both the removal and the addition and make
no changes to the code itself.

Amlogic appears without explanation in 2/4.  Must be separate patch to
address only that specific issue.  Should reference published erratum
if possible.  "Solves some issue" is not a compelling justification.

The tree must be consistent and functionally the same or improved
after every patch.

Add to pci_ids.h only if symbol used more than one place.

See
https://lore.kernel.org/r/20210701074458.1809532-3-chenhuacai@loongson.cn,
which looks similar.  Combine efforts if possible and cc Huacai so
you're both aware of overlapping work.

More hints in case they're useful:
https://lore.kernel.org/linux-pci/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com/

> Both ks_pcie_quirk loongson_mrrs_quirk was rewritten without any
> functionality changes by one mrrs_limit_quirk
> 
> Added DesignWare PCI controller which need same quirk for
> * drivers/pci/controller/dwc/pci-meson.c (PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3)
> 
> This quirk can solve some issue for Khadas VIM3/VIM3L(Amlogic)
> with HDMI scrambled picture and nvme devices at intensive writing...
> 
> come from:
> * https://lore.kernel.org/linux-pci/20210618063821.1383357-1-art@khadas.com/
> 
> Artem Lapkin (4):
>  PCI: move Keystone and Loongson device IDs to pci_ids
>  PCI: core: quirks: add mrrs_limit_quirk
>  PCI: keystone move mrrs quirk to core
>  PCI: loongson move mrrs quirk to core
> 
> -- 
> 2.25.1
>
Huacai Chen July 2, 2021, 1:15 a.m. UTC | #2
Hi, Bjorn,

> -----原始邮件-----
&gt; 发件人: "Bjorn Helgaas" <helgaas@kernel.org>
&gt; 发送时间: 2021-07-01 23:46:34 (星期四)
&gt; 收件人: "Artem Lapkin" <email2tema@gmail.com>
&gt; 抄送: narmstrong@baylibre.com, yue.wang@Amlogic.com, khilman@baylibre.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, jbrunet@baylibre.com, christianshewitt@gmail.com, martin.blumenstingl@googlemail.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, art@khadas.com, nick@khadas.com, gouwa@khadas.com, "Huacai Chen" <chenhuacai@loongson.cn>
&gt; 主题: Re: [PATCH 0/4] PCI: replace dublicated MRRS limit quirks
&gt; 
&gt; [+cc Huacai]
&gt; 
&gt; On Sat, Jun 19, 2021 at 02:39:48PM +0800, Artem Lapkin wrote:
&gt; &gt; Replace dublicated MRRS limit quirks by mrrs_limit_quirk from core
&gt; &gt; * drivers/pci/controller/dwc/pci-keystone.c
&gt; &gt; * drivers/pci/controller/pci-loongson.c
&gt; 
&gt; s/dublicated/duplicated/ (several occurrences)
&gt; 
&gt; Capitalize subject lines.
&gt; 
&gt; Use "git log --online" to learn conventions and follow them.
&gt; 
&gt; Add "()" after function names.
&gt; 
&gt; Capitalize acronyms appropriately (NVMe, MRRS, PCI, etc).
&gt; 
&gt; End sentences with periods.
&gt; 
&gt; A "move" patch must include both the removal and the addition and make
&gt; no changes to the code itself.
&gt; 
&gt; Amlogic appears without explanation in 2/4.  Must be separate patch to
&gt; address only that specific issue.  Should reference published erratum
&gt; if possible.  "Solves some issue" is not a compelling justification.
&gt; 
&gt; The tree must be consistent and functionally the same or improved
&gt; after every patch.
&gt; 
&gt; Add to pci_ids.h only if symbol used more than one place.
&gt; 
&gt; See
&gt; https://lore.kernel.org/r/20210701074458.1809532-3-chenhuacai@loongson.cn,
&gt; which looks similar.  Combine efforts if possible and cc Huacai so
&gt; you're both aware of overlapping work.
&gt; 
&gt; More hints in case they're useful:
&gt; https://lore.kernel.org/linux-pci/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com/
&gt; 
&gt; &gt; Both ks_pcie_quirk loongson_mrrs_quirk was rewritten without any
&gt; &gt; functionality changes by one mrrs_limit_quirk
Does that means keystone and Loongson has the same MRRS problem? And what should I do now?

Huacai
&gt; &gt; 
&gt; &gt; Added DesignWare PCI controller which need same quirk for
&gt; &gt; * drivers/pci/controller/dwc/pci-meson.c (PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3)
&gt; &gt; 
&gt; &gt; This quirk can solve some issue for Khadas VIM3/VIM3L(Amlogic)
&gt; &gt; with HDMI scrambled picture and nvme devices at intensive writing...
&gt; &gt; 
&gt; &gt; come from:
&gt; &gt; * https://lore.kernel.org/linux-pci/20210618063821.1383357-1-art@khadas.com/
&gt; &gt; 
&gt; &gt; Artem Lapkin (4):
&gt; &gt;  PCI: move Keystone and Loongson device IDs to pci_ids
&gt; &gt;  PCI: core: quirks: add mrrs_limit_quirk
&gt; &gt;  PCI: keystone move mrrs quirk to core
&gt; &gt;  PCI: loongson move mrrs quirk to core
&gt; &gt; 
&gt; &gt; -- 
&gt; &gt; 2.25.1
&gt; &gt;


</chenhuacai@loongson.cn></email2tema@gmail.com></helgaas@kernel.org>
Artem Lapkin July 5, 2021, 8:35 a.m. UTC | #3
> Does that means keystone and Loongson has the same MRRS problem? And what should I do now?

Look like yes ! and  amlogic has the same problem.
I think somebody need to rewrite it all to one common quirk for this problem.

If no one has any objection, I can try to remake it again.

On Fri, Jul 2, 2021 at 9:15 AM 陈华才 <chenhuacai@loongson.cn> wrote:
>
> Hi, Bjorn,
>
> &gt; -----原始邮件-----
> &gt; 发件人: "Bjorn Helgaas" <helgaas@kernel.org>
> &gt; 发送时间: 2021-07-01 23:46:34 (星期四)
> &gt; 收件人: "Artem Lapkin" <email2tema@gmail.com>
> &gt; 抄送: narmstrong@baylibre.com, yue.wang@Amlogic.com, khilman@baylibre.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, jbrunet@baylibre.com, christianshewitt@gmail.com, martin.blumenstingl@googlemail.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, art@khadas.com, nick@khadas.com, gouwa@khadas.com, "Huacai Chen" <chenhuacai@loongson.cn>
> &gt; 主题: Re: [PATCH 0/4] PCI: replace dublicated MRRS limit quirks
> &gt;
> &gt; [+cc Huacai]
> &gt;
> &gt; On Sat, Jun 19, 2021 at 02:39:48PM +0800, Artem Lapkin wrote:
> &gt; &gt; Replace dublicated MRRS limit quirks by mrrs_limit_quirk from core
> &gt; &gt; * drivers/pci/controller/dwc/pci-keystone.c
> &gt; &gt; * drivers/pci/controller/pci-loongson.c
> &gt;
> &gt; s/dublicated/duplicated/ (several occurrences)
> &gt;
> &gt; Capitalize subject lines.
> &gt;
> &gt; Use "git log --online" to learn conventions and follow them.
> &gt;
> &gt; Add "()" after function names.
> &gt;
> &gt; Capitalize acronyms appropriately (NVMe, MRRS, PCI, etc).
> &gt;
> &gt; End sentences with periods.
> &gt;
> &gt; A "move" patch must include both the removal and the addition and make
> &gt; no changes to the code itself.
> &gt;
> &gt; Amlogic appears without explanation in 2/4.  Must be separate patch to
> &gt; address only that specific issue.  Should reference published erratum
> &gt; if possible.  "Solves some issue" is not a compelling justification.
> &gt;
> &gt; The tree must be consistent and functionally the same or improved
> &gt; after every patch.
> &gt;
> &gt; Add to pci_ids.h only if symbol used more than one place.
> &gt;
> &gt; See
> &gt; https://lore.kernel.org/r/20210701074458.1809532-3-chenhuacai@loongson.cn,
> &gt; which looks similar.  Combine efforts if possible and cc Huacai so
> &gt; you're both aware of overlapping work.
> &gt;
> &gt; More hints in case they're useful:
> &gt; https://lore.kernel.org/linux-pci/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com/
> &gt;
> &gt; &gt; Both ks_pcie_quirk loongson_mrrs_quirk was rewritten without any
> &gt; &gt; functionality changes by one mrrs_limit_quirk
> Does that means keystone and Loongson has the same MRRS problem? And what should I do now?
>
> Huacai
> &gt; &gt;
> &gt; &gt; Added DesignWare PCI controller which need same quirk for
> &gt; &gt; * drivers/pci/controller/dwc/pci-meson.c (PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3)
> &gt; &gt;
> &gt; &gt; This quirk can solve some issue for Khadas VIM3/VIM3L(Amlogic)
> &gt; &gt; with HDMI scrambled picture and nvme devices at intensive writing...
> &gt; &gt;
> &gt; &gt; come from:
> &gt; &gt; * https://lore.kernel.org/linux-pci/20210618063821.1383357-1-art@khadas.com/
> &gt; &gt;
> &gt; &gt; Artem Lapkin (4):
> &gt; &gt;  PCI: move Keystone and Loongson device IDs to pci_ids
> &gt; &gt;  PCI: core: quirks: add mrrs_limit_quirk
> &gt; &gt;  PCI: keystone move mrrs quirk to core
> &gt; &gt;  PCI: loongson move mrrs quirk to core
> &gt; &gt;
> &gt; &gt; --
> &gt; &gt; 2.25.1
> &gt; &gt;
>
>
> </chenhuacai@loongson.cn></email2tema@gmail.com></helgaas@kernel.org>
Krzysztof Wilczyński July 5, 2021, 10:34 p.m. UTC | #4
Hi Art,

[...]
> If no one has any objection, I can try to remake it again.

I can't speak for everyone, of course, but I am sure that nobody would
object if you decide to work on v2, so that a proper fix can be applied,
and issues fixed long term.

Thank you for working on this!  Much appreciated!

	Krzysztof
Huacai Chen July 6, 2021, 1:36 a.m. UTC | #5
Hi, Art,

On Mon, Jul 5, 2021 at 4:35 PM Art Nikpal <email2tema@gmail.com> wrote:
>
> > Does that means keystone and Loongson has the same MRRS problem? And what should I do now?
>
> Look like yes ! and  amlogic has the same problem.
> I think somebody need to rewrite it all to one common quirk for this problem.
>
> If no one has any objection, I can try to remake it again.
But, Loongson platform has newer revision of hardware, and the MRRS
quirk has changed, please see:
https://patchwork.kernel.org/project/linux-pci/list/?series=509497

Huacai
>
> On Fri, Jul 2, 2021 at 9:15 AM 陈华才 <chenhuacai@loongson.cn> wrote:
> >
> > Hi, Bjorn,
> >
> > &gt; -----原始邮件-----
> > &gt; 发件人: "Bjorn Helgaas" <helgaas@kernel.org>
> > &gt; 发送时间: 2021-07-01 23:46:34 (星期四)
> > &gt; 收件人: "Artem Lapkin" <email2tema@gmail.com>
> > &gt; 抄送: narmstrong@baylibre.com, yue.wang@Amlogic.com, khilman@baylibre.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, jbrunet@baylibre.com, christianshewitt@gmail.com, martin.blumenstingl@googlemail.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, art@khadas.com, nick@khadas.com, gouwa@khadas.com, "Huacai Chen" <chenhuacai@loongson.cn>
> > &gt; 主题: Re: [PATCH 0/4] PCI: replace dublicated MRRS limit quirks
> > &gt;
> > &gt; [+cc Huacai]
> > &gt;
> > &gt; On Sat, Jun 19, 2021 at 02:39:48PM +0800, Artem Lapkin wrote:
> > &gt; &gt; Replace dublicated MRRS limit quirks by mrrs_limit_quirk from core
> > &gt; &gt; * drivers/pci/controller/dwc/pci-keystone.c
> > &gt; &gt; * drivers/pci/controller/pci-loongson.c
> > &gt;
> > &gt; s/dublicated/duplicated/ (several occurrences)
> > &gt;
> > &gt; Capitalize subject lines.
> > &gt;
> > &gt; Use "git log --online" to learn conventions and follow them.
> > &gt;
> > &gt; Add "()" after function names.
> > &gt;
> > &gt; Capitalize acronyms appropriately (NVMe, MRRS, PCI, etc).
> > &gt;
> > &gt; End sentences with periods.
> > &gt;
> > &gt; A "move" patch must include both the removal and the addition and make
> > &gt; no changes to the code itself.
> > &gt;
> > &gt; Amlogic appears without explanation in 2/4.  Must be separate patch to
> > &gt; address only that specific issue.  Should reference published erratum
> > &gt; if possible.  "Solves some issue" is not a compelling justification.
> > &gt;
> > &gt; The tree must be consistent and functionally the same or improved
> > &gt; after every patch.
> > &gt;
> > &gt; Add to pci_ids.h only if symbol used more than one place.
> > &gt;
> > &gt; See
> > &gt; https://lore.kernel.org/r/20210701074458.1809532-3-chenhuacai@loongson.cn,
> > &gt; which looks similar.  Combine efforts if possible and cc Huacai so
> > &gt; you're both aware of overlapping work.
> > &gt;
> > &gt; More hints in case they're useful:
> > &gt; https://lore.kernel.org/linux-pci/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com/
> > &gt;
> > &gt; &gt; Both ks_pcie_quirk loongson_mrrs_quirk was rewritten without any
> > &gt; &gt; functionality changes by one mrrs_limit_quirk
> > Does that means keystone and Loongson has the same MRRS problem? And what should I do now?
> >
> > Huacai
> > &gt; &gt;
> > &gt; &gt; Added DesignWare PCI controller which need same quirk for
> > &gt; &gt; * drivers/pci/controller/dwc/pci-meson.c (PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3)
> > &gt; &gt;
> > &gt; &gt; This quirk can solve some issue for Khadas VIM3/VIM3L(Amlogic)
> > &gt; &gt; with HDMI scrambled picture and nvme devices at intensive writing...
> > &gt; &gt;
> > &gt; &gt; come from:
> > &gt; &gt; * https://lore.kernel.org/linux-pci/20210618063821.1383357-1-art@khadas.com/
> > &gt; &gt;
> > &gt; &gt; Artem Lapkin (4):
> > &gt; &gt;  PCI: move Keystone and Loongson device IDs to pci_ids
> > &gt; &gt;  PCI: core: quirks: add mrrs_limit_quirk
> > &gt; &gt;  PCI: keystone move mrrs quirk to core
> > &gt; &gt;  PCI: loongson move mrrs quirk to core
> > &gt; &gt;
> > &gt; &gt; --
> > &gt; &gt; 2.25.1
> > &gt; &gt;
> >
> >
> > </chenhuacai@loongson.cn></email2tema@gmail.com></helgaas@kernel.org>
Artem Lapkin July 6, 2021, 6:06 a.m. UTC | #6
>But, Loongson platform has newer revision of hardware, and the MRRS
> quirk has changed, please see:
> https://patchwork.kernel.org/project/linux-pci/list/?series=509497
> Huacai

OK! tnx for information ! maybe we can cooperate and make one
universal quirk for all

On Tue, Jul 6, 2021 at 9:36 AM Huacai Chen <chenhuacai@gmail.com> wrote:
>
> Hi, Art,
>
> On Mon, Jul 5, 2021 at 4:35 PM Art Nikpal <email2tema@gmail.com> wrote:
> >
> > > Does that means keystone and Loongson has the same MRRS problem? And what should I do now?
> >
> > Look like yes ! and  amlogic has the same problem.
> > I think somebody need to rewrite it all to one common quirk for this problem.
> >
> > If no one has any objection, I can try to remake it again.
> But, Loongson platform has newer revision of hardware, and the MRRS
> quirk has changed, please see:
> https://patchwork.kernel.org/project/linux-pci/list/?series=509497
>
> Huacai
> >
> > On Fri, Jul 2, 2021 at 9:15 AM 陈华才 <chenhuacai@loongson.cn> wrote:
> > >
> > > Hi, Bjorn,
> > >
> > > &gt; -----原始邮件-----
> > > &gt; 发件人: "Bjorn Helgaas" <helgaas@kernel.org>
> > > &gt; 发送时间: 2021-07-01 23:46:34 (星期四)
> > > &gt; 收件人: "Artem Lapkin" <email2tema@gmail.com>
> > > &gt; 抄送: narmstrong@baylibre.com, yue.wang@Amlogic.com, khilman@baylibre.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, jbrunet@baylibre.com, christianshewitt@gmail.com, martin.blumenstingl@googlemail.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, art@khadas.com, nick@khadas.com, gouwa@khadas.com, "Huacai Chen" <chenhuacai@loongson.cn>
> > > &gt; 主题: Re: [PATCH 0/4] PCI: replace dublicated MRRS limit quirks
> > > &gt;
> > > &gt; [+cc Huacai]
> > > &gt;
> > > &gt; On Sat, Jun 19, 2021 at 02:39:48PM +0800, Artem Lapkin wrote:
> > > &gt; &gt; Replace dublicated MRRS limit quirks by mrrs_limit_quirk from core
> > > &gt; &gt; * drivers/pci/controller/dwc/pci-keystone.c
> > > &gt; &gt; * drivers/pci/controller/pci-loongson.c
> > > &gt;
> > > &gt; s/dublicated/duplicated/ (several occurrences)
> > > &gt;
> > > &gt; Capitalize subject lines.
> > > &gt;
> > > &gt; Use "git log --online" to learn conventions and follow them.
> > > &gt;
> > > &gt; Add "()" after function names.
> > > &gt;
> > > &gt; Capitalize acronyms appropriately (NVMe, MRRS, PCI, etc).
> > > &gt;
> > > &gt; End sentences with periods.
> > > &gt;
> > > &gt; A "move" patch must include both the removal and the addition and make
> > > &gt; no changes to the code itself.
> > > &gt;
> > > &gt; Amlogic appears without explanation in 2/4.  Must be separate patch to
> > > &gt; address only that specific issue.  Should reference published erratum
> > > &gt; if possible.  "Solves some issue" is not a compelling justification.
> > > &gt;
> > > &gt; The tree must be consistent and functionally the same or improved
> > > &gt; after every patch.
> > > &gt;
> > > &gt; Add to pci_ids.h only if symbol used more than one place.
> > > &gt;
> > > &gt; See
> > > &gt; https://lore.kernel.org/r/20210701074458.1809532-3-chenhuacai@loongson.cn,
> > > &gt; which looks similar.  Combine efforts if possible and cc Huacai so
> > > &gt; you're both aware of overlapping work.
> > > &gt;
> > > &gt; More hints in case they're useful:
> > > &gt; https://lore.kernel.org/linux-pci/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com/
> > > &gt;
> > > &gt; &gt; Both ks_pcie_quirk loongson_mrrs_quirk was rewritten without any
> > > &gt; &gt; functionality changes by one mrrs_limit_quirk
> > > Does that means keystone and Loongson has the same MRRS problem? And what should I do now?
> > >
> > > Huacai
> > > &gt; &gt;
> > > &gt; &gt; Added DesignWare PCI controller which need same quirk for
> > > &gt; &gt; * drivers/pci/controller/dwc/pci-meson.c (PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3)
> > > &gt; &gt;
> > > &gt; &gt; This quirk can solve some issue for Khadas VIM3/VIM3L(Amlogic)
> > > &gt; &gt; with HDMI scrambled picture and nvme devices at intensive writing...
> > > &gt; &gt;
> > > &gt; &gt; come from:
> > > &gt; &gt; * https://lore.kernel.org/linux-pci/20210618063821.1383357-1-art@khadas.com/
> > > &gt; &gt;
> > > &gt; &gt; Artem Lapkin (4):
> > > &gt; &gt;  PCI: move Keystone and Loongson device IDs to pci_ids
> > > &gt; &gt;  PCI: core: quirks: add mrrs_limit_quirk
> > > &gt; &gt;  PCI: keystone move mrrs quirk to core
> > > &gt; &gt;  PCI: loongson move mrrs quirk to core
> > > &gt; &gt;
> > > &gt; &gt; --
> > > &gt; &gt; 2.25.1
> > > &gt; &gt;
> > >
> > >
> > > </chenhuacai@loongson.cn></email2tema@gmail.com></helgaas@kernel.org>
Neil Armstrong July 6, 2021, 9:54 a.m. UTC | #7
Hi,

On 06/07/2021 08:06, Art Nikpal wrote:
>> But, Loongson platform has newer revision of hardware, and the MRRS
>> quirk has changed, please see:
>> https://patchwork.kernel.org/project/linux-pci/list/?series=509497
>> Huacai
> 
> OK! tnx for information ! maybe we can cooperate and make one
> universal quirk for all

In their Designware PCIe controller driver, amlogic sets the Max_Payload_Size & Max_Read_Request_Size to 256:
https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L260
https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L276
in their root port PCIe Express Device Control Register.

Looking at the Synopsys DW-PCIe Databook, Max_Payload_Size & Max_Read_Request_Size are used to decompose into AXI burst,
but it seems the Max_Payload_Size & Max_Read_Request_Size are set by default to 512 but the internal Max_Payload_Size_Supported
is set to 256, thus changing these values to 256 at runtime to match and optimize bandwidth.

It's said, "Reducing Outbound Decomposition" :
 - "Ensure that your application master does not generate bursts of size greater than or equal to Max_Payload_Size"
 - "Program your PCIe system with a larger value of Max_Payload_Size without exceeding Max_Payload_Size_Supported"
 - "Program your PCIe system with a larger value of Max_Read_Request without exceeding Max_Payload_Size_Supported:

So leaving 512 in Max_Payload_Size & Max_Read_Request leads to Outbound Decomposition which decreases PCIe link and degrades
the AXI bus by doubling the bursts, leading to this fix to avoid overflowing the AXI bus.

So it seems to be still needed, I assume this *should* be handled in the core somehow to propagate these settings to child endpoints to match
the root port Max_Payload_Size & Max_Read_Request sizes.

Maybe by adding a core function to set these values instead of using the dw_pcie_find_capability() & dw_pcie_write/readl_dbi() helpers
and set a state on the root port to propagate the value ?

Neil

> 
> On Tue, Jul 6, 2021 at 9:36 AM Huacai Chen <chenhuacai@gmail.com> wrote:
>>
>> Hi, Art,
>>
>> On Mon, Jul 5, 2021 at 4:35 PM Art Nikpal <email2tema@gmail.com> wrote:
>>>
>>>> Does that means keystone and Loongson has the same MRRS problem? And what should I do now?
>>>
>>> Look like yes ! and  amlogic has the same problem.
>>> I think somebody need to rewrite it all to one common quirk for this problem.
>>>
>>> If no one has any objection, I can try to remake it again.
>> But, Loongson platform has newer revision of hardware, and the MRRS
>> quirk has changed, please see:
>> https://patchwork.kernel.org/project/linux-pci/list/?series=509497
>>
>> Huacai
>>>
>>> On Fri, Jul 2, 2021 at 9:15 AM 陈华才 <chenhuacai@loongson.cn> wrote:
>>>>
>>>> Hi, Bjorn,
>>>>
>>>> &gt; -----原始邮件-----
>>>> &gt; 发件人: "Bjorn Helgaas" <helgaas@kernel.org>
>>>> &gt; 发送时间: 2021-07-01 23:46:34 (星期四)
>>>> &gt; 收件人: "Artem Lapkin" <email2tema@gmail.com>
>>>> &gt; 抄送: narmstrong@baylibre.com, yue.wang@Amlogic.com, khilman@baylibre.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, jbrunet@baylibre.com, christianshewitt@gmail.com, martin.blumenstingl@googlemail.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, art@khadas.com, nick@khadas.com, gouwa@khadas.com, "Huacai Chen" <chenhuacai@loongson.cn>
>>>> &gt; 主题: Re: [PATCH 0/4] PCI: replace dublicated MRRS limit quirks
>>>> &gt;
>>>> &gt; [+cc Huacai]
>>>> &gt;
>>>> &gt; On Sat, Jun 19, 2021 at 02:39:48PM +0800, Artem Lapkin wrote:
>>>> &gt; &gt; Replace dublicated MRRS limit quirks by mrrs_limit_quirk from core
>>>> &gt; &gt; * drivers/pci/controller/dwc/pci-keystone.c
>>>> &gt; &gt; * drivers/pci/controller/pci-loongson.c
>>>> &gt;
>>>> &gt; s/dublicated/duplicated/ (several occurrences)
>>>> &gt;
>>>> &gt; Capitalize subject lines.
>>>> &gt;
>>>> &gt; Use "git log --online" to learn conventions and follow them.
>>>> &gt;
>>>> &gt; Add "()" after function names.
>>>> &gt;
>>>> &gt; Capitalize acronyms appropriately (NVMe, MRRS, PCI, etc).
>>>> &gt;
>>>> &gt; End sentences with periods.
>>>> &gt;
>>>> &gt; A "move" patch must include both the removal and the addition and make
>>>> &gt; no changes to the code itself.
>>>> &gt;
>>>> &gt; Amlogic appears without explanation in 2/4.  Must be separate patch to
>>>> &gt; address only that specific issue.  Should reference published erratum
>>>> &gt; if possible.  "Solves some issue" is not a compelling justification.
>>>> &gt;
>>>> &gt; The tree must be consistent and functionally the same or improved
>>>> &gt; after every patch.
>>>> &gt;
>>>> &gt; Add to pci_ids.h only if symbol used more than one place.
>>>> &gt;
>>>> &gt; See
>>>> &gt; https://lore.kernel.org/r/20210701074458.1809532-3-chenhuacai@loongson.cn,
>>>> &gt; which looks similar.  Combine efforts if possible and cc Huacai so
>>>> &gt; you're both aware of overlapping work.
>>>> &gt;
>>>> &gt; More hints in case they're useful:
>>>> &gt; https://lore.kernel.org/linux-pci/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com/
>>>> &gt;
>>>> &gt; &gt; Both ks_pcie_quirk loongson_mrrs_quirk was rewritten without any
>>>> &gt; &gt; functionality changes by one mrrs_limit_quirk
>>>> Does that means keystone and Loongson has the same MRRS problem? And what should I do now?
>>>>
>>>> Huacai
>>>> &gt; &gt;
>>>> &gt; &gt; Added DesignWare PCI controller which need same quirk for
>>>> &gt; &gt; * drivers/pci/controller/dwc/pci-meson.c (PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3)
>>>> &gt; &gt;
>>>> &gt; &gt; This quirk can solve some issue for Khadas VIM3/VIM3L(Amlogic)
>>>> &gt; &gt; with HDMI scrambled picture and nvme devices at intensive writing...
>>>> &gt; &gt;
>>>> &gt; &gt; come from:
>>>> &gt; &gt; * https://lore.kernel.org/linux-pci/20210618063821.1383357-1-art@khadas.com/
>>>> &gt; &gt;
>>>> &gt; &gt; Artem Lapkin (4):
>>>> &gt; &gt;  PCI: move Keystone and Loongson device IDs to pci_ids
>>>> &gt; &gt;  PCI: core: quirks: add mrrs_limit_quirk
>>>> &gt; &gt;  PCI: keystone move mrrs quirk to core
>>>> &gt; &gt;  PCI: loongson move mrrs quirk to core
>>>> &gt; &gt;
>>>> &gt; &gt; --
>>>> &gt; &gt; 2.25.1
>>>> &gt; &gt;
>>>>
>>>>
>>>> </chenhuacai@loongson.cn></email2tema@gmail.com></helgaas@kernel.org>
Bjorn Helgaas July 7, 2021, 3:54 p.m. UTC | #8
On Tue, Jul 06, 2021 at 11:54:05AM +0200, Neil Armstrong wrote:
> In their Designware PCIe controller driver, amlogic sets the
> Max_Payload_Size & Max_Read_Request_Size to 256:
> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L260
> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L276
> in their root port PCIe Express Device Control Register.
> 
> Looking at the Synopsys DW-PCIe Databook, Max_Payload_Size &
> Max_Read_Request_Size are used to decompose into AXI burst, but it
> seems the Max_Payload_Size & Max_Read_Request_Size are set by
> default to 512 but the internal Max_Payload_Size_Supported is set to
> 256, thus changing these values to 256 at runtime to match and
> optimize bandwidth.
> 
> It's said, "Reducing Outbound Decomposition" :
>  - "Ensure that your application master does not generate bursts of
>    size greater than or equal to Max_Payload_Size"
>
>  - "Program your PCIe system with a larger value of Max_Payload_Size
>    without exceeding Max_Payload_Size_Supported"
>
>  - "Program your PCIe system with a larger value of Max_Read_Request
>    without exceeding Max_Payload_Size_Supported:
> 
> So leaving 512 in Max_Payload_Size & Max_Read_Request leads to
> Outbound Decomposition which decreases PCIe link and degrades the
> AXI bus by doubling the bursts, leading to this fix to avoid
> overflowing the AXI bus.
> 
> So it seems to be still needed, I assume this *should* be handled in
> the core somehow to propagate these settings to child endpoints to
> match the root port Max_Payload_Size & Max_Read_Request sizes.
> 
> Maybe by adding a core function to set these values instead of using
> the dw_pcie_find_capability() & dw_pcie_write/readl_dbi() helpers
> and set a state on the root port to propagate the value ?

I don't have the Synopsys DW-PCIe Databook, so I'm lacking any
context.  The above *seems* to say that MPS/MRRS settings affect AXI
bus usage.

The MPS and MRRS registers are defined to affect traffic on *PCIe*.  If
a platform uses MPS and MRRS values to optimize transfers on non-PCIe
links, that's a problem because the PCI core code that manages MPS and
MRRS has no knowledge of those non-PCIe parts of the system.

You might be able to deal with this in Synopsys-specific code somehow,
but it's going to be a bit of a hassle because I don't want it to make
maintenance of the generic MPS/MRRS code harder.

Bjorn
Neil Armstrong July 7, 2021, 4:43 p.m. UTC | #9
Hi,

On 07/07/2021 17:54, Bjorn Helgaas wrote:
> On Tue, Jul 06, 2021 at 11:54:05AM +0200, Neil Armstrong wrote:
>> In their Designware PCIe controller driver, amlogic sets the
>> Max_Payload_Size & Max_Read_Request_Size to 256:
>> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L260
>> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L276
>> in their root port PCIe Express Device Control Register.
>>
>> Looking at the Synopsys DW-PCIe Databook, Max_Payload_Size &
>> Max_Read_Request_Size are used to decompose into AXI burst, but it
>> seems the Max_Payload_Size & Max_Read_Request_Size are set by
>> default to 512 but the internal Max_Payload_Size_Supported is set to
>> 256, thus changing these values to 256 at runtime to match and
>> optimize bandwidth.
>>
>> It's said, "Reducing Outbound Decomposition" :
>>  - "Ensure that your application master does not generate bursts of
>>    size greater than or equal to Max_Payload_Size"
>>
>>  - "Program your PCIe system with a larger value of Max_Payload_Size
>>    without exceeding Max_Payload_Size_Supported"
>>
>>  - "Program your PCIe system with a larger value of Max_Read_Request
>>    without exceeding Max_Payload_Size_Supported:
>>
>> So leaving 512 in Max_Payload_Size & Max_Read_Request leads to
>> Outbound Decomposition which decreases PCIe link and degrades the
>> AXI bus by doubling the bursts, leading to this fix to avoid
>> overflowing the AXI bus.
>>
>> So it seems to be still needed, I assume this *should* be handled in
>> the core somehow to propagate these settings to child endpoints to
>> match the root port Max_Payload_Size & Max_Read_Request sizes.
>>
>> Maybe by adding a core function to set these values instead of using
>> the dw_pcie_find_capability() & dw_pcie_write/readl_dbi() helpers
>> and set a state on the root port to propagate the value ?
> 
> I don't have the Synopsys DW-PCIe Databook, so I'm lacking any
> context.  The above *seems* to say that MPS/MRRS settings affect AXI
> bus usage.

It does when the TLPs are directed to the RC.

> 
> The MPS and MRRS registers are defined to affect traffic on *PCIe*.  If
> a platform uses MPS and MRRS values to optimize transfers on non-PCIe
> links, that's a problem because the PCI core code that manages MPS and
> MRRS has no knowledge of those non-PCIe parts of the system.

Yes and no, it only affects PCIe in P2P, in non-P2P is will certainly affect
transfers on the internal SoC/Processor/Chip internal bus/fabric.

> You might be able to deal with this in Synopsys-specific code somehow,
> but it's going to be a bit of a hassle because I don't want it to make
> maintenance of the generic MPS/MRRS code harder.

I understand, but this is why these quirks are currently implemented in the
controller driver and only applies when the controller has been probed
and to each endpoint detected on this particular controller.

So we may continue having separate quirks for each controller if the core
isn't the right place to handle MPS/MRRS.

Neil

> Bjorn
>
Bjorn Helgaas July 7, 2021, 4:57 p.m. UTC | #10
On Wed, Jul 07, 2021 at 06:43:13PM +0200, Neil Armstrong wrote:
> On 07/07/2021 17:54, Bjorn Helgaas wrote:
> > On Tue, Jul 06, 2021 at 11:54:05AM +0200, Neil Armstrong wrote:
> >> In their Designware PCIe controller driver, amlogic sets the
> >> Max_Payload_Size & Max_Read_Request_Size to 256:
> >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L260
> >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L276
> >> in their root port PCIe Express Device Control Register.
> >>
> >> Looking at the Synopsys DW-PCIe Databook, Max_Payload_Size &
> >> Max_Read_Request_Size are used to decompose into AXI burst, but it
> >> seems the Max_Payload_Size & Max_Read_Request_Size are set by
> >> default to 512 but the internal Max_Payload_Size_Supported is set to
> >> 256, thus changing these values to 256 at runtime to match and
> >> optimize bandwidth.
> >>
> >> It's said, "Reducing Outbound Decomposition" :
> >>  - "Ensure that your application master does not generate bursts of
> >>    size greater than or equal to Max_Payload_Size"
> >>
> >>  - "Program your PCIe system with a larger value of Max_Payload_Size
> >>    without exceeding Max_Payload_Size_Supported"
> >>
> >>  - "Program your PCIe system with a larger value of Max_Read_Request
> >>    without exceeding Max_Payload_Size_Supported:
> >>
> >> So leaving 512 in Max_Payload_Size & Max_Read_Request leads to
> >> Outbound Decomposition which decreases PCIe link and degrades the
> >> AXI bus by doubling the bursts, leading to this fix to avoid
> >> overflowing the AXI bus.
> >>
> >> So it seems to be still needed, I assume this *should* be handled in
> >> the core somehow to propagate these settings to child endpoints to
> >> match the root port Max_Payload_Size & Max_Read_Request sizes.
> >>
> >> Maybe by adding a core function to set these values instead of using
> >> the dw_pcie_find_capability() & dw_pcie_write/readl_dbi() helpers
> >> and set a state on the root port to propagate the value ?
> > 
> > I don't have the Synopsys DW-PCIe Databook, so I'm lacking any
> > context.  The above *seems* to say that MPS/MRRS settings affect AXI
> > bus usage.
> 
> It does when the TLPs are directed to the RC.

That's a defect in the RC.

> > The MPS and MRRS registers are defined to affect traffic on *PCIe*.  If
> > a platform uses MPS and MRRS values to optimize transfers on non-PCIe
> > links, that's a problem because the PCI core code that manages MPS and
> > MRRS has no knowledge of those non-PCIe parts of the system.
> 
> Yes and no, it only affects PCIe in P2P, in non-P2P is will certainly affect
> transfers on the internal SoC/Processor/Chip internal bus/fabric.
> 
> > You might be able to deal with this in Synopsys-specific code somehow,
> > but it's going to be a bit of a hassle because I don't want it to make
> > maintenance of the generic MPS/MRRS code harder.
> 
> I understand, but this is why these quirks are currently implemented in the
> controller driver and only applies when the controller has been probed
> and to each endpoint detected on this particular controller.
> 
> So we may continue having separate quirks for each controller if the core
> isn't the right place to handle MPS/MRRS.

The PCI core is the correct place to handle MPS/MRRS because their
behavior is defined by the PCIe spec.

Quirks are the way to work around this defect in the Synopsys PCIe IP.

Bjorn
Bjorn Helgaas July 7, 2021, 5:21 p.m. UTC | #11
On Wed, Jul 07, 2021 at 11:57:35AM -0500, Bjorn Helgaas wrote:
> On Wed, Jul 07, 2021 at 06:43:13PM +0200, Neil Armstrong wrote:
> > On 07/07/2021 17:54, Bjorn Helgaas wrote:
> > > On Tue, Jul 06, 2021 at 11:54:05AM +0200, Neil Armstrong wrote:
> > >> In their Designware PCIe controller driver, amlogic sets the
> > >> Max_Payload_Size & Max_Read_Request_Size to 256:
> > >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L260
> > >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L276
> > >> in their root port PCIe Express Device Control Register.
> > >>
> > >> Looking at the Synopsys DW-PCIe Databook, Max_Payload_Size &
> > >> Max_Read_Request_Size are used to decompose into AXI burst, but it
> > >> seems the Max_Payload_Size & Max_Read_Request_Size are set by
> > >> default to 512 but the internal Max_Payload_Size_Supported is set to
> > >> 256, thus changing these values to 256 at runtime to match and
> > >> optimize bandwidth.
> > >>
> > >> It's said, "Reducing Outbound Decomposition" :
> > >>  - "Ensure that your application master does not generate bursts of
> > >>    size greater than or equal to Max_Payload_Size"
> > >>
> > >>  - "Program your PCIe system with a larger value of Max_Payload_Size
> > >>    without exceeding Max_Payload_Size_Supported"
> > >>
> > >>  - "Program your PCIe system with a larger value of Max_Read_Request
> > >>    without exceeding Max_Payload_Size_Supported:
> > >>
> > >> So leaving 512 in Max_Payload_Size & Max_Read_Request leads to
> > >> Outbound Decomposition which decreases PCIe link and degrades the
> > >> AXI bus by doubling the bursts, leading to this fix to avoid
> > >> overflowing the AXI bus.
> > >>
> > >> So it seems to be still needed, I assume this *should* be handled in
> > >> the core somehow to propagate these settings to child endpoints to
> > >> match the root port Max_Payload_Size & Max_Read_Request sizes.
> > >>
> > >> Maybe by adding a core function to set these values instead of using
> > >> the dw_pcie_find_capability() & dw_pcie_write/readl_dbi() helpers
> > >> and set a state on the root port to propagate the value ?
> > > 
> > > I don't have the Synopsys DW-PCIe Databook, so I'm lacking any
> > > context.  The above *seems* to say that MPS/MRRS settings affect AXI
> > > bus usage.
> > 
> > It does when the TLPs are directed to the RC.
> 
> That's a defect in the RC.

I mean, it's OK if MPS affects the *performance* of traffic on AXI,
but the RC must work correctly for any MPS up to the MPSS (Max Payload
Size Supported) it advertises.  And there's no PCIe mechanism for
managing the AXI performance impact, so I think it's a mistake if
Synopsys expects device-specific code in the MPS/MRRS configuration
path.  That code should be device-independent.

> > > The MPS and MRRS registers are defined to affect traffic on *PCIe*.  If
> > > a platform uses MPS and MRRS values to optimize transfers on non-PCIe
> > > links, that's a problem because the PCI core code that manages MPS and
> > > MRRS has no knowledge of those non-PCIe parts of the system.
> > 
> > Yes and no, it only affects PCIe in P2P, in non-P2P is will certainly affect
> > transfers on the internal SoC/Processor/Chip internal bus/fabric.
> > 
> > > You might be able to deal with this in Synopsys-specific code somehow,
> > > but it's going to be a bit of a hassle because I don't want it to make
> > > maintenance of the generic MPS/MRRS code harder.
> > 
> > I understand, but this is why these quirks are currently implemented in the
> > controller driver and only applies when the controller has been probed
> > and to each endpoint detected on this particular controller.
> > 
> > So we may continue having separate quirks for each controller if the core
> > isn't the right place to handle MPS/MRRS.
> 
> The PCI core is the correct place to handle MPS/MRRS because their
> behavior is defined by the PCIe spec.
> 
> Quirks are the way to work around this defect in the Synopsys PCIe IP.
> 
> Bjorn
Artem Lapkin July 12, 2021, 9:08 a.m. UTC | #12
> The PCI core is the correct place to handle MPS/MRRS because their> behavior is defined by the PCIe spec.
>Quirks are the way to work around this defect in the Synopsys PCIe IP.

> don't want it to make
> maintenance of the generic MPS/MRRS code harder.

Trying summarize ( every one must use separate quirk )

which file is right place for for meson_mrrs_limit_quirk()

- pci/controller/dwc/pci-meson.c or
- pci/quirks.c

rewrited quirk just for meson:

static void meson_mrrs_limit_quirk(struct pci_dev *dev)
{
    struct pci_bus *bus = dev->bus;
    int mrrs, mrrs_limit = 256;
    static const struct pci_device_id bridge_devids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3) },
        { 0, },
    };

    /* look for the matching bridge */
    while (!pci_is_root_bus(bus)) {
        /*
         * 256 bytes maximum read request size. They can't handle
         * anything larger than this. So force this limit on
         * any devices attached under these ports.
         */
        if (!pci_match_id(bridge_devids, bus->self)){
            bus = bus->parent;
            continue;
        }
        mrrs = pcie_get_readrq(dev);
        if (mrrs > mrrs_limit) {
            pci_info(dev, "limiting MRRS %d to %d\n", mrrs, mrrs_limit);
            pcie_set_readrq(dev, mrrs_limit);
        }
        break;
    }
}
DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, meson_mrrs_limit_quirk);


On Thu, Jul 8, 2021 at 12:57 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Wed, Jul 07, 2021 at 06:43:13PM +0200, Neil Armstrong wrote:
> > On 07/07/2021 17:54, Bjorn Helgaas wrote:
> > > On Tue, Jul 06, 2021 at 11:54:05AM +0200, Neil Armstrong wrote:
> > >> In their Designware PCIe controller driver, amlogic sets the
> > >> Max_Payload_Size & Max_Read_Request_Size to 256:
> > >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L260
> > >> https://elixir.bootlin.com/linux/latest/source/drivers/pci/controller/dwc/pci-meson.c#L276
> > >> in their root port PCIe Express Device Control Register.
> > >>
> > >> Looking at the Synopsys DW-PCIe Databook, Max_Payload_Size &
> > >> Max_Read_Request_Size are used to decompose into AXI burst, but it
> > >> seems the Max_Payload_Size & Max_Read_Request_Size are set by
> > >> default to 512 but the internal Max_Payload_Size_Supported is set to
> > >> 256, thus changing these values to 256 at runtime to match and
> > >> optimize bandwidth.
> > >>
> > >> It's said, "Reducing Outbound Decomposition" :
> > >>  - "Ensure that your application master does not generate bursts of
> > >>    size greater than or equal to Max_Payload_Size"
> > >>
> > >>  - "Program your PCIe system with a larger value of Max_Payload_Size
> > >>    without exceeding Max_Payload_Size_Supported"
> > >>
> > >>  - "Program your PCIe system with a larger value of Max_Read_Request
> > >>    without exceeding Max_Payload_Size_Supported:
> > >>
> > >> So leaving 512 in Max_Payload_Size & Max_Read_Request leads to
> > >> Outbound Decomposition which decreases PCIe link and degrades the
> > >> AXI bus by doubling the bursts, leading to this fix to avoid
> > >> overflowing the AXI bus.
> > >>
> > >> So it seems to be still needed, I assume this *should* be handled in
> > >> the core somehow to propagate these settings to child endpoints to
> > >> match the root port Max_Payload_Size & Max_Read_Request sizes.
> > >>
> > >> Maybe by adding a core function to set these values instead of using
> > >> the dw_pcie_find_capability() & dw_pcie_write/readl_dbi() helpers
> > >> and set a state on the root port to propagate the value ?
> > >
> > > I don't have the Synopsys DW-PCIe Databook, so I'm lacking any
> > > context.  The above *seems* to say that MPS/MRRS settings affect AXI
> > > bus usage.
> >
> > It does when the TLPs are directed to the RC.
>
> That's a defect in the RC.
>
> > > The MPS and MRRS registers are defined to affect traffic on *PCIe*.  If
> > > a platform uses MPS and MRRS values to optimize transfers on non-PCIe
> > > links, that's a problem because the PCI core code that manages MPS and
> > > MRRS has no knowledge of those non-PCIe parts of the system.
> >
> > Yes and no, it only affects PCIe in P2P, in non-P2P is will certainly affect
> > transfers on the internal SoC/Processor/Chip internal bus/fabric.
> >
> > > You might be able to deal with this in Synopsys-specific code somehow,
> > > but it's going to be a bit of a hassle because I don't want it to make
> > > maintenance of the generic MPS/MRRS code harder.
> >
> > I understand, but this is why these quirks are currently implemented in the
> > controller driver and only applies when the controller has been probed
> > and to each endpoint detected on this particular controller.
> >
> > So we may continue having separate quirks for each controller if the core
> > isn't the right place to handle MPS/MRRS.
>
> The PCI core is the correct place to handle MPS/MRRS because their
> behavior is defined by the PCIe spec.
>
> Quirks are the way to work around this defect in the Synopsys PCIe IP.
>
> Bjorn