diff mbox series

[v6,4/5] PCI: Add PCIE_MSG_CODE_PME_TURN_OFF message macro

Message ID 20240415-pme_msg-v6-4-56dad968ad3a@nxp.com (mailing list archive)
State Superseded
Headers show
Series PCI: dwc: Add common pme_turn_off message by using outbound iATU | expand

Commit Message

Frank Li April 15, 2024, 7:33 p.m. UTC
Add PCIE_MSG_CODE_PME_TURN_OFF macros to enable a PCIe host driver to send
PME_Turn_Off messages.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/pci/pci.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bjorn Helgaas April 16, 2024, 5:02 p.m. UTC | #1
On Mon, Apr 15, 2024 at 03:33:28PM -0400, Frank Li wrote:
> Add PCIE_MSG_CODE_PME_TURN_OFF macros to enable a PCIe host driver to send
> PME_Turn_Off messages.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  drivers/pci/pci.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 19b4227a8a7e8..1f6d54a5a7cfc 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -30,6 +30,8 @@
>  #define PCIE_MSG_TYPE_R_LOCAL	4
>  #define PCIE_MSG_TYPE_R_GATHER	5
>  
> +#define PCIE_MSG_CODE_PME_TURN_OFF	0x19

This is defined in PCIe r6.0, sec 2.2.8.2, so move this below the INTx
#defines so they're all in the order of the spec sections and add the
spec citation to follow the same style as the surrounding #defines,
i.e.,

  /* Power Management Messages; PCIe r6.0, sec 2.2.8.2 */
  #define PCIE_MSG_CODE_PME_TURN_OFF   0x19

While you're at it, tweak the [1/5] comments to be:

  /* Message Routing (r[2:0]); PCIe r6.0, sec 2.2.8 */
  /* INTx Mechanism Messages; PCIe r6.0, sec 2.2.8.1 */

since the "Message Routing See: PCIe ..." comments are run together
and need some punctuation between the text and the citation.

With these,

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

>  /* INTx Mechanism Messages See: PCIe r6.0, sec 2.2.8.1 */
>  #define PCIE_MSG_CODE_ASSERT_INTA	0x20
>  #define PCIE_MSG_CODE_ASSERT_INTB	0x21
> 
> -- 
> 2.34.1
>
Manivannan Sadhasivam April 17, 2024, 7:56 a.m. UTC | #2
On Tue, Apr 16, 2024 at 12:02:42PM -0500, Bjorn Helgaas wrote:
> On Mon, Apr 15, 2024 at 03:33:28PM -0400, Frank Li wrote:
> > Add PCIE_MSG_CODE_PME_TURN_OFF macros to enable a PCIe host driver to send
> > PME_Turn_Off messages.
> > 
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> >  drivers/pci/pci.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> > index 19b4227a8a7e8..1f6d54a5a7cfc 100644
> > --- a/drivers/pci/pci.h
> > +++ b/drivers/pci/pci.h
> > @@ -30,6 +30,8 @@
> >  #define PCIE_MSG_TYPE_R_LOCAL	4
> >  #define PCIE_MSG_TYPE_R_GATHER	5
> >  
> > +#define PCIE_MSG_CODE_PME_TURN_OFF	0x19
> 
> This is defined in PCIe r6.0, sec 2.2.8.2, so move this below the INTx
> #defines so they're all in the order of the spec sections and add the

I think it was me who suggested moving this up to keep it sorted in ascending
order :/

- Mani

> spec citation to follow the same style as the surrounding #defines,
> i.e.,
> 
>   /* Power Management Messages; PCIe r6.0, sec 2.2.8.2 */
>   #define PCIE_MSG_CODE_PME_TURN_OFF   0x19
> 
> While you're at it, tweak the [1/5] comments to be:
> 
>   /* Message Routing (r[2:0]); PCIe r6.0, sec 2.2.8 */
>   /* INTx Mechanism Messages; PCIe r6.0, sec 2.2.8.1 */
> 
> since the "Message Routing See: PCIe ..." comments are run together
> and need some punctuation between the text and the citation.
> 
> With these,
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> >  /* INTx Mechanism Messages See: PCIe r6.0, sec 2.2.8.1 */
> >  #define PCIE_MSG_CODE_ASSERT_INTA	0x20
> >  #define PCIE_MSG_CODE_ASSERT_INTB	0x21
> > 
> > -- 
> > 2.34.1
> >
Bjorn Helgaas April 17, 2024, 11:14 a.m. UTC | #3
On Wed, Apr 17, 2024 at 01:26:55PM +0530, Manivannan Sadhasivam wrote:
> On Tue, Apr 16, 2024 at 12:02:42PM -0500, Bjorn Helgaas wrote:
> > On Mon, Apr 15, 2024 at 03:33:28PM -0400, Frank Li wrote:
> > > Add PCIE_MSG_CODE_PME_TURN_OFF macros to enable a PCIe host driver to send
> > > PME_Turn_Off messages.
> > > 
> > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > ---
> > >  drivers/pci/pci.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> > > index 19b4227a8a7e8..1f6d54a5a7cfc 100644
> > > --- a/drivers/pci/pci.h
> > > +++ b/drivers/pci/pci.h
> > > @@ -30,6 +30,8 @@
> > >  #define PCIE_MSG_TYPE_R_LOCAL	4
> > >  #define PCIE_MSG_TYPE_R_GATHER	5
> > >  
> > > +#define PCIE_MSG_CODE_PME_TURN_OFF	0x19
> > 
> > This is defined in PCIe r6.0, sec 2.2.8.2, so move this below the INTx
> > #defines so they're all in the order of the spec sections and add the
> 
> I think it was me who suggested moving this up to keep it sorted in ascending
> order :/

OK, the order you suggested is fine.

> > spec citation to follow the same style as the surrounding #defines,
> > i.e.,
> > 
> >   /* Power Management Messages; PCIe r6.0, sec 2.2.8.2 */
> >   #define PCIE_MSG_CODE_PME_TURN_OFF   0x19
> > 
> > While you're at it, tweak the [1/5] comments to be:
> > 
> >   /* Message Routing (r[2:0]); PCIe r6.0, sec 2.2.8 */
> >   /* INTx Mechanism Messages; PCIe r6.0, sec 2.2.8.1 */
> > 
> > since the "Message Routing See: PCIe ..." comments are run together
> > and need some punctuation between the text and the citation.

But please do add and tweak the comments.

> > With these,
> > 
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Still fine to add this :)

> > >  /* INTx Mechanism Messages See: PCIe r6.0, sec 2.2.8.1 */
> > >  #define PCIE_MSG_CODE_ASSERT_INTA	0x20
> > >  #define PCIE_MSG_CODE_ASSERT_INTB	0x21
> > > 
> > > -- 
> > > 2.34.1
> > > 
> 
> -- 
> மணிவண்ணன் சதாசிவம்
diff mbox series

Patch

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 19b4227a8a7e8..1f6d54a5a7cfc 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -30,6 +30,8 @@ 
 #define PCIE_MSG_TYPE_R_LOCAL	4
 #define PCIE_MSG_TYPE_R_GATHER	5
 
+#define PCIE_MSG_CODE_PME_TURN_OFF	0x19
+
 /* INTx Mechanism Messages See: PCIe r6.0, sec 2.2.8.1 */
 #define PCIE_MSG_CODE_ASSERT_INTA	0x20
 #define PCIE_MSG_CODE_ASSERT_INTB	0x21