[v4,0/5] PCI: dwc: Add common pme_turn_off message by using outbound iATU

Message ID 20240213-pme_msg-v4-0-e2acd4d7a292@nxp.com
Headers
Series PCI: dwc: Add common pme_turn_off message by using outbound iATU |

Message

Frank Li Feb. 13, 2024, 9:50 p.m. UTC
  Involve an new and common mathod to send pme_turn_off() message. Previously
pme_turn_off() implement by platform related special register to trigge    
it.                                                                        
                                                                           
But Yoshihiro give good idea by using iATU to send out message. Previously 
Yoshihiro provide patches to raise INTx message by dummy write to outbound 
iATU.                                                                      
                                                                           
Use similar mathod to send out pme_turn_off message.                       
                                                                           
Previous two patches is picked from Yoshihiro' big patch serialise.        
 PCI: dwc: Change arguments of dw_pcie_prog_outbound_atu()                 
 PCI: Add INTx Mechanism Messages macros                                   
                                                                           
PCI: Add PME_TURN_OFF message macro                                        
dt-bindings: PCI: dwc: Add 'msg" register region, Add "msg" region to use  
to map PCI msg.                                                            
                                                                           
PCI: dwc: Add common pme_turn_off message method                           
Using common pme_turn_off() message if platform have not define their.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Changes in v4:
- Remove dt-binding patch. Needn't change any dts file and binding doc.
  Reserve a region at end of first IORESOURCE_MEM window by call
  request_resource(). So PCIe stack will not use this reserve region to any
PCIe devices.
  I tested it by reserve at begin of IORESOURCE_MEM window. PCIe stack
will skip it as expection.

  Fixed a issue, forget set iATU index when sent PME_turn_off.

- Link to v3: https://lore.kernel.org/r/20240202-pme_msg-v3-0-ff2af57a02ad@nxp.com

Changes in v3:
- fix 'MSG"
- Add pcie spec ref in head file
- using function name dw_pci_pme_turn_off()
- Using PCIE_ prefix macro
- Link to v2: https://lore.kernel.org/r/20240201-pme_msg-v2-0-6767052fe6a4@nxp.com

Changes in v2:
  - Add my sign off at PCI: dwc: Add outbound MSG TLPs support
  - Add Bjorn review tag at  Add INTx Mechanism Messages macros
  - using PME_Turn_Off match PCIe spec
  - ref to pcie spec v6.1
  - using section number.

- Link to v1: https://lore.kernel.org/r/20240130-pme_msg-v1-0-d52b0add5c7c@nxp.com

---
Frank Li (2):
      PCI: Add PCIE_MSG_CODE_PME_TURN_OFF message macro
      PCI: dwc: Add common send PME_Turn_Off message method

Yoshihiro Shimoda (3):
      PCI: Add INTx Mechanism Messages macros
      PCI: dwc: Consolidate args of dw_pcie_prog_outbound_atu() into a structure
      PCI: dwc: Add outbound MSG TLPs support

 drivers/pci/controller/dwc/pcie-designware-ep.c   |  21 ++--
 drivers/pci/controller/dwc/pcie-designware-host.c | 145 +++++++++++++++++++---
 drivers/pci/controller/dwc/pcie-designware.c      |  54 ++++----
 drivers/pci/controller/dwc/pcie-designware.h      |  21 +++-
 drivers/pci/pci.h                                 |  20 +++
 5 files changed, 197 insertions(+), 64 deletions(-)
---
base-commit: e08fc59eee9991afa467d406d684d46d543299a9
change-id: 20240130-pme_msg-dd2d81ee9886

Best regards,
  

Comments

Frank Li Feb. 19, 2024, 3:16 p.m. UTC | #1
On Tue, Feb 13, 2024 at 04:50:21PM -0500, Frank Li wrote:
> Involve an new and common mathod to send pme_turn_off() message. Previously
> pme_turn_off() implement by platform related special register to trigge    
> it.                                                                        

@mani:

	Do you have chance look this patches. Actually other patches
already reviewed. Only missed

	PCI: dwc: Add common send PME_Turn_Off message method
	PCI: Add PCIE_MSG_CODE_PME_TURN_OFF message macro

	This patch will reduce customer's PME_Turn_off method. Many code
can be cleaned after this.

Frank Li

>                                                                            
> But Yoshihiro give good idea by using iATU to send out message. Previously 
> Yoshihiro provide patches to raise INTx message by dummy write to outbound 
> iATU.                                                                      
>                                                                            
> Use similar mathod to send out pme_turn_off message.                       
>                                                                            
> Previous two patches is picked from Yoshihiro' big patch serialise.        
>  PCI: dwc: Change arguments of dw_pcie_prog_outbound_atu()                 
>  PCI: Add INTx Mechanism Messages macros                                   
>                                                                            
> PCI: Add PME_TURN_OFF message macro                                        
> dt-bindings: PCI: dwc: Add 'msg" register region, Add "msg" region to use  
> to map PCI msg.                                                            
>                                                                            
> PCI: dwc: Add common pme_turn_off message method                           
> Using common pme_turn_off() message if platform have not define their.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Changes in v4:
> - Remove dt-binding patch. Needn't change any dts file and binding doc.
>   Reserve a region at end of first IORESOURCE_MEM window by call
>   request_resource(). So PCIe stack will not use this reserve region to any
> PCIe devices.
>   I tested it by reserve at begin of IORESOURCE_MEM window. PCIe stack
> will skip it as expection.
> 
>   Fixed a issue, forget set iATU index when sent PME_turn_off.
> 
> - Link to v3: https://lore.kernel.org/r/20240202-pme_msg-v3-0-ff2af57a02ad@nxp.com
> 
> Changes in v3:
> - fix 'MSG"
> - Add pcie spec ref in head file
> - using function name dw_pci_pme_turn_off()
> - Using PCIE_ prefix macro
> - Link to v2: https://lore.kernel.org/r/20240201-pme_msg-v2-0-6767052fe6a4@nxp.com
> 
> Changes in v2:
>   - Add my sign off at PCI: dwc: Add outbound MSG TLPs support
>   - Add Bjorn review tag at  Add INTx Mechanism Messages macros
>   - using PME_Turn_Off match PCIe spec
>   - ref to pcie spec v6.1
>   - using section number.
> 
> - Link to v1: https://lore.kernel.org/r/20240130-pme_msg-v1-0-d52b0add5c7c@nxp.com
> 
> ---
> Frank Li (2):
>       PCI: Add PCIE_MSG_CODE_PME_TURN_OFF message macro
>       PCI: dwc: Add common send PME_Turn_Off message method
> 
> Yoshihiro Shimoda (3):
>       PCI: Add INTx Mechanism Messages macros
>       PCI: dwc: Consolidate args of dw_pcie_prog_outbound_atu() into a structure
>       PCI: dwc: Add outbound MSG TLPs support
> 
>  drivers/pci/controller/dwc/pcie-designware-ep.c   |  21 ++--
>  drivers/pci/controller/dwc/pcie-designware-host.c | 145 +++++++++++++++++++---
>  drivers/pci/controller/dwc/pcie-designware.c      |  54 ++++----
>  drivers/pci/controller/dwc/pcie-designware.h      |  21 +++-
>  drivers/pci/pci.h                                 |  20 +++
>  5 files changed, 197 insertions(+), 64 deletions(-)
> ---
> base-commit: e08fc59eee9991afa467d406d684d46d543299a9
> change-id: 20240130-pme_msg-dd2d81ee9886
> 
> Best regards,
> -- 
> Frank Li <Frank.Li@nxp.com>
>
  
Frank Li Feb. 26, 2024, 5:24 p.m. UTC | #2
On Mon, Feb 19, 2024 at 10:16:20AM -0500, Frank Li wrote:
> On Tue, Feb 13, 2024 at 04:50:21PM -0500, Frank Li wrote:
> > Involve an new and common mathod to send pme_turn_off() message. Previously
> > pme_turn_off() implement by platform related special register to trigge    
> > it.                                                                        
> 
> @mani:l
> 
> 	Do you have chance look this patches. Actually other patches
> already reviewed. Only missed
> 
> 	PCI: dwc: Add common send PME_Turn_Off message method
> 	PCI: Add PCIE_MSG_CODE_PME_TURN_OFF message macro
> 
> 	This patch will reduce customer's PME_Turn_off method. Many code
> can be cleaned after this.

@mani and @lpieralisi

	Do you have chance to look these?

Frank

> 
> Frank Li
> 
> >                                                                            
> > But Yoshihiro give good idea by using iATU to send out message. Previously 
> > Yoshihiro provide patches to raise INTx message by dummy write to outbound 
> > iATU.                                                                      
> >                                                                            
> > Use similar mathod to send out pme_turn_off message.                       
> >                                                                            
> > Previous two patches is picked from Yoshihiro' big patch serialise.        
> >  PCI: dwc: Change arguments of dw_pcie_prog_outbound_atu()                 
> >  PCI: Add INTx Mechanism Messages macros                                   
> >                                                                            
> > PCI: Add PME_TURN_OFF message macro                                        
> > dt-bindings: PCI: dwc: Add 'msg" register region, Add "msg" region to use  
> > to map PCI msg.                                                            
> >                                                                            
> > PCI: dwc: Add common pme_turn_off message method                           
> > Using common pme_turn_off() message if platform have not define their.
> > 
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > Changes in v4:
> > - Remove dt-binding patch. Needn't change any dts file and binding doc.
> >   Reserve a region at end of first IORESOURCE_MEM window by call
> >   request_resource(). So PCIe stack will not use this reserve region to any
> > PCIe devices.
> >   I tested it by reserve at begin of IORESOURCE_MEM window. PCIe stack
> > will skip it as expection.
> > 
> >   Fixed a issue, forget set iATU index when sent PME_turn_off.
> > 
> > - Link to v3: https://lore.kernel.org/r/20240202-pme_msg-v3-0-ff2af57a02ad@nxp.com
> > 
> > Changes in v3:
> > - fix 'MSG"
> > - Add pcie spec ref in head file
> > - using function name dw_pci_pme_turn_off()
> > - Using PCIE_ prefix macro
> > - Link to v2: https://lore.kernel.org/r/20240201-pme_msg-v2-0-6767052fe6a4@nxp.com
> > 
> > Changes in v2:
> >   - Add my sign off at PCI: dwc: Add outbound MSG TLPs support
> >   - Add Bjorn review tag at  Add INTx Mechanism Messages macros
> >   - using PME_Turn_Off match PCIe spec
> >   - ref to pcie spec v6.1
> >   - using section number.
> > 
> > - Link to v1: https://lore.kernel.org/r/20240130-pme_msg-v1-0-d52b0add5c7c@nxp.com
> > 
> > ---
> > Frank Li (2):
> >       PCI: Add PCIE_MSG_CODE_PME_TURN_OFF message macro
> >       PCI: dwc: Add common send PME_Turn_Off message method
> > 
> > Yoshihiro Shimoda (3):
> >       PCI: Add INTx Mechanism Messages macros
> >       PCI: dwc: Consolidate args of dw_pcie_prog_outbound_atu() into a structure
> >       PCI: dwc: Add outbound MSG TLPs support
> > 
> >  drivers/pci/controller/dwc/pcie-designware-ep.c   |  21 ++--
> >  drivers/pci/controller/dwc/pcie-designware-host.c | 145 +++++++++++++++++++---
> >  drivers/pci/controller/dwc/pcie-designware.c      |  54 ++++----
> >  drivers/pci/controller/dwc/pcie-designware.h      |  21 +++-
> >  drivers/pci/pci.h                                 |  20 +++
> >  5 files changed, 197 insertions(+), 64 deletions(-)
> > ---
> > base-commit: e08fc59eee9991afa467d406d684d46d543299a9
> > change-id: 20240130-pme_msg-dd2d81ee9886
> > 
> > Best regards,
> > -- 
> > Frank Li <Frank.Li@nxp.com>
> >