File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -1663,6 +1663,7 @@ int pci_save_state(struct pci_dev *dev)
1663
1663
return i ;
1664
1664
1665
1665
pci_save_ltr_state (dev );
1666
+ pci_save_aspm_l1ss_state (dev );
1666
1667
pci_save_dpc_state (dev );
1667
1668
pci_save_aer_state (dev );
1668
1669
pci_save_ptm_state (dev );
@@ -1769,6 +1770,7 @@ void pci_restore_state(struct pci_dev *dev)
1769
1770
* LTR itself (in the PCIe capability).
1770
1771
*/
1771
1772
pci_restore_ltr_state (dev );
1773
+ pci_restore_aspm_l1ss_state (dev );
1772
1774
1773
1775
pci_restore_pcie_state (dev );
1774
1776
pci_restore_pasid_state (dev );
@@ -3485,6 +3487,11 @@ void pci_allocate_cap_save_buffers(struct pci_dev *dev)
3485
3487
if (error )
3486
3488
pci_err (dev , "unable to allocate suspend buffer for LTR\n" );
3487
3489
3490
+ error = pci_add_ext_cap_save_buffer (dev , PCI_EXT_CAP_ID_L1SS ,
3491
+ 2 * sizeof (u32 ));
3492
+ if (error )
3493
+ pci_err (dev , "unable to allocate suspend buffer for ASPM-L1SS\n" );
3494
+
3488
3495
pci_allocate_vc_save_buffers (dev );
3489
3496
}
3490
3497
Original file line number Diff line number Diff line change @@ -561,10 +561,14 @@ bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
561
561
void pcie_aspm_init_link_state (struct pci_dev * pdev );
562
562
void pcie_aspm_exit_link_state (struct pci_dev * pdev );
563
563
void pcie_aspm_powersave_config_link (struct pci_dev * pdev );
564
+ void pci_save_aspm_l1ss_state (struct pci_dev * dev );
565
+ void pci_restore_aspm_l1ss_state (struct pci_dev * dev );
564
566
#else
565
567
static inline void pcie_aspm_init_link_state (struct pci_dev * pdev ) { }
566
568
static inline void pcie_aspm_exit_link_state (struct pci_dev * pdev ) { }
567
569
static inline void pcie_aspm_powersave_config_link (struct pci_dev * pdev ) { }
570
+ static inline void pci_save_aspm_l1ss_state (struct pci_dev * dev ) { }
571
+ static inline void pci_restore_aspm_l1ss_state (struct pci_dev * dev ) { }
568
572
#endif
569
573
570
574
#ifdef CONFIG_PCIE_ECRC
Original file line number Diff line number Diff line change @@ -732,6 +732,43 @@ static void pcie_config_aspm_l1ss(struct pcie_link_state *link, u32 state)
732
732
PCI_L1SS_CTL1_L1SS_MASK , val );
733
733
}
734
734
735
+ void pci_save_aspm_l1ss_state (struct pci_dev * dev )
736
+ {
737
+ struct pci_cap_saved_state * save_state ;
738
+ u16 l1ss = dev -> l1ss ;
739
+ u32 * cap ;
740
+
741
+ if (!l1ss )
742
+ return ;
743
+
744
+ save_state = pci_find_saved_ext_cap (dev , PCI_EXT_CAP_ID_L1SS );
745
+ if (!save_state )
746
+ return ;
747
+
748
+ cap = (u32 * )& save_state -> cap .data [0 ];
749
+ pci_read_config_dword (dev , l1ss + PCI_L1SS_CTL2 , cap ++ );
750
+ pci_read_config_dword (dev , l1ss + PCI_L1SS_CTL1 , cap ++ );
751
+ }
752
+
753
+ void pci_restore_aspm_l1ss_state (struct pci_dev * dev )
754
+ {
755
+ struct pci_cap_saved_state * save_state ;
756
+ u32 * cap , ctl1 , ctl2 ;
757
+ u16 l1ss = dev -> l1ss ;
758
+
759
+ if (!l1ss )
760
+ return ;
761
+
762
+ save_state = pci_find_saved_ext_cap (dev , PCI_EXT_CAP_ID_L1SS );
763
+ if (!save_state )
764
+ return ;
765
+
766
+ cap = (u32 * )& save_state -> cap .data [0 ];
767
+ ctl2 = * cap ++ ;
768
+ ctl1 = * cap ;
769
+ aspm_program_l1ss (dev , ctl1 , ctl2 );
770
+ }
771
+
735
772
static void pcie_config_aspm_dev (struct pci_dev * pdev , u32 val )
736
773
{
737
774
pcie_capability_clear_and_set_word (pdev , PCI_EXP_LNKCTL ,
You can’t perform that action at this time.
0 commit comments