* [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
@ 2026-11-25 15:58 Feng Tang
2026-11-26 8:37 ` Christoph Hellwig
2026-11-26 8:39 ` Niklas Cassel
0 siblings, 2 replies; 8+ messages in thread
From: Feng Tang @ 2026-11-25 15:58 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci; +Cc: linux-kernel, Feng Tang, Anju Zheng
During stability test, there was a bug that running 'mount' on a type
of commercial NVME disk failed on an arm64 server and raised PCIe RAS
error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
cmdline parameter.
The NVME device has MPS(Max Payload Size) capability of 256 bytes while
its corresponding root port is capable of 512 bytes. When enabling
PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
both set to 256, while the root port's are both set to 512. But the
NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
"
Max_Read_Request_Size - This field sets the maximum Read Request size
for the Function as a Requester. The Function must not generate Read
Requests with a size exceeding the set value
"
that it sends out Memory Read request with length of 512 bytes, and
when root port replies CplD packet with 512 bytes payload which exceeds
device's MPS, PCIe RAS error is issued.
The problem can be reproduced on some arm64 server and Intel server.
This caused some data damage, and there were quite a few NVME cards of
the same type damaged (though we are not sure these are directly related).
In this case, the kernel is innocent as it does make sure a device's MRRS
setting is no larger than its MPS setting, while the device breaks PCIe
spec. It could still be meaningful to warn about the possible danger.
Reported-by: Anju Zheng <zaj01616726@alibaba-inc.com>
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
---
include/linux/pci.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d31a8d107b1e..e115aa2e962a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1192,6 +1192,18 @@ static inline int pci_has_flag(int flag) { return pci_flags & flag; }
void pcie_bus_configure_settings(struct pci_bus *bus);
+/*
+ * Note: For PCIE_BUS_PERFORMANCE mode, it could be dangerous for a device
+ * that doesn't completely comply with PCIe spec about MPS and MRRS setting,
+ * as it allows the device and its corresponding root port to have different
+ * MPS settings.
+ *
+ * Kernel already makes sure a device's MRRS setting is no larger than its
+ * MPS setting. But there is real world case that some commercial NVME device
+ * sends out Memory Read request with length bigger than its MRRS (equals to
+ * its MPS), and root port replies CplD packet with that bigger length, which
+ * triggers RAS/MCE errors on arm64 and x86 servers, causing data damage.
+ */
enum pcie_bus_config_types {
PCIE_BUS_TUNE_OFF, /* Don't touch MPS at all */
PCIE_BUS_DEFAULT, /* Ensure MPS matches upstream bridge */
--
2.39.5 (Apple Git-154)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
2026-11-25 15:58 [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode Feng Tang
@ 2026-11-26 8:37 ` Christoph Hellwig
2026-11-26 9:48 ` Feng Tang
2026-11-27 13:24 ` Feng Tang
2026-11-26 8:39 ` Niklas Cassel
1 sibling, 2 replies; 8+ messages in thread
From: Christoph Hellwig @ 2026-11-26 8:37 UTC (permalink / raw)
To: Feng Tang; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Anju Zheng
On Wed, Nov 25, 2026 at 11:58:29PM +0800, Feng Tang wrote:
> During stability test, there was a bug that running 'mount' on a type
> of commercial NVME disk failed on an arm64 server and raised PCIe RAS
> error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
> cmdline parameter.
>
> The NVME device has MPS(Max Payload Size) capability of 256 bytes while
> its corresponding root port is capable of 512 bytes. When enabling
> PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
> both set to 256, while the root port's are both set to 512. But the
> NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
Please add a quirk for these devices now that you have identified
this problem.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
2026-11-25 15:58 [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode Feng Tang
2026-11-26 8:37 ` Christoph Hellwig
@ 2026-11-26 8:39 ` Niklas Cassel
2026-11-26 11:03 ` Feng Tang
1 sibling, 1 reply; 8+ messages in thread
From: Niklas Cassel @ 2026-11-26 8:39 UTC (permalink / raw)
To: Feng Tang; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Anju Zheng
On Wed, Nov 25, 2026 at 11:58:29PM +0800, Feng Tang wrote:
> During stability test, there was a bug that running 'mount' on a type
> of commercial NVME disk failed on an arm64 server and raised PCIe RAS
> error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
> cmdline parameter.
>
> The NVME device has MPS(Max Payload Size) capability of 256 bytes while
> its corresponding root port is capable of 512 bytes. When enabling
> PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
> both set to 256, while the root port's are both set to 512. But the
> NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
I assume that you are using pcie_bus_perf rather than the default strategy,
because with the default strategy never raises the Root Port above what
firmware programmed, which may be only 128 bytes.
pcie_bus_perf gives a Root Port its own maximum MPS without looking at
the devices below it, and relies on MRRS to keep Completions within the
endpoint's MPS, so a device that ignores its MRRS gets Completions
larger than its MPS.
My series [1] avoids this without pcie_bus_perf: with the default strategy,
it sets each Root Port hierarchy to the largest MPS that all of its devices
support, i.e. 256 bytes for both your Root Port and the NVMe. Since a
Function must not generate TLPs larger than its own Max_Payload_Size, the
Root Port then returns Completions of at most 256 bytes, even for the
512-byte reads your NVMe issues. The NVMe also gets the same 256-byte
payloads as with pcie_bus_perf, so nothing is lost by dropping it: the Root
Port's 512 bytes don't help a link whose only device supports 256.
Would you be able to test the series on that server, without
pci=pcie_bus_perf?
[1] https://lore.kernel.org/linux-pci/20261020122854.1500883-5-cassel@kernel.org/
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
2026-11-26 8:37 ` Christoph Hellwig
@ 2026-11-26 9:48 ` Feng Tang
2026-11-27 13:24 ` Feng Tang
1 sibling, 0 replies; 8+ messages in thread
From: Feng Tang @ 2026-11-26 9:48 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Anju Zheng
On Thu, Nov 26, 2026 at 12:37:37AM -0800, Christoph Hellwig wrote:
> On Wed, Nov 25, 2026 at 11:58:29PM +0800, Feng Tang wrote:
> > During stability test, there was a bug that running 'mount' on a type
> > of commercial NVME disk failed on an arm64 server and raised PCIe RAS
> > error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
> > cmdline parameter.
> >
> > The NVME device has MPS(Max Payload Size) capability of 256 bytes while
> > its corresponding root port is capable of 512 bytes. When enabling
> > PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
> > both set to 256, while the root port's are both set to 512. But the
> > NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
>
> Please add a quirk for these devices now that you have identified
> this problem.
Good suggestion! Will work on this.
One naughty point is, during the debug, we have 2 models from the
same vendor, which has the same Vendor ID and Device ID, one is
3.8TB, and the other is 1.9TB. Only the 1.9TB model has this
issue, while the 3.8TB one works fine with "pcie_bus_safe" mode.
'lspci -xvvv' of these 2 models are also almost the same, so there
is no way to tell these 2 models?
Any suggestion? Or we just add the quirks for this VID/DID for safe?
Thanks,
Feng
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
2026-11-26 8:39 ` Niklas Cassel
@ 2026-11-26 11:03 ` Feng Tang
2026-11-26 11:56 ` Niklas Cassel
0 siblings, 1 reply; 8+ messages in thread
From: Feng Tang @ 2026-11-26 11:03 UTC (permalink / raw)
To: Niklas Cassel; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Anju Zheng
Hi Niklas,
On Thu, Nov 26, 2026 at 09:39:44AM +0100, Niklas Cassel wrote:
> On Wed, Nov 25, 2026 at 11:58:29PM +0800, Feng Tang wrote:
> > During stability test, there was a bug that running 'mount' on a type
> > of commercial NVME disk failed on an arm64 server and raised PCIe RAS
> > error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
> > cmdline parameter.
> >
> > The NVME device has MPS(Max Payload Size) capability of 256 bytes while
> > its corresponding root port is capable of 512 bytes. When enabling
> > PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
> > both set to 256, while the root port's are both set to 512. But the
> > NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
>
> I assume that you are using pcie_bus_perf rather than the default strategy,
> because with the default strategy never raises the Root Port above what
> firmware programmed, which may be only 128 bytes.
Right, only the 'pcie_bus_perf' mode can reproducde this issue. The
default mode works just fine.
We reproucded it on one arm64 server and one Intel server, the MPS for
the NVME device and root port are both set to 256 bytes in default mode
(no pcie_bus_perf parameter).
> pcie_bus_perf gives a Root Port its own maximum MPS without looking at
> the devices below it, and relies on MRRS to keep Completions within the
> endpoint's MPS, so a device that ignores its MRRS gets Completions
> larger than its MPS.
>
> My series [1] avoids this without pcie_bus_perf: with the default strategy,
> it sets each Root Port hierarchy to the largest MPS that all of its devices
> support, i.e. 256 bytes for both your Root Port and the NVMe. Since a
> Function must not generate TLPs larger than its own Max_Payload_Size, the
> Root Port then returns Completions of at most 256 bytes, even for the
> 512-byte reads your NVMe issues. The NVMe also gets the same 256-byte
> payloads as with pcie_bus_perf, so nothing is lost by dropping it: the Root
> Port's 512 bytes don't help a link whose only device supports 256.
>
> Would you be able to test the series on that server, without
> pci=pcie_bus_perf?
I can give it a try after the quirk work suggested by Christoph Hellwig.
I haven't read through you patch, one question is, since current kernel
already works fine without 'pci=pcie_bus_perf', what' the intention of
this test?
Thanks,
Feng
> [1] https://lore.kernel.org/linux-pci/20261020122854.1500883-5-cassel@kernel.org/
>
> Kind regards,
> Niklas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
2026-11-26 11:03 ` Feng Tang
@ 2026-11-26 11:56 ` Niklas Cassel
0 siblings, 0 replies; 8+ messages in thread
From: Niklas Cassel @ 2026-11-26 11:56 UTC (permalink / raw)
To: Feng Tang; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, Anju Zheng
On Thu, Nov 26, 2026 at 07:03:19PM +0800, Feng Tang wrote:
> Hi Niklas,
>
> On Thu, Nov 26, 2026 at 09:39:44AM +0100, Niklas Cassel wrote:
> > On Wed, Nov 25, 2026 at 11:58:29PM +0800, Feng Tang wrote:
> > > During stability test, there was a bug that running 'mount' on a type
> > > of commercial NVME disk failed on an arm64 server and raised PCIe RAS
> > > error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
> > > cmdline parameter.
> > >
> > > The NVME device has MPS(Max Payload Size) capability of 256 bytes while
> > > its corresponding root port is capable of 512 bytes. When enabling
> > > PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
> > > both set to 256, while the root port's are both set to 512. But the
> > > NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
> >
> > I assume that you are using pcie_bus_perf rather than the default strategy,
> > because with the default strategy never raises the Root Port above what
> > firmware programmed, which may be only 128 bytes.
>
> Right, only the 'pcie_bus_perf' mode can reproducde this issue. The
> default mode works just fine.
>
> We reproucded it on one arm64 server and one Intel server, the MPS for
> the NVME device and root port are both set to 256 bytes in default mode
> (no pcie_bus_perf parameter).
>
> > pcie_bus_perf gives a Root Port its own maximum MPS without looking at
> > the devices below it, and relies on MRRS to keep Completions within the
> > endpoint's MPS, so a device that ignores its MRRS gets Completions
> > larger than its MPS.
> >
> > My series [1] avoids this without pcie_bus_perf: with the default strategy,
> > it sets each Root Port hierarchy to the largest MPS that all of its devices
> > support, i.e. 256 bytes for both your Root Port and the NVMe. Since a
> > Function must not generate TLPs larger than its own Max_Payload_Size, the
> > Root Port then returns Completions of at most 256 bytes, even for the
> > 512-byte reads your NVMe issues. The NVMe also gets the same 256-byte
> > payloads as with pcie_bus_perf, so nothing is lost by dropping it: the Root
> > Port's 512 bytes don't help a link whose only device supports 256.
> >
> > Would you be able to test the series on that server, without
> > pci=pcie_bus_perf?
>
> I can give it a try after the quirk work suggested by Christoph Hellwig.
>
> I haven't read through you patch, one question is, since current kernel
> already works fine without 'pci=pcie_bus_perf', what' the intention of
> this test?
For this NVMe drive, it won't change anything.
My series matters where the default strategy currently leaves the MPS
lower than what a device and its Root Port support, because it never
raises a Root Port above what firmware programmed. Which is normally
the reason why people use pcie_bus_perf. But unlink my series,
pcie_bus_perf does not reduce the Root Port's MPS to that of the max
supported by the endpoint, after the the MPS has been raised above
what the firmware programmed.
But if you get 256 bytes with the default strategy, which is the limit
of your NVMe device, why are you using pcie_bus_perf?
Perhaps you are using pcie_bus_perf to get a larger MPS for other devices
(other than the NVMe) on these servers. If that is the case, using my
series would allow you to still change to the default policy, and still
get the benefit of pcie_bus_perf (without the downsides of pcie_bus_perf).
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
2026-11-26 8:37 ` Christoph Hellwig
2026-11-26 9:48 ` Feng Tang
@ 2026-11-27 13:24 ` Feng Tang
2026-11-27 13:29 ` Niklas Cassel
1 sibling, 1 reply; 8+ messages in thread
From: Feng Tang @ 2026-11-27 13:24 UTC (permalink / raw)
To: Christoph Hellwig, Bjorn Helgaas
Cc: linux-pci, linux-kernel, Anju Zheng, Niklas Cassel
On Thu, Nov 26, 2026 at 12:37:37AM -0800, Christoph Hellwig wrote:
> On Wed, Nov 25, 2026 at 11:58:29PM +0800, Feng Tang wrote:
> > During stability test, there was a bug that running 'mount' on a type
> > of commercial NVME disk failed on an arm64 server and raised PCIe RAS
> > error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
> > cmdline parameter.
> >
> > The NVME device has MPS(Max Payload Size) capability of 256 bytes while
> > its corresponding root port is capable of 512 bytes. When enabling
> > PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
> > both set to 256, while the root port's are both set to 512. But the
> > NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
>
> Please add a quirk for these devices now that you have identified
> this problem.
Following is a draft patch as suggested, which can solve this issue. Please
help to review, thanks!
- Feng
---
From 829623aa7afa9e2e19a232d3968ef8c282cda3e4 Mon Sep 17 00:00:00 2001
From: Feng Tang <feng.tang@linux.alibaba.com>
Date: Thu, 26 Nov 2026 17:22:59 +0800
Subject: [PATCH] PCI: Quirk devices with broken MRRS function under
PCIE_BUS_PERFORMANCE mode
During stability test with "pci=pcie_bus_perf" cmdline parameter, there
was a bug that running 'mount' on one commercial NVMe disk failed on an
arm64 server, raised PCIe RAS error of "Malformed TLP", and panic the
kernel. The issue can't be reproduced after removing "pci=pcie_bus_perf".
The NVMe device has MPS(Max Payload Size) capability of 256 bytes while
its corresponding root port is capable of 512 bytes. When enabling
PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
both set to 256, while the root port's are both set to 512. But the
NVMe device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
"
Max_Read_Request_Size - This field sets the maximum Read Request size
for the Function as a Requester. The Function must not generate Read
Requests with a size exceeding the set value
"
that it doesn't honor the MRRS setting, and sends out Memory Read request
with length of 512 bytes, and when root port replies CplD packet with 512
bytes payload which exceeds device's MPS, PCIe RAS error is issued.
The problem can be reproduced on some arm64 server and Intel server.
This caused some data damage, and there were quite a few NVMe cards of
the same type damaged (though we are not sure these are directly related).
So add a quirk for this kind of devices which don't honor MRRS part of
PCIe spec, and under PCIE_BUS_PERFORMANCE mode, set their corresponding
root ports' MPS/MRRS to match theirs.
Reported-by: Anju Zheng <zaj01616726@alibaba-inc.com>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Feng Tang <feng.tang@linux.alibaba.com>
---
drivers/pci/probe.c | 24 ++++++++++++++++++++++++
drivers/pci/quirks.c | 21 +++++++++++++++++++++
include/linux/pci.h | 1 +
3 files changed, 46 insertions(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 27008e2ea5af..9d8b2091cc46 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2932,11 +2932,14 @@ static int pcie_find_smpss(struct pci_dev *dev, void *data)
return 0;
}
+static void pcie_write_mrrs(struct pci_dev *dev);
static void pcie_write_mps(struct pci_dev *dev, int mps)
{
int rc;
if (pcie_bus_config == PCIE_BUS_PERFORMANCE) {
+ struct pci_bus *bus;
+
mps = 128 << dev->pcie_mpss;
if (pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT &&
@@ -2956,6 +2959,27 @@ static void pcie_write_mps(struct pci_dev *dev, int mps)
* allowable MPS based on its parent bus).
*/
mps = min(mps, pcie_get_mps(dev->bus->self));
+
+ /*
+ * Quirk for devices that issue Memory Read Requests larger
+ * than their MRRS. "Performance" only guarantees a child's MPS
+ * is <= its parent's, so the corresponding root port may have
+ * bigger MPS than the device. When such a device sends out a
+ * Memory Read request with length > MRRS, and the root port
+ * returns CplD packet with length larger than device's MPS,
+ * "Malformed TLP" AER error or Machine Check Error(x86) could
+ * be triggered. So decrease the root port's MPS/MRRS down to
+ * match device's.
+ */
+ bus = dev->bus;
+ if (dev->broken_mrrs && bus->self &&
+ pci_pcie_type(bus->self) == PCI_EXP_TYPE_ROOT_PORT &&
+ pcie_get_mps(bus->self) > mps) {
+ pci_info(dev, "Device has broken MRRS function, limiting MPS of upstream %s to %d\n",
+ pci_name(bus->self), mps);
+ pcie_set_mps(bus->self, mps);
+ pcie_write_mrrs(bus->self);
+ }
}
rc = pcie_set_mps(dev, mps);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index de9bbccda21f..4560a116ae98 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6423,3 +6423,24 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
#endif
+
+/*
+ * Some commercial NVMe controllers do not honor their Max_Read_Request_Size:
+ * they issue Memory Read Requests larger than the MRRS the kernel programmed
+ * (under pci=pcie_bus_perf the kernel sets MRRS == MPS). In PERFORMANCE mode
+ * the upstream Root Port may be left with a larger MPS than the device, so it
+ * may reply CplD packets with length larger than the device's MPS. The device
+ * then reports them as Malformed TLPs, raising PCIe RAS error or Machine Check
+ * Error(for x86).
+ *
+ * Flag such devices so that later on pcie_write_mps() can force the corresponding
+ * root port's MPS down to match the device, keeping CplD packet length within
+ * the device's MPS.
+ *
+ * This only affects PCIE_BUS_PERFORMANCE mode.
+ */
+static void quirk_broken_mrrs(struct pci_dev *dev)
+{
+ dev->broken_mrrs = 1;
+}
+DECLARE_PCI_FIXUP_HEADER(0x144d, 0xa80a, quirk_broken_mrrs);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d31a8d107b1e..adeafed52ff6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -504,6 +504,7 @@ struct pci_dev {
*/
unsigned int external_facing:1;
unsigned int broken_intx_masking:1; /* INTx masking can't be used */
+ unsigned int broken_mrrs:1; /* Issues read request with length > MRRS */
unsigned int io_window_1k:1; /* Intel bridge 1K I/O windows */
unsigned int irq_managed:1;
unsigned int non_compliant_bars:1; /* Broken BARs; ignore them */
--
2.39.5 (Apple Git-154)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
2026-11-27 13:24 ` Feng Tang
@ 2026-11-27 13:29 ` Niklas Cassel
0 siblings, 0 replies; 8+ messages in thread
From: Niklas Cassel @ 2026-11-27 13:29 UTC (permalink / raw)
To: Feng Tang
Cc: Christoph Hellwig, Bjorn Helgaas, linux-pci, linux-kernel,
Anju Zheng
On Fri, Nov 27, 2026 at 09:24:30PM +0800, Feng Tang wrote:
> @@ -6423,3 +6423,24 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
> #endif
> +
> +/*
> + * Some commercial NVMe controllers do not honor their Max_Read_Request_Size:
> + * they issue Memory Read Requests larger than the MRRS the kernel programmed
> + * (under pci=pcie_bus_perf the kernel sets MRRS == MPS). In PERFORMANCE mode
> + * the upstream Root Port may be left with a larger MPS than the device, so it
> + * may reply CplD packets with length larger than the device's MPS. The device
> + * then reports them as Malformed TLPs, raising PCIe RAS error or Machine Check
> + * Error(for x86).
> + *
> + * Flag such devices so that later on pcie_write_mps() can force the corresponding
> + * root port's MPS down to match the device, keeping CplD packet length within
> + * the device's MPS.
> + *
> + * This only affects PCIE_BUS_PERFORMANCE mode.
> + */
> +static void quirk_broken_mrrs(struct pci_dev *dev)
> +{
> + dev->broken_mrrs = 1;
> +}
> +DECLARE_PCI_FIXUP_HEADER(0x144d, 0xa80a, quirk_broken_mrrs);
Please use PCI_VENDOR_ID_SAMSUNG instead of magic value 0x144d.
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-11-27 13:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 15:58 [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode Feng Tang
2026-11-26 8:37 ` Christoph Hellwig
2026-11-26 9:48 ` Feng Tang
2026-11-27 13:24 ` Feng Tang
2026-11-27 13:29 ` Niklas Cassel
2026-11-26 8:39 ` Niklas Cassel
2026-11-26 11:03 ` Feng Tang
2026-11-26 11:56 ` Niklas Cassel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox