2022-04-12 22:22:50

by Pali Rohár

[permalink] [raw]
Subject: [PATCH v5 0/4] PCI: mvebu: Slot support

This patch series add slot support to pci-mvebu.c driver.

Changes in v5:
* Fix compile error due to wrong patch rebasing

Changes in v4:
* Set 239 W when DT slot-power-limit-milliwatt is between 239 W and 250 W
* Fix returning power limit value

Changes in v3:
* Set 600 W when DT slot-power-limit-milliwatt > 600 W

Changes in v2:
* Dropped patch with PCI_EXP_SLTCAP_*_SHIFT macros as it is not needed anymore
* Dropped patch "ARM: dts: turris-omnia: Set PCIe slot-power-limit-milliwatt properties" which was applied
* Added support for PCIe 6.0 slot power limit encodings
* Round down slot power limit value
* Fix handling of slot power limit with scale x1.0 (0x00 value)
* Use FIELD_PREP instead of _SHIFT macros
* Changed commit message to Bjorn's suggestion
* Changed comments in the code to match PCIe spec
* Preserve user settings of PCI_EXP_SLTCTL_ASPL_DISABLE bit

Pali Rohár (4):
PCI: Add PCI_EXP_SLTCTL_ASPL_DISABLE macro
dt-bindings: Add 'slot-power-limit-milliwatt' PCIe port property
PCI: Add function for parsing 'slot-power-limit-milliwatt' DT property
PCI: mvebu: Add support for sending Set_Slot_Power_Limit message

Documentation/devicetree/bindings/pci/pci.txt | 6 ++
drivers/pci/controller/pci-mvebu.c | 97 ++++++++++++++++++-
drivers/pci/of.c | 70 +++++++++++++
drivers/pci/pci.h | 15 +++
include/uapi/linux/pci_regs.h | 1 +
5 files changed, 184 insertions(+), 5 deletions(-)

--
2.20.1


2022-04-13 00:00:05

by Pali Rohár

[permalink] [raw]
Subject: [PATCH v5 1/4] PCI: Add PCI_EXP_SLTCTL_ASPL_DISABLE macro

Add macro defining Auto Slot Power Limit Disable bit in Slot Control
Register.

Signed-off-by: Pali Rohár <[email protected]>
Signed-off-by: Marek Behún <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
---
include/uapi/linux/pci_regs.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index bee1a9ed6e66..108f8523fa04 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -616,6 +616,7 @@
#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */
#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */
+#define PCI_EXP_SLTCTL_ASPL_DISABLE 0x2000 /* Auto Slot Power Limit Disable */
#define PCI_EXP_SLTCTL_IBPD_DISABLE 0x4000 /* In-band PD disable */
#define PCI_EXP_SLTSTA 0x1a /* Slot Status */
#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */
--
2.20.1

2022-04-25 13:04:53

by Lorenzo Pieralisi

[permalink] [raw]
Subject: Re: (subset) [PATCH v5 0/4] PCI: mvebu: Slot support

On Tue, 12 Apr 2022 11:49:42 +0200, Pali Rohár wrote:
> This patch series add slot support to pci-mvebu.c driver.
>
> Changes in v5:
> * Fix compile error due to wrong patch rebasing
>
> Changes in v4:
> * Set 239 W when DT slot-power-limit-milliwatt is between 239 W and 250 W
> * Fix returning power limit value
>
> [...]

Dropped patch [2] since it is not needed.

Applied to pci/power-slot, thanks!

[1/4] PCI: Add PCI_EXP_SLTCTL_ASPL_DISABLE macro
https://git.kernel.org/lpieralisi/pci/c/e8e7fbb6a3
[3/4] PCI: Add function for parsing 'slot-power-limit-milliwatt' DT property
https://git.kernel.org/lpieralisi/pci/c/35662423fb
[4/4] PCI: mvebu: Add support for sending Set_Slot_Power_Limit message
https://git.kernel.org/lpieralisi/pci/c/0d5b8c2985

Thanks,
Lorenzo