Re: [PATCH v2 03/13] PCI/ASPM: Disable ASPM when driver requests it

2023-10-16 Thread Ilpo Järvinen
On Fri, 13 Oct 2023, Bjorn Helgaas wrote: > On Thu, Oct 12, 2023 at 01:56:16PM +0300, Ilpo Järvinen wrote: > > On Wed, 11 Oct 2023, Bjorn Helgaas wrote: > > > On Mon, Sep 18, 2023 at 04:10:53PM +0300, Ilpo Järvinen wrote: > > > > PCI core/ASPM service driver allows

Re: [PATCH v2 05/13] PCI/ASPM: Add pci_enable_link_state()

2023-10-16 Thread Ilpo Järvinen
On Fri, 13 Oct 2023, Bjorn Helgaas wrote: > On Thu, Oct 12, 2023 at 03:53:39PM +0300, Ilpo Järvinen wrote: > > On Wed, 11 Oct 2023, Bjorn Helgaas wrote: > > > On Mon, Sep 18, 2023 at 04:10:55PM +0300, Ilpo Järvinen wrote: > > > > pci_disable_link_state() lacks a sym

[PATCH v2 03/13] PCI/ASPM: Disable ASPM when driver requests it

2023-09-18 Thread Ilpo Järvinen
5yhbzx3wgu-j1agpbxb_t9bis2erhvkkfmtdvza...@mail.gmail.com/ Link: https://lore.kernel.org/all/20230511131441.45704-1-ilpo.jarvi...@linux.intel.com/ Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/Makefile | 1 + drivers/pci/pcie/aspm.c | 33 ++--- drivers/pci/pcie/aspm_mini

[PATCH v2 04/13] PCI/ASPM: Move L0S/L1/sub states mask calculation into a helper

2023-09-18 Thread Ilpo Järvinen
ASPM service driver does the same L0S / L1S / sub states allowed calculation in __pci_disable_link_state() and pci_set_default_link_state(). Create a helper to calculate the mask for the allowed states. Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/aspm.c | 33

[PATCH v2 05/13] PCI/ASPM: Add pci_enable_link_state()

2023-09-18 Thread Ilpo Järvinen
pci_enable_link_state() to remove ASPM states from the state disable mask. Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/aspm.c | 42 + include/linux/pci.h | 2 ++ 2 files changed, 44 insertions(+) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c

[PATCH v2 10/13] wifi: ath11k: Use pci_disable/enable_link_state()

2023-09-18 Thread Ilpo Järvinen
the ASPM state management. Signed-off-by: Ilpo Järvinen --- drivers/net/wireless/ath/ath11k/pci.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index a5aa1857ec14..764cdf74b0e9 100644

[PATCH v2 11/13] wifi: ath12k: Use pci_disable/enable_link_state()

2023-09-18 Thread Ilpo Järvinen
the ASPM state management. Signed-off-by: Ilpo Järvinen --- drivers/net/wireless/ath/ath12k/pci.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index fae5dfd6e9d7..9401f62476be 100644

[PATCH v2 01/13] PCI/ASPM: Rename pci_enable_link_state() to pci_set_default_link_state()

2023-09-18 Thread Ilpo Järvinen
pairs symmetrically with pci_disable_link_state() can be added later. Signed-off-by: Ilpo Järvinen --- drivers/pci/controller/vmd.c | 2 +- drivers/pci/pcie/aspm.c | 8 include/linux/pci.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pc

[PATCH v2 00/13] PCI/ASPM: Make ASPM in core robust and remove driver workarounds

2023-09-18 Thread Ilpo Järvinen
and drop the workarounds. v2: - Rebased the series - Reorder patches (rename patch first) Ilpo Järvinen (13): PCI/ASPM: Rename pci_enable_link_state() to pci_set_default_link_state() PCI/ASPM: Improve pci_set_default_link_state() kerneldoc PCI/ASPM: Disable ASPM when driver requests

[PATCH v2 02/13] PCI/ASPM: Improve pci_set_default_link_state() kerneldoc

2023-09-18 Thread Ilpo Järvinen
Improve pci_set_default_link_state() documentation: - Note the link state may get changed if the default policy is in use - Better follow kerneldoc formatting guidelines (separate description block and return entries) Signed-off-by: Ilpo Järvinen --- drivers/pci/pcie/aspm.c | 16

[PATCH v2 06/13] Bluetooth: hci_bcm4377: Convert aspm disable to quirk

2023-09-18 Thread Ilpo Järvinen
ASPM. Signed-off-by: Ilpo Järvinen --- drivers/bluetooth/hci_bcm4377.c | 20 drivers/pci/quirks.c| 3 +++ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index 19ad0e788646

[PATCH v2 07/13] mt76: Remove unreliable pci_disable_link_state() workaround

2023-09-18 Thread Ilpo Järvinen
() directly. Signed-off-by: Ilpo Järvinen --- It's a bit unclear which of these devices really need ASPM disabled. Probably all 76xx given the commit messages that added their disabling but 79xx seems a lot more uncertain and handwavy. mt7915 was done without observing any issue in commit

[PATCH v2 12/13] RDMA/hfi1: Use pci_disable/enable_link_state()

2023-09-18 Thread Ilpo Järvinen
the ASPM state management. Remove the functions that handled the ASPM changes that are now unnecessary. Signed-off-by: Ilpo Järvinen Reviewed-by: Dean Luick --- drivers/infiniband/hw/hfi1/aspm.c | 38 +++ drivers/infiniband/hw/hfi1/pcie.c | 2 +- 2 files changed, 4

[PATCH v2 13/13] misc: rtsx: Use pci_disable/enable_link_state()

2023-09-18 Thread Ilpo Järvinen
state management. Signed-off-by: Ilpo Järvinen --- drivers/misc/cardreader/rts5228.c | 6 ++ drivers/misc/cardreader/rts5261.c | 6 ++ drivers/misc/cardreader/rtsx_pcr.c | 8 +--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/misc/cardreader/rts5228.c b

[PATCH v2 08/13] e1000e: Remove unreliable pci_disable_link_state{,_locked}() workaround

2023-09-18 Thread Ilpo Järvinen
call the functions directly. Signed-off-by: Ilpo Järvinen --- drivers/net/ethernet/intel/e1000e/netdev.c | 77 +- 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index

[PATCH v2 09/13] wifi: ath10k: Use pci_disable/enable_link_state()

2023-09-18 Thread Ilpo Järvinen
the ASPM state management. Signed-off-by: Ilpo Järvinen --- drivers/net/wireless/ath/ath10k/pci.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 23f366221939..64f7133ce122 100644

Re: [PATCH v2 04/13] PCI/ASPM: Move L0S/L1/sub states mask calculation into a helper

2023-10-12 Thread Ilpo Järvinen
On Wed, 11 Oct 2023, Bjorn Helgaas wrote: > On Mon, Sep 18, 2023 at 04:10:54PM +0300, Ilpo Järvinen wrote: > > ASPM service driver does the same L0S / L1S / sub states allowed > > calculation in __pci_disable_link_state() and > > pci_set_default_link_state(). > > I

Re: [PATCH v2 03/13] PCI/ASPM: Disable ASPM when driver requests it

2023-10-12 Thread Ilpo Järvinen
On Wed, 11 Oct 2023, Bjorn Helgaas wrote: > On Mon, Sep 18, 2023 at 04:10:53PM +0300, Ilpo Järvinen wrote: > > PCI core/ASPM service driver allows controlling ASPM state through > > pci_disable_link_state() and pci_enable_link_state() API. It was > > decided earlie

Re: [PATCH v2 03/13] PCI/ASPM: Disable ASPM when driver requests it

2023-10-12 Thread Ilpo Järvinen
On Wed, 11 Oct 2023, Bjorn Helgaas wrote: > On Mon, Sep 18, 2023 at 04:10:53PM +0300, Ilpo Järvinen wrote: > > PCI core/ASPM service driver allows controlling ASPM state through > > pci_disable_link_state() and pci_enable_link_state() API. It was > > decided earlie

Re: [PATCH v2 05/13] PCI/ASPM: Add pci_enable_link_state()

2023-10-12 Thread Ilpo Järvinen
On Wed, 11 Oct 2023, Bjorn Helgaas wrote: > On Mon, Sep 18, 2023 at 04:10:55PM +0300, Ilpo Järvinen wrote: > > pci_disable_link_state() lacks a symmetric pair. Some drivers want to > > disable ASPM during certain phases of their operation but then > &g

[PATCH v4 10/11] wifi: ath10k: Use RMW accessors for changing LNKCTL

2023-07-13 Thread Ilpo Järvinen
. Fixes: 76d870ed09ab ("ath10k: enable ASPM") Suggested-by: Lukas Wunner Signed-off-by: Ilpo Järvinen Reviewed-by: Simon Horman Acked-by: Kalle Valo Cc: sta...@vger.kernel.org --- drivers/net/wireless/ath/ath10k/pci.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-)

[PATCH v5 10/11] wifi: ath10k: Use RMW accessors for changing LNKCTL

2023-07-17 Thread Ilpo Järvinen
. Fixes: 76d870ed09ab ("ath10k: enable ASPM") Suggested-by: Lukas Wunner Signed-off-by: Ilpo Järvinen Reviewed-by: Simon Horman Acked-by: Kalle Valo Cc: sta...@vger.kernel.org --- drivers/net/wireless/ath/ath10k/pci.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-)

Re: [PATCH v2 9/9] wifi: ath10k: Use RMW accessors for changing LNKCTL

2023-05-26 Thread Ilpo Järvinen
On Thu, 25 May 2023, Ilpo Järvinen wrote: > On Wed, 24 May 2023, Bjorn Helgaas wrote: > > > On Wed, May 17, 2023 at 01:52:35PM +0300, Ilpo Järvinen wrote: > > > Don't assume that only the driver would be accessing LNKCTL. ASPM > > > policy changes can trigger write

[RFC PATCH v1 09/13] wifi: ath10k: Use pci_disable/enable_link_state()

2023-06-02 Thread Ilpo Järvinen
the ASPM state management. Signed-off-by: Ilpo Järvinen --- drivers/net/wireless/ath/ath10k/pci.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 9275a672f90c..ec2b17e73b0e 100644

Re: [PATCH v2 9/9] wifi: ath10k: Use RMW accessors for changing LNKCTL

2023-05-25 Thread Ilpo Järvinen
On Wed, 24 May 2023, Bjorn Helgaas wrote: > On Wed, May 17, 2023 at 01:52:35PM +0300, Ilpo Järvinen wrote: > > Don't assume that only the driver would be accessing LNKCTL. ASPM > > policy changes can trigger write to LNKCTL outside of driver's control. > > > > Use RMW

[PATCH v3 10/10] wifi: ath10k: Use RMW accessors for changing LNKCTL

2023-06-20 Thread Ilpo Järvinen
. Fixes: 76d870ed09ab ("ath10k: enable ASPM") Suggested-by: Lukas Wunner Signed-off-by: Ilpo Järvinen Acked-by: Kalle Valo Cc: sta...@vger.kernel.org --- drivers/net/wireless/ath/ath10k/pci.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wi

[PATCH 17/17] wifi: ath10k: Use pcie_lnkctl_clear_and_set() for changing LNKCTL

2023-05-11 Thread Ilpo Järvinen
PCI_EXP_LNKCTL_ASPMC field which the driver itself has been changing, leave the other fields untouched. Suggested-by: Lukas Wunner Signed-off-by: Ilpo Järvinen --- drivers/net/wireless/ath/ath10k/pci.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless

[PATCH v2 9/9] wifi: ath10k: Use RMW accessors for changing LNKCTL

2023-05-17 Thread Ilpo Järvinen
. Fixes: 76d870ed09ab ("ath10k: enable ASPM") Suggested-by: Lukas Wunner Signed-off-by: Ilpo Järvinen Cc: sta...@vger.kernel.org --- drivers/net/wireless/ath/ath10k/pci.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/d