* [PATCH v4 0/7] minor PCI endpoint cleanups
@ 2024-03-20 11:31 Niklas Cassel
2024-03-20 11:31 ` [PATCH v4 7/7] PCI: rockchip-ep: Set a 64-bit BAR if requested Niklas Cassel
2024-05-17 11:12 ` [PATCH v4 0/7] minor PCI endpoint cleanups Krzysztof Wilczyński
0 siblings, 2 replies; 3+ messages in thread
From: Niklas Cassel @ 2024-03-20 11:31 UTC (permalink / raw)
To: Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, Shawn Lin,
Heiko Stuebner, Kishon Vijay Abraham I
Cc: Shradha Todi, Damien Le Moal, Niklas Cassel, linux-pci,
linux-rockchip, linux-arm-kernel
Hello all,
This series used to be called:
"PCI: endpoint: set prefetchable bit for 64-bit BARs"
However, since after discussions with Arnd and Mani, that patch has been
dropped, however, the other cleanups are still worth including IMO, thus
the series has been renamed.
Changes since v3:
-Picked up tags from Mani.
-Fixed minor comments from Mani.
-Dropped patch [PATCH v3 1/9] PCI: endpoint: pci-epf-test: Fix incorrect
loop increment.
-Dropped patch [PATCH v3 9/9] PCI: endpoint: Set prefetch when allocating
memory for 64-bit BARs.
-Reordered some of the patches to have a more logical ordering.
Niklas Cassel (7):
PCI: endpoint: pci-epf-test: Simplify pci_epf_test_alloc_space() loop
PCI: endpoint: Allocate a 64-bit BAR if that is the only option
PCI: endpoint: pci-epf-test: Remove superfluous code
PCI: endpoint: pci-epf-test: Simplify pci_epf_test_set_bar() loop
PCI: endpoint: pci-epf-test: Clean up pci_epf_test_unbind()
PCI: cadence: Set a 64-bit BAR if requested
PCI: rockchip-ep: Set a 64-bit BAR if requested
.../pci/controller/cadence/pcie-cadence-ep.c | 5 +-
drivers/pci/controller/pcie-rockchip-ep.c | 2 +-
drivers/pci/endpoint/functions/pci-epf-test.c | 62 +++++--------------
drivers/pci/endpoint/pci-epf-core.c | 9 ++-
4 files changed, 23 insertions(+), 55 deletions(-)
--
2.44.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v4 7/7] PCI: rockchip-ep: Set a 64-bit BAR if requested
2024-03-20 11:31 [PATCH v4 0/7] minor PCI endpoint cleanups Niklas Cassel
@ 2024-03-20 11:31 ` Niklas Cassel
2024-05-17 11:12 ` [PATCH v4 0/7] minor PCI endpoint cleanups Krzysztof Wilczyński
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Cassel @ 2024-03-20 11:31 UTC (permalink / raw)
To: Manivannan Sadhasivam, Shawn Lin, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Heiko Stuebner
Cc: Shradha Todi, Damien Le Moal, Niklas Cassel, linux-pci,
linux-rockchip, linux-arm-kernel
Ever since commit f25b5fae29d4 ("PCI: endpoint: Setting a BAR size > 4 GB
is invalid if 64-bit flag is not set") it has been impossible to get the
.set_bar() callback with a BAR size > 2 GB (yes, 2GB!), if the BAR was
also not requested to be configured as a 64-bit BAR.
It is however possible that an EPF driver configures a BAR as 64-bit,
even if the requested size is < 4 GB.
Respect the requested BAR configuration, just like how it is already
repected with regards to the prefetchable bit.
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/controller/pcie-rockchip-ep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
index c9046e97a1d2..57472cf48997 100644
--- a/drivers/pci/controller/pcie-rockchip-ep.c
+++ b/drivers/pci/controller/pcie-rockchip-ep.c
@@ -153,7 +153,7 @@ static int rockchip_pcie_ep_set_bar(struct pci_epc *epc, u8 fn, u8 vfn,
ctrl = ROCKCHIP_PCIE_CORE_BAR_CFG_CTRL_IO_32BITS;
} else {
bool is_prefetch = !!(flags & PCI_BASE_ADDRESS_MEM_PREFETCH);
- bool is_64bits = sz > SZ_2G;
+ bool is_64bits = !!(flags & PCI_BASE_ADDRESS_MEM_TYPE_64);
if (is_64bits && (bar & 1))
return -EINVAL;
--
2.44.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v4 0/7] minor PCI endpoint cleanups
2024-03-20 11:31 [PATCH v4 0/7] minor PCI endpoint cleanups Niklas Cassel
2024-03-20 11:31 ` [PATCH v4 7/7] PCI: rockchip-ep: Set a 64-bit BAR if requested Niklas Cassel
@ 2024-05-17 11:12 ` Krzysztof Wilczyński
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2024-05-17 11:12 UTC (permalink / raw)
To: Niklas Cassel
Cc: Manivannan Sadhasivam, Lorenzo Pieralisi, Rob Herring,
Bjorn Helgaas, Shawn Lin, Heiko Stuebner, Kishon Vijay Abraham I,
Shradha Todi, Damien Le Moal, linux-pci, linux-rockchip,
linux-arm-kernel
Hello,
> This series used to be called:
> "PCI: endpoint: set prefetchable bit for 64-bit BARs"
>
> However, since after discussions with Arnd and Mani, that patch has been
> dropped, however, the other cleanups are still worth including IMO, thus
> the series has been renamed.
[...]
> PCI: endpoint: pci-epf-test: Simplify pci_epf_test_alloc_space() loop
> PCI: endpoint: Allocate a 64-bit BAR if that is the only option
> PCI: endpoint: pci-epf-test: Remove superfluous code
> PCI: endpoint: pci-epf-test: Simplify pci_epf_test_set_bar() loop
> PCI: endpoint: pci-epf-test: Clean up pci_epf_test_unbind()
Applied to endpoint, thank you!
[01/05] PCI: endpoint: pci-epf-test: Simplify pci_epf_test_alloc_space() loop
https://git.kernel.org/pci/pci/c/417660525d6f
[02/05] PCI: endpoint: Allocate a 64-bit BAR if that is the only option
https://git.kernel.org/pci/pci/c/29a025b6fbf3
[03/05] PCI: endpoint: pci-epf-test: Remove superfluous code
https://git.kernel.org/pci/pci/c/828e870431aa
[04/05] PCI: endpoint: pci-epf-test: Simplify pci_epf_test_set_bar() loop
https://git.kernel.org/pci/pci/c/e49eab944cfb
[05/05] PCI: endpoint: pci-epf-test: Clean up pci_epf_test_unbind()
https://git.kernel.org/pci/pci/c/597ac0fa37b8
> PCI: cadence: Set a 64-bit BAR if requested
Applied to controller/cadence, thank you!
[1/1] PCI: cadence: Set a 64-bit BAR if requested
https://git.kernel.org/pci/pci/c/07db0fa80cf3
> PCI: rockchip-ep: Set a 64-bit BAR if requested
Applied to controller/rockchip, thank you!
[1/1] PCI: rockchip-ep: Set a 64-bit BAR if requested
https://git.kernel.org/pci/pci/c/de66b37a174f
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-17 11:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20 11:31 [PATCH v4 0/7] minor PCI endpoint cleanups Niklas Cassel
2024-03-20 11:31 ` [PATCH v4 7/7] PCI: rockchip-ep: Set a 64-bit BAR if requested Niklas Cassel
2024-05-17 11:12 ` [PATCH v4 0/7] minor PCI endpoint cleanups Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).