PCI: layerscape: use default error response behavior
Subsystems (5)
PATCH 1/1 PCI: layerscape: use default error response behavior
From: Jeff Barnes <[email protected]>
The Layerscape PCIe driver programs PCIE_ABSERR to forward errors from outbound non-posted requests to the internal AXI interface.
A PCI configuration access can race with the link going down after dw_pcie_other_conf_map_bus() checks the link but before the MMIO access is performed. When the resulting Completion Timeout is forwarded to AXI, it causes an asynchronous SError and kernel panic.
For example:
Kernel panic - not syncing: Asynchronous SError Interrupt ... Call trace: arm64_serror_panic+0x78/0x90 do_serror+0x84/0x90 el1h_64_error_handler+0x30/0x40 el1h_64_error+0x68/0x70 pci_generic_config_read+0x64/0xb0 dw_pcie_rd_other_conf+0x1c/0x68 pci_bus_read_config_word+0x68/0x118 pcie_capability_read_word+0xa8/0xd8 find_device_iter+0x8c/0x160 pci_walk_bus+0x60/0xb8 find_source_device+0x78/0xb0 aer_isr+0x1dc/0x230
Restore the controller's default error response behavior instead of forwarding these errors to AXI.
Reproduce the race by instrumenting dw_pcie_rd_other_conf() to call map_bus() while the link is up, then schedule a worker on another CPU to set PCI_EXP_LNKCTL_LD. Synchronize the CPUs immediately before the Link Disable DBI write, then perform readl() using the address returned by map_bus() concurrently with the link transition.
Without this change, the overlapping configuration read results in an asynchronous SError and kernel panic. With this change, the same test returns 0xffffffff from the configuration read. In this test, AER reports a non-fatal Completion Timeout, and no SError or kernel panic occurs.
This effectively reverts the error response behavior introduced by commit 84d897d69938
("PCI: layerscape: Change default error response behavior").
--- drivers/pci/controller/dwc/pci-layerscape.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/pci/controller/dwc/pci-layerscape.c +0 -12
@@ -28,8 +28,6 @@/* PEX Internal Configuration Registers */ #define PCIE_STRFMR1 0x71c/* Symbol Timer & Filter Mask Register1 */ -#define PCIE_ABSERR 0x8d0/* Bridge Slave Error Response Register */ -#define PCIE_ABSERR_SETTING 0x9401/* Forward error of non-posted request */ /* PF Message Command Register */ #define LS_PCIE_PF_MCR 0x2c
@@ -103,14 +101,6 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)iowrite32 (val, pci->dbi_base +PCIE_STRFMR1 ); } -/* Forward error response of outbound non-posted requests */ -static void ls_pcie_fix_error_response (struct ls_pcie *pcie) -{ -struct dw_pcie *pci = pcie->pci; - -iowrite32 (PCIE_ABSERR_SETTING , pci->dbi_base +PCIE_ABSERR ); -} -static u32 ls_pcie_pf_lut_readl (struct ls_pcie *pcie,u32 off) {if (pcie->big_endian)
@@ -180,8 +170,6 @@ static int ls_pcie_host_init(struct dw_pcie_rp *pp)struct dw_pcie *pci =to_dw_pcie_from_pp (pp);struct ls_pcie *pcie =to_ls_pcie (pci); -ls_pcie_fix_error_response (pcie); -dw_pcie_dbi_ro_wr_en (pci);ls_pcie_clear_multifunction (pcie);dw_pcie_dbi_ro_wr_dis (pci);
Signature · 1 line
2.43.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 15 lines
From: Jeff Barnes <[email protected]>
The Layerscape PCIe driver programs
PCIE_ABSERRto forward errors from outbound non-posted requests to the internal AXI interface.A PCI configuration access can race with the link going down after
dw_pcie_other_conf_map_bus()checks the link but before the MMIO access is performed. When the resulting Completion Timeout is forwarded to AXI, it causes an asynchronous SError and kernel panic.For example:
Kernel panic - not syncing: Asynchronous SError Interrupt ... Call trace:
Quoted 6 lines
[ ... ]
("PCI: layerscape: Change default error response behavior").Fixes 84d897d69938 ("PCI: layerscape: Change default error response behavior")Signed-off-by Jeff Barnes <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 45 lines · On Tue, Sep 29, 2026 at 03:43:39PM -0400, [email protected] wrote:
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
From: Jeff Barnes <[email protected]>
The Layerscape PCIe driver programs
PCIE_ABSERRto forward errors from outbound non-posted requests to the internal AXI interface.A PCI configuration access can race with the link going down after
dw_pcie_other_conf_map_bus()checks the link but before the MMIO access is performed. When the resulting Completion Timeout is forwarded to AXI, it causes an asynchronous SError and kernel panic.For example:
Kernel panic - not syncing: Asynchronous SError Interrupt ... Call trace: arm64_serror_panic+0x78/0x90 do_serror+0x84/0x90 el1h_64_error_handler+0x30/0x40 el1h_64_error+0x68/0x70 pci_generic_config_read+0x64/0xb0 dw_pcie_rd_other_conf+0x1c/0x68 pci_bus_read_config_word+0x68/0x118 pcie_capability_read_word+0xa8/0xd8 find_device_iter+0x8c/0x160 pci_walk_bus+0x60/0xb8 find_source_device+0x78/0xb0 aer_isr+0x1dc/0x230Restore the controller's default error response behavior instead of forwarding these errors to AXI.
Reproduce the race by instrumenting
dw_pcie_rd_other_conf()to callmap_bus()while the link is up, then schedule a worker on another CPU to setPCI_EXP_LNKCTL_LD. Synchronize the CPUs immediately before the Link Disable DBI write, then performreadl()using the address returned bymap_bus()concurrently with the link transition.Without this change, the overlapping configuration read results in an asynchronous SError and kernel panic. With this change, the same test returns
0xfffffffffrom the configuration read. In this test, AER reports a non-fatal Completion Timeout, and no SError or kernel panic occurs.
Quoted 3 lines
This effectively reverts the error response behavior introduced by commit
84d897d69938
("PCI: layerscape: Change default error response behavior").
Subject should be revert ...
I am not sure what's expect behavior by other dwc PCI controller. returns 0xfffffffff or report bus error.
Frank
Quoted 49 lines
Fixes 84d897d69938 ("PCI: layerscape: Change default error response behavior")Signed-off-by Jeff Barnes <[email protected]>--- drivers/pci/controller/dwc/pci-layerscape.c | 12 ------------ 1 file changed, 12 deletions(-)drivers/pci/controller/dwc/pci-layerscape.c +0
-13@@ -28,8 +28,6 @@/* PEX Internal Configuration Registers */ #define PCIE_STRFMR1 0x71c/* Symbol Timer & Filter Mask Register1 */ -#define PCIE_ABSERR 0x8d0/* Bridge Slave Error Response Register */ -#define PCIE_ABSERR_SETTING 0x9401/* Forward error of non-posted request */ /* PF Message Command Register */ #define LS_PCIE_PF_MCR 0x2c@@ -103,14 +101,6 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)iowrite32 (val, pci->dbi_base +PCIE_STRFMR1 ); } -/* Forward error response of outbound non-posted requests */ -static void ls_pcie_fix_error_response (struct ls_pcie *pcie) -{ -struct dw_pcie *pci = pcie->pci; - -iowrite32 (PCIE_ABSERR_SETTING , pci->dbi_base +PCIE_ABSERR ); -} -static u32 ls_pcie_pf_lut_readl (struct ls_pcie *pcie,u32 off) {if (pcie->big_endian)@@ -180,8 +170,6 @@ static int ls_pcie_host_init(struct dw_pcie_rp *pp)struct dw_pcie *pci =to_dw_pcie_from_pp (pp);struct ls_pcie *pcie =to_ls_pcie (pci); -ls_pcie_fix_error_response (pcie); -dw_pcie_dbi_ro_wr_en (pci);ls_pcie_clear_multifunction (pcie);dw_pcie_dbi_ro_wr_dis (pci); --2.43.0
Quoted 53 lines · Frank Li
Quoted 47 lines · On Tue, Sep 29, 2026 at 03:43:39PM -0400, [email protected] wrote:
[You don't often get email from [email protected]. Learn why this is important at
https://aka.ms/LearnAboutSenderIdentification ]From: Jeff Barnes <[email protected]>
The Layerscape PCIe driver programs
PCIE_ABSERRto forward errors from outbound non-posted requests to the internal AXI interface.A PCI configuration access can race with the link going down after
dw_pcie_other_conf_map_bus()checks the link but before the MMIO access is performed. When the resulting Completion Timeout is forwarded to AXI, it causes an asynchronous SError and kernel panic.For example:
Kernel panic - not syncing: Asynchronous SError Interrupt ... Call trace: arm64_serror_panic+0x78/0x90 do_serror+0x84/0x90 el1h_64_error_handler+0x30/0x40 el1h_64_error+0x68/0x70 pci_generic_config_read+0x64/0xb0 dw_pcie_rd_other_conf+0x1c/0x68 pci_bus_read_config_word+0x68/0x118 pcie_capability_read_word+0xa8/0xd8 find_device_iter+0x8c/0x160 pci_walk_bus+0x60/0xb8 find_source_device+0x78/0xb0 aer_isr+0x1dc/0x230Restore the controller's default error response behavior instead of forwarding these errors to AXI.
Reproduce the race by instrumenting
dw_pcie_rd_other_conf()to callmap_bus()while the link is up, then schedule a worker on another CPU to setPCI_EXP_LNKCTL_LD. Synchronize the CPUs immediately before the Link Disable DBI write, then performreadl()using the address returned bymap_bus()concurrently with the link transition.Without this change, the overlapping configuration read results in an asynchronous SError and kernel panic. With this change, the same test returns
0xfffffffffrom the configuration read. In this test, AER reports a non-fatal Completion Timeout, and no SError or kernel panic occurs.Quoted 3 lines
This effectively reverts the error response behavior introduced by commit
84d897d69938
("PCI: layerscape: Change default error response behavior").
Quoted 6 lines
Subject should be revert ...
I am not sure what's expect behavior by other dwc PCI controller. returns
0xfffffffffor report bus error.Frank
Thanks, Frank.
Agreed on the subject. This is mechanically a revert of 84d897d69938, so I'll change the subject to:
Revert "PCI: layerscape: Change default error response behavior"
Regarding the expected behavior on other DWC controllers, I don't have hardware available to test those implementations, so I don't want to speculate.
What I have verified on Layerscape is that with PCIE_ABSERR programmed, the failed configuration access is forwarded to AXI and results in an asynchronous SError and kernel panic. With the controller's default response, the identical injected race returns 0xffffffff and the kernel survives.
Please let me know if you think the behavior of other DWC implementations needs to be established before proceeding with this revert.
Thanks, Jeff
Quoted 54 lines
Quoted 53 lines
Fixes 84d897d69938 ("PCI: layerscape: Change default error response behavior")Signed-off-by Jeff Barnes <[email protected]>--- drivers/pci/controller/dwc/pci-layerscape.c | 12 ------------ 1 file changed, 12 deletions(-)drivers/pci/controller/dwc/pci-layerscape.c +0
-0@@ -28,8 +28,6 @@/* PEX Internal Configuration Registers */ #define PCIE_STRFMR1 0x71c/* Symbol Timer & Filter Mask Register1 */
-#definePCIE_ABSERR0x8d0/* Bridge Slave Error Response
Register */
-#definePCIE_ABSERR_SETTING0x9401/* Forward error of non-posted
request *//* PF Message Command Register */
#defineLS_PCIE_PF_MCR0x2cdrivers/pci/controller/dwc/pci-layerscape.c +0
-11@@ -103,14 +101,6 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)iowrite32 (val, pci->dbi_base +PCIE_STRFMR1 ); } -/* Forward error response of outbound non-posted requests */ -static void ls_pcie_fix_error_response (struct ls_pcie *pcie) -{ -struct dw_pcie *pci = pcie->pci; - -iowrite32 (PCIE_ABSERR_SETTING , pci->dbi_base +PCIE_ABSERR ); -} -static u32 ls_pcie_pf_lut_readl (struct ls_pcie *pcie,u32 off) {if (pcie->big_endian)@@ -180,8 +170,6 @@ static int ls_pcie_host_init(struct dw_pcie_rp *pp)struct dw_pcie *pci =to_dw_pcie_from_pp (pp);struct ls_pcie *pcie =to_ls_pcie (pci); -ls_pcie_fix_error_response (pcie); -dw_pcie_dbi_ro_wr_en (pci);ls_pcie_clear_multifunction (pcie);dw_pcie_dbi_ro_wr_dis (pci); --2.43.0
PATCH v2 1/1 Revert "PCI: layerscape: Change default error response behavior"
This reverts commit 84d897d69938
("PCI: layerscape: Change default error response behavior").
The Layerscape PCIe driver programs the DesignWare AMBA_ERROR_RESPONSE_DEFAULT register at offset 0x8d0 with 0x9401.
For AXI, the documented default with AMBA_ERROR_RESPONSE_GLOBAL cleared returns OKAY with all-ones data for errors on non-posted requests. Setting AMBA_ERROR_RESPONSE_GLOBAL causes an AXI error response instead, with AMBA_ERROR_RESPONSE_MAP selecting SLVERR or DECERR for individual PCIe completion errors.
The value 0x9401 sets AMBA_ERROR_RESPONSE_GLOBAL and maps Unsupported Request, Completer Abort, and Completion Timeout to SLVERR.
A PCI configuration access can race with the link going down after dw_pcie_other_conf_map_bus() checks the link but before pci_generic_config_read() performs the MMIO access. If the transaction results in a Completion Timeout, the Layerscape error response setting propagates it to AXI as SLVERR, resulting in an asynchronous SError and kernel panic.
Reproduce the race by obtaining the configuration-space mapping while the link is up, then disabling the link from another CPU immediately before performing the MMIO configuration read.
With the error response override enabled, the overlapping configuration read results in an asynchronous SError and kernel panic. With the DesignWare default behavior restored, the same test returns 0xffffffff. AER reports a non-fatal Completion Timeout, and no SError or kernel panic occurs.
Restore the documented DesignWare default error response behavior so a failed non-posted PCIe transaction does not become a fatal AXI error.
Changes in v2:
- Change the subject to identify this as a revert, as requested by Frank Li.
- Document the DesignWare AMBA_ERROR_RESPONSE_DEFAULT behavior and decode the 0x9401 setting used by Layerscape.
- Clarify that the setting propagates Completion Timeout as AXI SLVERR rather than causing the underlying PCIe transaction failure.
--- drivers/pci/controller/dwc/pci-layerscape.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/pci/controller/dwc/pci-layerscape.c +0 -12
@@ -28,8 +28,6 @@/* PEX Internal Configuration Registers */ #define PCIE_STRFMR1 0x71c/* Symbol Timer & Filter Mask Register1 */ -#define PCIE_ABSERR 0x8d0/* Bridge Slave Error Response Register */ -#define PCIE_ABSERR_SETTING 0x9401/* Forward error of non-posted request */ /* PF Message Command Register */ #define LS_PCIE_PF_MCR 0x2c
@@ -103,14 +101,6 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)iowrite32 (val, pci->dbi_base +PCIE_STRFMR1 ); } -/* Forward error response of outbound non-posted requests */ -static void ls_pcie_fix_error_response (struct ls_pcie *pcie) -{ -struct dw_pcie *pci = pcie->pci; - -iowrite32 (PCIE_ABSERR_SETTING , pci->dbi_base +PCIE_ABSERR ); -} -static u32 ls_pcie_pf_lut_readl (struct ls_pcie *pcie,u32 off) {if (pcie->big_endian)
@@ -180,8 +170,6 @@ static int ls_pcie_host_init(struct dw_pcie_rp *pp)struct dw_pcie *pci =to_dw_pcie_from_pp (pp);struct ls_pcie *pcie =to_ls_pcie (pci); -ls_pcie_fix_error_response (pcie); -dw_pcie_dbi_ro_wr_en (pci);ls_pcie_clear_multifunction (pcie);dw_pcie_dbi_ro_wr_dis (pci);
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v2] Revert "PCI: layerscape: Change default error response behavior"
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 15 lines
This reverts commit
84d897d69938
("PCI: layerscape: Change default error response behavior").The Layerscape PCIe driver programs the DesignWare
AMBA_ERROR_RESPONSE_DEFAULTregister at offset0x8d0with0x9401.For AXI, the documented default with
AMBA_ERROR_RESPONSE_GLOBALcleared returns OKAY with all-ones data for errors on non-posted requests. SettingAMBA_ERROR_RESPONSE_GLOBALcauses an AXI error response instead, withAMBA_ERROR_RESPONSE_MAPselecting SLVERR or DECERR for individual PCIe completion errors.The value
0x9401setsAMBA_ERROR_RESPONSE_GLOBALand maps Unsupported Request, Completer Abort, and Completion Timeout to SLVERR.
Quoted 6 lines
[ ... ]
failed non-posted PCIe transaction does not become a fatal AXI error.Fixes 84d897d69938 ("PCI: layerscape: Change default error response behavior")Signed-off-by Jeff Barnes <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH v2] Revert "PCI: layerscape: Change default error response behavior"
In reply to Jeff BarnesQuoted 34 lines · Jeff Barnes
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
This reverts commit
84d897d69938
("PCI: layerscape: Change default error response behavior").The Layerscape PCIe driver programs the DesignWare
AMBA_ERROR_RESPONSE_DEFAULTregister at offset0x8d0with0x9401.For AXI, the documented default with
AMBA_ERROR_RESPONSE_GLOBALcleared returns OKAY with all-ones data for errors on non-posted requests. SettingAMBA_ERROR_RESPONSE_GLOBALcauses an AXI error response instead, withAMBA_ERROR_RESPONSE_MAPselecting SLVERR or DECERR for individual PCIe completion errors.The value
0x9401setsAMBA_ERROR_RESPONSE_GLOBALand maps Unsupported Request, Completer Abort, and Completion Timeout to SLVERR.A PCI configuration access can race with the link going down after
dw_pcie_other_conf_map_bus()checks the link but beforepci_generic_config_read()performs the MMIO access. If the transaction results in a Completion Timeout, the Layerscape error response setting propagates it to AXI as SLVERR, resulting in an asynchronous SError and kernel panic.Reproduce the race by obtaining the configuration-space mapping while the link is up, then disabling the link from another CPU immediately before performing the MMIO configuration read.
With the error response override enabled, the overlapping configuration read results in an asynchronous SError and kernel panic. With the DesignWare default behavior restored, the same test returns
0xffffffff. AER reports a non-fatal Completion Timeout, and no SError or kernel panic occurs.
Quoted 7 lines
Restore the documented DesignWare default error response behavior so a failed non-posted PCIe transaction does not become a fatal AXI error.
Fixes 84d897d69938 ("PCI: layerscape: Change default error response behavior")Signed-off-by Jeff Barnes <[email protected]>
---
should be here, maintainer should can handle this for you.
Quoted 52 lines
Changes in v2:
- Change the subject to identify this as a revert, as requested by Frank Li.
- Document the DesignWareAMBA_ERROR_RESPONSE_DEFAULTbehavior and decode the0x9401setting used by Layerscape.
- Clarify that the setting propagates Completion Timeout as AXI SLVERR rather than causing the underlying PCIe transaction failure.--- drivers/pci/controller/dwc/pci-layerscape.c | 12 ------------ 1 file changed, 12 deletions(-)drivers/pci/controller/dwc/pci-layerscape.c +0
-13@@ -28,8 +28,6 @@/* PEX Internal Configuration Registers */ #define PCIE_STRFMR1 0x71c/* Symbol Timer & Filter Mask Register1 */ -#define PCIE_ABSERR 0x8d0/* Bridge Slave Error Response Register */ -#define PCIE_ABSERR_SETTING 0x9401/* Forward error of non-posted request */ /* PF Message Command Register */ #define LS_PCIE_PF_MCR 0x2c@@ -103,14 +101,6 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)iowrite32 (val, pci->dbi_base +PCIE_STRFMR1 ); } -/* Forward error response of outbound non-posted requests */ -static void ls_pcie_fix_error_response (struct ls_pcie *pcie) -{ -struct dw_pcie *pci = pcie->pci; - -iowrite32 (PCIE_ABSERR_SETTING , pci->dbi_base +PCIE_ABSERR ); -} -static u32 ls_pcie_pf_lut_readl (struct ls_pcie *pcie,u32 off) {if (pcie->big_endian)@@ -180,8 +170,6 @@ static int ls_pcie_host_init(struct dw_pcie_rp *pp)struct dw_pcie *pci =to_dw_pcie_from_pp (pp);struct ls_pcie *pcie =to_ls_pcie (pci); -ls_pcie_fix_error_response (pcie); -dw_pcie_dbi_ro_wr_en (pci);ls_pcie_clear_multifunction (pcie);dw_pcie_dbi_ro_wr_dis (pci); --2.43.0
Re: [PATCH v2] Revert "PCI: layerscape: Change default error response behavior"
Quoted 38 lines · Frank Li
Quoted 37 lines · Jeff Barnes
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
This reverts commit
84d897d69938
("PCI: layerscape: Change default error response behavior").The Layerscape PCIe driver programs the DesignWare
AMBA_ERROR_RESPONSE_DEFAULTregister at offset0x8d0with0x9401.For AXI, the documented default with
AMBA_ERROR_RESPONSE_GLOBALcleared returns OKAY with all-ones data for errors on non-posted requests. SettingAMBA_ERROR_RESPONSE_GLOBALcauses an AXI error response instead, withAMBA_ERROR_RESPONSE_MAPselecting SLVERR or DECERR for individual PCIe completion errors.The value
0x9401setsAMBA_ERROR_RESPONSE_GLOBALand maps Unsupported Request, Completer Abort, and Completion Timeout to SLVERR.A PCI configuration access can race with the link going down after
dw_pcie_other_conf_map_bus()checks the link but beforepci_generic_config_read()performs the MMIO access. If the transaction results in a Completion Timeout, the Layerscape error response setting propagates it to AXI as SLVERR, resulting in an asynchronous SError and kernel panic.Reproduce the race by obtaining the configuration-space mapping while the link is up, then disabling the link from another CPU immediately before performing the MMIO configuration read.
With the error response override enabled, the overlapping configuration read results in an asynchronous SError and kernel panic. With the DesignWare default behavior restored, the same test returns
0xffffffff. AER reports a non-fatal Completion Timeout, and no SError or kernel panic occurs.Restore the documented DesignWare default error response behavior so a failed non-posted PCIe transaction does not become a fatal AXI error.
Quoted 8 lines
Quoted 4 lines
Fixes 84d897d69938 ("PCI: layerscape: Change default error response behavior")Signed-off-by Jeff Barnes <[email protected]>---
should be here, maintainer should can handle this for you.
And avoid post new version at old thread, which will confuse patchwork and other CI tools.
Quoted 56 lines
Reviewed-by Frank Li <[email protected]>.Quoted 52 lines
Changes in v2:
- Change the subject to identify this as a revert, as requested by Frank Li.
- Document the DesignWareAMBA_ERROR_RESPONSE_DEFAULTbehavior and decode the0x9401setting used by Layerscape.
- Clarify that the setting propagates Completion Timeout as AXI SLVERR rather than causing the underlying PCIe transaction failure.--- drivers/pci/controller/dwc/pci-layerscape.c | 12 ------------ 1 file changed, 12 deletions(-)drivers/pci/controller/dwc/pci-layerscape.c +0
-13@@ -28,8 +28,6 @@/* PEX Internal Configuration Registers */ #define PCIE_STRFMR1 0x71c/* Symbol Timer & Filter Mask Register1 */ -#define PCIE_ABSERR 0x8d0/* Bridge Slave Error Response Register */ -#define PCIE_ABSERR_SETTING 0x9401/* Forward error of non-posted request */ /* PF Message Command Register */ #define LS_PCIE_PF_MCR 0x2c@@ -103,14 +101,6 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)iowrite32 (val, pci->dbi_base +PCIE_STRFMR1 ); } -/* Forward error response of outbound non-posted requests */ -static void ls_pcie_fix_error_response (struct ls_pcie *pcie) -{ -struct dw_pcie *pci = pcie->pci; - -iowrite32 (PCIE_ABSERR_SETTING , pci->dbi_base +PCIE_ABSERR ); -} -static u32 ls_pcie_pf_lut_readl (struct ls_pcie *pcie,u32 off) {if (pcie->big_endian)@@ -180,8 +170,6 @@ static int ls_pcie_host_init(struct dw_pcie_rp *pp)struct dw_pcie *pci =to_dw_pcie_from_pp (pp);struct ls_pcie *pcie =to_ls_pcie (pci); -ls_pcie_fix_error_response (pcie); -dw_pcie_dbi_ro_wr_en (pci);ls_pcie_clear_multifunction (pcie);dw_pcie_dbi_ro_wr_dis (pci); --2.43.0
Re: [PATCH v2] Revert "PCI: layerscape: Change default error response behavior"
In reply to Jeff BarnesHi,
Gentle ping on this fix. Please let me know if any additional changes or testing are needed.
Thanks,
Jeff
PATCH v2 1/1 Revert "PCI: layerscape: Change default error response behavior"
In reply to Jeff BarnesQuoted 15 lines
This reverts commit
84d897d69938
("PCI: layerscape: Change default error response behavior").The Layerscape PCIe driver programs the DesignWare
AMBA_ERROR_RESPONSE_DEFAULTregister at offset0x8d0with0x9401.For AXI, the documented default with
AMBA_ERROR_RESPONSE_GLOBALcleared returns OKAY with all-ones data for errors on non-posted requests. SettingAMBA_ERROR_RESPONSE_GLOBALcauses an AXI error response instead, withAMBA_ERROR_RESPONSE_MAPselecting SLVERR or DECERR for individual PCIe completion errors.The value
0x9401setsAMBA_ERROR_RESPONSE_GLOBALand maps Unsupported Request, Completer Abort, and Completion Timeout to SLVERR.
Quoted 7 lines
A PCI configuration access can race with the link going down after
dw_pcie_other_conf_map_bus()checks the link but beforepci_generic_config_read()performs the MMIO access. If the transaction results in a Completion Timeout, the Layerscape error response setting propagates it to AXI as SLVERR, resulting in an asynchronous SError and kernel panic.
Could you bring back the kernel panic backtrace from v1?
With that,
Quoted 28 lines
Reproduce the race by obtaining the configuration-space mapping while the link is up, then disabling the link from another CPU immediately before performing the MMIO configuration read.
With the error response override enabled, the overlapping configuration read results in an asynchronous SError and kernel panic. With the DesignWare default behavior restored, the same test returns
0xffffffff. AER reports a non-fatal Completion Timeout, and no SError or kernel panic occurs.Restore the documented DesignWare default error response behavior so a failed non-posted PCIe transaction does not become a fatal AXI error.
Fixes 84d897d69938 ("PCI: layerscape: Change default error response behavior")Signed-off-by Jeff Barnes <[email protected]>Changes in v2:
- Change the subject to identify this as a revert, as requested by Frank Li.
- Document the DesignWareAMBA_ERROR_RESPONSE_DEFAULTbehavior and decode the0x9401setting used by Layerscape.
- Clarify that the setting propagates Completion Timeout as AXI SLVERR rather than causing the underlying PCIe transaction failure.---
drivers/pci/controller/dwc/pci-layerscape.c| 12 ------------1 file changed, 12 deletions(-)