All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: dwc: meson add quirk
@ 2021-06-18  6:38 ` Artem Lapkin
  0 siblings, 0 replies; 20+ messages in thread
From: Artem Lapkin @ 2021-06-18  6:38 UTC (permalink / raw)
  To: narmstrong
  Cc: yue.wang, khilman, lorenzo.pieralisi, robh, kw, jbrunet,
	christianshewitt, martin.blumenstingl, linux-pci,
	linux-arm-kernel, linux-amlogic, linux-kernel, art, nick, gouwa

Device set same 256 bytes maximum read request size equal MAX_READ_REQ_SIZE
was find some issue with HDMI scrambled picture and nvme devices
at intensive writing...

[    4.798971] nvme 0000:01:00.0: fix MRRS from 512 to 256

This quirk setup same MRRS if we try solve this problem with
pci=pcie_bus_perf kernel command line param

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/pci/controller/dwc/pci-meson.c | 27 ++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 686ded034f22..e2d40e5c2661 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -466,6 +466,33 @@ static int meson_pcie_probe(struct platform_device *pdev)
 	return ret;
 }
 
+static void meson_pcie_quirk(struct pci_dev *dev)
+{
+	int mrrs;
+
+	/* no need quirk */
+	if (pcie_bus_config != PCIE_BUS_DEFAULT)
+		return;
+
+	/* no need for root bus */
+	if (pci_is_root_bus(dev->bus))
+		return;
+
+	mrrs = pcie_get_readrq(dev);
+
+	/*
+	 * set same 256 bytes maximum read request size equal MAX_READ_REQ_SIZE
+	 * was find some issue with HDMI scrambled picture and nvme devices
+	 * at intensive writing...
+	 */
+
+	if (mrrs != MAX_READ_REQ_SIZE) {
+		dev_info(&dev->dev, "fix MRRS from %d to %d\n", mrrs, MAX_READ_REQ_SIZE);
+		pcie_set_readrq(dev, MAX_READ_REQ_SIZE);
+	}
+}
+DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, meson_pcie_quirk);
+
 static const struct of_device_id meson_pcie_of_match[] = {
 	{
 		.compatible = "amlogic,axg-pcie",
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-06-19  3:03 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18  6:38 [PATCH] PCI: dwc: meson add quirk Artem Lapkin
2021-06-18  6:38 ` Artem Lapkin
2021-06-18  6:38 ` Artem Lapkin
2021-06-18 12:11 ` Martin Blumenstingl
2021-06-18 12:11   ` Martin Blumenstingl
2021-06-18 12:11   ` Martin Blumenstingl
2021-06-18 14:30   ` Rob Herring
2021-06-18 14:30     ` Rob Herring
2021-06-18 14:30     ` Rob Herring
2021-06-18 15:08     ` Neil Armstrong
2021-06-18 15:08       ` Neil Armstrong
2021-06-18 15:08       ` Neil Armstrong
2021-06-19  3:01       ` Art Nikpal
2021-06-19  3:01         ` Art Nikpal
2021-06-19  3:01         ` Art Nikpal
2021-06-18 18:29 ` kernel test robot
2021-06-18 18:29   ` kernel test robot
2021-06-18 23:01 ` Bjorn Helgaas
2021-06-18 23:01   ` Bjorn Helgaas
2021-06-18 23:01   ` Bjorn Helgaas

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.