* [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse
@ 2026-02-02 14:54 Koichiro Den
2026-02-02 14:54 ` [PATCH v2 1/2] PCI: dwc: ep: Return after clearing BAR-match inbound mapping Koichiro Den
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Koichiro Den @ 2026-02-02 14:54 UTC (permalink / raw)
To: mani, cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li
Cc: linux-pci, linux-doc, linux-kernel
Hi,
This patch series is a follow-up to a side discussion that started from
Niklas' comment at:
https://lore.kernel.org/all/aXtrW7viGZfMNZur@ryzen/
This series:
1) Makes BAR Match vs Address Match teardown in DesignWare EP explicit
by returning right after clearing a BAR-match inbound mapping.
2) Fixes the dw_pcie_ep_set_bar() mapping-update path to run
dw_pcie_ep_clear_ib_maps() unconditionally, since the driver cannot
reliably distinguish BAR Match -> BAR Match from Address Match ->
BAR Match transitions when the same epf_bar instance is updated in
place and passed in again.
Base: controller/dwc branch, latest:
commit a24149881558 ("PCI: dwc: ep: Add comment explaining controller level
PTM access in multi PF setup")
Changes since v1:
- Switched from the v1 approach (Y) to the alternative approach (X)
that was proposed earlier in the discussion.
Details of the v1 (Y) vs v2 (X) are described at:
https://lore.kernel.org/all/sextbnbmsur2xjfoun2l4lr5vekmpzae7sx6or2ird44t6ud6d@yprcz43tpq4p/
- Changed the subject.
v1: https://lore.kernel.org/all/20260131133655.218018-1-den@valinux.co.jp/
Thanks,
Koichiro Den (2):
PCI: dwc: ep: Return after clearing BAR-match inbound mapping
PCI: dwc: ep: Always clear IB maps on BAR update
drivers/pci/controller/dwc/pcie-designware-ep.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/2] PCI: dwc: ep: Return after clearing BAR-match inbound mapping
2026-02-02 14:54 [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
@ 2026-02-02 14:54 ` Koichiro Den
2026-02-02 15:29 ` Niklas Cassel
2026-02-02 14:54 ` [PATCH v2 2/2] PCI: dwc: ep: Always clear IB maps on BAR update Koichiro Den
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Koichiro Den @ 2026-02-02 14:54 UTC (permalink / raw)
To: mani, cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li
Cc: linux-pci, linux-doc, linux-kernel
dw_pcie_ep_clear_ib_maps() first checks whether the inbound mapping for
a BAR is in BAR Match Mode (tracked via ep_func->bar_to_atu[bar]). Once
found, the iATU region is disabled and the bookkeeping is cleared.
BAR Match Mode and Address Match Mode mappings are mutually exclusive
for a given BAR, so there is nothing left for the Address Match Mode
teardown path to do after the BAR Match Mode mapping has been removed.
Return early after clearing the BAR Match Mode mapping to avoid running
the Address Match Mode teardown path. This makes the helper's intention
explicit and helps detect incorrect use of pci_epc_set_bar().
Suggested-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
---
drivers/pci/controller/dwc/pcie-designware-ep.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 7e7844ff0f7e..0ca05943a1e5 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -165,6 +165,7 @@ static void dw_pcie_ep_clear_ib_maps(struct dw_pcie_ep *ep, u8 func_no, enum pci
dw_pcie_disable_atu(pci, PCIE_ATU_REGION_DIR_IB, atu_index);
clear_bit(atu_index, ep->ib_window_map);
ep_func->bar_to_atu[bar] = 0;
+ return;
}
/* Tear down all Address Match Mode mappings, if any. */
--
2.51.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/2] PCI: dwc: ep: Always clear IB maps on BAR update
2026-02-02 14:54 [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
2026-02-02 14:54 ` [PATCH v2 1/2] PCI: dwc: ep: Return after clearing BAR-match inbound mapping Koichiro Den
@ 2026-02-02 14:54 ` Koichiro Den
2026-02-02 15:34 ` Niklas Cassel
2026-02-09 5:40 ` [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
2026-02-19 19:43 ` Bjorn Helgaas
3 siblings, 1 reply; 11+ messages in thread
From: Koichiro Den @ 2026-02-02 14:54 UTC (permalink / raw)
To: mani, cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li
Cc: linux-pci, linux-doc, linux-kernel
dw_pcie_ep_set_bar() currently tears down existing inbound mappings only
when either the previous or the new struct pci_epf_bar uses submaps
(num_submap != 0). If both the old and new mappings are BAR Match Mode,
reprogramming the same ATU index is sufficient, so no explicit teardown
was needed.
However, some callers may reuse the same struct pci_epf_bar instance and
update it in place before calling set_bar() again. In that case
ep_func->epf_bar[bar] and the passed-in epf_bar can point to the same
object, so we cannot reliably distinguish BAR Match Mode -> BAR Match Mode
from Address Match Mode -> BAR Match Mode. As a result, the conditional
teardown based on num_submap becomes unreliable and existing inbound maps
may be left active.
Call dw_pcie_ep_clear_ib_maps() unconditionally before reprogramming the
BAR so that in-place updates are handled correctly.
This introduces a behavioral change in a corner case: if a BAR
reprogramming attempt fails (especially for the long-standing BAR Match
Mode -> BAR Match Mode update case), the previously programmed inbound
mapping will already have been torn down. This should be acceptable,
since the caller observes the error and should not use the BAR for any
real transactions in that case.
While at it, document that the existing update parameter check is
best-effort for in-place updates.
Fixes: cc839bef7727 ("PCI: dwc: ep: Support BAR subrange inbound mapping via Address Match Mode iATU")
Signed-off-by: Koichiro Den <den@valinux.co.jp>
---
drivers/pci/controller/dwc/pcie-designware-ep.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 0ca05943a1e5..295076cf70de 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -519,6 +519,12 @@ static int dw_pcie_ep_set_bar(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
/*
* We can only dynamically change a BAR if the new BAR size and
* BAR flags do not differ from the existing configuration.
+ *
+ * Note: this safety check only works when the caller uses
+ * a new struct pci_epf_bar in the second set_bar() call.
+ * If the same instance is updated in place and passed in,
+ * we cannot reliably detect invalid barno/size/flags
+ * changes here.
*/
if (ep_func->epf_bar[bar]->barno != bar ||
ep_func->epf_bar[bar]->size != size ||
@@ -527,10 +533,12 @@ static int dw_pcie_ep_set_bar(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
/*
* When dynamically changing a BAR, tear down any existing
- * mappings before re-programming.
+ * mappings before re-programming. This is redundant when
+ * both the old and new mappings are BAR Match Mode, but
+ * required to handle in-place updates and match-mode
+ * changes reliably.
*/
- if (ep_func->epf_bar[bar]->num_submap || epf_bar->num_submap)
- dw_pcie_ep_clear_ib_maps(ep, func_no, bar);
+ dw_pcie_ep_clear_ib_maps(ep, func_no, bar);
/*
* When dynamically changing a BAR, skip writing the BAR reg, as
--
2.51.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] PCI: dwc: ep: Return after clearing BAR-match inbound mapping
2026-02-02 14:54 ` [PATCH v2 1/2] PCI: dwc: ep: Return after clearing BAR-match inbound mapping Koichiro Den
@ 2026-02-02 15:29 ` Niklas Cassel
0 siblings, 0 replies; 11+ messages in thread
From: Niklas Cassel @ 2026-02-02 15:29 UTC (permalink / raw)
To: Koichiro Den
Cc: mani, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li, linux-pci, linux-doc, linux-kernel
On Mon, Feb 02, 2026 at 11:54:06PM +0900, Koichiro Den wrote:
> dw_pcie_ep_clear_ib_maps() first checks whether the inbound mapping for
> a BAR is in BAR Match Mode (tracked via ep_func->bar_to_atu[bar]). Once
> found, the iATU region is disabled and the bookkeeping is cleared.
>
> BAR Match Mode and Address Match Mode mappings are mutually exclusive
> for a given BAR, so there is nothing left for the Address Match Mode
> teardown path to do after the BAR Match Mode mapping has been removed.
>
> Return early after clearing the BAR Match Mode mapping to avoid running
> the Address Match Mode teardown path. This makes the helper's intention
> explicit and helps detect incorrect use of pci_epc_set_bar().
>
> Suggested-by: Niklas Cassel <cassel@kernel.org>
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---
Reviewed-by: Niklas Cassel <cassel@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] PCI: dwc: ep: Always clear IB maps on BAR update
2026-02-02 14:54 ` [PATCH v2 2/2] PCI: dwc: ep: Always clear IB maps on BAR update Koichiro Den
@ 2026-02-02 15:34 ` Niklas Cassel
0 siblings, 0 replies; 11+ messages in thread
From: Niklas Cassel @ 2026-02-02 15:34 UTC (permalink / raw)
To: Koichiro Den
Cc: mani, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li, linux-pci, linux-doc, linux-kernel
On Mon, Feb 02, 2026 at 11:54:07PM +0900, Koichiro Den wrote:
> dw_pcie_ep_set_bar() currently tears down existing inbound mappings only
> when either the previous or the new struct pci_epf_bar uses submaps
> (num_submap != 0). If both the old and new mappings are BAR Match Mode,
> reprogramming the same ATU index is sufficient, so no explicit teardown
> was needed.
>
> However, some callers may reuse the same struct pci_epf_bar instance and
> update it in place before calling set_bar() again. In that case
> ep_func->epf_bar[bar] and the passed-in epf_bar can point to the same
> object, so we cannot reliably distinguish BAR Match Mode -> BAR Match Mode
> from Address Match Mode -> BAR Match Mode. As a result, the conditional
> teardown based on num_submap becomes unreliable and existing inbound maps
> may be left active.
>
> Call dw_pcie_ep_clear_ib_maps() unconditionally before reprogramming the
> BAR so that in-place updates are handled correctly.
>
> This introduces a behavioral change in a corner case: if a BAR
> reprogramming attempt fails (especially for the long-standing BAR Match
> Mode -> BAR Match Mode update case), the previously programmed inbound
> mapping will already have been torn down. This should be acceptable,
> since the caller observes the error and should not use the BAR for any
> real transactions in that case.
>
> While at it, document that the existing update parameter check is
> best-effort for in-place updates.
>
> Fixes: cc839bef7727 ("PCI: dwc: ep: Support BAR subrange inbound mapping via Address Match Mode iATU")
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---
Reviewed-by: Niklas Cassel <cassel@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse
2026-02-02 14:54 [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
2026-02-02 14:54 ` [PATCH v2 1/2] PCI: dwc: ep: Return after clearing BAR-match inbound mapping Koichiro Den
2026-02-02 14:54 ` [PATCH v2 2/2] PCI: dwc: ep: Always clear IB maps on BAR update Koichiro Den
@ 2026-02-09 5:40 ` Koichiro Den
2026-02-09 11:35 ` Manivannan Sadhasivam
2026-02-19 19:43 ` Bjorn Helgaas
3 siblings, 1 reply; 11+ messages in thread
From: Koichiro Den @ 2026-02-09 5:40 UTC (permalink / raw)
To: mani, cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li
Cc: linux-pci, linux-doc, linux-kernel
On Mon, Feb 02, 2026 at 11:54:05PM +0900, Koichiro Den wrote:
> Hi,
>
> This patch series is a follow-up to a side discussion that started from
> Niklas' comment at:
> https://lore.kernel.org/all/aXtrW7viGZfMNZur@ryzen/
>
> This series:
> 1) Makes BAR Match vs Address Match teardown in DesignWare EP explicit
> by returning right after clearing a BAR-match inbound mapping.
> 2) Fixes the dw_pcie_ep_set_bar() mapping-update path to run
> dw_pcie_ep_clear_ib_maps() unconditionally, since the driver cannot
> reliably distinguish BAR Match -> BAR Match from Address Match ->
> BAR Match transitions when the same epf_bar instance is updated in
> place and passed in again.
>
> Base: controller/dwc branch, latest:
> commit a24149881558 ("PCI: dwc: ep: Add comment explaining controller level
> PTM access in multi PF setup")
>
> Changes since v1:
> - Switched from the v1 approach (Y) to the alternative approach (X)
> that was proposed earlier in the discussion.
> Details of the v1 (Y) vs v2 (X) are described at:
> https://lore.kernel.org/all/sextbnbmsur2xjfoun2l4lr5vekmpzae7sx6or2ird44t6ud6d@yprcz43tpq4p/
> - Changed the subject.
>
> v1: https://lore.kernel.org/all/20260131133655.218018-1-den@valinux.co.jp/
>
> Thanks,
Hi Mani,
Just following up on this series.
If this looks fine to you, would you mind picking it up when you have a
chance?
(Niklas has also commented here: https://lore.kernel.org/all/aYSZxCtACmQyC0XT@ryzen/)
Kind regards,
Koichiro
>
>
> Koichiro Den (2):
> PCI: dwc: ep: Return after clearing BAR-match inbound mapping
> PCI: dwc: ep: Always clear IB maps on BAR update
>
> drivers/pci/controller/dwc/pcie-designware-ep.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> --
> 2.51.0
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse
2026-02-09 5:40 ` [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
@ 2026-02-09 11:35 ` Manivannan Sadhasivam
2026-02-09 12:56 ` Koichiro Den
0 siblings, 1 reply; 11+ messages in thread
From: Manivannan Sadhasivam @ 2026-02-09 11:35 UTC (permalink / raw)
To: Koichiro Den
Cc: cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li, linux-pci, linux-doc, linux-kernel
On Mon, Feb 09, 2026 at 02:40:13PM +0900, Koichiro Den wrote:
> On Mon, Feb 02, 2026 at 11:54:05PM +0900, Koichiro Den wrote:
> > Hi,
> >
> > This patch series is a follow-up to a side discussion that started from
> > Niklas' comment at:
> > https://lore.kernel.org/all/aXtrW7viGZfMNZur@ryzen/
> >
> > This series:
> > 1) Makes BAR Match vs Address Match teardown in DesignWare EP explicit
> > by returning right after clearing a BAR-match inbound mapping.
> > 2) Fixes the dw_pcie_ep_set_bar() mapping-update path to run
> > dw_pcie_ep_clear_ib_maps() unconditionally, since the driver cannot
> > reliably distinguish BAR Match -> BAR Match from Address Match ->
> > BAR Match transitions when the same epf_bar instance is updated in
> > place and passed in again.
> >
> > Base: controller/dwc branch, latest:
> > commit a24149881558 ("PCI: dwc: ep: Add comment explaining controller level
> > PTM access in multi PF setup")
> >
> > Changes since v1:
> > - Switched from the v1 approach (Y) to the alternative approach (X)
> > that was proposed earlier in the discussion.
> > Details of the v1 (Y) vs v2 (X) are described at:
> > https://lore.kernel.org/all/sextbnbmsur2xjfoun2l4lr5vekmpzae7sx6or2ird44t6ud6d@yprcz43tpq4p/
> > - Changed the subject.
> >
> > v1: https://lore.kernel.org/all/20260131133655.218018-1-den@valinux.co.jp/
> >
> > Thanks,
>
> Hi Mani,
>
> Just following up on this series.
> If this looks fine to you, would you mind picking it up when you have a
> chance?
> (Niklas has also commented here: https://lore.kernel.org/all/aYSZxCtACmQyC0XT@ryzen/)
>
Sorry, I cannot get this series for 7.0 as it is too late. I'll try to get it
early once 7.0-rc1 is released.
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse
2026-02-09 11:35 ` Manivannan Sadhasivam
@ 2026-02-09 12:56 ` Koichiro Den
0 siblings, 0 replies; 11+ messages in thread
From: Koichiro Den @ 2026-02-09 12:56 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li, linux-pci, linux-doc, linux-kernel
On Mon, Feb 09, 2026 at 05:05:28PM +0530, Manivannan Sadhasivam wrote:
> On Mon, Feb 09, 2026 at 02:40:13PM +0900, Koichiro Den wrote:
> > On Mon, Feb 02, 2026 at 11:54:05PM +0900, Koichiro Den wrote:
> > > Hi,
> > >
> > > This patch series is a follow-up to a side discussion that started from
> > > Niklas' comment at:
> > > https://lore.kernel.org/all/aXtrW7viGZfMNZur@ryzen/
> > >
> > > This series:
> > > 1) Makes BAR Match vs Address Match teardown in DesignWare EP explicit
> > > by returning right after clearing a BAR-match inbound mapping.
> > > 2) Fixes the dw_pcie_ep_set_bar() mapping-update path to run
> > > dw_pcie_ep_clear_ib_maps() unconditionally, since the driver cannot
> > > reliably distinguish BAR Match -> BAR Match from Address Match ->
> > > BAR Match transitions when the same epf_bar instance is updated in
> > > place and passed in again.
> > >
> > > Base: controller/dwc branch, latest:
> > > commit a24149881558 ("PCI: dwc: ep: Add comment explaining controller level
> > > PTM access in multi PF setup")
> > >
> > > Changes since v1:
> > > - Switched from the v1 approach (Y) to the alternative approach (X)
> > > that was proposed earlier in the discussion.
> > > Details of the v1 (Y) vs v2 (X) are described at:
> > > https://lore.kernel.org/all/sextbnbmsur2xjfoun2l4lr5vekmpzae7sx6or2ird44t6ud6d@yprcz43tpq4p/
> > > - Changed the subject.
> > >
> > > v1: https://lore.kernel.org/all/20260131133655.218018-1-den@valinux.co.jp/
> > >
> > > Thanks,
> >
> > Hi Mani,
> >
> > Just following up on this series.
> > If this looks fine to you, would you mind picking it up when you have a
> > chance?
> > (Niklas has also commented here: https://lore.kernel.org/all/aYSZxCtACmQyC0XT@ryzen/)
> >
>
> Sorry, I cannot get this series for 7.0 as it is too late. I'll try to get it
> early once 7.0-rc1 is released.
Thanks for letting me know. That's totally fine by me.
Koichiro
>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse
2026-02-02 14:54 [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
` (2 preceding siblings ...)
2026-02-09 5:40 ` [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
@ 2026-02-19 19:43 ` Bjorn Helgaas
2026-02-20 3:42 ` Koichiro Den
2026-02-20 16:02 ` Niklas Cassel
3 siblings, 2 replies; 11+ messages in thread
From: Bjorn Helgaas @ 2026-02-19 19:43 UTC (permalink / raw)
To: Koichiro Den
Cc: mani, cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li, linux-pci, linux-doc, linux-kernel
On Mon, Feb 02, 2026 at 11:54:05PM +0900, Koichiro Den wrote:
> Hi,
>
> This patch series is a follow-up to a side discussion that started from
> Niklas' comment at:
> https://lore.kernel.org/all/aXtrW7viGZfMNZur@ryzen/
>
> This series:
> 1) Makes BAR Match vs Address Match teardown in DesignWare EP explicit
> by returning right after clearing a BAR-match inbound mapping.
> 2) Fixes the dw_pcie_ep_set_bar() mapping-update path to run
> dw_pcie_ep_clear_ib_maps() unconditionally, since the driver cannot
> reliably distinguish BAR Match -> BAR Match from Address Match ->
> BAR Match transitions when the same epf_bar instance is updated in
> place and passed in again.
>
> Base: controller/dwc branch, latest:
> commit a24149881558 ("PCI: dwc: ep: Add comment explaining controller level
> PTM access in multi PF setup")
>
> Changes since v1:
> - Switched from the v1 approach (Y) to the alternative approach (X)
> that was proposed earlier in the discussion.
> Details of the v1 (Y) vs v2 (X) are described at:
> https://lore.kernel.org/all/sextbnbmsur2xjfoun2l4lr5vekmpzae7sx6or2ird44t6ud6d@yprcz43tpq4p/
> - Changed the subject.
>
> v1: https://lore.kernel.org/all/20260131133655.218018-1-den@valinux.co.jp/
>
> Thanks,
>
>
> Koichiro Den (2):
> PCI: dwc: ep: Return after clearing BAR-match inbound mapping
> PCI: dwc: ep: Always clear IB maps on BAR update
>
> drivers/pci/controller/dwc/pcie-designware-ep.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
Since this fixes an issue with the new inbound submapping feature
we merged for v7.0, I put both of these on pci/for-linus for v7.0.
Thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse
2026-02-19 19:43 ` Bjorn Helgaas
@ 2026-02-20 3:42 ` Koichiro Den
2026-02-20 16:02 ` Niklas Cassel
1 sibling, 0 replies; 11+ messages in thread
From: Koichiro Den @ 2026-02-20 3:42 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: mani, cassel, kwilczynski, kishon, bhelgaas, corbet, jingoohan1,
lpieralisi, robh, Frank.Li, linux-pci, linux-doc, linux-kernel
On Thu, Feb 19, 2026 at 01:43:56PM -0600, Bjorn Helgaas wrote:
> On Mon, Feb 02, 2026 at 11:54:05PM +0900, Koichiro Den wrote:
> > Hi,
> >
> > This patch series is a follow-up to a side discussion that started from
> > Niklas' comment at:
> > https://lore.kernel.org/all/aXtrW7viGZfMNZur@ryzen/
> >
> > This series:
> > 1) Makes BAR Match vs Address Match teardown in DesignWare EP explicit
> > by returning right after clearing a BAR-match inbound mapping.
> > 2) Fixes the dw_pcie_ep_set_bar() mapping-update path to run
> > dw_pcie_ep_clear_ib_maps() unconditionally, since the driver cannot
> > reliably distinguish BAR Match -> BAR Match from Address Match ->
> > BAR Match transitions when the same epf_bar instance is updated in
> > place and passed in again.
> >
> > Base: controller/dwc branch, latest:
> > commit a24149881558 ("PCI: dwc: ep: Add comment explaining controller level
> > PTM access in multi PF setup")
> >
> > Changes since v1:
> > - Switched from the v1 approach (Y) to the alternative approach (X)
> > that was proposed earlier in the discussion.
> > Details of the v1 (Y) vs v2 (X) are described at:
> > https://lore.kernel.org/all/sextbnbmsur2xjfoun2l4lr5vekmpzae7sx6or2ird44t6ud6d@yprcz43tpq4p/
> > - Changed the subject.
> >
> > v1: https://lore.kernel.org/all/20260131133655.218018-1-den@valinux.co.jp/
> >
> > Thanks,
> >
> >
> > Koichiro Den (2):
> > PCI: dwc: ep: Return after clearing BAR-match inbound mapping
> > PCI: dwc: ep: Always clear IB maps on BAR update
> >
> > drivers/pci/controller/dwc/pcie-designware-ep.c | 15 ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
>
> Since this fixes an issue with the new inbound submapping feature
> we merged for v7.0, I put both of these on pci/for-linus for v7.0.
>
> Thanks!
Thanks for picking this up, Bjorn.
Best regards,
Koichiro
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse
2026-02-19 19:43 ` Bjorn Helgaas
2026-02-20 3:42 ` Koichiro Den
@ 2026-02-20 16:02 ` Niklas Cassel
1 sibling, 0 replies; 11+ messages in thread
From: Niklas Cassel @ 2026-02-20 16:02 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Koichiro Den, mani, kwilczynski, kishon, bhelgaas, corbet,
jingoohan1, lpieralisi, robh, Frank.Li, linux-pci, linux-doc,
linux-kernel
On Thu, Feb 19, 2026 at 01:43:56PM -0600, Bjorn Helgaas wrote:
> On Mon, Feb 02, 2026 at 11:54:05PM +0900, Koichiro Den wrote:
> > Hi,
> >
> > This patch series is a follow-up to a side discussion that started from
> > Niklas' comment at:
> > https://lore.kernel.org/all/aXtrW7viGZfMNZur@ryzen/
> >
> > This series:
> > 1) Makes BAR Match vs Address Match teardown in DesignWare EP explicit
> > by returning right after clearing a BAR-match inbound mapping.
> > 2) Fixes the dw_pcie_ep_set_bar() mapping-update path to run
> > dw_pcie_ep_clear_ib_maps() unconditionally, since the driver cannot
> > reliably distinguish BAR Match -> BAR Match from Address Match ->
> > BAR Match transitions when the same epf_bar instance is updated in
> > place and passed in again.
> >
> > Base: controller/dwc branch, latest:
> > commit a24149881558 ("PCI: dwc: ep: Add comment explaining controller level
> > PTM access in multi PF setup")
> >
> > Changes since v1:
> > - Switched from the v1 approach (Y) to the alternative approach (X)
> > that was proposed earlier in the discussion.
> > Details of the v1 (Y) vs v2 (X) are described at:
> > https://lore.kernel.org/all/sextbnbmsur2xjfoun2l4lr5vekmpzae7sx6or2ird44t6ud6d@yprcz43tpq4p/
> > - Changed the subject.
> >
> > v1: https://lore.kernel.org/all/20260131133655.218018-1-den@valinux.co.jp/
> >
> > Thanks,
> >
> >
> > Koichiro Den (2):
> > PCI: dwc: ep: Return after clearing BAR-match inbound mapping
> > PCI: dwc: ep: Always clear IB maps on BAR update
> >
> > drivers/pci/controller/dwc/pcie-designware-ep.c | 15 ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
>
> Since this fixes an issue with the new inbound submapping feature
> we merged for v7.0, I put both of these on pci/for-linus for v7.0.
Thank you Bjorn!
If possible, I please consider sending these to Linus as well:
https://patchwork.kernel.org/project/linux-pci/patch/20260210181225.3926165-2-cassel@kernel.org/
The Fixes tag:
Fixes: 8719c64e76bf ("PCI: dwc: ep: Cache MSI outbound iATU mapping")
references a commit that was included in v7.0 merge window, so it would be
nice to have the above fix patch in v7.0.
This is fixing the same problem as 8719c64e76bf ("PCI: dwc: ep: Cache MSI
outbound iATU mapping") fixed for dw_pcie_ep_raise_msi_irq():
https://patchwork.kernel.org/project/linux-pci/patch/20260211175540.105677-2-cassel@kernel.org/
Mani has marked this commit as "Awaiting Upstream", I'm guessing he plans
to queue it for v7.1 ?
If not to much trouble, I think it would be nice to have in v7.0 as well,
so we have both functional dw_pcie_ep_raise_msi_irq() and
dw_pcie_ep_raise_msix_irq() in v7.0.
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-02-20 16:02 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02 14:54 [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
2026-02-02 14:54 ` [PATCH v2 1/2] PCI: dwc: ep: Return after clearing BAR-match inbound mapping Koichiro Den
2026-02-02 15:29 ` Niklas Cassel
2026-02-02 14:54 ` [PATCH v2 2/2] PCI: dwc: ep: Always clear IB maps on BAR update Koichiro Den
2026-02-02 15:34 ` Niklas Cassel
2026-02-09 5:40 ` [PATCH v2 0/2] PCI: dwc: ep: Fix BAR update handling with in-place epf_bar reuse Koichiro Den
2026-02-09 11:35 ` Manivannan Sadhasivam
2026-02-09 12:56 ` Koichiro Den
2026-02-19 19:43 ` Bjorn Helgaas
2026-02-20 3:42 ` Koichiro Den
2026-02-20 16:02 ` Niklas Cassel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox